Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
fix(tests): link the posix file system tests without the logic thread
Olcay Seygan51d4545d029b
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 089b49129..dbd5ce905 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -236,7 +236,7 @@ found and fixed, EA's own, not port damage.**- A German, French or other non-English Zero Hour on a Mac or Linux speaks its own language. Windows' installer writes the language into the registry, and nothing does that on a Mac or Linux, so the game took English and found it in the original Generals' files beside Zero Hour: the menus came up in Generals' English with Zero Hour's own lines missing, so it looked like plain Generals. With no language set it now takes the one your Zero Hour's own files are in. A language you set yourself still wins.- Text on the Linux menus is as wide as on Windows. Linux has no Arial, and the font standing in for it reports a wider average letter, so every menu font the game sets to a fixed width came out a quarter narrower than it should, the "Generals" lettering and the menu buttons among them. Each is measured against Arial's own figure now, and lands within one percent of Windows.- The game no longer crashes on some Linux PCs as its window opens. The game hands out memory its own way, and on Linux the graphics driver gets its memory from the game too. Some drivers, AMD's on Debian 12 among them, need every piece lined up on a 16-byte boundary, and the game's lined up on 4, so the start died or went through depending on where the pieces happened to fall. On Linux everything outside the game's own pools now comes from the system, which lines it up as the driver expects.-- `./build-linux.sh` stopped on Linux Mint and Arch after the centred Classic interface went in: the new code compared layout names with a Windows-only spelling that GCC on Linux has never heard of. It uses the name every platform knows now, and so do the two debug-build spots with the same habit. From 3.0.0 on, `./build-macos.sh` and `./build-linux.sh` stopped again, on another Windows-only spelling in the mod code and, on Linux, a file name written in the wrong case, which Windows does not mind. The log blamed the audio library because it was the last file the build had started; the real error sat higher up. Both are fixed, after Andreas Berger found them.+- `./build-linux.sh` stopped on Linux Mint and Arch after the centred Classic interface went in: the new code compared layout names with a Windows-only spelling that GCC on Linux has never heard of. It uses the name every platform knows now, and so do the two debug-build spots with the same habit. From 3.0.0 on, `./build-macos.sh` and `./build-linux.sh` stopped again, on another Windows-only spelling in the mod code and, on Linux, a file name written in the wrong case, which Windows does not mind. The log blamed the audio library because it was the last file the build had started; the real error sat higher up. Both are fixed, after Andreas Berger found them. On 3.2.0 `./build-macos.sh` got nearly to the end and stopped on four of the build's own tests of how the game reads its files, which were missing two pieces the game's job scheduler picked up in that version. They have them now, after Martin K. reported it.- Windows on Arm laptops, the Snapdragon ones, get a build made for them. Microsoft never shipped those machines the library the game loads its textures and shaders through, so the game brings its own, the texture code the Mac and Linux versions already run. Switched on in place of Microsoft's library on an ordinary Windows PC, it draws the same battlefields, with no tree, house or patch of ground going missing. Nobody has played it on a Snapdragon laptop yet.- The Linux game has Generals' icon. The window carries it in the taskbar and in the window switcher, and `add-to-menu.sh` in the folder `./build-linux.sh` makes puts the game in the desktop's app menu with it, which is where GNOME takes a running game's icon from. It had none.- Thanks to ilyasakin, whose port this is.diff --git a/GeneralsMD/Code/Tests/test_bigfilesystem_stubs.cpp b/GeneralsMD/Code/Tests/test_bigfilesystem_stubs.cppindex 4a0a9113d..16ffbc9e7 100644--- a/GeneralsMD/Code/Tests/test_bigfilesystem_stubs.cpp+++ b/GeneralsMD/Code/Tests/test_bigfilesystem_stubs.cpp@@ -24,6 +24,9 @@** - DebugInit, DebugLog: Debug.cpp does not compile off Windows yet. DebugLog prints, so a* DEBUG_LOG from the memory manager is not lost.+ * - ReleaseCrash: the memory manager stops on a corrupt block header; here that aborts.+ * - LogicThread's census: JobSystem::parallel_for counts itself when it runs on the logic thread,+ * and nothing here is one, so the flag stays FALSE and the count is never taken.* - INI: SubsystemInterfaceList::initSubsystem loads INI files; nothing here initialises a* subsystem through it.* - TheFileSystem, FileSystem::openFile: RAMFile::open(const char*) opens through the whole file@@ -38,6 +41,7 @@#include "Common/GameAudio.h"#include "Common/GlobalData.h"#include "Common/INI.h"+#include "Common/LogicThread.h"extern "C" void DebugInit(int){@@ -52,12 +56,21 @@ extern "C" void DebugLog(const char *format, ...)va_end(args);}+extern "C" void ReleaseCrash(const char *reason)+{+ fprintf(stderr, "test_bigfilesystem: ReleaseCrash: %s\n", reason);+ abort();+}+static void unreachable(const char *what){fprintf(stderr, "test_posixlocalfilesystem: %s was reached, and this test has no stand-in for it\n", what);abort();}+thread_local Bool LogicThread::t_isLogicThread = FALSE;+void LogicThread::noteCensus(Channel) { unreachable("LogicThread::noteCensus"); }+INI::INI() { unreachable("INI::INI"); }INI::~INI() {}void INI::loadDirectory(AsciiString, Bool, INILoadType, Xfer *) { unreachable("INI::loadDirectory"); }diff --git a/GeneralsMD/Code/Tests/test_posixlocalfilesystem_stubs.cpp b/GeneralsMD/Code/Tests/test_posixlocalfilesystem_stubs.cppindex b311f64e7..76a6b823d 100644--- a/GeneralsMD/Code/Tests/test_posixlocalfilesystem_stubs.cpp+++ b/GeneralsMD/Code/Tests/test_posixlocalfilesystem_stubs.cpp@@ -24,6 +24,8 @@* - DebugInit, DebugLog: Debug.cpp does not compile off Windows yet. DebugLog prints, so a* DEBUG_LOG from the memory manager is not lost.* - ReleaseCrash: the memory manager stops on a corrupt block header; here that aborts.+ * - LogicThread's census: JobSystem::parallel_for counts itself when it runs on the logic thread,+ * and nothing here is one, so the flag stays FALSE and the count is never taken.* - INI: SubsystemInterfaceList::initSubsystem loads INI files; nothing here initialises a* subsystem through it.* - TheFileSystem, FileSystem::openFile: RAMFile::open(const char*) opens through the whole file@@ -36,6 +38,7 @@#include "Common/Debug.h"#include "Common/FileSystem.h"#include "Common/INI.h"+#include "Common/LogicThread.h"extern "C" void DebugInit(int){@@ -62,6 +65,9 @@ static void unreachable(const char *what)abort();}+thread_local Bool LogicThread::t_isLogicThread = FALSE;+void LogicThread::noteCensus(Channel) { unreachable("LogicThread::noteCensus"); }+INI::INI() { unreachable("INI::INI"); }INI::~INI() {}void INI::loadDirectory(AsciiString, Bool, INILoadType, Xfer *) { unreachable("INI::loadDirectory"); }