Skip to content

Commit c0fc760

Browse files
committed
fix: Add missing includes, initSubsystem helper, and RTS_HAS_JSON_CHUNK define to DataChunkConverter
1 parent d622848 commit c0fc760

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

GeneralsMD/Code/Tools/DataChunkConverter/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ if (NOT IS_VS6_BUILD)
1111
${CMAKE_CURRENT_SOURCE_DIR}/../../GameEngine/Include/Precompiled
1212
${CMAKE_CURRENT_SOURCE_DIR}/../../Libraries/Include
1313
${CMAKE_SOURCE_DIR}/Core/GameEngine/Include
14+
${CMAKE_CURRENT_SOURCE_DIR}/../../GameEngineDevice/Include
15+
)
16+
17+
target_compile_definitions(z_datachunkconverter PRIVATE
18+
RTS_HAS_JSON_CHUNK
1419
)
1520

1621
target_link_libraries(z_datachunkconverter PRIVATE

GeneralsMD/Code/Tools/DataChunkConverter/DataChunkConverter.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,25 @@
4242
#include "GameLogic/ScriptEngine.h"
4343
#include "GameLogic/SidesList.h"
4444
#include "GameClient/ShellHooks.h"
45+
#include "Common/SubsystemInterface.h"
46+
#include "Common/LocalFileSystem.h"
47+
#include "Common/ArchiveFileSystem.h"
48+
#include "Win32Device/Common/Win32LocalFileSystem.h"
49+
#include "Win32Device/Common/Win32BIGFileSystem.h"
4550

4651
#include <stdio.h>
4752
#include <string.h>
4853
#include <stdlib.h>
4954

55+
static SubsystemInterfaceList TheSubsystemListRecord;
56+
57+
template<class SUBSYSTEM>
58+
void initSubsystem(SUBSYSTEM*& sysref, SUBSYSTEM* sys, const char* path1 = NULL, const char* path2 = NULL)
59+
{
60+
sysref = sys;
61+
TheSubsystemListRecord.initSubsystem(sys, path1, path2, NULL);
62+
}
63+
5064
class SimpleFileOutputStream : public OutputStream
5165
{
5266
FILE* m_file;
@@ -235,7 +249,7 @@ int main(int argc, char* argv[])
235249
return 1;
236250
}
237251

238-
initSubsystem(TheFileSystem, new FileSystem);
252+
TheFileSystem = new FileSystem;
239253
initSubsystem(TheLocalFileSystem, (LocalFileSystem*)new Win32LocalFileSystem);
240254
initSubsystem(TheArchiveFileSystem, (ArchiveFileSystem*)new Win32BIGFileSystem);
241255
initSubsystem(TheWritableGlobalData, new GlobalData(), "Data\\INI\\Default\\GameData", "Data\\INI\\GameData");
@@ -244,9 +258,12 @@ int main(int argc, char* argv[])
244258
initSubsystem(TheMultiplayerSettings, new MultiplayerSettings(), "Data\\INI\\Default\\Multiplayer", "Data\\INI\\Multiplayer");
245259
initSubsystem(TheTerrainTypes, new TerrainTypeCollection(), "Data\\INI\\Default\\TerrainTypes", "Data\\INI\\TerrainTypes");
246260
initSubsystem(TheThingFactory, new ThingFactory(), "Data\\INI\\Default\\Thing", "Data\\INI\\Thing");
247-
initSubsystem(TheNameKeyGenerator, new NameKeyGenerator());
261+
TheNameKeyGenerator = new NameKeyGenerator();
262+
TheNameKeyGenerator->init();
248263
initSubsystem(TheScriptEngine, new ScriptEngine());
249264

265+
TheSubsystemListRecord.postProcessLoadAll();
266+
250267
Bool success = false;
251268
if (isInputSCB) {
252269
success = convertSCBToJSON(inputPath, outputPath);

0 commit comments

Comments
 (0)