Skip to content

Commit e2ac648

Browse files
committed
Fix DataChunkConverter PreRTS.h include path and add missing WriteActionDataChunkJSON for GeneralsMD
1 parent bf402c8 commit e2ac648

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Generals/Code/Tools/DataChunkConverter/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ if (NOT IS_VS6_BUILD)
66
DataChunkConverter.cpp
77
)
88

9+
target_include_directories(g_datachunkconverter PRIVATE
10+
${CMAKE_CURRENT_SOURCE_DIR}/../../GameEngine/Include/Precompiled
11+
)
12+
913
target_link_libraries(g_datachunkconverter PRIVATE
1014
g_gameengine
1115
g_gameenginedevice

GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,6 +2793,30 @@ void ScriptAction::WriteActionDataChunk(DataChunkOutput &chunkWriter, ScriptActi
27932793
}
27942794
}
27952795

2796+
#ifdef RTS_HAS_JSON_CHUNK
2797+
void ScriptAction::WriteActionDataChunkJSON(JSONChunkOutput &chunkWriter, ScriptAction *pScriptAction)
2798+
{
2799+
while (pScriptAction) {
2800+
chunkWriter.openDataChunk("ScriptAction", K_SCRIPT_ACTION_VERSION_2);
2801+
chunkWriter.writeInt(pScriptAction->m_actionType);
2802+
const ActionTemplate* at = TheScriptEngine->getActionTemplate(pScriptAction->m_actionType);
2803+
if (at) {
2804+
chunkWriter.writeNameKey(at->m_internalNameKey);
2805+
} else {
2806+
DEBUG_CRASH(("Invalid action."));
2807+
chunkWriter.writeNameKey(NAMEKEY("Bogus"));
2808+
}
2809+
chunkWriter.writeInt(pScriptAction->m_numParms);
2810+
Int i;
2811+
for (i=0; i<pScriptAction->m_numParms; i++) {
2812+
pScriptAction->m_parms[i]->WriteParameterJSON(chunkWriter);
2813+
}
2814+
chunkWriter.closeDataChunk();
2815+
pScriptAction = pScriptAction->getNext();
2816+
}
2817+
}
2818+
#endif
2819+
27962820
/**
27972821
* ScriptAction::ParseAction - read an action chunk in a script list.
27982822
* Format is the newer CHUNKY format.

0 commit comments

Comments
 (0)