Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ option(OPENTS_EXPERIMENTAL_CLANG_CL "Build with clang-cl using the MSVC ABI" OFF
option(OPENTS_EXPERIMENTAL_X64 "Configure an unsupported 64-bit Windows build" OFF)
option(OPENTS_EXPERIMENTAL_NATIVE "Configure a native build for the host platform" OFF)

# Lets a target's FOLDER place it in a Visual Studio solution folder. The bgfx submodule sets
# this as well, so declare it here rather than inherit it from a vendored build.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)


if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
if(NOT OPENTS_EXPERIMENTAL_CLANG_CL)
Expand Down Expand Up @@ -59,6 +64,17 @@ else()
"-DOPENTS_EXPERIMENTAL_NATIVE=ON.")
endif()

# Only MSVC names the target architecture in a compiler variable, so the native and
# cross builds fall back on the system they are configured for.
string(TOLOWER "${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" OPENTS_ARCH)
if(NOT OPENTS_ARCH)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" OPENTS_ARCH)
endif()
if(NOT OPENTS_ARCH)
set(OPENTS_ARCH "unknown")
endif()

# Only Windows carries resource scripts, and no other toolchain supplies a compiler for them.
if(WIN32)
enable_language(RC)
endif()
Expand Down Expand Up @@ -91,6 +107,7 @@ set(OPENTS_STAMP_ARGS
"-DOPENTS_SOURCE_DIR=${CMAKE_SOURCE_DIR}"
"-DOPENTS_VERSION_HEADER=${OPENTS_VERSION_HEADER}"
"-DOPENTS_STAMP_HEADER=${OPENTS_STAMP_HEADER}"
"-DOPENTS_ARCH=${OPENTS_ARCH}"
-P "${CMAKE_SOURCE_DIR}/cmake/GitStamp.cmake"
)

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ endorsed by Electronic Arts.
2. Extract the release zip into the Tiberian Sun game directory.
3. Run `Game.exe`.

OpenTS supports Windows 10 version 1903 (build 18362) and newer. Earlier
Windows versions are untested and unsupported. Wine may work, but there is no
supported native Linux build.

OpenTS supplies the engine, not the game data: the installation above
provides the original assets. There is no installer, and no extra runtime
library or launch argument is required. Windows is supported; Wine may work,
but there is no supported native Linux build. The engine asks Windows for the
UTF-8 code page, which needs Windows 10 version 1903 or newer. Older Windows
keeps its own code page, so game text still shows, but a path or file name
holding a character that code page lacks may fail.
library or launch argument is required.

## Running on macOS

Expand Down
10 changes: 6 additions & 4 deletions cmake/GitStamp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ set(VERSION_CONTENT
#else
#define OPENTS_RC_PRERELEASE_FLAG 0x0L
#endif

#define OPENTS_ARCH \"${OPENTS_ARCH}\"
")

set(OPENTS_COMMIT "unknown")
Expand Down Expand Up @@ -173,13 +175,13 @@ if(OPENTS_COMMIT_DIRTY)
endif()

if(OPENTS_OFFICIAL_BUILD)
set(OPENTS_VERSION_DISPLAY "${OPENTS_VERSION}")
set(OPENTS_VERSION_DISPLAY "${OPENTS_VERSION} (${OPENTS_ARCH})")
elseif(OPENTS_COMMIT STREQUAL "unknown")
set(OPENTS_VERSION_DISPLAY "${OPENTS_VERSION}")
set(OPENTS_VERSION_DISPLAY "${OPENTS_VERSION} (${OPENTS_ARCH})")
elseif(OPENTS_COMMIT_DIRTY)
set(OPENTS_VERSION_DISPLAY "${OPENTS_VERSION} (${OPENTS_COMMIT}, modified)")
set(OPENTS_VERSION_DISPLAY "${OPENTS_VERSION} (${OPENTS_COMMIT}, modified, ${OPENTS_ARCH})")
else()
set(OPENTS_VERSION_DISPLAY "${OPENTS_VERSION} (${OPENTS_COMMIT})")
set(OPENTS_VERSION_DISPLAY "${OPENTS_VERSION} (${OPENTS_COMMIT}, ${OPENTS_ARCH})")
endif()

set(STAMP_CONTENT
Expand Down
2 changes: 1 addition & 1 deletion code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ if(WIN32)
winmm
ws2_32
kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32
ole32 oleaut32 uuid odbc32 odbccp32
odbc32 odbccp32
)
endif()

Expand Down
7 changes: 7 additions & 0 deletions code/_astar.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@

class AStarClass;

/*
* The most cells a path may run to. A buffer handed to Find_Path holds one more, because a
* finished path of length L is padded out to entry L.
*/
inline constexpr int PATH_LENGTH_MAX = 2000;


/**************************************************************************
** Find_Path returns with a pointer to this structure.
*/
Expand Down
4 changes: 3 additions & 1 deletion code/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

#include "addon.h"

#include "_deploymentconfig.h"
#include "ccfile.h"
#include "data.h"
#include "deploymentconfig.h"
#include "init.h"
#include "language/language.h"
#include "ui/uigametype.h"
Expand Down Expand Up @@ -82,7 +84,7 @@ void Detect_Addons(void)
AvailableAddOns = (1 << ADDON_BASE_GAME);
ActiveAddOns = (1 << ADDON_BASE_GAME);

if (CCFileClass("FIRESTRM.INI").Is_Available() == true) {
if (CCFileClass(DeploymentConfig.RulesExpansionFile.c_str()).Is_Available() == true) {
AvailableAddOns |= (1 << ADDON_FIRESTORM);
}
}
Expand Down
3 changes: 3 additions & 0 deletions code/animfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class AnimFile : public Animate
unsigned short framesPerSecond; /// Number of frames to play per second.
unsigned short pad2[29]; /// 58 bytes of filler to round up to 128 bytes total.
};
static_assert(sizeof(LPFHeader) == 128, "the LPF header is 128 bytes on disk");

struct LPDescriptor {
unsigned short baseRecord; /// Number of first record in this large page.
Expand All @@ -116,6 +117,7 @@ class AnimFile : public Animate
/// bit 14 of "nRecords" == "final record continues on next lp".
unsigned short nBytes; /// Total number of bytes of contents, excluding header.
};
static_assert(sizeof(LPDescriptor) == 6, "a large page descriptor is 6 bytes on disk");

/*
* Structure of a single Large Page in an anim file.
Expand All @@ -134,6 +136,7 @@ class AnimFile : public Animate
unsigned short RecordSizes[1]; /// [nRecords] Array of lengths of each record in the large page.

};
static_assert(sizeof(LPStruct) == 10, "a large page header is 8 bytes on disk, and the struct carries the first of the record sizes that follow it");

/*
* These are the color cycling ranges Deluxe Paint stores after the header, each
Expand Down
Loading