Skip to content

Commit 223f08b

Browse files
committed
nit: add comment for tool usage
1 parent f68b40a commit 223f08b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Generals/Code/Tools/DataChunkConverter/DataChunkConverter.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,22 @@ static Bool convertJSONToSCB(const char* inputPath, const char* outputPath)
670670
return true;
671671
}
672672

673+
/**
674+
* DataChunkConverter - Converts SCB (script binary) files to JSON and vice versa.
675+
*
676+
* This tool is used to convert script chunk files between binary SCB format and human-readable JSON format.
677+
* The game directory is required to load INI files needed for parsing script data (thing templates, etc).
678+
*
679+
* Usage examples:
680+
* datachunkconverter -in script.scb -out script.json
681+
* datachunkconverter -in script.json -out script.scb -gamedir "C:\\Games\\Generals"
682+
*/
673683
int main(int argc, char* argv[])
674684
{
675685
initMemoryManager();
676686

687+
// Find game directory: required to load INI files for parsing script data (thing templates, etc).
688+
// Try current directory first, then command-line arg, then registry.
677689
char gameDir[MAX_PATH] = "";
678690
char currentDir[MAX_PATH];
679691
if (!GetCurrentDirectoryA(MAX_PATH, currentDir)) {

GeneralsMD/Code/Tools/DataChunkConverter/DataChunkConverter.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,10 +672,22 @@ static Bool convertJSONToSCB(const char* inputPath, const char* outputPath)
672672
return true;
673673
}
674674

675+
/**
676+
* DataChunkConverter - Converts SCB (script binary) files to JSON and vice versa.
677+
*
678+
* This tool is used to convert script chunk files between binary SCB format and human-readable JSON format.
679+
* The game directory is required to load INI files needed for parsing script data (thing templates, etc).
680+
*
681+
* Usage examples:
682+
* datachunkconverter -in script.scb -out script.json
683+
* datachunkconverter -in script.json -out script.scb -gamedir "C:\\Games\\Generals"
684+
*/
675685
int main(int argc, char* argv[])
676686
{
677687
initMemoryManager();
678688

689+
// Find game directory: required to load INI files for parsing script data (thing templates, etc).
690+
// Try current directory first, then command-line arg, then registry.
679691
char gameDir[MAX_PATH] = "";
680692
char currentDir[MAX_PATH];
681693
if (!GetCurrentDirectoryA(MAX_PATH, currentDir)) {

0 commit comments

Comments
 (0)