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(w3ddevice): scan the game directory for archives, not everything under it
Olcay Seygan68833b4fc1bc
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/ArchiveFileSystem.h b/GeneralsMD/Code/GameEngine/Include/Common/ArchiveFileSystem.hindex 703bac48a..b431ca108 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/ArchiveFileSystem.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/ArchiveFileSystem.h@@ -168,7 +168,7 @@ class ArchiveFileSystem : public SubsystemInterfacevoid getFileListInDirectory(const AsciiString& currentDirectory, const AsciiString& originalDirectory, const AsciiString& searchName, FilenameList &filenameList, Bool searchSubdirectories) const; ///< search the given directory for files matching the searchName (egs. *.ini, *.rep). Possibly search subdirectories. Scans each Archive file.Bool getFileInfo(const AsciiString& filename, FileInfo *fileInfo) const; ///< see FileSystem.h- virtual Bool loadBigFilesFromDirectory(AsciiString dir, AsciiString fileMask, Bool overwrite = FALSE) = 0;+ virtual Bool loadBigFilesFromDirectory(AsciiString dir, AsciiString fileMask, Bool overwrite = FALSE, Bool searchSubdirectories = TRUE) = 0;// Unprotected this for copy-protection routinesAsciiString getArchiveFilenameForFile(const AsciiString& filename) const;diff --git a/GeneralsMD/Code/GameEngineDevice/Include/Win32Device/Common/Win32BIGFileSystem.h b/GeneralsMD/Code/GameEngineDevice/Include/Win32Device/Common/Win32BIGFileSystem.hindex 3f408dcf8..3ada91dbb 100644--- a/GeneralsMD/Code/GameEngineDevice/Include/Win32Device/Common/Win32BIGFileSystem.h+++ b/GeneralsMD/Code/GameEngineDevice/Include/Win32Device/Common/Win32BIGFileSystem.h@@ -52,7 +52,7 @@ public:virtual void closeArchiveFile(const Char *filename);virtual void closeAllFiles( void ); ///< Close all files associated with ArchiveFiles- virtual Bool loadBigFilesFromDirectory(AsciiString dir, AsciiString fileMask, Bool overwrite = FALSE);+ virtual Bool loadBigFilesFromDirectory(AsciiString dir, AsciiString fileMask, Bool overwrite = FALSE, Bool searchSubdirectories = TRUE);protected:};diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cppindex e706a4735..1a3454eac 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp@@ -58,13 +58,21 @@ void Win32BIGFileSystem::init() {return;}- loadBigFilesFromDirectory("", "*.big");+ //+ // The exe's own directory and no further down. This used to walk every subdirectory under it,+ // which had two consequences. A stray archive - one extracted into Data\INI, say - joined the+ // set without anyone asking, and since the INI CRC covers the INI files as resolved, that is a+ // silent "join denied, different INI set" for everyone who has not got the same stray file. And+ // ZH_Generals\*.big, which the explicit pass below loads on purpose and in a particular order,+ // was found and parsed by this pass as well: fifteen archives opened twice at every start.+ //+ loadBigFilesFromDirectory("", "*.big", FALSE, FALSE);// loadIntoDirectoryTree keeps the FIRST archive that claims a path and the plain// *.big pass above enumerates case-insensitively alphabetically, so INIZH.big claims// Data\INI\... before PatchINI.big is even looked at and the 1.04 patch content is// unreachable. Re-load the patch archives with overwrite so they win, like retail.- loadBigFilesFromDirectory("", "Patch*.big", TRUE);+ loadBigFilesFromDirectory("", "Patch*.big", TRUE, FALSE);// load original Generals assetsAsciiString installPath;@@ -236,10 +244,10 @@ void Win32BIGFileSystem::closeAllArchiveFiles() {void Win32BIGFileSystem::closeAllFiles() {}-Bool Win32BIGFileSystem::loadBigFilesFromDirectory(AsciiString dir, AsciiString fileMask, Bool overwrite) {+Bool Win32BIGFileSystem::loadBigFilesFromDirectory(AsciiString dir, AsciiString fileMask, Bool overwrite, Bool searchSubdirectories) {FilenameList filenameList;- TheLocalFileSystem->getFileListInDirectory(dir, AsciiString(""), fileMask, filenameList, TRUE);+ TheLocalFileSystem->getFileListInDirectory(dir, AsciiString(""), fileMask, filenameList, searchSubdirectories);Bool actuallyAdded = FALSE;FilenameListIter it = filenameList.begin();