Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
152 changed files
with
9,589 additions
and
7,180 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# CMAKE project for openrct2-cli (CLI-only build of OpenRCT2) | ||
cmake_minimum_required(VERSION 2.6) | ||
if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR) | ||
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt") | ||
endif () | ||
|
||
# CMake dependencies | ||
include(FindPkgConfig) | ||
|
||
# Third party libraries (which we want to eventually remove from openrct2-cli) | ||
PKG_CHECK_MODULES(SDL2 REQUIRED sdl2) | ||
|
||
# Sources | ||
file(GLOB_RECURSE OPENRCT2_CLI_SOURCES | ||
"${CMAKE_CURRENT_LIST_DIR}/*.c" | ||
"${CMAKE_CURRENT_LIST_DIR}/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/*.h" | ||
"${CMAKE_CURRENT_LIST_DIR}/*.hpp") | ||
|
||
# Outputs | ||
set (PROJECT openrct2) | ||
project(${PROJECT}) | ||
add_executable(${PROJECT} ${OPENRCT2_CLI_SOURCES}) | ||
|
||
target_link_libraries(${PROJECT} "libopenrct2") | ||
|
||
# Includes | ||
target_include_directories(${PROJECT} PRIVATE "${CMAKE_CURRENT_LIST_DIR}/.." | ||
${SDL2_INCLUDE_DIRS}) | ||
|
||
# Compiler flags | ||
if (FORCE32) | ||
set(TARGET_M "-m32") | ||
endif () | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 ${TARGET_M}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 ${TARGET_M}") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TARGET_M}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers | ||
/***************************************************************************** | ||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2. | ||
* | ||
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md | ||
* For more information, visit https://github.com/OpenRCT2/OpenRCT2 | ||
* | ||
* OpenRCT2 is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* A full copy of the GNU General Public License can be found in licence.txt | ||
*****************************************************************************/ | ||
#pragma endregion | ||
|
||
#include <openrct2/Context.h> | ||
|
||
using namespace OpenRCT2; | ||
|
||
/** | ||
* Main entry point for non-Windows sytems. Windows instead uses its own DLL proxy. | ||
*/ | ||
int main(int argc, char * * argv) | ||
{ | ||
IContext * context = CreateContext(); | ||
int exitCode = context->RunOpenRCT2(argc, argv); | ||
delete context; | ||
return exitCode; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<SolutionDir Condition="'$(SolutionDir)'==''">..\..\</SolutionDir> | ||
</PropertyGroup> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Debug|Win32"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Debug|x64"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|Win32"> | ||
<Configuration>Release</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|x64"> | ||
<Configuration>Release</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>{B6808F71-30B4-4499-8FF6-0B1C86391842}</ProjectGuid> | ||
<RootNamespace>openrct2-cli</RootNamespace> | ||
<ProjectName>openrct2-cli</ProjectName> | ||
</PropertyGroup> | ||
<PropertyGroup Label="Configuration"> | ||
<ConfigurationType>Application</ConfigurationType> | ||
</PropertyGroup> | ||
<Import Project="..\..\openrct2.common.props" /> | ||
<PropertyGroup> | ||
<TargetName>openrct2-cli</TargetName> | ||
<LibraryPath>$(SolutionDir)bin;$(LibraryPath)</LibraryPath> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup> | ||
<ClCompile> | ||
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName> | ||
<AdditionalOptions>$(OPENRCT2_CL_ADDITIONALOPTIONS) %(AdditionalOptions)</AdditionalOptions> | ||
</ClCompile> | ||
<Link> | ||
<AdditionalDependencies>libopenrct2.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
<ProgramDatabaseFile>$(OutDir)openrct2-cli.pdb</ProgramDatabaseFile> | ||
<SubSystem>Console</SubSystem> | ||
</Link> | ||
<Lib> | ||
<TargetMachine Condition="'$(Platform)'=='Win32'">MachineX86</TargetMachine> | ||
<TargetMachine Condition="'$(Platform)'=='x64'">MachineX64</TargetMachine> | ||
</Lib> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<ResourceCompile Include="..\..\resources\OpenRCT2.rc" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="Cli.cpp" /> | ||
</ItemGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# CMAKE project for openrct2-cli (UI build of OpenRCT2) | ||
cmake_minimum_required(VERSION 2.6) | ||
if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR) | ||
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt") | ||
endif () | ||
|
||
# Options | ||
option(DISABLE_OPENGL "Disable OpenGL support.") | ||
|
||
# CMake dependencies | ||
include(FindPkgConfig) | ||
|
||
# Third party libraries | ||
PKG_CHECK_MODULES(GL REQUIRED gl) | ||
PKG_CHECK_MODULES(SDL2 REQUIRED sdl2) | ||
if (NOT DISABLE_OPENGL) | ||
# GL doesn't work nicely with macOS, while find_package doesn't work with multiarch on Ubuntu. | ||
if (APPLE) | ||
find_package(OpenGL REQUIRED) | ||
elseif (NOT WIN32) | ||
PKG_CHECK_MODULES(GL REQUIRED gl) | ||
endif () | ||
endif () | ||
|
||
# Sources | ||
file(GLOB_RECURSE OPENRCT2_UI_SOURCES | ||
"${CMAKE_CURRENT_LIST_DIR}/*.c" | ||
"${CMAKE_CURRENT_LIST_DIR}/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/*.h" | ||
"${CMAKE_CURRENT_LIST_DIR}/*.hpp") | ||
|
||
# Outputs | ||
set (PROJECT openrct2) | ||
project(${PROJECT}) | ||
add_executable(${PROJECT} ${OPENRCT2_UI_SOURCES}) | ||
|
||
target_link_libraries(${PROJECT} "libopenrct2" | ||
${SDL2_LIBRARIES} | ||
${SDL2_TTF_LIBRARIES}) | ||
|
||
if (NOT DISABLE_OPENGL) | ||
if (WIN32) | ||
target_link_libraries(${PROJECT} opengl32) | ||
elseif (APPLE) | ||
target_link_libraries(${PROJECT} ${OPENGL_LIBRARY}) | ||
else () | ||
target_link_libraries(${PROJECT} ${GL_LIBRARIES}) | ||
endif () | ||
endif () | ||
|
||
# Includes | ||
target_include_directories(${PROJECT} PRIVATE "${CMAKE_CURRENT_LIST_DIR}/.." | ||
${SDL2_INCLUDE_DIRS}) | ||
|
||
# Compiler flags | ||
if (FORCE32) | ||
set(TARGET_M "-m32") | ||
endif () | ||
if (WIN32) | ||
# mingw complains about "%zu" not being a valid format specifier for printf, unless we | ||
# tell it that it is | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__USE_MINGW_ANSI_STDIO=1") | ||
endif () | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 ${TARGET_M}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 ${TARGET_M}") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TARGET_M}") | ||
|
||
# Defines | ||
if (DISABLE_OPENGL) | ||
add_definitions(-DDISABLE_OPENGL) | ||
else () | ||
# Makes OpenGL function get queried in run-time rather than linked-in | ||
add_definitions(-DOPENGL_NO_LINK) | ||
endif () |
Oops, something went wrong.