11/*
2- ** Command & Conquer Generals(tm)
2+ ** Command & Conquer Generals Zero Hour (tm)
33** Copyright 2025 Electronic Arts Inc.
44**
55** This program is free software: you can redistribute it and/or modify
3434#include " GameClient/GameText.h"
3535#include " GameNetwork/NetworkDefs.h"
3636
37+ #ifdef _INTERNAL
38+ // for occasional debugging...
39+ // #pragma optimize("", off)
40+ // #pragma MESSAGE("************************************** WARNING, optimization disabled for debugging purposes")
41+ #endif
42+
43+
44+
3745Bool TheDebugIgnoreSyncErrors = FALSE ;
3846extern Int DX8Wrapper_PreserveFPU;
3947
@@ -644,7 +652,18 @@ Int parseBuildMapCache(char *args[], int)
644652 return 1 ;
645653}
646654
647- #if defined(_DEBUG) || defined(_INTERNAL)
655+
656+ #if defined(_DEBUG) || defined(_INTERNAL) || defined(_ALLOW_DEBUG_CHEATS_IN_RELEASE)
657+ Int parsePreload ( char *args[], int num )
658+ {
659+ if ( TheWritableGlobalData )
660+ TheWritableGlobalData->m_preloadAssets = TRUE ;
661+ return 1 ;
662+ }
663+ #endif
664+
665+
666+ #if defined(_DEBUG) || defined(_INTERNAL)
648667Int parseDisplayDebug (char *args[], int )
649668{
650669 if (TheWritableGlobalData)
@@ -664,12 +683,6 @@ Int parseFile(char *args[], int num)
664683 return 2 ;
665684}
666685
667- Int parsePreload ( char *args[], int num )
668- {
669- if ( TheWritableGlobalData )
670- TheWritableGlobalData->m_preloadAssets = TRUE ;
671- return 1 ;
672- }
673686
674687Int parsePreloadEverything ( char *args[], int num )
675688{
@@ -777,18 +790,37 @@ Int parseNoShellMap(char *args[], int)
777790 return 1 ;
778791}
779792
793+ Int parseNoShaders (char *args[], int )
794+ {
795+ if (TheWritableGlobalData)
796+ {
797+ TheWritableGlobalData->m_chipSetType = 1 ; // force to a voodoo card which uses least amount of features.
798+ }
799+ return 1 ;
800+ }
801+
780802#if (defined(_DEBUG) || defined(_INTERNAL))
781803Int parseNoLogo (char *args[], int )
782804{
783805 if (TheWritableGlobalData)
784806 {
785807 TheWritableGlobalData->m_playIntro = FALSE ;
786808 TheWritableGlobalData->m_afterIntro = TRUE ;
809+ TheWritableGlobalData->m_playSizzle = FALSE ;
787810 }
788811 return 1 ;
789812}
790813#endif
791814
815+ Int parseNoSizzle ( char *args[], int )
816+ {
817+ if (TheWritableGlobalData)
818+ {
819+ TheWritableGlobalData->m_playSizzle = FALSE ;
820+ }
821+ return 1 ;
822+ }
823+
792824Int parseShellMap (char *args[], int num)
793825{
794826 if (TheWritableGlobalData && num > 1 )
@@ -820,6 +852,10 @@ Int parseQuickStart( char *args[], int num )
820852{
821853#if (defined(_DEBUG) || defined(_INTERNAL))
822854 parseNoLogo ( args, num );
855+ #else
856+ // Kris: Patch 1.01 -- Allow release builds to skip the sizzle video, but still force the EA logo to show up.
857+ // This is for legal reasons.
858+ parseNoSizzle ( args, num );
823859#endif
824860 parseNoShellMap ( args, num );
825861 parseNoWindowAnimation ( args, num );
@@ -835,6 +871,29 @@ Int parseConstantDebug( char *args[], int num )
835871 return 1 ;
836872}
837873
874+ #if (defined(_DEBUG) || defined(_INTERNAL))
875+ Int parseExtraLogging ( char *args[], int num )
876+ {
877+ if (TheWritableGlobalData)
878+ {
879+ TheWritableGlobalData->m_extraLogging = TRUE ;
880+ }
881+ return 1 ;
882+ }
883+ #endif
884+
885+ // -allAdvice feature
886+ /*
887+ Int parseAllAdvice( char *args[], int num )
888+ {
889+ if( TheWritableGlobalData )
890+ {
891+ TheWritableGlobalData->m_allAdvice = TRUE;
892+ }
893+ return 1;
894+ }
895+ */
896+
838897Int parseShowTeamDot ( char *args[], int num )
839898{
840899 if ( TheWritableGlobalData )
@@ -973,6 +1032,20 @@ Int parseBenchmark(char *args[], int num)
9731032}
9741033#endif
9751034
1035+ #if defined(_DEBUG) || defined(_INTERNAL)
1036+ #ifdef DUMP_PERF_STATS
1037+ Int parseStats (char *args[], int num)
1038+ {
1039+ if (TheWritableGlobalData && num > 1 )
1040+ {
1041+ TheWritableGlobalData->m_dumpStatsAtInterval = TRUE ;
1042+ TheWritableGlobalData->m_statsInterval = atoi (args[1 ]);
1043+ }
1044+ return 2 ;
1045+ }
1046+ #endif
1047+ #endif
1048+
9761049#ifdef DEBUG_CRASHING
9771050Int parseIgnoreAsserts (char *args[], int num)
9781051{
@@ -1056,14 +1129,14 @@ Int parseMod(char *args[], Int num)
10561129 }
10571130
10581131 // now check for dir-ness
1059- struct stat statBuf;
1060- if (stat (modPath.str (), &statBuf) != 0 )
1132+ struct _stat statBuf;
1133+ if (_stat (modPath.str (), &statBuf) != 0 )
10611134 {
10621135 DEBUG_LOG ((" Could not _stat() mod.\n " ));
10631136 return 2 ; // could not stat the file/dir.
10641137 }
10651138
1066- if (statBuf.st_mode & S_IFDIR )
1139+ if (statBuf.st_mode & _S_IFDIR )
10671140 {
10681141 if (!modPath.endsWith (" \\ " ) && !modPath.endsWith (" /" ))
10691142 modPath.concat (' \\ ' );
@@ -1129,6 +1202,9 @@ static CommandLineParam params[] =
11291202 { " -scriptDebug" , parseScriptDebug },
11301203 { " -playStats" , parsePlayStats },
11311204 { " -mod" , parseMod },
1205+ { " -noshaders" , parseNoShaders },
1206+ { " -quickstart" , parseQuickStart },
1207+
11321208#if (defined(_DEBUG) || defined(_INTERNAL))
11331209 { " -noaudio" , parseNoAudio },
11341210 { " -map" , parseMapName },
@@ -1137,7 +1213,10 @@ static CommandLineParam params[] =
11371213 { " -noLogOrCrash" , parseNoLogOrCrash },
11381214 { " -FPUPreserve" , parseFPUPreserve },
11391215 { " -benchmark" , parseBenchmark },
1140- { " -saveStats" , parseSaveStats },
1216+ #ifdef DUMP_PERF_STATS
1217+ { " -stats" , parseStats },
1218+ #endif
1219+ { " -saveStats" , parseSaveStats },
11411220 { " -localMOTD" , parseLocalMOTD },
11421221 { " -UseCSF" , parseUseCSF },
11431222 { " -NoInputDisable" , parseNoInputDisable },
@@ -1218,8 +1297,10 @@ static CommandLineParam params[] =
12181297 { " -munkee" , parseMunkee },
12191298 { " -displayDebug" , parseDisplayDebug },
12201299 { " -file" , parseFile },
1221- { " -preload" , parsePreload },
1222- { " -preloadEverything" , parsePreloadEverything },
1300+
1301+ // { "-preload", parsePreload },
1302+
1303+ { " -preloadEverything" , parsePreloadEverything },
12231304 { " -logAssets" , parseLogAssets },
12241305 { " -netMinPlayers" , parseNetMinPlayers },
12251306 { " -DemoLoadScreen" , parseDemoLoadScreen },
@@ -1239,14 +1320,15 @@ static CommandLineParam params[] =
12391320 { " -noShellAnim" , parseNoWindowAnimation },
12401321 { " -winCursors" , parseWinCursors },
12411322 { " -constantDebug" , parseConstantDebug },
1242- { " -quickstart" , parseQuickStart },
12431323 { " -seed" , parseSeed },
12441324 { " -noagpfix" , parseIncrAGPBuf },
12451325 { " -noFPSLimit" , parseNoFPSLimit },
12461326 { " -dumpAssetUsage" , parseDumpAssetUsage },
12471327 { " -jumpToFrame" , parseJumpToFrame },
12481328 { " -updateImages" , parseUpdateImages },
12491329 { " -showTeamDot" , parseShowTeamDot },
1330+ { " -extraLogging" , parseExtraLogging },
1331+
12501332#endif
12511333
12521334#ifdef DEBUG_LOGGING
@@ -1261,6 +1343,15 @@ static CommandLineParam params[] =
12611343#ifdef DEBUG_STACKTRACE
12621344 { " -ignoreStackTrace" , parseIgnoreStackTrace },
12631345#endif
1346+
1347+ // -allAdvice feature
1348+ // { "-allAdvice", parseAllAdvice },
1349+
1350+ #if defined(_DEBUG) || defined(_INTERNAL) || defined(_ALLOW_DEBUG_CHEATS_IN_RELEASE)
1351+ { " -preload" , parsePreload },
1352+ #endif
1353+
1354+
12641355};
12651356
12661357// parseCommandLine ===========================================================
0 commit comments