From 4393b855bd6a68180fa7d037ff2907e41a88ae3c Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 5 Jul 2025 14:50:52 +0200 Subject: [PATCH 01/13] [GEN][ZH] Automatically add trailing new lines in debug log messages (#1232) --- .../Source/WWVegas/WWStub/wwdebugstub.cpp | 2 ++ Core/Tools/CRCDiff/debug.cpp | 3 ++- Core/Tools/PATCHGET/debug.cpp | 14 +++++----- Core/Tools/matchbot/wlib/wdebug.h | 4 +++ .../GameEngine/Source/Common/System/Debug.cpp | 27 ++++++++++--------- .../Code/Tools/WorldBuilder/src/wbview3d.cpp | 2 ++ .../GameEngine/Source/Common/System/Debug.cpp | 27 ++++++++++--------- .../Code/Tools/WorldBuilder/src/wbview3d.cpp | 2 ++ 8 files changed, 48 insertions(+), 33 deletions(-) diff --git a/Core/Libraries/Source/WWVegas/WWStub/wwdebugstub.cpp b/Core/Libraries/Source/WWVegas/WWStub/wwdebugstub.cpp index a86eb93156..b1d2054bcc 100644 --- a/Core/Libraries/Source/WWVegas/WWStub/wwdebugstub.cpp +++ b/Core/Libraries/Source/WWVegas/WWStub/wwdebugstub.cpp @@ -35,6 +35,7 @@ void DebugLog(const char *format, ...) va_start(arg, format); vprintf(format, arg); va_end(arg); + printf("\n"); } #endif @@ -49,6 +50,7 @@ void DebugCrash(const char *format, ...) va_start(arg, format); vprintf(format, arg); va_end(arg); + printf("\n"); // No exit in this stub } diff --git a/Core/Tools/CRCDiff/debug.cpp b/Core/Tools/CRCDiff/debug.cpp index 397085a5c2..da3d2e3c96 100644 --- a/Core/Tools/CRCDiff/debug.cpp +++ b/Core/Tools/CRCDiff/debug.cpp @@ -37,8 +37,9 @@ void DebugLog(const char *fmt, ...) buffer[1023] = 0; va_end( va ); - printf( "%s", buffer ); + printf( "%s\n", buffer ); OutputDebugString( buffer ); + OutputDebugString( "\n" ); } #endif // DEBUG diff --git a/Core/Tools/PATCHGET/debug.cpp b/Core/Tools/PATCHGET/debug.cpp index 64a24880ff..9934d05f0b 100644 --- a/Core/Tools/PATCHGET/debug.cpp +++ b/Core/Tools/PATCHGET/debug.cpp @@ -44,14 +44,14 @@ static int doCrashBox(const char *buffer, bool logResult) case IDABORT: #ifdef DEBUG_LOGGING if (logResult) - DebugLog("[Abort]\n"); + DebugLog("[Abort]"); #endif _exit(1); break; case IDRETRY: #ifdef DEBUG_LOGGING if (logResult) - DebugLog("[Retry]\n"); + DebugLog("[Retry]"); #endif ::DebugBreak(); break; @@ -59,7 +59,7 @@ static int doCrashBox(const char *buffer, bool logResult) #ifdef DEBUG_LOGGING // do nothing, just keep going if (logResult) - DebugLog("[Ignore]\n"); + DebugLog("[Ignore]"); #endif break; } @@ -77,7 +77,8 @@ void DebugLog(const char *fmt, ...) va_end( va ); OutputDebugString(theBuffer); - printf( "%s", theBuffer ); + OutputDebugString("\n"); + printf( "%s\n", theBuffer ); } #endif // defined(DEBUG) || defined(DEBUG_LOGGING) @@ -98,9 +99,10 @@ void DebugCrash(const char *format, ...) ::MessageBox(NULL, "String too long for debug buffers", "", MB_OK|MB_APPLMODAL); OutputDebugString(theBuffer); - printf( "%s", theBuffer ); + OutputDebugString("\n"); + printf( "%s\n", theBuffer ); - strcat(theBuffer, "\n\nAbort->exception; Retry->debugger; Ignore->continue\n"); + strcat(theBuffer, "\n\nAbort->exception; Retry->debugger; Ignore->continue"); int result = doCrashBox(theBuffer, true); diff --git a/Core/Tools/matchbot/wlib/wdebug.h b/Core/Tools/matchbot/wlib/wdebug.h index 1f397bd453..96b517bea5 100644 --- a/Core/Tools/matchbot/wlib/wdebug.h +++ b/Core/Tools/matchbot/wlib/wdebug.h @@ -197,6 +197,7 @@ extern CritSec DebugLibSemaphore; __s << __FILE__ << "[" << __LINE__ << \ "]: " << ##V << " = " << V << '\n' << '\0';\ OutputDebugString(STRSTREAM_CSTR(__s));\ + OutputDebugString("\n");\ DEBUGUNLOCK; \ } @@ -211,6 +212,7 @@ extern CritSec DebugLibSemaphore; __s << "DBG [" << __FILE__ << \ " " << __LINE__ << "] " << X << '\n' << '\0';\ OutputDebugString(STRSTREAM_CSTR(__s));\ + OutputDebugString("\n");\ DEBUGUNLOCK; \ } @@ -223,6 +225,7 @@ extern CritSec DebugLibSemaphore; strstream __s;\ __s << X << '\0';\ OutputDebugString(STRSTREAM_CSTR(__s));\ + OutputDebugString("\n");\ DEBUGUNLOCK; \ } @@ -237,6 +240,7 @@ extern CritSec DebugLibSemaphore; __s << __FILE__ << "[" << __LINE__ << \ "]: " << ##X << '\n' << '\0';\ OutputDebugString(STRSTREAM_CSTR(__s));\ + OutputDebugString("\n");\ DEBUGUNLOCK; \ } diff --git a/Generals/Code/GameEngine/Source/Common/System/Debug.cpp b/Generals/Code/GameEngine/Source/Common/System/Debug.cpp index bdd9075a33..6e7ae79932 100644 --- a/Generals/Code/GameEngine/Source/Common/System/Debug.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/Debug.cpp @@ -233,7 +233,7 @@ static void doLogOutput(const char *buffer) { if (theLogFile) { - fprintf(theLogFile, "%s", buffer); // note, no \n (should be there already) + fprintf(theLogFile, "%s\n", buffer); fflush(theLogFile); } } @@ -242,10 +242,11 @@ static void doLogOutput(const char *buffer) if (theDebugFlags & DEBUG_FLAG_LOG_TO_CONSOLE) { ::OutputDebugString(buffer); + ::OutputDebugString("\n"); } #ifdef INCLUDE_DEBUG_LOG_IN_CRC_LOG - addCRCDebugLineNoCounter("%s", buffer); + addCRCDebugLineNoCounter("%s\n", buffer); #endif } #endif @@ -274,14 +275,14 @@ static int doCrashBox(const char *buffer, Bool logResult) case IDABORT: #ifdef DEBUG_LOGGING if (logResult) - DebugLog("[Abort]\n"); + DebugLog("[Abort]"); #endif _exit(1); break; case IDRETRY: #ifdef DEBUG_LOGGING if (logResult) - DebugLog("[Retry]\n"); + DebugLog("[Retry]"); #endif ::DebugBreak(); break; @@ -289,7 +290,7 @@ static int doCrashBox(const char *buffer, Bool logResult) #ifdef DEBUG_LOGGING // do nothing, just keep going if (logResult) - DebugLog("[Ignore]\n"); + DebugLog("[Ignore]"); #endif break; } @@ -308,7 +309,7 @@ static void doStackDump() const int STACKTRACE_SKIP = 2; void* stacktrace[STACKTRACE_SIZE]; - doLogOutput("\nStack Dump:\n"); + doLogOutput("\nStack Dump:"); ::FillStackAddresses(stacktrace, STACKTRACE_SIZE, STACKTRACE_SKIP); ::StackDumpFromAddresses(stacktrace, STACKTRACE_SIZE, doLogOutput); } @@ -396,7 +397,7 @@ void DebugInit(int flags) theLogFile = fopen(theLogFileName, "w"); if (theLogFile != NULL) { - DebugLog("Log %s opened: %s\n", theLogFileName, getCurrentTimeString()); + DebugLog("Log %s opened: %s", theLogFileName, getCurrentTimeString()); } #endif } @@ -494,7 +495,7 @@ void DebugCrash(const char *format, ...) #ifdef DEBUG_LOGGING if (ignoringAsserts()) { - doLogOutput("**** CRASH IN FULL SCREEN - Auto-ignored, CHECK THIS LOG!\n"); + doLogOutput("**** CRASH IN FULL SCREEN - Auto-ignored, CHECK THIS LOG!"); } whackFunnyCharacters(theCrashBuffer); doLogOutput(theCrashBuffer); @@ -506,7 +507,7 @@ void DebugCrash(const char *format, ...) } #endif - strcat(theCrashBuffer, "\n\nAbort->exception; Retry->debugger; Ignore->continue\n"); + strcat(theCrashBuffer, "\n\nAbort->exception; Retry->debugger; Ignore->continue"); int result = doCrashBox(theCrashBuffer, true); @@ -546,7 +547,7 @@ void DebugShutdown() #ifdef DEBUG_LOGGING if (theLogFile) { - DebugLog("Log closed: %s\n", getCurrentTimeString()); + DebugLog("Log closed: %s", getCurrentTimeString()); fclose(theLogFile); } theLogFile = NULL; @@ -623,9 +624,9 @@ void SimpleProfiler::stopAndLog(const char *msg, int howOftenToLog, int howOften { m_numSessions = 0; m_totalAllSessions = 0; - DEBUG_LOG(("%s: reset averages\n",msg)); + DEBUG_LOG(("%s: reset averages",msg)); } - DEBUG_ASSERTLOG(m_numSessions % howOftenToLog != 0, ("%s: %f msec, total %f msec, avg %f msec\n",msg,getTime(),getTotalTime(),getAverageTime())); + DEBUG_ASSERTLOG(m_numSessions % howOftenToLog != 0, ("%s: %f msec, total %f msec, avg %f msec",msg,getTime(),getTotalTime(),getAverageTime())); } // ---------------------------------------------------------------------------- @@ -682,7 +683,7 @@ double SimpleProfiler::getAverageTime() { if (theReleaseCrashLogFile) { - fprintf(theReleaseCrashLogFile, "%s", buffer); // note, no \n (should be there already) + fprintf(theReleaseCrashLogFile, "%s\n", buffer); fflush(theReleaseCrashLogFile); } } diff --git a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp index 921de88d2a..87916e081e 100644 --- a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp @@ -135,6 +135,7 @@ static void WWDebug_Message_Callback(DebugType type, const char * message) { #ifdef RTS_DEBUG ::OutputDebugString(message); + ::OutputDebugString("\n"); #endif } @@ -143,6 +144,7 @@ static void WWAssert_Callback(const char * message) { #ifdef RTS_DEBUG ::OutputDebugString(message); + ::OutputDebugString("\n"); ::DebugBreak(); #endif } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Debug.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/Debug.cpp index 6a8e4a51b8..4e722adb8e 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/Debug.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/Debug.cpp @@ -234,7 +234,7 @@ static void doLogOutput(const char *buffer) { if (theLogFile) { - fprintf(theLogFile, "%s", buffer); // note, no \n (should be there already) + fprintf(theLogFile, "%s\n", buffer); fflush(theLogFile); } } @@ -243,10 +243,11 @@ static void doLogOutput(const char *buffer) if (theDebugFlags & DEBUG_FLAG_LOG_TO_CONSOLE) { ::OutputDebugString(buffer); + ::OutputDebugString("\n"); } #ifdef INCLUDE_DEBUG_LOG_IN_CRC_LOG - addCRCDebugLineNoCounter("%s", buffer); + addCRCDebugLineNoCounter("%s\n", buffer); #endif } #endif @@ -275,14 +276,14 @@ static int doCrashBox(const char *buffer, Bool logResult) case IDABORT: #ifdef DEBUG_LOGGING if (logResult) - DebugLog("[Abort]\n"); + DebugLog("[Abort]"); #endif _exit(1); break; case IDRETRY: #ifdef DEBUG_LOGGING if (logResult) - DebugLog("[Retry]\n"); + DebugLog("[Retry]"); #endif ::DebugBreak(); break; @@ -290,7 +291,7 @@ static int doCrashBox(const char *buffer, Bool logResult) #ifdef DEBUG_LOGGING // do nothing, just keep going if (logResult) - DebugLog("[Ignore]\n"); + DebugLog("[Ignore]"); #endif break; } @@ -309,7 +310,7 @@ static void doStackDump() const int STACKTRACE_SKIP = 2; void* stacktrace[STACKTRACE_SIZE]; - doLogOutput("\nStack Dump:\n"); + doLogOutput("\nStack Dump:"); ::FillStackAddresses(stacktrace, STACKTRACE_SIZE, STACKTRACE_SKIP); ::StackDumpFromAddresses(stacktrace, STACKTRACE_SIZE, doLogOutput); } @@ -397,7 +398,7 @@ void DebugInit(int flags) theLogFile = fopen(theLogFileName, "w"); if (theLogFile != NULL) { - DebugLog("Log %s opened: %s\n", theLogFileName, getCurrentTimeString()); + DebugLog("Log %s opened: %s", theLogFileName, getCurrentTimeString()); } #endif } @@ -495,7 +496,7 @@ void DebugCrash(const char *format, ...) #ifdef DEBUG_LOGGING if (ignoringAsserts()) { - doLogOutput("**** CRASH IN FULL SCREEN - Auto-ignored, CHECK THIS LOG!\n"); + doLogOutput("**** CRASH IN FULL SCREEN - Auto-ignored, CHECK THIS LOG!"); } whackFunnyCharacters(theCrashBuffer); doLogOutput(theCrashBuffer); @@ -507,7 +508,7 @@ void DebugCrash(const char *format, ...) } #endif - strcat(theCrashBuffer, "\n\nAbort->exception; Retry->debugger; Ignore->continue\n"); + strcat(theCrashBuffer, "\n\nAbort->exception; Retry->debugger; Ignore->continue"); int result = doCrashBox(theCrashBuffer, true); @@ -547,7 +548,7 @@ void DebugShutdown() #ifdef DEBUG_LOGGING if (theLogFile) { - DebugLog("Log closed: %s\n", getCurrentTimeString()); + DebugLog("Log closed: %s", getCurrentTimeString()); fclose(theLogFile); } theLogFile = NULL; @@ -624,9 +625,9 @@ void SimpleProfiler::stopAndLog(const char *msg, int howOftenToLog, int howOften { m_numSessions = 0; m_totalAllSessions = 0; - DEBUG_LOG(("%s: reset averages\n",msg)); + DEBUG_LOG(("%s: reset averages",msg)); } - DEBUG_ASSERTLOG(m_numSessions % howOftenToLog != 0, ("%s: %f msec, total %f msec, avg %f msec\n",msg,getTime(),getTotalTime(),getAverageTime())); + DEBUG_ASSERTLOG(m_numSessions % howOftenToLog != 0, ("%s: %f msec, total %f msec, avg %f msec",msg,getTime(),getTotalTime(),getAverageTime())); } // ---------------------------------------------------------------------------- @@ -683,7 +684,7 @@ double SimpleProfiler::getAverageTime() { if (theReleaseCrashLogFile) { - fprintf(theReleaseCrashLogFile, "%s", buffer); // note, no \n (should be there already) + fprintf(theReleaseCrashLogFile, "%s\n", buffer); fflush(theReleaseCrashLogFile); } } diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp index 38874ec02b..055ed7af09 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp @@ -135,6 +135,7 @@ static void WWDebug_Message_Callback(DebugType type, const char * message) { #ifdef RTS_DEBUG ::OutputDebugString(message); + ::OutputDebugString("\n"); #endif } @@ -143,6 +144,7 @@ static void WWAssert_Callback(const char * message) { #ifdef RTS_DEBUG ::OutputDebugString(message); + ::OutputDebugString("\n"); ::DebugBreak(); #endif } From ce71f5729a6ff3ec3902d605bf49f1ce3c2be52d Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Mon, 7 Jul 2025 19:13:28 +0200 Subject: [PATCH 02/13] [GEN][ZH] Remove trailing LF from DEBUG_LOG, DEBUG_LOG_LEVEL strings with script (#1232) --- .../Source/Compression/CompressionManager.cpp | 30 +-- .../Compression/LZHCompress/NoxCompress.cpp | 2 +- .../Source/WWVegas/WWDownload/Download.cpp | 4 +- .../Source/WWVegas/WWDownload/FTP.CPP | 10 +- Core/Tools/Autorun/GameText.cpp | 8 +- Core/Tools/CRCDiff/expander.cpp | 18 +- Core/Tools/Compress/Compress.cpp | 30 +-- Core/Tools/MapCacheBuilder/Source/WinMain.cpp | 4 +- Core/Tools/PATCHGET/CHATAPI.CPP | 20 +- Core/Tools/PATCHGET/DownloadManager.cpp | 10 +- Core/Tools/matchbot/matcher.cpp | 14 +- .../Tools/textureCompress/textureCompress.cpp | 34 +-- .../Include/GameClient/LanguageFilter.h | 4 +- .../Include/GameNetwork/LANGameInfo.h | 2 +- .../GameNetwork/WOLBrowser/FEBDispatch.h | 2 +- .../Source/Common/Audio/GameAudio.cpp | 2 +- .../Source/Common/Audio/GameSounds.cpp | 12 +- .../Source/Common/Audio/simpleplayer.cpp | 84 +++--- .../GameEngine/Source/Common/CRCDebug.cpp | 8 +- .../GameEngine/Source/Common/CommandLine.cpp | 12 +- .../GameEngine/Source/Common/GameEngine.cpp | 48 ++-- .../GameEngine/Source/Common/GlobalData.cpp | 6 +- .../Code/GameEngine/Source/Common/INI/INI.cpp | 2 +- .../Source/Common/INI/INIMapCache.cpp | 2 +- .../Source/Common/INI/INIWebpageURL.cpp | 2 +- .../GameEngine/Source/Common/PerfTimer.cpp | 6 +- .../GameEngine/Source/Common/RTS/Player.cpp | 32 +-- .../Source/Common/RTS/PlayerList.cpp | 16 +- .../GameEngine/Source/Common/RandomValue.cpp | 16 +- .../GameEngine/Source/Common/Recorder.cpp | 76 +++--- .../GameEngine/Source/Common/StateMachine.cpp | 28 +- .../Common/System/ArchiveFileSystem.cpp | 16 +- .../Source/Common/System/AsciiString.cpp | 2 +- .../Source/Common/System/DataChunk.cpp | 16 +- .../Source/Common/System/Directory.cpp | 8 +- .../Source/Common/System/FileSystem.cpp | 8 +- .../Source/Common/System/FunctionLexicon.cpp | 2 +- .../Source/Common/System/GameMemory.cpp | 122 ++++----- .../Source/Common/System/LocalFile.cpp | 2 +- .../Common/System/SaveGame/GameState.cpp | 14 +- .../Source/Common/System/StackDump.cpp | 8 +- .../Common/System/SubsystemInterface.cpp | 4 +- .../Source/Common/System/registry.cpp | 4 +- .../Source/Common/Thing/ThingFactory.cpp | 2 +- .../Source/Common/Thing/ThingTemplate.cpp | 6 +- .../Source/Common/UserPreferences.cpp | 2 +- .../Drawable/Update/BeaconClientUpdate.cpp | 2 +- .../GameClient/GUI/ControlBar/ControlBar.cpp | 4 +- .../GUI/ControlBar/ControlBarScheme.cpp | 10 +- .../GUI/DisconnectMenu/DisconnectMenu.cpp | 2 +- .../ControlBarPopupDescription.cpp | 2 +- .../GUICallbacks/Menus/DisconnectWindow.cpp | 6 +- .../GUICallbacks/Menus/LanGameOptionsMenu.cpp | 4 +- .../GUI/GUICallbacks/Menus/LanLobbyMenu.cpp | 4 +- .../GUI/GUICallbacks/Menus/MainMenu.cpp | 10 +- .../Menus/NetworkDirectConnect.cpp | 2 +- .../GUI/GUICallbacks/Menus/OptionsMenu.cpp | 8 +- .../GUI/GUICallbacks/Menus/PopupJoinGame.cpp | 2 +- .../GUICallbacks/Menus/PopupLadderSelect.cpp | 2 +- .../GUICallbacks/Menus/PopupPlayerInfo.cpp | 18 +- .../GUI/GUICallbacks/Menus/QuitMenu.cpp | 2 +- .../GUI/GUICallbacks/Menus/ScoreScreen.cpp | 42 +-- .../Menus/SkirmishGameOptionsMenu.cpp | 2 +- .../GUICallbacks/Menus/WOLBuddyOverlay.cpp | 18 +- .../GUICallbacks/Menus/WOLGameSetupMenu.cpp | 66 ++--- .../GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp | 50 ++-- .../GUI/GUICallbacks/Menus/WOLLoginMenu.cpp | 12 +- .../GUICallbacks/Menus/WOLQuickMatchMenu.cpp | 20 +- .../GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp | 8 +- .../GameClient/GUI/Gadget/GadgetListBox.cpp | 4 +- .../Source/GameClient/GUI/GameFont.cpp | 2 +- .../Source/GameClient/GUI/GameWindow.cpp | 18 +- .../GameClient/GUI/GameWindowManager.cpp | 46 ++-- .../GUI/GameWindowManagerScript.cpp | 24 +- .../GUI/GameWindowTransitionsStyles.cpp | 2 +- .../Source/GameClient/GUI/HeaderTemplate.cpp | 2 +- .../Source/GameClient/GUI/IMEManager.cpp | 22 +- .../Source/GameClient/GUI/LoadScreen.cpp | 12 +- .../GameClient/GUI/ProcessAnimateWindow.cpp | 8 +- .../Source/GameClient/GUI/Shell/Shell.cpp | 18 +- .../Source/GameClient/GUI/WindowLayout.cpp | 2 +- .../Source/GameClient/GameClient.cpp | 52 ++-- .../Source/GameClient/GameClientDispatch.cpp | 2 +- .../GameEngine/Source/GameClient/GameText.cpp | 12 +- .../GameEngine/Source/GameClient/InGameUI.cpp | 8 +- .../Source/GameClient/Input/Mouse.cpp | 10 +- .../Source/GameClient/LanguageFilter.cpp | 4 +- .../GameEngine/Source/GameClient/MapUtil.cpp | 62 ++--- .../GameClient/MessageStream/CommandXlat.cpp | 12 +- .../GameClient/MessageStream/MetaEvent.cpp | 6 +- .../MessageStream/SelectionXlat.cpp | 12 +- .../GameEngine/Source/GameLogic/AI/AI.cpp | 6 +- .../Source/GameLogic/AI/AIGroup.cpp | 16 +- .../Source/GameLogic/AI/AIGuard.cpp | 8 +- .../Source/GameLogic/AI/AIPathfind.cpp | 236 ++++++++--------- .../Source/GameLogic/AI/AIPlayer.cpp | 42 +-- .../Source/GameLogic/AI/AISkirmishPlayer.cpp | 24 +- .../Source/GameLogic/AI/AIStates.cpp | 112 ++++---- .../Source/GameLogic/AI/AITNGuard.cpp | 10 +- .../Source/GameLogic/AI/TurretAI.cpp | 12 +- .../Source/GameLogic/Map/SidesList.cpp | 16 +- .../Source/GameLogic/Map/TerrainLogic.cpp | 10 +- .../Object/Behavior/AutoHealBehavior.cpp | 2 +- .../Behavior/DumbProjectileBehavior.cpp | 6 +- .../Object/Behavior/MinefieldBehavior.cpp | 6 +- .../Object/Behavior/ParkingPlaceBehavior.cpp | 4 +- .../Object/Behavior/SlowDeathBehavior.cpp | 2 +- .../GameLogic/Object/Contain/OpenContain.cpp | 6 +- .../Object/Contain/ParachuteContain.cpp | 6 +- .../Source/GameLogic/Object/Locomotor.cpp | 18 +- .../Source/GameLogic/Object/Object.cpp | 16 +- .../GameLogic/Object/ObjectCreationList.cpp | 2 +- .../GameLogic/Object/PartitionManager.cpp | 40 +-- .../GameLogic/Object/SimpleObjectIterator.cpp | 8 +- .../GameLogic/Object/Update/AIUpdate.cpp | 72 ++--- .../AIUpdate/DeliverPayloadAIUpdate.cpp | 6 +- .../Update/AIUpdate/MissileAIUpdate.cpp | 6 +- .../Update/AIUpdate/RailroadGuideAIUpdate.cpp | 2 +- .../DockUpdate/SupplyWarehouseDockUpdate.cpp | 2 +- .../Update/MissileLauncherBuildingUpdate.cpp | 12 +- .../Object/Update/NeutronMissileUpdate.cpp | 6 +- .../GameLogic/Object/Update/PhysicsUpdate.cpp | 2 +- .../Object/Update/StructureCollapseUpdate.cpp | 2 +- .../Object/Update/StructureToppleUpdate.cpp | 8 +- .../GameLogic/Object/Update/ToppleUpdate.cpp | 4 +- .../Source/GameLogic/Object/Weapon.cpp | 88 +++---- .../Source/GameLogic/Object/WeaponSet.cpp | 8 +- .../GameLogic/ScriptEngine/ScriptActions.cpp | 30 +-- .../GameLogic/ScriptEngine/ScriptEngine.cpp | 46 ++-- .../Source/GameLogic/ScriptEngine/Scripts.cpp | 2 +- .../ScriptEngine/VictoryConditions.cpp | 6 +- .../Source/GameLogic/System/GameLogic.cpp | 92 +++---- .../GameLogic/System/GameLogicDispatch.cpp | 20 +- .../Source/GameNetwork/Connection.cpp | 20 +- .../Source/GameNetwork/ConnectionManager.cpp | 234 ++++++++--------- .../Source/GameNetwork/DisconnectManager.cpp | 84 +++--- .../Source/GameNetwork/DownloadManager.cpp | 10 +- .../Source/GameNetwork/FileTransfer.cpp | 8 +- .../Source/GameNetwork/FirewallHelper.cpp | 160 ++++++------ .../Source/GameNetwork/FrameData.cpp | 18 +- .../Source/GameNetwork/FrameDataManager.cpp | 4 +- .../Source/GameNetwork/FrameMetrics.cpp | 4 +- .../Source/GameNetwork/GameInfo.cpp | 156 +++++------ .../GameEngine/Source/GameNetwork/GameSpy.cpp | 84 +++--- .../Source/GameNetwork/GameSpy/GSConfig.cpp | 8 +- .../Source/GameNetwork/GameSpy/LadderDefs.cpp | 28 +- .../GameNetwork/GameSpy/MainMenuUtils.cpp | 34 +-- .../Source/GameNetwork/GameSpy/PeerDefs.cpp | 20 +- .../GameSpy/StagingRoomGameInfo.cpp | 52 ++-- .../GameSpy/Thread/BuddyThread.cpp | 34 +-- .../GameSpy/Thread/GameResultsThread.cpp | 12 +- .../GameNetwork/GameSpy/Thread/PeerThread.cpp | 180 ++++++------- .../Thread/PersistentStorageThread.cpp | 158 +++++------ .../GameNetwork/GameSpy/Thread/PingThread.cpp | 16 +- .../Source/GameNetwork/GameSpyChat.cpp | 4 +- .../Source/GameNetwork/GameSpyGP.cpp | 26 +- .../Source/GameNetwork/GameSpyGameInfo.cpp | 50 ++-- .../Source/GameNetwork/GameSpyOverlay.cpp | 16 +- .../GameNetwork/GameSpyPersistentStorage.cpp | 28 +- .../Source/GameNetwork/IPEnumeration.cpp | 12 +- .../GameEngine/Source/GameNetwork/LANAPI.cpp | 36 +-- .../Source/GameNetwork/LANAPICallbacks.cpp | 32 +-- .../Source/GameNetwork/LANAPIhandlers.cpp | 18 +- .../Source/GameNetwork/LANGameInfo.cpp | 6 +- .../GameEngine/Source/GameNetwork/NAT.cpp | 168 ++++++------ .../Source/GameNetwork/NetCommandRef.cpp | 4 +- .../GameNetwork/NetCommandWrapperList.cpp | 2 +- .../Source/GameNetwork/NetMessageStream.cpp | 8 +- .../Source/GameNetwork/NetPacket.cpp | 238 ++++++++--------- .../GameEngine/Source/GameNetwork/Network.cpp | 82 +++--- .../Source/GameNetwork/NetworkUtil.cpp | 12 +- .../Source/GameNetwork/Transport.cpp | 34 +-- .../GameNetwork/WOLBrowser/WebBrowser.cpp | 10 +- .../MilesAudioDevice/MilesAudioManager.cpp | 16 +- .../VideoDevice/Bink/BinkVideoPlayer.cpp | 8 +- .../Drawable/Draw/W3DDependencyModelDraw.cpp | 2 +- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 64 ++--- .../Drawable/Draw/W3DTankTruckDraw.cpp | 10 +- .../GameClient/Drawable/Draw/W3DTruckDraw.cpp | 12 +- .../W3DDevice/GameClient/GUI/W3DGameFont.cpp | 2 +- .../GameClient/Shadow/W3DVolumetricShadow.cpp | 4 +- .../W3DDevice/GameClient/W3DAssetManager.cpp | 8 +- .../W3DDevice/GameClient/W3DBridgeBuffer.cpp | 6 +- .../W3DDevice/GameClient/W3DDebugIcons.cpp | 2 +- .../W3DDevice/GameClient/W3DDisplay.cpp | 2 +- .../GameClient/W3DDisplayStringManager.cpp | 2 +- .../W3DDevice/GameClient/W3DRoadBuffer.cpp | 4 +- .../W3DDevice/GameClient/W3DShaderManager.cpp | 2 +- .../W3DDevice/GameClient/W3DTreeBuffer.cpp | 2 +- .../Source/W3DDevice/GameClient/W3DView.cpp | 24 +- .../W3DDevice/GameClient/W3DWebBrowser.cpp | 2 +- .../W3DDevice/GameClient/WorldHeightMap.cpp | 4 +- .../Win32Device/Common/Win32BIGFileSystem.cpp | 12 +- .../Common/Win32LocalFileSystem.cpp | 4 +- .../GameClient/Win32DIKeyboard.cpp | 22 +- .../Win32Device/GameClient/Win32DIMouse.cpp | 24 +- .../Source/WWVegas/WW3D2/dx8wrapper.cpp | 4 +- Generals/Code/Main/WinMain.cpp | 6 +- .../Code/Tools/GUIEdit/Source/GUIEdit.cpp | 10 +- .../Tools/GUIEdit/Source/HierarchyView.cpp | 12 +- .../Tools/GUIEdit/Source/LayoutScheme.cpp | 10 +- .../Code/Tools/GUIEdit/Source/Properties.cpp | 8 +- Generals/Code/Tools/GUIEdit/Source/Save.cpp | 16 +- .../ParticleEditor/ParticleTypePanels.cpp | 2 +- .../Code/Tools/WorldBuilder/src/BuildList.cpp | 20 +- .../WorldBuilder/src/GlobalLightOptions.cpp | 60 ++--- .../Tools/WorldBuilder/src/MapPreview.cpp | 6 +- .../Tools/WorldBuilder/src/ScriptDialog.cpp | 4 +- .../Tools/WorldBuilder/src/ShadowOptions.cpp | 2 +- .../Tools/WorldBuilder/src/WHeightMapEdit.cpp | 6 +- .../Code/Tools/WorldBuilder/src/WaterTool.cpp | 8 +- .../Tools/WorldBuilder/src/WorldBuilder.cpp | 4 +- .../WorldBuilder/src/WorldBuilderDoc.cpp | 38 +-- .../Tools/WorldBuilder/src/playerlistdlg.cpp | 4 +- .../Code/Tools/WorldBuilder/src/wbview.cpp | 2 +- .../Code/Tools/WorldBuilder/src/wbview3d.cpp | 6 +- .../GameEngine/Include/Common/ScopedMutex.h | 2 +- .../Include/GameClient/LanguageFilter.h | 4 +- .../Include/GameNetwork/LANGameInfo.h | 2 +- .../GameNetwork/WOLBrowser/FEBDispatch.h | 2 +- .../Source/Common/Audio/GameAudio.cpp | 2 +- .../Source/Common/Audio/GameSounds.cpp | 12 +- .../Source/Common/Audio/simpleplayer.cpp | 84 +++--- .../GameEngine/Source/Common/CRCDebug.cpp | 8 +- .../GameEngine/Source/Common/CommandLine.cpp | 12 +- .../GameEngine/Source/Common/GameEngine.cpp | 22 +- .../GameEngine/Source/Common/GlobalData.cpp | 6 +- .../Code/GameEngine/Source/Common/INI/INI.cpp | 2 +- .../Source/Common/INI/INIMapCache.cpp | 2 +- .../Source/Common/INI/INIWebpageURL.cpp | 2 +- .../GameEngine/Source/Common/PerfTimer.cpp | 6 +- .../GameEngine/Source/Common/RTS/Player.cpp | 32 +-- .../Source/Common/RTS/PlayerList.cpp | 16 +- .../GameEngine/Source/Common/RandomValue.cpp | 16 +- .../GameEngine/Source/Common/Recorder.cpp | 76 +++--- .../GameEngine/Source/Common/StateMachine.cpp | 36 +-- .../Common/System/ArchiveFileSystem.cpp | 16 +- .../Source/Common/System/AsciiString.cpp | 2 +- .../Source/Common/System/DataChunk.cpp | 16 +- .../Source/Common/System/Directory.cpp | 8 +- .../Source/Common/System/FileSystem.cpp | 8 +- .../Source/Common/System/FunctionLexicon.cpp | 2 +- .../Source/Common/System/GameMemory.cpp | 122 ++++----- .../Source/Common/System/LocalFile.cpp | 2 +- .../Common/System/SaveGame/GameState.cpp | 14 +- .../Source/Common/System/StackDump.cpp | 8 +- .../Source/Common/System/registry.cpp | 6 +- .../Source/Common/Thing/ThingTemplate.cpp | 6 +- .../Source/Common/UserPreferences.cpp | 2 +- .../Drawable/Update/BeaconClientUpdate.cpp | 2 +- .../Code/GameEngine/Source/GameClient/Eva.cpp | 2 +- .../GameClient/GUI/ControlBar/ControlBar.cpp | 4 +- .../GUI/ControlBar/ControlBarScheme.cpp | 10 +- .../GUI/DisconnectMenu/DisconnectMenu.cpp | 2 +- .../ControlBarPopupDescription.cpp | 2 +- .../GUICallbacks/Menus/DisconnectWindow.cpp | 6 +- .../GUICallbacks/Menus/LanGameOptionsMenu.cpp | 4 +- .../GUI/GUICallbacks/Menus/LanLobbyMenu.cpp | 4 +- .../GUI/GUICallbacks/Menus/MainMenu.cpp | 10 +- .../Menus/NetworkDirectConnect.cpp | 2 +- .../GUI/GUICallbacks/Menus/OptionsMenu.cpp | 8 +- .../GUI/GUICallbacks/Menus/PopupJoinGame.cpp | 2 +- .../GUICallbacks/Menus/PopupLadderSelect.cpp | 2 +- .../GUICallbacks/Menus/PopupPlayerInfo.cpp | 14 +- .../GUI/GUICallbacks/Menus/QuitMenu.cpp | 2 +- .../GUI/GUICallbacks/Menus/ScoreScreen.cpp | 46 ++-- .../Menus/SkirmishGameOptionsMenu.cpp | 2 +- .../GUICallbacks/Menus/WOLBuddyOverlay.cpp | 18 +- .../GUICallbacks/Menus/WOLGameSetupMenu.cpp | 66 ++--- .../GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp | 50 ++-- .../GUI/GUICallbacks/Menus/WOLLoginMenu.cpp | 12 +- .../GUICallbacks/Menus/WOLQuickMatchMenu.cpp | 20 +- .../GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp | 14 +- .../GameClient/GUI/Gadget/GadgetListBox.cpp | 4 +- .../Source/GameClient/GUI/GameFont.cpp | 2 +- .../Source/GameClient/GUI/GameWindow.cpp | 18 +- .../GameClient/GUI/GameWindowManager.cpp | 46 ++-- .../GUI/GameWindowManagerScript.cpp | 24 +- .../GUI/GameWindowTransitionsStyles.cpp | 2 +- .../Source/GameClient/GUI/HeaderTemplate.cpp | 2 +- .../Source/GameClient/GUI/IMEManager.cpp | 22 +- .../Source/GameClient/GUI/LoadScreen.cpp | 12 +- .../GameClient/GUI/ProcessAnimateWindow.cpp | 8 +- .../Source/GameClient/GUI/Shell/Shell.cpp | 18 +- .../Source/GameClient/GUI/WindowLayout.cpp | 2 +- .../Source/GameClient/GameClient.cpp | 52 ++-- .../Source/GameClient/GameClientDispatch.cpp | 2 +- .../GameEngine/Source/GameClient/GameText.cpp | 12 +- .../GameEngine/Source/GameClient/InGameUI.cpp | 8 +- .../Source/GameClient/Input/Mouse.cpp | 10 +- .../Source/GameClient/LanguageFilter.cpp | 4 +- .../GameEngine/Source/GameClient/MapUtil.cpp | 62 ++--- .../GameClient/MessageStream/CommandXlat.cpp | 12 +- .../GameClient/MessageStream/MetaEvent.cpp | 6 +- .../MessageStream/SelectionXlat.cpp | 12 +- .../GameEngine/Source/GameLogic/AI/AI.cpp | 6 +- .../Source/GameLogic/AI/AIGroup.cpp | 16 +- .../Source/GameLogic/AI/AIGuard.cpp | 10 +- .../Source/GameLogic/AI/AIGuardRetaliate.cpp | 10 +- .../Source/GameLogic/AI/AIPathfind.cpp | 246 +++++++++--------- .../Source/GameLogic/AI/AIPlayer.cpp | 42 +-- .../Source/GameLogic/AI/AISkirmishPlayer.cpp | 24 +- .../Source/GameLogic/AI/AIStates.cpp | 114 ++++---- .../Source/GameLogic/AI/AITNGuard.cpp | 10 +- .../Source/GameLogic/AI/TurretAI.cpp | 12 +- .../Source/GameLogic/Map/PolygonTrigger.cpp | 2 +- .../Source/GameLogic/Map/SidesList.cpp | 16 +- .../Source/GameLogic/Map/TerrainLogic.cpp | 10 +- .../Object/Behavior/AutoHealBehavior.cpp | 2 +- .../Behavior/DumbProjectileBehavior.cpp | 6 +- .../Object/Behavior/FlightDeckBehavior.cpp | 2 +- .../Object/Behavior/MinefieldBehavior.cpp | 6 +- .../Object/Behavior/ParkingPlaceBehavior.cpp | 4 +- .../Object/Behavior/SlowDeathBehavior.cpp | 2 +- .../GameLogic/Object/Contain/OpenContain.cpp | 6 +- .../Object/Contain/ParachuteContain.cpp | 6 +- .../Source/GameLogic/Object/Locomotor.cpp | 18 +- .../Source/GameLogic/Object/Object.cpp | 16 +- .../GameLogic/Object/ObjectCreationList.cpp | 2 +- .../GameLogic/Object/PartitionManager.cpp | 40 +-- .../GameLogic/Object/SimpleObjectIterator.cpp | 8 +- .../GameLogic/Object/Update/AIUpdate.cpp | 72 ++--- .../AIUpdate/DeliverPayloadAIUpdate.cpp | 6 +- .../Update/AIUpdate/MissileAIUpdate.cpp | 6 +- .../Update/AIUpdate/RailroadGuideAIUpdate.cpp | 2 +- .../DockUpdate/SupplyWarehouseDockUpdate.cpp | 2 +- .../Update/MissileLauncherBuildingUpdate.cpp | 12 +- .../Object/Update/NeutronMissileUpdate.cpp | 6 +- .../GameLogic/Object/Update/PhysicsUpdate.cpp | 2 +- .../Object/Update/StructureCollapseUpdate.cpp | 2 +- .../Object/Update/StructureToppleUpdate.cpp | 8 +- .../GameLogic/Object/Update/ToppleUpdate.cpp | 4 +- .../Source/GameLogic/Object/Weapon.cpp | 88 +++---- .../Source/GameLogic/Object/WeaponSet.cpp | 8 +- .../GameLogic/ScriptEngine/ScriptActions.cpp | 30 +-- .../GameLogic/ScriptEngine/ScriptEngine.cpp | 52 ++-- .../Source/GameLogic/ScriptEngine/Scripts.cpp | 6 +- .../ScriptEngine/VictoryConditions.cpp | 6 +- .../Source/GameLogic/System/GameLogic.cpp | 104 ++++---- .../GameLogic/System/GameLogicDispatch.cpp | 20 +- .../Source/GameNetwork/Connection.cpp | 20 +- .../Source/GameNetwork/ConnectionManager.cpp | 234 ++++++++--------- .../Source/GameNetwork/DisconnectManager.cpp | 84 +++--- .../Source/GameNetwork/DownloadManager.cpp | 10 +- .../Source/GameNetwork/FileTransfer.cpp | 8 +- .../Source/GameNetwork/FirewallHelper.cpp | 160 ++++++------ .../Source/GameNetwork/FrameData.cpp | 18 +- .../Source/GameNetwork/FrameDataManager.cpp | 4 +- .../Source/GameNetwork/FrameMetrics.cpp | 4 +- .../Source/GameNetwork/GameInfo.cpp | 156 +++++------ .../Source/GameNetwork/GameSpy/GSConfig.cpp | 8 +- .../Source/GameNetwork/GameSpy/LadderDefs.cpp | 28 +- .../GameNetwork/GameSpy/MainMenuUtils.cpp | 34 +-- .../Source/GameNetwork/GameSpy/PeerDefs.cpp | 20 +- .../GameSpy/StagingRoomGameInfo.cpp | 52 ++-- .../GameSpy/Thread/BuddyThread.cpp | 34 +-- .../GameSpy/Thread/GameResultsThread.cpp | 12 +- .../GameNetwork/GameSpy/Thread/PeerThread.cpp | 182 ++++++------- .../Thread/PersistentStorageThread.cpp | 148 +++++------ .../GameNetwork/GameSpy/Thread/PingThread.cpp | 16 +- .../Source/GameNetwork/GameSpyChat.cpp | 4 +- .../Source/GameNetwork/GameSpyGP.cpp | 26 +- .../Source/GameNetwork/GameSpyGameInfo.cpp | 50 ++-- .../Source/GameNetwork/GameSpyOverlay.cpp | 16 +- .../Source/GameNetwork/IPEnumeration.cpp | 12 +- .../GameEngine/Source/GameNetwork/LANAPI.cpp | 36 +-- .../Source/GameNetwork/LANAPICallbacks.cpp | 32 +-- .../Source/GameNetwork/LANAPIhandlers.cpp | 18 +- .../Source/GameNetwork/LANGameInfo.cpp | 6 +- .../GameEngine/Source/GameNetwork/NAT.cpp | 168 ++++++------ .../Source/GameNetwork/NetCommandRef.cpp | 4 +- .../GameNetwork/NetCommandWrapperList.cpp | 2 +- .../Source/GameNetwork/NetMessageStream.cpp | 8 +- .../Source/GameNetwork/NetPacket.cpp | 238 ++++++++--------- .../GameEngine/Source/GameNetwork/Network.cpp | 82 +++--- .../Source/GameNetwork/NetworkUtil.cpp | 12 +- .../Source/GameNetwork/Transport.cpp | 34 +-- .../GameNetwork/WOLBrowser/WebBrowser.cpp | 10 +- .../MilesAudioDevice/MilesAudioManager.cpp | 16 +- .../StdDevice/Common/StdBIGFileSystem.cpp | 12 +- .../StdDevice/Common/StdLocalFileSystem.cpp | 10 +- .../VideoDevice/Bink/BinkVideoPlayer.cpp | 8 +- .../VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp | 8 +- .../Drawable/Draw/W3DDependencyModelDraw.cpp | 2 +- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 66 ++--- .../Drawable/Draw/W3DTankTruckDraw.cpp | 10 +- .../GameClient/Drawable/Draw/W3DTruckDraw.cpp | 12 +- .../W3DDevice/GameClient/FlatHeightMap.cpp | 2 +- .../W3DDevice/GameClient/GUI/W3DGameFont.cpp | 2 +- .../GameClient/Shadow/W3DVolumetricShadow.cpp | 4 +- .../W3DDevice/GameClient/W3DAssetManager.cpp | 8 +- .../W3DDevice/GameClient/W3DBridgeBuffer.cpp | 6 +- .../W3DDevice/GameClient/W3DDebugIcons.cpp | 2 +- .../W3DDevice/GameClient/W3DDisplay.cpp | 2 +- .../GameClient/W3DDisplayStringManager.cpp | 2 +- .../W3DDevice/GameClient/W3DRoadBuffer.cpp | 6 +- .../W3DDevice/GameClient/W3DShaderManager.cpp | 2 +- .../Source/W3DDevice/GameClient/W3DView.cpp | 28 +- .../W3DDevice/GameClient/W3DWebBrowser.cpp | 2 +- .../W3DDevice/GameClient/WorldHeightMap.cpp | 4 +- .../Win32Device/Common/Win32BIGFileSystem.cpp | 12 +- .../Common/Win32LocalFileSystem.cpp | 4 +- .../GameClient/Win32DIKeyboard.cpp | 22 +- .../Win32Device/GameClient/Win32DIMouse.cpp | 24 +- .../Source/WWVegas/WW3D2/dx8wrapper.cpp | 4 +- GeneralsMD/Code/Main/WinMain.cpp | 6 +- .../Code/Tools/GUIEdit/Source/GUIEdit.cpp | 10 +- .../Tools/GUIEdit/Source/HierarchyView.cpp | 12 +- .../Tools/GUIEdit/Source/LayoutScheme.cpp | 10 +- .../Code/Tools/GUIEdit/Source/Properties.cpp | 8 +- GeneralsMD/Code/Tools/GUIEdit/Source/Save.cpp | 16 +- .../ParticleEditor/ParticleTypePanels.cpp | 2 +- .../Code/Tools/WorldBuilder/src/BuildList.cpp | 20 +- .../WorldBuilder/src/GlobalLightOptions.cpp | 60 ++--- .../Tools/WorldBuilder/src/MapPreview.cpp | 6 +- .../Tools/WorldBuilder/src/ScriptDialog.cpp | 4 +- .../Tools/WorldBuilder/src/ShadowOptions.cpp | 2 +- .../Tools/WorldBuilder/src/WHeightMapEdit.cpp | 6 +- .../Code/Tools/WorldBuilder/src/WaterTool.cpp | 8 +- .../Tools/WorldBuilder/src/WorldBuilder.cpp | 6 +- .../WorldBuilder/src/WorldBuilderDoc.cpp | 38 +-- .../Tools/WorldBuilder/src/playerlistdlg.cpp | 4 +- .../Code/Tools/WorldBuilder/src/wbview.cpp | 4 +- .../Code/Tools/WorldBuilder/src/wbview3d.cpp | 10 +- 424 files changed, 4884 insertions(+), 4884 deletions(-) diff --git a/Core/Libraries/Source/Compression/CompressionManager.cpp b/Core/Libraries/Source/Compression/CompressionManager.cpp index f752360ccd..af955cdbe6 100644 --- a/Core/Libraries/Source/Compression/CompressionManager.cpp +++ b/Core/Libraries/Source/Compression/CompressionManager.cpp @@ -262,7 +262,7 @@ Int CompressionManager::compressData( CompressionType compType, void *srcVoid, I } else { - DEBUG_LOG(("ZLib compression error (level is %d, src len is %d) %d\n", level, srcLen, err)); + DEBUG_LOG(("ZLib compression error (level is %d, src len is %d) %d", level, srcLen, err)); return 0; } } @@ -327,7 +327,7 @@ Int CompressionManager::decompressData( void *srcVoid, Int srcLen, void *destVoi } else { - DEBUG_LOG(("ZLib decompression error (src is level %d, %d bytes long) %d\n", + DEBUG_LOG(("ZLib decompression error (src is level %d, %d bytes long) %d", compType - COMPRESSION_ZLIB1 + 1 /* 1-9 */, srcLen, err)); return 0; } @@ -387,7 +387,7 @@ void DoCompressTest( void ) File *f = TheFileSystem->openFile(it->first.str()); if (f) { - DEBUG_LOG(("***************************\nTesting '%s'\n\n", it->first.str())); + DEBUG_LOG(("***************************\nTesting '%s'\n", it->first.str())); Int origSize = f->size(); UnsignedByte *buf = (UnsignedByte *)f->readEntireAndClose(); UnsignedByte *uncompressedBuf = NEW UnsignedByte[origSize]; @@ -398,11 +398,11 @@ void DoCompressTest( void ) for (i=COMPRESSION_MIN; i<=COMPRESSION_MAX; ++i) { - DEBUG_LOG(("=================================================\n")); - DEBUG_LOG(("Compression Test %d\n", i)); + DEBUG_LOG(("=================================================")); + DEBUG_LOG(("Compression Test %d", i)); Int maxCompressedSize = CompressionManager::getMaxCompressedSize( origSize, (CompressionType)i ); - DEBUG_LOG(("Orig size is %d, max compressed size is %d bytes\n", origSize, maxCompressedSize)); + DEBUG_LOG(("Orig size is %d, max compressed size is %d bytes", origSize, maxCompressedSize)); UnsignedByte *compressedBuf = NEW UnsignedByte[maxCompressedSize]; memset(compressedBuf, 0, maxCompressedSize); @@ -420,9 +420,9 @@ void DoCompressTest( void ) s_decompressGathers[i]->stopTimer(); } d.compressedSize[i] = compressedLen; - DEBUG_LOG(("Compressed len is %d (%g%% of original size)\n", compressedLen, (double)compressedLen/(double)origSize*100.0)); + DEBUG_LOG(("Compressed len is %d (%g%% of original size)", compressedLen, (double)compressedLen/(double)origSize*100.0)); DEBUG_ASSERTCRASH(compressedLen, ("Failed to compress\n")); - DEBUG_LOG(("Decompressed len is %d (%g%% of original size)\n", decompressedLen, (double)decompressedLen/(double)origSize*100.0)); + DEBUG_LOG(("Decompressed len is %d (%g%% of original size)", decompressedLen, (double)decompressedLen/(double)origSize*100.0)); DEBUG_ASSERTCRASH(decompressedLen == origSize, ("orig size does not match compressed+uncompressed output\n")); if (decompressedLen == origSize) @@ -438,9 +438,9 @@ void DoCompressTest( void ) compressedBuf = NULL; } - DEBUG_LOG(("d = %d -> %d\n", d.origSize, d.compressedSize[i])); + DEBUG_LOG(("d = %d -> %d", d.origSize, d.compressedSize[i])); s_sizes[it->first] = d; - DEBUG_LOG(("s_sizes[%s] = %d -> %d\n", it->first.str(), s_sizes[it->first].origSize, s_sizes[it->first].compressedSize[i])); + DEBUG_LOG(("s_sizes[%s] = %d -> %d", it->first.str(), s_sizes[it->first].origSize, s_sizes[it->first].compressedSize[i])); delete[] buf; buf = NULL; @@ -469,13 +469,13 @@ void DoCompressTest( void ) totalUncompressedBytes += d.origSize; totalCompressedBytes += d.compressedSize[i]; } - DEBUG_LOG(("***************************************************\n")); - DEBUG_LOG(("Compression method %s:\n", CompressionManager::getCompressionNameByType((CompressionType)i))); - DEBUG_LOG(("%d bytes compressed to %d (%g%%)\n", totalUncompressedBytes, totalCompressedBytes, + DEBUG_LOG(("***************************************************")); + DEBUG_LOG(("Compression method %s:", CompressionManager::getCompressionNameByType((CompressionType)i))); + DEBUG_LOG(("%d bytes compressed to %d (%g%%)", totalUncompressedBytes, totalCompressedBytes, totalCompressedBytes/(Real)totalUncompressedBytes*100.0f)); - DEBUG_LOG(("Min ratio: %g%%, Max ratio: %g%%\n", + DEBUG_LOG(("Min ratio: %g%%, Max ratio: %g%%", minCompression*100.0f, maxCompression*100.0f)); - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } PerfGather::dumpAll(10000); diff --git a/Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp b/Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp index 6ef197afc3..5fca8aa916 100644 --- a/Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp +++ b/Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp @@ -95,7 +95,7 @@ Bool DecompressFile (char *infile, char *outfile) break; } - DEBUG_LOG(("Decompressed %s to %s, output size = %d\n", infile, outfile, rawSize)); + DEBUG_LOG(("Decompressed %s to %s, output size = %d", infile, outfile, rawSize)); LZHLDestroyDecompressor(decompress); outFilePtr = fopen(outfile, "wb"); diff --git a/Core/Libraries/Source/WWVegas/WWDownload/Download.cpp b/Core/Libraries/Source/WWVegas/WWDownload/Download.cpp index 4cb2f21582..fe06dfe95a 100644 --- a/Core/Libraries/Source/WWVegas/WWDownload/Download.cpp +++ b/Core/Libraries/Source/WWVegas/WWDownload/Download.cpp @@ -373,9 +373,9 @@ HRESULT CDownload::PumpMessages() DEBUG_LOG(("About to OnProgressUpdate() - m_FileSize=%d, m_BytesRead=%d, timetaken=%d, numerator=%d", m_FileSize, m_BytesRead, timetaken, ( ( m_FileSize - m_BytesRead ) * timetaken ))); - DEBUG_LOG((", m_startPosition=%d, denominator=%d, predictionTime=%d\n", + DEBUG_LOG((", m_startPosition=%d, denominator=%d, predictionTime=%d", m_StartPosition, ( m_BytesRead - m_StartPosition ), predictionIndex)); - DEBUG_LOG(("vals are %d %d %d %d %d %d %d %d\n", + DEBUG_LOG(("vals are %d %d %d %d %d %d %d %d", m_predictionTimes[ 0 ], m_predictionTimes[ 1 ], m_predictionTimes[ 2 ], m_predictionTimes[ 3 ], m_predictionTimes[ 4 ], m_predictionTimes[ 5 ], m_predictionTimes[ 6 ], m_predictionTimes[ 7 ])); diff --git a/Core/Libraries/Source/WWVegas/WWDownload/FTP.CPP b/Core/Libraries/Source/WWVegas/WWDownload/FTP.CPP index e847ce8691..7761d63087 100644 --- a/Core/Libraries/Source/WWVegas/WWDownload/FTP.CPP +++ b/Core/Libraries/Source/WWVegas/WWDownload/FTP.CPP @@ -1613,18 +1613,18 @@ HRESULT Cftp::GetNextFileBlock( LPCSTR szLocalFileName, int * piTotalRead ) char curdir[256]; _getcwd(curdir,256); Prepare_Directories(curdir, m_szLocalFileName); - DEBUG_LOG(("CWD: %s\n", curdir)); + DEBUG_LOG(("CWD: %s", curdir)); if( rename( downloadfilename, m_szLocalFileName ) != 0 ) { - DEBUG_LOG(("First rename of %s to %s failed with errno of %d\n", downloadfilename, m_szLocalFileName, errno)); + DEBUG_LOG(("First rename of %s to %s failed with errno of %d", downloadfilename, m_szLocalFileName, errno)); /* Error moving file - remove file that's already there and try again. */ _chmod( m_szLocalFileName, _S_IWRITE | _S_IREAD); // make sure it's not readonly - DEBUG_LOG(("_chmod of %s failed with errno of %d\n", m_szLocalFileName, errno)); + DEBUG_LOG(("_chmod of %s failed with errno of %d", m_szLocalFileName, errno)); remove( m_szLocalFileName ); - DEBUG_LOG(("remove of %s failed with errno of %d\n", m_szLocalFileName, errno)); + DEBUG_LOG(("remove of %s failed with errno of %d", m_szLocalFileName, errno)); if( rename( downloadfilename, m_szLocalFileName ) != 0 ) { - DEBUG_LOG(("Second rename of %s to %s failed with errno of %d\n", downloadfilename, m_szLocalFileName, errno)); + DEBUG_LOG(("Second rename of %s to %s failed with errno of %d", downloadfilename, m_szLocalFileName, errno)); return( FTP_FAILED ); } } diff --git a/Core/Tools/Autorun/GameText.cpp b/Core/Tools/Autorun/GameText.cpp index 8ee7df7d8f..a9246882f3 100644 --- a/Core/Tools/Autorun/GameText.cpp +++ b/Core/Tools/Autorun/GameText.cpp @@ -357,15 +357,15 @@ void GameTextManager::deinit( void ) NoString *noString = m_noStringList; - DEBUG_LOG(("\n*** Missing strings ***\n")); + DEBUG_LOG(("\n*** Missing strings ***")); while ( noString ) { - DEBUG_LOG(("*** %ls ***\n", noString->text.str())); + DEBUG_LOG(("*** %ls ***", noString->text.str())); NoString *next = noString->next; delete noString; noString = next; } - DEBUG_LOG(("*** End missing strings ***\n\n")); + DEBUG_LOG(("*** End missing strings ***\n")); m_noStringList = NULL; @@ -1085,7 +1085,7 @@ const wchar_t * GameTextManager::fetch( const Char *label ) noString = noString->next; } - //DEBUG_LOG(("*** MISSING:'%s' ***\n", label)); + //DEBUG_LOG(("*** MISSING:'%s' ***", label)); // Remember file could have been altered at this point. noString = new NoString; noString->text = missingString; diff --git a/Core/Tools/CRCDiff/expander.cpp b/Core/Tools/CRCDiff/expander.cpp index 4063b949d4..9e7961d5d0 100644 --- a/Core/Tools/CRCDiff/expander.cpp +++ b/Core/Tools/CRCDiff/expander.cpp @@ -57,31 +57,31 @@ void Expander::expand( const std::string& input, { // first time output.append(input.substr(0, pos)); - //DEBUG_LOG(("First time, output='%s'\n", output.c_str())); + //DEBUG_LOG(("First time, output='%s'", output.c_str())); } else { // done this before std::string sub = input.substr(lastpos, pos-lastpos); - //DEBUG_LOG(("*** lastpos = %d, pos=%d, sub='%s'\n", lastpos, pos, sub.c_str())); + //DEBUG_LOG(("*** lastpos = %d, pos=%d, sub='%s'", lastpos, pos, sub.c_str())); output.append(sub); - //DEBUG_LOG(("output='%s'\n", output.c_str())); + //DEBUG_LOG(("output='%s'", output.c_str())); } } else { - //DEBUG_LOG(("pos == 0\n")); + //DEBUG_LOG(("pos == 0")); } // pos is the first position of a possible expansion - //DEBUG_LOG(("Looking for endpos via '%s' in '%s'\n", m_right.c_str(), input.substr(pos+m_left.length()).c_str())); + //DEBUG_LOG(("Looking for endpos via '%s' in '%s'", m_right.c_str(), input.substr(pos+m_left.length()).c_str())); unsigned int endpos = input.find(m_right, pos+m_left.length()); - //DEBUG_LOG(("substr is %d-%d of '%s'\n", pos, endpos, input.c_str())); + //DEBUG_LOG(("substr is %d-%d of '%s'", pos, endpos, input.c_str())); if (endpos != input.npos) { // found a complete token - expand it std::string sub = input.substr(pos+m_left.length(), endpos-pos-m_left.length()); - //DEBUG_LOG(("found token: '%s'\n", sub.c_str())); + //DEBUG_LOG(("found token: '%s'", sub.c_str())); ExpansionMap::iterator it = m_expansions.find(sub); if (it == m_expansions.end()) @@ -100,9 +100,9 @@ void Expander::expand( const std::string& input, { std::string toExpand = it->second; std::string expanded = ""; - //DEBUG_LOG(("###### expanding '%s'\n", toExpand.c_str())); + //DEBUG_LOG(("###### expanding '%s'", toExpand.c_str())); expand(toExpand, expanded, stripUnknown); - //DEBUG_LOG(("###### expanded '%s'\n", expanded.c_str())); + //DEBUG_LOG(("###### expanded '%s'", expanded.c_str())); output.append(expanded); } } diff --git a/Core/Tools/Compress/Compress.cpp b/Core/Tools/Compress/Compress.cpp index 84d626c70d..72f7082f2a 100644 --- a/Core/Tools/Compress/Compress.cpp +++ b/Core/Tools/Compress/Compress.cpp @@ -28,12 +28,12 @@ void dumpHelp(const char *exe) { - DEBUG_LOG(("Usage:\n To print the compression type of an existing file: %s -in infile\n", exe)); - DEBUG_LOG((" To compress a file: %s -in infile -out outfile <-type compressionmode>\n\n", exe)); - DEBUG_LOG(("Compression modes:\n")); + DEBUG_LOG(("Usage:\n To print the compression type of an existing file: %s -in infile", exe)); + DEBUG_LOG((" To compress a file: %s -in infile -out outfile <-type compressionmode>\n", exe)); + DEBUG_LOG(("Compression modes:")); for (int i=COMPRESSION_MIN; i<=COMPRESSION_MAX; ++i) { - DEBUG_LOG((" %s\n", CompressionManager::getCompressionNameByType((CompressionType)i))); + DEBUG_LOG((" %s", CompressionManager::getCompressionNameByType((CompressionType)i))); } } @@ -92,7 +92,7 @@ int main(int argc, char **argv) return EXIT_SUCCESS; } - DEBUG_LOG(("IN:'%s' OUT:'%s' Compression:'%s'\n", + DEBUG_LOG(("IN:'%s' OUT:'%s' Compression:'%s'", inFile.c_str(), outFile.c_str(), CompressionManager::getCompressionNameByType(compressType))); // just check compression on the input file if we have no output specified @@ -101,7 +101,7 @@ int main(int argc, char **argv) FILE *fpIn = fopen(inFile.c_str(), "rb"); if (!fpIn) { - DEBUG_LOG(("Cannot open '%s'\n", inFile.c_str())); + DEBUG_LOG(("Cannot open '%s'", inFile.c_str())); return EXIT_FAILURE; } fseek(fpIn, 0, SEEK_END); @@ -114,20 +114,20 @@ int main(int argc, char **argv) if (numRead != 8) { - DEBUG_LOG(("Cannot read header from '%s'\n", inFile.c_str())); + DEBUG_LOG(("Cannot read header from '%s'", inFile.c_str())); return EXIT_FAILURE; } CompressionType usedType = CompressionManager::getCompressionType(data, 8); if (usedType == COMPRESSION_NONE) { - DEBUG_LOG(("No compression on '%s'\n", inFile.c_str())); + DEBUG_LOG(("No compression on '%s'", inFile.c_str())); return EXIT_SUCCESS; } int uncompressedSize = CompressionManager::getUncompressedSize(data, 8); - DEBUG_LOG(("'%s' is compressed using %s, from %d to %d bytes, %g%% of its original size\n", + DEBUG_LOG(("'%s' is compressed using %s, from %d to %d bytes, %g%% of its original size", inFile.c_str(), CompressionManager::getCompressionNameByType(usedType), uncompressedSize, size, size/(double)(uncompressedSize+0.1)*100.0)); @@ -138,7 +138,7 @@ int main(int argc, char **argv) FILE *fpIn = fopen(inFile.c_str(), "rb"); if (!fpIn) { - DEBUG_LOG(("Cannot open input '%s'\n", inFile.c_str())); + DEBUG_LOG(("Cannot open input '%s'", inFile.c_str())); return EXIT_FAILURE; } @@ -152,18 +152,18 @@ int main(int argc, char **argv) fclose(fpIn); if (numRead != inputSize) { - DEBUG_LOG(("Cannot read input '%s'\n", inFile.c_str())); + DEBUG_LOG(("Cannot read input '%s'", inFile.c_str())); delete[] inputData; return EXIT_FAILURE; } - DEBUG_LOG(("Read %d bytes from '%s'\n", numRead, inFile.c_str())); + DEBUG_LOG(("Read %d bytes from '%s'", numRead, inFile.c_str())); // Open the output file FILE *fpOut = fopen(outFile.c_str(), "wb"); if (!fpOut) { - DEBUG_LOG(("Cannot open output '%s'\n", outFile.c_str())); + DEBUG_LOG(("Cannot open output '%s'", outFile.c_str())); delete[] inputData; return EXIT_FAILURE; } @@ -171,7 +171,7 @@ int main(int argc, char **argv) if (compressType == COMPRESSION_NONE) { - DEBUG_LOG(("No compression requested, writing uncompressed data\n")); + DEBUG_LOG(("No compression requested, writing uncompressed data")); int outSize = CompressionManager::getUncompressedSize(inputData, inputSize); char *outData = new char[outSize]; CompressionManager::decompressData(inputData, inputSize, outData, outSize); @@ -181,7 +181,7 @@ int main(int argc, char **argv) } else { - DEBUG_LOG(("Compressing data using %s\n", CompressionManager::getCompressionNameByType(compressType))); + DEBUG_LOG(("Compressing data using %s", CompressionManager::getCompressionNameByType(compressType))); // Allocate the output buffer int outSize = CompressionManager::getMaxCompressedSize(inputSize, compressType); char *outData = new char[outSize]; diff --git a/Core/Tools/MapCacheBuilder/Source/WinMain.cpp b/Core/Tools/MapCacheBuilder/Source/WinMain.cpp index fd29d7d49d..b1f4c488fa 100644 --- a/Core/Tools/MapCacheBuilder/Source/WinMain.cpp +++ b/Core/Tools/MapCacheBuilder/Source/WinMain.cpp @@ -245,7 +245,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, while (token != NULL) { char * str = strtrim(token); argvSet.push_back(str); - DEBUG_LOG(("Adding '%s'\n", str)); + DEBUG_LOG(("Adding '%s'", str)); token = nextParam(NULL, "\" "); } @@ -294,7 +294,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, // add in allowed maps for (std::list::const_iterator cit = argvSet.begin(); cit != argvSet.end(); ++cit) { - DEBUG_LOG(("Adding shipping map: '%s'\n", cit->c_str())); + DEBUG_LOG(("Adding shipping map: '%s'", cit->c_str())); TheMapCache->addShippingMap((*cit).c_str()); } diff --git a/Core/Tools/PATCHGET/CHATAPI.CPP b/Core/Tools/PATCHGET/CHATAPI.CPP index e89fdc781f..522cad59ea 100644 --- a/Core/Tools/PATCHGET/CHATAPI.CPP +++ b/Core/Tools/PATCHGET/CHATAPI.CPP @@ -186,7 +186,7 @@ static void startOnline( void ) { if (MessageBox(NULL, "Patches Available. Download?", GAME_NAME, MB_YESNO) == IDYES) { - DEBUG_LOG(("Downloading patches\n")); + DEBUG_LOG(("Downloading patches")); while (queuedDownloads.size()) { TheDownload = queuedDownloads.front(); @@ -196,7 +196,7 @@ static void startOnline( void ) int retVal = DialogBox(Global_instance, MAKEINTRESOURCE(IDD_DOWNLOAD_DIALOG), g_PrimaryWindow, downloadDialogProc); if (retVal) { - DEBUG_LOG(("Error %d\n", GetLastError())); + DEBUG_LOG(("Error %d", GetLastError())); } /**/ /* @@ -369,7 +369,7 @@ static void queuePatch(bool mandatory, std::string downloadURL) } fileDir.append(fileName); - DEBUG_LOG(("download URL split: %d [%s] [%s] [%s] [%s] [%s] [%s] [%s]\n", + DEBUG_LOG(("download URL split: %d [%s] [%s] [%s] [%s] [%s] [%s] [%s]", success, connectionType.c_str(), server.c_str(), user.c_str(), pass.c_str(), filePath.c_str(), fileName.c_str(), fileDir.c_str())); @@ -402,7 +402,7 @@ static GHTTPBool patchCheckCallback( GHTTPRequest request, GHTTPResult result, c --checksLeft; DEBUG_ASSERTCRASH(checksLeft>=0, ("Too many callbacks")); - DEBUG_LOG(("Result=%d, buffer=[%s], len=%d\n", result, buffer, bufferLen)); + DEBUG_LOG(("Result=%d, buffer=[%s], len=%d", result, buffer, bufferLen)); if (result != GHTTPSuccess) { cantConnect = true; @@ -424,7 +424,7 @@ static GHTTPBool patchCheckCallback( GHTTPRequest request, GHTTPResult result, c ok = ok && nextToken(line, url, " "); if (ok && type == "patch") { - DEBUG_LOG(("Saw a patch: %d/[%s]\n", atoi(req.c_str()), url.c_str())); + DEBUG_LOG(("Saw a patch: %d/[%s]", atoi(req.c_str()), url.c_str())); queuePatch( atoi(req.c_str()), url ); } else if (ok && type == "server") @@ -465,7 +465,7 @@ static void StartPatchCheck( void ) ghttpGet(gameURL.c_str(), GHTTPFalse, patchCheckCallback, NULL); ghttpGet(mapURL.c_str(), GHTTPFalse, patchCheckCallback, NULL); - DEBUG_LOG(("Started looking for patches at '%s' && '%s'\n", gameURL.c_str(), mapURL.c_str())); + DEBUG_LOG(("Started looking for patches at '%s' && '%s'", gameURL.c_str(), mapURL.c_str())); } /////////////////////////////////////////////////////////////////////////////////////// @@ -541,15 +541,15 @@ BOOL CALLBACK downloadDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM break; case WM_TIMER: - DEBUG_LOG(("TIMER\n")); + DEBUG_LOG(("TIMER")); if( g_Finished == 0 ) { - DEBUG_LOG(("Entering PumpMsgs\n")); + DEBUG_LOG(("Entering PumpMsgs")); TheDownloadManager->update(); /* pDownload->PumpMessages(); */ - DEBUG_LOG(("Done with PumpMsgs\n")); + DEBUG_LOG(("Done with PumpMsgs")); if (strlen(g_DLTimeRem)) SetDlgItemText( hwndDlg, IDC_TIMEREM, g_DLTimeRem ); if (strlen(g_DLBytesLeft)) @@ -559,7 +559,7 @@ BOOL CALLBACK downloadDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM } else { - DEBUG_LOG(("TIMER: Finished\n")); + DEBUG_LOG(("TIMER: Finished")); EndDialog( hwndDlg, g_Finished ); DestroyWindow( hwndDlg ); } diff --git a/Core/Tools/PATCHGET/DownloadManager.cpp b/Core/Tools/PATCHGET/DownloadManager.cpp index 50d649ee3f..fd5112385f 100644 --- a/Core/Tools/PATCHGET/DownloadManager.cpp +++ b/Core/Tools/PATCHGET/DownloadManager.cpp @@ -153,27 +153,27 @@ HRESULT DownloadManager::OnError( int error ) break; } m_errorString = s; - DEBUG_LOG(("DownloadManager::OnError(): %s(%d)\n", s.c_str(), error)); + DEBUG_LOG(("DownloadManager::OnError(): %s(%d)", s.c_str(), error)); return S_OK; } HRESULT DownloadManager::OnEnd() { m_sawEnd = true; - DEBUG_LOG(("DownloadManager::OnEnd()\n")); + DEBUG_LOG(("DownloadManager::OnEnd()")); return S_OK; } HRESULT DownloadManager::OnQueryResume() { - DEBUG_LOG(("DownloadManager::OnQueryResume()\n")); + DEBUG_LOG(("DownloadManager::OnQueryResume()")); //return DOWNLOADEVENT_DONOTRESUME; return DOWNLOADEVENT_RESUME; } HRESULT DownloadManager::OnProgressUpdate( int bytesread, int totalsize, int timetaken, int timeleft ) { - DEBUG_LOG(("DownloadManager::OnProgressUpdate(): %d/%d %d/%d\n", bytesread, totalsize, timetaken, timeleft)); + DEBUG_LOG(("DownloadManager::OnProgressUpdate(): %d/%d %d/%d", bytesread, totalsize, timetaken, timeleft)); return S_OK; } @@ -208,7 +208,7 @@ HRESULT DownloadManager::OnStatusUpdate( int status ) break; } m_statusString = s; - DEBUG_LOG(("DownloadManager::OnStatusUpdate(): %s(%d)\n", s.c_str(), status)); + DEBUG_LOG(("DownloadManager::OnStatusUpdate(): %s(%d)", s.c_str(), status)); return S_OK; } diff --git a/Core/Tools/matchbot/matcher.cpp b/Core/Tools/matchbot/matcher.cpp index 9af08ecf97..a6426d6282 100644 --- a/Core/Tools/matchbot/matcher.cpp +++ b/Core/Tools/matchbot/matcher.cpp @@ -240,29 +240,29 @@ static void NickErrorCallback ( PEER peer, int type, const char * badNick, int n void callbackEach( CHAT chat, CHATBool success, int index, const char *channel, const char *topic, int numUsers, void *param ) { - DEBUG_LOG(("Chat channel success: %d\n", success)); + DEBUG_LOG(("Chat channel success: %d", success)); if (!success) { return; } - DEBUG_LOG(("Channel[%d]: %s (%s), %d users\n", + DEBUG_LOG(("Channel[%d]: %s (%s), %d users", index, channel, topic, numUsers)); } void callbackAll( CHAT chat, CHATBool success, int numChannels, const char **channels, const char **topics, int *numUsers, void *param ) { - DEBUG_LOG(("Chat channels success: %d\n", success)); + DEBUG_LOG(("Chat channels success: %d", success)); if (!success) { return; } - DEBUG_LOG(("%d channels found\n", numChannels)); + DEBUG_LOG(("%d channels found", numChannels)); for (int i=0; i "); commandLine.append(dxtOutFname); - DEBUG_LOG(("Compressing textures with command line of '%s'\n", commandLine.c_str())); + DEBUG_LOG(("Compressing textures with command line of '%s'", commandLine.c_str())); int ret = system(commandLine.c_str()); - DEBUG_LOG(("system(%s) returned %d\n", commandLine.c_str(), ret)); + DEBUG_LOG(("system(%s) returned %d", commandLine.c_str(), ret)); DeleteFile(tmpFname); // now copy compressed file to target dir @@ -375,16 +375,16 @@ void compressOrigFiles(const std::string& sourceDirName, const std::string& targ dest.append(*sit); dest.replace(dest.size()-4, 4, ".dds"); - DEBUG_LOG(("Copying new file from %s to %s\n", src.c_str(), dest.c_str())); + DEBUG_LOG(("Copying new file from %s to %s", src.c_str(), dest.c_str())); if (_chmod(dest.c_str(), _S_IWRITE | _S_IREAD) == -1) { - DEBUG_LOG(("Cannot chmod '%s'\n", dest.c_str())); + DEBUG_LOG(("Cannot chmod '%s'", dest.c_str())); } BOOL ret = CopyFile(src.c_str(), dest.c_str(), FALSE); if (!ret) { - DEBUG_LOG(("Could not copy file!\n")); + DEBUG_LOG(("Could not copy file!")); } _utime(dest.c_str(), &utb); @@ -408,23 +408,23 @@ void copyOrigFiles(const std::string& sourceDirName, const std::string& targetDi if (_chmod(dest.c_str(), _S_IWRITE | _S_IREAD) == -1) { - DEBUG_LOG(("Cannot chmod '%s'\n", dest.c_str())); + DEBUG_LOG(("Cannot chmod '%s'", dest.c_str())); } BOOL res = CopyFile(src.c_str(), dest.c_str(), FALSE); - DEBUG_LOG(("Copying file: %s returns %d\n", src.c_str(), res)); + DEBUG_LOG(("Copying file: %s returns %d", src.c_str(), res)); } } //------------------------------------------------------------------------------------------------- static void scanDir( const std::string& sourceDirName, const std::string& targetDirName, const std::string& cacheDirName, const std::string& dxtOutFname ) { - DEBUG_LOG(("Scanning '%s'\n", sourceDirName.c_str())); + DEBUG_LOG(("Scanning '%s'", sourceDirName.c_str())); Directory sourceDir(sourceDirName); - DEBUG_LOG(("Scanning '%s'\n", targetDirName.c_str())); + DEBUG_LOG(("Scanning '%s'", targetDirName.c_str())); Directory targetDir(targetDirName); - DEBUG_LOG(("Scanning '%s'\n", cacheDirName.c_str())); + DEBUG_LOG(("Scanning '%s'", cacheDirName.c_str())); Directory cacheDir(cacheDirName); FileInfoSet *sourceFiles = sourceDir.getFiles(); @@ -436,7 +436,7 @@ static void scanDir( const std::string& sourceDirName, const std::string& target StringSet origFilesToCompress; StringSet origFilesToCopy; - DEBUG_LOG(("Emptying targetDir\n")); + DEBUG_LOG(("Emptying targetDir")); for (FileInfoSet::iterator targetIt = targetFiles->begin(); targetIt != targetFiles->end(); ++targetIt) { FileInfo f = *targetIt; @@ -452,7 +452,7 @@ static void scanDir( const std::string& sourceDirName, const std::string& target { fname.insert(0, "\\"); fname.insert(0, targetDirName); - DEBUG_LOG(("Deleting now-removed file '%s'\n", fname.c_str())); + DEBUG_LOG(("Deleting now-removed file '%s'", fname.c_str())); DeleteFile(fname.c_str()); } } diff --git a/Generals/Code/GameEngine/Include/GameClient/LanguageFilter.h b/Generals/Code/GameEngine/Include/GameClient/LanguageFilter.h index 67862d6981..855d7abd49 100644 --- a/Generals/Code/GameEngine/Include/GameClient/LanguageFilter.h +++ b/Generals/Code/GameEngine/Include/GameClient/LanguageFilter.h @@ -57,9 +57,9 @@ struct UnicodeStringsEqual Bool retval = (a.compareNoCase(b) == 0); DEBUG_LOG(("Comparing %ls with %ls, return value is ", a.str(), b.str())); if (retval) { - DEBUG_LOG(("true.\n")); + DEBUG_LOG(("true.")); } else { - DEBUG_LOG(("false.\n")); + DEBUG_LOG(("false.")); } return retval; } diff --git a/Generals/Code/GameEngine/Include/GameNetwork/LANGameInfo.h b/Generals/Code/GameEngine/Include/GameNetwork/LANGameInfo.h index 1ea0026c2c..4708d8936d 100644 --- a/Generals/Code/GameEngine/Include/GameNetwork/LANGameInfo.h +++ b/Generals/Code/GameEngine/Include/GameNetwork/LANGameInfo.h @@ -151,7 +151,7 @@ class LANGameInfo : public GameInfo /// Set the last time we heard from the player inline void setPlayerLastHeard( int who, UnsignedInt lastHeard ) { - DEBUG_LOG(("LANGameInfo::setPlayerLastHeard - changing player %d last heard from %d to %d\n", who, getPlayerLastHeard(who), lastHeard)); + DEBUG_LOG(("LANGameInfo::setPlayerLastHeard - changing player %d last heard from %d to %d", who, getPlayerLastHeard(who), lastHeard)); if (m_LANSlot[who].isHuman()) m_LANSlot[who].setLastHeard(lastHeard); } diff --git a/Generals/Code/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h b/Generals/Code/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h index 8843ff6966..455f19f6e2 100644 --- a/Generals/Code/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h +++ b/Generals/Code/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h @@ -84,7 +84,7 @@ public C if ( m_dispatch == NULL ) { - DEBUG_LOG(("Error creating Dispatch for Web interface\n")); + DEBUG_LOG(("Error creating Dispatch for Web interface")); } } diff --git a/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp b/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp index 6a1862fa3e..78892d21ae 100644 --- a/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp +++ b/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp @@ -470,7 +470,7 @@ AudioHandle AudioManager::addAudioEvent(const AudioEventRTS *eventToAdd) // cull muted audio if (audioEvent->getVolume() < TheAudio->getAudioSettings()->m_minVolume) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" - culled due to muting (%d).\n", audioEvent->getVolume())); + DEBUG_LOG((" - culled due to muting (%d).", audioEvent->getVolume())); #endif releaseAudioEventRTS(audioEvent); return AHSV_Muted; diff --git a/Generals/Code/GameEngine/Source/Common/Audio/GameSounds.cpp b/Generals/Code/GameEngine/Source/Common/Audio/GameSounds.cpp index c224f33b48..eeb5b202a9 100644 --- a/Generals/Code/GameEngine/Source/Common/Audio/GameSounds.cpp +++ b/Generals/Code/GameEngine/Source/Common/Audio/GameSounds.cpp @@ -141,7 +141,7 @@ void SoundManager::addAudioEvent(AudioEventRTS *&eventToAdd) if (canPlayNow(eventToAdd)) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" - appended to request list with handle '%d'.\n", (UnsignedInt) eventToAdd->getPlayingHandle())); + DEBUG_LOG((" - appended to request list with handle '%d'.", (UnsignedInt) eventToAdd->getPlayingHandle())); #endif AudioRequest *audioRequest = TheAudio->allocateAudioRequest( true ); audioRequest->m_pendingEvent = eventToAdd; @@ -223,7 +223,7 @@ Bool SoundManager::canPlayNow( AudioEventRTS *event ) if (distance.length() >= event->getAudioEventInfo()->m_maxDistance) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("- culled due to distance (%.2f).\n", distance.length())); + DEBUG_LOG(("- culled due to distance (%.2f).", distance.length())); #endif return false; } @@ -233,7 +233,7 @@ Bool SoundManager::canPlayNow( AudioEventRTS *event ) ThePartitionManager->getShroudStatusForPlayer(localPlayerNdx, pos) != CELLSHROUD_CLEAR ) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("- culled due to shroud.\n")); + DEBUG_LOG(("- culled due to shroud.")); #endif return false; } @@ -250,7 +250,7 @@ Bool SoundManager::canPlayNow( AudioEventRTS *event ) else { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("- culled due to voice.\n")); + DEBUG_LOG(("- culled due to voice.")); #endif return false; } @@ -259,7 +259,7 @@ Bool SoundManager::canPlayNow( AudioEventRTS *event ) if( TheAudio->doesViolateLimit( event ) ) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("- culled due to limit.\n" )); + DEBUG_LOG(("- culled due to limit." )); #endif return false; } @@ -302,7 +302,7 @@ Bool SoundManager::canPlayNow( AudioEventRTS *event ) else { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("- culled due to no channels available and non-interrupting.\n" )); + DEBUG_LOG(("- culled due to no channels available and non-interrupting." )); #endif return false; } diff --git a/Generals/Code/GameEngine/Source/Common/Audio/simpleplayer.cpp b/Generals/Code/GameEngine/Source/Common/Audio/simpleplayer.cpp index 6eccd1f575..d734b41fd5 100644 --- a/Generals/Code/GameEngine/Source/Common/Audio/simpleplayer.cpp +++ b/Generals/Code/GameEngine/Source/Common/Audio/simpleplayer.cpp @@ -159,14 +159,14 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnSample( return( E_UNEXPECTED ); } - DEBUG_LOG(( " New Sample of length %d and PS time %d ms\n", + DEBUG_LOG(( " New Sample of length %d and PS time %d ms", cbData, ( DWORD ) ( cnsSampleTime / 10000 ) )); LPWAVEHDR pwh = (LPWAVEHDR) new BYTE[ sizeof( WAVEHDR ) + cbData ]; if( NULL == pwh ) { - DEBUG_LOG(( "OnSample OUT OF MEMORY! \n")); + DEBUG_LOG(( "OnSample OUT OF MEMORY! ")); *m_phrCompletion = E_OUTOFMEMORY; SetEvent( m_hCompletionEvent ); @@ -189,7 +189,7 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnSample( if( mmr != MMSYSERR_NOERROR ) { - DEBUG_LOG(( "failed to prepare wave buffer, error=%lu\n" , mmr )); + DEBUG_LOG(( "failed to prepare wave buffer, error=%lu" , mmr )); *m_phrCompletion = E_UNEXPECTED; SetEvent( m_hCompletionEvent ); return( E_UNEXPECTED ); @@ -202,7 +202,7 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnSample( { delete pwh; - DEBUG_LOG(( "failed to write wave sample, error=%lu\n" , mmr )); + DEBUG_LOG(( "failed to write wave sample, error=%lu" , mmr )); *m_phrCompletion = E_UNEXPECTED; SetEvent( m_hCompletionEvent ); return( E_UNEXPECTED ); @@ -235,7 +235,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if( NULL == pszCheck ) { - DEBUG_LOG(( "internal error %lu\n" , GetLastError() )); + DEBUG_LOG(( "internal error %lu" , GetLastError() )); return E_UNEXPECTED ; } @@ -251,7 +251,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if( NULL == m_pszUrl ) { - DEBUG_LOG(( "insufficient Memory\n" )) ; + DEBUG_LOG(( "insufficient Memory" )) ; return( E_OUTOFMEMORY ); } @@ -276,7 +276,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if( FAILED( hr ) ) { - DEBUG_LOG(( "failed to create audio reader (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "failed to create audio reader (hr=0x%08x)" , hr )); return( hr ); } @@ -291,13 +291,13 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple } if ( NS_E_NO_STREAM == hr ) { - DEBUG_LOG(( "Waiting for transmission to begin...\n" )); + DEBUG_LOG(( "Waiting for transmission to begin..." )); WaitForSingleObject( m_hOpenEvent, INFINITE ); hr = m_hrOpen; } if ( FAILED( hr ) ) { - DEBUG_LOG(( "failed to open (hr=0x%08x)\n", hr )); + DEBUG_LOG(( "failed to open (hr=0x%08x)", hr )); return( hr ); } @@ -308,7 +308,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple hr = m_pReader->QueryInterface( IID_IWMHeaderInfo, ( VOID ** )&m_pHeader ); if ( FAILED( hr ) ) { - DEBUG_LOG(( "failed to qi for header interface (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "failed to qi for header interface (hr=0x%08x)" , hr )); return( hr ); } @@ -317,7 +317,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple hr = m_pHeader->GetAttributeCount( 0, &wAttrCnt ); if ( FAILED( hr ) ) { - DEBUG_LOG(( "GetAttributeCount Failed (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "GetAttributeCount Failed (hr=0x%08x)" , hr )); return( hr ); } @@ -334,7 +334,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple hr = m_pHeader->GetAttributeByIndex( i, &wStream, NULL, &cchNamelen, &type, NULL, &cbLength ); if ( FAILED( hr ) ) { - DEBUG_LOG(( "GetAttributeByIndex Failed (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "GetAttributeByIndex Failed (hr=0x%08x)" , hr )); break; } @@ -350,35 +350,35 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple hr = m_pHeader->GetAttributeByIndex( i, &wStream, pwszName, &cchNamelen, &type, pValue, &cbLength ); if ( FAILED( hr ) ) { - DEBUG_LOG(( "GetAttributeByIndex Failed (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "GetAttributeByIndex Failed (hr=0x%08x)" , hr )); break; } switch ( type ) { case WMT_TYPE_DWORD: - DEBUG_LOG(("%ws: %u\n" , pwszName, *((DWORD *) pValue) )); + DEBUG_LOG(("%ws: %u" , pwszName, *((DWORD *) pValue) )); break; case WMT_TYPE_STRING: - DEBUG_LOG(("%ws: %ws\n" , pwszName, (WCHAR *) pValue )); + DEBUG_LOG(("%ws: %ws" , pwszName, (WCHAR *) pValue )); break; case WMT_TYPE_BINARY: - DEBUG_LOG(("%ws: Type = Binary of Length %u\n" , pwszName, cbLength )); + DEBUG_LOG(("%ws: Type = Binary of Length %u" , pwszName, cbLength )); break; case WMT_TYPE_BOOL: - DEBUG_LOG(("%ws: %s\n" , pwszName, ( * ( ( BOOL * ) pValue) ? _T( "true" ) : _T( "false" ) ) )); + DEBUG_LOG(("%ws: %s" , pwszName, ( * ( ( BOOL * ) pValue) ? _T( "true" ) : _T( "false" ) ) )); break; case WMT_TYPE_WORD: - DEBUG_LOG(("%ws: %hu\n" , pwszName, *((WORD *) pValue) )); + DEBUG_LOG(("%ws: %hu" , pwszName, *((WORD *) pValue) )); break; case WMT_TYPE_QWORD: - DEBUG_LOG(("%ws: %I64u\n" , pwszName, *((QWORD *) pValue) )); + DEBUG_LOG(("%ws: %I64u" , pwszName, *((QWORD *) pValue) )); break; case WMT_TYPE_GUID: - DEBUG_LOG(("%ws: %I64x%I64x\n" , pwszName, *((QWORD *) pValue), *((QWORD *) pValue + 1) )); + DEBUG_LOG(("%ws: %I64x%I64x" , pwszName, *((QWORD *) pValue), *((QWORD *) pValue + 1) )); break; default: - DEBUG_LOG(("%ws: Type = %d, Length %u\n" , pwszName, type, cbLength )); + DEBUG_LOG(("%ws: Type = %d, Length %u" , pwszName, type, cbLength )); break; } @@ -408,13 +408,13 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple hr = m_pReader->GetOutputCount( &cOutputs ); if ( FAILED( hr ) ) { - DEBUG_LOG(( "failed GetOutputCount(), (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "failed GetOutputCount(), (hr=0x%08x)" , hr )); return( hr ); } if ( cOutputs != 1 ) { - DEBUG_LOG(( "Not audio only (cOutputs = %d).\n" , cOutputs )); + DEBUG_LOG(( "Not audio only (cOutputs = %d)." , cOutputs )); // return( E_UNEXPECTED ); } @@ -422,7 +422,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple hr = m_pReader->GetOutputProps( 0, &pProps ); if ( FAILED( hr ) ) { - DEBUG_LOG(( "failed GetOutputProps(), (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "failed GetOutputProps(), (hr=0x%08x)" , hr )); return( hr ); } @@ -432,7 +432,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if ( FAILED( hr ) ) { pProps->Release( ); - DEBUG_LOG(( "GetMediaType failed (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "GetMediaType failed (hr=0x%08x)" , hr )); return( hr ); } @@ -442,7 +442,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if ( FAILED( hr ) ) { pProps->Release( ); - DEBUG_LOG(( "GetMediaType failed (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "GetMediaType failed (hr=0x%08x)" , hr )); return( hr ); } @@ -451,7 +451,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if ( pMediaType->majortype != WMMEDIATYPE_Audio ) { delete[] (BYTE *) pMediaType ; - DEBUG_LOG(( "Not audio only (major type mismatch).\n" )); + DEBUG_LOG(( "Not audio only (major type mismatch)." )); return( E_UNEXPECTED ); } @@ -477,7 +477,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if( mmr != MMSYSERR_NOERROR ) { - DEBUG_LOG(( "failed to open wav output device, error=%lu\n" , mmr )); + DEBUG_LOG(( "failed to open wav output device, error=%lu" , mmr )); return( E_UNEXPECTED ); } @@ -489,7 +489,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if( FAILED( hr ) ) { - DEBUG_LOG(( "failed Start(), (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "failed Start(), (hr=0x%08x)" , hr )); return( hr ); } @@ -508,39 +508,39 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnStatus( switch( Status ) { case WMT_OPENED: - DEBUG_LOG(( "OnStatus( WMT_OPENED )\n" )); + DEBUG_LOG(( "OnStatus( WMT_OPENED )" )); m_hrOpen = hr; SetEvent( m_hOpenEvent ); break; case WMT_SOURCE_SWITCH: - DEBUG_LOG(( "OnStatus( WMT_SOURCE_SWITCH )\n" )); + DEBUG_LOG(( "OnStatus( WMT_SOURCE_SWITCH )" )); m_hrOpen = hr; SetEvent( m_hOpenEvent ); break; case WMT_ERROR: - DEBUG_LOG(( "OnStatus( WMT_ERROR )\n" )); + DEBUG_LOG(( "OnStatus( WMT_ERROR )" )); break; case WMT_STARTED: - DEBUG_LOG(( "OnStatus( WMT_STARTED )\n" )); + DEBUG_LOG(( "OnStatus( WMT_STARTED )" )); break; case WMT_STOPPED: - DEBUG_LOG(( "OnStatus( WMT_STOPPED )\n" )); + DEBUG_LOG(( "OnStatus( WMT_STOPPED )" )); break; case WMT_BUFFERING_START: - DEBUG_LOG(( "OnStatus( WMT_BUFFERING START)\n" )); + DEBUG_LOG(( "OnStatus( WMT_BUFFERING START)" )); break; case WMT_BUFFERING_STOP: - DEBUG_LOG(( "OnStatus( WMT_BUFFERING STOP)\n" )); + DEBUG_LOG(( "OnStatus( WMT_BUFFERING STOP)" )); break; case WMT_EOF: - DEBUG_LOG(( "OnStatus( WMT_EOF )\n" )); + DEBUG_LOG(( "OnStatus( WMT_EOF )" )); // // cleanup and exit @@ -556,7 +556,7 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnStatus( break; case WMT_END_OF_SEGMENT: - DEBUG_LOG(( "OnStatus( WMT_END_OF_SEGMENT )\n" )); + DEBUG_LOG(( "OnStatus( WMT_END_OF_SEGMENT )" )); // // cleanup and exit @@ -572,11 +572,11 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnStatus( break; case WMT_LOCATING: - DEBUG_LOG(( "OnStatus( WMT_LOCATING )\n" )); + DEBUG_LOG(( "OnStatus( WMT_LOCATING )" )); break; case WMT_CONNECTING: - DEBUG_LOG(( "OnStatus( WMT_CONNECTING )\n" )); + DEBUG_LOG(( "OnStatus( WMT_CONNECTING )" )); break; case WMT_NO_RIGHTS: @@ -595,7 +595,7 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnStatus( if( FAILED( hr ) ) { - DEBUG_LOG(( "Unable to launch web browser to retrieve playback license (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "Unable to launch web browser to retrieve playback license (hr=0x%08x)" , hr )); } delete [] pwszEscapedURL; @@ -606,7 +606,7 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnStatus( case WMT_MISSING_CODEC: { - DEBUG_LOG(( "Missing codec: (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "Missing codec: (hr=0x%08x)" , hr )); break; } diff --git a/Generals/Code/GameEngine/Source/Common/CRCDebug.cpp b/Generals/Code/GameEngine/Source/Common/CRCDebug.cpp index dbaae90a1a..924ba5d4e6 100644 --- a/Generals/Code/GameEngine/Source/Common/CRCDebug.cpp +++ b/Generals/Code/GameEngine/Source/Common/CRCDebug.cpp @@ -82,7 +82,7 @@ CRCVerification::~CRCVerification() { TheInGameUI->message(UnicodeString(L"GameLogic changed outside of GameLogic::update() - call Matt (x36804)!")); } - CRCDEBUG_LOG(("GameLogic changed outside of GameLogic::update()!!!\n")); + CRCDEBUG_LOG(("GameLogic changed outside of GameLogic::update()!!!")); } /**/ #endif @@ -102,7 +102,7 @@ void outputCRCDebugLines( void ) for (Int i=start; igetPath_UserData().str(), args[1]); } - DEBUG_LOG(("Looking for mod '%s'\n", modPath.str())); + DEBUG_LOG(("Looking for mod '%s'", modPath.str())); if (!TheLocalFileSystem->doesFileExist(modPath.str())) { - DEBUG_LOG(("Mod does not exist.\n")); + DEBUG_LOG(("Mod does not exist.")); return 2; // no such file/dir. } @@ -1081,7 +1081,7 @@ Int parseMod(char *args[], Int num) struct _stat statBuf; if (_stat(modPath.str(), &statBuf) != 0) { - DEBUG_LOG(("Could not _stat() mod.\n")); + DEBUG_LOG(("Could not _stat() mod.")); return 2; // could not stat the file/dir. } @@ -1089,12 +1089,12 @@ Int parseMod(char *args[], Int num) { if (!modPath.endsWith("\\") && !modPath.endsWith("/")) modPath.concat('\\'); - DEBUG_LOG(("Mod dir is '%s'.\n", modPath.str())); + DEBUG_LOG(("Mod dir is '%s'.", modPath.str())); TheWritableGlobalData->m_modDir = modPath; } else { - DEBUG_LOG(("Mod file is '%s'.\n", modPath.str())); + DEBUG_LOG(("Mod file is '%s'.", modPath.str())); TheWritableGlobalData->m_modBIG = modPath; } @@ -1405,7 +1405,7 @@ static void parseCommandLine(const CommandLineParam* params, int numParams) { DEBUG_LOG((" %s", argv[arg])); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); DebugSetFlags(debugFlags); // turn timestamps back on iff they were on before arg = 1; #endif // DEBUG_LOGGING diff --git a/Generals/Code/GameEngine/Source/Common/GameEngine.cpp b/Generals/Code/GameEngine/Source/Common/GameEngine.cpp index bff2391a23..09ac26ccb5 100644 --- a/Generals/Code/GameEngine/Source/Common/GameEngine.cpp +++ b/Generals/Code/GameEngine/Source/Common/GameEngine.cpp @@ -138,7 +138,7 @@ void DeepCRCSanityCheck::reset(void) fname.format("%sCRCAfter%dMaps.dat", TheGlobalData->getPath_UserData().str(), timesThrough); UnsignedInt thisCRC = TheGameLogic->getCRC( CRC_RECALC, fname ); - DEBUG_LOG(("DeepCRCSanityCheck: CRC is %X\n", thisCRC)); + DEBUG_LOG(("DeepCRCSanityCheck: CRC is %X", thisCRC)); DEBUG_ASSERTCRASH(timesThrough == 0 || thisCRC == lastCRC, ("CRC after reset did not match beginning CRC!\nNetwork games won't work after this.\nOld: 0x%8.8X, New: 0x%8.8X", lastCRC, thisCRC)); @@ -238,7 +238,7 @@ GameEngine::~GameEngine() void GameEngine::setFramesPerSecondLimit( Int fps ) { - DEBUG_LOG(("GameEngine::setFramesPerSecondLimit() - setting max fps to %d (TheGlobalData->m_useFpsLimit == %d)\n", fps, TheGlobalData->m_useFpsLimit)); + DEBUG_LOG(("GameEngine::setFramesPerSecondLimit() - setting max fps to %d (TheGlobalData->m_useFpsLimit == %d)", fps, TheGlobalData->m_useFpsLimit)); m_maxFPS = fps; } @@ -253,7 +253,7 @@ void GameEngine::init() if (TheVersion) { - DEBUG_LOG(("================================================================================\n")); + DEBUG_LOG(("================================================================================")); #ifdef DEBUG_LOGGING #if defined RTS_DEBUG const char *buildType = "Debug"; @@ -261,11 +261,11 @@ void GameEngine::init() const char *buildType = "Release"; #endif #endif // DEBUG_LOGGING - DEBUG_LOG(("Generals version %s (%s)\n", TheVersion->getAsciiVersion().str(), buildType)); - DEBUG_LOG(("Build date: %s\n", TheVersion->getAsciiBuildTime().str())); - DEBUG_LOG(("Build location: %s\n", TheVersion->getAsciiBuildLocation().str())); - DEBUG_LOG(("Built by: %s\n", TheVersion->getAsciiBuildUser().str())); - DEBUG_LOG(("================================================================================\n")); + DEBUG_LOG(("Generals version %s (%s)", TheVersion->getAsciiVersion().str(), buildType)); + DEBUG_LOG(("Build date: %s", TheVersion->getAsciiBuildTime().str())); + DEBUG_LOG(("Build location: %s", TheVersion->getAsciiBuildLocation().str())); + DEBUG_LOG(("Built by: %s", TheVersion->getAsciiBuildUser().str())); + DEBUG_LOG(("================================================================================")); } m_maxFPS = DEFAULT_MAX_FPS; @@ -325,7 +325,7 @@ void GameEngine::init() } #if defined(PERF_TIMERS) || defined(DUMP_PERF_STATS) - DEBUG_LOG(("Calculating CPU frequency for performance timers.\n")); + DEBUG_LOG(("Calculating CPU frequency for performance timers.")); InitPrecisionTimer(); #endif #ifdef PERF_TIMERS @@ -397,7 +397,7 @@ void GameEngine::init() xferCRC.close(); TheWritableGlobalData->m_iniCRC = xferCRC.getCRC(); - DEBUG_LOG(("INI CRC is 0x%8.8X\n", TheGlobalData->m_iniCRC)); + DEBUG_LOG(("INI CRC is 0x%8.8X", TheGlobalData->m_iniCRC)); TheSubsystemList->postProcessLoadAll(); @@ -700,7 +700,7 @@ void GameEngine::execute( void ) now = timeGetTime(); } //Int slept = now - prevTime; - //DEBUG_LOG(("delayed %d\n",slept)); + //DEBUG_LOG(("delayed %d",slept)); prevTime = now; @@ -767,11 +767,11 @@ void GameEngine::checkAbnormalQuitting(void) Int ptIdx; const PlayerTemplate *myTemplate = player->getPlayerTemplate(); - DEBUG_LOG(("myTemplate = %X(%s)\n", myTemplate, myTemplate->getName().str())); + DEBUG_LOG(("myTemplate = %X(%s)", myTemplate, myTemplate->getName().str())); for (ptIdx = 0; ptIdx < ThePlayerTemplateStore->getPlayerTemplateCount(); ++ptIdx) { const PlayerTemplate *nthTemplate = ThePlayerTemplateStore->getNthPlayerTemplate(ptIdx); - DEBUG_LOG(("nthTemplate = %X(%s)\n", nthTemplate, nthTemplate->getName().str())); + DEBUG_LOG(("nthTemplate = %X(%s)", nthTemplate, nthTemplate->getName().str())); if (nthTemplate == myTemplate) { break; @@ -792,35 +792,35 @@ void GameEngine::checkAbnormalQuitting(void) UserPreferences pref; AsciiString userPrefFilename; userPrefFilename.format("GeneralsOnline\\MiscPref%d.ini", stats.id); - DEBUG_LOG(("using the file %s\n", userPrefFilename.str())); + DEBUG_LOG(("using the file %s", userPrefFilename.str())); pref.load(userPrefFilename); Int addedInDesyncs2 = pref.getInt("0", 0); - DEBUG_LOG(("addedInDesyncs2 = %d\n", addedInDesyncs2)); + DEBUG_LOG(("addedInDesyncs2 = %d", addedInDesyncs2)); if (addedInDesyncs2 < 0) addedInDesyncs2 = 10; Int addedInDesyncs3 = pref.getInt("1", 0); - DEBUG_LOG(("addedInDesyncs3 = %d\n", addedInDesyncs3)); + DEBUG_LOG(("addedInDesyncs3 = %d", addedInDesyncs3)); if (addedInDesyncs3 < 0) addedInDesyncs3 = 10; Int addedInDesyncs4 = pref.getInt("2", 0); - DEBUG_LOG(("addedInDesyncs4 = %d\n", addedInDesyncs4)); + DEBUG_LOG(("addedInDesyncs4 = %d", addedInDesyncs4)); if (addedInDesyncs4 < 0) addedInDesyncs4 = 10; Int addedInDiscons2 = pref.getInt("3", 0); - DEBUG_LOG(("addedInDiscons2 = %d\n", addedInDiscons2)); + DEBUG_LOG(("addedInDiscons2 = %d", addedInDiscons2)); if (addedInDiscons2 < 0) addedInDiscons2 = 10; Int addedInDiscons3 = pref.getInt("4", 0); - DEBUG_LOG(("addedInDiscons3 = %d\n", addedInDiscons3)); + DEBUG_LOG(("addedInDiscons3 = %d", addedInDiscons3)); if (addedInDiscons3 < 0) addedInDiscons3 = 10; Int addedInDiscons4 = pref.getInt("5", 0); - DEBUG_LOG(("addedInDiscons4 = %d\n", addedInDiscons4)); + DEBUG_LOG(("addedInDiscons4 = %d", addedInDiscons4)); if (addedInDiscons4 < 0) addedInDiscons4 = 10; - DEBUG_LOG(("req.addDesync=%d, req.addDiscon=%d, addedInDesync=%d,%d,%d, addedInDiscon=%d,%d,%d\n", + DEBUG_LOG(("req.addDesync=%d, req.addDiscon=%d, addedInDesync=%d,%d,%d, addedInDiscon=%d,%d,%d", req.addDesync, req.addDiscon, addedInDesyncs2, addedInDesyncs3, addedInDesyncs4, addedInDiscons2, addedInDiscons3, addedInDiscons4)); @@ -833,7 +833,7 @@ void GameEngine::checkAbnormalQuitting(void) pref["0"] = val; val.format("%d", addedInDiscons2 + req.addDiscon); pref["3"] = val; - DEBUG_LOG(("house 2 req.addDesync || req.addDiscon: %d %d\n", + DEBUG_LOG(("house 2 req.addDesync || req.addDiscon: %d %d", addedInDesyncs2 + req.addDesync, addedInDiscons2 + req.addDiscon)); } else if (req.lastHouse == 3) @@ -842,7 +842,7 @@ void GameEngine::checkAbnormalQuitting(void) pref["1"] = val; val.format("%d", addedInDiscons3 + req.addDiscon); pref["4"] = val; - DEBUG_LOG(("house 3 req.addDesync || req.addDiscon: %d %d\n", + DEBUG_LOG(("house 3 req.addDesync || req.addDiscon: %d %d", addedInDesyncs3 + req.addDesync, addedInDiscons3 + req.addDiscon)); } else @@ -851,7 +851,7 @@ void GameEngine::checkAbnormalQuitting(void) pref["2"] = val; val.format("%d", addedInDiscons4 + req.addDiscon); pref["5"] = val; - DEBUG_LOG(("house 4 req.addDesync || req.addDiscon: %d %d\n", + DEBUG_LOG(("house 4 req.addDesync || req.addDiscon: %d %d", addedInDesyncs4 + req.addDesync, addedInDiscons4 + req.addDiscon)); } pref.write(); diff --git a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp index 52579db017..8d2a558262 100644 --- a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp @@ -1213,7 +1213,7 @@ UnsignedInt GlobalData::generateExeCRC() #define GENERALS_108_EAAPP_EXE_CRC 0xb07fbd50u exeCRC.set(GENERALS_108_CD_EXE_CRC); - DEBUG_LOG(("Fake EXE CRC is 0x%8.8X\n", exeCRC.get())); + DEBUG_LOG(("Fake EXE CRC is 0x%8.8X", exeCRC.get())); #else { @@ -1227,7 +1227,7 @@ UnsignedInt GlobalData::generateExeCRC() { exeCRC.computeCRC(crcBlock, amtRead); } - DEBUG_LOG(("EXE CRC is 0x%8.8X\n", exeCRC.get())); + DEBUG_LOG(("EXE CRC is 0x%8.8X", exeCRC.get())); fp->close(); fp = NULL; } @@ -1267,7 +1267,7 @@ UnsignedInt GlobalData::generateExeCRC() fp = NULL; } - DEBUG_LOG(("EXE+Version(%d.%d)+SCB CRC is 0x%8.8X\n", version >> 16, version & 0xffff, exeCRC.get())); + DEBUG_LOG(("EXE+Version(%d.%d)+SCB CRC is 0x%8.8X", version >> 16, version & 0xffff, exeCRC.get())); return exeCRC.get(); } diff --git a/Generals/Code/GameEngine/Source/Common/INI/INI.cpp b/Generals/Code/GameEngine/Source/Common/INI/INI.cpp index 5246be9c31..8a1cb7352c 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INI.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INI.cpp @@ -486,7 +486,7 @@ void INI::readLine( void ) if (s_xfer) { s_xfer->xferUser( m_buffer, sizeof( char ) * strlen( m_buffer ) ); - //DEBUG_LOG(("Xfer val is now 0x%8.8X in %s, line %s\n", ((XferCRC *)s_xfer)->getCRC(), + //DEBUG_LOG(("Xfer val is now 0x%8.8X in %s, line %s", ((XferCRC *)s_xfer)->getCRC(), //m_filename.str(), m_buffer)); } } diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIMapCache.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIMapCache.cpp index 6c15219d71..65531faec1 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INIMapCache.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INIMapCache.cpp @@ -164,7 +164,7 @@ void INI::parseMapCacheDefinition( INI* ini ) AsciiString lowerName = name; lowerName.toLower(); md.m_fileName = lowerName; -// DEBUG_LOG(("INI::parseMapCacheDefinition - adding %s to map cache\n", lowerName.str())); +// DEBUG_LOG(("INI::parseMapCacheDefinition - adding %s to map cache", lowerName.str())); (*TheMapCache)[lowerName] = md; } } diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp index 4080c5c4d9..d7a582fe80 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp @@ -116,7 +116,7 @@ void INI::parseWebpageURLDefinition( INI* ini ) getcwd(cwd, _MAX_PATH); url->m_url.format("file://%s\\Data\\%s\\%s", encodeURL(cwd).str(), GetRegistryLanguage().str(), url->m_url.str()+7); - DEBUG_LOG(("INI::parseWebpageURLDefinition() - converted URL to [%s]\n", url->m_url.str())); + DEBUG_LOG(("INI::parseWebpageURLDefinition() - converted URL to [%s]", url->m_url.str())); } } // end parseMusicTrackDefinition diff --git a/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp b/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp index bb86de4203..a5feec6542 100644 --- a/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp +++ b/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp @@ -110,7 +110,7 @@ void InitPrecisionTimer() GetPrecisionTimer(&bogus[7]); } TheTicksToGetTicks = (bogus[7] - start) / (ITERS*8); - DEBUG_LOG(("TheTicksToGetTicks is %d (%f usec)\n",(int)TheTicksToGetTicks,TheTicksToGetTicks/s_ticksPerUSec)); + DEBUG_LOG(("TheTicksToGetTicks is %d (%f usec)",(int)TheTicksToGetTicks,TheTicksToGetTicks/s_ticksPerUSec)); #endif } @@ -303,7 +303,7 @@ void PerfGather::reset() } GetPrecisionTimer(&end); s_stopStartOverhead = (end - start) / (ITERS*8); - DEBUG_LOG(("s_stopStartOverhead is %d (%f usec)\n",(int)s_stopStartOverhead,s_stopStartOverhead/s_ticksPerUSec)); + DEBUG_LOG(("s_stopStartOverhead is %d (%f usec)",(int)s_stopStartOverhead,s_stopStartOverhead/s_ticksPerUSec)); } } @@ -532,7 +532,7 @@ void PerfTimer::outputInfo( void ) m_callCount, 1000.0f / avgTimePerFrame)); } else { - DEBUG_LOG(("%s\n" + DEBUG_LOG(("%s" "Average Time (per call): %.4f ms\n" "Average Time (per frame): %.4f ms\n" "Average calls per frame: %.2f\n" diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp index c2018e2bfa..895a14f5e5 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -174,7 +174,7 @@ AsciiString kindofMaskAsAsciiString(KindOfMaskType m) } void dumpBattlePlanBonuses(const BattlePlanBonuses *b, AsciiString name, const Player *p, const Object *o, AsciiString fname, Int line, Bool doDebugLog) { - CRCDEBUG_LOG(("dumpBattlePlanBonuses() %s:%d %s\n Player %d(%ls) object %d(%s) armor:%g/%8.8X bombardment:%d, holdTheLine:%d, searchAndDestroy:%d sight:%g/%8.8X, valid:%s invalid:%s\n", + CRCDEBUG_LOG(("dumpBattlePlanBonuses() %s:%d %s\n Player %d(%ls) object %d(%s) armor:%g/%8.8X bombardment:%d, holdTheLine:%d, searchAndDestroy:%d sight:%g/%8.8X, valid:%s invalid:%s", fname.str(), line, name.str(), (p)?p->getPlayerIndex():-1, (p)?((Player *)p)->getPlayerDisplayName().str():L"", (o)?o->getID():-1, (o)?o->getTemplate()->getName().str():"", b->m_armorScalar, AS_INT(b->m_armorScalar), @@ -184,7 +184,7 @@ void dumpBattlePlanBonuses(const BattlePlanBonuses *b, AsciiString name, const P kindofMaskAsAsciiString(b->m_invalidKindOf).str())); if (!doDebugLog) return; - DEBUG_LOG(("dumpBattlePlanBonuses() %s:%d %s\n Player %d(%ls) object %d(%s) armor:%g/%8.8X bombardment:%d, holdTheLine:%d, searchAndDestroy:%d sight:%g/%8.8X, valid:%s invalid:%s\n", + DEBUG_LOG(("dumpBattlePlanBonuses() %s:%d %s\n Player %d(%ls) object %d(%s) armor:%g/%8.8X bombardment:%d, holdTheLine:%d, searchAndDestroy:%d sight:%g/%8.8X, valid:%s invalid:%s", fname.str(), line, name.str(), (p)?p->getPlayerIndex():-1, (p)?((Player *)p)->getPlayerDisplayName().str():L"", (o)?o->getID():-1, (o)?o->getTemplate()->getName().str():"", b->m_armorScalar, AS_INT(b->m_armorScalar), @@ -2130,7 +2130,7 @@ Bool Player::addScience(ScienceType science) if (hasScience(science)) return false; - //DEBUG_LOG(("Adding Science %s\n",TheScienceStore->getInternalNameForScience(science).str())); + //DEBUG_LOG(("Adding Science %s",TheScienceStore->getInternalNameForScience(science).str())); m_sciences.push_back(science); @@ -2179,7 +2179,7 @@ Bool Player::addScience(ScienceType science) //============================================================================= void Player::addSciencePurchasePoints(Int delta) { - //DEBUG_LOG(("Adding SciencePurchasePoints %d -> %d\n",m_sciencePurchasePoints,m_sciencePurchasePoints+delta)); + //DEBUG_LOG(("Adding SciencePurchasePoints %d -> %d",m_sciencePurchasePoints,m_sciencePurchasePoints+delta)); Int oldSPP = m_sciencePurchasePoints; m_sciencePurchasePoints += delta; if (m_sciencePurchasePoints < 0) @@ -2281,7 +2281,7 @@ Bool Player::setRankLevel(Int newLevel) if (newLevel == m_rankLevel) return false; - //DEBUG_LOG(("Set Rank Level %d -> %d\n",m_rankLevel,newLevel)); + //DEBUG_LOG(("Set Rank Level %d -> %d",m_rankLevel,newLevel)); Int oldSPP = m_sciencePurchasePoints; @@ -2320,7 +2320,7 @@ Bool Player::setRankLevel(Int newLevel) m_rankLevel = newLevel; DEBUG_ASSERTCRASH(m_skillPoints >= m_levelDown && m_skillPoints < m_levelUp, ("hmm, wrong")); - //DEBUG_LOG(("Rank %d, Skill %d, down %d, up %d\n",m_rankLevel,m_skillPoints, m_levelDown, m_levelUp)); + //DEBUG_LOG(("Rank %d, Skill %d, down %d, up %d",m_rankLevel,m_skillPoints, m_levelDown, m_levelUp)); if (TheControlBar != NULL) { @@ -3022,7 +3022,7 @@ static void localApplyBattlePlanBonusesToObject( Object *obj, void *userData ) Object *objectToValidate = obj; Object *objectToModify = obj; - DEBUG_LOG(("localApplyBattlePlanBonusesToObject() - looking at object %d (%s)\n", + DEBUG_LOG(("localApplyBattlePlanBonusesToObject() - looking at object %d (%s)", (objectToValidate)?objectToValidate->getID():INVALID_ID, (objectToValidate)?objectToValidate->getTemplate()->getName().str():"")); @@ -3032,30 +3032,30 @@ static void localApplyBattlePlanBonusesToObject( Object *obj, void *userData ) if( isProjectile ) { objectToValidate = TheGameLogic->findObjectByID( obj->getProducerID() ); - DEBUG_LOG(("Object is a projectile - looking at object %d (%s) instead\n", + DEBUG_LOG(("Object is a projectile - looking at object %d (%s) instead", (objectToValidate)?objectToValidate->getID():INVALID_ID, (objectToValidate)?objectToValidate->getTemplate()->getName().str():"")); } if( objectToValidate && objectToValidate->isAnyKindOf( bonus->m_validKindOf ) ) { - DEBUG_LOG(("Is valid kindof\n")); + DEBUG_LOG(("Is valid kindof")); if( !objectToValidate->isAnyKindOf( bonus->m_invalidKindOf ) ) { - DEBUG_LOG(("Is not invalid kindof\n")); + DEBUG_LOG(("Is not invalid kindof")); //Quite the trek eh? Now we can apply the bonuses! if( !isProjectile ) { - DEBUG_LOG(("Is not projectile. Armor scalar is %g\n", bonus->m_armorScalar)); + DEBUG_LOG(("Is not projectile. Armor scalar is %g", bonus->m_armorScalar)); //Really important to not apply certain bonuses like health augmentation to projectiles! if( bonus->m_armorScalar != 1.0f ) { BodyModuleInterface *body = objectToModify->getBodyModule(); body->applyDamageScalar( bonus->m_armorScalar ); - CRCDEBUG_LOG(("Applying armor scalar of %g (%8.8X) to object %d (%ls) owned by player %d\n", + CRCDEBUG_LOG(("Applying armor scalar of %g (%8.8X) to object %d (%ls) owned by player %d", bonus->m_armorScalar, AS_INT(bonus->m_armorScalar), objectToModify->getID(), objectToModify->getTemplate()->getDisplayName().str(), objectToModify->getControllingPlayer()->getPlayerIndex())); - DEBUG_LOG(("After apply, armor scalar is %g\n", body->getDamageScalar())); + DEBUG_LOG(("After apply, armor scalar is %g", body->getDamageScalar())); } if( bonus->m_sightRangeScalar != 1.0f ) { @@ -3130,13 +3130,13 @@ void Player::applyBattlePlanBonusesForPlayerObjects( const BattlePlanBonuses *bo //Only allocate the battle plan bonuses if we actually use it! if( !m_battlePlanBonuses ) { - DEBUG_LOG(("Allocating new m_battlePlanBonuses\n")); + DEBUG_LOG(("Allocating new m_battlePlanBonuses")); m_battlePlanBonuses = newInstance( BattlePlanBonuses ); *m_battlePlanBonuses = *bonus; } else { - DEBUG_LOG(("Adding bonus into existing m_battlePlanBonuses\n")); + DEBUG_LOG(("Adding bonus into existing m_battlePlanBonuses")); DUMPBATTLEPLANBONUSES(m_battlePlanBonuses, this, NULL); //Just apply the differences by multiplying the scalars together (kindofs won't change) //These bonuses are used for new objects that are created or objects that are transferred @@ -3488,7 +3488,7 @@ void Player::crc( Xfer *xfer ) // Player battle plan bonuses Bool battlePlanBonus = m_battlePlanBonuses != NULL; xfer->xferBool( &battlePlanBonus ); - CRCDEBUG_LOG(("Player %d[%ls] %s battle plans\n", m_playerIndex, m_playerDisplayName.str(), (battlePlanBonus)?"has":"doesn't have")); + CRCDEBUG_LOG(("Player %d[%ls] %s battle plans", m_playerIndex, m_playerDisplayName.str(), (battlePlanBonus)?"has":"doesn't have")); if( m_battlePlanBonuses ) { CRCDUMPBATTLEPLANBONUSES(m_battlePlanBonuses, this, NULL); diff --git a/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp b/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp index bddfa1e0ec..28ebc4ac35 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp @@ -147,7 +147,7 @@ void PlayerList::newGame() Bool exists; // throwaway, since we don't care if it exists if (d->getBool(TheKey_multiplayerIsLocal, &exists)) { - DEBUG_LOG(("Player %s is multiplayer local\n", pname.str())); + DEBUG_LOG(("Player %s is multiplayer local", pname.str())); setLocalPlayer(p); setLocal = true; } @@ -200,7 +200,7 @@ void PlayerList::newGame() } else { - DEBUG_LOG(("unknown enemy %s\n",tok.str())); + DEBUG_LOG(("unknown enemy %s",tok.str())); } } @@ -214,7 +214,7 @@ void PlayerList::newGame() } else { - DEBUG_LOG(("unknown ally %s\n",tok.str())); + DEBUG_LOG(("unknown ally %s",tok.str())); } } @@ -290,7 +290,7 @@ Team *PlayerList::validateTeam( AsciiString owner ) Team *t = TheTeamFactory->findTeam(owner); if (t) { - //DEBUG_LOG(("assigned obj %08lx to team %s\n",obj,owner.str())); + //DEBUG_LOG(("assigned obj %08lx to team %s",obj,owner.str())); } else { @@ -322,9 +322,9 @@ void PlayerList::setLocalPlayer(Player *player) #ifdef INTENSE_DEBUG if (player) { - DEBUG_LOG(("\n----------\n")); + DEBUG_LOG(("\n----------")); // did you know? you can use "%ls" to print a doublebyte string, even in a single-byte printf... - DEBUG_LOG(("Switching local players. The new player is named '%ls' (%s) and owns the following objects:\n", + DEBUG_LOG(("Switching local players. The new player is named '%ls' (%s) and owns the following objects:", player->getPlayerDisplayName().str(), TheNameKeyGenerator->keyToName(player->getPlayerNameKey()).str() )); @@ -335,9 +335,9 @@ void PlayerList::setLocalPlayer(Player *player) { DEBUG_LOG((" (NOT BUILDABLE)")); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } - DEBUG_LOG(("\n----------\n")); + DEBUG_LOG(("\n----------")); } #endif diff --git a/Generals/Code/GameEngine/Source/Common/RandomValue.cpp b/Generals/Code/GameEngine/Source/Common/RandomValue.cpp index 137f820552..0b36e74761 100644 --- a/Generals/Code/GameEngine/Source/Common/RandomValue.cpp +++ b/Generals/Code/GameEngine/Source/Common/RandomValue.cpp @@ -173,7 +173,7 @@ void InitRandom( UnsignedInt seed ) seedRandom(seed, theGameLogicSeed); theGameLogicBaseSeed = seed; #ifdef DEBUG_RANDOM_LOGIC -DEBUG_LOG(( "InitRandom %08lx\n",seed)); +DEBUG_LOG(( "InitRandom %08lx",seed)); #endif } @@ -188,7 +188,7 @@ void InitGameLogicRandom( UnsignedInt seed ) theGameLogicBaseSeed = seed; #endif #ifdef DEBUG_RANDOM_LOGIC -DEBUG_LOG(( "InitRandom Logic %08lx\n",seed)); +DEBUG_LOG(( "InitRandom Logic %08lx",seed)); #endif } @@ -220,7 +220,7 @@ Int GetGameLogicRandomValue( int lo, int hi, const char *file, int line ) /**/ #ifdef DEBUG_RANDOM_LOGIC -DEBUG_LOG(( "%d: GetGameLogicRandomValue = %d (%d - %d), %s line %d\n", +DEBUG_LOG(( "%d: GetGameLogicRandomValue = %d (%d - %d), %s line %d", TheGameLogic->getFrame(), rval, lo, hi, file, line )); #endif /**/ @@ -243,7 +243,7 @@ Int GetGameClientRandomValue( int lo, int hi, const char *file, int line ) /**/ #ifdef DEBUG_RANDOM_CLIENT -DEBUG_LOG(( "%d: GetGameClientRandomValue = %d (%d - %d), %s line %d\n", +DEBUG_LOG(( "%d: GetGameClientRandomValue = %d (%d - %d), %s line %d", TheGameLogic ? TheGameLogic->getFrame() : -1, rval, lo, hi, file, line )); #endif /**/ @@ -266,7 +266,7 @@ Int GetGameAudioRandomValue( int lo, int hi, const char *file, int line ) /**/ #ifdef DEBUG_RANDOM_AUDIO -DEBUG_LOG(( "%d: GetGameAudioRandomValue = %d (%d - %d), %s line %d\n", +DEBUG_LOG(( "%d: GetGameAudioRandomValue = %d (%d - %d), %s line %d", TheGameLogic->getFrame(), rval, lo, hi, file, line )); #endif /**/ @@ -290,7 +290,7 @@ Real GetGameLogicRandomValueReal( Real lo, Real hi, const char *file, int line ) DEBUG_ASSERTCRASH( rval >= lo && rval <= hi, ("Bad random val")); /**/ #ifdef DEBUG_RANDOM_LOGIC -DEBUG_LOG(( "%d: GetGameLogicRandomValueReal = %f, %s line %d\n", +DEBUG_LOG(( "%d: GetGameLogicRandomValueReal = %f, %s line %d", TheGameLogic->getFrame(), rval, file, line )); #endif /**/ @@ -314,7 +314,7 @@ Real GetGameClientRandomValueReal( Real lo, Real hi, const char *file, int line DEBUG_ASSERTCRASH( rval >= lo && rval <= hi, ("Bad random val")); /**/ #ifdef DEBUG_RANDOM_CLIENT -DEBUG_LOG(( "%d: GetGameClientRandomValueReal = %f, %s line %d\n", +DEBUG_LOG(( "%d: GetGameClientRandomValueReal = %f, %s line %d", TheGameLogic->getFrame(), rval, file, line )); #endif /**/ @@ -338,7 +338,7 @@ Real GetGameAudioRandomValueReal( Real lo, Real hi, const char *file, int line ) DEBUG_ASSERTCRASH( rval >= lo && rval <= hi, ("Bad random val")); /**/ #ifdef DEBUG_RANDOM_AUDIO -DEBUG_LOG(( "%d: GetGameAudioRandomValueReal = %f, %s line %d\n", +DEBUG_LOG(( "%d: GetGameAudioRandomValueReal = %f, %s line %d", TheGameLogic->getFrame(), rval, file, line )); #endif /**/ diff --git a/Generals/Code/GameEngine/Source/Common/Recorder.cpp b/Generals/Code/GameEngine/Source/Common/Recorder.cpp index ca0b7ca5fd..965ebce153 100644 --- a/Generals/Code/GameEngine/Source/Common/Recorder.cpp +++ b/Generals/Code/GameEngine/Source/Common/Recorder.cpp @@ -286,7 +286,7 @@ void RecorderClass::cleanUpReplayFile( void ) char fname[_MAX_PATH+1]; strncpy(fname, TheGlobalData->m_baseStatsDir.str(), _MAX_PATH); strncat(fname, m_fileName.str(), _MAX_PATH - strlen(fname)); - DEBUG_LOG(("Saving replay to %s\n", fname)); + DEBUG_LOG(("Saving replay to %s", fname)); AsciiString oldFname; oldFname.format("%s%s", getReplayDir().str(), m_fileName.str()); CopyFile(oldFname.str(), fname, TRUE); @@ -309,18 +309,18 @@ void RecorderClass::cleanUpReplayFile( void ) fileSize = ftell(fp); fclose(fp); fp = NULL; - DEBUG_LOG(("Log file size was %d\n", fileSize)); + DEBUG_LOG(("Log file size was %d", fileSize)); } const int MAX_DEBUG_SIZE = 65536; if (fileSize <= MAX_DEBUG_SIZE || TheGlobalData->m_saveAllStats) { - DEBUG_LOG(("Using CopyFile to copy %s\n", logFileName)); + DEBUG_LOG(("Using CopyFile to copy %s", logFileName)); CopyFile(logFileName, debugFname.str(), TRUE); } else { - DEBUG_LOG(("manual copy of %s\n", logFileName)); + DEBUG_LOG(("manual copy of %s", logFileName)); FILE *ifp = fopen(logFileName, "rb"); FILE *ofp = fopen(debugFname.str(), "wb"); if (ifp && ofp) @@ -493,7 +493,7 @@ void RecorderClass::updateRecord() msg->getArgument(0)->integer != GAME_SHELL && msg->getArgument(0)->integer != GAME_NONE) { m_originalGameMode = msg->getArgument(0)->integer; - DEBUG_LOG(("RecorderClass::updateRecord() - original game is mode %d\n", m_originalGameMode)); + DEBUG_LOG(("RecorderClass::updateRecord() - original game is mode %d", m_originalGameMode)); lastFrame = 0; GameDifficulty diff = DIFFICULTY_NORMAL; if (msg->getArgumentCount() >= 2) @@ -640,7 +640,7 @@ void RecorderClass::startRecording(GameDifficulty diff, Int originalGameMode, In { TheSkirmishGameInfo->setCRCInterval(REPLAY_CRC_INTERVAL); theSlotList = GameInfoToAsciiString(TheSkirmishGameInfo); - DEBUG_LOG(("GameInfo String: %s\n",theSlotList.str())); + DEBUG_LOG(("GameInfo String: %s",theSlotList.str())); localIndex = 0; } else @@ -651,7 +651,7 @@ void RecorderClass::startRecording(GameDifficulty diff, Int originalGameMode, In } } logGameStart(theSlotList); - DEBUG_LOG(("RecorderClass::startRecording - theSlotList = %s\n", theSlotList.str())); + DEBUG_LOG(("RecorderClass::startRecording - theSlotList = %s", theSlotList.str())); // write slot list (starting spots, color, alliances, etc fwrite(theSlotList.str(), theSlotList.getLength() + 1, 1, m_file); @@ -692,7 +692,7 @@ void RecorderClass::startRecording(GameDifficulty diff, Int originalGameMode, In // Write maxFPS chosen fwrite(&maxFPS, sizeof(maxFPS), 1, m_file); - DEBUG_LOG(("RecorderClass::startRecording() - diff=%d, mode=%d, FPS=%d\n", diff, originalGameMode, maxFPS)); + DEBUG_LOG(("RecorderClass::startRecording() - diff=%d, mode=%d, FPS=%d", diff, originalGameMode, maxFPS)); /* // Write the map name. @@ -754,7 +754,7 @@ void RecorderClass::writeToFile(GameMessage * msg) { commandName.concat(tmp); } - //DEBUG_LOG(("RecorderClass::writeToFile - Adding %s command from player %d to TheCommandList on frame %d\n", + //DEBUG_LOG(("RecorderClass::writeToFile - Adding %s command from player %d to TheCommandList on frame %d", //commandName.str(), msg->getPlayerIndex(), TheGameLogic->getFrame())); #endif // DEBUG_LOGGING @@ -826,7 +826,7 @@ Bool RecorderClass::readReplayHeader(ReplayHeader& header) m_file = fopen(filepath.str(), "rb"); if (m_file == NULL) { - DEBUG_LOG(("Can't open %s (%s)\n", filepath.str(), header.filename.str())); + DEBUG_LOG(("Can't open %s (%s)", filepath.str(), header.filename.str())); return FALSE; } @@ -835,7 +835,7 @@ Bool RecorderClass::readReplayHeader(ReplayHeader& header) fread(&genrep, sizeof(char), 6, m_file); genrep[6] = 0; if (strncmp(genrep, "GENREP", 6)) { - DEBUG_LOG(("RecorderClass::readReplayHeader - replay file did not have GENREP at the start.\n")); + DEBUG_LOG(("RecorderClass::readReplayHeader - replay file did not have GENREP at the start.")); fclose(m_file); m_file = NULL; return FALSE; @@ -874,10 +874,10 @@ Bool RecorderClass::readReplayHeader(ReplayHeader& header) header.gameOptions = readAsciiString(); m_gameInfo.reset(); m_gameInfo.enterGame(); - DEBUG_LOG(("RecorderClass::readReplayHeader - GameInfo = %s\n", header.gameOptions.str())); + DEBUG_LOG(("RecorderClass::readReplayHeader - GameInfo = %s", header.gameOptions.str())); if (!ParseAsciiStringToGameInfo(&m_gameInfo, header.gameOptions)) { - DEBUG_LOG(("RecorderClass::readReplayHeader - replay file did not have a valid GameInfo string.\n")); + DEBUG_LOG(("RecorderClass::readReplayHeader - replay file did not have a valid GameInfo string.")); fclose(m_file); m_file = NULL; return FALSE; @@ -888,7 +888,7 @@ Bool RecorderClass::readReplayHeader(ReplayHeader& header) header.localPlayerIndex = atoi(playerIndex.str()); if (header.localPlayerIndex < -1 || header.localPlayerIndex >= MAX_SLOTS) { - DEBUG_LOG(("RecorderClass::readReplayHeader - invalid local slot number.\n")); + DEBUG_LOG(("RecorderClass::readReplayHeader - invalid local slot number.")); m_gameInfo.endGame(); m_gameInfo.reset(); fclose(m_file); @@ -1002,20 +1002,20 @@ void CRCInfo::addCRC(UnsignedInt val) } m_data.push_back(val); - //DEBUG_LOG(("CRCInfo::addCRC() - crc %8.8X pushes list to %d entries (full=%d)\n", val, m_data.size(), !m_data.empty())); + //DEBUG_LOG(("CRCInfo::addCRC() - crc %8.8X pushes list to %d entries (full=%d)", val, m_data.size(), !m_data.empty())); } UnsignedInt CRCInfo::readCRC(void) { if (m_data.empty()) { - DEBUG_LOG(("CRCInfo::readCRC() - bailing, full=0, size=%d\n", m_data.size())); + DEBUG_LOG(("CRCInfo::readCRC() - bailing, full=0, size=%d", m_data.size())); return 0; } UnsignedInt val = m_data.front(); m_data.pop_front(); - //DEBUG_LOG(("CRCInfo::readCRC() - returning %8.8X, full=%d, size=%d\n", val, !m_data.empty(), m_data.size())); + //DEBUG_LOG(("CRCInfo::readCRC() - returning %8.8X, full=%d, size=%d", val, !m_data.empty(), m_data.size())); return val; } @@ -1028,7 +1028,7 @@ void RecorderClass::handleCRCMessage(UnsignedInt newCRC, Int playerIndex, Bool f { if (fromPlayback) { - //DEBUG_LOG(("RecorderClass::handleCRCMessage() - Adding CRC of %X from %d to m_crcInfo\n", newCRC, playerIndex)); + //DEBUG_LOG(("RecorderClass::handleCRCMessage() - Adding CRC of %X from %d to m_crcInfo", newCRC, playerIndex)); m_crcInfo->addCRC(newCRC); return; } @@ -1043,7 +1043,7 @@ void RecorderClass::handleCRCMessage(UnsignedInt newCRC, Int playerIndex, Bool f if (samePlayer || (localPlayerIndex < 0)) { UnsignedInt playbackCRC = m_crcInfo->readCRC(); - //DEBUG_LOG(("RecorderClass::handleCRCMessage() - Comparing CRCs of InGame:%8.8X Replay:%8.8X Frame:%d from Player %d\n", + //DEBUG_LOG(("RecorderClass::handleCRCMessage() - Comparing CRCs of InGame:%8.8X Replay:%8.8X Frame:%d from Player %d", // playbackCRC, newCRC, TheGameLogic->getFrame()-m_crcInfo->GetQueueSize()-1, playerIndex)); if (TheGameLogic->getFrame() > 0 && newCRC != playbackCRC && !m_crcInfo->sawCRCMismatch()) { @@ -1067,7 +1067,7 @@ void RecorderClass::handleCRCMessage(UnsignedInt newCRC, Int playerIndex, Bool f const UnicodeString mismatchDetailsStr = TheGameText->FETCH_OR_SUBSTITUTE("GUI:CRCMismatchDetails", L"InGame:%8.8X Replay:%8.8X Frame:%d"); TheInGameUI->message(mismatchDetailsStr, playbackCRC, newCRC, mismatchFrame); - DEBUG_LOG(("Replay has gone out of sync!\nInGame:%8.8X Replay:%8.8X\nFrame:%d\n", + DEBUG_LOG(("Replay has gone out of sync!\nInGame:%8.8X Replay:%8.8X\nFrame:%d", playbackCRC, newCRC, mismatchFrame)); // Print Mismatch in case we are simulating replays from console. @@ -1082,7 +1082,7 @@ void RecorderClass::handleCRCMessage(UnsignedInt newCRC, Int playerIndex, Bool f return; } - //DEBUG_LOG(("RecorderClass::handleCRCMessage() - Skipping CRC of %8.8X from %d (our index is %d)\n", newCRC, playerIndex, localPlayerIndex)); + //DEBUG_LOG(("RecorderClass::handleCRCMessage() - Skipping CRC of %8.8X from %d (our index is %d)", newCRC, playerIndex, localPlayerIndex)); } /** @@ -1194,7 +1194,7 @@ Bool RecorderClass::playbackFile(AsciiString filename) #ifdef DEBUG_LOGGING if (header.localPlayerIndex >= 0) { - DEBUG_LOG(("Local player is %ls (slot %d, IP %8.8X)\n", + DEBUG_LOG(("Local player is %ls (slot %d, IP %8.8X)", m_gameInfo.getSlot(header.localPlayerIndex)->getName().str(), header.localPlayerIndex, m_gameInfo.getSlot(header.localPlayerIndex)->getIP())); } #endif @@ -1202,7 +1202,7 @@ Bool RecorderClass::playbackFile(AsciiString filename) Bool isMultiplayer = m_gameInfo.getSlot(header.localPlayerIndex)->getIP() != 0; m_crcInfo = NEW CRCInfo(header.localPlayerIndex, isMultiplayer); REPLAY_CRC_INTERVAL = m_gameInfo.getCRCInterval(); - DEBUG_LOG(("Player index is %d, replay CRC interval is %d\n", m_crcInfo->getLocalPlayer(), REPLAY_CRC_INTERVAL)); + DEBUG_LOG(("Player index is %d, replay CRC interval is %d", m_crcInfo->getLocalPlayer(), REPLAY_CRC_INTERVAL)); Int difficulty = 0; fread(&difficulty, sizeof(difficulty), 1, m_file); @@ -1215,7 +1215,7 @@ Bool RecorderClass::playbackFile(AsciiString filename) Int maxFPS = 0; fread(&maxFPS, sizeof(maxFPS), 1, m_file); - DEBUG_LOG(("RecorderClass::playbackFile() - original game was mode %d\n", m_originalGameMode)); + DEBUG_LOG(("RecorderClass::playbackFile() - original game was mode %d", m_originalGameMode)); // TheSuperHackers @fix helmutbuhler 03/04/2025 // In case we restart a replay, we need to clear the command list. @@ -1310,7 +1310,7 @@ AsciiString RecorderClass::readAsciiString() { void RecorderClass::readNextFrame() { Int retcode = fread(&m_nextFrame, sizeof(m_nextFrame), 1, m_file); if (retcode != 1) { - DEBUG_LOG(("RecorderClass::readNextFrame - fread failed on frame %d\n", TheGameLogic->getFrame())); + DEBUG_LOG(("RecorderClass::readNextFrame - fread failed on frame %d", TheGameLogic->getFrame())); m_nextFrame = -1; stopPlayback(); } @@ -1323,7 +1323,7 @@ void RecorderClass::appendNextCommand() { GameMessage::Type type; Int retcode = fread(&type, sizeof(type), 1, m_file); if (retcode != 1) { - DEBUG_LOG(("RecorderClass::appendNextCommand - fread failed on frame %d\n", m_nextFrame/*TheGameLogic->getFrame()*/)); + DEBUG_LOG(("RecorderClass::appendNextCommand - fread failed on frame %d", m_nextFrame/*TheGameLogic->getFrame()*/)); return; } @@ -1354,7 +1354,7 @@ void RecorderClass::appendNextCommand() { #endif if (logCommand) { - DEBUG_LOG(("RecorderClass::appendNextCommand - Adding %s command from player %d to TheCommandList on frame %d\n", + DEBUG_LOG(("RecorderClass::appendNextCommand - Adding %s command from player %d to TheCommandList on frame %d", commandName.str(), (type == GameMessage::MSG_BEGIN_NETWORK_MESSAGES)?0:msg->getPlayerIndex(), m_nextFrame/*TheGameLogic->getFrame()*/)); } #endif @@ -1421,7 +1421,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Integer argument: %d (%8.8X)\n", theint, theint)); + DEBUG_LOG(("Integer argument: %d (%8.8X)", theint, theint)); } #endif } else if (type == ARGUMENTDATATYPE_REAL) { @@ -1431,7 +1431,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Real argument: %g (%8.8X)\n", thereal, *(int *)&thereal)); + DEBUG_LOG(("Real argument: %g (%8.8X)", thereal, *(int *)&thereal)); } #endif } else if (type == ARGUMENTDATATYPE_BOOLEAN) { @@ -1441,7 +1441,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Bool argument: %d\n", thebool)); + DEBUG_LOG(("Bool argument: %d", thebool)); } #endif } else if (type == ARGUMENTDATATYPE_OBJECTID) { @@ -1451,7 +1451,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Object ID argument: %d\n", theid)); + DEBUG_LOG(("Object ID argument: %d", theid)); } #endif } else if (type == ARGUMENTDATATYPE_DRAWABLEID) { @@ -1461,7 +1461,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Drawable ID argument: %d\n", theid)); + DEBUG_LOG(("Drawable ID argument: %d", theid)); } #endif } else if (type == ARGUMENTDATATYPE_TEAMID) { @@ -1471,7 +1471,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Team ID argument: %d\n", theid)); + DEBUG_LOG(("Team ID argument: %d", theid)); } #endif } else if (type == ARGUMENTDATATYPE_LOCATION) { @@ -1481,7 +1481,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Coord3D argument: %g %g %g (%8.8X %8.8X %8.8X)\n", loc.x, loc.y, loc.z, + DEBUG_LOG(("Coord3D argument: %g %g %g (%8.8X %8.8X %8.8X)", loc.x, loc.y, loc.z, *(int *)&loc.x, *(int *)&loc.y, *(int *)&loc.z)); } #endif @@ -1492,7 +1492,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Pixel argument: %d,%d\n", pixel.x, pixel.y)); + DEBUG_LOG(("Pixel argument: %d,%d", pixel.x, pixel.y)); } #endif } else if (type == ARGUMENTDATATYPE_PIXELREGION) { @@ -1502,7 +1502,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Pixel Region argument: %d,%d -> %d,%d\n", reg.lo.x, reg.lo.y, reg.hi.x, reg.hi.y)); + DEBUG_LOG(("Pixel Region argument: %d,%d -> %d,%d", reg.lo.x, reg.lo.y, reg.hi.x, reg.hi.y)); } #endif } else if (type == ARGUMENTDATATYPE_TIMESTAMP) { // Not to be confused with Terrance Stamp... Kneel before Zod!!! @@ -1512,7 +1512,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Timestamp argument: %d\n", stamp)); + DEBUG_LOG(("Timestamp argument: %d", stamp)); } #endif } else if (type == ARGUMENTDATATYPE_WIDECHAR) { @@ -1522,7 +1522,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("WideChar argument: %d (%lc)\n", theid, theid)); + DEBUG_LOG(("WideChar argument: %d (%lc)", theid, theid)); } #endif } diff --git a/Generals/Code/GameEngine/Source/Common/StateMachine.cpp b/Generals/Code/GameEngine/Source/Common/StateMachine.cpp index 576f0ae0ee..a486d1d414 100644 --- a/Generals/Code/GameEngine/Source/Common/StateMachine.cpp +++ b/Generals/Code/GameEngine/Source/Common/StateMachine.cpp @@ -171,7 +171,7 @@ StateReturnType State::friend_checkForTransitions( StateReturnType status ) #ifdef STATE_MACHINE_DEBUG if (getMachine()->getWantsDebugOutput()) { - DEBUG_LOG(("%d '%s' -- '%s' condition '%s' returned true!\n", TheGameLogic->getFrame(), getMachineOwner()->getTemplate()->getName().str(), + DEBUG_LOG(("%d '%s' -- '%s' condition '%s' returned true!", TheGameLogic->getFrame(), getMachineOwner()->getTemplate()->getName().str(), getMachine()->getName().str(), it->description ? it->description : "[no description]")); } #endif @@ -229,7 +229,7 @@ StateReturnType State::friend_checkForSleepTransitions( StateReturnType status ) #ifdef STATE_MACHINE_DEBUG if (getMachine()->getWantsDebugOutput()) { - DEBUG_LOG(("%d '%s' -- '%s' condition '%s' returned true!\n", TheGameLogic->getFrame(), getMachineOwner()->getTemplate()->getName().str(), + DEBUG_LOG(("%d '%s' -- '%s' condition '%s' returned true!", TheGameLogic->getFrame(), getMachineOwner()->getTemplate()->getName().str(), getMachine()->getName().str(), it->description ? it->description : "[no description]")); } #endif @@ -335,7 +335,7 @@ void StateMachine::internalClear() #ifdef STATE_MACHINE_DEBUG if (getWantsDebugOutput()) { - DEBUG_LOG(("%d '%s' -- '%s' %x internalClear()\n", TheGameLogic->getFrame(), m_owner->getTemplate()->getName().str(), m_name.str(), this)); + DEBUG_LOG(("%d '%s' -- '%s' %x internalClear()", TheGameLogic->getFrame(), m_owner->getTemplate()->getName().str(), m_name.str(), this)); } #endif } @@ -350,8 +350,8 @@ void StateMachine::clear() if (m_locked) { #ifdef STATE_MACHINE_DEBUG - if (m_currentState) DEBUG_LOG((" cur state '%s'\n", m_currentState->getName().str())); - DEBUG_LOG(("machine is locked (by %s), cannot be cleared (Please don't ignore; this generally indicates a potential logic flaw)\n",m_lockedby)); + if (m_currentState) DEBUG_LOG((" cur state '%s'", m_currentState->getName().str())); + DEBUG_LOG(("machine is locked (by %s), cannot be cleared (Please don't ignore; this generally indicates a potential logic flaw)",m_lockedby)); #endif return; } @@ -375,8 +375,8 @@ StateReturnType StateMachine::resetToDefaultState() if (m_locked) { #ifdef STATE_MACHINE_DEBUG - if (m_currentState) DEBUG_LOG((" cur state '%s'\n", m_currentState->getName().str())); - DEBUG_LOG(("machine is locked (by %s), cannot be cleared (Please don't ignore; this generally indicates a potential logic flaw)\n",m_lockedby)); + if (m_currentState) DEBUG_LOG((" cur state '%s'", m_currentState->getName().str())); + DEBUG_LOG(("machine is locked (by %s), cannot be cleared (Please don't ignore; this generally indicates a potential logic flaw)",m_lockedby)); #endif return STATE_FAILURE; } @@ -539,8 +539,8 @@ StateReturnType StateMachine::setState( StateID newStateID ) if (m_locked) { #ifdef STATE_MACHINE_DEBUG - if (m_currentState) DEBUG_LOG((" cur state '%s'\n", m_currentState->getName().str())); - DEBUG_LOG(("machine is locked (by %s), cannot be cleared (Please don't ignore; this generally indicates a potential logic flaw)\n",m_lockedby)); + if (m_currentState) DEBUG_LOG((" cur state '%s'", m_currentState->getName().str())); + DEBUG_LOG(("machine is locked (by %s), cannot be cleared (Please don't ignore; this generally indicates a potential logic flaw)",m_lockedby)); #endif return STATE_CONTINUE; } @@ -592,9 +592,9 @@ StateReturnType StateMachine::internalSetState( StateID newStateID ) DEBUG_LOG((" INVALID_STATE_ID ")); } if (newState) { - DEBUG_LOG(("enter '%s' \n", newState->getName().str())); + DEBUG_LOG(("enter '%s' ", newState->getName().str())); } else { - DEBUG_LOG(("to INVALID_STATE\n")); + DEBUG_LOG(("to INVALID_STATE")); } } #endif @@ -695,8 +695,8 @@ StateReturnType StateMachine::initDefaultState() if (i == m_stateMap.end()) { DEBUG_LOG(("\nState %s(%d) : ", state->getName().str(), id)); - DEBUG_LOG(("Transition %d not found\n", curID)); - DEBUG_LOG(("This MUST BE FIXED!!!jba\n")); + DEBUG_LOG(("Transition %d not found", curID)); + DEBUG_LOG(("This MUST BE FIXED!!!jba")); DEBUG_CRASH(("Invalid transition.")); } else { State *st = (*i).second; @@ -753,7 +753,7 @@ void StateMachine::halt() #ifdef STATE_MACHINE_DEBUG if (getWantsDebugOutput()) { - DEBUG_LOG(("%d '%s' -- '%s' %x halt()\n", TheGameLogic->getFrame(), m_owner->getTemplate()->getName().str(), m_name.str(), this)); + DEBUG_LOG(("%d '%s' -- '%s' %x halt()", TheGameLogic->getFrame(), m_owner->getTemplate()->getName().str(), m_name.str(), this)); } #endif } diff --git a/Generals/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp b/Generals/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp index 59ef351da7..352ed202f5 100644 --- a/Generals/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp @@ -158,7 +158,7 @@ void ArchiveFileSystem::loadIntoDirectoryTree(const ArchiveFile *archiveFile, co AsciiString path2; path2 = debugpath; path2.concat(token); -// DEBUG_LOG(("ArchiveFileSystem::loadIntoDirectoryTree - adding file %s, archived in %s\n", path2.str(), archiveFilename.str())); +// DEBUG_LOG(("ArchiveFileSystem::loadIntoDirectoryTree - adding file %s, archived in %s", path2.str(), archiveFilename.str())); dirInfo->m_files[token] = archiveFilename; } @@ -172,14 +172,14 @@ void ArchiveFileSystem::loadMods() { ArchiveFile *archiveFile = openArchiveFile(TheGlobalData->m_modBIG.str()); if (archiveFile != NULL) { - DEBUG_LOG(("ArchiveFileSystem::loadMods - loading %s into the directory tree.\n", TheGlobalData->m_modBIG.str())); + DEBUG_LOG(("ArchiveFileSystem::loadMods - loading %s into the directory tree.", TheGlobalData->m_modBIG.str())); loadIntoDirectoryTree(archiveFile, TheGlobalData->m_modBIG, TRUE); m_archiveFileMap[TheGlobalData->m_modBIG] = archiveFile; - DEBUG_LOG(("ArchiveFileSystem::loadMods - %s inserted into the archive file map.\n", TheGlobalData->m_modBIG.str())); + DEBUG_LOG(("ArchiveFileSystem::loadMods - %s inserted into the archive file map.", TheGlobalData->m_modBIG.str())); } else { - DEBUG_LOG(("ArchiveFileSystem::loadMods - could not openArchiveFile(%s)\n", TheGlobalData->m_modBIG.str())); + DEBUG_LOG(("ArchiveFileSystem::loadMods - could not openArchiveFile(%s)", TheGlobalData->m_modBIG.str())); } } @@ -283,14 +283,14 @@ AsciiString ArchiveFileSystem::getArchiveFilenameForFile(const AsciiString& file // the directory doesn't exist, so return NULL // dump the directories; - //DEBUG_LOG(("directory %s not found in %s in archive file system\n", token.str(), debugpath.str())); - //DEBUG_LOG(("directories in %s in archive file system are:\n", debugpath.str())); + //DEBUG_LOG(("directory %s not found in %s in archive file system", token.str(), debugpath.str())); + //DEBUG_LOG(("directories in %s in archive file system are:", debugpath.str())); //ArchivedDirectoryInfoMap::const_iterator it = dirInfo->m_directories.begin(); //while (it != dirInfo->m_directories.end()) { - // DEBUG_LOG(("\t%s\n", it->second.m_directoryName.str())); + // DEBUG_LOG(("\t%s", it->second.m_directoryName.str())); // it++; //} - //DEBUG_LOG(("end of directory list.\n")); + //DEBUG_LOG(("end of directory list.")); return AsciiString::TheEmptyString; } diff --git a/Generals/Code/GameEngine/Source/Common/System/AsciiString.cpp b/Generals/Code/GameEngine/Source/Common/System/AsciiString.cpp index 6f639e18ef..af1efbf3be 100644 --- a/Generals/Code/GameEngine/Source/Common/System/AsciiString.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/AsciiString.cpp @@ -115,7 +115,7 @@ void AsciiString::debugIgnoreLeaks() } else { - DEBUG_LOG(("cannot ignore the leak (no data)\n")); + DEBUG_LOG(("cannot ignore the leak (no data)")); } #endif } diff --git a/Generals/Code/GameEngine/Source/Common/System/DataChunk.cpp b/Generals/Code/GameEngine/Source/Common/System/DataChunk.cpp index 99ac3bb8b1..cbb2b1e821 100644 --- a/Generals/Code/GameEngine/Source/Common/System/DataChunk.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/DataChunk.cpp @@ -66,32 +66,32 @@ Bool CachedFileInputStream::open(AsciiString path) if (CompressionManager::isDataCompressed(m_buffer, m_size) == 0) { - //DEBUG_LOG(("CachedFileInputStream::open() - file %s is uncompressed at %d bytes!\n", path.str(), m_size)); + //DEBUG_LOG(("CachedFileInputStream::open() - file %s is uncompressed at %d bytes!", path.str(), m_size)); } else { Int uncompLen = CompressionManager::getUncompressedSize(m_buffer, m_size); - //DEBUG_LOG(("CachedFileInputStream::open() - file %s is compressed! It should go from %d to %d\n", path.str(), + //DEBUG_LOG(("CachedFileInputStream::open() - file %s is compressed! It should go from %d to %d", path.str(), // m_size, uncompLen)); char *uncompBuffer = NEW char[uncompLen]; Int actualLen = CompressionManager::decompressData(m_buffer, m_size, uncompBuffer, uncompLen); if (actualLen == uncompLen) { - //DEBUG_LOG(("Using uncompressed data\n")); + //DEBUG_LOG(("Using uncompressed data")); delete[] m_buffer; m_buffer = uncompBuffer; m_size = uncompLen; } else { - //DEBUG_LOG(("Decompression failed - using compressed data\n")); + //DEBUG_LOG(("Decompression failed - using compressed data")); // decompression failed. Maybe we invalidly thought it was compressed? delete[] uncompBuffer; } } //if (m_size >= 4) //{ - // DEBUG_LOG(("File starts as '%c%c%c%c'\n", m_buffer[0], m_buffer[1], + // DEBUG_LOG(("File starts as '%c%c%c%c'", m_buffer[0], m_buffer[1], // m_buffer[2], m_buffer[3])); //} @@ -295,7 +295,7 @@ void DataChunkOutput::openDataChunk( const char *name, DataChunkVersionType ver // remember this m_tmp_file position so we can write the real data size later c->filepos = ::ftell(m_tmp_file); #ifdef VERBOSE - DEBUG_LOG(("Writing chunk %s at %d (%x)\n", name, ::ftell(m_tmp_file), ::ftell(m_tmp_file))); + DEBUG_LOG(("Writing chunk %s at %d (%x)", name, ::ftell(m_tmp_file), ::ftell(m_tmp_file))); #endif // store a placeholder for the data size Int dummy = 0xffff; @@ -328,7 +328,7 @@ void DataChunkOutput::closeDataChunk( void ) // pop the chunk off the stack OutputChunk *c = m_chunkStack; #ifdef VERBOSE - DEBUG_LOG(("Closing chunk %s at %d (%x)\n", m_contents.getName(c->id).str(), here, here)); + DEBUG_LOG(("Closing chunk %s at %d (%x)", m_contents.getName(c->id).str(), here, here)); #endif m_chunkStack = m_chunkStack->next; deleteInstance(c); @@ -725,7 +725,7 @@ AsciiString DataChunkInput::openDataChunk(DataChunkVersionType *ver ) c->id = 0; c->version = 0; c->dataSize = 0; - //DEBUG_LOG(("Opening data chunk at offset %d (%x)\n", m_file->tell(), m_file->tell())); + //DEBUG_LOG(("Opening data chunk at offset %d (%x)", m_file->tell(), m_file->tell())); // read the chunk ID m_file->read( (char *)&c->id, sizeof(UnsignedInt) ); decrementDataLeft( sizeof(UnsignedInt) ); diff --git a/Generals/Code/GameEngine/Source/Common/System/Directory.cpp b/Generals/Code/GameEngine/Source/Common/System/Directory.cpp index 04f133a1df..235fe135bf 100644 --- a/Generals/Code/GameEngine/Source/Common/System/Directory.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/Directory.cpp @@ -53,7 +53,7 @@ void FileInfo::set( const WIN32_FIND_DATA& info ) modTime = FileTimeToTimet(info.ftLastWriteTime); attributes = info.dwFileAttributes; filesize = info.nFileSizeLow; - //DEBUG_LOG(("FileInfo::set(): fname=%s, size=%d\n", filename.str(), filesize)); + //DEBUG_LOG(("FileInfo::set(): fname=%s, size=%d", filename.str(), filesize)); } //------------------------------------------------------------------------------------------------- @@ -67,7 +67,7 @@ Directory::Directory( const AsciiString& dirPath ) : m_dirPath(dirPath) // sanity if( m_dirPath.isEmpty() ) { - DEBUG_LOG(( "Empty dirname\n")); + DEBUG_LOG(( "Empty dirname")); return; } @@ -77,7 +77,7 @@ Directory::Directory( const AsciiString& dirPath ) : m_dirPath(dirPath) // switch into the directory provided if( SetCurrentDirectory( m_dirPath.str() ) == 0 ) { - DEBUG_LOG(( "Can't set directory '%s'\n", m_dirPath.str() )); + DEBUG_LOG(( "Can't set directory '%s'", m_dirPath.str() )); return; } @@ -86,7 +86,7 @@ Directory::Directory( const AsciiString& dirPath ) : m_dirPath(dirPath) hFile = FindFirstFile( "*", &item); if( hFile == INVALID_HANDLE_VALUE ) { - DEBUG_LOG(( "Can't search directory '%s'\n", m_dirPath.str() )); + DEBUG_LOG(( "Can't search directory '%s'", m_dirPath.str() )); done = true; } diff --git a/Generals/Code/GameEngine/Source/Common/System/FileSystem.cpp b/Generals/Code/GameEngine/Source/Common/System/FileSystem.cpp index 1952bcd158..9e40133a6d 100644 --- a/Generals/Code/GameEngine/Source/Common/System/FileSystem.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/FileSystem.cpp @@ -258,14 +258,14 @@ Bool FileSystem::areMusicFilesOnCD() return TRUE; #else if (!TheCDManager) { - DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - No CD Manager; returning false\n")); + DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - No CD Manager; returning false")); return FALSE; } AsciiString cdRoot; Int dc = TheCDManager->driveCount(); for (Int i = 0; i < dc; ++i) { - DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - checking drive %d\n", i)); + DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - checking drive %d", i)); CDDriveInterface *cdi = TheCDManager->getDrive(i); if (!cdi) { continue; @@ -275,11 +275,11 @@ Bool FileSystem::areMusicFilesOnCD() if (!cdRoot.endsWith("\\")) cdRoot.concat("\\"); cdRoot.concat("gensec.big"); - DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - checking for %s\n", cdRoot.str())); + DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - checking for %s", cdRoot.str())); File *musicBig = TheLocalFileSystem->openFile(cdRoot.str()); if (musicBig) { - DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - found it!\n")); + DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - found it!")); musicBig->close(); return TRUE; } diff --git a/Generals/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp b/Generals/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp index 341f1d2edf..77d5882726 100644 --- a/Generals/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp @@ -643,7 +643,7 @@ Bool FunctionLexicon::validate( void ) if( sourceEntry->func == lookAtEntry->func ) { - DEBUG_LOG(( "WARNING! Function lexicon entries match same address! '%s' and '%s'\n", + DEBUG_LOG(( "WARNING! Function lexicon entries match same address! '%s' and '%s'", sourceEntry->name, lookAtEntry->name )); valid = FALSE; diff --git a/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp b/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp index 5ff3b22798..01f201ba1e 100644 --- a/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp @@ -124,7 +124,7 @@ DECLARE_PERF_TIMER(MemoryPoolInitFilling) s_initFillerValue |= (~(s_initFillerValue << 4)) & 0xf0; s_initFillerValue |= (s_initFillerValue << 8); s_initFillerValue |= (s_initFillerValue << 16); - DEBUG_LOG(("Setting MemoryPool initFillerValue to %08x (index %d)\n",s_initFillerValue,index)); + DEBUG_LOG(("Setting MemoryPool initFillerValue to %08x (index %d)",s_initFillerValue,index)); } #endif @@ -782,7 +782,7 @@ Bool BlockCheckpointInfo::shouldBeInReport(Int flags, Int startCheckpoint, Int e if (!bi) { - DEBUG_LOG(("%s,%32s,%6s,%6s,%6s,%s\n",PREPEND,"POOLNAME","BLKSZ","ALLOC","FREED","BLOCKNAME")); + DEBUG_LOG(("%s,%32s,%6s,%6s,%6s,%s",PREPEND,"POOLNAME","BLKSZ","ALLOC","FREED","BLOCKNAME")); } else { @@ -792,7 +792,7 @@ Bool BlockCheckpointInfo::shouldBeInReport(Int flags, Int startCheckpoint, Int e if (bi->shouldBeInReport(flags, startCheckpoint, endCheckpoint)) { - DEBUG_LOG(("%s,%32s,%6d,%6d,%6d,%s\n",PREPEND,poolName,bi->m_blockSize,bi->m_allocCheckpoint,bi->m_freeCheckpoint,bi->m_debugLiteralTagString)); + DEBUG_LOG(("%s,%32s,%6d,%6d,%6d,%s",PREPEND,poolName,bi->m_blockSize,bi->m_allocCheckpoint,bi->m_freeCheckpoint,bi->m_debugLiteralTagString)); #ifdef MEMORYPOOL_STACKTRACE if (flags & REPORT_CP_STACKTRACE) { @@ -1031,7 +1031,7 @@ Int MemoryPoolSingleBlock::debugSingleBlockReportLeak(const char* owner) } else { - DEBUG_LOG(("Leaked a block of size %d, tagstring %s, from pool/dma %s\n",m_logicalSize,m_debugLiteralTagString,owner)); + DEBUG_LOG(("Leaked a block of size %d, tagstring %s, from pool/dma %s",m_logicalSize,m_debugLiteralTagString,owner)); } #ifdef MEMORYPOOL_SINGLEBLOCK_GETS_STACKTRACE @@ -1480,7 +1480,7 @@ void Checkpointable::debugCheckpointReport( Int flags, Int startCheckpoint, Int if (m_cpiEverFailed) { - DEBUG_LOG((" *** WARNING *** info on freed blocks may be inaccurate or incomplete!\n")); + DEBUG_LOG((" *** WARNING *** info on freed blocks may be inaccurate or incomplete!")); } for (BlockCheckpointInfo *bi = m_firstCheckpointInfo; bi; bi = bi->getNext()) @@ -1875,13 +1875,13 @@ void MemoryPool::removeFromList(MemoryPool **pHead) if (!pool) { - DEBUG_LOG(("%s,%32s,%6s,%6s,%6s,%6s,%6s,%6s\n",PREPEND,"POOLNAME","BLKSZ","INIT","OVRFL","USED","TOTAL","PEAK")); + DEBUG_LOG(("%s,%32s,%6s,%6s,%6s,%6s,%6s,%6s",PREPEND,"POOLNAME","BLKSZ","INIT","OVRFL","USED","TOTAL","PEAK")); if( fp ) fprintf( fp, "%s,%32s,%6s,%6s,%6s,%6s,%6s,%6s\n",PREPEND,"POOLNAME","BLKSZ","INIT","OVRFL","USED","TOTAL","PEAK" ); } else { - DEBUG_LOG(("%s,%32s,%6d,%6d,%6d,%6d,%6d,%6d\n",PREPEND, + DEBUG_LOG(("%s,%32s,%6d,%6d,%6d,%6d,%6d,%6d",PREPEND, pool->m_poolName,pool->m_allocationSize,pool->m_initialAllocationCount,pool->m_overflowAllocationCount, pool->m_usedBlocksInPool,pool->m_totalBlocksInPool,pool->m_peakUsedBlocksInPool)); if( fp ) @@ -2556,10 +2556,10 @@ void DynamicMemoryAllocator::debugDmaInfoReport( FILE *fp ) Int numBlocks; Int bytes = debugCalcRawBlockBytes(&numBlocks); - DEBUG_LOG(("%s,Total Raw Blocks = %d\n",PREPEND,numBlocks)); - DEBUG_LOG(("%s,Total Raw Block Bytes = %d\n",PREPEND,bytes)); - DEBUG_LOG(("%s,Average Raw Block Size = %d\n",PREPEND,numBlocks?bytes/numBlocks:0)); - DEBUG_LOG(("%s,Raw Blocks:\n",PREPEND)); + DEBUG_LOG(("%s,Total Raw Blocks = %d",PREPEND,numBlocks)); + DEBUG_LOG(("%s,Total Raw Block Bytes = %d",PREPEND,bytes)); + DEBUG_LOG(("%s,Average Raw Block Size = %d",PREPEND,numBlocks?bytes/numBlocks:0)); + DEBUG_LOG(("%s,Raw Blocks:",PREPEND)); if( fp ) { fprintf( fp, "%s,Total Raw Blocks = %d\n",PREPEND,numBlocks ); @@ -2569,7 +2569,7 @@ void DynamicMemoryAllocator::debugDmaInfoReport( FILE *fp ) } for (MemoryPoolSingleBlock *b = m_rawBlocks; b; b = b->getNextRawBlock()) { - DEBUG_LOG(("%s, Blocksize=%d\n",PREPEND,b->debugGetLogicalSize())); + DEBUG_LOG(("%s, Blocksize=%d",PREPEND,b->debugGetLogicalSize())); //if( fp ) //{ // fprintf( fp, "%s, Blocksize=%d\n",PREPEND,b->debugGetLogicalSize() ); @@ -3089,16 +3089,16 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en if (flags & REPORT_FACTORYINFO) { - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Begin Factory Info Report\n")); - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Bytes in use (logical) = %d\n",m_usedBytes)); - DEBUG_LOG(("Bytes in use (physical) = %d\n",m_physBytes)); - DEBUG_LOG(("PEAK Bytes in use (logical) = %d\n",m_peakUsedBytes)); - DEBUG_LOG(("PEAK Bytes in use (physical) = %d\n",m_peakPhysBytes)); - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("End Factory Info Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Begin Factory Info Report")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Bytes in use (logical) = %d",m_usedBytes)); + DEBUG_LOG(("Bytes in use (physical) = %d",m_physBytes)); + DEBUG_LOG(("PEAK Bytes in use (logical) = %d",m_peakUsedBytes)); + DEBUG_LOG(("PEAK Bytes in use (physical) = %d",m_peakPhysBytes)); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("End Factory Info Report")); + DEBUG_LOG(("------------------------------------------")); if( fp ) { fprintf( fp, "------------------------------------------\n" ); @@ -3116,9 +3116,9 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en if (flags & REPORT_POOLINFO) { - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Begin Pool Info Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Begin Pool Info Report")); + DEBUG_LOG(("------------------------------------------")); if( fp ) { fprintf( fp, "------------------------------------------\n" ); @@ -3134,9 +3134,9 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en { dma->debugDmaInfoReport( fp ); } - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("End Pool Info Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("End Pool Info Report")); + DEBUG_LOG(("------------------------------------------")); if( fp ) { fprintf( fp, "------------------------------------------\n" ); @@ -3147,43 +3147,43 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en if (flags & REPORT_POOL_OVERFLOW) { - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Begin Pool Overflow Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Begin Pool Overflow Report")); + DEBUG_LOG(("------------------------------------------")); MemoryPool *pool = m_firstPoolInFactory; for (; pool; pool = pool->getNextPoolInList()) { if (pool->getPeakBlockCount() > pool->getInitialBlockCount()) { - DEBUG_LOG(("*** Pool %s overflowed initial allocation of %d (peak allocation was %d)\n",pool->getPoolName(),pool->getInitialBlockCount(),pool->getPeakBlockCount())); + DEBUG_LOG(("*** Pool %s overflowed initial allocation of %d (peak allocation was %d)",pool->getPoolName(),pool->getInitialBlockCount(),pool->getPeakBlockCount())); } } - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("End Pool Overflow Report\n")); - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Begin Pool Underflow Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("End Pool Overflow Report")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Begin Pool Underflow Report")); + DEBUG_LOG(("------------------------------------------")); for (pool = m_firstPoolInFactory; pool; pool = pool->getNextPoolInList()) { Int peak = pool->getPeakBlockCount()*pool->getAllocationSize(); Int initial = pool->getInitialBlockCount()*pool->getAllocationSize(); if (peak < initial/2 && (initial - peak) > 4096) { - DEBUG_LOG(("*** Pool %s used less than half its initial allocation of %d (peak allocation was %d, wasted %dk)\n", + DEBUG_LOG(("*** Pool %s used less than half its initial allocation of %d (peak allocation was %d, wasted %dk)", pool->getPoolName(),pool->getInitialBlockCount(),pool->getPeakBlockCount(),(initial - peak)/1024)); } } - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("End Pool Underflow Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("End Pool Underflow Report")); + DEBUG_LOG(("------------------------------------------")); } if( flags & REPORT_SIMPLE_LEAKS ) { - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Begin Simple Leak Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Begin Simple Leak Report")); + DEBUG_LOG(("------------------------------------------")); Int any = 0; for (MemoryPool *pool = m_firstPoolInFactory; pool; pool = pool->getNextPoolInList()) { @@ -3194,9 +3194,9 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en any += dma->debugDmaReportLeaks(); } DEBUG_ASSERTCRASH(!any, ("There were %d memory leaks. Please fix them.\n",any)); - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("End Simple Leak Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("End Simple Leak Report")); + DEBUG_LOG(("------------------------------------------")); } #ifdef MEMORYPOOL_CHECKPOINTING @@ -3204,18 +3204,18 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en { const char* nm = (this == TheMemoryPoolFactory) ? "TheMemoryPoolFactory" : "*** UNKNOWN *** MemoryPoolFactory"; - DEBUG_LOG(("\n")); - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Begin Block Report for %s\n", nm)); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Begin Block Report for %s", nm)); + DEBUG_LOG(("------------------------------------------")); char buf[256] = ""; if (flags & _REPORT_CP_ALLOCATED_BEFORE) strcat(buf, "AllocBefore "); if (flags & _REPORT_CP_ALLOCATED_BETWEEN) strcat(buf, "AllocBetween "); if (flags & _REPORT_CP_FREED_BEFORE) strcat(buf, "FreedBefore "); if (flags & _REPORT_CP_FREED_BETWEEN) strcat(buf, "FreedBetween "); if (flags & _REPORT_CP_FREED_NEVER) strcat(buf, "StillExisting "); - DEBUG_LOG(("Options: Between checkpoints %d and %d, report on (%s)\n",startCheckpoint,endCheckpoint,buf)); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("Options: Between checkpoints %d and %d, report on (%s)",startCheckpoint,endCheckpoint,buf)); + DEBUG_LOG(("------------------------------------------")); BlockCheckpointInfo::doBlockCheckpointReport( NULL, "", 0, 0, 0 ); for (MemoryPool *pool = m_firstPoolInFactory; pool; pool = pool->getNextPoolInList()) @@ -3227,9 +3227,9 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en dma->debugCheckpointReport(flags, startCheckpoint, endCheckpoint, "(Oversized)"); } - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("End Block Report for %s\n", nm)); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("End Block Report for %s", nm)); + DEBUG_LOG(("------------------------------------------")); } #endif @@ -3489,7 +3489,7 @@ static void preMainInitMemoryManager() if (TheMemoryPoolFactory == NULL) { DEBUG_INIT(DEBUG_FLAGS_DEFAULT); - DEBUG_LOG(("*** Initing Memory Manager prior to main!\n")); + DEBUG_LOG(("*** Initing Memory Manager prior to main!")); Int numSubPools; const PoolInitRec *pParms; @@ -3513,7 +3513,7 @@ void shutdownMemoryManager() if (thePreMainInitFlag) { #ifdef MEMORYPOOL_DEBUG - DEBUG_LOG(("*** Memory Manager was inited prior to main -- skipping shutdown!\n")); + DEBUG_LOG(("*** Memory Manager was inited prior to main -- skipping shutdown!")); #endif } else @@ -3537,8 +3537,8 @@ void shutdownMemoryManager() } #ifdef MEMORYPOOL_DEBUG - DEBUG_LOG(("Peak system allocation was %d bytes\n",thePeakSystemAllocationInBytes)); - DEBUG_LOG(("Wasted DMA space (peak) was %d bytes\n",thePeakWastedDMA)); + DEBUG_LOG(("Peak system allocation was %d bytes",thePeakSystemAllocationInBytes)); + DEBUG_LOG(("Wasted DMA space (peak) was %d bytes",thePeakWastedDMA)); DEBUG_ASSERTCRASH(theTotalSystemAllocationInBytes == 0, ("Leaked a total of %d raw bytes\n", theTotalSystemAllocationInBytes)); #endif } diff --git a/Generals/Code/GameEngine/Source/Common/System/LocalFile.cpp b/Generals/Code/GameEngine/Source/Common/System/LocalFile.cpp index 74ae452183..6ddc2a4133 100644 --- a/Generals/Code/GameEngine/Source/Common/System/LocalFile.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/LocalFile.cpp @@ -272,7 +272,7 @@ Bool LocalFile::open( const Char *filename, Int access ) #endif ++s_totalOpen; -/// DEBUG_LOG(("LocalFile::open %s (total %d)\n",filename,s_totalOpen)); +/// DEBUG_LOG(("LocalFile::open %s (total %d)",filename,s_totalOpen)); if ( m_access & APPEND ) { if ( seek ( 0, END ) < 0 ) diff --git a/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp b/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp index 8ca2f3c210..ae57d9add3 100644 --- a/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp @@ -565,7 +565,7 @@ SaveCode GameState::saveGame( AsciiString filename, UnicodeString desc, } catch(...) { // print error message to the user TheInGameUI->message( "GUI:Error" ); - DEBUG_LOG(( "Error opening file '%s'\n", filepath.str() )); + DEBUG_LOG(( "Error opening file '%s'", filepath.str() )); return SC_ERROR; } @@ -931,7 +931,7 @@ AsciiString GameState::portableMapPathToRealMapPath(const AsciiString& in) const if (!FileSystem::isPathInDirectory(prefix, containingBasePath)) { - DEBUG_LOG(("Normalized file path for '%s' was outside the expected base path of '%s'.\n", prefix.str(), containingBasePath.str())); + DEBUG_LOG(("Normalized file path for '%s' was outside the expected base path of '%s'.", prefix.str(), containingBasePath.str())); return AsciiString::TheEmptyString; } @@ -1327,7 +1327,7 @@ void GameState::iterateSaveFiles( IterateSaveFileCallback callback, void *userDa // ------------------------------------------------------------------------------------------------ void GameState::friend_xferSaveDataForCRC( Xfer *xfer, SnapshotType which ) { - DEBUG_LOG(("GameState::friend_xferSaveDataForCRC() - SnapshotType %d\n", which)); + DEBUG_LOG(("GameState::friend_xferSaveDataForCRC() - SnapshotType %d", which)); SaveGameInfo *gameInfo = getSaveGameInfo(); gameInfo->description.clear(); gameInfo->saveFileType = SAVE_FILE_TYPE_NORMAL; @@ -1350,7 +1350,7 @@ void GameState::xferSaveData( Xfer *xfer, SnapshotType which ) // save or load all blocks if( xfer->getXferMode() == XFER_SAVE ) { - DEBUG_LOG(("GameState::xferSaveData() - XFER_SAVE\n")); + DEBUG_LOG(("GameState::xferSaveData() - XFER_SAVE")); // save all blocks AsciiString blockName; @@ -1365,7 +1365,7 @@ void GameState::xferSaveData( Xfer *xfer, SnapshotType which ) // get block name blockName = blockInfo->blockName; - DEBUG_LOG(("Looking at block '%s'\n", blockName.str())); + DEBUG_LOG(("Looking at block '%s'", blockName.str())); // // for mission save files, we only save the game state block and campaign manager @@ -1413,7 +1413,7 @@ void GameState::xferSaveData( Xfer *xfer, SnapshotType which ) } // end if, save else { - DEBUG_LOG(("GameState::xferSaveData() - not XFER_SAVE\n")); + DEBUG_LOG(("GameState::xferSaveData() - not XFER_SAVE")); AsciiString token; Int blockSize; Bool done = FALSE; @@ -1443,7 +1443,7 @@ void GameState::xferSaveData( Xfer *xfer, SnapshotType which ) { // log the block not found - DEBUG_LOG(( "GameState::xferSaveData - Skipping unknown block '%s'\n", token.str() )); + DEBUG_LOG(( "GameState::xferSaveData - Skipping unknown block '%s'", token.str() )); // // block was not found, this could have been a block from an older file diff --git a/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp b/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp index d12b14dedf..4af5761d3e 100644 --- a/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp @@ -473,7 +473,7 @@ void WriteStackLine(void*address, void (*callback)(const char*)) //***************************************************************************** void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) { - DEBUG_LOG(( "\n********** EXCEPTION DUMP ****************\n" )); + DEBUG_LOG(( "\n********** EXCEPTION DUMP ****************" )); /* ** List of possible exceptions */ @@ -530,7 +530,7 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) "Error code: ?????\nDescription: Unknown exception." }; - DEBUG_LOG( ("Dump exception info\n") ); + DEBUG_LOG( ("Dump exception info") ); CONTEXT *context = e_info->ContextRecord; /* ** The following are set for access violation only @@ -562,7 +562,7 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) { if ( _codes[i] == e_info->ExceptionRecord->ExceptionCode ) { - DEBUG_LOG ( ("Found exception description\n") ); + DEBUG_LOG ( ("Found exception description") ); break; } } @@ -623,7 +623,7 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) strcat (scrap, "\n"); DOUBLE_DEBUG ( ( (scrap))); - DEBUG_LOG(( "********** END EXCEPTION DUMP ****************\n\n" )); + DEBUG_LOG(( "********** END EXCEPTION DUMP ****************\n" )); } diff --git a/Generals/Code/GameEngine/Source/Common/System/SubsystemInterface.cpp b/Generals/Code/GameEngine/Source/Common/System/SubsystemInterface.cpp index 80a79a24fb..647c51ef4f 100644 --- a/Generals/Code/GameEngine/Source/Common/System/SubsystemInterface.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/SubsystemInterface.cpp @@ -73,7 +73,7 @@ void SubsystemInterface::UPDATE(void) Real subTime = s_msConsumed - m_startTimeConsumed; if (m_name.isEmpty()) return; if (m_curUpdateTime > 0.00001) { - //DEBUG_LOG(("Subsys %s total time %.2f, subTime %.2f, net time %.2f\n", + //DEBUG_LOG(("Subsys %s total time %.2f, subTime %.2f, net time %.2f", // m_name.str(), m_curUpdateTime*1000, subTime*1000, (m_curUpdateTime-subTime)*1000 )); m_curUpdateTime -= subTime; @@ -96,7 +96,7 @@ void SubsystemInterface::DRAW(void) Real subTime = s_msConsumed - m_startDrawTimeConsumed; if (m_name.isEmpty()) return; if (m_curDrawTime > 0.00001) { - //DEBUG_LOG(("Subsys %s total time %.2f, subTime %.2f, net time %.2f\n", + //DEBUG_LOG(("Subsys %s total time %.2f, subTime %.2f, net time %.2f", // m_name.str(), m_curUpdateTime*1000, subTime*1000, (m_curUpdateTime-subTime)*1000 )); m_curDrawTime -= subTime; diff --git a/Generals/Code/GameEngine/Source/Common/System/registry.cpp b/Generals/Code/GameEngine/Source/Common/System/registry.cpp index 06672735de..318dbd572c 100644 --- a/Generals/Code/GameEngine/Source/Common/System/registry.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/registry.cpp @@ -120,7 +120,7 @@ Bool GetStringFromRegistry(AsciiString path, AsciiString key, AsciiString& val) AsciiString fullPath = "SOFTWARE\\Electronic Arts\\EA Games\\Generals"; fullPath.concat(path); - DEBUG_LOG(("GetStringFromRegistry - looking in %s for key %s\n", fullPath.str(), key.str())); + DEBUG_LOG(("GetStringFromRegistry - looking in %s for key %s", fullPath.str(), key.str())); if (getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val)) { return TRUE; @@ -134,7 +134,7 @@ Bool GetUnsignedIntFromRegistry(AsciiString path, AsciiString key, UnsignedInt& AsciiString fullPath = "SOFTWARE\\Electronic Arts\\EA Games\\Generals"; fullPath.concat(path); - DEBUG_LOG(("GetUnsignedIntFromRegistry - looking in %s for key %s\n", fullPath.str(), key.str())); + DEBUG_LOG(("GetUnsignedIntFromRegistry - looking in %s for key %s", fullPath.str(), key.str())); if (getUnsignedIntFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val)) { return TRUE; diff --git a/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp b/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp index 27d9a79f09..2e167a6fb7 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp @@ -292,7 +292,7 @@ ThingTemplate *ThingFactory::findTemplateInternal( const AsciiString& name ) #endif - //DEBUG_LOG(("*** Object template %s not found\n",name.str())); + //DEBUG_LOG(("*** Object template %s not found",name.str())); return NULL; } // end getTemplate diff --git a/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp index bfa6a90533..c0cf6bdd5d 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -520,7 +520,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const Bool replaced = mi->clearAiModuleInfo(); if (replaced) { - DEBUG_LOG(("replaced an AI for %s!\n",self->getName().str())); + DEBUG_LOG(("replaced an AI for %s!",self->getName().str())); } } @@ -1142,7 +1142,7 @@ void ThingTemplate::resolveNames() // but ThingTemplate can muck with stuff with gleeful abandon. (srj) if( tmpls[ j ] ) const_cast(tmpls[j])->m_isBuildFacility = true; - // DEBUG_LOG(("BF: %s is a buildfacility for %s\n",tmpls[j]->m_nameString.str(),this->m_nameString.str())); + // DEBUG_LOG(("BF: %s is a buildfacility for %s",tmpls[j]->m_nameString.str(),this->m_nameString.str())); } } @@ -1308,7 +1308,7 @@ const AudioEventRTS *ThingTemplate::getPerUnitSound(const AsciiString& soundName PerUnitSoundMap::const_iterator it = m_perUnitSounds.find(soundName); if (it == m_perUnitSounds.end()) { - DEBUG_LOG(("Unknown Audio name (%s) asked for in ThingTemplate (%s).\n", soundName.str(), m_nameString.str())); + DEBUG_LOG(("Unknown Audio name (%s) asked for in ThingTemplate (%s).", soundName.str(), m_nameString.str())); return &s_audioEventNoSound; } diff --git a/Generals/Code/GameEngine/Source/Common/UserPreferences.cpp b/Generals/Code/GameEngine/Source/Common/UserPreferences.cpp index 5c1580eec8..b17c883fc9 100644 --- a/Generals/Code/GameEngine/Source/Common/UserPreferences.cpp +++ b/Generals/Code/GameEngine/Source/Common/UserPreferences.cpp @@ -794,7 +794,7 @@ Bool LadderPreferences::loadProfile( Int profileID ) AsciiString ladName = it->first; AsciiString ladData = it->second; - DEBUG_LOG(("Looking at [%s] = [%s]\n", ladName.str(), ladData.str())); + DEBUG_LOG(("Looking at [%s] = [%s]", ladName.str(), ladData.str())); const char *ptr = ladName.reverseFind(':'); DEBUG_ASSERTCRASH(ptr, ("Did not find ':' in ladder name - skipping")); diff --git a/Generals/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp b/Generals/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp index d91d9c6e43..1f0b0451d7 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp @@ -152,7 +152,7 @@ void BeaconClientUpdate::hideBeacon( void ) } // end if -// DEBUG_LOG(("in hideBeacon(): draw=%d, m_particleSystemID=%d\n", draw, m_particleSystemID)); +// DEBUG_LOG(("in hideBeacon(): draw=%d, m_particleSystemID=%d", draw, m_particleSystemID)); } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index 392d79493a..d56c91fefc 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -2743,7 +2743,7 @@ void ControlBar::setControlBarSchemeByPlayer(Player *p) { m_isObserverCommandBar = TRUE; switchToContext( CB_CONTEXT_OBSERVER_LIST, NULL ); - DEBUG_LOG(("We're loading the Observer Command Bar\n")); + DEBUG_LOG(("We're loading the Observer Command Bar")); if (buttonPlaceBeacon) buttonPlaceBeacon->winHide(TRUE); @@ -2788,7 +2788,7 @@ void ControlBar::setControlBarSchemeByPlayerTemplate( const PlayerTemplate *pt) { m_isObserverCommandBar = TRUE; switchToContext( CB_CONTEXT_OBSERVER_LIST, NULL ); - DEBUG_LOG(("We're loading the Observer Command Bar\n")); + DEBUG_LOG(("We're loading the Observer Command Bar")); if (buttonPlaceBeacon) buttonPlaceBeacon->winHide(TRUE); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp index 44d64cb98c..ffb10797fc 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp @@ -586,7 +586,7 @@ void ControlBarScheme::init(void) } win->winSetPosition(x,y ); win->winSetSize((m_powerBarLR.x - m_powerBarUL.x)*resMultiplier.x+ COMMAND_BAR_SIZE_OFFSET,(m_powerBarLR.y - m_powerBarUL.y)*resMultiplier.y+ COMMAND_BAR_SIZE_OFFSET); - DEBUG_LOG(("Power Bar UL X:%d Y:%d LR X:%d Y:%d size X:%d Y:%d\n",m_powerBarUL.x, m_powerBarUL.y,m_powerBarLR.x, m_powerBarLR.y, (m_powerBarLR.x - m_powerBarUL.x)*resMultiplier.x+ COMMAND_BAR_SIZE_OFFSET,(m_powerBarLR.y - m_powerBarUL.y)*resMultiplier.y+ COMMAND_BAR_SIZE_OFFSET )); + DEBUG_LOG(("Power Bar UL X:%d Y:%d LR X:%d Y:%d size X:%d Y:%d",m_powerBarUL.x, m_powerBarUL.y,m_powerBarLR.x, m_powerBarLR.y, (m_powerBarLR.x - m_powerBarUL.x)*resMultiplier.x+ COMMAND_BAR_SIZE_OFFSET,(m_powerBarLR.y - m_powerBarUL.y)*resMultiplier.y+ COMMAND_BAR_SIZE_OFFSET )); } win= TheWindowManager->winGetWindowFromId( NULL, TheNameKeyGenerator->nameToKey( "ControlBar.wnd:ButtonGeneral" ) ); @@ -1092,14 +1092,14 @@ void ControlBarSchemeManager::setControlBarSchemeByPlayerTemplate( const PlayerT { m_currentScheme->init(); - DEBUG_LOG(("setControlBarSchemeByPlayer already is using %s as its side\n", side.str())); + DEBUG_LOG(("setControlBarSchemeByPlayer already is using %s as its side", side.str())); return; } // if we don't have a side, set it to Observer shell if(side.isEmpty()) side.set("Observer"); - DEBUG_LOG(("setControlBarSchemeByPlayer used %s as its side\n", side.str())); + DEBUG_LOG(("setControlBarSchemeByPlayer used %s as its side", side.str())); ControlBarScheme *tempScheme = NULL; ControlBarSchemeList::iterator it = m_schemeList.begin(); @@ -1160,14 +1160,14 @@ void ControlBarSchemeManager::setControlBarSchemeByPlayer(Player *p) { m_currentScheme->init(); - DEBUG_LOG(("setControlBarSchemeByPlayer already is using %s as its side\n", side.str())); + DEBUG_LOG(("setControlBarSchemeByPlayer already is using %s as its side", side.str())); return; } // if we don't have a side, set it to Observer shell if(side.isEmpty()) side.set("Observer"); - DEBUG_LOG(("setControlBarSchemeByPlayer used %s as its side\n", side.str())); + DEBUG_LOG(("setControlBarSchemeByPlayer used %s as its side", side.str())); ControlBarScheme *tempScheme = NULL; ControlBarSchemeList::iterator it = m_schemeList.begin(); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp index c3bd8627f8..1e94cf1dbc 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp @@ -311,7 +311,7 @@ void DisconnectMenu::removePlayer(Int slot, UnicodeString playerName) { } void DisconnectMenu::voteForPlayer(Int slot) { - DEBUG_LOG(("Casting vote for disconnect slot %d\n", slot)); + DEBUG_LOG(("Casting vote for disconnect slot %d", slot)); TheNetwork->voteForPlayerDisconnect(slot); // Do this next. } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp index 97bc80090a..95e8e728d9 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp @@ -140,7 +140,7 @@ void ControlBar::showBuildTooltipLayout( GameWindow *cmdButton ) m_showBuildToolTipLayout = TRUE; if(!isInitialized && beginWaitTime + cmdButton->getTooltipDelay() < timeGetTime()) { - //DEBUG_LOG(("%d beginwaittime, %d tooltipdelay, %dtimegettime\n", beginWaitTime, cmdButton->getTooltipDelay(), timeGetTime())); + //DEBUG_LOG(("%d beginwaittime, %d tooltipdelay, %dtimegettime", beginWaitTime, cmdButton->getTooltipDelay(), timeGetTime())); passedWaitTime = TRUE; } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp index 50eaf4ea66..a484e12dd9 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp @@ -246,7 +246,7 @@ WindowMsgHandledType DisconnectControlSystem( GameWindow *window, UnsignedInt ms case GEM_EDIT_DONE: { -// DEBUG_LOG(("DisconnectControlSystem - got GEM_EDIT_DONE.\n")); +// DEBUG_LOG(("DisconnectControlSystem - got GEM_EDIT_DONE.")); GameWindow *control = (GameWindow *)mData1; Int controlID = control->winGetWindowId(); @@ -256,7 +256,7 @@ WindowMsgHandledType DisconnectControlSystem( GameWindow *window, UnsignedInt ms { UnicodeString txtInput; -// DEBUG_LOG(("DisconnectControlSystem - GEM_EDIT_DONE was from the text entry control.\n")); +// DEBUG_LOG(("DisconnectControlSystem - GEM_EDIT_DONE was from the text entry control.")); // read the user's input txtInput.set(GadgetTextEntryGetText( textEntryWindow )); @@ -266,7 +266,7 @@ WindowMsgHandledType DisconnectControlSystem( GameWindow *window, UnsignedInt ms txtInput.trim(); // Echo the user's input to the chat window if (!txtInput.isEmpty()) { -// DEBUG_LOG(("DisconnectControlSystem - sending string %ls\n", txtInput.str())); +// DEBUG_LOG(("DisconnectControlSystem - sending string %ls", txtInput.str())); TheDisconnectMenu->sendChat(txtInput); } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp index 450240907d..3f0df3ccb0 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp @@ -772,7 +772,7 @@ void LanGameOptionsMenuInit( WindowLayout *layout, void *userData ) { // If we init while the game is in progress, we are really returning to the menu // after the game. So, we pop the menu and go back to the lobby. Whee! - DEBUG_LOG(("Popping to lobby after a game!\n")); + DEBUG_LOG(("Popping to lobby after a game!")); TheShell->popImmediate(); return; } @@ -823,7 +823,7 @@ void LanGameOptionsMenuInit( WindowLayout *layout, void *userData ) else { - //DEBUG_LOG(("LanGameOptionsMenuInit(): map is %s\n", TheLAN->GetMyGame()->getMap().str())); + //DEBUG_LOG(("LanGameOptionsMenuInit(): map is %s", TheLAN->GetMyGame()->getMap().str())); buttonStart->winSetText(TheGameText->fetch("GUI:Accept")); buttonSelectMap->winEnable( FALSE ); TheLAN->GetMyGame()->setMapCRC( TheLAN->GetMyGame()->getMapCRC() ); // force a recheck diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp index 32aac39e5d..a36a531aa3 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp @@ -580,7 +580,7 @@ void LanLobbyMenuUpdate( WindowLayout * layout, void *userData) if (LANSocketErrorDetected == TRUE) { LANSocketErrorDetected = FALSE; - DEBUG_LOG(("SOCKET ERROR! BAILING!\n")); + DEBUG_LOG(("SOCKET ERROR! BAILING!")); MessageBoxOk(TheGameText->fetch("GUI:NetworkError"), TheGameText->fetch("GUI:SocketError"), NULL); // we have a socket problem, back out to the main menu. @@ -727,7 +727,7 @@ WindowMsgHandledType LanLobbyMenuSystem( GameWindow *window, UnsignedInt msg, { //shellmapOn = TRUE; LANbuttonPushed = true; - DEBUG_LOG(("Back was hit - popping to main menu\n")); + DEBUG_LOG(("Back was hit - popping to main menu")); TheShell->pop(); delete TheLAN; TheLAN = NULL; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp index e298a3ed8c..a37b5bcd46 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp @@ -570,7 +570,7 @@ void MainMenuInit( WindowLayout *layout, void *userData ) { // wohoo - we're connected! fire off a check for updates checkedForUpdate = TRUE; - DEBUG_LOG(("Looking for a patch for productID=%d, versionStr=%s, distribution=%d\n", + DEBUG_LOG(("Looking for a patch for productID=%d, versionStr=%s, distribution=%d", gameProductID, gameVersionUniqueIDStr, gameDistributionID)); ptCheckForPatch( gameProductID, gameVersionUniqueIDStr, gameDistributionID, patchAvailableCallback, PTFalse, NULL ); //ptCheckForPatch( productID, versionUniqueIDStr, distributionID, mapPackAvailableCallback, PTFalse, NULL ); @@ -585,7 +585,7 @@ void MainMenuInit( WindowLayout *layout, void *userData ) if (TheGameSpyPeerMessageQueue && !TheGameSpyPeerMessageQueue->isConnected()) { - DEBUG_LOG(("Tearing down GameSpy from MainMenuInit()\n")); + DEBUG_LOG(("Tearing down GameSpy from MainMenuInit()")); TearDownGameSpy(); } if (TheMapCache) @@ -771,7 +771,7 @@ void ResolutionDialogUpdate() //------------------------------------------------------------------------------------------------------ // Used for debugging purposes //------------------------------------------------------------------------------------------------------ - DEBUG_LOG(("Resolution Timer : started at %d, current time at %d, frameTicker is %d\n", timeStarted, + DEBUG_LOG(("Resolution Timer : started at %d, current time at %d, frameTicker is %d", timeStarted, time(NULL) , currentTime)); } */ @@ -952,7 +952,7 @@ WindowMsgHandledType MainMenuInput( GameWindow *window, UnsignedInt msg, if(abs(mouse.x - mousePosX) > 20 || abs(mouse.y - mousePosY) > 20) { - DEBUG_LOG(("Mouse X:%d, Y:%d\n", mouse.x, mouse.y)); + DEBUG_LOG(("Mouse X:%d, Y:%d", mouse.x, mouse.y)); if(notShown) { initialGadgetDelay = 1; @@ -1012,7 +1012,7 @@ WindowMsgHandledType MainMenuSystem( GameWindow *window, UnsignedInt msg, case GWM_DESTROY: { ghttpCleanup(); - DEBUG_LOG(("Tearing down GameSpy from MainMenuSystem(GWM_DESTROY)\n")); + DEBUG_LOG(("Tearing down GameSpy from MainMenuSystem(GWM_DESTROY)")); TearDownGameSpy(); StopAsyncDNSCheck(); // kill off the async DNS check thread in case it is still running break; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp index 899eb8c0bb..1f449d7068 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp @@ -226,7 +226,7 @@ void JoinDirectConnectGame() Int ip1, ip2, ip3, ip4; sscanf(ipstr, "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4); - DEBUG_LOG(("JoinDirectConnectGame - joining at %d.%d.%d.%d\n", ip1, ip2, ip3, ip4)); + DEBUG_LOG(("JoinDirectConnectGame - joining at %d.%d.%d.%d", ip1, ip2, ip3, ip4)); ipaddress = (ip1 << 24) + (ip2 << 16) + (ip3 << 8) + ip4; // ipaddress = htonl(ipaddress); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index 1273b71e5e..7933ec3bb4 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -1104,7 +1104,7 @@ static void saveOptions( void ) if(val != -1) { TheWritableGlobalData->m_keyboardScrollFactor = val/100.0f; - DEBUG_LOG(("Scroll Spped val %d, keyboard scroll factor %f\n", val, TheGlobalData->m_keyboardScrollFactor)); + DEBUG_LOG(("Scroll Spped val %d, keyboard scroll factor %f", val, TheGlobalData->m_keyboardScrollFactor)); AsciiString prefString; prefString.format("%d", val); (*pref)["ScrollFactor"] = prefString; @@ -1685,7 +1685,7 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) //set scroll options AsciiString test = (*pref)["DrawScrollAnchor"]; - DEBUG_LOG(("DrawScrollAnchor == [%s]\n", test.str())); + DEBUG_LOG(("DrawScrollAnchor == [%s]", test.str())); if (test == "Yes" || (test.isEmpty() && TheInGameUI->getDrawRMBScrollAnchor())) { GadgetCheckBoxSetChecked( checkDrawAnchor, true); @@ -1697,7 +1697,7 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) TheInGameUI->setDrawRMBScrollAnchor(false); } test = (*pref)["MoveScrollAnchor"]; - DEBUG_LOG(("MoveScrollAnchor == [%s]\n", test.str())); + DEBUG_LOG(("MoveScrollAnchor == [%s]", test.str())); if (test == "Yes" || (test.isEmpty() && TheInGameUI->getMoveRMBScrollAnchor())) { GadgetCheckBoxSetChecked( checkMoveAnchor, true); @@ -1719,7 +1719,7 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) // set scroll speed slider Int scrollPos = (Int)(TheGlobalData->m_keyboardScrollFactor*100.0f); GadgetSliderSetPosition( sliderScrollSpeed, scrollPos ); - DEBUG_LOG(("Scroll SPeed %d\n", scrollPos)); + DEBUG_LOG(("Scroll SPeed %d", scrollPos)); // set the send delay check box GadgetCheckBoxSetChecked(checkSendDelay, TheGlobalData->m_firewallSendDelay); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp index 223c513bfa..6bd6e90466 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp @@ -257,7 +257,7 @@ static void joinGame( AsciiString password ) req.stagingRoom.id = ourRoom->getID(); req.password = password.str(); TheGameSpyPeerMessageQueue->addRequest(req); - DEBUG_LOG(("Attempting to join game %d(%ls) with password [%s]\n", ourRoom->getID(), ourRoom->getGameName().str(), password.str())); + DEBUG_LOG(("Attempting to join game %d(%ls) with password [%s]", ourRoom->getID(), ourRoom->getGameName().str(), password.str())); GameSpyCloseOverlay(GSOVERLAY_GAMEPASSWORD); parentPopup = NULL; } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp index e5a55a2964..2c8d1fd8ca 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp @@ -408,7 +408,7 @@ WindowMsgHandledType PopupLadderSelectSystem( GameWindow *window, UnsignedInt ms if ( pass.isNotEmpty() ) // password ok { AsciiString cryptPass = EncryptString(pass.str()); - DEBUG_LOG(("pass is %s, crypted pass is %s, comparing to %s\n", + DEBUG_LOG(("pass is %s, crypted pass is %s, comparing to %s", pass.str(), cryptPass.str(), li->cryptedPassword.str())); if (cryptPass == li->cryptedPassword) ladderSelectedCallback(); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp index 0d5aa9bcca..053faf0323 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp @@ -128,11 +128,11 @@ static const Image* lookupRankImage(AsciiString side, Int rank) const Image *img = TheMappedImageCollection->findImageByName(fullImageName); if (img) { - DEBUG_LOG(("*** Loaded rank image '%s' from TheMappedImageCollection!\n", fullImageName.str())); + DEBUG_LOG(("*** Loaded rank image '%s' from TheMappedImageCollection!", fullImageName.str())); } else { - DEBUG_LOG(("*** Could not load rank image '%s' from TheMappedImageCollection!\n", fullImageName.str())); + DEBUG_LOG(("*** Could not load rank image '%s' from TheMappedImageCollection!", fullImageName.str())); } return img; } @@ -148,7 +148,7 @@ static Int getTotalDisconnectsFromFile(Int playerID) UserPreferences pref; AsciiString userPrefFilename; userPrefFilename.format("GeneralsOnline\\MiscPref%d.ini", playerID); - DEBUG_LOG(("setPersistentDataCallback - reading stats from file %s\n", userPrefFilename.str())); + DEBUG_LOG(("setPersistentDataCallback - reading stats from file %s", userPrefFilename.str())); pref.load(userPrefFilename); // if there is a file override, use that data instead. @@ -184,7 +184,7 @@ Int GetAdditionalDisconnectsFromUserFile(Int playerID) if (TheGameSpyInfo->getAdditionalDisconnects() > 0 && !retval) { - DEBUG_LOG(("Clearing additional disconnects\n")); + DEBUG_LOG(("Clearing additional disconnects")); TheGameSpyInfo->clearAdditionalDisconnects(); } @@ -204,7 +204,7 @@ void GetAdditionalDisconnectsFromUserFile(PSPlayerStats *stats) if (TheGameSpyInfo->getAdditionalDisconnects() > 0 && !getTotalDisconnectsFromFile(stats->id)) { - DEBUG_LOG(("Clearing additional disconnects\n")); + DEBUG_LOG(("Clearing additional disconnects")); TheGameSpyInfo->clearAdditionalDisconnects(); } @@ -216,7 +216,7 @@ void GetAdditionalDisconnectsFromUserFile(PSPlayerStats *stats) UserPreferences pref; AsciiString userPrefFilename; userPrefFilename.format("GeneralsOnline\\MiscPref%d.ini", stats->id); - DEBUG_LOG(("setPersistentDataCallback - reading stats from file %s\n", userPrefFilename.str())); + DEBUG_LOG(("setPersistentDataCallback - reading stats from file %s", userPrefFilename.str())); pref.load(userPrefFilename); // if there is a file override, use that data instead. @@ -1043,7 +1043,7 @@ void HandlePersistentStorageResponses( void ) break; case PSResponse::PSRESPONSE_PLAYERSTATS: { - DEBUG_LOG(("LocalProfileID %d, resp.player.id %d, resp.player.locale %d\n", TheGameSpyInfo->getLocalProfileID(), resp.player.id, resp.player.locale)); + DEBUG_LOG(("LocalProfileID %d, resp.player.id %d, resp.player.locale %d", TheGameSpyInfo->getLocalProfileID(), resp.player.id, resp.player.locale)); /* if(resp.player.id == TheGameSpyInfo->getLocalProfileID() && resp.player.locale < LOC_MIN) { @@ -1092,7 +1092,7 @@ void HandlePersistentStorageResponses( void ) Bool isPreorder = TheGameSpyInfo->didPlayerPreorder( TheGameSpyInfo->getLocalProfileID() ); req.statsToPush.preorder = isPreorder; - DEBUG_LOG(("PEERREQUEST_PUSHSTATS: stats will be %d,%d,%d,%d,%d,%d\n", + DEBUG_LOG(("PEERREQUEST_PUSHSTATS: stats will be %d,%d,%d,%d,%d,%d", req.statsToPush.locale, req.statsToPush.wins, req.statsToPush.losses, req.statsToPush.rankPoints, req.statsToPush.side, req.statsToPush.preorder)); TheGameSpyPeerMessageQueue->addRequest(req); } @@ -1101,7 +1101,7 @@ void HandlePersistentStorageResponses( void ) { UpdateLocalPlayerStats(); } - DEBUG_LOG(("PopulatePlayerInfoWindows() - lookAtPlayerID is %d, got %d\n", lookAtPlayerID, resp.player.id)); + DEBUG_LOG(("PopulatePlayerInfoWindows() - lookAtPlayerID is %d, got %d", lookAtPlayerID, resp.player.id)); PopulatePlayerInfoWindows("PopupPlayerInfo.wnd"); //GadgetListBoxAddEntryText(listboxInfo, UnicodeString(L"Got info!"), GameSpyColor[GSCOLOR_DEFAULT], -1); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp index e31b1e286d..bc3a0fd798 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp @@ -233,7 +233,7 @@ static void restartMissionMenu() msg->appendIntegerArgument(diff); msg->appendIntegerArgument(rankPointsStartedWith); msg->appendIntegerArgument(fps); - DEBUG_LOG(("Restarting game mode %d, Diff=%d, RankPoints=%d\n", gameMode, + DEBUG_LOG(("Restarting game mode %d, Diff=%d, RankPoints=%d", gameMode, TheScriptEngine->getGlobalDifficulty(), rankPointsStartedWith) ); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index c30d24da25..5a2dd1236a 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -220,7 +220,7 @@ void ScoreScreenInit( WindowLayout *layout, void *userData ) { if (TheGameSpyInfo) { - DEBUG_LOG(("ScoreScreenInit(): TheGameSpyInfo->stuff(%s/%s/%s)\n", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); + DEBUG_LOG(("ScoreScreenInit(): TheGameSpyInfo->stuff(%s/%s/%s)", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); } DontShowMainMenu = TRUE; //KRIS @@ -930,7 +930,7 @@ static Bool isSlotLocalAlly(GameInfo *game, const GameSlot *slot) static void updateSkirmishBattleHonors(SkirmishBattleHonors& stats) { - DEBUG_LOG(("Updating Skirmish battle honors\n")); + DEBUG_LOG(("Updating Skirmish battle honors")); Player *localPlayer = ThePlayerList->getLocalPlayer(); ScoreKeeper *s = localPlayer->getScoreKeeper(); @@ -1032,7 +1032,7 @@ static void updateSkirmishBattleHonors(SkirmishBattleHonors& stats) static void updateMPBattleHonors(Int& honors, PSPlayerStats& stats) { - DEBUG_LOG(("Updating MP battle honors\n")); + DEBUG_LOG(("Updating MP battle honors")); Player *localPlayer = ThePlayerList->getLocalPlayer(); ScoreKeeper *s = localPlayer->getScoreKeeper(); @@ -1356,7 +1356,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); // If we died, and are watching sparring AIs, we still get the loss. if (player->isPlayerActive()) { - DEBUG_LOG(("Skipping skirmish stats update: sandbox:%d defeat:%d victory:%d\n", + DEBUG_LOG(("Skipping skirmish stats update: sandbox:%d defeat:%d victory:%d", TheGameInfo->isSandbox(), TheVictoryConditions->isLocalAlliedDefeat(), TheVictoryConditions->isLocalAlliedVictory())); return; } @@ -1408,7 +1408,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); if (TheVictoryConditions->amIObserver()) { // nothing to track - DEBUG_LOG(("populatePlayerInfo() - not tracking stats for observer\n")); + DEBUG_LOG(("populatePlayerInfo() - not tracking stats for observer")); return; } PSPlayerStats stats = TheGameSpyPSMessageQueue->findPlayerStatsByID(localID); @@ -1443,28 +1443,28 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); anyAI = TRUE; } } - DEBUG_LOG(("Game ended on frame %d - TheGameLogic->getFrame()=%d\n", lastFrameOfGame-1, TheGameLogic->getFrame()-1)); + DEBUG_LOG(("Game ended on frame %d - TheGameLogic->getFrame()=%d", lastFrameOfGame-1, TheGameLogic->getFrame()-1)); for (i=0; igetConstSlot(i); - DEBUG_LOG(("latestHumanInGame=%d, slot->isOccupied()=%d, slot->disconnected()=%d, slot->isAI()=%d, slot->lastFrameInGame()=%d\n", + DEBUG_LOG(("latestHumanInGame=%d, slot->isOccupied()=%d, slot->disconnected()=%d, slot->isAI()=%d, slot->lastFrameInGame()=%d", latestHumanInGame, slot->isOccupied(), slot->disconnected(), slot->isAI(), slot->lastFrameInGame())); if (slot->isOccupied() && slot->disconnected()) { - DEBUG_LOG(("Marking game as a possible disconnect game\n")); + DEBUG_LOG(("Marking game as a possible disconnect game")); sawAnyDisconnects = TRUE; } if (slot->isOccupied() && !slot->disconnected() && i != localSlotNum && (slot->isAI() || (slot->lastFrameInGame() >= lastFrameOfGame/*TheGameLogic->getFrame()*/-1))) { - DEBUG_LOG(("Marking game as not ending in disconnect\n")); + DEBUG_LOG(("Marking game as not ending in disconnect")); gameEndedInDisconnect = FALSE; } } if (!sawAnyDisconnects) { - DEBUG_LOG(("Didn't see any disconnects - making gameEndedInDisconnect == FALSE\n")); + DEBUG_LOG(("Didn't see any disconnects - making gameEndedInDisconnect == FALSE")); gameEndedInDisconnect = FALSE; } @@ -1476,17 +1476,17 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); // check if we were to blame. if (TheNetwork->getPingsRecieved() < max(1, TheNetwork->getPingsSent()/2)) /// @todo: what's a good percent of pings to have gotten? { - DEBUG_LOG(("We were to blame. Leaving gameEndedInDisconnect = true\n")); + DEBUG_LOG(("We were to blame. Leaving gameEndedInDisconnect = true")); } else { - DEBUG_LOG(("We were not to blame. Changing gameEndedInDisconnect = false\n")); + DEBUG_LOG(("We were not to blame. Changing gameEndedInDisconnect = false")); gameEndedInDisconnect = FALSE; } } else { - DEBUG_LOG(("gameEndedInDisconnect, and we didn't ping on last frame. What's up with that?\n")); + DEBUG_LOG(("gameEndedInDisconnect, and we didn't ping on last frame. What's up with that?")); } } @@ -1497,7 +1497,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); } //Remove the extra disconnection we add to all games when they start. - DEBUG_LOG(("populatePlayerInfo() - removing extra disconnect\n")); + DEBUG_LOG(("populatePlayerInfo() - removing extra disconnect")); if (TheGameSpyInfo) TheGameSpyInfo->updateAdditionalGameSpyDisconnections(-1); @@ -1516,7 +1516,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); } if (!sawEndOfGame) { - DEBUG_LOG(("Not sending results - we didn't finish a game\n")); + DEBUG_LOG(("Not sending results - we didn't finish a game")); return; } @@ -1536,13 +1536,13 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); if (TheVictoryConditions->getEndFrame() < LOGICFRAMES_PER_SECOND * 25 && TheVictoryConditions->getEndFrame()) { - DEBUG_LOG(("populatePlayerInfo() - not tracking stats for short game\n")); + DEBUG_LOG(("populatePlayerInfo() - not tracking stats for short game")); return; } // generate and send a gameres packet AsciiString resultsPacket = TheGameSpyGame->generateGameSpyGameResultsPacket(); - DEBUG_LOG(("About to send results packet: %s\n", resultsPacket.str())); + DEBUG_LOG(("About to send results packet: %s", resultsPacket.str())); PSRequest grReq; grReq.requestType = PSRequest::PSREQUEST_SENDGAMERESTOGAMESPY; grReq.results = resultsPacket.str(); @@ -1550,11 +1550,11 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); Int ptIdx; const PlayerTemplate *myTemplate = player->getPlayerTemplate(); - DEBUG_LOG(("myTemplate = %X(%s)\n", myTemplate, myTemplate->getName().str())); + DEBUG_LOG(("myTemplate = %X(%s)", myTemplate, myTemplate->getName().str())); for (ptIdx = 0; ptIdx < ThePlayerTemplateStore->getPlayerTemplateCount(); ++ptIdx) { const PlayerTemplate *nthTemplate = ThePlayerTemplateStore->getNthPlayerTemplate(ptIdx); - DEBUG_LOG(("nthTemplate = %X(%s)\n", nthTemplate, nthTemplate->getName().str())); + DEBUG_LOG(("nthTemplate = %X(%s)", nthTemplate, nthTemplate->getName().str())); if (nthTemplate == myTemplate) { break; @@ -1578,7 +1578,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); SetUnsignedIntInRegistry("", "dc", discons); SetUnsignedIntInRegistry("", "se", syncs); */ - DEBUG_LOG(("populatePlayerInfo() - need to save off info for disconnect games!\n")); + DEBUG_LOG(("populatePlayerInfo() - need to save off info for disconnect games!")); PSRequest req; req.requestType = PSRequest::PSREQUEST_UPDATEPLAYERSTATS; @@ -1747,7 +1747,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); updateChallengeMedals(stats.challengeMedals); } - DEBUG_LOG(("populatePlayerInfo() - tracking stats for %s/%s/%s\n", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); + DEBUG_LOG(("populatePlayerInfo() - tracking stats for %s/%s/%s", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); PSRequest req; req.requestType = PSRequest::PSREQUEST_UPDATEPLAYERSTATS; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp index e9838fafda..23df3c933c 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp @@ -375,7 +375,7 @@ void reallyDoStart( void ) //NameKeyType sliderGameSpeedID = TheNameKeyGenerator->nameToKey( AsciiString( "SkirmishGameOptionsMenu.wnd:SliderGameSpeed" ) ); GameWindow *sliderGameSpeed = TheWindowManager->winGetWindowFromId( parentSkirmishGameOptions, sliderGameSpeedID ); Int maxFPS = GadgetSliderGetPosition( sliderGameSpeed ); - DEBUG_LOG(("GameSpeedSlider was at %d\n", maxFPS)); + DEBUG_LOG(("GameSpeedSlider was at %d", maxFPS)); if (maxFPS > GREATER_NO_FPS_LIMIT) maxFPS = 1000; if (maxFPS < 15) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp index 33cfafb8e8..ac41cdb72c 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp @@ -273,14 +273,14 @@ WindowMsgHandledType BuddyControlSystem( GameWindow *window, UnsignedInt msg, if (recipIt == m->end()) break; - DEBUG_LOG(("Trying to send a buddy message to %d.\n", selectedProfile)); + DEBUG_LOG(("Trying to send a buddy message to %d.", selectedProfile)); if (TheGameSpyGame && TheGameSpyGame->isInGame() && TheGameSpyGame->isGameInProgress() && !ThePlayerList->getLocalPlayer()->isPlayerActive()) { - DEBUG_LOG(("I'm dead - gotta look for cheats.\n")); + DEBUG_LOG(("I'm dead - gotta look for cheats.")); for (Int i=0; igetGameSpySlot(i)->getProfileID())); + DEBUG_LOG(("Slot[%d] profile is %d", i, TheGameSpyGame->getGameSpySlot(i)->getProfileID())); if (TheGameSpyGame->getGameSpySlot(i)->getProfileID() == selectedProfile) { // can't send to someone in our game if we're dead/observing. security breach and all that. no seances for you. @@ -537,7 +537,7 @@ void HandleBuddyResponses( void ) message.m_senderNick = nick; messages->push_back(message); - DEBUG_LOG(("Inserting buddy chat from '%s'/'%s'\n", nick.str(), resp.arg.message.nick)); + DEBUG_LOG(("Inserting buddy chat from '%s'/'%s'", nick.str(), resp.arg.message.nick)); // put message on screen insertChat(message); @@ -1213,7 +1213,7 @@ void RequestBuddyAdd(Int profileID, AsciiString nick) // insert status into box messages->push_back(message); - DEBUG_LOG(("Inserting buddy add request\n")); + DEBUG_LOG(("Inserting buddy add request")); // put message on screen insertChat(message); @@ -1286,7 +1286,7 @@ WindowMsgHandledType WOLBuddyOverlayRCMenuSystem( GameWindow *window, UnsignedIn { if(!isGameSpyUser) break; - DEBUG_LOG(("ButtonAdd was pushed\n")); + DEBUG_LOG(("ButtonAdd was pushed")); if (isRequest) { // ok the request @@ -1335,12 +1335,12 @@ WindowMsgHandledType WOLBuddyOverlayRCMenuSystem( GameWindow *window, UnsignedIn BuddyInfoMap *buddies = (isBuddy)?TheGameSpyInfo->getBuddyMap():TheGameSpyInfo->getBuddyRequestMap(); buddies->erase(profileID); updateBuddyInfo(); - DEBUG_LOG(("ButtonDelete was pushed\n")); + DEBUG_LOG(("ButtonDelete was pushed")); PopulateLobbyPlayerListbox(); } else if( controlID == buttonPlayID ) { - DEBUG_LOG(("buttonPlayID was pushed\n")); + DEBUG_LOG(("buttonPlayID was pushed")); } else if( controlID == buttonIgnoreID ) { @@ -1374,7 +1374,7 @@ WindowMsgHandledType WOLBuddyOverlayRCMenuSystem( GameWindow *window, UnsignedIn } else if( controlID == buttonStatsID ) { - DEBUG_LOG(("buttonStatsID was pushed\n")); + DEBUG_LOG(("buttonStatsID was pushed")); GameSpyCloseOverlay(GSOVERLAY_PLAYERINFO); SetLookAtPlayer(profileID,nick ); GameSpyOpenOverlay(GSOVERLAY_PLAYERINFO); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp index 302abe11ec..6382711271 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp @@ -123,7 +123,7 @@ void SendStatsToOtherPlayers(const GameInfo *game) AsciiString hostName; hostName.translate(slot->getName()); req.nick = hostName.str(); - DEBUG_LOG(("SendStatsToOtherPlayers() - sending to '%s', data of\n\t'%s'\n", hostName.str(), req.options.c_str())); + DEBUG_LOG(("SendStatsToOtherPlayers() - sending to '%s', data of\n\t'%s'", hostName.str(), req.options.c_str())); TheGameSpyPeerMessageQueue->addRequest(req); } } @@ -243,7 +243,7 @@ void PopBackToLobby( void ) //TheGameSpyInfo->joinBestGroupRoom(); } - DEBUG_LOG(("PopBackToLobby() - parentWOLGameSetup is %X\n", parentWOLGameSetup)); + DEBUG_LOG(("PopBackToLobby() - parentWOLGameSetup is %X", parentWOLGameSetup)); if (parentWOLGameSetup) { nextScreen = "Menus/WOLCustomLobby.wnd"; @@ -1187,18 +1187,18 @@ void WOLGameSetupMenuInit( WindowLayout *layout, void *userData ) GameSpyCloseAllOverlays(); GSMessageBoxOk( title, body ); TheGameSpyInfo->reset(); - DEBUG_LOG(("WOLGameSetupMenuInit() - game was in progress, and we were disconnected, so pop immediate back to main menu\n")); + DEBUG_LOG(("WOLGameSetupMenuInit() - game was in progress, and we were disconnected, so pop immediate back to main menu")); TheShell->popImmediate(); return; } // If we init while the game is in progress, we are really returning to the menu // after the game. So, we pop the menu and go back to the lobby. Whee! - DEBUG_LOG(("WOLGameSetupMenuInit() - game was in progress, so pop immediate back to lobby\n")); + DEBUG_LOG(("WOLGameSetupMenuInit() - game was in progress, so pop immediate back to lobby")); TheShell->popImmediate(); if (TheGameSpyPeerMessageQueue && TheGameSpyPeerMessageQueue->isConnected()) { - DEBUG_LOG(("We're still connected, so pushing back on the lobby\n")); + DEBUG_LOG(("We're still connected, so pushing back on the lobby")); TheShell->push("Menus/WOLCustomLobby.wnd", TRUE); } return; @@ -1344,7 +1344,7 @@ static void shutdownComplete( WindowLayout *layout ) { if (!TheGameSpyPeerMessageQueue || !TheGameSpyPeerMessageQueue->isConnected()) { - DEBUG_LOG(("GameSetup shutdownComplete() - skipping push because we're disconnected\n")); + DEBUG_LOG(("GameSetup shutdownComplete() - skipping push because we're disconnected")); } else { @@ -1490,7 +1490,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) { // haven't seen ourselves buttonPushed = true; - DEBUG_LOG(("Haven't seen ourselves in slotlist\n")); + DEBUG_LOG(("Haven't seen ourselves in slotlist")); if (TheGameSpyGame) TheGameSpyGame->reset(); TheGameSpyInfo->leaveStagingRoom(); @@ -1541,13 +1541,13 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) if (!TheLobbyQueuedUTMs.empty()) { - DEBUG_LOG(("Got response from queued lobby UTM list\n")); + DEBUG_LOG(("Got response from queued lobby UTM list")); resp = TheLobbyQueuedUTMs.front(); TheLobbyQueuedUTMs.pop_front(); } else if (TheGameSpyPeerMessageQueue->getResponse( resp )) { - DEBUG_LOG(("Got response from message queue\n")); + DEBUG_LOG(("Got response from message queue")); } else { @@ -1784,7 +1784,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) #if defined(RTS_DEBUG) if (g_debugSlots) { - DEBUG_LOG(("About to process a room UTM. Command is '%s', command options is '%s'\n", + DEBUG_LOG(("About to process a room UTM. Command is '%s', command options is '%s'", resp.command.c_str(), resp.commandOptions.c_str())); } #endif @@ -1795,26 +1795,26 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) Bool isValidSlotList = game && game->getSlot(0) && game->getSlot(0)->isPlayer( resp.nick.c_str() ) && !TheGameSpyInfo->amIHost(); if (!isValidSlotList) { - SLOTLIST_DEBUG_LOG(("Not a valid slotlist\n")); + SLOTLIST_DEBUG_LOG(("Not a valid slotlist")); if (!game) { - SLOTLIST_DEBUG_LOG(("No game!\n")); + SLOTLIST_DEBUG_LOG(("No game!")); } else { if (!game->getSlot(0)) { - SLOTLIST_DEBUG_LOG(("No slot 0!\n")); + SLOTLIST_DEBUG_LOG(("No slot 0!")); } else { if (TheGameSpyInfo->amIHost()) { - SLOTLIST_DEBUG_LOG(("I'm the host!\n")); + SLOTLIST_DEBUG_LOG(("I'm the host!")); } else { - SLOTLIST_DEBUG_LOG(("Not from the host! isHuman:%d, name:'%ls', sender:'%s'\n", + SLOTLIST_DEBUG_LOG(("Not from the host! isHuman:%d, name:'%ls', sender:'%s'", game->getSlot(0)->isHuman(), game->getSlot(0)->getName().str(), resp.nick.c_str())); } @@ -1871,15 +1871,15 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) Bool isInGame = newLocalSlotNum >= 0; if (!optionsOK) { - SLOTLIST_DEBUG_LOG(("Options are bad! bailing!\n")); + SLOTLIST_DEBUG_LOG(("Options are bad! bailing!")); break; } else { - SLOTLIST_DEBUG_LOG(("Options are good, local slot is %d\n", newLocalSlotNum)); + SLOTLIST_DEBUG_LOG(("Options are good, local slot is %d", newLocalSlotNum)); if (!isInGame) { - SLOTLIST_DEBUG_LOG(("Not in game; players are:\n")); + SLOTLIST_DEBUG_LOG(("Not in game; players are:")); for (Int i=0; igetGameSpySlot(i); @@ -1887,7 +1887,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) { UnicodeString munkee; munkee.format(L"\t%d: %ls", i, slot->getName().str()); - SLOTLIST_DEBUG_LOG(("%ls\n", munkee.str())); + SLOTLIST_DEBUG_LOG(("%ls", munkee.str())); } } } @@ -1947,7 +1947,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) { // can't see ourselves buttonPushed = true; - DEBUG_LOG(("Can't see ourselves in slotlist %s\n", options.str())); + DEBUG_LOG(("Can't see ourselves in slotlist %s", options.str())); TheGameSpyInfo->getCurrentStagingRoom()->reset(); TheGameSpyInfo->leaveStagingRoom(); //TheGameSpyInfo->joinBestGroupRoom(); @@ -2034,7 +2034,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) UnicodeString message = TheGameText->fetch("GUI:GSKicked"); AsciiString commandMessage = resp.commandOptions.c_str(); commandMessage.trim(); - DEBUG_LOG(("We were kicked: reason was '%s'\n", resp.commandOptions.c_str())); + DEBUG_LOG(("We were kicked: reason was '%s'", resp.commandOptions.c_str())); if (commandMessage == "GameStarted") { message = TheGameText->fetch("GUI:GSKickedGameStarted"); @@ -2096,7 +2096,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) options.nextToken(&key, "="); Int val = atoi(options.str()+1); UnsignedInt uVal = atoi(options.str()+1); - DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d\n", key.str(), options.str()+1, slotNum)); + DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d", key.str(), options.str()+1, slotNum)); GameSpyGameSlot *slot = game->getGameSpySlot(slotNum); if (!slot) @@ -2125,7 +2125,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) } else { - DEBUG_LOG(("Rejecting invalid color %d\n", val)); + DEBUG_LOG(("Rejecting invalid color %d", val)); } } else if (key == "PlayerTemplate") @@ -2144,7 +2144,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) } else { - DEBUG_LOG(("Rejecting invalid PlayerTemplate %d\n", val)); + DEBUG_LOG(("Rejecting invalid PlayerTemplate %d", val)); } } else if (key == "StartPos") @@ -2171,7 +2171,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) } else { - DEBUG_LOG(("Rejecting invalid startPos %d\n", val)); + DEBUG_LOG(("Rejecting invalid startPos %d", val)); } } else if (key == "Team") @@ -2184,7 +2184,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) } else { - DEBUG_LOG(("Rejecting invalid team %d\n", val)); + DEBUG_LOG(("Rejecting invalid team %d", val)); } } else if (key == "IP") @@ -2198,7 +2198,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) } else { - DEBUG_LOG(("Rejecting invalid IP %d\n", uVal)); + DEBUG_LOG(("Rejecting invalid IP %d", uVal)); } } else if (key == "NAT") @@ -2207,19 +2207,19 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) (val <= FirewallHelperClass::FIREWALL_MAX)) { slot->setNATBehavior((FirewallHelperClass::FirewallBehaviorType)val); - DEBUG_LOG(("Setting NAT behavior to %d for player %d\n", val, slotNum)); + DEBUG_LOG(("Setting NAT behavior to %d for player %d", val, slotNum)); change = true; } else { - DEBUG_LOG(("Rejecting invalid NAT behavior %d from player %d\n", val, slotNum)); + DEBUG_LOG(("Rejecting invalid NAT behavior %d from player %d", val, slotNum)); } } else if (key == "Ping") { slot->setPingString(options.str()+1); TheGameSpyInfo->setGameOptions(); - DEBUG_LOG(("Setting ping string to %s for player %d\n", options.str()+1, slotNum)); + DEBUG_LOG(("Setting ping string to %s for player %d", options.str()+1, slotNum)); } if (change) @@ -2230,9 +2230,9 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) TheGameSpyInfo->setGameOptions(); WOLDisplaySlotList(); - DEBUG_LOG(("Slot value is color=%d, PlayerTemplate=%d, startPos=%d, team=%d, IP=0x%8.8X\n", + DEBUG_LOG(("Slot value is color=%d, PlayerTemplate=%d, startPos=%d, team=%d, IP=0x%8.8X", slot->getColor(), slot->getPlayerTemplate(), slot->getStartPos(), slot->getTeamNumber(), slot->getIP())); - DEBUG_LOG(("Slot list updated to %s\n", GameInfoToAsciiString(game).str())); + DEBUG_LOG(("Slot list updated to %s", GameInfoToAsciiString(game).str())); } } } @@ -2265,7 +2265,7 @@ WindowMsgHandledType WOLGameSetupMenuInput( GameWindow *window, UnsignedInt msg, GameWindow *control = (GameWindow *)mData1; NameKeyType controlID = (NameKeyType)control->winGetWindowId(); - DEBUG_LOG(("GWM_RIGHT_UP for control %d(%s)\n", controlID, TheNameKeyGenerator->keyToName(controlID).str())); + DEBUG_LOG(("GWM_RIGHT_UP for control %d(%s)", controlID, TheNameKeyGenerator->keyToName(controlID).str())); break; } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index 27a74906ac..98d9d36947 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -344,7 +344,7 @@ static void populateGroupRoomListbox(GameWindow *lb) GameSpyGroupRoom room = iter->second; if (room.m_groupID != TheGameSpyConfig->getQMChannel()) { - DEBUG_LOG(("populateGroupRoomListbox(): groupID %d\n", room.m_groupID)); + DEBUG_LOG(("populateGroupRoomListbox(): groupID %d", room.m_groupID)); if (room.m_groupID == TheGameSpyInfo->getCurrentGroupRoom()) { Int selected = GadgetComboBoxAddEntry(lb, room.m_translatedName, GameSpyColor[GSCOLOR_CURRENTROOM]); @@ -359,7 +359,7 @@ static void populateGroupRoomListbox(GameWindow *lb) } else { - DEBUG_LOG(("populateGroupRoomListbox(): skipping QM groupID %d\n", room.m_groupID)); + DEBUG_LOG(("populateGroupRoomListbox(): skipping QM groupID %d", room.m_groupID)); } } @@ -499,7 +499,7 @@ void PopulateLobbyPlayerListbox(void) uStr = GadgetListBoxGetText(listboxLobbyPlayers, selectedIndices[i], 2); selectedName.translate(uStr); selectedNames.insert(selectedName); - DEBUG_LOG(("Saving off old selection %d (%s)\n", selectedIndices[i], selectedName.str())); + DEBUG_LOG(("Saving off old selection %d (%s)", selectedIndices[i], selectedName.str())); } // save off old top entry @@ -518,7 +518,7 @@ void PopulateLobbyPlayerListbox(void) selIt = selectedNames.find(info.m_name); if (selIt != selectedNames.end()) { - DEBUG_LOG(("Marking index %d (%s) to re-select\n", index, info.m_name.str())); + DEBUG_LOG(("Marking index %d (%s) to re-select", index, info.m_name.str())); indicesToSelect.insert(index); } } @@ -536,7 +536,7 @@ void PopulateLobbyPlayerListbox(void) selIt = selectedNames.find(info.m_name); if (selIt != selectedNames.end()) { - DEBUG_LOG(("Marking index %d (%s) to re-select\n", index, info.m_name.str())); + DEBUG_LOG(("Marking index %d (%s) to re-select", index, info.m_name.str())); indicesToSelect.insert(index); } } @@ -554,7 +554,7 @@ void PopulateLobbyPlayerListbox(void) selIt = selectedNames.find(info.m_name); if (selIt != selectedNames.end()) { - DEBUG_LOG(("Marking index %d (%s) to re-select\n", index, info.m_name.str())); + DEBUG_LOG(("Marking index %d (%s) to re-select", index, info.m_name.str())); indicesToSelect.insert(index); } } @@ -570,7 +570,7 @@ void PopulateLobbyPlayerListbox(void) while (index < count) { newIndices[index] = *indexIt; - DEBUG_LOG(("Queueing up index %d to re-select\n", *indexIt)); + DEBUG_LOG(("Queueing up index %d to re-select", *indexIt)); ++index; ++indexIt; } @@ -651,19 +651,19 @@ void WOLLobbyMenuInit( WindowLayout *layout, void *userData ) { if (groupRoomToJoin) { - DEBUG_LOG(("WOLLobbyMenuInit() - rejoining group room %d\n", groupRoomToJoin)); + DEBUG_LOG(("WOLLobbyMenuInit() - rejoining group room %d", groupRoomToJoin)); TheGameSpyInfo->joinGroupRoom(groupRoomToJoin); groupRoomToJoin = 0; } else { - DEBUG_LOG(("WOLLobbyMenuInit() - joining best group room\n")); + DEBUG_LOG(("WOLLobbyMenuInit() - joining best group room")); TheGameSpyInfo->joinBestGroupRoom(); } } else { - DEBUG_LOG(("WOLLobbyMenuInit() - not joining group room because we're already in one\n")); + DEBUG_LOG(("WOLLobbyMenuInit() - not joining group room because we're already in one")); } GrabWindowInfo(); @@ -854,15 +854,15 @@ static void refreshGameList( Bool forceRefresh ) { if (TheGameSpyInfo->hasStagingRoomListChanged()) { - //DEBUG_LOG(("################### refreshing game list\n")); - //DEBUG_LOG(("gameRefreshTime=%d, refreshInterval=%d, now=%d\n", gameListRefreshTime, refreshInterval, timeGetTime())); + //DEBUG_LOG(("################### refreshing game list")); + //DEBUG_LOG(("gameRefreshTime=%d, refreshInterval=%d, now=%d", gameListRefreshTime, refreshInterval, timeGetTime())); RefreshGameListBoxes(); gameListRefreshTime = timeGetTime(); } else { //DEBUG_LOG(("-")); } } else { - //DEBUG_LOG(("gameListRefreshTime: %d refreshInterval: %d\n")); + //DEBUG_LOG(("gameListRefreshTime: %d refreshInterval: %d")); } } //------------------------------------------------------------------------------------------------- @@ -954,7 +954,7 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) } else { - DEBUG_LOG(("WOLLobbyMenuUpdate() - joining best group room\n")); + DEBUG_LOG(("WOLLobbyMenuUpdate() - joining best group room")); TheGameSpyInfo->joinBestGroupRoom(); } populateGroupRoomListbox(comboLobbyGroupRooms); @@ -998,7 +998,7 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) case PeerResponse::PEERRESPONSE_PLAYERUTM: case PeerResponse::PEERRESPONSE_ROOMUTM: { - DEBUG_LOG(("Putting off a UTM in the lobby\n")); + DEBUG_LOG(("Putting off a UTM in the lobby")); TheLobbyQueuedUTMs.push_back(resp); } break; @@ -1067,7 +1067,7 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) const char *firstPlayer = resp.stagingRoomPlayerNames[i].c_str(); if (!strcmp(hostName.str(), firstPlayer)) { - DEBUG_LOG(("Saw host %s == %s in slot %d\n", hostName.str(), firstPlayer, i)); + DEBUG_LOG(("Saw host %s == %s in slot %d", hostName.str(), firstPlayer, i)); isHostPresent = TRUE; } } @@ -1111,13 +1111,13 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) GSMessageBoxOk(TheGameText->fetch("GUI:JoinFailedDefault"), s); if (groupRoomToJoin) { - DEBUG_LOG(("WOLLobbyMenuUpdate() - rejoining group room %d\n", groupRoomToJoin)); + DEBUG_LOG(("WOLLobbyMenuUpdate() - rejoining group room %d", groupRoomToJoin)); TheGameSpyInfo->joinGroupRoom(groupRoomToJoin); groupRoomToJoin = 0; } else { - DEBUG_LOG(("WOLLobbyMenuUpdate() - joining best group room\n")); + DEBUG_LOG(("WOLLobbyMenuUpdate() - joining best group room")); TheGameSpyInfo->joinBestGroupRoom(); } } @@ -1231,7 +1231,7 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) } } DEBUG_ASSERTCRASH(numPlayers, ("Game had no players!\n")); - //DEBUG_LOG(("Saw room: hasPass=%d, allowsObservers=%d\n", room.getHasPassword(), room.getAllowObservers())); + //DEBUG_LOG(("Saw room: hasPass=%d, allowsObservers=%d", room.getHasPassword(), room.getAllowObservers())); if (resp.stagingRoom.action == PEER_ADD) { TheGameSpyInfo->addStagingRoom(room); @@ -1293,15 +1293,15 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) { if (TheGameSpyInfo->hasStagingRoomListChanged()) { - //DEBUG_LOG(("################### refreshing game list\n")); - //DEBUG_LOG(("gameRefreshTime=%d, refreshInterval=%d, now=%d\n", gameListRefreshTime, refreshInterval, timeGetTime())); + //DEBUG_LOG(("################### refreshing game list")); + //DEBUG_LOG(("gameRefreshTime=%d, refreshInterval=%d, now=%d", gameListRefreshTime, refreshInterval, timeGetTime())); RefreshGameListBoxes(); gameListRefreshTime = timeGetTime(); } else { //DEBUG_LOG(("-")); } } else { - //DEBUG_LOG(("gameListRefreshTime: %d refreshInterval: %d\n")); + //DEBUG_LOG(("gameListRefreshTime: %d refreshInterval: %d")); } #else refreshGameList(); @@ -1551,7 +1551,7 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg, if (!roomToJoin || roomToJoin->getExeCRC() != TheGlobalData->m_exeCRC || roomToJoin->getIniCRC() != TheGlobalData->m_iniCRC) { // bad crc. don't go. - DEBUG_LOG(("WOLLobbyMenuSystem - CRC mismatch with the game I'm trying to join. My CRC's - EXE:0x%08X INI:0x%08X Their CRC's - EXE:0x%08x INI:0x%08x\n", TheGlobalData->m_exeCRC, TheGlobalData->m_iniCRC, roomToJoin->getExeCRC(), roomToJoin->getIniCRC())); + DEBUG_LOG(("WOLLobbyMenuSystem - CRC mismatch with the game I'm trying to join. My CRC's - EXE:0x%08X INI:0x%08X Their CRC's - EXE:0x%08x INI:0x%08x", TheGlobalData->m_exeCRC, TheGlobalData->m_iniCRC, roomToJoin->getExeCRC(), roomToJoin->getIniCRC())); #if defined(RTS_DEBUG) if (TheGlobalData->m_netMinPlayers) { @@ -1647,12 +1647,12 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg, int rowSelected = -1; GadgetComboBoxGetSelectedPos(control, &rowSelected); - DEBUG_LOG(("Row selected = %d\n", rowSelected)); + DEBUG_LOG(("Row selected = %d", rowSelected)); if (rowSelected >= 0) { Int groupID; groupID = (Int)GadgetComboBoxGetItemData(comboLobbyGroupRooms, rowSelected); - DEBUG_LOG(("ItemData was %d, current Group Room is %d\n", groupID, TheGameSpyInfo->getCurrentGroupRoom())); + DEBUG_LOG(("ItemData was %d, current Group Room is %d", groupID, TheGameSpyInfo->getCurrentGroupRoom())); if (groupID && groupID != TheGameSpyInfo->getCurrentGroupRoom()) { TheGameSpyInfo->leaveGroupRoom(); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp index d7475ae1c9..b2555349d9 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp @@ -769,7 +769,7 @@ static void checkLogin( void ) { // save off our ping string, and end those threads AsciiString pingStr = ThePinger->getPingString( 1000 ); - DEBUG_LOG(("Ping string is %s\n", pingStr.str())); + DEBUG_LOG(("Ping string is %s", pingStr.str())); TheGameSpyInfo->setPingString(pingStr); //delete ThePinger; //ThePinger = NULL; @@ -868,7 +868,7 @@ void WOLLoginMenuUpdate( WindowLayout * layout, void *userData) // kill & restart the threads AsciiString motd = TheGameSpyInfo->getMOTD(); AsciiString config = TheGameSpyInfo->getConfig(); - DEBUG_LOG(("Tearing down GameSpy from WOLLoginMenuUpdate(PEERRESPONSE_DISCONNECT)\n")); + DEBUG_LOG(("Tearing down GameSpy from WOLLoginMenuUpdate(PEERRESPONSE_DISCONNECT)")); TearDownGameSpy(); SetUpGameSpy( motd.str(), config.str() ); } @@ -894,7 +894,7 @@ void WOLLoginMenuUpdate( WindowLayout * layout, void *userData) // kill & restart the threads AsciiString motd = TheGameSpyInfo->getMOTD(); AsciiString config = TheGameSpyInfo->getConfig(); - DEBUG_LOG(("Tearing down GameSpy from WOLLoginMenuUpdate(login timeout)\n")); + DEBUG_LOG(("Tearing down GameSpy from WOLLoginMenuUpdate(login timeout)")); TearDownGameSpy(); SetUpGameSpy( motd.str(), config.str() ); } @@ -1273,7 +1273,7 @@ WindowMsgHandledType WOLLoginMenuSystem( GameWindow *window, UnsignedInt msg, //TheGameSpyInfo->setLocalProfileID( resp.player.profileID ); TheGameSpyInfo->setLocalEmail( email ); TheGameSpyInfo->setLocalPassword( password ); - DEBUG_LOG(("before create: TheGameSpyInfo->stuff(%s/%s/%s)\n", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); + DEBUG_LOG(("before create: TheGameSpyInfo->stuff(%s/%s/%s)", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); TheGameSpyBuddyMessageQueue->addRequest( req ); if(checkBoxRememberPassword && GadgetCheckBoxIsChecked(checkBoxRememberPassword)) @@ -1362,7 +1362,7 @@ WindowMsgHandledType WOLLoginMenuSystem( GameWindow *window, UnsignedInt msg, //TheGameSpyInfo->setLocalProfileID( resp.player.profileID ); TheGameSpyInfo->setLocalEmail( email ); TheGameSpyInfo->setLocalPassword( password ); - DEBUG_LOG(("before login: TheGameSpyInfo->stuff(%s/%s/%s)\n", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); + DEBUG_LOG(("before login: TheGameSpyInfo->stuff(%s/%s/%s)", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); TheGameSpyBuddyMessageQueue->addRequest( req ); if(checkBoxRememberPassword && GadgetCheckBoxIsChecked(checkBoxRememberPassword)) @@ -1479,7 +1479,7 @@ WindowMsgHandledType WOLLoginMenuSystem( GameWindow *window, UnsignedInt msg, } } //uniLine.trim(); - DEBUG_LOG(("adding TOS line: [%ls]\n", uniLine.str())); + DEBUG_LOG(("adding TOS line: [%ls]", uniLine.str())); GadgetListBoxAddEntryText(listboxTOS, uniLine, tosColor, -1); } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp index b5bafa1e1e..100103b212 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp @@ -730,7 +730,7 @@ void WOLQuickMatchMenuInit( WindowLayout *layout, void *userData ) GameSpyCloseAllOverlays(); GSMessageBoxOk( title, body ); TheGameSpyInfo->reset(); - DEBUG_LOG(("WOLQuickMatchMenuInit() - game was in progress, and we were disconnected, so pop immediate back to main menu\n")); + DEBUG_LOG(("WOLQuickMatchMenuInit() - game was in progress, and we were disconnected, so pop immediate back to main menu")); TheShell->popImmediate(); return; } @@ -1137,17 +1137,17 @@ void WOLQuickMatchMenuUpdate( WindowLayout * layout, void *userData) { if (!stricmp(resp.command.c_str(), "STATS")) { - DEBUG_LOG(("Saw STATS from %s, data was '%s'\n", resp.nick.c_str(), resp.commandOptions.c_str())); + DEBUG_LOG(("Saw STATS from %s, data was '%s'", resp.nick.c_str(), resp.commandOptions.c_str())); AsciiString data = resp.commandOptions.c_str(); AsciiString idStr; data.nextToken(&idStr, " "); Int id = atoi(idStr.str()); - DEBUG_LOG(("data: %d(%s) - '%s'\n", id, idStr.str(), data.str())); + DEBUG_LOG(("data: %d(%s) - '%s'", id, idStr.str(), data.str())); PSPlayerStats stats = TheGameSpyPSMessageQueue->parsePlayerKVPairs(data.str()); PSPlayerStats oldStats = TheGameSpyPSMessageQueue->findPlayerStatsByID(id); stats.id = id; - DEBUG_LOG(("Parsed ID is %d, old ID is %d\n", stats.id, oldStats.id)); + DEBUG_LOG(("Parsed ID is %d, old ID is %d", stats.id, oldStats.id)); if (stats.id && (oldStats.id == 0)) TheGameSpyPSMessageQueue->trackPlayerStats(stats); @@ -1178,12 +1178,12 @@ void WOLQuickMatchMenuUpdate( WindowLayout * layout, void *userData) (val <= FirewallHelperClass::FIREWALL_TYPE_DESTINATION_PORT_DELTA)) { slot->setNATBehavior((FirewallHelperClass::FirewallBehaviorType)val); - DEBUG_LOG(("Setting NAT behavior to %d for player %d\n", val, slotNum)); + DEBUG_LOG(("Setting NAT behavior to %d for player %d", val, slotNum)); change = true; } else { - DEBUG_LOG(("Rejecting invalid NAT behavior %d from player %d\n", val, slotNum)); + DEBUG_LOG(("Rejecting invalid NAT behavior %d from player %d", val, slotNum)); } } */ @@ -1324,7 +1324,7 @@ void WOLQuickMatchMenuUpdate( WindowLayout * layout, void *userData) } } - DEBUG_LOG(("Starting a QM game: options=[%s]\n", GameInfoToAsciiString(TheGameSpyGame).str())); + DEBUG_LOG(("Starting a QM game: options=[%s]", GameInfoToAsciiString(TheGameSpyGame).str())); SendStatsToOtherPlayers(TheGameSpyGame); TheGameSpyGame->startGame(0); GameWindow *buttonBuddies = TheWindowManager->winGetWindowFromId(NULL, buttonBuddiesID); @@ -1661,7 +1661,7 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms if (ladderInfo && ladderInfo->randomFactions) { Int sideNum = GameClientRandomValue(0, ladderInfo->validFactions.size()-1); - DEBUG_LOG(("Looking for %d out of %d random sides\n", sideNum, ladderInfo->validFactions.size())); + DEBUG_LOG(("Looking for %d out of %d random sides", sideNum, ladderInfo->validFactions.size())); AsciiStringListConstIterator cit = ladderInfo->validFactions.begin(); while (sideNum) { @@ -1672,13 +1672,13 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms { Int numPlayerTemplates = ThePlayerTemplateStore->getPlayerTemplateCount(); AsciiString sideStr = *cit; - DEBUG_LOG(("Chose %s as our side... finding\n", sideStr.str())); + DEBUG_LOG(("Chose %s as our side... finding", sideStr.str())); for (Int c=0; cgetNthPlayerTemplate(c); if (fac && fac->getSide() == sideStr) { - DEBUG_LOG(("Found %s in index %d\n", sideStr.str(), c)); + DEBUG_LOG(("Found %s in index %d", sideStr.str(), c)); req.QM.side = c; break; } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp index b9a8e18c75..6984daada8 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp @@ -281,7 +281,7 @@ static void updateNumPlayersOnline(void) g = grabUByte(aLine.str()+5); b = grabUByte(aLine.str()+7); c = GameMakeColor(r, g, b, a); - DEBUG_LOG(("MOTD line '%s' has color %X\n", aLine.str(), c)); + DEBUG_LOG(("MOTD line '%s' has color %X", aLine.str(), c)); aLine = aLine.str() + 9; } line = UnicodeString(MultiByteToWideCharSingleLine(aLine.str()).c_str()); @@ -346,7 +346,7 @@ static void updateOverallStats(void) usa = calcPercent(s_statsUSA, STATS_LASTWEEK, TheGameText->fetch("SIDE:America")); china = calcPercent(s_statsChina, STATS_LASTWEEK, TheGameText->fetch("SIDE:China")); gla = calcPercent(s_statsGLA, STATS_LASTWEEK, TheGameText->fetch("SIDE:GLA")); - DEBUG_LOG(("Last Week: %ls %ls %ls\n", usa.str(), china.str(), gla.str())); + DEBUG_LOG(("Last Week: %ls %ls %ls", usa.str(), china.str(), gla.str())); win = TheWindowManager->winGetWindowFromId( NULL, NAMEKEY("WOLWelcomeMenu.wnd:StaticTextUSALastWeek") ); GadgetStaticTextSetText(win, usa); win = TheWindowManager->winGetWindowFromId( NULL, NAMEKEY("WOLWelcomeMenu.wnd:StaticTextChinaLastWeek") ); @@ -357,7 +357,7 @@ static void updateOverallStats(void) usa = calcPercent(s_statsUSA, STATS_TODAY, TheGameText->fetch("SIDE:America")); china = calcPercent(s_statsChina, STATS_TODAY, TheGameText->fetch("SIDE:China")); gla = calcPercent(s_statsGLA, STATS_TODAY, TheGameText->fetch("SIDE:GLA")); - DEBUG_LOG(("Today: %ls %ls %ls\n", usa.str(), china.str(), gla.str())); + DEBUG_LOG(("Today: %ls %ls %ls", usa.str(), china.str(), gla.str())); win = TheWindowManager->winGetWindowFromId( NULL, NAMEKEY("WOLWelcomeMenu.wnd:StaticTextUSAToday") ); GadgetStaticTextSetText(win, usa); win = TheWindowManager->winGetWindowFromId( NULL, NAMEKEY("WOLWelcomeMenu.wnd:StaticTextChinaToday") ); @@ -779,7 +779,7 @@ WindowMsgHandledType WOLWelcomeMenuSystem( GameWindow *window, UnsignedInt msg, breq.buddyRequestType = BuddyRequest::BUDDYREQUEST_LOGOUT; TheGameSpyBuddyMessageQueue->addRequest( breq ); - DEBUG_LOG(("Tearing down GameSpy from WOLWelcomeMenuSystem(GBM_SELECTED)\n")); + DEBUG_LOG(("Tearing down GameSpy from WOLWelcomeMenuSystem(GBM_SELECTED)")); TearDownGameSpy(); /* diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp index 3fb2f24bfc..bcac0e91fb 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp @@ -2429,7 +2429,7 @@ void GadgetListBoxAddMultiSelect( GameWindow *listbox ) DEBUG_ASSERTCRASH(listboxData && listboxData->selections == NULL, ("selections is not NULL")); listboxData->selections = NEW Int [listboxData->listLength]; - DEBUG_LOG(( "Enable list box multi select: listLength (select) = %d * %d = %d bytes;\n", + DEBUG_LOG(( "Enable list box multi select: listLength (select) = %d * %d = %d bytes;", listboxData->listLength, sizeof(Int), listboxData->listLength *sizeof(Int) )); @@ -2569,7 +2569,7 @@ void GadgetListBoxSetListLength( GameWindow *listbox, Int newLength ) if( listboxData->listData == NULL ) { - DEBUG_LOG(( "Unable to allocate listbox data pointer\n" )); + DEBUG_LOG(( "Unable to allocate listbox data pointer" )); assert( 0 ); return; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp index 605a2a8e05..1cb94f79cb 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp @@ -208,7 +208,7 @@ GameFont *FontLibrary::getFont( AsciiString name, Int pointSize, Bool bold ) font->bold = bold; font->fontData = NULL; - //DEBUG_LOG(("Font: Loading font '%s' %d point\n", font->nameString.str(), font->pointSize)); + //DEBUG_LOG(("Font: Loading font '%s' %d point", font->nameString.str(), font->pointSize)); // load the device specific data pointer if( loadFontData( font ) == FALSE ) { diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp index 4f9ce08ef0..737d07cdc0 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp @@ -1607,7 +1607,7 @@ Int GameWindow::winSetEnabledImage( Int index, const Image *image ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set enabled image, index out of range '%d'\n", index )); + DEBUG_LOG(( "set enabled image, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1628,7 +1628,7 @@ Int GameWindow::winSetEnabledColor( Int index, Color color ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set enabled color, index out of range '%d'\n", index )); + DEBUG_LOG(( "set enabled color, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1649,7 +1649,7 @@ Int GameWindow::winSetEnabledBorderColor( Int index, Color color ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set enabled border color, index out of range '%d'\n", index )); + DEBUG_LOG(( "set enabled border color, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1670,7 +1670,7 @@ Int GameWindow::winSetDisabledImage( Int index, const Image *image ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set disabled image, index out of range '%d'\n", index )); + DEBUG_LOG(( "set disabled image, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1691,7 +1691,7 @@ Int GameWindow::winSetDisabledColor( Int index, Color color ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set disabled color, index out of range '%d'\n", index )); + DEBUG_LOG(( "set disabled color, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1712,7 +1712,7 @@ Int GameWindow::winSetDisabledBorderColor( Int index, Color color ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set disabled border color, index out of range '%d'\n", index )); + DEBUG_LOG(( "set disabled border color, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1733,7 +1733,7 @@ Int GameWindow::winSetHiliteImage( Int index, const Image *image ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set hilite image, index out of range '%d'\n", index )); + DEBUG_LOG(( "set hilite image, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1754,7 +1754,7 @@ Int GameWindow::winSetHiliteColor( Int index, Color color ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set hilite color, index out of range '%d'\n", index )); + DEBUG_LOG(( "set hilite color, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1775,7 +1775,7 @@ Int GameWindow::winSetHiliteBorderColor( Int index, Color color ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set hilite border color, index out of range '%d'\n", index )); + DEBUG_LOG(( "set hilite border color, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp index 1edec48f25..700ca2b0a0 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp @@ -1374,7 +1374,7 @@ void GameWindowManager::dumpWindow( GameWindow *window ) if( window == NULL ) return; - DEBUG_LOG(( "ID: %d\tRedraw: 0x%08X\tUser Data: %d\n", + DEBUG_LOG(( "ID: %d\tRedraw: 0x%08X\tUser Data: %d", window->winGetWindowId(), window->m_draw, window->m_userData )); for( child = window->m_child; child; child = child->m_next ) @@ -1401,7 +1401,7 @@ GameWindow *GameWindowManager::winCreate( GameWindow *parent, if( window == NULL ) { - DEBUG_LOG(( "WinCreate error: Could not allocate new window\n" )); + DEBUG_LOG(( "WinCreate error: Could not allocate new window" )); #ifndef FINAL { GameWindow *win; @@ -1602,7 +1602,7 @@ Int GameWindowManager::winUnsetModal( GameWindow *window ) { // return error if not - DEBUG_LOG(( "WinUnsetModal: Invalid window attempting to unset modal (%d)\n", + DEBUG_LOG(( "WinUnsetModal: Invalid window attempting to unset modal (%d)", window->winGetWindowId() )); return WIN_ERR_GENERAL_FAILURE; @@ -1849,7 +1849,7 @@ GameWindow *GameWindowManager::gogoGadgetPushButton( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_PUSH_BUTTON ) == FALSE ) { - DEBUG_LOG(( "Cann't create button gadget, instance data not button type\n" )); + DEBUG_LOG(( "Cann't create button gadget, instance data not button type" )); assert( 0 ); return NULL; @@ -1863,7 +1863,7 @@ GameWindow *GameWindowManager::gogoGadgetPushButton( GameWindow *parent, if( button == NULL ) { - DEBUG_LOG(( "Unable to create button for push button gadget\n" )); + DEBUG_LOG(( "Unable to create button for push button gadget" )); assert( 0 ); return NULL; @@ -1917,7 +1917,7 @@ GameWindow *GameWindowManager::gogoGadgetCheckbox( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_CHECK_BOX ) == FALSE ) { - DEBUG_LOG(( "Cann't create checkbox gadget, instance data not checkbox type\n" )); + DEBUG_LOG(( "Cann't create checkbox gadget, instance data not checkbox type" )); assert( 0 ); return NULL; @@ -1931,7 +1931,7 @@ GameWindow *GameWindowManager::gogoGadgetCheckbox( GameWindow *parent, if( checkbox == NULL ) { - DEBUG_LOG(( "Unable to create checkbox window\n" )); + DEBUG_LOG(( "Unable to create checkbox window" )); assert( 0 ); return NULL; @@ -1984,7 +1984,7 @@ GameWindow *GameWindowManager::gogoGadgetRadioButton( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_RADIO_BUTTON ) == FALSE ) { - DEBUG_LOG(( "Cann't create radioButton gadget, instance data not radioButton type\n" )); + DEBUG_LOG(( "Cann't create radioButton gadget, instance data not radioButton type" )); assert( 0 ); return NULL; @@ -1998,7 +1998,7 @@ GameWindow *GameWindowManager::gogoGadgetRadioButton( GameWindow *parent, if( radioButton == NULL ) { - DEBUG_LOG(( "Unable to create radio button window\n" )); + DEBUG_LOG(( "Unable to create radio button window" )); assert( 0 ); return NULL; @@ -2056,7 +2056,7 @@ GameWindow *GameWindowManager::gogoGadgetTabControl( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_TAB_CONTROL ) == FALSE ) { - DEBUG_LOG(( "Cann't create tabControl gadget, instance data not tabControl type\n" )); + DEBUG_LOG(( "Cann't create tabControl gadget, instance data not tabControl type" )); assert( 0 ); return NULL; @@ -2070,7 +2070,7 @@ GameWindow *GameWindowManager::gogoGadgetTabControl( GameWindow *parent, if( tabControl == NULL ) { - DEBUG_LOG(( "Unable to create tab control window\n" )); + DEBUG_LOG(( "Unable to create tab control window" )); assert( 0 ); return NULL; @@ -2128,7 +2128,7 @@ GameWindow *GameWindowManager::gogoGadgetListBox( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_SCROLL_LISTBOX ) == FALSE ) { - DEBUG_LOG(( "Cann't create listbox gadget, instance data not listbox type\n" )); + DEBUG_LOG(( "Cann't create listbox gadget, instance data not listbox type" )); assert( 0 ); return NULL; @@ -2141,7 +2141,7 @@ GameWindow *GameWindowManager::gogoGadgetListBox( GameWindow *parent, if( listbox == NULL ) { - DEBUG_LOG(( "Unable to create listbox window\n" )); + DEBUG_LOG(( "Unable to create listbox window" )); assert( 0 ); return NULL; @@ -2307,7 +2307,7 @@ GameWindow *GameWindowManager::gogoGadgetSlider( GameWindow *parent, else { - DEBUG_LOG(( "gogoGadgetSlider warning: unrecognized slider style.\n" )); + DEBUG_LOG(( "gogoGadgetSlider warning: unrecognized slider style." )); assert( 0 ); return NULL; @@ -2317,7 +2317,7 @@ GameWindow *GameWindowManager::gogoGadgetSlider( GameWindow *parent, if( slider == NULL ) { - DEBUG_LOG(( "Unable to create slider control window\n" )); + DEBUG_LOG(( "Unable to create slider control window" )); assert( 0 ); return NULL; @@ -2396,7 +2396,7 @@ GameWindow *GameWindowManager::gogoGadgetComboBox( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_COMBO_BOX) == FALSE ) { - DEBUG_LOG(( "Cann't create ComboBox gadget, instance data not ComboBox type\n" )); + DEBUG_LOG(( "Cann't create ComboBox gadget, instance data not ComboBox type" )); assert( 0 ); return NULL; @@ -2409,7 +2409,7 @@ GameWindow *GameWindowManager::gogoGadgetComboBox( GameWindow *parent, if( comboBox == NULL ) { - DEBUG_LOG(( "Unable to create ComboBox window\n" )); + DEBUG_LOG(( "Unable to create ComboBox window" )); assert( 0 ); return NULL; @@ -2600,7 +2600,7 @@ GameWindow *GameWindowManager::gogoGadgetProgressBar( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_PROGRESS_BAR ) == FALSE ) { - DEBUG_LOG(( "Cann't create progressBar gadget, instance data not progressBar type\n" )); + DEBUG_LOG(( "Cann't create progressBar gadget, instance data not progressBar type" )); assert( 0 ); return NULL; @@ -2614,7 +2614,7 @@ GameWindow *GameWindowManager::gogoGadgetProgressBar( GameWindow *parent, if( progressBar == NULL ) { - DEBUG_LOG(( "Unable to create progress bar control\n" )); + DEBUG_LOG(( "Unable to create progress bar control" )); assert( 0 ); return NULL; @@ -2666,7 +2666,7 @@ GameWindow *GameWindowManager::gogoGadgetStaticText( GameWindow *parent, } else { - DEBUG_LOG(( "gogoGadgetText warning: unrecognized text style.\n" )); + DEBUG_LOG(( "gogoGadgetText warning: unrecognized text style." )); return NULL; } @@ -2728,7 +2728,7 @@ GameWindow *GameWindowManager::gogoGadgetTextEntry( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_ENTRY_FIELD ) == FALSE ) { - DEBUG_LOG(( "Unable to create text entry, style not entry type\n" )); + DEBUG_LOG(( "Unable to create text entry, style not entry type" )); assert( 0 ); return NULL; @@ -2740,7 +2740,7 @@ GameWindow *GameWindowManager::gogoGadgetTextEntry( GameWindow *parent, if( entry == NULL ) { - DEBUG_LOG(( "Unable to create text entry window\n" )); + DEBUG_LOG(( "Unable to create text entry window" )); assert( 0 ); return NULL; @@ -2834,7 +2834,7 @@ GameWindow *GameWindowManager::gogoGadgetTextEntry( GameWindow *parent, if( data->constructList == NULL ) { - DEBUG_LOG(( "gogoGadgetEntry warning: Failed to create listbox.\n" )); + DEBUG_LOG(( "gogoGadgetEntry warning: Failed to create listbox." )); assert( 0 ); winDestroy( entry ); return NULL; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp index 081e52176a..b9f5351cc8 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp @@ -239,7 +239,7 @@ static void parseBitString( const char *inBuffer, UnsignedInt *bits, const char { if ( !parseBitFlag( tok, bits, flagList ) ) { - DEBUG_LOG(( "ParseBitString: Invalid flag '%s'.\n", tok )); + DEBUG_LOG(( "ParseBitString: Invalid flag '%s'.", tok )); } } } @@ -286,7 +286,7 @@ static void readUntilSemicolon( File *fp, char *buffer, int maxBufLen ) } - DEBUG_LOG(( "ReadUntilSemicolon: ERROR - Read buffer overflow - input truncated.\n" )); + DEBUG_LOG(( "ReadUntilSemicolon: ERROR - Read buffer overflow - input truncated." )); buffer[ maxBufLen - 1 ] = '\000'; @@ -389,7 +389,7 @@ static void pushWindow( GameWindow *window ) if( stackPtr == &windowStack[ WIN_STACK_DEPTH - 1 ] ) { - DEBUG_LOG(( "pushWindow: Warning, stack overflow\n" )); + DEBUG_LOG(( "pushWindow: Warning, stack overflow" )); return; } // end if @@ -993,7 +993,7 @@ static Bool parseTooltipText( const char *token, WinInstanceData *instData, if( strlen( c ) >= MAX_TEXT_LABEL ) { - DEBUG_LOG(( "TextTooltip label '%s' is too long, max is '%d'\n", c, MAX_TEXT_LABEL )); + DEBUG_LOG(( "TextTooltip label '%s' is too long, max is '%d'", c, MAX_TEXT_LABEL )); assert( 0 ); return FALSE; @@ -1043,7 +1043,7 @@ static Bool parseText( const char *token, WinInstanceData *instData, if( strlen( c ) >= MAX_TEXT_LABEL ) { - DEBUG_LOG(( "Text label '%s' is too long, max is '%d'\n", c, MAX_TEXT_LABEL )); + DEBUG_LOG(( "Text label '%s' is too long, max is '%d'", c, MAX_TEXT_LABEL )); assert( 0 ); return FALSE; @@ -1082,7 +1082,7 @@ static Bool parseTextColor( const char *token, WinInstanceData *instData, else { - DEBUG_LOG(( "Undefined state for text color\n" )); + DEBUG_LOG(( "Undefined state for text color" )); assert( 0 ); return FALSE; @@ -1303,7 +1303,7 @@ static Bool parseDrawData( const char *token, WinInstanceData *instData, else { - DEBUG_LOG(( "ParseDrawData, undefined token '%s'\n", token )); + DEBUG_LOG(( "ParseDrawData, undefined token '%s'", token )); assert( 0 ); return FALSE; @@ -2233,7 +2233,7 @@ static Bool parseChildWindows( GameWindow *window, if( lastWindow != window ) { - DEBUG_LOG(( "parseChildWindows: unmatched window on stack. Corrupt stack or bad source\n" )); + DEBUG_LOG(( "parseChildWindows: unmatched window on stack. Corrupt stack or bad source" )); return FALSE; } @@ -2403,7 +2403,7 @@ static GameWindow *parseWindow( File *inFile, char *buffer ) if (parse->parse( token, &instData, buffer, data ) == FALSE ) { - DEBUG_LOG(( "parseGameObject: Error parsing %s\n", parse->name )); + DEBUG_LOG(( "parseGameObject: Error parsing %s", parse->name )); goto cleanupAndExit; } @@ -2426,7 +2426,7 @@ static GameWindow *parseWindow( File *inFile, char *buffer ) if( parseData( &data, type, buffer ) == FALSE ) { - DEBUG_LOG(( "parseGameWindow: Error parsing %s\n", parse->name )); + DEBUG_LOG(( "parseGameWindow: Error parsing %s", parse->name )); goto cleanupAndExit; } @@ -2725,7 +2725,7 @@ GameWindow *GameWindowManager::winCreateFromScript( AsciiString filenameString, inFile = TheFileSystem->openFile(filepath, File::READ); if (inFile == NULL) { - DEBUG_LOG(( "WinCreateFromScript: Cannot access file '%s'.\n", filename )); + DEBUG_LOG(( "WinCreateFromScript: Cannot access file '%s'.", filename )); return NULL; } @@ -2742,7 +2742,7 @@ GameWindow *GameWindowManager::winCreateFromScript( AsciiString filenameString, if( parseLayoutBlock( inFile, buffer, version, &scriptInfo ) == FALSE ) { - DEBUG_LOG(( "WinCreateFromScript: Error parsing layout block\n" )); + DEBUG_LOG(( "WinCreateFromScript: Error parsing layout block" )); return FALSE; } // end if diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp index 71e2ba2ad4..dd44f328e9 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp @@ -1493,7 +1493,7 @@ void CountUpTransition::init( GameWindow *win ) AsciiString tempStr; tempStr.translate(m_fullText); m_intValue = atoi(tempStr.str()); - DEBUG_LOG(("CountUpTransition::init %hs %s %d\n", m_fullText.str(), tempStr.str(), m_intValue)); + DEBUG_LOG(("CountUpTransition::init %hs %s %d", m_fullText.str(), tempStr.str(), m_intValue)); if(m_intValue < COUNTUPTRANSITION_END) { m_countState = COUNT_ONES; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp index 484ac94d04..3460bb3f15 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp @@ -186,7 +186,7 @@ GameFont *HeaderTemplateManager::getFontFromTemplate( AsciiString name ) HeaderTemplate *ht = findHeaderTemplate( name ); if(!ht) { - //DEBUG_LOG(("HeaderTemplateManager::getFontFromTemplate - Could not find header %s\n", name.str())); + //DEBUG_LOG(("HeaderTemplateManager::getFontFromTemplate - Could not find header %s", name.str())); return NULL; } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp index 236df23fc2..e3e42fe2c3 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp @@ -396,7 +396,7 @@ void IMEManager::printMessageInfo( Int message, Int wParam, Int lParam ) { Char *notifyName = getMessageName( m_notifyInfo, wParam ); if ( notifyName == NULL ) notifyName = "unknown"; - DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x\n", messageText, message, notifyName, wParam, lParam )); + DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x", messageText, message, notifyName, wParam, lParam )); break; } case WM_IME_CONTROL: @@ -404,7 +404,7 @@ void IMEManager::printMessageInfo( Int message, Int wParam, Int lParam ) Char *controlName = getMessageName( m_controlInfo, wParam ); if ( controlName == NULL ) controlName = "unknown"; - DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x\n", messageText, message, controlName, wParam, lParam )); + DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x", messageText, message, controlName, wParam, lParam )); break; } #ifdef WM_IME_REQUEST @@ -413,7 +413,7 @@ void IMEManager::printMessageInfo( Int message, Int wParam, Int lParam ) Char *requestName = getMessageName( m_requestInfo, wParam ); if ( requestName == NULL ) requestName = "unknown"; - DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x\n", messageText, message, requestName, wParam, lParam )); + DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x", messageText, message, requestName, wParam, lParam )); break; } #endif @@ -423,13 +423,13 @@ void IMEManager::printMessageInfo( Int message, Int wParam, Int lParam ) buildFlagsString( m_setContextInfo, lParam, flags ); - DEBUG_LOG(( "IMM: %s(0x%04x) - 0x%08x - %s(0x%04x)\n", messageText, message, wParam, flags.str(), lParam )); + DEBUG_LOG(( "IMM: %s(0x%04x) - 0x%08x - %s(0x%04x)", messageText, message, wParam, flags.str(), lParam )); break; } default: if ( messageText ) { - DEBUG_LOG(( "IMM: %s(0x%04x) - 0x%08x - 0x%08x\n", messageText, message, wParam, lParam )); + DEBUG_LOG(( "IMM: %s(0x%04x) - 0x%08x - 0x%08x", messageText, message, wParam, lParam )); } break; } @@ -450,7 +450,7 @@ void IMEManager::printConversionStatus( void ) buildFlagsString( m_setCmodeInfo, mode, flags ); - DEBUG_LOG(( "IMM: Conversion mode = (%s)\n", flags.str())); + DEBUG_LOG(( "IMM: Conversion mode = (%s)", flags.str())); } } @@ -469,7 +469,7 @@ void IMEManager::printSentenceStatus( void ) buildFlagsString( m_setSmodeInfo, mode, flags ); - DEBUG_LOG(( "IMM: Sentence mode = (%s)\n", flags.str())); + DEBUG_LOG(( "IMM: Sentence mode = (%s)", flags.str())); } } #endif // DEBUG_IME @@ -681,7 +681,7 @@ Bool IMEManager::serviceIMEMessage( void *windowsHandle, UnsignedInt message, In { WideChar wchar = convertCharToWide(wParam); #ifdef DEBUG_IME - DEBUG_LOG(("IMM: WM_IME_CHAR - '%hc'0x%04x\n", wchar, wchar )); + DEBUG_LOG(("IMM: WM_IME_CHAR - '%hc'0x%04x", wchar, wchar )); #endif if ( m_window && (wchar > 32 || wchar == VK_RETURN )) @@ -699,7 +699,7 @@ Bool IMEManager::serviceIMEMessage( void *windowsHandle, UnsignedInt message, In WideChar wchar = (WideChar) (wParam & 0xffff); #ifdef DEBUG_IME - DEBUG_LOG(("IMM: WM_CHAR - '%hc'0x%04x\n", wchar, wchar )); + DEBUG_LOG(("IMM: WM_CHAR - '%hc'0x%04x", wchar, wchar )); #endif if ( m_window && (wchar >= 32 || wchar == VK_RETURN) ) @@ -713,7 +713,7 @@ Bool IMEManager::serviceIMEMessage( void *windowsHandle, UnsignedInt message, In // -------------------------------------------------------------------- case WM_IME_SELECT: - DEBUG_LOG(("IMM: WM_IME_SELECT\n")); + DEBUG_LOG(("IMM: WM_IME_SELECT")); return FALSE; case WM_IME_STARTCOMPOSITION: //The WM_IME_STARTCOMPOSITION message is sent immediately before an @@ -1421,7 +1421,7 @@ void IMEManager::updateCandidateList( Int candidateFlags ) m_selectedIndex = clist->dwSelection; #ifdef DEBUG_IME - DEBUG_LOG(("IME: Candidate Update: Candidates = %d, pageSize = %d pageStart = %d, selected = %d\n", m_candidateCount, m_pageStart, m_pageSize, m_selectedIndex )); + DEBUG_LOG(("IME: Candidate Update: Candidates = %d, pageSize = %d pageStart = %d, selected = %d", m_candidateCount, m_pageStart, m_pageSize, m_selectedIndex )); #endif if ( m_candidateUpArrow ) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 4abe899b9f..27cc138e49 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -735,7 +735,7 @@ void MultiPlayerLoadScreen::init( GameInfo *game ) if(loadScreenImage) m_loadScreen->winSetEnabledImage(0, loadScreenImage); //DEBUG_ASSERTCRASH(TheNetwork, ("Where the Heck is the Network!!!!")); - //DEBUG_LOG(("NumPlayers %d\n", TheNetwork->getNumPlayers())); + //DEBUG_LOG(("NumPlayers %d", TheNetwork->getNumPlayers())); GameWindow *teamWin[MAX_SLOTS]; Int i = 0; @@ -878,7 +878,7 @@ void MultiPlayerLoadScreen::processProgress(Int playerId, Int percentage) DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d\n", percentage, playerId)); return; } - //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)\n", percentage, playerId, m_playerLookup[playerId])); + //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)", percentage, playerId, m_playerLookup[playerId])); if(m_progressBars[m_playerLookup[playerId]]) GadgetProgressBarSetProgress(m_progressBars[m_playerLookup[playerId]], percentage ); } @@ -945,7 +945,7 @@ void GameSpyLoadScreen::init( GameInfo *game ) m_loadScreen->winBringToTop(); m_mapPreview = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "GameSpyLoadScreen.wnd:WinMapPreview")); DEBUG_ASSERTCRASH(TheNetwork, ("Where the Heck is the Network!!!!")); - DEBUG_LOG(("NumPlayers %d\n", TheNetwork->getNumPlayers())); + DEBUG_LOG(("NumPlayers %d", TheNetwork->getNumPlayers())); GameSlot *lSlot = game->getSlot(game->getLocalSlotNum()); const PlayerTemplate* pt; if (lSlot->getPlayerTemplate() >= 0) @@ -1037,7 +1037,7 @@ GameSlot *lSlot = game->getSlot(game->getLocalSlotNum()); // Get the stats for the player PSPlayerStats stats = TheGameSpyPSMessageQueue->findPlayerStatsByID(slot->getProfileID()); - DEBUG_LOG(("LoadScreen - populating info for %ls(%d) - stats returned id %d\n", + DEBUG_LOG(("LoadScreen - populating info for %ls(%d) - stats returned id %d", slot->getName().str(), slot->getProfileID(), stats.id)); Bool isPreorder = TheGameSpyInfo->didPlayerPreorder(stats.id); @@ -1206,7 +1206,7 @@ void GameSpyLoadScreen::processProgress(Int playerId, Int percentage) DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d\n", percentage, playerId)); return; } - //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)\n", percentage, playerId, m_playerLookup[playerId])); + //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)", percentage, playerId, m_playerLookup[playerId])); if(m_progressBars[m_playerLookup[playerId]]) GadgetProgressBarSetProgress(m_progressBars[m_playerLookup[playerId]], percentage ); } @@ -1257,7 +1257,7 @@ void MapTransferLoadScreen::init( GameInfo *game ) m_loadScreen->winBringToTop(); DEBUG_ASSERTCRASH(TheNetwork, ("Where the Heck is the Network?!!!!")); - DEBUG_LOG(("NumPlayers %d\n", TheNetwork->getNumPlayers())); + DEBUG_LOG(("NumPlayers %d", TheNetwork->getNumPlayers())); AsciiString winName; Int i; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp index d0c44b5e59..3568c45a39 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp @@ -840,7 +840,7 @@ void ProcessAnimateWindowSlideFromBottomTimed::initReverseAnimateWindow( wnd::An UnsignedInt now = timeGetTime(); - DEBUG_LOG(("initReverseAnimateWindow at %d (%d->%d)\n", now, now, now + m_maxDuration)); + DEBUG_LOG(("initReverseAnimateWindow at %d (%d->%d)", now, now, now + m_maxDuration)); animWin->setAnimData(startPos, endPos, curPos, restPos, vel, now, now + m_maxDuration); } @@ -882,7 +882,7 @@ void ProcessAnimateWindowSlideFromBottomTimed::initAnimateWindow( wnd::AnimateWi UnsignedInt now = timeGetTime(); UnsignedInt delay = animWin->getDelay(); - DEBUG_LOG(("initAnimateWindow at %d (%d->%d)\n", now, now + delay, now + m_maxDuration + delay)); + DEBUG_LOG(("initAnimateWindow at %d (%d->%d)", now, now + delay, now + m_maxDuration + delay)); animWin->setAnimData(startPos, endPos, curPos, restPos, vel, now + delay, now + m_maxDuration + delay); } @@ -929,12 +929,12 @@ Bool ProcessAnimateWindowSlideFromBottomTimed::updateAnimateWindow( wnd::Animate curPos.y = endPos.y; animWin->setFinished( TRUE ); win->winSetPosition(curPos.x, curPos.y); - DEBUG_LOG(("window finished animating at %d (%d->%d)\n", now, startTime, endTime)); + DEBUG_LOG(("window finished animating at %d (%d->%d)", now, startTime, endTime)); return TRUE; } curPos.y = startPos.y + percentDone*(endPos.y - startPos.y); - DEBUG_LOG(("(%d,%d) -> (%d,%d) -> (%d,%d) at %g\n", + DEBUG_LOG(("(%d,%d) -> (%d,%d) -> (%d,%d) at %g", startPos.x, startPos.y, curPos.x, curPos.y, endPos.x, endPos.y, percentDone)); win->winSetPosition(curPos.x, curPos.y); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp index f3bc2b4af2..3d04b61b62 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp @@ -331,10 +331,10 @@ void Shell::push( AsciiString filename, Bool shutdownImmediate ) #ifdef DEBUG_LOGGING - DEBUG_LOG(("Shell:push(%s) - stack was\n", filename.str())); + DEBUG_LOG(("Shell:push(%s) - stack was", filename.str())); for (Int i=0; igetFilename().str())); + DEBUG_LOG(("\t\t%s", m_screenStack[i]->getFilename().str())); } #endif @@ -342,7 +342,7 @@ void Shell::push( AsciiString filename, Bool shutdownImmediate ) if( m_screenCount >= MAX_SHELL_STACK ) { - DEBUG_LOG(( "Unable to load screen '%s', max '%d' reached\n", + DEBUG_LOG(( "Unable to load screen '%s', max '%d' reached", filename.str(), MAX_SHELL_STACK )); return; @@ -398,10 +398,10 @@ void Shell::pop( void ) return; #ifdef DEBUG_LOGGING - DEBUG_LOG(("Shell:pop() - stack was\n")); + DEBUG_LOG(("Shell:pop() - stack was")); for (Int i=0; igetFilename().str())); + DEBUG_LOG(("\t\t%s", m_screenStack[i]->getFilename().str())); } #endif @@ -437,10 +437,10 @@ void Shell::popImmediate( void ) return; #ifdef DEBUG_LOGGING - DEBUG_LOG(("Shell:popImmediate() - stack was\n")); + DEBUG_LOG(("Shell:popImmediate() - stack was")); for (Int i=0; igetFilename().str())); + DEBUG_LOG(("\t\t%s", m_screenStack[i]->getFilename().str())); } #endif @@ -467,7 +467,7 @@ void Shell::popImmediate( void ) //------------------------------------------------------------------------------------------------- void Shell::showShell( Bool runInit ) { - DEBUG_LOG(("Shell:showShell() - %s (%s)\n", TheGlobalData->m_initialFile.str(), (top())?top()->getFilename().str():"no top screen")); + DEBUG_LOG(("Shell:showShell() - %s (%s)", TheGlobalData->m_initialFile.str(), (top())?top()->getFilename().str():"no top screen")); if(!TheGlobalData->m_initialFile.isEmpty() || !TheGlobalData->m_simulateReplays.empty()) { @@ -576,7 +576,7 @@ void Shell::hideShell( void ) // If we have the 3d background running, mark it to close m_clearBackground = TRUE; - DEBUG_LOG(("Shell:hideShell() - %s\n", (top())?top()->getFilename().str():"no top screen")); + DEBUG_LOG(("Shell:hideShell() - %s", (top())?top()->getFilename().str():"no top screen")); WindowLayout *layout = top(); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp index 9e2d4fb281..7ef63f6edc 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp @@ -208,7 +208,7 @@ Bool WindowLayout::load( AsciiString filename ) { DEBUG_ASSERTCRASH( target, ("WindowLayout::load - Failed to load layout") ); - DEBUG_LOG(( "WindowLayout::load - Unable to load layout file '%s'\n", filename.str() )); + DEBUG_LOG(( "WindowLayout::load - Unable to load layout file '%s'", filename.str() )); return FALSE; } // end if diff --git a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp index 9d639e17da..1f7a752611 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -131,17 +131,17 @@ GameClient::~GameClient() // clear any drawable TOC we might have m_drawableTOC.clear(); - //DEBUG_LOG(("Preloaded texture files ------------------------------------------\n")); + //DEBUG_LOG(("Preloaded texture files ------------------------------------------")); //for (Int oog=0; oog %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d", before.dwAvailPageFile, after.dwAvailPageFile, before.dwAvailPageFile - after.dwAvailPageFile)); - DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d", before.dwAvailPhys, after.dwAvailPhys, before.dwAvailPhys - after.dwAvailPhys)); - DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d", before.dwAvailVirtual, after.dwAvailVirtual, before.dwAvailVirtual - after.dwAvailVirtual)); /* - DEBUG_LOG(("Preloading memory dwLength %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwLength %d --> %d : %d", before.dwLength, after.dwLength, before.dwLength - after.dwLength)); - DEBUG_LOG(("Preloading memory dwMemoryLoad %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwMemoryLoad %d --> %d : %d", before.dwMemoryLoad, after.dwMemoryLoad, before.dwMemoryLoad - after.dwMemoryLoad)); - DEBUG_LOG(("Preloading memory dwTotalPageFile %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwTotalPageFile %d --> %d : %d", before.dwTotalPageFile, after.dwTotalPageFile, before.dwTotalPageFile - after.dwTotalPageFile)); - DEBUG_LOG(("Preloading memory dwTotalPhys %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwTotalPhys %d --> %d : %d", before.dwTotalPhys , after.dwTotalPhys, before.dwTotalPhys - after.dwTotalPhys)); - DEBUG_LOG(("Preloading memory dwTotalVirtual %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwTotalVirtual %d --> %d : %d", before.dwTotalVirtual , after.dwTotalVirtual, before.dwTotalVirtual - after.dwTotalVirtual)); */ @@ -1093,11 +1093,11 @@ void GameClient::preloadAssets( TimeOfDay timeOfDay ) GlobalMemoryStatus(&after); debrisModelNamesGlobalHack.clear(); - DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d", before.dwAvailPageFile, after.dwAvailPageFile, before.dwAvailPageFile - after.dwAvailPageFile)); - DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d", before.dwAvailPhys, after.dwAvailPhys, before.dwAvailPhys - after.dwAvailPhys)); - DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d", before.dwAvailVirtual, after.dwAvailVirtual, before.dwAvailVirtual - after.dwAvailVirtual)); TheControlBar->preloadAssets( timeOfDay ); @@ -1106,11 +1106,11 @@ void GameClient::preloadAssets( TimeOfDay timeOfDay ) TheParticleSystemManager->preloadAssets( timeOfDay ); GlobalMemoryStatus(&after); - DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d", before.dwAvailPageFile, after.dwAvailPageFile, before.dwAvailPageFile - after.dwAvailPageFile)); - DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d", before.dwAvailPhys, after.dwAvailPhys, before.dwAvailPhys - after.dwAvailPhys)); - DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d", before.dwAvailVirtual, after.dwAvailVirtual, before.dwAvailVirtual - after.dwAvailVirtual)); const char *textureNames[] = { @@ -1160,11 +1160,11 @@ void GameClient::preloadAssets( TimeOfDay timeOfDay ) TheDisplay->preloadTextureAssets(textureNames[i]); GlobalMemoryStatus(&after); - DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d", before.dwAvailPageFile, after.dwAvailPageFile, before.dwAvailPageFile - after.dwAvailPageFile)); - DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d", before.dwAvailPhys, after.dwAvailPhys, before.dwAvailPhys - after.dwAvailPhys)); - DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d", before.dwAvailVirtual, after.dwAvailVirtual, before.dwAvailVirtual - after.dwAvailVirtual)); // preloadTextureNamesGlobalHack2 = preloadTextureNamesGlobalHack; @@ -1526,11 +1526,11 @@ void GameClient::xfer( Xfer *xfer ) BriefingList *bList = GetBriefingTextList(); Int numEntries = bList->size(); xfer->xferInt(&numEntries); - DEBUG_LOG(("Saving %d briefing lines\n", numEntries)); + DEBUG_LOG(("Saving %d briefing lines", numEntries)); for (BriefingList::const_iterator bIt = bList->begin(); bIt != bList->end(); ++bIt) { AsciiString tempStr = *bIt; - DEBUG_LOG(("'%s'\n", tempStr.str())); + DEBUG_LOG(("'%s'", tempStr.str())); xfer->xferAsciiString(&tempStr); } } @@ -1538,13 +1538,13 @@ void GameClient::xfer( Xfer *xfer ) { Int numEntries = 0; xfer->xferInt(&numEntries); - DEBUG_LOG(("Loading %d briefing lines\n", numEntries)); + DEBUG_LOG(("Loading %d briefing lines", numEntries)); UpdateDiplomacyBriefingText(AsciiString::TheEmptyString, TRUE); // clear out briefing list first while (numEntries-- > 0) { AsciiString tempStr; xfer->xferAsciiString(&tempStr); - DEBUG_LOG(("'%s'\n", tempStr.str())); + DEBUG_LOG(("'%s'", tempStr.str())); UpdateDiplomacyBriefingText(tempStr, FALSE); } } diff --git a/Generals/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp b/Generals/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp index e8b8a8aa82..b7938b2bf8 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp @@ -49,7 +49,7 @@ GameMessageDisposition GameClientMessageDispatcher::translateGameMessage(const G if (msg->getType() == GameMessage::MSG_FRAME_TICK) return KEEP_MESSAGE; - //DEBUG_LOG(("GameClientMessageDispatcher::translateGameMessage() - eating a %s on frame %d\n", + //DEBUG_LOG(("GameClientMessageDispatcher::translateGameMessage() - eating a %s on frame %d", //((GameMessage *)msg)->getCommandAsAsciiString().str(), TheGameClient->getFrame())); return DESTROY_MESSAGE; diff --git a/Generals/Code/GameEngine/Source/GameClient/GameText.cpp b/Generals/Code/GameEngine/Source/GameClient/GameText.cpp index 7ae6f28ccf..10c4cb43d1 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GameText.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GameText.cpp @@ -411,15 +411,15 @@ void GameTextManager::deinit( void ) NoString *noString = m_noStringList; - DEBUG_LOG(("\n*** Missing strings ***\n")); + DEBUG_LOG(("\n*** Missing strings ***")); while ( noString ) { - DEBUG_LOG(("*** %ls ***\n", noString->text.str())); + DEBUG_LOG(("*** %ls ***", noString->text.str())); NoString *next = noString->next; delete noString; noString = next; } - DEBUG_LOG(("*** End missing strings ***\n\n")); + DEBUG_LOG(("*** End missing strings ***\n")); m_noStringList = NULL; @@ -834,7 +834,7 @@ Bool GameTextManager::getStringCount( const char *filename, Int& textCount ) File *file; file = TheFileSystem->openFile(filename, File::READ | File::TEXT); - DEBUG_LOG(("Looking in %s for string file\n", filename)); + DEBUG_LOG(("Looking in %s for string file", filename)); if ( file == NULL ) { @@ -875,7 +875,7 @@ Bool GameTextManager::getCSFInfo ( const Char *filename ) CSFHeader header; Int ok = FALSE; File *file = TheFileSystem->openFile(filename, File::READ | File::BINARY); - DEBUG_LOG(("Looking in %s for compiled string file\n", filename)); + DEBUG_LOG(("Looking in %s for compiled string file", filename)); if ( file != NULL ) { @@ -1318,7 +1318,7 @@ UnicodeString GameTextManager::fetch( const Char *label, Bool *exists ) noString = noString->next; } - //DEBUG_LOG(("*** MISSING:'%s' ***\n", label)); + //DEBUG_LOG(("*** MISSING:'%s' ***", label)); // Remember file could have been altered at this point. noString = NEW NoString; noString->text = missingString; diff --git a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp index 99fb712174..6109ef36c6 100644 --- a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -556,7 +556,7 @@ void InGameUI::addSuperweapon(Int playerIndex, const AsciiString& powerName, Obj const Player* player = ThePlayerList->getNthPlayer(playerIndex); Bool hiddenByScience = (powerTemplate->getRequiredScience() != SCIENCE_INVALID) && (player->hasScience(powerTemplate->getRequiredScience()) == false); - DEBUG_LOG(("Adding superweapon UI timer\n")); + DEBUG_LOG(("Adding superweapon UI timer")); SuperweaponInfo *info = newInstance(SuperweaponInfo)( id, -1, // timestamp @@ -578,7 +578,7 @@ void InGameUI::addSuperweapon(Int playerIndex, const AsciiString& powerName, Obj // ------------------------------------------------------------------------------------------------ Bool InGameUI::removeSuperweapon(Int playerIndex, const AsciiString& powerName, ObjectID id, const SpecialPowerTemplate *powerTemplate) { - DEBUG_LOG(("Removing superweapon UI timer\n")); + DEBUG_LOG(("Removing superweapon UI timer")); SuperweaponMap::iterator mapIt = m_superweapons[playerIndex].find(powerName); if (mapIt != m_superweapons[playerIndex].end()) { @@ -2429,7 +2429,7 @@ void InGameUI::createMouseoverHint( const GameMessage *msg ) if (oldID != m_mousedOverDrawableID) { - //DEBUG_LOG(("Resetting tooltip delay\n")); + //DEBUG_LOG(("Resetting tooltip delay")); TheMouse->resetTooltipDelay(); } @@ -4882,7 +4882,7 @@ void InGameUI::DEBUG_addFloatingText(const AsciiString& text, const Coord3D * po m_floatingTextList.push_front( newFTD ); // add to the list - //DEBUG_LOG(("%s\n",text.str())); + //DEBUG_LOG(("%s",text.str())); } #endif diff --git a/Generals/Code/GameEngine/Source/GameClient/Input/Mouse.cpp b/Generals/Code/GameEngine/Source/GameClient/Input/Mouse.cpp index 02a8b7c1c2..a785db2d2c 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Input/Mouse.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Input/Mouse.cpp @@ -320,7 +320,7 @@ void Mouse::processMouseEvent( Int index ) m_currMouse.deltaPos.x = m_currMouse.pos.x - m_prevMouse.pos.x; m_currMouse.deltaPos.y = m_currMouse.pos.y - m_prevMouse.pos.y; -// DEBUG_LOG(("Mouse dx %d, dy %d, index %d, frame %d\n", m_currMouse.deltaPos.x, m_currMouse.deltaPos.y, index, m_inputFrame)); +// DEBUG_LOG(("Mouse dx %d, dy %d, index %d, frame %d", m_currMouse.deltaPos.x, m_currMouse.deltaPos.y, index, m_inputFrame)); // // check if mouse is still and flag tooltip // if( ((dx*dx) + (dy*dy)) < CURSOR_MOVE_TOL_SQ ) // { @@ -695,7 +695,7 @@ void Mouse::createStreamMessages( void ) } else { - //DEBUG_LOG(("%d %d %d %d\n", TheGameClient->getFrame(), delay, now, m_stillTime)); + //DEBUG_LOG(("%d %d %d %d", TheGameClient->getFrame(), delay, now, m_stillTime)); m_displayTooltip = FALSE; } @@ -829,7 +829,7 @@ void Mouse::createStreamMessages( void ) void Mouse::setCursorTooltip( UnicodeString tooltip, Int delay, const RGBColor *color, Real width ) { - //DEBUG_LOG(("%d Tooltip: %ls\n", TheGameClient->getFrame(), tooltip.str())); + //DEBUG_LOG(("%d Tooltip: %ls", TheGameClient->getFrame(), tooltip.str())); m_isTooltipEmpty = tooltip.isEmpty(); m_tooltipDelay = delay; @@ -847,7 +847,7 @@ void Mouse::setCursorTooltip( UnicodeString tooltip, Int delay, const RGBColor * { widthInPixels = TheDisplay->getWidth(); } - //DEBUG_LOG(("Setting tooltip width to %d pixels (%g%% of the normal tooltip width)\n", widthInPixels, width*100)); + //DEBUG_LOG(("Setting tooltip width to %d pixels (%g%% of the normal tooltip width)", widthInPixels, width*100)); m_tooltipDisplayString->setWordWrap( widthInPixels ); m_lastTooltipWidth = width; } @@ -855,7 +855,7 @@ void Mouse::setCursorTooltip( UnicodeString tooltip, Int delay, const RGBColor * if (forceRecalc || !m_isTooltipEmpty && tooltip.compare(m_tooltipDisplayString->getText())) { m_tooltipDisplayString->setText(tooltip); - //DEBUG_LOG(("Tooltip: %ls\n", tooltip.str())); + //DEBUG_LOG(("Tooltip: %ls", tooltip.str())); } if (color) { diff --git a/Generals/Code/GameEngine/Source/GameClient/LanguageFilter.cpp b/Generals/Code/GameEngine/Source/GameClient/LanguageFilter.cpp index 79f5769f7a..97cdd655d8 100644 --- a/Generals/Code/GameEngine/Source/GameClient/LanguageFilter.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/LanguageFilter.cpp @@ -64,7 +64,7 @@ void LanguageFilter::init() { } UnicodeString uniword(word); unHaxor(uniword); - //DEBUG_LOG(("Just read %ls from the bad word file. Entered as %ls\n", word, uniword.str())); + //DEBUG_LOG(("Just read %ls from the bad word file. Entered as %ls", word, uniword.str())); m_wordList[uniword] = true; } @@ -101,7 +101,7 @@ void LanguageFilter::filterLine(UnicodeString &line) unHaxor(token); LangMapIter iter = m_wordList.find(token); if (iter != m_wordList.end()) { - DEBUG_LOG(("Found word %ls in bad word list. Token was %ls\n", (*iter).first.str(), token.str())); + DEBUG_LOG(("Found word %ls in bad word list. Token was %ls", (*iter).first.str(), token.str())); for (Int i = 0; i < len; ++i) { *pos = L'*'; ++pos; diff --git a/Generals/Code/GameEngine/Source/GameClient/MapUtil.cpp b/Generals/Code/GameEngine/Source/GameClient/MapUtil.cpp index 681bc1dfe0..b83582cb90 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MapUtil.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MapUtil.cpp @@ -148,7 +148,7 @@ static Bool ParseObjectDataChunk(DataChunkInput &file, DataChunkInfo *info, void pThisOne = newInstance( MapObject )( loc, name, angle, flags, &d, TheThingFactory->findTemplate( name ) ); -//DEBUG_LOG(("obj %s owner %s\n",name.str(),d.getAsciiString(TheKey_originalOwner).str())); +//DEBUG_LOG(("obj %s owner %s",name.str(),d.getAsciiString(TheKey_originalOwner).str())); if (pThisOne->getProperties()->getType(TheKey_waypointID) == Dict::DICT_INT) { @@ -441,7 +441,7 @@ void MapCache::writeCacheINI( Bool userDir ) } else { - //DEBUG_LOG(("%s does not start %s\n", mapDir.str(), it->first.str())); + //DEBUG_LOG(("%s does not start %s", mapDir.str(), it->first.str())); } ++it; } @@ -583,12 +583,12 @@ Bool MapCache::loadUserMaps() std::set::const_iterator sit = m_allowedMaps.find(fname); if (m_allowedMaps.size() != 0 && sit == m_allowedMaps.end()) { - //DEBUG_LOG(("Skipping map: '%s'\n", fname.str())); + //DEBUG_LOG(("Skipping map: '%s'", fname.str())); skipMap = TRUE; } else { - //DEBUG_LOG(("Parsing map: '%s'\n", fname.str())); + //DEBUG_LOG(("Parsing map: '%s'", fname.str())); } } @@ -653,19 +653,19 @@ Bool MapCache::addMap( AsciiString dirName, AsciiString fname, FileInfo *fileInf if ((md.m_filesize == filesize) && (md.m_CRC != 0)) { -// DEBUG_LOG(("MapCache::addMap - found match for map %s\n", lowerFname.str())); +// DEBUG_LOG(("MapCache::addMap - found match for map %s", lowerFname.str())); return FALSE; // OK, it checks out. } - DEBUG_LOG(("%s didn't match file in MapCache\n", fname.str())); - DEBUG_LOG(("size: %d / %d\n", filesize, md.m_filesize)); - DEBUG_LOG(("time1: %d / %d\n", fileInfo->timestampHigh, md.m_timestamp.m_highTimeStamp)); - DEBUG_LOG(("time2: %d / %d\n", fileInfo->timestampLow, md.m_timestamp.m_lowTimeStamp)); -// DEBUG_LOG(("size: %d / %d\n", filesize, md.m_filesize)); -// DEBUG_LOG(("time1: %d / %d\n", timestamp.m_highTimeStamp, md.m_timestamp.m_highTimeStamp)); -// DEBUG_LOG(("time2: %d / %d\n", timestamp.m_lowTimeStamp, md.m_timestamp.m_lowTimeStamp)); + DEBUG_LOG(("%s didn't match file in MapCache", fname.str())); + DEBUG_LOG(("size: %d / %d", filesize, md.m_filesize)); + DEBUG_LOG(("time1: %d / %d", fileInfo->timestampHigh, md.m_timestamp.m_highTimeStamp)); + DEBUG_LOG(("time2: %d / %d", fileInfo->timestampLow, md.m_timestamp.m_lowTimeStamp)); +// DEBUG_LOG(("size: %d / %d", filesize, md.m_filesize)); +// DEBUG_LOG(("time1: %d / %d", timestamp.m_highTimeStamp, md.m_timestamp.m_highTimeStamp)); +// DEBUG_LOG(("time2: %d / %d", timestamp.m_lowTimeStamp, md.m_timestamp.m_lowTimeStamp)); } - DEBUG_LOG(("MapCache::addMap(): caching '%s' because '%s' was not found\n", fname.str(), lowerFname.str())); + DEBUG_LOG(("MapCache::addMap(): caching '%s' because '%s' was not found", fname.str(), lowerFname.str())); loadMap(fname); // Just load for querying the data, since we aren't playing this map. @@ -686,7 +686,7 @@ Bool MapCache::addMap( AsciiString dirName, AsciiString fname, FileInfo *fileInf AsciiString munkee = worldDict.getAsciiString(TheKey_mapName, &exists); if (!exists || munkee.isEmpty()) { - DEBUG_LOG(("Missing TheKey_mapName!\n")); + DEBUG_LOG(("Missing TheKey_mapName!")); AsciiString tempdisplayname; tempdisplayname = fname.reverseFind('\\') + 1; md.m_displayName.translate(tempdisplayname); @@ -713,7 +713,7 @@ Bool MapCache::addMap( AsciiString dirName, AsciiString fname, FileInfo *fileInf extension.format(L" (%d)", md.m_numPlayers); md.m_displayName.concat(extension); } - DEBUG_LOG(("Map name is now '%ls'\n", md.m_displayName.str())); + DEBUG_LOG(("Map name is now '%ls'", md.m_displayName.str())); TheGameText->reset(); } @@ -721,16 +721,16 @@ Bool MapCache::addMap( AsciiString dirName, AsciiString fname, FileInfo *fileInf (*this)[lowerFname] = md; - DEBUG_LOG((" filesize = %d bytes\n", md.m_filesize)); - DEBUG_LOG((" displayName = %ls\n", md.m_displayName.str())); - DEBUG_LOG((" CRC = %X\n", md.m_CRC)); - DEBUG_LOG((" timestamp = %d\n", md.m_timestamp)); - DEBUG_LOG((" isOfficial = %s\n", (md.m_isOfficial)?"yes":"no")); + DEBUG_LOG((" filesize = %d bytes", md.m_filesize)); + DEBUG_LOG((" displayName = %ls", md.m_displayName.str())); + DEBUG_LOG((" CRC = %X", md.m_CRC)); + DEBUG_LOG((" timestamp = %d", md.m_timestamp)); + DEBUG_LOG((" isOfficial = %s", (md.m_isOfficial)?"yes":"no")); - DEBUG_LOG((" isMultiplayer = %s\n", (md.m_isMultiplayer)?"yes":"no")); - DEBUG_LOG((" numPlayers = %d\n", md.m_numPlayers)); + DEBUG_LOG((" isMultiplayer = %s", (md.m_isMultiplayer)?"yes":"no")); + DEBUG_LOG((" numPlayers = %d", md.m_numPlayers)); - DEBUG_LOG((" extent = (%2.2f,%2.2f) -> (%2.2f,%2.2f)\n", + DEBUG_LOG((" extent = (%2.2f,%2.2f) -> (%2.2f,%2.2f)", md.m_extent.lo.x, md.m_extent.lo.y, md.m_extent.hi.x, md.m_extent.hi.y)); @@ -739,7 +739,7 @@ Bool MapCache::addMap( AsciiString dirName, AsciiString fname, FileInfo *fileInf while (itw != md.m_waypoints.end()) { pos = itw->second; - DEBUG_LOG((" waypoint %s: (%2.2f,%2.2f)\n", itw->first.str(), pos.x, pos.y)); + DEBUG_LOG((" waypoint %s: (%2.2f,%2.2f)", itw->first.str(), pos.x, pos.y)); ++itw; } @@ -820,7 +820,7 @@ typedef MapDisplayToFileNameList::iterator MapDisplayToFileNameListIter; while (numMapsListed < TheMapCache->size()) { - DEBUG_LOG(("Adding maps with %d players\n", curNumPlayersInMap)); + DEBUG_LOG(("Adding maps with %d players", curNumPlayersInMap)); it = TheMapCache->begin(); while (it != TheMapCache->end()) { const MapMetaData *md = &(it->second); @@ -828,7 +828,7 @@ typedef MapDisplayToFileNameList::iterator MapDisplayToFileNameListIter; if (md->m_numPlayers == curNumPlayersInMap) { tempCache.insert(it->second.m_displayName); filenameMap[it->second.m_displayName] = it->first; - DEBUG_LOG(("Adding map %s to temp cache.\n", it->first.str())); + DEBUG_LOG(("Adding map %s to temp cache.", it->first.str())); ++numMapsListed; } } @@ -846,7 +846,7 @@ typedef MapDisplayToFileNameList::iterator MapDisplayToFileNameListIter; /* if (it != TheMapCache->end()) { - DEBUG_LOG(("populateMapListbox(): looking at %s (displayName = %ls), mp = %d (== %d?) mapDir=%s (ok=%d)\n", + DEBUG_LOG(("populateMapListbox(): looking at %s (displayName = %ls), mp = %d (== %d?) mapDir=%s (ok=%d)", it->first.str(), it->second.m_displayName.str(), it->second.m_isMultiplayer, isMultiplayer, mapDir.str(), it->first.startsWith(mapDir.str()))); } @@ -1061,7 +1061,7 @@ Image *getMapPreviewImage( AsciiString mapName ) { if(!TheGlobalData) return NULL; - DEBUG_LOG(("%s Map Name \n", mapName.str())); + DEBUG_LOG(("%s Map Name ", mapName.str())); AsciiString tgaName = mapName; AsciiString name; AsciiString tempName; @@ -1213,7 +1213,7 @@ Bool parseMapPreviewChunk(DataChunkInput &file, DataChunkInfo *info, void *userD surface = (TextureClass *)mapPreviewImage->getRawTextureData()->Get_Surface_Level(); //texture->Get_Surface_Level(); - DEBUG_LOG(("BeginMapPreviewInfo\n")); + DEBUG_LOG(("BeginMapPreviewInfo")); UnsignedInt *buffer = new UnsignedInt[size.x * size.y]; Int x,y; for (y=0; yDrawPixel( x, y, file.readInt() ); buffer[y + x] = file.readInt(); - DEBUG_LOG(("x:%d, y:%d, %X\n", x, y, buffer[y + x])); + DEBUG_LOG(("x:%d, y:%d, %X", x, y, buffer[y + x])); } } mapPreviewImage->setRawTextureData(buffer); DEBUG_ASSERTCRASH(file.atEndOfChunk(), ("Unexpected data left over.")); - DEBUG_LOG(("EndMapPreviewInfo\n")); + DEBUG_LOG(("EndMapPreviewInfo")); REF_PTR_RELEASE(surface); return true; */ diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index 26d5f27eb7..bfcfa33b44 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -97,7 +97,7 @@ void countObjects(Object *obj, void *userData) if (!numObjects || !obj) return; - DEBUG_LOG(("Looking at obj %d (%s) - isEffectivelyDead()==%d, isDestroyed==%d, numObjects==%d\n", + DEBUG_LOG(("Looking at obj %d (%s) - isEffectivelyDead()==%d, isDestroyed==%d, numObjects==%d", obj->getID(), obj->getTemplate()->getName().str(), obj->isEffectivelyDead(), obj->isDestroyed(), *numObjects)); if (!obj->isEffectivelyDead() && !obj->isDestroyed() && !obj->isKindOf(KINDOF_INERT)) @@ -618,7 +618,7 @@ void pickAndPlayUnitVoiceResponse( const DrawableList *list, GameMessage::Type m break; default: - DEBUG_LOG(("Requested to add voice of message type %d, but don't know how - jkmcd\n", msgType)); + DEBUG_LOG(("Requested to add voice of message type %d, but don't know how - jkmcd", msgType)); break; } if( skip ) @@ -913,7 +913,7 @@ GameMessage::Type CommandTranslator::issueAttackCommand( Drawable *target, if( m_teamExists ) { - //DEBUG_LOG(("issuing team-attack cmd against %s\n",enemy->getTemplate()->getName().str())); + //DEBUG_LOG(("issuing team-attack cmd against %s",enemy->getTemplate()->getName().str())); // insert team attack command message into stream switch( command ) @@ -947,7 +947,7 @@ GameMessage::Type CommandTranslator::issueAttackCommand( Drawable *target, } else { - DEBUG_LOG(("issuing NON-team-attack cmd against %s\n",target->getTemplate()->getName().str())); + DEBUG_LOG(("issuing NON-team-attack cmd against %s",target->getTemplate()->getName().str())); // send single attack command for selected drawable const DrawableList *selected = TheInGameUI->getAllSelectedDrawables(); @@ -2946,7 +2946,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage Int count; const ThingTemplate *thing = TheThingFactory->findTemplate( ThePlayerList->getLocalPlayer()->getPlayerTemplate()->getBeaconTemplate() ); ThePlayerList->getLocalPlayer()->countObjectsByThingTemplate( 1, &thing, false, &count ); - DEBUG_LOG(("MSG_META_PLACE_BEACON - Player already has %d beacons active\n", count)); + DEBUG_LOG(("MSG_META_PLACE_BEACON - Player already has %d beacons active", count)); if (count < TheMultiplayerSettings->getMaxBeaconsPerPlayer()) { const CommandButton *commandButton = TheControlBar->findCommandButton( "Command_PlaceBeacon" ); @@ -3976,7 +3976,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage UnicodeString umsg; umsg.translate(msg); TheInGameUI->message(umsg); - DEBUG_LOG(("%ls\n", msg.str())); + DEBUG_LOG(("%ls", msg.str())); pObject->setGeometryInfo( newGeometry ); } diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp index 6070be9c66..d89dc85ae8 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp @@ -421,7 +421,7 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa ) ) { - //DEBUG_LOG(("Frame %d: MetaEventTranslator::translateGameMessage() Mods-only change: %s\n", TheGameLogic->getFrame(), findGameMessageNameByType(map->m_meta))); + //DEBUG_LOG(("Frame %d: MetaEventTranslator::translateGameMessage() Mods-only change: %s", TheGameLogic->getFrame(), findGameMessageNameByType(map->m_meta))); /*GameMessage *metaMsg =*/ TheMessageStream->appendMessage(map->m_meta); disp = DESTROY_MESSAGE; break; @@ -443,7 +443,7 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa { // if it's an autorepeat of a "known" key, don't generate the meta-event, // but DO eat the keystroke so no one else can mess with it - //DEBUG_LOG(("Frame %d: MetaEventTranslator::translateGameMessage() auto-repeat: %s\n", TheGameLogic->getFrame(), findGameMessageNameByType(map->m_meta))); + //DEBUG_LOG(("Frame %d: MetaEventTranslator::translateGameMessage() auto-repeat: %s", TheGameLogic->getFrame(), findGameMessageNameByType(map->m_meta))); } else { @@ -469,7 +469,7 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa /*GameMessage *metaMsg =*/ TheMessageStream->appendMessage(map->m_meta); - //DEBUG_LOG(("Frame %d: MetaEventTranslator::translateGameMessage() normal: %s\n", TheGameLogic->getFrame(), findGameMessageNameByType(map->m_meta))); + //DEBUG_LOG(("Frame %d: MetaEventTranslator::translateGameMessage() normal: %s", TheGameLogic->getFrame(), findGameMessageNameByType(map->m_meta))); } disp = DESTROY_MESSAGE; break; diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index cee8bf15c0..ea3fad05c5 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -984,7 +984,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa Int group = t - GameMessage::MSG_META_CREATE_TEAM0; if ( group >= 0 && group < 10 ) { - DEBUG_LOG(("META: create team %d\n",group)); + DEBUG_LOG(("META: create team %d",group)); // Assign selected items to a group GameMessage *newmsg = TheMessageStream->appendMessage((GameMessage::Type)(GameMessage::MSG_CREATE_TEAM0 + group)); Drawable *drawable = TheGameClient->getDrawableList(); @@ -1016,7 +1016,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa Int group = t - GameMessage::MSG_META_SELECT_TEAM0; if ( group >= 0 && group < 10 ) { - DEBUG_LOG(("META: select team %d\n",group)); + DEBUG_LOG(("META: select team %d",group)); UnsignedInt now = TheGameLogic->getFrame(); if ( m_lastGroupSelTime == 0 ) @@ -1027,7 +1027,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa // check for double-press to jump view if ( now - m_lastGroupSelTime < 20 && group == m_lastGroupSelGroup ) { - DEBUG_LOG(("META: DOUBLETAP select team %d\n",group)); + DEBUG_LOG(("META: DOUBLETAP select team %d",group)); Player *player = ThePlayerList->getLocalPlayer(); if (player) { @@ -1089,7 +1089,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa Int group = t - GameMessage::MSG_META_ADD_TEAM0; if ( group >= 0 && group < 10 ) { - DEBUG_LOG(("META: select team %d\n",group)); + DEBUG_LOG(("META: select team %d",group)); UnsignedInt now = TheGameLogic->getFrame(); if ( m_lastGroupSelTime == 0 ) @@ -1101,7 +1101,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa if ( now - m_lastGroupSelTime < 20 && group == m_lastGroupSelGroup ) { - DEBUG_LOG(("META: DOUBLETAP select team %d\n",group)); + DEBUG_LOG(("META: DOUBLETAP select team %d",group)); Player *player = ThePlayerList->getLocalPlayer(); if (player) { @@ -1161,7 +1161,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa Int group = t - GameMessage::MSG_META_VIEW_TEAM0; if ( group >= 1 && group <= 10 ) { - DEBUG_LOG(("META: view team %d\n",group)); + DEBUG_LOG(("META: view team %d",group)); Player *player = ThePlayerList->getLocalPlayer(); if (player) { diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp index 2be019d634..187232b5ed 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp @@ -453,7 +453,7 @@ AIGroupPtr AI::createGroup( void ) #endif // add it to the list -// DEBUG_LOG(("***AIGROUP %x is being added to m_groupList.\n", group )); +// DEBUG_LOG(("***AIGROUP %x is being added to m_groupList.", group )); #if RETAIL_COMPATIBLE_AIGROUP m_groupList.push_back( group ); #else @@ -477,7 +477,7 @@ void AI::destroyGroup( AIGroup *group ) DEBUG_ASSERTCRASH(group != NULL, ("A NULL group made its way into the AIGroup list.. jkmcd")); // remove it -// DEBUG_LOG(("***AIGROUP %x is being removed from m_groupList.\n", group )); +// DEBUG_LOG(("***AIGROUP %x is being removed from m_groupList.", group )); m_groupList.erase( i ); // destroy group @@ -729,7 +729,7 @@ Object *AI::findClosestEnemy( const Object *me, Real range, UnsignedInt qualifie } } if (bestEnemy) { - //DEBUG_LOG(("Find closest found %s, hunter %s, info %s\n", bestEnemy->getTemplate()->getName().str(), + //DEBUG_LOG(("Find closest found %s, hunter %s, info %s", bestEnemy->getTemplate()->getName().str(), // me->getTemplate()->getName().str(), info->getName().str())); } return bestEnemy; diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp index dd80bc79d9..1fdbb155cd 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp @@ -70,14 +70,14 @@ */ AIGroup::AIGroup( void ) { -// DEBUG_LOG(("***AIGROUP %x is being constructed.\n", this)); +// DEBUG_LOG(("***AIGROUP %x is being constructed.", this)); m_groundPath = NULL; m_speed = 0.0f; m_dirty = false; m_id = TheAI->getNextGroupID(); m_memberListSize = 0; m_memberList.clear(); - //DEBUG_LOG(( "AIGroup #%d created\n", m_id )); + //DEBUG_LOG(( "AIGroup #%d created", m_id )); } /** @@ -85,7 +85,7 @@ AIGroup::AIGroup( void ) */ AIGroup::~AIGroup() { -// DEBUG_LOG(("***AIGROUP %x is being destructed.\n", this)); +// DEBUG_LOG(("***AIGROUP %x is being destructed.", this)); // disassociate each member from the group #if RETAIL_COMPATIBLE_AIGROUP @@ -115,7 +115,7 @@ AIGroup::~AIGroup() deleteInstance(m_groundPath); m_groundPath = NULL; } - //DEBUG_LOG(( "AIGroup #%d destroyed\n", m_id )); + //DEBUG_LOG(( "AIGroup #%d destroyed", m_id )); } /** @@ -174,7 +174,7 @@ Bool AIGroup::isMember( Object *obj ) */ void AIGroup::add( Object *obj ) { -// DEBUG_LOG(("***AIGROUP %x is adding Object %x (%s).\n", this, obj, obj->getTemplate()->getName().str())); +// DEBUG_LOG(("***AIGROUP %x is adding Object %x (%s).", this, obj, obj->getTemplate()->getName().str())); DEBUG_ASSERTCRASH(obj != NULL, ("trying to add null obj to AIGroup")); if (obj == NULL) return; @@ -197,7 +197,7 @@ void AIGroup::add( Object *obj ) // add to group's list of objects m_memberList.push_back( obj ); ++m_memberListSize; -// DEBUG_LOG(("***AIGROUP %x has size %u now.\n", this, m_memberListSize)); +// DEBUG_LOG(("***AIGROUP %x has size %u now.", this, m_memberListSize)); obj->enterGroup( this ); @@ -215,7 +215,7 @@ Bool AIGroup::remove( Object *obj ) AIGroupPtr refThis = AIGroupPtr::Create_AddRef(this); #endif -// DEBUG_LOG(("***AIGROUP %x is removing Object %x (%s).\n", this, obj, obj->getTemplate()->getName().str())); +// DEBUG_LOG(("***AIGROUP %x is removing Object %x (%s).", this, obj, obj->getTemplate()->getName().str())); std::list::iterator i = std::find( m_memberList.begin(), m_memberList.end(), obj ); // make sure object is actually in the group @@ -225,7 +225,7 @@ Bool AIGroup::remove( Object *obj ) // remove it m_memberList.erase( i ); --m_memberListSize; -// DEBUG_LOG(("***AIGROUP %x has size %u now.\n", this, m_memberListSize)); +// DEBUG_LOG(("***AIGROUP %x has size %u now.", this, m_memberListSize)); // tell object to forget about group obj->leaveGroup(); diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIGuard.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIGuard.cpp index e4577ae26e..f233f63e16 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIGuard.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIGuard.cpp @@ -357,7 +357,7 @@ StateReturnType AIGuardInnerState::onEnter( void ) Object* nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()) ; if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AIGuardInnerState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AIGuardInnerState.")); return STATE_SUCCESS; } m_exitConditions.m_center = pos; @@ -451,7 +451,7 @@ StateReturnType AIGuardOuterState::onEnter( void ) Object* nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()) ; if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AIGuardInnerState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AIGuardInnerState.")); return STATE_SUCCESS; } Object *obj = getMachineOwner(); @@ -643,7 +643,7 @@ StateReturnType AIGuardIdleState::onEnter( void ) //-------------------------------------------------------------------------------------- StateReturnType AIGuardIdleState::update( void ) { - //DEBUG_LOG(("AIGuardIdleState frame %d: %08lx\n",TheGameLogic->getFrame(),getMachineOwner())); + //DEBUG_LOG(("AIGuardIdleState frame %d: %08lx",TheGameLogic->getFrame(),getMachineOwner())); UnsignedInt now = TheGameLogic->getFrame(); if (now < m_nextEnemyScanTime) @@ -753,7 +753,7 @@ StateReturnType AIGuardAttackAggressorState::onEnter( void ) Object *nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()); if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AIGuardAttackAggressorState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AIGuardAttackAggressorState.")); return STATE_SUCCESS; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index aa5c15c915..5ebc925168 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -124,7 +124,7 @@ void PathNode::setNextOptimized(PathNode *node) m_nextOptiDist2D = m_nextOptiDirNorm2D.length(); if (m_nextOptiDist2D == 0.0f) { - //DEBUG_LOG(("Warning - Path Seg length == 0, adjusting. john a.\n")); + //DEBUG_LOG(("Warning - Path Seg length == 0, adjusting. john a.")); m_nextOptiDist2D = 0.01f; } m_nextOptiDirNorm2D.x /= m_nextOptiDist2D; @@ -402,7 +402,7 @@ void Path::appendNode( const Coord3D *pos, PathfindLayerEnum layer ) { /* Check for duplicates. */ if (pos->x == m_pathTail->getPosition()->x && pos->y == m_pathTail->getPosition()->y) { - DEBUG_LOG(("Warning - Path Seg length == 0, ignoring. john a.\n")); + DEBUG_LOG(("Warning - Path Seg length == 0, ignoring. john a.")); return; } } @@ -499,7 +499,7 @@ void Path::optimize( const Object *obj, LocomotorSurfaceTypeMask acceptableSurfa for( ; node != anchor; node = node->getPrevious() ) { Bool isPassable = false; - //CRCDEBUG_LOG(("Path::optimize() calling isLinePassable()\n")); + //CRCDEBUG_LOG(("Path::optimize() calling isLinePassable()")); if (TheAI->pathfinder()->isLinePassable( obj, acceptableSurfaces, layer, *anchor->getPosition(), *node->getPosition(), blocked, false)) { @@ -616,7 +616,7 @@ void Path::optimizeGroundPath( Bool crusher, Int pathDiameter ) for( ; node != anchor; node = node->getPrevious() ) { Bool isPassable = false; - //CRCDEBUG_LOG(("Path::optimize() calling isLinePassable()\n")); + //CRCDEBUG_LOG(("Path::optimize() calling isLinePassable()")); if (TheAI->pathfinder()->isGroundPathPassable( crusher, *anchor->getPosition(), layer, *node->getPosition(), pathDiameter)) { @@ -738,7 +738,7 @@ void Path::computePointOnPath( ClosestPointOnPathInfo& out ) { - CRCDEBUG_LOG(("Path::computePointOnPath() for %s\n", DebugDescribeObject(obj).str())); + CRCDEBUG_LOG(("Path::computePointOnPath() for %s", DebugDescribeObject(obj).str())); out.layer = LAYER_GROUND; out.posOnPath.zero(); @@ -755,7 +755,7 @@ void Path::computePointOnPath( { out = m_cpopOut; m_cpopCountdown--; - CRCDEBUG_LOG(("Path::computePointOnPath() end because we're really close\n")); + CRCDEBUG_LOG(("Path::computePointOnPath() end because we're really close")); return; } m_cpopCountdown = MAX_CPOP; @@ -908,7 +908,7 @@ void Path::computePointOnPath( k = 1.0f; Bool gotPos = false; - CRCDEBUG_LOG(("Path::computePointOnPath() calling isLinePassable() 1\n")); + CRCDEBUG_LOG(("Path::computePointOnPath() calling isLinePassable() 1")); if (TheAI->pathfinder()->isLinePassable( obj, locomotorSet.getValidSurfaces(), out.layer, pos, *nextNodePos, false, true )) { @@ -942,7 +942,7 @@ void Path::computePointOnPath( tryPos.x = (nextNodePos->x + next->getPosition()->x) * 0.5; tryPos.y = (nextNodePos->y + next->getPosition()->y) * 0.5; tryPos.z = nextNodePos->z; - CRCDEBUG_LOG(("Path::computePointOnPath() calling isLinePassable() 2\n")); + CRCDEBUG_LOG(("Path::computePointOnPath() calling isLinePassable() 2")); if (veryClose || TheAI->pathfinder()->isLinePassable( obj, locomotorSet.getValidSurfaces(), closeNext->getLayer(), pos, tryPos, false, true )) { gotPos = true; @@ -960,7 +960,7 @@ void Path::computePointOnPath( out.posOnPath.y = closeNodePos->y + tryDist * segmentDirNorm.y; out.posOnPath.z = closeNodePos->z; - CRCDEBUG_LOG(("Path::computePointOnPath() calling isLinePassable() 3\n")); + CRCDEBUG_LOG(("Path::computePointOnPath() calling isLinePassable() 3")); if (TheAI->pathfinder()->isLinePassable( obj, locomotorSet.getValidSurfaces(), out.layer, pos, out.posOnPath, false, true )) { k = 0.5f; @@ -1011,7 +1011,7 @@ void Path::computePointOnPath( m_cpopIn = pos; m_cpopOut = out; m_cpopValid = true; - CRCDEBUG_LOG(("Path::computePointOnPath() end\n")); + CRCDEBUG_LOG(("Path::computePointOnPath() end")); } @@ -2202,7 +2202,7 @@ void PathfindZoneManager::allocateZones(void) while (m_zonesAllocated <= m_maxZone) { m_zonesAllocated *= 2; } - DEBUG_LOG(("Allocating zone tables of size %d\n", m_zonesAllocated)); + DEBUG_LOG(("Allocating zone tables of size %d", m_zonesAllocated)); // pool[]ify m_groundCliffZones = MSGNEW("PathfindZoneInfo") zoneStorageType[m_zonesAllocated]; m_groundWaterZones = MSGNEW("PathfindZoneInfo") zoneStorageType[m_zonesAllocated]; @@ -2321,13 +2321,13 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye } } - //DEBUG_LOG(("Collapsed zones %d\n", m_maxZone)); + //DEBUG_LOG(("Collapsed zones %d", m_maxZone)); } } Int totalZones = m_maxZone; if (totalZones>maxZones/2) { - DEBUG_LOG(("Max zones %d\n", m_maxZone)); + DEBUG_LOG(("Max zones %d", m_maxZone)); } // Collapse the zones into a 1,2,3... sequence, removing collapsed zones. @@ -2347,7 +2347,7 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye #if defined(DEBUG_LOGGING) QueryPerformanceCounter((LARGE_INTEGER *)&endTime64); timeToUpdate = ((double)(endTime64-startTime64) / (double)(freq64)); - DEBUG_LOG(("Time to calculate first %f\n", timeToUpdate)); + DEBUG_LOG(("Time to calculate first %f", timeToUpdate)); #endif #endif // Now map the zones in the map back into the collapsed zones. @@ -2406,7 +2406,7 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye #if defined(DEBUG_LOGGING) QueryPerformanceCounter((LARGE_INTEGER *)&endTime64); timeToUpdate = ((double)(endTime64-startTime64) / (double)(freq64)); - DEBUG_LOG(("Time to calculate second %f\n", timeToUpdate)); + DEBUG_LOG(("Time to calculate second %f", timeToUpdate)); #endif #endif @@ -2438,7 +2438,7 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye Int zone1 = map[i][j].getZone(); Int zone2 = map[i-1][j].getZone(); if (m_terrainZones[zone1] != m_terrainZones[zone2]) { - //DEBUG_LOG(("Matching terrain zone %d to %d.\n", zone1, zone2)); + //DEBUG_LOG(("Matching terrain zone %d to %d.", zone1, zone2)); } applyZone(map[i][j], map[i-1][j], m_groundRubbleZones, m_maxZone); } @@ -2463,7 +2463,7 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye Int zone1 = map[i][j].getZone(); Int zone2 = map[i][j-1].getZone(); if (m_terrainZones[zone1] != m_terrainZones[zone2]) { - //DEBUG_LOG(("Matching terrain zone %d to %d.\n", zone1, zone2)); + //DEBUG_LOG(("Matching terrain zone %d to %d.", zone1, zone2)); } applyZone(map[i][j], map[i][j-1], m_groundRubbleZones, m_maxZone); } @@ -2513,7 +2513,7 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye #if defined(DEBUG_LOGGING) QueryPerformanceCounter((LARGE_INTEGER *)&endTime64); timeToUpdate = ((double)(endTime64-startTime64) / (double)(freq64)); - DEBUG_LOG(("Time to calculate zones %f, cells %d\n", timeToUpdate, (globalBounds.hi.x-globalBounds.lo.x)*(globalBounds.hi.y-globalBounds.lo.y))); + DEBUG_LOG(("Time to calculate zones %f, cells %d", timeToUpdate, (globalBounds.hi.x-globalBounds.lo.x)*(globalBounds.hi.y-globalBounds.lo.y))); #endif #endif #if defined(RTS_DEBUG) @@ -3394,7 +3394,7 @@ Pathfinder::~Pathfinder( void ) void Pathfinder::reset( void ) { frameToShowObstacles = 0; - DEBUG_LOG(("Pathfind cell is %d bytes, PathfindCellInfo is %d bytes\n", sizeof(PathfindCell), sizeof(PathfindCellInfo))); + DEBUG_LOG(("Pathfind cell is %d bytes, PathfindCellInfo is %d bytes", sizeof(PathfindCell), sizeof(PathfindCellInfo))); if (m_blockOfMapCells) { delete []m_blockOfMapCells; @@ -3530,7 +3530,7 @@ PathfindLayerEnum Pathfinder::addBridge(Bridge *theBridge) if (m_layers[layer].init(theBridge, (PathfindLayerEnum)layer) ) { return (PathfindLayerEnum)layer; } - DEBUG_LOG(("WARNING: Bridge failed to init in pathfinder\n")); + DEBUG_LOG(("WARNING: Bridge failed to init in pathfinder")); return LAYER_GROUND; // failed to init, usually cause off of the map. jba. } layer++; @@ -3549,7 +3549,7 @@ void Pathfinder::updateLayer(Object *obj, PathfindLayerEnum layer) layer = LAYER_GROUND; } } - //DEBUG_LOG(("Object layer is %d\n", layer)); + //DEBUG_LOG(("Object layer is %d", layer)); obj->setLayer(layer); } @@ -4343,12 +4343,12 @@ void Pathfinder::cleanOpenAndClosedLists(void) { needInfo = true; } if (!needInfo) { - DEBUG_LOG(("leaked cell %d, %d\n", m_map[i][j].getXIndex(), m_map[i][j].getYIndex())); + DEBUG_LOG(("leaked cell %d, %d", m_map[i][j].getXIndex(), m_map[i][j].getYIndex())); m_map[i][j].releaseInfo(); } DEBUG_ASSERTCRASH((needInfo), ("Minor temporary memory leak - Extra cell allocated. Tell JBA steps if repeatable.")); }; - //DEBUG_LOG(("Pathfind used %d cells.\n", count)); + //DEBUG_LOG(("Pathfind used %d cells.", count)); #endif //#endif @@ -4679,7 +4679,7 @@ void Pathfinder::snapClosestGoalPosition(Object *obj, Coord3D *pos) } } } - //DEBUG_LOG(("Couldn't find goal.\n")); + //DEBUG_LOG(("Couldn't find goal.")); } /** @@ -4928,7 +4928,7 @@ Bool Pathfinder::adjustDestination(Object *obj, const LocomotorSet& locomotorSet // Didn't work, so just do simple adjust. return(adjustDestination(obj, locomotorSet, dest, NULL)); } - //DEBUG_LOG(("adjustDestination failed, dest (%f, %f), adj dest (%f,%f), %x %s\n", dest->x, dest->y, adjustDest.x, adjustDest.y, + //DEBUG_LOG(("adjustDestination failed, dest (%f, %f), adj dest (%f,%f), %x %s", dest->x, dest->y, adjustDest.x, adjustDest.y, //obj, obj->getTemplate()->getName().str())); return false; } @@ -5435,7 +5435,7 @@ void Pathfinder::processPathfindQueue(void) { DEBUG_LOG(("%d Pathfind queue: %d paths, %d cells", TheGameLogic->getFrame(), pathsFound, m_cumulativeCellsAllocated)); DEBUG_LOG(("Time %f (%f)", timeToUpdate, (::GetTickCount()-startTimeMS)/1000.0f)); - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } #endif #endif @@ -5580,7 +5580,7 @@ struct ExamineCellsStruct to->setParentCell(from) ; to->setTotalCost(to->getCostSoFar() + costRemaining) ; - //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d\n", + //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d", // to->getXIndex(), to->getYIndex(), // to->costSoFar(from), newCostSoFar, costRemaining, to->getCostSoFar() + costRemaining)); @@ -5842,7 +5842,7 @@ Int Pathfinder::examineNeighboringCells(PathfindCell *parentCell, PathfindCell * } newCell->setTotalCost(newCell->getCostSoFar() + costRemaining) ; - //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d\n", + //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d", // newCell->getXIndex(), newCell->getYIndex(), // newCell->costSoFar(parentCell), newCostSoFar, costRemaining, newCell->getCostSoFar() + costRemaining)); @@ -5908,12 +5908,12 @@ Path *Pathfinder::findPath( Object *obj, const LocomotorSet& locomotorSet, const Path *linkPath = findClosestPath(obj, locomotorSet, node->getPosition(), prior->getPosition(), false, 0, true); if (linkPath==NULL) { - DEBUG_LOG(("Couldn't find path - unexpected. jba.\n")); + DEBUG_LOG(("Couldn't find path - unexpected. jba.")); continue; } PathNode *linkNode = linkPath->getLastNode(); if (linkNode==NULL) { - DEBUG_LOG(("Empty path - unexpected. jba.\n")); + DEBUG_LOG(("Empty path - unexpected. jba.")); continue; } for (linkNode=linkNode->getPrevious(); linkNode; linkNode=linkNode->getPrevious()) { @@ -5942,9 +5942,9 @@ Path *Pathfinder::findPath( Object *obj, const LocomotorSet& locomotorSet, const Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSet, const Coord3D *from, const Coord3D *rawTo) { - //CRCDEBUG_LOG(("Pathfinder::findPath()\n")); + //CRCDEBUG_LOG(("Pathfinder::findPath()")); #ifdef INTENSE_DEBUG - DEBUG_LOG(("internal find path...\n")); + DEBUG_LOG(("internal find path...")); #endif #ifdef DEBUG_LOGGING @@ -5962,7 +5962,7 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe } if (rawTo->x == 0.0f && rawTo->y == 0.0f) { - DEBUG_LOG(("Attempting pathfind to 0,0, generally a bug.\n")); + DEBUG_LOG(("Attempting pathfind to 0,0, generally a bug.")); return NULL; } DEBUG_ASSERTCRASH(m_openList==NULL && m_closedList == NULL, ("Dangling lists.")); @@ -6053,10 +6053,10 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe zone1 = m_zoneManager.getEffectiveZone(locomotorSet.getValidSurfaces(), isCrusher, zone1); } - //DEBUG_LOG(("Zones %d to %d\n", zone1, zone2)); + //DEBUG_LOG(("Zones %d to %d", zone1, zone2)); if ( zone1 != zone2) { - //DEBUG_LOG(("Intense Debug Info - Pathfind Zone screen failed-cannot reach desired location.\n")); + //DEBUG_LOG(("Intense Debug Info - Pathfind Zone screen failed-cannot reach desired location.")); goalCell->releaseInfo(); parentCell->releaseInfo(); return NULL; @@ -6101,15 +6101,15 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe // success - found a path to the goal Bool show = TheGlobalData->m_debugAI==AI_DEBUG_PATHS; #ifdef INTENSE_DEBUG - DEBUG_LOG(("internal find path SUCCESS...\n")); + DEBUG_LOG(("internal find path SUCCESS...")); Int count = 0; if (cellCount>1000 && obj) { show = true; - DEBUG_LOG(("cells %d obj %s %x from (%f,%f) to(%f, %f)\n", count, obj->getTemplate()->getName().str(), obj, from->x, from->y, to->x, to->y)); + DEBUG_LOG(("cells %d obj %s %x from (%f,%f) to(%f, %f)", count, obj->getTemplate()->getName().str(), obj, from->x, from->y, to->x, to->y)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif TheScriptEngine->AppendDebugMessage("Big path", false); @@ -6139,7 +6139,7 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe // failure - goal cannot be reached #if defined(RTS_DEBUG) #ifdef INTENSE_DEBUG - DEBUG_LOG(("internal find path FAILURE...\n")); + DEBUG_LOG(("internal find path FAILURE...")); #endif if (TheGlobalData->m_debugAI == AI_DEBUG_PATHS) { @@ -6180,7 +6180,7 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("state %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("state %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif } @@ -6193,8 +6193,8 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe valid = validMovementPosition( isCrusher, obj->getLayer(), locomotorSet, to ) ; DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("Pathfind failed from (%f,%f) to (%f,%f), OV %d\n", from->x, from->y, to->x, to->y, valid)); - DEBUG_LOG(("Unit '%s', time %f, cells %d\n", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f,cellCount)); + DEBUG_LOG(("Pathfind failed from (%f,%f) to (%f,%f), OV %d", from->x, from->y, to->x, to->y, valid)); + DEBUG_LOG(("Unit '%s', time %f, cells %d", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f,cellCount)); } #endif @@ -6386,7 +6386,7 @@ struct MADStruct return 0; // Only move allies. } if (otherObj && otherObj->getAI() && !otherObj->getAI()->isMoving()) { - //DEBUG_LOG(("Moving ally\n")); + //DEBUG_LOG(("Moving ally")); otherObj->getAI()->aiMoveAwayFromUnit(d->obj, CMD_FROM_AI); } } @@ -6466,7 +6466,7 @@ struct GroundCellsStruct Path *Pathfinder::findGroundPath( const Coord3D *from, const Coord3D *rawTo, Int pathDiameter, Bool crusher) { - //CRCDEBUG_LOG(("Pathfinder::findGroundPath()\n")); + //CRCDEBUG_LOG(("Pathfinder::findGroundPath()")); #ifdef DEBUG_LOGGING Int startTimeMS = ::GetTickCount(); #endif @@ -6486,7 +6486,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, } if (rawTo->x == 0.0f && rawTo->y == 0.0f) { - DEBUG_LOG(("Attempting pathfind to 0,0, generally a bug.\n")); + DEBUG_LOG(("Attempting pathfind to 0,0, generally a bug.")); return NULL; } DEBUG_ASSERTCRASH(m_openList==NULL && m_closedList == NULL, ("Dangling lists.")); @@ -6566,7 +6566,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, zone1 = m_zoneManager.getEffectiveZone(LOCOMOTORSURFACE_GROUND, false, parentCell->getZone()); zone2 = m_zoneManager.getEffectiveZone(LOCOMOTORSURFACE_GROUND, false, goalCell->getZone()); - //DEBUG_LOG(("Zones %d to %d\n", zone1, zone2)); + //DEBUG_LOG(("Zones %d to %d", zone1, zone2)); if ( zone1 != zone2) { goalCell->releaseInfo(); @@ -6602,7 +6602,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, // success - found a path to the goal #ifdef INTENSE_DEBUG DEBUG_LOG((" time %d msec %d cells", (::GetTickCount()-startTimeMS), cellCount)); - DEBUG_LOG((" SUCCESS\n")); + DEBUG_LOG((" SUCCESS")); #endif #if defined(RTS_DEBUG) Bool show = TheGlobalData->m_debugAI==AI_DEBUG_GROUND_PATHS; @@ -6748,13 +6748,13 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, } //DEBUG_LOG(("CELL(%d,%d)L%d CD%d CSF %d, CR%d // ",newCell->getXIndex(), newCell->getYIndex(), // newCell->getLayer(), clearDiameter, newCostSoFar, costRemaining)); - //if ((cellCount&7)==0) DEBUG_LOG(("\n")); + //if ((cellCount&7)==0) DEBUG_LOG(("")); newCell->setCostSoFar(newCostSoFar); // keep track of path we're building - point back to cell we moved here from newCell->setParentCell(parentCell) ; newCell->setTotalCost(newCell->getCostSoFar() + costRemaining) ; - //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d\n", + //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d", // newCell->getXIndex(), newCell->getYIndex(), // newCell->costSoFar(parentCell), newCostSoFar, costRemaining, newCell->getCostSoFar() + costRemaining)); @@ -6774,7 +6774,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, } // failure - goal cannot be reached #ifdef INTENSE_DEBUG - DEBUG_LOG((" FAILURE\n")); + DEBUG_LOG((" FAILURE")); #endif #if defined(RTS_DEBUG) if (TheGlobalData->m_debugAI) @@ -6811,8 +6811,8 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, #endif DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("FindGroundPath failed from (%f,%f) to (%f,%f)\n", from->x, from->y, to->x, to->y)); - DEBUG_LOG(("time %f\n", (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("FindGroundPath failed from (%f,%f) to (%f,%f)", from->x, from->y, to->x, to->y)); + DEBUG_LOG(("time %f", (::GetTickCount()-startTimeMS)/1000.0f)); #ifdef DUMP_PERF_STATS TheGameLogic->incrementOverallFailedPathfinds(); @@ -6928,13 +6928,13 @@ Path *Pathfinder::findClosestHierarchicalPath( Bool isHuman, const LocomotorSet& Path *Pathfinder::internal_findHierarchicalPath( Bool isHuman, const LocomotorSurfaceTypeMask locomotorSurface, const Coord3D *from, const Coord3D *rawTo, Bool crusher, Bool closestOK) { - //CRCDEBUG_LOG(("Pathfinder::findGroundPath()\n")); + //CRCDEBUG_LOG(("Pathfinder::findGroundPath()")); #ifdef DEBUG_LOGGING Int startTimeMS = ::GetTickCount(); #endif if (rawTo->x == 0.0f && rawTo->y == 0.0f) { - DEBUG_LOG(("Attempting pathfind to 0,0, generally a bug.\n")); + DEBUG_LOG(("Attempting pathfind to 0,0, generally a bug.")); return NULL; } DEBUG_ASSERTCRASH(m_openList==NULL && m_closedList == NULL, ("Dangling lists.")); @@ -7427,8 +7427,8 @@ Path *Pathfinder::internal_findHierarchicalPath( Bool isHuman, const LocomotorSu #endif DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("FindHierarchicalPath failed from (%f,%f) to (%f,%f)\n", from->x, from->y, to->x, to->y)); - DEBUG_LOG(("time %f\n", (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("FindHierarchicalPath failed from (%f,%f) to (%f,%f)", from->x, from->y, to->x, to->y)); + DEBUG_LOG(("time %f", (::GetTickCount()-startTimeMS)/1000.0f)); #ifdef DUMP_PERF_STATS TheGameLogic->incrementOverallFailedPathfinds(); @@ -7587,7 +7587,7 @@ void Pathfinder::clip( Coord3D *from, Coord3D *to ) Bool Pathfinder::pathDestination( Object *obj, const LocomotorSet& locomotorSet, Coord3D *dest, PathfindLayerEnum layer, const Coord3D *groupDest) { - //CRCDEBUG_LOG(("Pathfinder::pathDestination()\n")); + //CRCDEBUG_LOG(("Pathfinder::pathDestination()")); if (m_isMapReady == false) return NULL; if (!obj) return false; @@ -7782,7 +7782,7 @@ Bool Pathfinder::pathDestination( Object *obj, const LocomotorSet& locomotorSet newCell->setTotalCost(newCell->getCostSoFar() + costRemaining) ; - //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d\n", + //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d", // newCell->getXIndex(), newCell->getYIndex(), // newCell->costSoFar(parentCell), newCostSoFar, costRemaining, newCell->getCostSoFar() + costRemaining)); @@ -7865,7 +7865,7 @@ void Pathfinder::tightenPath(Object *obj, const LocomotorSet& locomotorSet, Coor Int Pathfinder::checkPathCost(Object *obj, const LocomotorSet& locomotorSet, const Coord3D *from, const Coord3D *rawTo) { - //CRCDEBUG_LOG(("Pathfinder::checkPathCost()\n")); + //CRCDEBUG_LOG(("Pathfinder::checkPathCost()")); if (m_isMapReady == false) return NULL; enum {MAX_COST = 0x7fff0000}; if (!obj) return MAX_COST; @@ -8035,7 +8035,7 @@ Int Pathfinder::checkPathCost(Object *obj, const LocomotorSet& locomotorSet, con newCell->setTotalCost(newCell->getCostSoFar() + costRemaining) ; - //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d\n", + //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d", // newCell->getXIndex(), newCell->getYIndex(), // newCell->costSoFar(parentCell), newCostSoFar, costRemaining, newCell->getCostSoFar() + costRemaining)); @@ -8070,7 +8070,7 @@ Int Pathfinder::checkPathCost(Object *obj, const LocomotorSet& locomotorSet, con Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet, const Coord3D *from, Coord3D *rawTo, Bool blocked, Real pathCostMultiplier, Bool moveAllies) { - //CRCDEBUG_LOG(("Pathfinder::findClosestPath()\n")); + //CRCDEBUG_LOG(("Pathfinder::findClosestPath()")); #ifdef DEBUG_LOGGING Int startTimeMS = ::GetTickCount(); #endif @@ -8240,11 +8240,11 @@ Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet } if (count>1000) { show = true; - DEBUG_LOG(("FCP - cells %d obj %s %x\n", count, obj->getTemplate()->getName().str(), obj)); + DEBUG_LOG(("FCP - cells %d obj %s %x", count, obj->getTemplate()->getName().str(), obj)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif TheScriptEngine->AppendDebugMessage("Big path FCP", false); @@ -8313,17 +8313,17 @@ Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet #ifdef INTENSE_DEBUG if (count>5000) { show = true; - DEBUG_LOG(("FCP CC cells %d obj %s %x\n", count, obj->getTemplate()->getName().str(), obj)); + DEBUG_LOG(("FCP CC cells %d obj %s %x", count, obj->getTemplate()->getName().str(), obj)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif DEBUG_LOG(("%d ", TheGameLogic->getFrame())); DEBUG_LOG(("Pathfind(findClosestPath) chugged from (%f,%f) to (%f,%f), --", from->x, from->y, to->x, to->y)); - DEBUG_LOG(("Unit '%s', time %f\n", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #ifdef INTENSE_DEBUG TheScriptEngine->AppendDebugMessage("Big path FCP CC", false); #endif @@ -8349,7 +8349,7 @@ Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet DEBUG_LOG(("%d ", TheGameLogic->getFrame())); DEBUG_LOG(("Pathfind(findClosestPath) failed from (%f,%f) to (%f,%f), original valid %d --", from->x, from->y, to->x, to->y, valid)); - DEBUG_LOG(("Unit '%s', time %f\n", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #endif #if defined(RTS_DEBUG) if (TheGlobalData->m_debugAI) @@ -8792,23 +8792,23 @@ Bool Pathfinder::isViewBlockedByObstacle(const Object* obj, const Object* objOth //----------------------------------------------------------------------------- Bool Pathfinder::isAttackViewBlockedByObstacle(const Object* attacker, const Coord3D& attackerPos, const Object* victim, const Coord3D& victimPos) { - //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() - attackerPos is (%g,%g,%g) (%X,%X,%X)\n", + //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() - attackerPos is (%g,%g,%g) (%X,%X,%X)", // attackerPos.x, attackerPos.y, attackerPos.z, // AS_INT(attackerPos.x),AS_INT(attackerPos.y),AS_INT(attackerPos.z))); - //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() - victimPos is (%g,%g,%g) (%X,%X,%X)\n", + //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() - victimPos is (%g,%g,%g) (%X,%X,%X)", // victimPos.x, victimPos.y, victimPos.z, // AS_INT(victimPos.x),AS_INT(victimPos.y),AS_INT(victimPos.z))); // Global switch to turn this off in case it doesn't work. if (!TheAI->getAiData()->m_attackUsesLineOfSight) { - //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 1\n")); + //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 1")); return false; } // If the attacker doesn't need line of sight, isn't blocked. if (!attacker->isKindOf(KINDOF_ATTACK_NEEDS_LINE_OF_SIGHT)) { - //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 2\n")); + //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 2")); return false; } @@ -8830,7 +8830,7 @@ Bool Pathfinder::isAttackViewBlockedByObstacle(const Object* attacker, const Coo if (viewBlocked) { - //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 3\n")); + //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 3")); return true; } } @@ -8858,7 +8858,7 @@ Bool Pathfinder::isAttackViewBlockedByObstacle(const Object* attacker, const Coo } Int ret = iterateCellsAlongLine(attackerPos, victimPos, layer, attackBlockedByObstacleCallback, &info); - //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 4\n")); + //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 4")); return ret != 0; } @@ -9057,7 +9057,7 @@ Bool Pathfinder::isLinePassable( const Object *obj, LocomotorSurfaceTypeMask acc Bool allowPinched) { LinePassableStruct info; - //CRCDEBUG_LOG(("Pathfinder::isLinePassable(): %d %d %d \n", m_ignoreObstacleID, m_isMapReady, m_isTunneling)); + //CRCDEBUG_LOG(("Pathfinder::isLinePassable(): %d %d %d ", m_ignoreObstacleID, m_isMapReady, m_isTunneling)); info.obj = obj; info.acceptableSurfaces = acceptableSurfaces; @@ -9147,7 +9147,7 @@ void Pathfinder::updateGoal( Object *obj, const Coord3D *newGoalPos, PathfindLay PathfindLayerEnum originalLayer = obj->getDestinationLayer(); - //DEBUG_LOG(("Object Goal layer is %d\n", layer)); + //DEBUG_LOG(("Object Goal layer is %d", layer)); Bool layerChanged = originalLayer != layer; Bool doGround=false; @@ -9196,7 +9196,7 @@ void Pathfinder::updateGoal( Object *obj, const Coord3D *newGoalPos, PathfindLay if (warn && cell->getGoalUnit()!=INVALID_ID && cell->getGoalUnit() != obj->getID()) { warn = false; // jba intense debug - //DEBUG_LOG(, ("Units got stuck close to each other. jba\n")); + //DEBUG_LOG(, ("Units got stuck close to each other. jba")); } cellNdx.x = i; cellNdx.y = j; @@ -9209,7 +9209,7 @@ void Pathfinder::updateGoal( Object *obj, const Coord3D *newGoalPos, PathfindLay if (warn && cell->getGoalUnit()!=INVALID_ID && cell->getGoalUnit() != obj->getID()) { warn = false; // jba intense debug - //DEBUG_LOG(, ("Units got stuck close to each other. jba\n")); + //DEBUG_LOG(, ("Units got stuck close to each other. jba")); } cellNdx.x = i; cellNdx.y = j; @@ -9403,7 +9403,7 @@ void Pathfinder::updatePos( Object *obj, const Coord3D *newPos) ai->setCurPathfindCell(newCell); Int i,j; ICoord2D cellNdx; - //DEBUG_LOG(("Updating unit pos at cell %d, %d\n", newCell.x, newCell.y)); + //DEBUG_LOG(("Updating unit pos at cell %d, %d", newCell.x, newCell.y)); if (curCell.x>=0 && curCell.y>=0) { for (i=curCell.x-radius; i=0 && curCell.y>=0) { for (i=curCell.x-radius; igetBlockedByAlly()) continue; } if (otherObj && otherObj->getAI() && !otherObj->getAI()->isMoving()) { - //DEBUG_LOG(("Moving ally\n")); + //DEBUG_LOG(("Moving ally")); otherObj->getAI()->aiMoveAwayFromUnit(obj, CMD_FROM_AI); } } @@ -9743,7 +9743,7 @@ Path *Pathfinder::getMoveAwayFromPath(Object* obj, Object *otherObj, DEBUG_LOG(("%d ", TheGameLogic->getFrame())); DEBUG_LOG(("getMoveAwayFromPath pathfind failed -- ")); - DEBUG_LOG(("Unit '%s', time %f\n", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); m_isTunneling = false; cleanOpenAndClosedLists(); @@ -9757,7 +9757,7 @@ Path *Pathfinder::getMoveAwayFromPath(Object* obj, Object *otherObj, Path *Pathfinder::patchPath( const Object *obj, const LocomotorSet& locomotorSet, Path *originalPath, Bool blocked ) { - //CRCDEBUG_LOG(("Pathfinder::patchPath()\n")); + //CRCDEBUG_LOG(("Pathfinder::patchPath()")); #ifdef DEBUG_LOGGING Int startTimeMS = ::GetTickCount(); #endif @@ -9922,7 +9922,7 @@ Path *Pathfinder::patchPath( const Object *obj, const LocomotorSet& locomotorSet DEBUG_LOG(("%d ", TheGameLogic->getFrame())); DEBUG_LOG(("patchPath Pathfind failed -- ")); - DEBUG_LOG(("Unit '%s', time %f\n", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #if defined(RTS_DEBUG) if (TheGlobalData->m_debugAI) { @@ -9945,30 +9945,30 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot const Object *victim, const Coord3D* victimPos, const Weapon *weapon ) { /* - CRCDEBUG_LOG(("Pathfinder::findAttackPath() for object %d (%s)\n", obj->getID(), obj->getTemplate()->getName().str())); + CRCDEBUG_LOG(("Pathfinder::findAttackPath() for object %d (%s)", obj->getID(), obj->getTemplate()->getName().str())); XferCRC xferCRC; xferCRC.open("lightCRC"); xferCRC.xferSnapshot((Object *)obj); xferCRC.close(); - CRCDEBUG_LOG(("obj CRC is %X\n", xferCRC.getCRC())); + CRCDEBUG_LOG(("obj CRC is %X", xferCRC.getCRC())); if (from) { - CRCDEBUG_LOG(("from: (%g,%g,%g) (%X,%X,%X)\n", + CRCDEBUG_LOG(("from: (%g,%g,%g) (%X,%X,%X)", from->x, from->y, from->z, AS_INT(from->x), AS_INT(from->y), AS_INT(from->z))); } if (victim) { - CRCDEBUG_LOG(("victim is %d (%s)\n", victim->getID(), victim->getTemplate()->getName().str())); + CRCDEBUG_LOG(("victim is %d (%s)", victim->getID(), victim->getTemplate()->getName().str())); XferCRC xferCRC; xferCRC.open("lightCRC"); xferCRC.xferSnapshot((Object *)victim); xferCRC.close(); - CRCDEBUG_LOG(("victim CRC is %X\n", xferCRC.getCRC())); + CRCDEBUG_LOG(("victim CRC is %X", xferCRC.getCRC())); } if (victimPos) { - CRCDEBUG_LOG(("from: (%g,%g,%g) (%X,%X,%X)\n", + CRCDEBUG_LOG(("from: (%g,%g,%g) (%X,%X,%X)", victimPos->x, victimPos->y, victimPos->z, AS_INT(victimPos->x), AS_INT(victimPos->y), AS_INT(victimPos->z))); } @@ -10152,11 +10152,11 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot } if (count>1000) { show = true; - DEBUG_LOG(("FAP cells %d obj %s %x\n", count, obj->getTemplate()->getName().str(), obj)); + DEBUG_LOG(("FAP cells %d obj %s %x", count, obj->getTemplate()->getName().str(), obj)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif TheScriptEngine->AppendDebugMessage("Big Attack path", false); @@ -10165,7 +10165,7 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot if (show) debugShowSearch(true); #if defined(RTS_DEBUG) - //DEBUG_LOG(("Attack path took %d cells, %f sec\n", cellCount, (::GetTickCount()-startTimeMS)/1000.0f)); + //DEBUG_LOG(("Attack path took %d cells, %f sec", cellCount, (::GetTickCount()-startTimeMS)/1000.0f)); #endif // construct and return path Path *path = buildActualPath( obj, locomotorSet.getValidSurfaces(), obj->getPosition(), parentCell, centerInCell, false); @@ -10203,11 +10203,11 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot } #ifdef INTENSE_DEBUG - DEBUG_LOG(("obj %s %x\n", obj->getTemplate()->getName().str(), obj)); + DEBUG_LOG(("obj %s %x", obj->getTemplate()->getName().str(), obj)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif debugShowSearch(true); @@ -10222,8 +10222,8 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot } #if defined(RTS_DEBUG) DEBUG_LOG(("%d (%d cells)", TheGameLogic->getFrame(), cellCount)); - DEBUG_LOG(("Attack Pathfind failed from (%f,%f) to (%f,%f) -- \n", from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); - DEBUG_LOG(("Unit '%s', attacking '%s' time %f\n", obj->getTemplate()->getName().str(), victim->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("Attack Pathfind failed from (%f,%f) to (%f,%f) -- ", from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); + DEBUG_LOG(("Unit '%s', attacking '%s' time %f", obj->getTemplate()->getName().str(), victim->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #endif #endif #ifdef DUMP_PERF_STATS @@ -10241,7 +10241,7 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotorSet, const Coord3D *from, const Coord3D* repulsorPos1, const Coord3D* repulsorPos2, Real repulsorRadius) { - //CRCDEBUG_LOG(("Pathfinder::findSafePath()\n")); + //CRCDEBUG_LOG(("Pathfinder::findSafePath()")); if (m_isMapReady == false) return NULL; // Should always be ok. #if defined(RTS_DEBUG) // Int startTimeMS = ::GetTickCount(); @@ -10320,7 +10320,7 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor farthestDistanceSqr = distSqr; if (cellCount > MAX_CELLS) { #ifdef INTENSE_DEBUG - DEBUG_LOG(("Took intermediate path, dist %f, goal dist %f\n", sqrt(farthestDistanceSqr), repulsorRadius)); + DEBUG_LOG(("Took intermediate path, dist %f, goal dist %f", sqrt(farthestDistanceSqr), repulsorRadius)); #endif ok = true; // Already a big search, just take this one. } @@ -10338,11 +10338,11 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor } if (count>2000) { show = true; - DEBUG_LOG(("cells %d obj %s %x\n", count, obj->getTemplate()->getName().str(), obj)); + DEBUG_LOG(("cells %d obj %s %x", count, obj->getTemplate()->getName().str(), obj)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif TheScriptEngine->AppendDebugMessage("Big Safe path", false); @@ -10351,7 +10351,7 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor if (show) debugShowSearch(true); #if defined(RTS_DEBUG) - //DEBUG_LOG(("Attack path took %d cells, %f sec\n", cellCount, (::GetTickCount()-startTimeMS)/1000.0f)); + //DEBUG_LOG(("Attack path took %d cells, %f sec", cellCount, (::GetTickCount()-startTimeMS)/1000.0f)); #endif // construct and return path Path *path = buildActualPath( obj, locomotorSet.getValidSurfaces(), obj->getPosition(), parentCell, centerInCell, false); @@ -10371,11 +10371,11 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor } #ifdef INTENSE_DEBUG - DEBUG_LOG(("obj %s %x count %d\n", obj->getTemplate()->getName().str(), obj, cellCount)); + DEBUG_LOG(("obj %s %x count %d", obj->getTemplate()->getName().str(), obj, cellCount)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif TheScriptEngine->AppendDebugMessage("Overflowed Safe path", false); @@ -10383,8 +10383,8 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor #if 0 #if defined(RTS_DEBUG) DEBUG_LOG(("%d (%d cells)", TheGameLogic->getFrame(), cellCount)); - DEBUG_LOG(("Attack Pathfind failed from (%f,%f) to (%f,%f) -- \n", from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); - DEBUG_LOG(("Unit '%s', attacking '%s' time %f\n", obj->getTemplate()->getName().str(), victim->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("Attack Pathfind failed from (%f,%f) to (%f,%f) -- ", from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); + DEBUG_LOG(("Unit '%s', attacking '%s' time %f", obj->getTemplate()->getName().str(), victim->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #endif #endif #ifdef DUMP_PERF_STATS @@ -10398,42 +10398,42 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor //----------------------------------------------------------------------------- void Pathfinder::crc( Xfer *xfer ) { - CRCDEBUG_LOG(("Pathfinder::crc() on frame %d\n", TheGameLogic->getFrame())); - CRCDEBUG_LOG(("beginning CRC: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("Pathfinder::crc() on frame %d", TheGameLogic->getFrame())); + CRCDEBUG_LOG(("beginning CRC: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferUser( &m_extent, sizeof(IRegion2D) ); - CRCDEBUG_LOG(("m_extent: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_extent: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferBool( &m_isMapReady ); - CRCDEBUG_LOG(("m_isMapReady: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_isMapReady: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferBool( &m_isTunneling ); - CRCDEBUG_LOG(("m_isTunneling: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_isTunneling: %8.8X", ((XferCRC *)xfer)->getCRC())); Int obsolete1 = 0; xfer->xferInt( &obsolete1 ); xfer->xferUser(&m_ignoreObstacleID, sizeof(ObjectID)); - CRCDEBUG_LOG(("m_ignoreObstacleID: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_ignoreObstacleID: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferUser(m_queuedPathfindRequests, sizeof(ObjectID)*PATHFIND_QUEUE_LEN); - CRCDEBUG_LOG(("m_queuedPathfindRequests: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_queuedPathfindRequests: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferInt(&m_queuePRHead); - CRCDEBUG_LOG(("m_queuePRHead: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_queuePRHead: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferInt(&m_queuePRTail); - CRCDEBUG_LOG(("m_queuePRTail: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_queuePRTail: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferInt(&m_numWallPieces); - CRCDEBUG_LOG(("m_numWallPieces: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_numWallPieces: %8.8X", ((XferCRC *)xfer)->getCRC())); for (Int i=0; ixferObjectID(&m_wallPieces[MAX_WALL_PIECES]); } - CRCDEBUG_LOG(("m_wallPieces: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_wallPieces: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferReal(&m_wallHeight); - CRCDEBUG_LOG(("m_wallHeight: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_wallHeight: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferInt(&m_cumulativeCellsAllocated); - CRCDEBUG_LOG(("m_cumulativeCellsAllocated: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_cumulativeCellsAllocated: %8.8X", ((XferCRC *)xfer)->getCRC())); } // end crc diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp index 24924be21f..5e1699e859 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp @@ -160,7 +160,7 @@ void AIPlayer::onStructureProduced( Object *factory, Object *bldg ) if( rhbi ) { ObjectID spawnedID = rhbi->getReconstructedBuildingID(); if (bldg->getID() == spawnedID) { - DEBUG_LOG(("AI got rebuilt %s\n", bldgPlan->getName().str())); + DEBUG_LOG(("AI got rebuilt %s", bldgPlan->getName().str())); info->setObjectID(bldg->getID()); return; } @@ -171,7 +171,7 @@ void AIPlayer::onStructureProduced( Object *factory, Object *bldg ) } if (TheGameLogic->getFrame()>0) { - DEBUG_LOG(("***AI PLAYER-Structure not found in production queue.\n")); + DEBUG_LOG(("***AI PLAYER-Structure not found in production queue.")); } } @@ -331,7 +331,7 @@ void AIPlayer::queueSupplyTruck( void ) } } } - //DEBUG_LOG(("Expected %d harvesters, found %d, need %d\n", info->getDesiredGatherers(), + //DEBUG_LOG(("Expected %d harvesters, found %d, need %d", info->getDesiredGatherers(), // curGatherers, info->getDesiredGatherers()-curGatherers) ); info->setCurrentGatherers(curGatherers); } @@ -363,7 +363,7 @@ void AIPlayer::queueSupplyTruck( void ) // The supply truck ai issues dock commands, and they become confused. // Thus, player. jba. ;( obj->getAI()->aiDock(center, CMD_FROM_PLAYER); - DEBUG_LOG(("Re-attaching supply truck to supply center.\n")); + DEBUG_LOG(("Re-attaching supply truck to supply center.")); return; } } @@ -706,7 +706,7 @@ void AIPlayer::processBaseBuilding( void ) if (name.isEmpty()) continue; const ThingTemplate *bldgPlan = TheThingFactory->findTemplate( name ); if (!bldgPlan) { - DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.\n", name.str())); + DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.", name.str())); continue; } // check for hole. @@ -727,7 +727,7 @@ void AIPlayer::processBaseBuilding( void ) if( rhbi ) { ObjectID spawnerID = rhbi->getSpawnerID(); if (priorID == spawnerID) { - DEBUG_LOG(("AI Found hole to rebuild %s\n", bldgPlan->getName().str())); + DEBUG_LOG(("AI Found hole to rebuild %s", bldgPlan->getName().str())); info->setObjectID(obj->getID()); } } @@ -741,7 +741,7 @@ void AIPlayer::processBaseBuilding( void ) ObjectID builder = bldg->getBuilderID(); Object* myDozer = TheGameLogic->findObjectByID(builder); if (myDozer==NULL) { - DEBUG_LOG(("AI's Dozer got killed. Find another dozer.\n")); + DEBUG_LOG(("AI's Dozer got killed. Find another dozer.")); myDozer = findDozer(bldg->getPosition()); if (myDozer==NULL || myDozer->getAI()==NULL) { continue; @@ -765,7 +765,7 @@ void AIPlayer::processBaseBuilding( void ) if (info->getObjectTimestamp()+TheAI->getAiData()->m_rebuildDelaySeconds*LOGICFRAMES_PER_SECOND > TheGameLogic->getFrame()) { continue; } else { - DEBUG_LOG(("Enabling rebuild for %s\n", info->getTemplateName().str())); + DEBUG_LOG(("Enabling rebuild for %s", info->getTemplateName().str())); info->setObjectTimestamp(0); // ready to build. } } @@ -1129,7 +1129,7 @@ void AIPlayer::onUnitProduced( Object *factory, Object *unit ) } } if (!found) { - DEBUG_LOG(("***AI PLAYER-Unit not found in production queue.\n")); + DEBUG_LOG(("***AI PLAYER-Unit not found in production queue.")); } m_teamDelay = 0; // Cause the update queues & selection to happen immediately. @@ -1802,7 +1802,7 @@ void AIPlayer::buildBySupplies(Int minimumCash, const AsciiString& thingName) NULL, m_player ) == LBC_OK; if (valid) break; if( TheGlobalData->m_debugSupplyCenterPlacement ) - DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)\n", newPos.x, newPos.y)); + DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)", newPos.x, newPos.y)); newPos.y = yPos+posOffset; valid = TheBuildAssistant->isLocationLegalToBuild( &newPos, tTemplate, angle, BuildAssistant::CLEAR_PATH | @@ -1810,7 +1810,7 @@ void AIPlayer::buildBySupplies(Int minimumCash, const AsciiString& thingName) BuildAssistant::NO_OBJECT_OVERLAP, NULL, m_player ) == LBC_OK; if( !valid && TheGlobalData->m_debugSupplyCenterPlacement ) - DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)\n", newPos.x, newPos.y)); + DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)", newPos.x, newPos.y)); } if (valid) break; xPos = location.x-offset; @@ -1824,7 +1824,7 @@ void AIPlayer::buildBySupplies(Int minimumCash, const AsciiString& thingName) NULL, m_player ) == LBC_OK; if (valid) break; if( TheGlobalData->m_debugSupplyCenterPlacement ) - DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)\n", newPos.x, newPos.y)); + DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)", newPos.x, newPos.y)); newPos.x = xPos+posOffset; valid = TheBuildAssistant->isLocationLegalToBuild( &newPos, tTemplate, angle, BuildAssistant::CLEAR_PATH | @@ -1832,7 +1832,7 @@ void AIPlayer::buildBySupplies(Int minimumCash, const AsciiString& thingName) BuildAssistant::NO_OBJECT_OVERLAP, NULL, m_player ) == LBC_OK; if( !valid && TheGlobalData->m_debugSupplyCenterPlacement ) - DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)\n", newPos.x, newPos.y)); + DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)", newPos.x, newPos.y)); } if (valid) break; } @@ -1840,7 +1840,7 @@ void AIPlayer::buildBySupplies(Int minimumCash, const AsciiString& thingName) if (valid) { if( TheGlobalData->m_debugSupplyCenterPlacement ) - DEBUG_LOG(("buildAISupplyCenter -- SUCCESS at (%.2f,%.2f)\n", newPos.x, newPos.y)); + DEBUG_LOG(("buildAISupplyCenter -- SUCCESS at (%.2f,%.2f)", newPos.x, newPos.y)); location = newPos; } TheTerrainVisual->removeAllBibs(); // isLocationLegalToBuild adds bib feedback, turn it off. jba. @@ -1967,12 +1967,12 @@ void AIPlayer::repairStructure(ObjectID structure) Int i; for (i=0; igetID()) { - DEBUG_LOG(("info - Bridge already queued for repair.\n")); + DEBUG_LOG(("info - Bridge already queued for repair.")); return; } } if (m_structuresInQueue>=MAX_STRUCTURES_TO_REPAIR) { - DEBUG_LOG(("Structure repair queue is full, ignoring repair request. JBA\n")); + DEBUG_LOG(("Structure repair queue is full, ignoring repair request. JBA")); return; } m_structuresToRepair[m_structuresInQueue] = structureObj->getID(); @@ -2028,7 +2028,7 @@ void AIPlayer::updateBridgeRepair(void) m_repairDozer = dozer->getID(); m_repairDozerOrigin = *dozer->getPosition(); dozer->getAI()->aiRepair(bridgeObj, CMD_FROM_AI); - DEBUG_LOG(("Telling dozer to repair\n")); + DEBUG_LOG(("Telling dozer to repair")); m_dozerIsRepairing = true; return; } @@ -2053,7 +2053,7 @@ void AIPlayer::updateBridgeRepair(void) if (!dozerAI->isAnyTaskPending()) { // should be done repairing. if (bridgeState==BODY_PRISTINE) { - DEBUG_LOG(("Dozer finished repairing structure.\n")); + DEBUG_LOG(("Dozer finished repairing structure.")); // we're done. Int i; for (i=0; igetAI()->aiRepair(bridgeObj, CMD_FROM_AI); m_dozerIsRepairing = true; - DEBUG_LOG(("Telling dozer to repair\n")); + DEBUG_LOG(("Telling dozer to repair")); } // ------------------------------------------------------------------------------------------------ @@ -2277,7 +2277,7 @@ void AIPlayer::recruitSpecificAITeam(TeamPrototype *teamProto, Real recruitRadiu #ifdef DEBUG_LOGGING Coord3D pos = *unit->getPosition(); Coord3D to = teamProto->getTemplateInfo()->m_homeLocation; - DEBUG_LOG(("Moving unit from %f,%f to %f,%f\n", pos.x, pos.y , to.x, to.y )); + DEBUG_LOG(("Moving unit from %f,%f to %f,%f", pos.x, pos.y , to.x, to.y )); #endif ai->aiMoveToPosition( &teamProto->getTemplateInfo()->m_homeLocation, CMD_FROM_AI); } @@ -2734,7 +2734,7 @@ void AIPlayer::newMap( void ) if (name.isEmpty()) continue; const ThingTemplate *bldgPlan = TheThingFactory->findTemplate( name ); if (!bldgPlan) { - DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.\n", name.str())); + DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.", name.str())); continue; } if (info->isInitiallyBuilt()) { diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp index a90c6141d1..27247f0674 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp @@ -113,7 +113,7 @@ void AISkirmishPlayer::processBaseBuilding( void ) if (name.isEmpty()) continue; const ThingTemplate *curPlan = TheThingFactory->findTemplate( name ); if (!curPlan) { - DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.\n", name.str())); + DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.", name.str())); continue; } bldg = TheGameLogic->findObjectByID( info->getObjectID() ); @@ -135,7 +135,7 @@ void AISkirmishPlayer::processBaseBuilding( void ) if( rhbi ) { ObjectID spawnerID = rhbi->getSpawnerID(); if (priorID == spawnerID) { - DEBUG_LOG(("AI Found hole to rebuild %s\n", curPlan->getName().str())); + DEBUG_LOG(("AI Found hole to rebuild %s", curPlan->getName().str())); info->setObjectID(obj->getID()); } } @@ -153,7 +153,7 @@ void AISkirmishPlayer::processBaseBuilding( void ) ObjectID builder = bldg->getBuilderID(); Object* myDozer = TheGameLogic->findObjectByID(builder); if (myDozer==NULL) { - DEBUG_LOG(("AI's Dozer got killed. Find another dozer.\n")); + DEBUG_LOG(("AI's Dozer got killed. Find another dozer.")); queueDozer(); myDozer = findDozer(bldg->getPosition()); if (myDozer==NULL || myDozer->getAI()==NULL) { @@ -178,7 +178,7 @@ void AISkirmishPlayer::processBaseBuilding( void ) if (info->getObjectTimestamp()+TheAI->getAiData()->m_rebuildDelaySeconds*LOGICFRAMES_PER_SECOND > TheGameLogic->getFrame()) { continue; } else { - DEBUG_LOG(("Enabling rebuild for %s\n", info->getTemplateName().str())); + DEBUG_LOG(("Enabling rebuild for %s", info->getTemplateName().str())); info->setObjectTimestamp(0); // ready to build. } } @@ -236,7 +236,7 @@ void AISkirmishPlayer::processBaseBuilding( void ) if (!powerUnderConstruction) { bldgPlan = powerPlan; bldgInfo = powerInfo; - DEBUG_LOG(("Forcing build of power plant.\n")); + DEBUG_LOG(("Forcing build of power plant.")); } } if (bldgPlan && bldgInfo) { @@ -413,7 +413,7 @@ void AISkirmishPlayer::buildSpecificAIBuilding(const AsciiString &thingName) if (name.isEmpty()) continue; const ThingTemplate *bldgPlan = TheThingFactory->findTemplate( name ); if (!bldgPlan) { - DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.\n", name.str())); + DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.", name.str())); continue; } Object *bldg = TheGameLogic->findObjectByID( info->getObjectID() ); @@ -669,8 +669,8 @@ void AISkirmishPlayer::buildAIBaseDefenseStructure(const AsciiString &thingName, // TheSuperHackers @info helmutbuhler 21/04/2025 This debug mutates the code to become CRC incompatible #if defined(RTS_DEBUG) || !RETAIL_COMPATIBLE_CRC - DEBUG_LOG(("Angle is %f sin %f, cos %f \n", 180*angle/PI, s, c)); - DEBUG_LOG(("Offset is %f %f, new is %f, %f \n", + DEBUG_LOG(("Angle is %f sin %f, cos %f ", 180*angle/PI, s, c)); + DEBUG_LOG(("Offset is %f %f, new is %f, %f ", offset.x, offset.y, offset.x*c - offset.y*s, offset.y*c + offset.x*s @@ -802,7 +802,7 @@ void AISkirmishPlayer::recruitSpecificAITeam(TeamPrototype *teamProto, Real recr #ifdef DEBUG_LOGGING Coord3D pos = *unit->getPosition(); Coord3D to = teamProto->getTemplateInfo()->m_homeLocation; - DEBUG_LOG(("Moving unit from %f,%f to %f,%f\n", pos.x, pos.y , to.x, to.y )); + DEBUG_LOG(("Moving unit from %f,%f to %f,%f", pos.x, pos.y , to.x, to.y )); #endif ai->aiMoveToPosition( &teamProto->getTemplateInfo()->m_homeLocation, CMD_FROM_AI); } @@ -975,7 +975,7 @@ void AISkirmishPlayer::adjustBuildList(BuildListInfo *list) } } if (!foundStart) { - DEBUG_LOG(("Couldn't find starting command center for ai player.\n")); + DEBUG_LOG(("Couldn't find starting command center for ai player.")); return; } // Find the location of the command center in the build list. @@ -1066,7 +1066,7 @@ void AISkirmishPlayer::newMap( void ) /* Get our proper build list. */ AsciiString mySide = m_player->getSide(); - DEBUG_LOG(("AI Player side is %s\n", mySide.str())); + DEBUG_LOG(("AI Player side is %s", mySide.str())); const AISideBuildList *build = TheAI->getAiData()->m_sideBuildLists; while (build) { if (build->m_side == mySide) { @@ -1087,7 +1087,7 @@ void AISkirmishPlayer::newMap( void ) if (name.isEmpty()) continue; const ThingTemplate *bldgPlan = TheThingFactory->findTemplate( name ); if (!bldgPlan) { - DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.\n", name.str())); + DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.", name.str())); continue; } if (info->isInitiallyBuilt()) { diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp index 92b86efc66..a942d7b390 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp @@ -578,13 +578,13 @@ StateReturnType AIRappelState::update() { const FXList* fx = obj->getTemplate()->getPerUnitFX("CombatDropKillFX"); FXList::doFXObj(fx, bldg, NULL); - DEBUG_LOG(("Killing %d enemies in combat drop!\n",numKilled)); + DEBUG_LOG(("Killing %d enemies in combat drop!",numKilled)); } if (numKilled == MAX_TO_KILL) { obj->kill(); - DEBUG_LOG(("Killing SELF in combat drop!\n")); + DEBUG_LOG(("Killing SELF in combat drop!")); } else { @@ -870,7 +870,7 @@ StateReturnType AIStateMachine::updateStateMachine() //-extraLogging #if defined(RTS_DEBUG) if( !idle && TheGlobalData->m_extraLogging ) - DEBUG_LOG( (" - RETURN EARLY STATE_CONTINUE\n") ); + DEBUG_LOG( (" - RETURN EARLY STATE_CONTINUE") ); #endif //end -extraLogging @@ -902,7 +902,7 @@ StateReturnType AIStateMachine::updateStateMachine() break; } if( !idle ) - DEBUG_LOG( (" - RETURNING %s\n", result.str() ) ); + DEBUG_LOG( (" - RETURNING %s", result.str() ) ); } #endif //end -extraLogging @@ -933,9 +933,9 @@ StateReturnType AIStateMachine::setTemporaryState( StateID newStateID, Int frame DEBUG_LOG((" INVALID_STATE_ID ")); } if (newState) { - DEBUG_LOG(("enter '%s' \n", newState->getName().str())); + DEBUG_LOG(("enter '%s' ", newState->getName().str())); } else { - DEBUG_LOG(("to INVALID_STATE\n")); + DEBUG_LOG(("to INVALID_STATE")); } } #endif @@ -1096,7 +1096,7 @@ Bool outOfWeaponRangeObject( State *thisState, void* userData ) Object *victim = thisState->getMachineGoalObject(); Weapon *weapon = obj->getCurrentWeapon(); - CRCDEBUG_LOG(("outOfWeaponRangeObject()\n")); + CRCDEBUG_LOG(("outOfWeaponRangeObject()")); if (victim && weapon) { Bool viewBlocked = false; @@ -1129,14 +1129,14 @@ Bool outOfWeaponRangeObject( State *thisState, void* userData ) // A weapon with leech range temporarily has unlimited range and is locked onto its target. if (!weapon->hasLeechRange() && viewBlocked) { - //CRCDEBUG_LOG(("outOfWeaponRangeObject() - object %d (%s) view is blocked for attacking %d (%s)\n", + //CRCDEBUG_LOG(("outOfWeaponRangeObject() - object %d (%s) view is blocked for attacking %d (%s)", // obj->getID(), obj->getTemplate()->getName().str(), // victim->getID(), victim->getTemplate()->getName().str())); return true; } if (!weapon->hasLeechRange() && !weapon->isWithinAttackRange(obj, victim)) { - //CRCDEBUG_LOG(("outOfWeaponRangeObject() - object %d (%s) is out of range for attacking %d (%s)\n", + //CRCDEBUG_LOG(("outOfWeaponRangeObject() - object %d (%s) is out of range for attacking %d (%s)", // obj->getID(), obj->getTemplate()->getName().str(), // victim->getID(), victim->getTemplate()->getName().str())); return true; @@ -1788,7 +1788,7 @@ StateReturnType AIInternalMoveToState::update() blocked = true; m_blockedRepathTimestamp = TheGameLogic->getFrame(); // Intense debug logging jba. - //DEBUG_LOG(("Info - Blocked - recomputing.\n")); + //DEBUG_LOG(("Info - Blocked - recomputing.")); } //Determine if we are on a cliff cell... if so, use the climbing model condition @@ -1863,7 +1863,7 @@ StateReturnType AIInternalMoveToState::update() // Check if we have reached our destination // Real onPathDistToGoal = ai->getLocomotorDistanceToGoal(); - //DEBUG_LOG(("onPathDistToGoal = %f %s\n",onPathDistToGoal, obj->getTemplate()->getName().str())); + //DEBUG_LOG(("onPathDistToGoal = %f %s",onPathDistToGoal, obj->getTemplate()->getName().str())); if (ai->getCurLocomotor() && (onPathDistToGoal < ai->getCurLocomotor()->getCloseEnoughDist())) { if (ai->isDoingGroundMovement()) { @@ -1877,7 +1877,7 @@ StateReturnType AIInternalMoveToState::update() delta.y = obj->getPosition()->y - goalPos.y; delta.z = 0; if (delta.length() > 4*PATHFIND_CELL_SIZE_F) { - //DEBUG_LOG(("AIInternalMoveToState Trying to finish early. Continuing...\n")); + //DEBUG_LOG(("AIInternalMoveToState Trying to finish early. Continuing...")); onPathDistToGoal = ai->getLocomotorDistanceToGoal(); return STATE_CONTINUE; } @@ -2058,7 +2058,7 @@ StateReturnType AIMoveToState::update() m_goalPosition.y += dir.y*leadDistance; m_goalPosition.z += dir.z*leadDistance; } - //DEBUG_LOG(("update goal pos to %f %f %f\n",m_goalPosition.x,m_goalPosition.y,m_goalPosition.z)); + //DEBUG_LOG(("update goal pos to %f %f %f",m_goalPosition.x,m_goalPosition.y,m_goalPosition.z)); } else { Bool isMissile = obj->isKindOf(KINDOF_PROJECTILE); if (isMissile) { @@ -2206,7 +2206,7 @@ Bool AIMoveAndTightenState::computePath() ai->requestPath(&m_goalPosition, true); return true; } - //DEBUG_LOG(("AIMoveAndTightenState::computePath - stuck, failing.\n")); + //DEBUG_LOG(("AIMoveAndTightenState::computePath - stuck, failing.")); return false; // don't repath for now. jba. } return true; // just use the existing path. See above. @@ -2349,7 +2349,7 @@ Bool AIAttackApproachTargetState::computePath() if( getMachineOwner()->isMobile() == false ) return false; - //CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - begin for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - begin for object %d", getMachineOwner()->getID())); AIUpdateInterface *ai = getMachineOwner()->getAI(); @@ -2357,7 +2357,7 @@ Bool AIAttackApproachTargetState::computePath() { forceRepath = true; // Intense logging. jba - //CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - stuck, recomputing for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - stuck, recomputing for object %d", getMachineOwner()->getID())); } if (m_waitingForPath) return true; @@ -2370,7 +2370,7 @@ Bool AIAttackApproachTargetState::computePath() /// @todo Unify recomputation conditions & account for obj ID so everyone doesnt compute on the same frame (MSB) if (!forceRepath && TheGameLogic->getFrame() - m_approachTimestamp < MIN_RECOMPUTE_TIME) { - //CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because of min time for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because of min time for object %d", getMachineOwner()->getID())); return true; } @@ -2384,14 +2384,14 @@ Bool AIAttackApproachTargetState::computePath() // if our victim's position hasn't changed, don't re-path if (!forceRepath && isSamePosition(source->getPosition(), &m_prevVictimPos, getMachineGoalObject()->getPosition() )) { - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because victim in same place for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because victim in same place for object %d", getMachineOwner()->getID())); return true; } Weapon* weapon = source->getCurrentWeapon(); if (!weapon) { - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because of no weapon for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because of no weapon for object %d", getMachineOwner()->getID())); return false; } @@ -2415,7 +2415,7 @@ Bool AIAttackApproachTargetState::computePath() { m_waitingForPath = true; m_goalPosition = m_prevVictimPos; - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - requestPath() for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - requestPath() for object %d", getMachineOwner()->getID())); ai->requestPath(&m_goalPosition, getAdjustsDestination()); } else @@ -2426,11 +2426,11 @@ Bool AIAttackApproachTargetState::computePath() Coord3D pos; victim->getGeometryInfo().getCenterPosition( *victim->getPosition(), pos ); - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - requestAttackPath() for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - requestAttackPath() for object %d", getMachineOwner()->getID())); ai->requestAttackPath(victim->getID(), &pos ); m_stopIfInRange = false; // we have calculated a position to shoot from, so go there. } - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing after repathing for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing after repathing for object %d", getMachineOwner()->getID())); return true; } else @@ -2441,18 +2441,18 @@ Bool AIAttackApproachTargetState::computePath() m_goalPosition = *getMachineGoalPosition(); if (!forceRepath) { - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because we're aiming for a fixed position for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because we're aiming for a fixed position for object %d", getMachineOwner()->getID())); return true; // fixed positions don't move. } // must use computeAttackPath so that min ranges are considered. m_waitingForPath = true; ai->requestAttackPath(INVALID_ID, &m_goalPosition); - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing after repathing at a fixed position for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing after repathing at a fixed position for object %d", getMachineOwner()->getID())); return true; } - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing at end of function for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing at end of function for object %d", getMachineOwner()->getID())); return true; } @@ -2499,7 +2499,7 @@ StateReturnType AIAttackApproachTargetState::onEnter() { // contained by AIAttackState, so no separate timer // urg. hacky. if we are a projectile, turn on precise z-pos. - //CRCDEBUG_LOG(("AIAttackApproachTargetState::onEnter() - object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::onEnter() - object %d", getMachineOwner()->getID())); Object* source = getMachineOwner(); AIUpdateInterface* ai = source->getAI(); if (source->isKindOf(KINDOF_PROJECTILE)) @@ -2571,7 +2571,7 @@ StateReturnType AIAttackApproachTargetState::onEnter() } // find a good spot to shoot from - //CRCDEBUG_LOG(("AIAttackApproachTargetState::onEnter() - calling computePath() for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::onEnter() - calling computePath() for object %d", getMachineOwner()->getID())); if (computePath() == false) return STATE_FAILURE; @@ -2582,7 +2582,7 @@ StateReturnType AIAttackApproachTargetState::onEnter() StateReturnType AIAttackApproachTargetState::updateInternal() { AIUpdateInterface* ai = getMachineOwner()->getAI(); - //CRCDEBUG_LOG(("AIAttackApproachTargetState::updateInternal() - object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::updateInternal() - object %d", getMachineOwner()->getID())); if (getMachine()->isGoalObjectDestroyed()) { ai->notifyVictimIsDead(); @@ -2620,7 +2620,7 @@ StateReturnType AIAttackApproachTargetState::updateInternal() } } // find a good spot to shoot from - //CRCDEBUG_LOG(("AIAttackApproachTargetState::updateInternal() - calling computePath() to victim for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::updateInternal() - calling computePath() to victim for object %d", getMachineOwner()->getID())); if (computePath() == false) return STATE_SUCCESS; code = AIInternalMoveToState::update(); @@ -2636,7 +2636,7 @@ StateReturnType AIAttackApproachTargetState::updateInternal() { // Attacking a position. // find a good spot to shoot from - //CRCDEBUG_LOG(("AIAttackApproachTargetState::updateInternal() - calling computePath() to position for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::updateInternal() - calling computePath() to position for object %d", getMachineOwner()->getID())); if (m_stopIfInRange && weapon && weapon->isWithinAttackRange(source, &m_goalPosition)) { Bool viewBlocked = false; @@ -2859,17 +2859,17 @@ StateReturnType AIAttackPursueTargetState::onEnter() if (source->isKindOf(KINDOF_PROJECTILE)) { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - is a projectile for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - is a projectile for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // Projectiles go directly to AIAttackApproachTargetState. } if (getMachine()->isGoalObjectDestroyed()) { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - goal object is destroyed for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - goal object is destroyed for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // Already killed victim. } if (!m_isAttackingObject) { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - not attacking for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - not attacking for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // only pursue objects - positions don't move. } @@ -2898,11 +2898,11 @@ StateReturnType AIAttackPursueTargetState::onEnter() } if (!canPursue(source, weapon, victim) ) { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - can't pursue for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - can't pursue for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; } } else { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - no victim for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - no victim for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // gotta have a victim. } // If we have a turret, start aiming. @@ -2911,7 +2911,7 @@ StateReturnType AIAttackPursueTargetState::onEnter() { ai->setTurretTargetObject(tur, victim, m_isForceAttacking); } else { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - no turret for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - no turret for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // we only pursue with turrets, as non-turreted weapons can't fire on the run. } @@ -2951,7 +2951,7 @@ StateReturnType AIAttackPursueTargetState::updateInternal() code = AIInternalMoveToState::update(); if (code != STATE_CONTINUE) { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::updateInternal() - failed internal update() for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::updateInternal() - failed internal update() for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // Always return state success, as state failure exits the attack. // we may need to aim & do another approach if the target moved. jba. } @@ -2962,7 +2962,7 @@ StateReturnType AIAttackPursueTargetState::updateInternal() WhichTurretType tur = ai->getWhichTurretForCurWeapon(); if (tur == TURRET_INVALID) { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::updateInternal() - no turret for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::updateInternal() - no turret for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // We currently only pursue with a turret weapon. } @@ -2985,7 +2985,7 @@ StateReturnType AIAttackPursueTargetState::updateInternal() } ai->setDesiredSpeed(victimSpeed); // Really intense debug info. jba. - // DEBUG_LOG(("VS %f, OS %f, goal %f\n", victim->getPhysics()->getForwardSpeed2D(), source->getPhysics()->getForwardSpeed2D(), victimSpeed)); + // DEBUG_LOG(("VS %f, OS %f, goal %f", victim->getPhysics()->getForwardSpeed2D(), source->getPhysics()->getForwardSpeed2D(), victimSpeed)); } else { ai->setDesiredSpeed(FAST_AS_POSSIBLE); } @@ -3022,7 +3022,7 @@ StateReturnType AIAttackPursueTargetState::update() void AIAttackPursueTargetState::onExit( StateExitType status ) { // contained by AIAttackState, so no separate timer - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onExit() for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onExit() for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); AIInternalMoveToState::onExit( status ); m_isInitialApproach = false; // We only want to allow turreted things to fire at enemies during their @@ -3565,7 +3565,7 @@ StateReturnType AIAttackMoveToState::update() if (distSqr < sqr(ATTACK_CLOSE_ENOUGH_CELLS*PATHFIND_CELL_SIZE_F)) { return ret; } - DEBUG_LOG(("AIAttackMoveToState::update Distance from goal %f, retrying.\n", sqrt(distSqr))); + DEBUG_LOG(("AIAttackMoveToState::update Distance from goal %f, retrying.", sqrt(distSqr))); ret = STATE_CONTINUE; m_retryCount--; @@ -3951,7 +3951,7 @@ StateReturnType AIFollowWaypointPathState::onEnter() setAdjustsDestination(ai->isDoingGroundMovement()); if (getAdjustsDestination()) { if (!TheAI->pathfinder()->adjustDestination(getMachineOwner(), ai->getLocomotorSet(), &m_goalPosition)) { - DEBUG_LOG(("Breaking out of follow waypoint path\n")); + DEBUG_LOG(("Breaking out of follow waypoint path")); return STATE_FAILURE; } TheAI->pathfinder()->updateGoal(getMachineOwner(), &m_goalPosition, m_goalLayer); @@ -3964,7 +3964,7 @@ StateReturnType AIFollowWaypointPathState::onEnter() } } if (ret != STATE_CONTINUE) { - DEBUG_LOG(("Breaking out of follow waypoint path\n")); + DEBUG_LOG(("Breaking out of follow waypoint path")); } return ret; } @@ -4025,7 +4025,7 @@ StateReturnType AIFollowWaypointPathState::update() if (m_currentWaypoint) { // TheSuperHackers @info helmutbuhler 05/05/2025 This debug mutates the code to become CRC incompatible #if defined(RTS_DEBUG) || !RETAIL_COMPATIBLE_CRC - DEBUG_LOG(("Breaking out of follow waypoint path %s of %s\n", + DEBUG_LOG(("Breaking out of follow waypoint path %s of %s", m_currentWaypoint->getName().str(), m_currentWaypoint->getPathLabel1().str())); #endif } @@ -4102,7 +4102,7 @@ StateReturnType AIFollowWaypointPathState::update() if (m_currentWaypoint) { // TheSuperHackers @info helmutbuhler 05/05/2025 This debug mutates the code to become CRC incompatible #if defined(RTS_DEBUG) || !RETAIL_COMPATIBLE_CRC - DEBUG_LOG(("Breaking out of follow waypoint path %s of %s\n", + DEBUG_LOG(("Breaking out of follow waypoint path %s of %s", m_currentWaypoint->getName().str(), m_currentWaypoint->getPathLabel1().str())); #endif } @@ -4118,7 +4118,7 @@ StateReturnType AIFollowWaypointPathState::update() return STATE_CONTINUE; } if (status != STATE_CONTINUE) { - DEBUG_LOG(("Breaking out of follow waypoint path\n")); + DEBUG_LOG(("Breaking out of follow waypoint path")); } return status; } @@ -4923,7 +4923,7 @@ StateReturnType AIAttackAimAtTargetState::update() if (aimDelta < REL_THRESH) aimDelta = REL_THRESH; - //DEBUG_LOG(("AIM: desired %f, actual %f, delta %f, aimDelta %f, goalpos %f %f\n",rad2deg(obj->getOrientation() + relAngle),rad2deg(obj->getOrientation()),rad2deg(relAngle),rad2deg(aimDelta),victim->getPosition()->x,victim->getPosition()->y)); + //DEBUG_LOG(("AIM: desired %f, actual %f, delta %f, aimDelta %f, goalpos %f %f",rad2deg(obj->getOrientation() + relAngle),rad2deg(obj->getOrientation()),rad2deg(relAngle),rad2deg(aimDelta),victim->getPosition()->x,victim->getPosition()->y)); if (m_canTurnInPlace) { if (fabs(relAngle) > aimDelta) @@ -5301,7 +5301,7 @@ DECLARE_PERF_TIMER(AIAttackState) StateReturnType AIAttackState::onEnter() { USE_PERF_TIMER(AIAttackState) - //CRCDEBUG_LOG(("AIAttackState::onEnter() - start for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackState::onEnter() - start for object %d", getMachineOwner()->getID())); Object* source = getMachineOwner(); AIUpdateInterface *ai = source->getAI(); // if we are in sleep mode, we will not attack @@ -5318,7 +5318,7 @@ StateReturnType AIAttackState::onEnter() return STATE_FAILURE; // create new state machine for attack behavior - //CRCDEBUG_LOG(("AIAttackState::onEnter() - constructing state machine for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackState::onEnter() - constructing state machine for object %d", getMachineOwner()->getID())); m_attackMachine = newInstance(AttackStateMachine)(source, this, "AIAttackMachine", m_follow, m_isAttackingObject, m_isForceAttacking ); // tell the attack machine who the victim of the attack is @@ -5883,7 +5883,7 @@ StateReturnType AIDockState::onEnter() if (dockWithMe == NULL) { // we have nothing to dock with! - DEBUG_LOG(("No goal in AIDockState::onEnter - exiting.\n")); + DEBUG_LOG(("No goal in AIDockState::onEnter - exiting.")); return STATE_FAILURE; } DockUpdateInterface *dock = NULL; @@ -5891,7 +5891,7 @@ StateReturnType AIDockState::onEnter() // if we have nothing to dock with, fail if (dock == NULL) { - DEBUG_LOG(("Goal is not a dock in AIDockState::onEnter - exiting.\n")); + DEBUG_LOG(("Goal is not a dock in AIDockState::onEnter - exiting.")); return STATE_FAILURE; } @@ -5923,7 +5923,7 @@ void AIDockState::onExit( StateExitType status ) deleteInstance(m_dockMachine); m_dockMachine = NULL; } else { - DEBUG_LOG(("Dock exited immediately\n")); + DEBUG_LOG(("Dock exited immediately")); } // stop ignoring our goal object @@ -5954,10 +5954,10 @@ StateReturnType AIDockState::update() { ai->setCanPathThroughUnits(true); //if (ai->isBlockedAndStuck()) { - //DEBUG_LOG(("Blocked and stuck.\n")); + //DEBUG_LOG(("Blocked and stuck.")); //} //if (ai->getNumFramesBlocked()>5) { - //DEBUG_LOG(("Blocked %d frames\n", ai->getNumFramesBlocked())); + //DEBUG_LOG(("Blocked %d frames", ai->getNumFramesBlocked())); //} } /* @@ -6395,7 +6395,7 @@ void AIGuardState::onExit( StateExitType status ) //---------------------------------------------------------------------------------------------------------- StateReturnType AIGuardState::update() { - //DEBUG_LOG(("AIGuardState frame %d: %08lx\n",TheGameLogic->getFrame(),getMachineOwner())); + //DEBUG_LOG(("AIGuardState frame %d: %08lx",TheGameLogic->getFrame(),getMachineOwner())); if (m_guardMachine == NULL) { @@ -6516,7 +6516,7 @@ void AITunnelNetworkGuardState::onExit( StateExitType status ) //---------------------------------------------------------------------------------------------------------- StateReturnType AITunnelNetworkGuardState::update() { - //DEBUG_LOG(("AITunnelNetworkGuardState frame %d: %08lx\n",TheGameLogic->getFrame(),getMachineOwner())); + //DEBUG_LOG(("AITunnelNetworkGuardState frame %d: %08lx",TheGameLogic->getFrame(),getMachineOwner())); if (m_guardMachine == NULL) { diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AITNGuard.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AITNGuard.cpp index 2f9add3ade..950c668c35 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AITNGuard.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AITNGuard.cpp @@ -325,7 +325,7 @@ StateReturnType AITNGuardInnerState::onEnter( void ) Object* nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()) ; if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardInnerState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardInnerState.")); return STATE_SUCCESS; } m_exitConditions.m_attackGiveUpFrame = TheGameLogic->getFrame() + TheAI->getAiData()->m_guardChaseUnitFrames; @@ -469,7 +469,7 @@ StateReturnType AITNGuardOuterState::onEnter( void ) Object* nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()) ; if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardOuterState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardOuterState.")); return STATE_SUCCESS; } @@ -664,7 +664,7 @@ StateReturnType AITNGuardIdleState::onEnter( void ) //-------------------------------------------------------------------------------------- StateReturnType AITNGuardIdleState::update( void ) { - //DEBUG_LOG(("AITNGuardIdleState frame %d: %08lx\n",TheGameLogic->getFrame(),getMachineOwner())); + //DEBUG_LOG(("AITNGuardIdleState frame %d: %08lx",TheGameLogic->getFrame(),getMachineOwner())); UnsignedInt now = TheGameLogic->getFrame(); if (now < m_nextEnemyScanTime) @@ -692,7 +692,7 @@ StateReturnType AITNGuardIdleState::update( void ) Object *nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()); if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardAttackAggressorState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardAttackAggressorState.")); return STATE_SLEEP(0); } if (getMachineOwner()->getContainedBy()) { @@ -781,7 +781,7 @@ StateReturnType AITNGuardAttackAggressorState::onEnter( void ) Object *nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()); if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardAttackAggressorState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardAttackAggressorState.")); return STATE_SUCCESS; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp index 95d82a8f76..05b1158977 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp @@ -679,7 +679,7 @@ UpdateSleepTime TurretAI::updateTurretAI() return UPDATE_SLEEP(m_sleepUntil - now); } - //DEBUG_LOG(("updateTurretAI frame %d: %08lx\n",TheGameLogic->getFrame(),getOwner())); + //DEBUG_LOG(("updateTurretAI frame %d: %08lx",TheGameLogic->getFrame(),getOwner())); UpdateSleepTime subMachineSleep = UPDATE_SLEEP_FOREVER; // assume the best! // either we don't care about continuous fire stuff, or we care, but time has elapsed @@ -945,7 +945,7 @@ StateReturnType TurretAIAimTurretState::onEnter() */ StateReturnType TurretAIAimTurretState::update() { - //DEBUG_LOG(("TurretAIAimTurretState frame %d: %08lx\n",TheGameLogic->getFrame(),getTurretAI()->getOwner())); + //DEBUG_LOG(("TurretAIAimTurretState frame %d: %08lx",TheGameLogic->getFrame(),getTurretAI()->getOwner())); TurretAI* turret = getTurretAI(); Object* obj = turret->getOwner(); @@ -1203,7 +1203,7 @@ StateReturnType TurretAIRecenterTurretState::onEnter() StateReturnType TurretAIRecenterTurretState::update() { - //DEBUG_LOG(("TurretAIRecenterTurretState frame %d: %08lx\n",TheGameLogic->getFrame(),getTurretAI()->getOwner())); + //DEBUG_LOG(("TurretAIRecenterTurretState frame %d: %08lx",TheGameLogic->getFrame(),getTurretAI()->getOwner())); TurretAI* turret = getTurretAI(); Bool angleAligned = turret->friend_turnTowardsAngle(turret->getNaturalTurretAngle(), 0.5f, 0.0f); @@ -1282,7 +1282,7 @@ StateReturnType TurretAIIdleState::onEnter() //---------------------------------------------------------------------------------------------------------- StateReturnType TurretAIIdleState::update() { - //DEBUG_LOG(("TurretAIIdleState frame %d: %08lx\n",TheGameLogic->getFrame(),getTurretAI()->getOwner())); + //DEBUG_LOG(("TurretAIIdleState frame %d: %08lx",TheGameLogic->getFrame(),getTurretAI()->getOwner())); UnsignedInt now = TheGameLogic->getFrame(); if (now >= m_nextIdleScan) @@ -1353,7 +1353,7 @@ StateReturnType TurretAIIdleScanState::onEnter() StateReturnType TurretAIIdleScanState::update() { - //DEBUG_LOG(("TurretAIIdleScanState frame %d: %08lx\n",TheGameLogic->getFrame(),getTurretAI()->getOwner())); + //DEBUG_LOG(("TurretAIIdleScanState frame %d: %08lx",TheGameLogic->getFrame(),getTurretAI()->getOwner())); Bool angleAligned = getTurretAI()->friend_turnTowardsAngle(getTurretAI()->getNaturalTurretAngle() + m_desiredAngle, 0.5f, 0.0f); Bool pitchAligned = getTurretAI()->friend_turnTowardsPitch(getTurretAI()->getNaturalTurretPitch(), 0.5f); @@ -1424,7 +1424,7 @@ void TurretAIHoldTurretState::onExit( StateExitType status ) StateReturnType TurretAIHoldTurretState::update() { - //DEBUG_LOG(("TurretAIHoldTurretState frame %d: %08lx\n",TheGameLogic->getFrame(),getTurretAI()->getOwner())); + //DEBUG_LOG(("TurretAIHoldTurretState frame %d: %08lx",TheGameLogic->getFrame(),getTurretAI()->getOwner())); if (TheGameLogic->getFrame() >= m_timestamp) return STATE_SUCCESS; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp b/Generals/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp index 551751fefc..6bf24cb8dd 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp @@ -456,9 +456,9 @@ static Bool ParseTeamsDataChunk(DataChunkInput &file, DataChunkInfo *info, void if (sides->findSkirmishSideInfo(player)) { // player exists, so just add it. sides->addSkirmishTeam(&teamDict); - //DEBUG_LOG(("Adding team %s\n", teamName.str())); + //DEBUG_LOG(("Adding team %s", teamName.str())); } else { - //DEBUG_LOG(("Couldn't add team %s, no player %s\n", teamName.str(), player.str())); + //DEBUG_LOG(("Couldn't add team %s, no player %s", teamName.str(), player.str())); } } DEBUG_ASSERTCRASH(file.atEndOfChunk(), ("Unexpected data left over.")); @@ -507,7 +507,7 @@ void SidesList::prepareForMP_or_Skirmish(void) } if (!gotScripts) { AsciiString path = "data\\Scripts\\SkirmishScripts.scb"; - DEBUG_LOG(("Skirmish map using standard scripts\n")); + DEBUG_LOG(("Skirmish map using standard scripts")); m_skirmishTeamrec.clear(); CachedFileInputStream theInputStream; if (theInputStream.open(path)) { @@ -517,7 +517,7 @@ void SidesList::prepareForMP_or_Skirmish(void) file.registerParser( AsciiString("ScriptsPlayers"), AsciiString::TheEmptyString, ParsePlayersDataChunk ); file.registerParser( AsciiString("ScriptTeams"), AsciiString::TheEmptyString, ParseTeamsDataChunk ); if (!file.parse(this)) { - DEBUG_LOG(("ERROR - Unable to read in skirmish scripts.\n")); + DEBUG_LOG(("ERROR - Unable to read in skirmish scripts.")); return; } ScriptList *scripts[MAX_PLAYER_COUNT]; @@ -761,7 +761,7 @@ Bool SidesList::validateSides() } else { - DEBUG_LOG(("*** default team for player %s missing (should not be possible), adding it...\n",tname.str())); + DEBUG_LOG(("*** default team for player %s missing (should not be possible), adding it...",tname.str())); Dict d; d.setAsciiString(TheKey_teamName, tname); d.setAsciiString(TheKey_teamOwner, pname); @@ -777,14 +777,14 @@ Bool SidesList::validateSides() // (note that owners can be teams or players, but allies/enemies can only be teams.) if (validateAllyEnemyList(pname, allies)) { - DEBUG_LOG(("bad allies...\n")); + DEBUG_LOG(("bad allies...")); pdict->setAsciiString(TheKey_playerAllies, allies); modified = true; } if (validateAllyEnemyList(pname, enemies)) { - DEBUG_LOG(("bad enemies...\n")); + DEBUG_LOG(("bad enemies...")); pdict->setAsciiString(TheKey_playerEnemies, enemies); modified = true; } @@ -814,7 +814,7 @@ Bool SidesList::validateSides() SidesInfo* si = findSideInfo(towner); if (si == NULL || towner == tname) { - DEBUG_LOG(("bad owner %s; reparenting to neutral...\n",towner.str())); + DEBUG_LOG(("bad owner %s; reparenting to neutral...",towner.str())); tdict->setAsciiString(TheKey_teamOwner, AsciiString::TheEmptyString); modified = true; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index 925bd8832d..ecb206bcb0 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -856,7 +856,7 @@ Drawable *Bridge::pickBridge(const Vector3 &from, const Vector3 &to, Vector3 *po if (isPointOnBridge(&loc)) { *pos = intersectPos; - //DEBUG_LOG(("Picked bridge %.2f, %.2f, %.2f\n", intersectPos.X, intersectPos.Y, intersectPos.Z)); + //DEBUG_LOG(("Picked bridge %.2f, %.2f, %.2f", intersectPos.X, intersectPos.Y, intersectPos.Z)); Object *bridge = TheGameLogic->findObjectByID(m_bridgeInfo.bridgeObjectID); if (bridge) { return bridge->getDrawable(); @@ -1304,9 +1304,9 @@ Bool TerrainLogic::loadMap( AsciiString filename, Bool query ) } else { DEBUG_LOG(("No links.")); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } - DEBUG_LOG(("Total of %d waypoints.\n", count)); + DEBUG_LOG(("Total of %d waypoints.", count)); #endif if (!query) { @@ -1586,7 +1586,7 @@ Waypoint *TerrainLogic::getClosestWaypointOnPath( const Coord3D *pos, AsciiStrin Real distSqr = 0; Waypoint *pClosestWay = NULL; if (label.isEmpty()) { - DEBUG_LOG(("***Warning - asking for empty path label.\n")); + DEBUG_LOG(("***Warning - asking for empty path label.")); return NULL; } @@ -1617,7 +1617,7 @@ Waypoint *TerrainLogic::getClosestWaypointOnPath( const Coord3D *pos, AsciiStrin Bool TerrainLogic::isPurposeOfPath( Waypoint *pWay, AsciiString label ) { if (label.isEmpty() || pWay==NULL) { - DEBUG_LOG(("***Warning - asking for empth path label.\n")); + DEBUG_LOG(("***Warning - asking for empth path label.")); return false; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/AutoHealBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/AutoHealBehavior.cpp index de3d30e298..fc65a82e48 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/AutoHealBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/AutoHealBehavior.cpp @@ -186,7 +186,7 @@ UpdateSleepTime AutoHealBehavior::update( void ) return UPDATE_SLEEP_FOREVER; } -//DEBUG_LOG(("doing auto heal %d\n",TheGameLogic->getFrame())); +//DEBUG_LOG(("doing auto heal %d",TheGameLogic->getFrame())); if( d->m_affectsWholePlayer ) { diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp index 9e15994e1f..b9f885696d 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp @@ -305,7 +305,7 @@ static Bool calcTrajectory( } } -//DEBUG_LOG(("took %d loops to find a match\n",numLoops)); +//DEBUG_LOG(("took %d loops to find a match",numLoops)); if (exactTarget) return true; @@ -467,7 +467,7 @@ Bool DumbProjectileBehavior::projectileHandleCollision( Object *other ) // if it's not the specific thing we were targeting, see if we should incidentally collide... if (!m_detonationWeaponTmpl->shouldProjectileCollideWith(projectileLauncher, getObject(), other, m_victimID)) { - //DEBUG_LOG(("ignoring projectile collision with %s at frame %d\n",other->getTemplate()->getName().str(),TheGameLogic->getFrame())); + //DEBUG_LOG(("ignoring projectile collision with %s at frame %d",other->getTemplate()->getName().str(),TheGameLogic->getFrame())); return true; } @@ -487,7 +487,7 @@ Bool DumbProjectileBehavior::projectileHandleCollision( Object *other ) Object* thingToKill = *it++; if (!thingToKill->isEffectivelyDead() && thingToKill->isKindOfMulti(d->m_garrisonHitKillKindof, d->m_garrisonHitKillKindofNot)) { - //DEBUG_LOG(("Killed a garrisoned unit (%08lx %s) via Flash-Bang!\n",thingToKill,thingToKill->getTemplate()->getName().str())); + //DEBUG_LOG(("Killed a garrisoned unit (%08lx %s) via Flash-Bang!",thingToKill,thingToKill->getTemplate()->getName().str())); if (projectileLauncher) projectileLauncher->scoreTheKill( thingToKill ); thingToKill->kill(); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp index bdd976155c..a6694f7b1c 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp @@ -218,7 +218,7 @@ UpdateSleepTime MinefieldBehavior::update() if (TheGameLogic->findObjectByID(m_immunes[i].id) == NULL || now > m_immunes[i].collideTime + 2) { - //DEBUG_LOG(("expiring an immunity %d\n",m_immunes[i].id)); + //DEBUG_LOG(("expiring an immunity %d",m_immunes[i].id)); m_immunes[i].id = INVALID_ID; // he's dead, jim. m_immunes[i].collideTime = 0; } @@ -347,7 +347,7 @@ void MinefieldBehavior::onCollide( Object *other, const Coord3D *loc, const Coor { if (m_immunes[i].id == other->getID()) { - //DEBUG_LOG(("ignoring due to immunity %d\n",m_immunes[i].id)); + //DEBUG_LOG(("ignoring due to immunity %d",m_immunes[i].id)); m_immunes[i].collideTime = now; return; } @@ -387,7 +387,7 @@ void MinefieldBehavior::onCollide( Object *other, const Coord3D *loc, const Coor { if (m_immunes[i].id == INVALID_ID || m_immunes[i].id == other->getID()) { - //DEBUG_LOG(("add/update immunity %d\n",m_immunes[i].id)); + //DEBUG_LOG(("add/update immunity %d",m_immunes[i].id)); m_immunes[i].id = other->getID(); m_immunes[i].collideTime = now; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp index 4668cb2f2b..aaac8901c5 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp @@ -707,7 +707,7 @@ void ParkingPlaceBehavior::exitObjectViaDoor( Object *newObj, ExitDoorType exitD DUMPCOORD3D(getObject()->getPosition()); if (producedAtHelipad) { - CRCDEBUG_LOG(("Produced at helipad (door = %d)\n", exitDoor)); + CRCDEBUG_LOG(("Produced at helipad (door = %d)", exitDoor)); DEBUG_ASSERTCRASH(exitDoor == DOOR_NONE_NEEDED, ("Hmm, unlikely")); Matrix3D mtx; #ifdef DEBUG_CRASHING @@ -722,7 +722,7 @@ void ParkingPlaceBehavior::exitObjectViaDoor( Object *newObj, ExitDoorType exitD } else { - CRCDEBUG_LOG(("Produced at hangar (door = %d)\n", exitDoor)); + CRCDEBUG_LOG(("Produced at hangar (door = %d)", exitDoor)); DEBUG_ASSERTCRASH(exitDoor != DOOR_NONE_NEEDED, ("Hmm, unlikely")); if (!reserveSpace(newObj->getID(), parkingOffset, &ppinfo)) //&loc, &orient, NULL, NULL, NULL, NULL, &hangarInternal, &hangOrient)) { diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp index 120c513bae..f6c862f4ab 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp @@ -377,7 +377,7 @@ void SlowDeathBehavior::doPhaseStuff(SlowDeathPhaseType sdphase) //------------------------------------------------------------------------------------------------- UpdateSleepTime SlowDeathBehavior::update() { - //DEBUG_LOG(("updating SlowDeathBehavior %08lx\n",this)); + //DEBUG_LOG(("updating SlowDeathBehavior %08lx",this)); DEBUG_ASSERTCRASH(isSlowDeathActivated(), ("hmm, this should not be possible")); const SlowDeathBehaviorModuleData* d = getSlowDeathBehaviorModuleData(); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp index 20f6b837b3..89c8ed80da 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp @@ -217,7 +217,7 @@ void OpenContain::addOrRemoveObjFromWorld(Object* obj, Bool add) // check for it here and print a warning // if( obj->isKindOf( KINDOF_STRUCTURE ) ) - DEBUG_LOG(( "WARNING: Containing/Removing structures like '%s' is potentially a very expensive and slow operation\n", + DEBUG_LOG(( "WARNING: Containing/Removing structures like '%s' is potentially a very expensive and slow operation", obj->getTemplate()->getName().str() )); @@ -300,7 +300,7 @@ void OpenContain::addToContain( Object *rider ) if( rider->getContainedBy() != NULL ) { - DEBUG_LOG(( "'%s' is trying to contain '%s', but '%s' is already contained by '%s'\n", + DEBUG_LOG(( "'%s' is trying to contain '%s', but '%s' is already contained by '%s'", getObject()->getTemplate()->getName().str(), rider->getTemplate()->getName().str(), rider->getTemplate()->getName().str(), @@ -367,7 +367,7 @@ void OpenContain::removeFromContain( Object *rider, Bool exposeStealthUnits ) if( containedBy != getObject() ) { - DEBUG_LOG(( "'%s' is trying to un-contain '%s', but '%s' is really contained by '%s'\n", + DEBUG_LOG(( "'%s' is trying to un-contain '%s', but '%s' is really contained by '%s'", getObject()->getTemplate()->getName().str(), rider->getTemplate()->getName().str(), rider->getTemplate()->getName().str(), diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp index 341f2a8229..67d71d2dd5 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp @@ -172,7 +172,7 @@ void ParachuteContain::updateBonePositions() m_paraAttachBone.zero(); } } - //DEBUG_LOG(("updating para bone positions %d...\n",TheGameLogic->getFrame())); + //DEBUG_LOG(("updating para bone positions %d...",TheGameLogic->getFrame())); } if (m_needToUpdateRiderBones) @@ -186,13 +186,13 @@ void ParachuteContain::updateBonePositions() { if (riderDraw->getPristineBonePositions( "PARA_MAN", 0, &m_riderAttachBone, NULL, 1) != 1) { - //DEBUG_LOG(("*** No parachute-attach bone... using object height!\n")); + //DEBUG_LOG(("*** No parachute-attach bone... using object height!")); m_riderAttachBone.zero(); m_riderAttachBone.z += riderDraw->getDrawableGeometryInfo().getMaxHeightAbovePosition(); } } - //DEBUG_LOG(("updating rider bone positions %d...\n",TheGameLogic->getFrame())); + //DEBUG_LOG(("updating rider bone positions %d...",TheGameLogic->getFrame())); } } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp index 2882f3a61b..4c220a3da9 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp @@ -399,19 +399,19 @@ void LocomotorTemplate::validate() if (m_maxSpeed <= 0.0f) { // if one of these was omitted, it defaults to zero... just quietly heal it here, rather than crashing - DEBUG_LOG(("THRUST locos may not have zero m_maxSpeed; healing...\n")); + DEBUG_LOG(("THRUST locos may not have zero m_maxSpeed; healing...")); m_maxSpeed = 0.01f; } if (m_maxSpeedDamaged <= 0.0f) { // if one of these was omitted, it defaults to zero... just quietly heal it here, rather than crashing - DEBUG_LOG(("THRUST locos may not have zero m_maxSpeedDamaged; healing...\n")); + DEBUG_LOG(("THRUST locos may not have zero m_maxSpeedDamaged; healing...")); m_maxSpeedDamaged = 0.01f; } if (m_minSpeed <= 0.0f) { // if one of these was omitted, it defaults to zero... just quietly heal it here, rather than crashing - DEBUG_LOG(("THRUST locos may not have zero m_minSpeed; healing...\n")); + DEBUG_LOG(("THRUST locos may not have zero m_minSpeed; healing...")); m_minSpeed = 0.01f; } } @@ -1210,7 +1210,7 @@ void Locomotor::moveTowardsPositionTreads(Object* obj, PhysicsBehavior *physics, } - //DEBUG_LOG(("Actual speed %f, Braking factor %f, slowDownDist %f, Pathdist %f, goalSpeed %f\n", + //DEBUG_LOG(("Actual speed %f, Braking factor %f, slowDownDist %f, Pathdist %f, goalSpeed %f", // actualSpeed, m_brakingFactor, slowDownDist, onPathDistToGoal, goalSpeed)); // @@ -1419,7 +1419,7 @@ void Locomotor::moveTowardsPositionWheels(Object* obj, PhysicsBehavior *physics, } - //DEBUG_LOG(("Actual speed %f, Braking factor %f, slowDownDist %f, Pathdist %f, goalSpeed %f\n", + //DEBUG_LOG(("Actual speed %f, Braking factor %f, slowDownDist %f, Pathdist %f, goalSpeed %f", // actualSpeed, m_brakingFactor, slowDownDist, onPathDistToGoal, goalSpeed)); @@ -1470,7 +1470,7 @@ void Locomotor::moveTowardsPositionWheels(Object* obj, PhysicsBehavior *physics, if (fabs(accelForce) > fabs(maxForceNeeded)) accelForce = maxForceNeeded; - //DEBUG_LOG(("Braking %d, actualSpeed %f, goalSpeed %f, delta %f, accel %f\n", getFlag(IS_BRAKING), + //DEBUG_LOG(("Braking %d, actualSpeed %f, goalSpeed %f, delta %f, accel %f", getFlag(IS_BRAKING), //actualSpeed, goalSpeed, speedDelta, accelForce)); const Coord3D *dir = obj->getUnitDirectionVector2D(); @@ -1978,7 +1978,7 @@ void Locomotor::moveTowardsPositionThrust(Object* obj, PhysicsBehavior *physics, Vector3 curVel(physics->getVelocity()->x, physics->getVelocity()->y, physics->getVelocity()->z); Vector3 accelVec = thrustDir * maxAccel - curVel * damping; - //DEBUG_LOG(("accel %f (max %f) vel %f (max %f) damping %f\n",accelVec.Length(),maxAccel,curVel.Length(),maxForwardSpeed,damping)); + //DEBUG_LOG(("accel %f (max %f) vel %f (max %f) damping %f",accelVec.Length(),maxAccel,curVel.Length(),maxForwardSpeed,damping)); Real mass = physics->getMass(); @@ -2261,7 +2261,7 @@ Bool Locomotor::handleBehaviorZ(Object* obj, PhysicsBehavior *physics, const Coo Real liftToUse = calcLiftToUseAtPt(obj, physics, pos.z, surfaceHt, preferredHeight); - //DEBUG_LOG(("HandleBZ %d LiftToUse %f\n",TheGameLogic->getFrame(),liftToUse)); + //DEBUG_LOG(("HandleBZ %d LiftToUse %f",TheGameLogic->getFrame(),liftToUse)); if (liftToUse != 0.0f) { Coord3D force; @@ -2294,7 +2294,7 @@ Bool Locomotor::handleBehaviorZ(Object* obj, PhysicsBehavior *physics, const Coo Real liftToUse = calcLiftToUseAtPt(obj, physics, pos.z, surfaceHt, preferredHeight); - //DEBUG_LOG(("HandleBZ %d LiftToUse %f\n",TheGameLogic->getFrame(),liftToUse)); + //DEBUG_LOG(("HandleBZ %d LiftToUse %f",TheGameLogic->getFrame(),liftToUse)); if (liftToUse != 0.0f) { Coord3D force; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp index b2aa157e49..e9be58baad 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -2116,12 +2116,12 @@ void Object::onCollide( Object *other, const Coord3D *loc, const Coord3D *normal if( getStatusBits().test( OBJECT_STATUS_NO_COLLISIONS ) ) { #ifdef DEBUG_CRC - //DEBUG_LOG(("Object::onCollide() - OBJECT_STATUS_NO_COLLISIONS set\n")); + //DEBUG_LOG(("Object::onCollide() - OBJECT_STATUS_NO_COLLISIONS set")); #endif break; } #ifdef DEBUG_CRC - //DEBUG_LOG(("Object::onCollide() - calling collide module\n")); + //DEBUG_LOG(("Object::onCollide() - calling collide module")); #endif collide->onCollide(other, loc, normal); } @@ -2424,7 +2424,7 @@ void Object::setLayer(PathfindLayerEnum layer) if (layer!=m_layer) { #define no_SET_LAYER_INTENSE_DEBUG #ifdef SET_LAYER_INTENSE_DEBUG - DEBUG_LOG(("Changing layer from %d to %d\n", m_layer, layer)); + DEBUG_LOG(("Changing layer from %d to %d", m_layer, layer)); if (m_layer != LAYER_GROUND) { if (TheTerrainLogic->objectInteractsWithBridgeLayer(this, m_layer)) { DEBUG_CRASH(("Probably shouldn't be chaging layer. jba.")); @@ -3493,7 +3493,7 @@ void Object::xfer( Xfer *xfer ) xfer->xferObjectID( &id ); setID( id ); - DEBUG_LOG(("Xfer Object %s id=%d\n",getTemplate()->getName().str(),id)); + DEBUG_LOG(("Xfer Object %s id=%d",getTemplate()->getName().str(),id)); if (version >= 7) { @@ -4379,7 +4379,7 @@ void Object::look() m_partitionLastLook->m_forWhom = lookingMask; m_partitionLastLook->m_howFar = getShroudClearingRange(); -// DEBUG_LOG(( "A %s looks at %f, %f for %x at range %f\n", +// DEBUG_LOG(( "A %s looks at %f, %f for %x at range %f", // getTemplate()->getName().str(), // pos.x, // pos.y, @@ -4406,7 +4406,7 @@ void Object::unlook() m_partitionLastLook->m_forWhom ); -// DEBUG_LOG(( "A %s queues an unlook at %f, %f for %x at range %f\n", +// DEBUG_LOG(( "A %s queues an unlook at %f, %f for %x at range %f", // getTemplate()->getName().str(), // m_partitionLastLook.m_where.x, // m_partitionLastLook.m_where.y, @@ -5450,7 +5450,7 @@ AIGroup *Object::getGroup(void) //------------------------------------------------------------------------------------------------- void Object::enterGroup( AIGroup *group ) { -// DEBUG_LOG(("***AIGROUP %x involved in enterGroup on %x\n", group, this)); +// DEBUG_LOG(("***AIGROUP %x involved in enterGroup on %x", group, this)); // if we are in another group, remove ourselves from it first leaveGroup(); @@ -5464,7 +5464,7 @@ void Object::enterGroup( AIGroup *group ) //------------------------------------------------------------------------------------------------- void Object::leaveGroup( void ) { -// DEBUG_LOG(("***AIGROUP %x involved in leaveGroup on %x\n", m_group, this)); +// DEBUG_LOG(("***AIGROUP %x involved in leaveGroup on %x", m_group, this)); // if we are in a group, remove ourselves from it if (m_group) { diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp index 9754e97612..e65ba8b013 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp @@ -999,7 +999,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget if (m_inheritsVeterancy && sourceObj && obj->getExperienceTracker()->isTrainable()) { - DEBUG_LOG(("Object %s inherits veterancy level %d from %s\n", + DEBUG_LOG(("Object %s inherits veterancy level %d from %s", obj->getTemplate()->getName().str(), sourceObj->getVeterancyLevel(), sourceObj->getTemplate()->getName().str())); VeterancyLevel v = sourceObj->getVeterancyLevel(); obj->getExperienceTracker()->setVeterancyLevel(v); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index 60e5c27c15..a2d060a2c6 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -242,10 +242,10 @@ inline Bool filtersAllow(PartitionFilter **filters, Object *objOther) if (DoFilterProfiling && calls > 0 && calls % 1000==0) { - DEBUG_LOG(("\n\n")); + DEBUG_LOG(("\n")); for (idx = 0; idx < maxEver; idx++) { - DEBUG_LOG(("rejections[%s] = %d (useful = %d)\n",names[idx],rejections[idx],usefulRejections[idx])); + DEBUG_LOG(("rejections[%s] = %d (useful = %d)",names[idx],rejections[idx],usefulRejections[idx])); } } @@ -1276,7 +1276,7 @@ void PartitionCell::addLooker(Int playerIndex) CellShroudStatus newShroud = getShroudStatusForPlayer( playerIndex ); -// DEBUG_LOG(( "ADD %d, %d. CS = %d, AS = %d for player %d.\n", +// DEBUG_LOG(( "ADD %d, %d. CS = %d, AS = %d for player %d.", // m_cellX, // m_cellY, // m_shroudLevel[playerIndex].m_currentShroud, @@ -1312,7 +1312,7 @@ void PartitionCell::removeLooker(Int playerIndex) } CellShroudStatus newShroud = getShroudStatusForPlayer( playerIndex ); -// DEBUG_LOG(( "REMOVE %d, %d. CS = %d, AS = %d for player %d.\n", +// DEBUG_LOG(( "REMOVE %d, %d. CS = %d, AS = %d for player %d.", // m_cellX, // m_cellY, // m_shroudLevel[playerIndex].m_currentShroud, @@ -1541,7 +1541,7 @@ void PartitionCell::loadPostProcess( void ) //----------------------------------------------------------------------------- PartitionData::PartitionData() { - //DEBUG_LOG(("create pd %08lx\n",this)); + //DEBUG_LOG(("create pd %08lx",this)); m_next = NULL; m_prev = NULL; m_nextDirty = NULL; @@ -1565,13 +1565,13 @@ PartitionData::PartitionData() //----------------------------------------------------------------------------- PartitionData::~PartitionData() { - //DEBUG_LOG(("toss pd for pd %08lx obj %08lx\n",this,m_object)); + //DEBUG_LOG(("toss pd for pd %08lx obj %08lx",this,m_object)); removeAllTouchedCells(); freeCoiArray(); DEBUG_ASSERTCRASH(ThePartitionManager, ("ThePartitionManager is null")); if (ThePartitionManager && ThePartitionManager->isInListDirtyModules(this)) { - //DEBUG_LOG(("remove pd %08lx from dirty list (%08lx %08lx)\n",this,m_prevDirty,m_nextDirty)); + //DEBUG_LOG(("remove pd %08lx from dirty list (%08lx %08lx)",this,m_prevDirty,m_nextDirty)); ThePartitionManager->removeFromDirtyModules(this); //DEBUG_ASSERTCRASH(!ThePartitionManager->isInListDirtyModules(this), ("hmm\n")); } @@ -1934,7 +1934,7 @@ void PartitionData::addPossibleCollisions(PartitionContactList *ctList) } #endif - //DEBUG_LOG(("adding possible collision for %s\n",getObject()->getTemplate()->getName().str())); + //DEBUG_LOG(("adding possible collision for %s",getObject()->getTemplate()->getName().str())); CellAndObjectIntersection *myCoi = m_coiArray; for (Int i = m_coiInUseCount; i > 0; --i, ++myCoi) @@ -2201,7 +2201,7 @@ theObjName = obj->getTemplate()->getName(); //----------------------------------------------------------------------------- void PartitionData::makeDirty(Bool needToUpdateCells) { - //DEBUG_LOG(("makeDirty for pd %08lx obj %08lx\n",this,m_object)); + //DEBUG_LOG(("makeDirty for pd %08lx obj %08lx",this,m_object)); if (!ThePartitionManager->isInListDirtyModules(this)) { if (needToUpdateCells) @@ -2263,7 +2263,7 @@ void PartitionData::attachToObject(Object* object) m_ghostObject = TheGhostObjectManager->addGhostObject(object, this); } - //DEBUG_LOG(("attach pd for pd %08lx obj %08lx\n",this,m_object)); + //DEBUG_LOG(("attach pd for pd %08lx obj %08lx",this,m_object)); // (re)calc maxCoi and (re)alloc cois DEBUG_ASSERTCRASH(m_coiArrayCount == 0 && m_coiArray == NULL, ("hmm, coi should probably be null here")); @@ -2294,7 +2294,7 @@ void PartitionData::detachFromObject() removeAllTouchedCells(); freeCoiArray(); - //DEBUG_LOG(("detach pd for pd %08lx obj %08lx\n",this,m_object)); + //DEBUG_LOG(("detach pd for pd %08lx obj %08lx",this,m_object)); // no longer attached to object m_object = NULL; @@ -2340,7 +2340,7 @@ void PartitionData::detachFromGhostObject(void) removeAllTouchedCells(); freeCoiArray(); - //DEBUG_LOG(("detach pd for pd %08lx obj %08lx\n",this,m_object)); + //DEBUG_LOG(("detach pd for pd %08lx obj %08lx",this,m_object)); // no longer attached to object m_object = NULL; @@ -2418,7 +2418,7 @@ for (PartitionContactListNode *cd2 = m_contactHash[ hashValue ]; cd2; cd2 = cd2- } if (depth > 3) { - DEBUG_LOG(("depth is %d for %s %08lx (%d) - %s %08lx (%d)\n", + DEBUG_LOG(("depth is %d for %s %08lx (%d) - %s %08lx (%d)", depth,obj_obj->getTemplate()->getName().str(),obj_obj,obj_obj->getID(), other_obj->getTemplate()->getName().str(),other_obj,other_obj->getID() )); @@ -2429,7 +2429,7 @@ if (depth > 3) //hashValue %= PartitionContactList_SOCKET_COUNT; - DEBUG_LOG(("ENTRY: %s %08lx (%d) - %s %08lx (%d) [rawhash %d]\n", + DEBUG_LOG(("ENTRY: %s %08lx (%d) - %s %08lx (%d) [rawhash %d]", cd2->m_obj->getObject()->getTemplate()->getName().str(),cd2->m_obj->getObject(),cd2->m_obj->getObject()->getID(), cd2->m_other->getObject()->getTemplate()->getName().str(),cd2->m_other->getObject(),cd2->m_other->getObject()->getID(), rawhash)); @@ -2535,12 +2535,12 @@ void PartitionContactList::processContactList() // if (!obj->isDestroyed() && obj->friend_getPartitionData() != NULL && !obj->isKindOf(KINDOF_IMMOBILE)) { -//DEBUG_LOG(("%d: re-dirtying collision of %s %08lx with %s %08lx\n",TheGameLogic->getFrame(),obj->getTemplate()->getName().str(),obj,other->getTemplate()->getName().str(),other)); +//DEBUG_LOG(("%d: re-dirtying collision of %s %08lx with %s %08lx",TheGameLogic->getFrame(),obj->getTemplate()->getName().str(),obj,other->getTemplate()->getName().str(),other)); obj->friend_getPartitionData()->makeDirty(false); } if (!other->isDestroyed() && other->friend_getPartitionData() != NULL && !other->isKindOf(KINDOF_IMMOBILE)) { -//DEBUG_LOG(("%d: re-dirtying collision of %s %08lx with %s %08lx [other]\n",TheGameLogic->getFrame(),other->getTemplate()->getName().str(),other,obj->getTemplate()->getName().str(),obj)); +//DEBUG_LOG(("%d: re-dirtying collision of %s %08lx with %s %08lx [other]",TheGameLogic->getFrame(),other->getTemplate()->getName().str(),other,obj->getTemplate()->getName().str(),obj)); other->friend_getPartitionData()->makeDirty(false); } } @@ -2851,7 +2851,7 @@ void PartitionManager::registerObject( Object* object ) // if object is already part of this system get out of here if( object->friend_getPartitionData() != NULL ) { - DEBUG_LOG(( "Object '%s' already registered with partition manager\n", + DEBUG_LOG(( "Object '%s' already registered with partition manager", object->getTemplate()->getName().str() )); return; } // end if @@ -2926,7 +2926,7 @@ void PartitionManager::registerGhostObject( GhostObject* object) // if object is already part of this system get out of here if( object->friend_getPartitionData() != NULL ) { - DEBUG_LOG(( "GhostObject already registered with partition manager\n")); + DEBUG_LOG(( "GhostObject already registered with partition manager")); return; } // end if @@ -3172,7 +3172,7 @@ void PartitionManager::calcRadiusVec() for (Int i = 0; i <= m_maxGcoRadius; ++i) { total += m_radiusVec[i].size(); - //DEBUG_LOG(("radius %d has %d entries\n",i,m_radiusVec[i].size())); + //DEBUG_LOG(("radius %d has %d entries",i,m_radiusVec[i].size())); } DEBUG_ASSERTCRASH(total == (cx*2-1)*(cy*2-1),("expected %d, got %d\n",(cx*2-1)*(cy*2-1),total)); #endif @@ -4539,7 +4539,7 @@ Bool PartitionManager::isClearLineOfSightTerrain(const Object* obj, const Coord3 const Real LOS_FUDGE = 0.5f; if (terrainAtHighPoint > lineOfSightAtHighPoint + LOS_FUDGE) { - //DEBUG_LOG(("isClearLineOfSightTerrain fails\n")); + //DEBUG_LOG(("isClearLineOfSightTerrain fails")); return false; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/SimpleObjectIterator.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/SimpleObjectIterator.cpp index 74d5e629c6..c75d29f3f8 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/SimpleObjectIterator.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/SimpleObjectIterator.cpp @@ -134,10 +134,10 @@ void SimpleObjectIterator::sort(IterOrderType order) #ifdef INTENSE_DEBUG { - DEBUG_LOG(("\n\n---------- BEFORE sort for %d -----------\n",order)); + DEBUG_LOG(("\n\n---------- BEFORE sort for %d -----------",order)); for (Clump *p = m_firstClump; p; p = p->m_nextClump) { - DEBUG_LOG((" obj %08lx numeric %f\n",p->m_obj,p->m_numeric)); + DEBUG_LOG((" obj %08lx numeric %f",p->m_obj,p->m_numeric)); } } #endif @@ -233,10 +233,10 @@ void SimpleObjectIterator::sort(IterOrderType order) #ifdef INTENSE_DEBUG { - DEBUG_LOG(("\n\n---------- sort for %d -----------\n",order)); + DEBUG_LOG(("\n\n---------- sort for %d -----------",order)); for (Clump *p = m_firstClump; p; p = p->m_nextClump) { - DEBUG_LOG((" obj %08lx numeric %f\n",p->m_obj,p->m_numeric)); + DEBUG_LOG((" obj %08lx numeric %f",p->m_obj,p->m_numeric)); } } #endif diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 6d13862846..e77e36b21c 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -394,7 +394,7 @@ void AIUpdateInterface::doPathfind( PathfindServicesInterface *pathfinder ) if (!m_waitingForPath) { return; } - //CRCDEBUG_LOG(("AIUpdateInterface::doPathfind() for object %d\n", getObject()->getID())); + //CRCDEBUG_LOG(("AIUpdateInterface::doPathfind() for object %d", getObject()->getID())); m_waitingForPath = FALSE; if (m_isSafePath) { destroyPath(); @@ -438,11 +438,11 @@ void AIUpdateInterface::doPathfind( PathfindServicesInterface *pathfinder ) TheAI->pathfinder()->updateGoal(getObject(), getPath()->getLastNode()->getPosition(), getPath()->getLastNode()->getLayer()); } - //CRCDEBUG_LOG(("AIUpdateInterface::doPathfind() - m_isAttackPath = TRUE after computeAttackPath\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::doPathfind() - m_isAttackPath = TRUE after computeAttackPath")); m_isAttackPath = TRUE; return; } - //CRCDEBUG_LOG(("AIUpdateInterface::doPathfind() - m_isAttackPath = FALSE after computeAttackPath()\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::doPathfind() - m_isAttackPath = FALSE after computeAttackPath()")); m_isAttackPath = FALSE; if (victim) { m_requestedDestination = *victim->getPosition(); @@ -479,10 +479,10 @@ void AIUpdateInterface::requestPath( Coord3D *destination, Bool isFinalGoal ) DEBUG_CRASH(("Attempting to path immobile unit.")); } - //DEBUG_LOG(("Request Frame %d, obj %s %x\n", TheGameLogic->getFrame(), getObject()->getTemplate()->getName().str(), getObject())); + //DEBUG_LOG(("Request Frame %d, obj %s %x", TheGameLogic->getFrame(), getObject()->getTemplate()->getName().str(), getObject())); m_requestedDestination = *destination; m_isFinalGoal = isFinalGoal; - CRCDEBUG_LOG(("AIUpdateInterface::requestPath() - m_isAttackPath = FALSE for object %d\n", getObject()->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::requestPath() - m_isAttackPath = FALSE for object %d", getObject()->getID())); m_isAttackPath = FALSE; m_requestedVictimID = INVALID_ID; m_isApproachPath = FALSE; @@ -494,12 +494,12 @@ void AIUpdateInterface::requestPath( Coord3D *destination, Bool isFinalGoal ) m_waitingForPath = TRUE; if (m_pathTimestamp > TheGameLogic->getFrame()-3) { /* Requesting path very quickly. Can cause a spin. */ - //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 1 second\n", + //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 1 second", //TheGameLogic->getFrame())); setQueueForPathTime(LOGICFRAMES_PER_SECOND); // See if it has been too soon. // jba intense debug - //DEBUG_LOG(("Info - RePathing very quickly %d, %d.\n", m_pathTimestamp, TheGameLogic->getFrame())); + //DEBUG_LOG(("Info - RePathing very quickly %d, %d.", m_pathTimestamp, TheGameLogic->getFrame())); if (m_path && m_isBlockedAndStuck) { setIgnoreCollisionTime(2*LOGICFRAMES_PER_SECOND); m_blockedFrames = 0; @@ -518,7 +518,7 @@ void AIUpdateInterface::requestAttackPath( ObjectID victimID, const Coord3D* vic if (m_locomotorSet.getValidSurfaces() == 0) { DEBUG_CRASH(("Attempting to path immobile unit.")); } - CRCDEBUG_LOG(("AIUpdateInterface::requestAttackPath() - m_isAttackPath = TRUE for object %d\n", getObject()->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::requestAttackPath() - m_isAttackPath = TRUE for object %d", getObject()->getID())); m_requestedDestination = *victimPos; m_requestedVictimID = victimID; m_isAttackPath = TRUE; @@ -527,7 +527,7 @@ void AIUpdateInterface::requestAttackPath( ObjectID victimID, const Coord3D* vic m_waitingForPath = TRUE; if (m_pathTimestamp > TheGameLogic->getFrame()-3) { /* Requesting path very quickly. Can cause a spin. */ - //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 2 second\n",TheGameLogic->getFrame())); + //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 2 second",TheGameLogic->getFrame())); setQueueForPathTime(2*LOGICFRAMES_PER_SECOND); return; } @@ -542,7 +542,7 @@ void AIUpdateInterface::requestApproachPath( Coord3D *destination ) } m_requestedDestination = *destination; m_isFinalGoal = TRUE; - CRCDEBUG_LOG(("AIUpdateInterface::requestApproachPath() - m_isAttackPath = FALSE for object %d\n", getObject()->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::requestApproachPath() - m_isAttackPath = FALSE for object %d", getObject()->getID())); m_isAttackPath = FALSE; m_requestedVictimID = INVALID_ID; m_isApproachPath = TRUE; @@ -550,7 +550,7 @@ void AIUpdateInterface::requestApproachPath( Coord3D *destination ) m_waitingForPath = TRUE; if (m_pathTimestamp > TheGameLogic->getFrame()-3) { /* Requesting path very quickly. Can cause a spin. */ - //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 2 second\n",TheGameLogic->getFrame())); + //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 2 second",TheGameLogic->getFrame())); setQueueForPathTime(2*LOGICFRAMES_PER_SECOND); return; } @@ -566,7 +566,7 @@ void AIUpdateInterface::requestSafePath( ObjectID repulsor ) } m_repulsor1 = repulsor; m_isFinalGoal = FALSE; - CRCDEBUG_LOG(("AIUpdateInterface::requestSafePath() - m_isAttackPath = FALSE for object %d\n", getObject()->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::requestSafePath() - m_isAttackPath = FALSE for object %d", getObject()->getID())); m_isAttackPath = FALSE; m_requestedVictimID = INVALID_ID; m_isApproachPath = FALSE; @@ -574,7 +574,7 @@ void AIUpdateInterface::requestSafePath( ObjectID repulsor ) m_waitingForPath = TRUE; if (m_pathTimestamp > TheGameLogic->getFrame()-3) { /* Requesting path very quickly. Can cause a spin. */ - //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 2 second\n",TheGameLogic->getFrame())); + //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 2 second",TheGameLogic->getFrame())); setQueueForPathTime(2*LOGICFRAMES_PER_SECOND); return; } @@ -997,7 +997,7 @@ void AIUpdateInterface::friend_notifyStateMachineChanged() DECLARE_PERF_TIMER(AIUpdateInterface_update) UpdateSleepTime AIUpdateInterface::update( void ) { - //DEBUG_LOG(("AIUpdateInterface frame %d: %08lx\n",TheGameLogic->getFrame(),getObject())); + //DEBUG_LOG(("AIUpdateInterface frame %d: %08lx",TheGameLogic->getFrame(),getObject())); USE_PERF_TIMER(AIUpdateInterface_update) @@ -1344,7 +1344,7 @@ Bool AIUpdateInterface::blockedBy(Object *other) Real collisionAngle = ThePartitionManager->getRelativeAngle2D( obj, &otherPos ); Real otherAngle = ThePartitionManager->getRelativeAngle2D( other, &pos ); - //DEBUG_LOG(("Collision angle %.2f, %.2f, %s, %x %s\n", collisionAngle*180/PI, otherAngle*180/PI, obj->getTemplate()->getName().str(), obj, other->getTemplate()->getName().str())); + //DEBUG_LOG(("Collision angle %.2f, %.2f, %s, %x %s", collisionAngle*180/PI, otherAngle*180/PI, obj->getTemplate()->getName().str(), obj, other->getTemplate()->getName().str())); Real angleLimit = PI/4; // 45 degrees. if (collisionAngle>PI/2 || collisionAngle<-PI/2) { return FALSE; // we're moving away. @@ -1364,7 +1364,7 @@ Bool AIUpdateInterface::blockedBy(Object *other) return FALSE; } } else { - //DEBUG_LOG(("Moving Away From EachOther\n")); + //DEBUG_LOG(("Moving Away From EachOther")); return FALSE; // moving away, so no need for corrective action. } } else { @@ -1395,7 +1395,7 @@ Bool AIUpdateInterface::needToRotate(void) if (getPath()) { ClosestPointOnPathInfo info; - CRCDEBUG_LOG(("AIUpdateInterface::needToRotate() - calling computePointOnPath() for object %d\n", getObject()->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::needToRotate() - calling computePointOnPath() for object %d", getObject()->getID())); getPath()->computePointOnPath(getObject(), m_locomotorSet, *getObject()->getPosition(), info); deltaAngle = ThePartitionManager->getRelativeAngle2D( getObject(), &info.posOnPath ); } @@ -1480,7 +1480,7 @@ Bool AIUpdateInterface::processCollision(PhysicsBehavior *physics, Object *other #endif } - //DEBUG_LOG(("Blocked %s, %x, %s\n", getObject()->getTemplate()->getName().str(), getObject(), other->getTemplate()->getName().str())); + //DEBUG_LOG(("Blocked %s, %x, %s", getObject()->getTemplate()->getName().str(), getObject(), other->getTemplate()->getName().str())); if (m_blockedFrames==0) m_blockedFrames = 1; if (!needToRotate()) { @@ -1488,7 +1488,7 @@ Bool AIUpdateInterface::processCollision(PhysicsBehavior *physics, Object *other if (!otherMoving) { // Intense logging jba - // DEBUG_LOG(("Blocked&Stuck !otherMoving\n")); + // DEBUG_LOG(("Blocked&Stuck !otherMoving")); m_isBlockedAndStuck = TRUE; return FALSE; } @@ -1505,7 +1505,7 @@ Bool AIUpdateInterface::processCollision(PhysicsBehavior *physics, Object *other aiMoveAwayFromUnit(aiOther->getObject(), CMD_FROM_AI); //m_isBlockedAndStuck = TRUE; // Intense logging jba. - // DEBUG_LOG(("Blocked&Stuck other is blockedByUs, has higher priority\n")); + // DEBUG_LOG(("Blocked&Stuck other is blockedByUs, has higher priority")); } } } @@ -1545,7 +1545,7 @@ Bool AIUpdateInterface::processCollision(PhysicsBehavior *physics, Object *other return false; // we are doing a special ability. Shouldn't move at this time. jba. } // jba intense debug - //DEBUG_LOG(("*****Units ended up on top of each other. Shouldn't happen.\n")); + //DEBUG_LOG(("*****Units ended up on top of each other. Shouldn't happen.")); if (isIdle()) { Coord3D safePosition = *getObject()->getPosition(); @@ -1762,12 +1762,12 @@ Bool AIUpdateInterface::computePath( PathfindServicesInterface *pathServices, Co */ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServices, const Object *victim, const Coord3D* victimPos ) { - //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() for object %d\n", getObject()->getID())); + //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() for object %d", getObject()->getID())); // See if it has been too soon. if (m_pathTimestamp >= TheGameLogic->getFrame()-2) { // jba intense debug - //CRCDEBUG_LOG(("Info - RePathing very quickly %d, %d.\n", m_pathTimestamp, TheGameLogic->getFrame())); + //CRCDEBUG_LOG(("Info - RePathing very quickly %d, %d.", m_pathTimestamp, TheGameLogic->getFrame())); if (m_path && m_isBlockedAndStuck) { setIgnoreCollisionTime(2*LOGICFRAMES_PER_SECOND); @@ -1788,7 +1788,7 @@ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServic Object* source = getObject(); if (!victim && !victimPos) { - //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() - victim is NULL\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() - victim is NULL")); return FALSE; } @@ -1818,7 +1818,7 @@ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServic if (!viewBlocked) { destroyPath(); - //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() - target is in range and visible\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() - target is in range and visible")); return TRUE; } @@ -1835,7 +1835,7 @@ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServic } if (!viewBlocked) { destroyPath(); - //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() target pos is in range and visible\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() target pos is in range and visible")); return TRUE; } } @@ -1870,7 +1870,7 @@ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServic destroyPath(); return false; } - //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() is contact weapon\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() is contact weapon")); return ok; } @@ -1964,7 +1964,7 @@ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServic m_blockedFrames = 0; m_isBlockedAndStuck = FALSE; - //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() done\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() done")); if (m_path) return TRUE; @@ -1983,7 +1983,7 @@ void AIUpdateInterface::destroyPath( void ) m_path = NULL; m_waitingForPath = FALSE; // we no longer need it. - //CRCDEBUG_LOG(("AIUpdateInterface::destroyPath() - m_isAttackPath = FALSE for object %d\n", getObject()->getID())); + //CRCDEBUG_LOG(("AIUpdateInterface::destroyPath() - m_isAttackPath = FALSE for object %d", getObject()->getID())); m_isAttackPath = FALSE; setLocomotorGoalNone(); } @@ -2137,9 +2137,9 @@ UpdateSleepTime AIUpdateInterface::doLocomotor( void ) { return UPDATE_SLEEP_FOREVER; // Can't move till we get our path. } - DEBUG_LOG(("Dead %d, obj %s %x\n", isAiInDeadState(), getObject()->getTemplate()->getName().str(), getObject())); + DEBUG_LOG(("Dead %d, obj %s %x", isAiInDeadState(), getObject()->getTemplate()->getName().str(), getObject())); #ifdef STATE_MACHINE_DEBUG - DEBUG_LOG(("Waiting %d, state %s\n", m_waitingForPath, getStateMachine()->getCurrentStateName().str())); + DEBUG_LOG(("Waiting %d, state %s", m_waitingForPath, getStateMachine()->getCurrentStateName().str())); m_stateMachine->setDebugOutput(1); #endif DEBUG_CRASH(("must have a path here (doLocomotor)")); @@ -2157,7 +2157,7 @@ UpdateSleepTime AIUpdateInterface::doLocomotor( void ) // Compute the actual goal position along the path to move towards. Consider // obstacles, and follow the intermediate path points. ClosestPointOnPathInfo info; - CRCDEBUG_LOG(("AIUpdateInterface::doLocomotor() - calling computePointOnPath() for %s\n", + CRCDEBUG_LOG(("AIUpdateInterface::doLocomotor() - calling computePointOnPath() for %s", DebugDescribeObject(getObject()).str())); getPath()->computePointOnPath(getObject(), m_locomotorSet, *getObject()->getPosition(), info); onPathDistToGoal = info.distAlongPath; @@ -2412,7 +2412,7 @@ Real AIUpdateInterface::getLocomotorDistanceToGoal() } else if (!m_curLocomotor) { - //DEBUG_LOG(("no locomotor here, so no dist. (this is ok.)\n")); + //DEBUG_LOG(("no locomotor here, so no dist. (this is ok.)")); return 0.0f; } else if( m_curLocomotor->isCloseEnoughDist3D() || getObject()->isKindOf(KINDOF_PROJECTILE)) @@ -2437,7 +2437,7 @@ Real AIUpdateInterface::getLocomotorDistanceToGoal() } else { // Ground based locomotor. ClosestPointOnPathInfo info; - CRCDEBUG_LOG(("AIUpdateInterface::getLocomotorDistanceToGoal() - calling computePointOnPath() for object %d\n", getObject()->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::getLocomotorDistanceToGoal() - calling computePointOnPath() for object %d", getObject()->getID())); getPath()->computePointOnPath(getObject(), m_locomotorSet, *getObject()->getPosition(), info); goalPos = info.posOnPath; dist = info.distAlongPath; @@ -4398,7 +4398,7 @@ Object* AIUpdateInterface::getNextMoodTarget( Bool calledByAI, Bool calledDuring Object *newVictim = TheAI->findClosestEnemy(obj, rangeToFindWithin, flags, getAttackInfo()); /* -DEBUG_LOG(("GNMT frame %d: %s %08lx (con %s %08lx) uses range %f, flags %08lx, %s finds %s %08lx\n", +DEBUG_LOG(("GNMT frame %d: %s %08lx (con %s %08lx) uses range %f, flags %08lx, %s finds %s %08lx", now, obj->getTemplate()->getName().str(), obj, @@ -4414,7 +4414,7 @@ DEBUG_LOG(("GNMT frame %d: %s %08lx (con %s %08lx) uses range %f, flags %08lx, % if (newVictim) { - CRCDEBUG_LOG(("AIUpdateInterface::getNextMoodTarget() - %d is attacking %d\n", obj->getID(), newVictim->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::getNextMoodTarget() - %d is attacking %d", obj->getID(), newVictim->getID())); /* srj debug hack. ignore. Int ot = getTmpValue(); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp index ce0f37b474..80c52aabb6 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp @@ -377,7 +377,7 @@ Bool DeliverPayloadAIUpdate::isCloseEnoughToTarget() if ( inBound ) allowedDistanceSqr = sqr(getAllowedDistanceToTarget() + getPreOpenDistance()); - //DEBUG_LOG(("Dist to target is %f (allowed %f)\n",sqrt(currentDistanceSqr),sqrt(allowedDistanceSqr))); + //DEBUG_LOG(("Dist to target is %f (allowed %f)",sqrt(currentDistanceSqr),sqrt(allowedDistanceSqr))); if ( allowedDistanceSqr > currentDistanceSqr ) @@ -939,10 +939,10 @@ StateReturnType ConsiderNewApproachState::onEnter() // Increment local counter o ++m_numberEntriesToState; - DEBUG_LOG(("Considering approach #%d...\n",m_numberEntriesToState)); + DEBUG_LOG(("Considering approach #%d...",m_numberEntriesToState)); if( m_numberEntriesToState > ai->getMaxNumberAttempts() ) { - DEBUG_LOG(("Too many approaches! Time to give up.\n")); + DEBUG_LOG(("Too many approaches! Time to give up.")); return STATE_FAILURE; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp index b740995117..cdf6b0cb88 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp @@ -318,7 +318,7 @@ Bool MissileAIUpdate::projectileHandleCollision( Object *other ) // if it's not the specific thing we were targeting, see if we should incidentally collide... if (!m_detonationWeaponTmpl->shouldProjectileCollideWith(projectileLauncher, obj, other, m_victimID)) { - //DEBUG_LOG(("ignoring projectile collision with %s at frame %d\n",other->getTemplate()->getName().str(),TheGameLogic->getFrame())); + //DEBUG_LOG(("ignoring projectile collision with %s at frame %d",other->getTemplate()->getName().str(),TheGameLogic->getFrame())); return true; } @@ -338,7 +338,7 @@ Bool MissileAIUpdate::projectileHandleCollision( Object *other ) Object* thingToKill = *it++; if (!thingToKill->isEffectivelyDead() && thingToKill->isKindOfMulti(d->m_garrisonHitKillKindof, d->m_garrisonHitKillKindofNot)) { - //DEBUG_LOG(("Killed a garrisoned unit (%08lx %s) via Flash-Bang!\n",thingToKill,thingToKill->getTemplate()->getName().str())); + //DEBUG_LOG(("Killed a garrisoned unit (%08lx %s) via Flash-Bang!",thingToKill,thingToKill->getTemplate()->getName().str())); if (projectileLauncher) projectileLauncher->scoreTheKill( thingToKill ); thingToKill->kill(); @@ -581,7 +581,7 @@ void MissileAIUpdate::doKillState(void) closeEnough = curLoco->getMaxSpeedForCondition(BODY_PRISTINE); } Real distanceToTargetSq = ThePartitionManager->getDistanceSquared( getObject(), getGoalObject(), FROM_CENTER_3D); - //DEBUG_LOG(("Distance to target %f, closeEnough %f\n", sqrt(distanceToTargetSq), closeEnough)); + //DEBUG_LOG(("Distance to target %f, closeEnough %f", sqrt(distanceToTargetSq), closeEnough)); if (distanceToTargetSq < closeEnough*closeEnough) { Coord3D pos = *getGoalObject()->getPosition(); getObject()->setPosition(&pos); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp index 6064adfd4d..89513f9924 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp @@ -952,7 +952,7 @@ void RailroadBehavior::createCarriages( void ) else // or else let's use the defualt template list prvided in the INI { firstCarriage = TheThingFactory->newObject( temp, self->getTeam() ); - DEBUG_LOG(("%s Added a carriage, %s \n", self->getTemplate()->getName().str(),firstCarriage->getTemplate()->getName().str())); + DEBUG_LOG(("%s Added a carriage, %s ", self->getTemplate()->getName().str(),firstCarriage->getTemplate()->getName().str())); } if ( firstCarriage ) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp index f50cf213c0..a986eb24b4 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp @@ -95,7 +95,7 @@ Bool SupplyWarehouseDockUpdate::action( Object* docker, Object *drone ) Real closeEnoughSqr = sqr(docker->getGeometryInfo().getBoundingCircleRadius()*2); Real curDistSqr = ThePartitionManager->getDistanceSquared(docker, getObject(), FROM_BOUNDINGSPHERE_2D); if (curDistSqr > closeEnoughSqr) { - DEBUG_LOG(("Failing dock, dist %f, not close enough(%f).\n", sqrt(curDistSqr), sqrt(closeEnoughSqr))); + DEBUG_LOG(("Failing dock, dist %f, not close enough(%f).", sqrt(curDistSqr), sqrt(closeEnoughSqr))); // Make it twitch a little. Coord3D newPos = *docker->getPosition(); Real range = 0.4*PATHFIND_CELL_SIZE_F; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/MissileLauncherBuildingUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/MissileLauncherBuildingUpdate.cpp index 68f8a36261..1a448d7307 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/MissileLauncherBuildingUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/MissileLauncherBuildingUpdate.cpp @@ -73,7 +73,7 @@ void MissileLauncherBuildingUpdate::switchToState(DoorStateType dst) switch (dst) { case DOOR_CLOSED: - DEBUG_LOG(("switch to state DOOR_CLOSED at %d\n",now)); + DEBUG_LOG(("switch to state DOOR_CLOSED at %d",now)); /// @todo srj -- for now, this assumes at most one door clr.set(MODELCONDITION_DOOR_1_WAITING_TO_CLOSE); clr.set(MODELCONDITION_DOOR_1_CLOSING); @@ -93,7 +93,7 @@ void MissileLauncherBuildingUpdate::switchToState(DoorStateType dst) break; case DOOR_OPENING: - DEBUG_LOG(("switch to state DOOR_OPENING at %d\n",now)); + DEBUG_LOG(("switch to state DOOR_OPENING at %d",now)); /// @todo srj -- for now, this assumes at most one door clr.set(MODELCONDITION_DOOR_1_WAITING_TO_CLOSE); clr.set(MODELCONDITION_DOOR_1_CLOSING); @@ -115,7 +115,7 @@ void MissileLauncherBuildingUpdate::switchToState(DoorStateType dst) break; case DOOR_OPEN: - DEBUG_LOG(("switch to state DOOR_OPEN at %d\n",now)); + DEBUG_LOG(("switch to state DOOR_OPEN at %d",now)); /// @todo srj -- for now, this assumes at most one door clr.set(MODELCONDITION_DOOR_1_WAITING_TO_CLOSE); clr.set(MODELCONDITION_DOOR_1_CLOSING); @@ -135,7 +135,7 @@ void MissileLauncherBuildingUpdate::switchToState(DoorStateType dst) break; case DOOR_WAITING_TO_CLOSE: - DEBUG_LOG(("switch to state DOOR_WAITING_TO_CLOSE at %d\n",now)); + DEBUG_LOG(("switch to state DOOR_WAITING_TO_CLOSE at %d",now)); /// @todo srj -- for now, this assumes at most one door clr.set(MODELCONDITION_DOOR_1_CLOSING); clr.set(MODELCONDITION_DOOR_1_OPENING); @@ -155,7 +155,7 @@ void MissileLauncherBuildingUpdate::switchToState(DoorStateType dst) break; case DOOR_CLOSING: - DEBUG_LOG(("switch to state DOOR_CLOSING at %d\n",now)); + DEBUG_LOG(("switch to state DOOR_CLOSING at %d",now)); /// @todo srj -- for now, this assumes at most one door clr.set(MODELCONDITION_DOOR_1_WAITING_TO_CLOSE); clr.set(MODELCONDITION_DOOR_1_WAITING_OPEN); @@ -252,7 +252,7 @@ UpdateSleepTime MissileLauncherBuildingUpdate::update( void ) if (m_doorState != DOOR_OPEN && m_specialPowerModule->isReady()) { - DEBUG_LOG(("*** had to POP the door open!\n")); + DEBUG_LOG(("*** had to POP the door open!")); switchToState(DOOR_OPEN); } else if (m_doorState == DOOR_CLOSED && now >= whenToStartOpening) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp index 6160db52fa..a8903cfdbe 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp @@ -417,9 +417,9 @@ void NeutronMissileUpdate::doAttack( void ) pos.y += m_vel.y; pos.z += m_vel.z; -//DEBUG_LOG(("vel %f accel %f z %f\n",m_vel.length(),m_accel.length(), pos.z)); +//DEBUG_LOG(("vel %f accel %f z %f",m_vel.length(),m_accel.length(), pos.z)); //Real vm = sqrt(m_vel.x*m_vel.x+m_vel.y*m_vel.y+m_vel.z*m_vel.z); -//DEBUG_LOG(("vel is %f %f %f (%f)\n",m_vel.x,m_vel.y,m_vel.z,vm)); +//DEBUG_LOG(("vel is %f %f %f (%f)",m_vel.x,m_vel.y,m_vel.z,vm)); getObject()->setTransformMatrix( &mx ); getObject()->setPosition( &pos ); @@ -513,7 +513,7 @@ UpdateSleepTime NeutronMissileUpdate::update( void ) { Coord3D newPos = *getObject()->getPosition(); Real distThisTurn = sqrt(sqr(newPos.x-oldPos.x) + sqr(newPos.y-oldPos.y) + sqr(newPos.z-oldPos.z)); - //DEBUG_LOG(("noTurnDist goes from %f to %f\n",m_noTurnDistLeft,m_noTurnDistLeft-distThisTurn)); + //DEBUG_LOG(("noTurnDist goes from %f to %f",m_noTurnDistLeft,m_noTurnDistLeft-distThisTurn)); m_noTurnDistLeft -= distThisTurn; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp index 46b7813894..11511da60b 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp @@ -754,7 +754,7 @@ UpdateSleepTime PhysicsBehavior::update() damageInfo.in.m_sourceID = obj->getID(); damageInfo.in.m_amount = damageAmt; obj->attemptDamage( &damageInfo ); - //DEBUG_LOG(("Dealing %f (%f %f) points of falling damage to %s!\n",damageAmt,damageInfo.out.m_actualDamageDealt, damageInfo.out.m_actualDamageClipped,obj->getTemplate()->getName().str())); + //DEBUG_LOG(("Dealing %f (%f %f) points of falling damage to %s!",damageAmt,damageInfo.out.m_actualDamageDealt, damageInfo.out.m_actualDamageClipped,obj->getTemplate()->getName().str())); // if this killed us, add SPLATTED to get a cool death. if (obj->isEffectivelyDead()) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp index a16be816e9..f11220b8ba 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp @@ -303,7 +303,7 @@ static void buildNonDupRandomIndexList(Int range, Int count, Int idxList[]) //------------------------------------------------------------------------------------------------- void StructureCollapseUpdate::doPhaseStuff(StructureCollapsePhaseType scphase, const Coord3D *target) { - DEBUG_LOG(("Firing phase %d on frame %d\n", scphase, TheGameLogic->getFrame())); + DEBUG_LOG(("Firing phase %d on frame %d", scphase, TheGameLogic->getFrame())); const StructureCollapseUpdateModuleData* d = getStructureCollapseUpdateModuleData(); Int i, idx, count, listSize; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp index 1a2e03c2a7..701c414c05 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp @@ -236,9 +236,9 @@ UpdateSleepTime StructureToppleUpdate::update( void ) if (m_toppleState == TOPPLESTATE_TOPPLING) { UnsignedInt now = TheGameLogic->getFrame(); Real toppleAcceleration = TOPPLE_ACCELERATION_FACTOR * (Sin(m_accumulatedAngle) * (1.0 - m_structuralIntegrity)); -// DEBUG_LOG(("toppleAcceleration = %f\n", toppleAcceleration)); +// DEBUG_LOG(("toppleAcceleration = %f", toppleAcceleration)); m_toppleVelocity += toppleAcceleration; -// DEBUG_LOG(("m_toppleVelocity = %f\n", m_toppleVelocity)); +// DEBUG_LOG(("m_toppleVelocity = %f", m_toppleVelocity)); // doesn't make sense to have a structural integrity less than zero. if (m_structuralIntegrity > 0.0f) { @@ -247,7 +247,7 @@ UpdateSleepTime StructureToppleUpdate::update( void ) m_structuralIntegrity = 0.0f; } } -// DEBUG_LOG(("m_structuralIntegrity = %f\n\n", m_structuralIntegrity)); +// DEBUG_LOG(("m_structuralIntegrity = %f\n", m_structuralIntegrity)); doAngleFX(m_accumulatedAngle, m_accumulatedAngle + m_toppleVelocity); @@ -478,7 +478,7 @@ void StructureToppleUpdate::doToppleDelayBurstFX() const StructureToppleUpdateModuleData *d = getStructureToppleUpdateModuleData(); const DamageInfo *lastDamageInfo = getObject()->getBodyModule()->getLastDamageInfo(); - DEBUG_LOG(("Doing topple delay burst on frame %d\n", TheGameLogic->getFrame())); + DEBUG_LOG(("Doing topple delay burst on frame %d", TheGameLogic->getFrame())); if( lastDamageInfo == NULL || getDamageTypeFlag( d->m_damageFXTypes, lastDamageInfo->in.m_damageType ) ) FXList::doFXPos(d->m_toppleDelayFXList, &m_delayBurstLocation); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ToppleUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ToppleUpdate.cpp index f3a05875d8..1295a293f7 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ToppleUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ToppleUpdate.cpp @@ -145,7 +145,7 @@ void ToppleUpdate::applyTopplingForce( const Coord3D* toppleDirection, Real topp if (getObject()->isEffectivelyDead()) return; - //DEBUG_LOG(("awaking ToppleUpdate %08lx\n",this)); + //DEBUG_LOG(("awaking ToppleUpdate %08lx",this)); setWakeFrame(getObject(), UPDATE_SLEEP_NONE); const ToppleUpdateModuleData* d = getToppleUpdateModuleData(); @@ -267,7 +267,7 @@ static void deathByToppling(Object* obj) //------------------------------------------------------------------------------------------------- UpdateSleepTime ToppleUpdate::update() { - //DEBUG_LOG(("updating ToppleUpdate %08lx\n",this)); + //DEBUG_LOG(("updating ToppleUpdate %08lx",this)); DEBUG_ASSERTCRASH(m_toppleState != TOPPLE_UPRIGHT, ("hmm, we should be sleeping here")); if ( (m_toppleState == TOPPLE_UPRIGHT) || (m_toppleState == TOPPLE_DOWN) ) return UPDATE_SLEEP_FOREVER; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 41b7d41adf..37e2df8080 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -489,7 +489,7 @@ Int WeaponTemplate::getDelayBetweenShots(const WeaponBonus& bonus) const delayToUse = GameLogicRandomValue( m_minDelayBetweenShots, m_maxDelayBetweenShots ); Real bonusROF = bonus.getField(WeaponBonus::RATE_OF_FIRE); - //CRCDEBUG_LOG(("WeaponTemplate::getDelayBetweenShots() - min:%d max:%d val:%d, bonusROF=%g/%8.8X\n", + //CRCDEBUG_LOG(("WeaponTemplate::getDelayBetweenShots() - min:%d max:%d val:%d, bonusROF=%g/%8.8X", //m_minDelayBetweenShots, m_maxDelayBetweenShots, delayToUse, bonusROF, AS_INT(bonusROF))); return REAL_TO_INT_FLOOR(delayToUse / bonusROF); @@ -708,7 +708,7 @@ Bool WeaponTemplate::shouldProjectileCollideWith( if ((getProjectileCollideMask() & requiredMask) != 0) return true; - //DEBUG_LOG(("Rejecting projectile collision between %s and %s!\n",projectile->getTemplate()->getName().str(),thingWeCollidedWith->getTemplate()->getName().str())); + //DEBUG_LOG(("Rejecting projectile collision between %s and %s!",projectile->getTemplate()->getName().str(),thingWeCollidedWith->getTemplate()->getName().str())); return false; } @@ -746,7 +746,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate #endif //end -extraLogging - //CRCDEBUG_LOG(("WeaponTemplate::fireWeaponTemplate() from %s\n", DescribeObject(sourceObj).str())); + //CRCDEBUG_LOG(("WeaponTemplate::fireWeaponTemplate() from %s", DescribeObject(sourceObj).str())); DEBUG_ASSERTCRASH(specificBarrelToUse >= 0, ("specificBarrelToUse should no longer be -1\n")); if (sourceObj == NULL || (victimObj == NULL && victimPos == NULL)) @@ -754,7 +754,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate //-extraLogging #if defined(RTS_DEBUG) if( TheGlobalData->m_extraLogging ) - DEBUG_LOG( ("FAIL 1 (sourceObj %d == NULL || (victimObj %d == NULL && victimPos %d == NULL)\n", sourceObj != 0, victimObj != 0, victimPos != 0) ); + DEBUG_LOG( ("FAIL 1 (sourceObj %d == NULL || (victimObj %d == NULL && victimPos %d == NULL)", sourceObj != 0, victimObj != 0, victimPos != 0) ); #endif //end -extraLogging @@ -819,7 +819,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate distSqr = ThePartitionManager->getDistanceSquared(sourceObj, victimPos, ATTACK_RANGE_CALC_TYPE); } -// DEBUG_LOG(("WeaponTemplate::fireWeaponTemplate: firing weapon %s (source=%s, victim=%s)\n", +// DEBUG_LOG(("WeaponTemplate::fireWeaponTemplate: firing weapon %s (source=%s, victim=%s)", // m_name.str(),sourceObj->getTemplate()->getName().str(),victimObj?victimObj->getTemplate()->getName().str():"NULL")); //Only perform this check if the weapon isn't a leech range weapon (which can have unlimited range!) @@ -833,7 +833,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate //-extraLogging #if defined(RTS_DEBUG) if( TheGlobalData->m_extraLogging ) - DEBUG_LOG( ("FAIL 2 (distSqr %.2f > attackRangeSqr %.2f)\n", distSqr, attackRangeSqr ) ); + DEBUG_LOG( ("FAIL 2 (distSqr %.2f > attackRangeSqr %.2f)", distSqr, attackRangeSqr ) ); #endif //end -extraLogging @@ -855,7 +855,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate //-extraLogging #if defined(RTS_DEBUG) if( TheGlobalData->m_extraLogging ) - DEBUG_LOG( ("FAIL 3 (distSqr %.2f< minAttackRangeSqr %.2f - 0.5f && !isProjectileDetonation %d)\n", distSqr, minAttackRangeSqr, isProjectileDetonation ) ); + DEBUG_LOG( ("FAIL 3 (distSqr %.2f< minAttackRangeSqr %.2f - 0.5f && !isProjectileDetonation %d)", distSqr, minAttackRangeSqr, isProjectileDetonation ) ); #endif //end -extraLogging @@ -910,7 +910,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate if (handled == false && fx != NULL) { // bah. just play it at the drawable's pos. - //DEBUG_LOG(("*** WeaponFireFX not fully handled by the client\n")); + //DEBUG_LOG(("*** WeaponFireFX not fully handled by the client")); const Coord3D* where = isContactWeapon() ? &targetPos : sourceObj->getDrawable()->getPosition(); FXList::doFXPos(fx, where, sourceObj->getDrawable()->getTransformMatrix(), getWeaponSpeed(), &targetPos, getPrimaryDamageRadius(bonus)); } @@ -945,13 +945,13 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate if (delayInFrames < 1.0f) { // go ahead and do it now - //DEBUG_LOG(("WeaponTemplate::fireWeaponTemplate: firing weapon immediately!\n")); + //DEBUG_LOG(("WeaponTemplate::fireWeaponTemplate: firing weapon immediately!")); dealDamageInternal(sourceID, damageID, damagePos, bonus, isProjectileDetonation); //-extraLogging #if defined(RTS_DEBUG) if( TheGlobalData->m_extraLogging ) - DEBUG_LOG( ("EARLY 4 (delayed damage applied now)\n") ); + DEBUG_LOG( ("EARLY 4 (delayed damage applied now)") ); #endif //end -extraLogging @@ -965,14 +965,14 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate { UnsignedInt delayInWholeFrames = REAL_TO_INT_CEIL(delayInFrames); when = TheGameLogic->getFrame() + delayInWholeFrames; - //DEBUG_LOG(("WeaponTemplate::fireWeaponTemplate: firing weapon in %d frames (= %d)!\n", delayInWholeFrames,when)); + //DEBUG_LOG(("WeaponTemplate::fireWeaponTemplate: firing weapon in %d frames (= %d)!", delayInWholeFrames,when)); TheWeaponStore->setDelayedDamage(this, damagePos, when, sourceID, damageID, bonus); } //-extraLogging #if defined(RTS_DEBUG) if( TheGlobalData->m_extraLogging ) - DEBUG_LOG( ("EARLY 5 (delaying damage applied until frame %d)\n", when ) ); + DEBUG_LOG( ("EARLY 5 (delaying damage applied until frame %d)", when ) ); #endif //end -extraLogging @@ -1087,7 +1087,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate //-extraLogging #if defined(RTS_DEBUG) if( TheGlobalData->m_extraLogging ) - DEBUG_LOG( ("DONE\n") ); + DEBUG_LOG( ("DONE") ); #endif //end -extraLogging @@ -1180,7 +1180,7 @@ void WeaponTemplate::dealDamageInternal(ObjectID sourceID, ObjectID victimID, co } // if historic bonuses -//DEBUG_LOG(("WeaponTemplate::dealDamageInternal: dealing damage %s at frame %d\n",m_name.str(),TheGameLogic->getFrame())); +//DEBUG_LOG(("WeaponTemplate::dealDamageInternal: dealing damage %s at frame %d",m_name.str(),TheGameLogic->getFrame())); // if there's a specific victim, use it's pos (overriding the value passed in) Object *primaryVictim = victimID ? TheGameLogic->findObjectByID(victimID) : NULL; // might be null... @@ -1245,7 +1245,7 @@ void WeaponTemplate::dealDamageInternal(ObjectID sourceID, ObjectID victimID, co // Remember that source is a missile for some units, and they don't want to injure them'selves' either if( source == curVictim || source->getProducerID() == curVictim->getID() ) { - //DEBUG_LOG(("skipping damage done to SELF...\n")); + //DEBUG_LOG(("skipping damage done to SELF...")); continue; } } @@ -1385,7 +1385,7 @@ void WeaponStore::createAndFireTempWeapon(const WeaponTemplate* wt, const Object //------------------------------------------------------------------------------------------------- void WeaponStore::createAndFireTempWeapon(const WeaponTemplate* wt, const Object *source, Object *target) { - //CRCDEBUG_LOG(("WeaponStore::createAndFireTempWeapon() for %s\n", DescribeObject(source))); + //CRCDEBUG_LOG(("WeaponStore::createAndFireTempWeapon() for %s", DescribeObject(source))); if (wt == NULL) return; Weapon* w = TheWeaponStore->allocateNewWeapon(wt, PRIMARY_WEAPON); @@ -1660,7 +1660,7 @@ void Weapon::computeBonus(const Object *source, WeaponBonusConditionFlags extraB { bonus.clear(); WeaponBonusConditionFlags flags = source->getWeaponBonusCondition(); - //CRCDEBUG_LOG(("Weapon::computeBonus() - flags are %X for %s\n", flags, DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::computeBonus() - flags are %X for %s", flags, DescribeObject(source).str())); flags |= extraBonusFlags; if (TheGlobalData->m_weaponBonusSet) TheGlobalData->m_weaponBonusSet->appendBonuses(flags, bonus); @@ -1705,10 +1705,10 @@ void Weapon::setClipPercentFull(Real percent, Bool allowReduction) { m_ammoInClip = ammo; m_status = m_ammoInClip ? OUT_OF_AMMO : READY_TO_FIRE; - //CRCDEBUG_LOG(("Weapon::setClipPercentFull() just set m_status to %d (ammo in clip is %d)\n", m_status, m_ammoInClip)); + //CRCDEBUG_LOG(("Weapon::setClipPercentFull() just set m_status to %d (ammo in clip is %d)", m_status, m_ammoInClip)); m_whenLastReloadStarted = TheGameLogic->getFrame(); m_whenWeCanFireAgain = m_whenLastReloadStarted; - //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::setClipPercentFull\n", m_whenWeCanFireAgain)); + //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::setClipPercentFull", m_whenWeCanFireAgain)); rebuildScatterTargets(); } } @@ -1742,7 +1742,7 @@ void Weapon::reloadWithBonus(const Object *sourceObj, const WeaponBonus& bonus, Real reloadTime = loadInstantly ? 0 : m_template->getClipReloadTime(bonus); m_whenLastReloadStarted = TheGameLogic->getFrame(); m_whenWeCanFireAgain = m_whenLastReloadStarted + reloadTime; - //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::reloadWithBonus 1\n", m_whenWeCanFireAgain)); + //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::reloadWithBonus 1", m_whenWeCanFireAgain)); // if we are sharing reload times // go through other weapons in weapon set @@ -1756,7 +1756,7 @@ void Weapon::reloadWithBonus(const Object *sourceObj, const WeaponBonus& bonus, if (weapon) { weapon->setPossibleNextShotFrame(m_whenWeCanFireAgain); - //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::reloadWithBonus 2\n", m_whenWeCanFireAgain)); + //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::reloadWithBonus 2", m_whenWeCanFireAgain)); weapon->setStatus(RELOADING_CLIP); } } @@ -2266,7 +2266,7 @@ Bool Weapon::privateFireWeapon( ObjectID* projectileID ) { - //CRCDEBUG_LOG(("Weapon::privateFireWeapon() for %s\n", DescribeObject(sourceObj).str())); + //CRCDEBUG_LOG(("Weapon::privateFireWeapon() for %s", DescribeObject(sourceObj).str())); //USE_PERF_TIMER(fireWeapon) if (projectileID) *projectileID = INVALID_ID; @@ -2433,17 +2433,17 @@ Bool Weapon::privateFireWeapon( { m_status = OUT_OF_AMMO; m_whenWeCanFireAgain = 0x7fffffff; - //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::privateFireWeapon 1\n", m_whenWeCanFireAgain)); + //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::privateFireWeapon 1", m_whenWeCanFireAgain)); } } else { m_status = BETWEEN_FIRING_SHOTS; - //CRCDEBUG_LOG(("Weapon::privateFireWeapon() just set m_status to BETWEEN_FIRING_SHOTS\n")); + //CRCDEBUG_LOG(("Weapon::privateFireWeapon() just set m_status to BETWEEN_FIRING_SHOTS")); Int delay = m_template->getDelayBetweenShots(bonus); m_whenLastReloadStarted = now; m_whenWeCanFireAgain = now + delay; - //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d (delay is %d) in Weapon::privateFireWeapon\n", m_whenWeCanFireAgain, delay)); + //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d (delay is %d) in Weapon::privateFireWeapon", m_whenWeCanFireAgain, delay)); // if we are sharing reload times // go through other weapons in weapon set @@ -2458,7 +2458,7 @@ Bool Weapon::privateFireWeapon( if (weapon) { weapon->setPossibleNextShotFrame(m_whenWeCanFireAgain); - //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::privateFireWeapon 3\n", m_whenWeCanFireAgain)); + //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::privateFireWeapon 3", m_whenWeCanFireAgain)); weapon->setStatus(BETWEEN_FIRING_SHOTS); } } @@ -2489,7 +2489,7 @@ void Weapon::preFireWeapon( const Object *source, const Object *victim ) //------------------------------------------------------------------------------------------------- Bool Weapon::fireWeapon(const Object *source, Object *target, ObjectID* projectileID) { - //CRCDEBUG_LOG(("Weapon::fireWeapon() for %s at %s\n", DescribeObject(source).str(), DescribeObject(target).str())); + //CRCDEBUG_LOG(("Weapon::fireWeapon() for %s at %s", DescribeObject(source).str(), DescribeObject(target).str())); return privateFireWeapon(source, target, NULL, false, false, 0, projectileID); } @@ -2497,21 +2497,21 @@ Bool Weapon::fireWeapon(const Object *source, Object *target, ObjectID* projecti // return true if we auto-reloaded our clip after firing. Bool Weapon::fireWeapon(const Object *source, const Coord3D* pos, ObjectID* projectileID) { - //CRCDEBUG_LOG(("Weapon::fireWeapon() for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::fireWeapon() for %s", DescribeObject(source).str())); return privateFireWeapon(source, NULL, pos, false, false, 0, projectileID); } //------------------------------------------------------------------------------------------------- void Weapon::fireProjectileDetonationWeapon(const Object *source, Object *target, WeaponBonusConditionFlags extraBonusFlags) { - //CRCDEBUG_LOG(("Weapon::fireProjectileDetonationWeapon() for %sat %s\n", DescribeObject(source).str(), DescribeObject(target).str())); + //CRCDEBUG_LOG(("Weapon::fireProjectileDetonationWeapon() for %sat %s", DescribeObject(source).str(), DescribeObject(target).str())); privateFireWeapon(source, target, NULL, true, false, extraBonusFlags, NULL); } //------------------------------------------------------------------------------------------------- void Weapon::fireProjectileDetonationWeapon(const Object *source, const Coord3D* pos, WeaponBonusConditionFlags extraBonusFlags) { - //CRCDEBUG_LOG(("Weapon::fireProjectileDetonationWeapon() for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::fireProjectileDetonationWeapon() for %s", DescribeObject(source).str())); privateFireWeapon(source, NULL, pos, true, false, extraBonusFlags, NULL); } @@ -2520,7 +2520,7 @@ void Weapon::fireProjectileDetonationWeapon(const Object *source, const Coord3D* //and immediately gain control of the weapon that was fired to give it special orders... Object* Weapon::forceFireWeapon( const Object *source, const Coord3D *pos) { - //CRCDEBUG_LOG(("Weapon::forceFireWeapon() for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::forceFireWeapon() for %s", DescribeObject(source).str())); //Force the ammo to load instantly. //loadAmmoNow( source ); //Fire the weapon at the position. Internally, it'll store the weapon projectile ID if so created. @@ -2544,7 +2544,7 @@ WeaponStatus Weapon::getStatus() const m_status = READY_TO_FIRE; else m_status = OUT_OF_AMMO; - //CRCDEBUG_LOG(("Weapon::getStatus() just set m_status to %d (ammo in clip is %d)\n", m_status, m_ammoInClip)); + //CRCDEBUG_LOG(("Weapon::getStatus() just set m_status to %d (ammo in clip is %d)", m_status, m_ammoInClip)); } return m_status; } @@ -2571,7 +2571,7 @@ Bool Weapon::isWithinTargetPitch(const Object *source, const Object *victim) con (minPitch <= m_template->getMinTargetPitch() && maxPitch >= m_template->getMaxTargetPitch())) return true; - //DEBUG_LOG(("pitch %f-%f is out of range\n",rad2deg(minPitch),rad2deg(maxPitch),rad2deg(m_template->getMinTargetPitch()),rad2deg(m_template->getMaxTargetPitch()))); + //DEBUG_LOG(("pitch %f-%f is out of range",rad2deg(minPitch),rad2deg(maxPitch),rad2deg(m_template->getMinTargetPitch()),rad2deg(m_template->getMaxTargetPitch()))); return false; } @@ -2735,16 +2735,16 @@ void Weapon::processRequestAssistance( const Object *requestingObject, Object *v Real turretPitch = 0.0f; const AIUpdateInterface* ai = launcher->getAIUpdateInterface(); WhichTurretType tur = ai ? ai->getWhichTurretForWeaponSlot(wslot, &turretAngle, &turretPitch) : TURRET_INVALID; - //CRCDEBUG_LOG(("calcProjectileLaunchPosition(): Turret %d, slot %d, barrel %d for %s\n", tur, wslot, specificBarrelToUse, DescribeObject(launcher).str())); + //CRCDEBUG_LOG(("calcProjectileLaunchPosition(): Turret %d, slot %d, barrel %d for %s", tur, wslot, specificBarrelToUse, DescribeObject(launcher).str())); Matrix3D attachTransform(true); Coord3D turretRotPos = {0.0f, 0.0f, 0.0f}; Coord3D turretPitchPos = {0.0f, 0.0f, 0.0f}; const Drawable* draw = launcher->getDrawable(); - //CRCDEBUG_LOG(("Do we have a drawable? %d\n", (draw != NULL))); + //CRCDEBUG_LOG(("Do we have a drawable? %d", (draw != NULL))); if (!draw || !draw->getProjectileLaunchOffset(wslot, specificBarrelToUse, &attachTransform, tur, &turretRotPos, &turretPitchPos)) { - //CRCDEBUG_LOG(("ProjectileLaunchPos %d %d not found!\n",wslot, specificBarrelToUse)); + //CRCDEBUG_LOG(("ProjectileLaunchPos %d %d not found!",wslot, specificBarrelToUse)); DEBUG_CRASH(("ProjectileLaunchPos %d %d not found!\n",wslot, specificBarrelToUse)); attachTransform.Make_Identity(); turretRotPos.zero(); @@ -2793,7 +2793,7 @@ void Weapon::processRequestAssistance( const Object *requestingObject, Object *v Int specificBarrelToUse ) { - //CRCDEBUG_LOG(("Weapon::positionProjectileForLaunch() for %s from %s\n", + //CRCDEBUG_LOG(("Weapon::positionProjectileForLaunch() for %s from %s", //DescribeObject(projectile).str(), DescribeObject(launcher).str())); // if our launch vehicle is gone, destroy ourselves @@ -2860,12 +2860,12 @@ Bool Weapon::isClearFiringLineOfSightTerrain(const Object* source, const Object* { Coord3D origin; origin = *source->getPosition(); - //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain(Object) for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain(Object) for %s", DescribeObject(source).str())); //DUMPCOORD3D(&origin); getFiringLineOfSightOrigin(source, origin); Coord3D victimPos; victim->getGeometryInfo().getCenterPosition( *victim->getPosition(), victimPos ); - //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain() - victimPos is (%g,%g,%g) (%X,%X,%X)\n", + //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain() - victimPos is (%g,%g,%g) (%X,%X,%X)", // victimPos.x, victimPos.y, victimPos.z, // AS_INT(victimPos.x),AS_INT(victimPos.y),AS_INT(victimPos.z))); return ThePartitionManager->isClearLineOfSightTerrain(NULL, origin, NULL, victimPos); @@ -2877,7 +2877,7 @@ Bool Weapon::isClearFiringLineOfSightTerrain(const Object* source, const Coord3D { Coord3D origin; origin = *source->getPosition(); - //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain(Coord3D) for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain(Coord3D) for %s", DescribeObject(source).str())); //DUMPCOORD3D(&origin); getFiringLineOfSightOrigin(source, origin); return ThePartitionManager->isClearLineOfSightTerrain(NULL, origin, NULL, victimPos); @@ -2889,7 +2889,7 @@ Bool Weapon::isClearFiringLineOfSightTerrain(const Object* source, const Coord3D Bool Weapon::isClearGoalFiringLineOfSightTerrain(const Object* source, const Coord3D& goalPos, const Object* victim) const { Coord3D origin=goalPos; - //CRCDEBUG_LOG(("Weapon::isClearGoalFiringLineOfSightTerrain(Object) for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::isClearGoalFiringLineOfSightTerrain(Object) for %s", DescribeObject(source).str())); //DUMPCOORD3D(&origin); getFiringLineOfSightOrigin(source, origin); Coord3D victimPos; @@ -2903,10 +2903,10 @@ Bool Weapon::isClearGoalFiringLineOfSightTerrain(const Object* source, const Coo Bool Weapon::isClearGoalFiringLineOfSightTerrain(const Object* source, const Coord3D& goalPos, const Coord3D& victimPos) const { Coord3D origin=goalPos; - //CRCDEBUG_LOG(("Weapon::isClearGoalFiringLineOfSightTerrain(Coord3D) for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::isClearGoalFiringLineOfSightTerrain(Coord3D) for %s", DescribeObject(source).str())); //DUMPCOORD3D(&origin); getFiringLineOfSightOrigin(source, origin); - //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain() - victimPos is (%g,%g,%g) (%X,%X,%X)\n", + //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain() - victimPos is (%g,%g,%g) (%X,%X,%X)", // victimPos.x, victimPos.y, victimPos.z, // AS_INT(victimPos.x),AS_INT(victimPos.y),AS_INT(victimPos.z))); return ThePartitionManager->isClearLineOfSightTerrain(NULL, origin, NULL, victimPos); @@ -3107,7 +3107,7 @@ void Weapon::crc( Xfer *xfer ) #ifdef DEBUG_CRC if (doLogging) { - CRCDEBUG_LOG(("%s\n", logString.str())); + CRCDEBUG_LOG(("%s", logString.str())); } #endif // DEBUG_CRC diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp index dceaa5ab05..5b2ea6af60 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp @@ -328,7 +328,7 @@ void WeaponSet::updateWeaponSet(const Object* obj) } } m_curWeaponTemplateSet = set; - //DEBUG_LOG(("WeaponSet::updateWeaponSet -- changed curweapon to %s\n",getCurWeapon()->getName().str())); + //DEBUG_LOG(("WeaponSet::updateWeaponSet -- changed curweapon to %s",getCurWeapon()->getName().str())); } } @@ -919,7 +919,7 @@ Bool WeaponSet::chooseBestWeaponForTarget(const Object* obj, const Object* victi m_curWeapon = PRIMARY_WEAPON; } - //DEBUG_LOG(("WeaponSet::chooseBestWeaponForTarget -- changed curweapon to %s\n",getCurWeapon()->getName().str())); + //DEBUG_LOG(("WeaponSet::chooseBestWeaponForTarget -- changed curweapon to %s",getCurWeapon()->getName().str())); return found; } @@ -1003,13 +1003,13 @@ Bool WeaponSet::setWeaponLock( WeaponSlotType weaponSlot, WeaponLockType lockTyp { m_curWeapon = weaponSlot; m_curWeaponLockedStatus = lockType; - //DEBUG_LOG(("WeaponSet::setWeaponLock permanently -- changed curweapon to %s\n",getCurWeapon()->getName().str())); + //DEBUG_LOG(("WeaponSet::setWeaponLock permanently -- changed curweapon to %s",getCurWeapon()->getName().str())); } else if( lockType == LOCKED_TEMPORARILY && m_curWeaponLockedStatus != LOCKED_PERMANENTLY ) { m_curWeapon = weaponSlot; m_curWeaponLockedStatus = lockType; - //DEBUG_LOG(("WeaponSet::setWeaponLock temporarily -- changed curweapon to %s\n",getCurWeapon()->getName().str())); + //DEBUG_LOG(("WeaponSet::setWeaponLock temporarily -- changed curweapon to %s",getCurWeapon()->getName().str())); } return true; diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp index a6186d4de6..0a7a12a956 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp @@ -401,7 +401,7 @@ void ScriptActions::doMoveToWaypoint(const AsciiString& team, const AsciiString& Waypoint *way = TheTerrainLogic->getWaypointByName(waypoint); if (way) { Coord3D destination = *way->getLocation(); - //DEBUG_LOG(("Moving team to waypoint %f, %f, %f\n", destination.x, destination.y, destination.z)); + //DEBUG_LOG(("Moving team to waypoint %f, %f, %f", destination.x, destination.y, destination.z)); theGroup->groupMoveToPosition( &destination, false, CMD_FROM_SCRIPT ); } } @@ -490,7 +490,7 @@ void ScriptActions::doCreateReinforcements(const AsciiString& team, const AsciiS destination = *way->getLocation(); if (!theTeamProto) { - DEBUG_LOG(("***WARNING - Team %s not found.\n", team.str())); + DEBUG_LOG(("***WARNING - Team %s not found.", team.str())); return; } const TeamTemplateInfo *pInfo = theTeamProto->getTemplateInfo(); @@ -975,7 +975,7 @@ void ScriptActions::doCreateObject(const AsciiString& objectName, const AsciiStr if (!theTeam) { TheScriptEngine->AppendDebugMessage("***WARNING - Team not found:***", false); TheScriptEngine->AppendDebugMessage(teamName, true); - DEBUG_LOG(("WARNING - Team %s not found.\n", teamName.str())); + DEBUG_LOG(("WARNING - Team %s not found.", teamName.str())); return; } const ThingTemplate *thingTemplate; @@ -999,7 +999,7 @@ void ScriptActions::doCreateObject(const AsciiString& objectName, const AsciiStr obj->setPosition( pos ); } // end if } else { - DEBUG_LOG(("WARNING - ThingTemplate '%s' not found.\n", thingName.str())); + DEBUG_LOG(("WARNING - ThingTemplate '%s' not found.", thingName.str())); } } @@ -1145,7 +1145,7 @@ void ScriptActions::createUnitOnTeamAt(const AsciiString& unitName, const AsciiS if (!theTeam) { TheScriptEngine->AppendDebugMessage("***WARNING - Team not found:***", false); TheScriptEngine->AppendDebugMessage(teamName, true); - DEBUG_LOG(("WARNING - Team %s not found.\n", teamName.str())); + DEBUG_LOG(("WARNING - Team %s not found.", teamName.str())); return; } const ThingTemplate *thingTemplate; @@ -1173,7 +1173,7 @@ void ScriptActions::createUnitOnTeamAt(const AsciiString& unitName, const AsciiS } } // end if } else { - DEBUG_LOG(("WARNING - ThingTemplate '%s' not found.\n", objType.str())); + DEBUG_LOG(("WARNING - ThingTemplate '%s' not found.", objType.str())); } } @@ -2961,7 +2961,7 @@ static PlayerMaskType getHumanPlayerMask( void ) mask &= player->getPlayerMask(); } - //DEBUG_LOG(("getHumanPlayerMask(): mask was %4.4X\n", mask)); + //DEBUG_LOG(("getHumanPlayerMask(): mask was %4.4X", mask)); return mask; } @@ -3020,22 +3020,22 @@ void ScriptActions::doShroudMapAtWaypoint(const AsciiString& waypointName, Real //------------------------------------------------------------------------------------------------- void ScriptActions::doRevealMapEntire(const AsciiString& playerName) { - DEBUG_LOG(("ScriptActions::doRevealMapEntire() for player named '%s'\n", playerName.str())); + DEBUG_LOG(("ScriptActions::doRevealMapEntire() for player named '%s'", playerName.str())); Player* player = TheScriptEngine->getPlayerFromAsciiString(playerName); if (player && playerName.isNotEmpty()) { - DEBUG_LOG(("ScriptActions::doRevealMapEntire() for player named '%ls' in position %d\n", player->getPlayerDisplayName().str(), player->getPlayerIndex())); + DEBUG_LOG(("ScriptActions::doRevealMapEntire() for player named '%ls' in position %d", player->getPlayerDisplayName().str(), player->getPlayerIndex())); ThePartitionManager->revealMapForPlayer( player->getPlayerIndex() ); } else { - DEBUG_LOG(("ScriptActions::doRevealMapEntire() - no player, so doing all human players\n")); + DEBUG_LOG(("ScriptActions::doRevealMapEntire() - no player, so doing all human players")); for (Int i=0; igetPlayerCount(); ++i) { Player *player = ThePlayerList->getNthPlayer(i); if (player->getPlayerType() == PLAYER_HUMAN) { - DEBUG_LOG(("ScriptActions::doRevealMapEntire() for player %d\n", i)); + DEBUG_LOG(("ScriptActions::doRevealMapEntire() for player %d", i)); ThePartitionManager->revealMapForPlayer( i ); } } @@ -3059,7 +3059,7 @@ void ScriptActions::doRevealMapEntirePermanently( Bool reveal, const AsciiString Player *player = ThePlayerList->getNthPlayer(i); if (player->getPlayerType() == PLAYER_HUMAN) { - DEBUG_LOG(("ScriptActions::doRevealMapEntirePermanently() for player %d\n", i)); + DEBUG_LOG(("ScriptActions::doRevealMapEntirePermanently() for player %d", i)); if( reveal ) ThePartitionManager->revealMapForPlayerPermanently( i ); else @@ -3086,7 +3086,7 @@ void ScriptActions::doShroudMapEntire(const AsciiString& playerName) Player *player = ThePlayerList->getNthPlayer(i); if (player->getPlayerType() == PLAYER_HUMAN) { - DEBUG_LOG(("ScriptActions::doShroudMapEntire() for player %d\n", i)); + DEBUG_LOG(("ScriptActions::doShroudMapEntire() for player %d", i)); ThePartitionManager->shroudMapForPlayer( i ); } } @@ -3211,7 +3211,7 @@ void ScriptActions::doIdleAllPlayerUnits(const AsciiString& playerName) Player *player = ThePlayerList->getNthPlayer(i); if (player->getPlayerType() == PLAYER_HUMAN) { - DEBUG_LOG(("ScriptActions::doIdleAllPlayerUnits() for player %d\n", i)); + DEBUG_LOG(("ScriptActions::doIdleAllPlayerUnits() for player %d", i)); player->setUnitsShouldIdleOrResume(true); } } @@ -3235,7 +3235,7 @@ void ScriptActions::doResumeSupplyTruckingForIdleUnits(const AsciiString& player Player *player = ThePlayerList->getNthPlayer(i); if (player->getPlayerType() == PLAYER_HUMAN) { - DEBUG_LOG(("ScriptActions::doResumeSupplyTruckingForIdleUnits() for player %d\n", i)); + DEBUG_LOG(("ScriptActions::doResumeSupplyTruckingForIdleUnits() for player %d", i)); player->setUnitsShouldIdleOrResume(false); } } diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp index 3da276424e..b0a3a8070e 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp @@ -193,13 +193,13 @@ Int AttackPriorityInfo::getPriority(const ThingTemplate *tThing) const //------------------------------------------------------------------------------------------------- void AttackPriorityInfo::dumpPriorityInfo(void) { - DEBUG_LOG(("Attack priority '%s', default %d\n", m_name.str(), m_defaultPriority)); + DEBUG_LOG(("Attack priority '%s', default %d", m_name.str(), m_defaultPriority)); if (m_priorityMap==NULL) return; for (AttackPriorityMap::const_iterator it = m_priorityMap->begin(); it != m_priorityMap->end(); ++it) { const ThingTemplate *tThing = (*it).first; Int priority = (*it).second; (void)tThing; (void)priority; - DEBUG_LOG((" Thing '%s' priority %d\n",tThing->getName().str(), priority)); + DEBUG_LOG((" Thing '%s' priority %d",tThing->getName().str(), priority)); } } #endif @@ -4588,9 +4588,9 @@ void ScriptEngine::reset( void ) #ifdef SPECIAL_SCRIPT_PROFILING #ifdef DEBUG_LOGGING if (m_numFrames > 1) { - DEBUG_LOG(("\n***SCRIPT ENGINE STATS %.0f frames:\n", m_numFrames)); - DEBUG_LOG(("Avg time to update %.3f milisec\n", 1000*m_totalUpdateTime/m_numFrames)); - DEBUG_LOG((" Max time to update %.3f miliseconds.\n", m_maxUpdateTime*1000)); + DEBUG_LOG(("\n***SCRIPT ENGINE STATS %.0f frames:", m_numFrames)); + DEBUG_LOG(("Avg time to update %.3f milisec", 1000*m_totalUpdateTime/m_numFrames)); + DEBUG_LOG((" Max time to update %.3f miliseconds.", m_maxUpdateTime*1000)); } m_numFrames=0; m_totalUpdateTime=0; @@ -4624,14 +4624,14 @@ void ScriptEngine::reset( void ) } } if (maxScript) { - DEBUG_LOG((" SCRIPT %s total time %f seconds,\n evaluated %d times, avg execution %2.3f msec (Goal less than 0.05)\n", + DEBUG_LOG((" SCRIPT %s total time %f seconds,\n evaluated %d times, avg execution %2.3f msec (Goal less than 0.05)", maxScript->getName().str(), maxScript->getConditionTime(), maxScript->getConditionCount(), 1000*maxScript->getConditionTime()/maxScript->getConditionCount()) ); maxScript->addToConditionTime(-2*maxTime); // reset to negative. } } - DEBUG_LOG(("***\n")); + DEBUG_LOG(("***")); } #endif #endif @@ -4775,9 +4775,9 @@ void ScriptEngine::update( void ) AsciiString name = it->first; Object * obj = it->second; if (obj && obj->getAIUpdateInterface()) - DEBUG_LOG(("%s=%x('%s'), isDead%d\n", name.str(), obj, obj->getName().str(), obj->getAIUpdateInterface()->isDead())); + DEBUG_LOG(("%s=%x('%s'), isDead%d", name.str(), obj, obj->getName().str(), obj->getAIUpdateInterface()->isDead())); } - DEBUG_LOG(("\n\n")); + DEBUG_LOG(("\n")); */ #endif #endif @@ -5332,7 +5332,7 @@ void ScriptEngine::runScript(const AsciiString& scriptName, Team *pThisTeam) } else { AppendDebugMessage("***Attempting to call script that is not a subroutine:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.\n", scriptName.str())); + DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.", scriptName.str())); } } else { pScript = findScript(scriptName); @@ -5342,12 +5342,12 @@ void ScriptEngine::runScript(const AsciiString& scriptName, Team *pThisTeam) } else { AppendDebugMessage("***Attempting to call script that is not a subroutine:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.\n", scriptName.str())); + DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.", scriptName.str())); } } else { AppendDebugMessage("***Script not defined:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("WARNING: Script '%s' not defined.\n", scriptName.str())); + DEBUG_LOG(("WARNING: Script '%s' not defined.", scriptName.str())); } } // m_callingTeam is restored automatically via LatchRestore @@ -5379,7 +5379,7 @@ void ScriptEngine::runObjectScript(const AsciiString& scriptName, Object *pThisO } else { AppendDebugMessage("***Attempting to call script that is not a subroutine:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.\n", scriptName.str())); + DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.", scriptName.str())); } } else { pScript = findScript(scriptName); @@ -5389,12 +5389,12 @@ void ScriptEngine::runObjectScript(const AsciiString& scriptName, Object *pThisO } else { AppendDebugMessage("***Attempting to call script that is not a subroutine:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.\n", scriptName.str())); + DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.", scriptName.str())); } } else { AppendDebugMessage("***Script not defined:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("WARNING: Script '%s' not defined.\n", scriptName.str())); + DEBUG_LOG(("WARNING: Script '%s' not defined.", scriptName.str())); } } m_callingObject = pSavCallingObject; @@ -6138,7 +6138,7 @@ void ScriptEngine::callSubroutine( ScriptAction *pAction ) } else { AppendDebugMessage("***Attempting to call script that is not a subroutine:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.\n", scriptName.str())); + DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.", scriptName.str())); } } else { pScript = findScript(scriptName); @@ -6148,12 +6148,12 @@ void ScriptEngine::callSubroutine( ScriptAction *pAction ) } else { AppendDebugMessage("***Attempting to call script that is not a subroutine:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.\n", scriptName.str())); + DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.", scriptName.str())); } } else { AppendDebugMessage("***Script not defined:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("WARNING: Script '%s' not defined.\n", scriptName.str())); + DEBUG_LOG(("WARNING: Script '%s' not defined.", scriptName.str())); } } } @@ -6200,7 +6200,7 @@ void ScriptEngine::checkConditionsForTeamNames(Script *pScript) AppendDebugMessage(scriptName, false); AppendDebugMessage(multiTeamName, false); AppendDebugMessage(teamName, false); - DEBUG_LOG(("WARNING: Script '%s' contains multiple non-singleton team conditions: %s & %s.\n", scriptName.str(), + DEBUG_LOG(("WARNING: Script '%s' contains multiple non-singleton team conditions: %s & %s.", scriptName.str(), multiTeamName.str(), teamName.str())); } } @@ -7170,7 +7170,7 @@ void ScriptEngine::evaluateAndProgressAllSequentialScripts( void ) if (spinCount > MAX_SPIN_COUNT) { SequentialScript *seqScript = (*it); if (seqScript) { - DEBUG_LOG(("Sequential script %s appears to be in an infinite loop.\n", + DEBUG_LOG(("Sequential script %s appears to be in an infinite loop.", seqScript->m_scriptToExecuteSequentially->getName().str())); } ++it; @@ -7772,7 +7772,7 @@ void ScriptEngine::forceUnfreezeTime(void) void ScriptEngine::AppendDebugMessage(const AsciiString& strToAdd, Bool forcePause) { #ifdef INTENSE_DEBUG - DEBUG_LOG(("-SCRIPT- %d %s\n", TheGameLogic->getFrame(), strToAdd.str())); + DEBUG_LOG(("-SCRIPT- %d %s", TheGameLogic->getFrame(), strToAdd.str())); #endif typedef void (*funcptr)(const char*); if (!st_DebugDLL) { @@ -8100,7 +8100,7 @@ static void xferListAsciiStringCoord3D( Xfer *xfer, ListAsciiStringCoord3D *list // ------------------------------------------------------------------------------------------------ void ScriptEngine::setGlobalDifficulty( GameDifficulty difficulty ) { - DEBUG_LOG(("ScriptEngine::setGlobalDifficulty(%d)\n", ((Int)difficulty))); + DEBUG_LOG(("ScriptEngine::setGlobalDifficulty(%d)", ((Int)difficulty))); m_gameDifficulty = difficulty; } @@ -8648,7 +8648,7 @@ void _appendMessage(const AsciiString& str, Bool isTrueMessage, Bool shouldPause msg.concat(str); #ifdef INTENSE_DEBUG - DEBUG_LOG(("-SCRIPT- %s\n", msg.str())); + DEBUG_LOG(("-SCRIPT- %s", msg.str())); #endif if (!st_DebugDLL) { return; diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp index d5a01ea36a..8f7672dbfd 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp @@ -2088,7 +2088,7 @@ Parameter *Parameter::ReadParameter(DataChunkInput &file) strcpy(newName, "GLA"); strcat(newName, oldName+strlen("Fundamentalist")); pParm->m_string.set(newName); - DEBUG_LOG(("Changing Script Ref from %s to %s\n", oldName, newName)); + DEBUG_LOG(("Changing Script Ref from %s to %s", oldName, newName)); } } diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/VictoryConditions.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/VictoryConditions.cpp index eae151b0c7..b059e5bdd4 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/VictoryConditions.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/VictoryConditions.cpp @@ -203,7 +203,7 @@ void VictoryConditions::update( void ) GameSlot *slot = (TheGameInfo)?TheGameInfo->getSlot(idx):NULL; if (slot && slot->isAI()) { - DEBUG_LOG(("Marking AI player %s as defeated\n", pName.str())); + DEBUG_LOG(("Marking AI player %s as defeated", pName.str())); slot->setLastFrameInGame(TheGameLogic->getFrame()); } } @@ -308,10 +308,10 @@ void VictoryConditions::cachePlayerPtrs( void ) for (Int i=0; igetNthPlayer(i); - DEBUG_LOG(("Checking whether to cache player %d - [%ls], house [%ls]\n", i, player?player->getPlayerDisplayName().str():L"", (player&&player->getPlayerTemplate())?player->getPlayerTemplate()->getDisplayName().str():L"")); + DEBUG_LOG(("Checking whether to cache player %d - [%ls], house [%ls]", i, player?player->getPlayerDisplayName().str():L"", (player&&player->getPlayerTemplate())?player->getPlayerTemplate()->getDisplayName().str():L"")); if (player && player != ThePlayerList->getNeutralPlayer() && player->getPlayerTemplate() && player->getPlayerTemplate() != civTemplate && !player->isPlayerObserver()) { - DEBUG_LOG(("Caching player\n")); + DEBUG_LOG(("Caching player")); m_players[playerCount] = player; if (m_players[playerCount]->isLocalPlayer()) m_localSlotNum = playerCount; diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index c96b234067..91470a20de 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -506,8 +506,8 @@ static Object * placeObjectAtPosition(Int slotNum, AsciiString objectTemplateNam obj->setOrientation(obj->getTemplate()->getPlacementViewAngle()); obj->setPosition( &pos ); - //DEBUG_LOG(("Placed a starting building for %s at waypoint %s\n", playerName.str(), waypointName.str())); - CRCDEBUG_LOG(("Placed an object for %ls at pos (%g,%g,%g)\n", pPlayer->getPlayerDisplayName().str(), + //DEBUG_LOG(("Placed a starting building for %s at waypoint %s", playerName.str(), waypointName.str())); + CRCDEBUG_LOG(("Placed an object for %ls at pos (%g,%g,%g)", pPlayer->getPlayerDisplayName().str(), pos.x, pos.y, pos.z)); DUMPCOORD3D(&pos); @@ -528,7 +528,7 @@ static Object * placeObjectAtPosition(Int slotNum, AsciiString objectTemplateNam team->setActive(); TheAI->pathfinder()->addObjectToPathfindMap(obj); if (obj->getAIUpdateInterface() && !obj->isKindOf(KINDOF_IMMOBILE)) { - CRCDEBUG_LOG(("Not immobile - adjusting dest\n")); + CRCDEBUG_LOG(("Not immobile - adjusting dest")); if (TheAI->pathfinder()->adjustDestination(obj, obj->getAIUpdateInterface()->getLocomotorSet(), &pos)) { DUMPCOORD3D(&pos); TheAI->pathfinder()->updateGoal(obj, &pos, LAYER_GROUND); // Units always start on the ground for now. jba. @@ -565,7 +565,7 @@ static void placeNetworkBuildingsForPlayer(Int slotNum, const GameSlot *pSlot, P if (buildingTemplateName.isEmpty()) return; - DEBUG_LOG(("Placing starting building at waypoint %s\n", waypointName.str())); + DEBUG_LOG(("Placing starting building at waypoint %s", waypointName.str())); Object *conYard = placeObjectAtPosition(slotNum, buildingTemplateName, pos, pPlayer, pTemplate); if (!conYard) @@ -593,7 +593,7 @@ static void placeNetworkBuildingsForPlayer(Int slotNum, const GameSlot *pSlot, P FindPositionOptions options; options.minRadius = conYard->getGeometryInfo().getBoundingSphereRadius() * 0.7f; options.maxRadius = conYard->getGeometryInfo().getBoundingSphereRadius() * 1.3f; - DEBUG_LOG(("Placing starting object %d (%s)\n", i, objName.str())); + DEBUG_LOG(("Placing starting object %d (%s)", i, objName.str())); ThePartitionManager->update(); Bool foundPos = ThePartitionManager->findPositionAround(&pos, &options, &objPos); if (foundPos) @@ -605,7 +605,7 @@ static void placeNetworkBuildingsForPlayer(Int slotNum, const GameSlot *pSlot, P } else { - DEBUG_LOG(("Could not find position\n")); + DEBUG_LOG(("Could not find position")); } } } @@ -694,7 +694,7 @@ static void checkForDuplicateColors( GameInfo *game ) } else if (colorIdx >= 0) { - DEBUG_LOG(("Clearing color %d for player %d\n", colorIdx, i)); + DEBUG_LOG(("Clearing color %d for player %d", colorIdx, i)); } } } @@ -728,7 +728,7 @@ static void populateRandomSideAndColor( GameInfo *game ) // clean up random factions Int playerTemplateIdx = slot->getPlayerTemplate(); - DEBUG_LOG(("Player %d has playerTemplate index %d\n", i, playerTemplateIdx)); + DEBUG_LOG(("Player %d has playerTemplate index %d", i, playerTemplateIdx)); while (playerTemplateIdx != PLAYERTEMPLATE_OBSERVER && (playerTemplateIdx < 0 || playerTemplateIdx >= ThePlayerTemplateStore->getPlayerTemplateCount())) { DEBUG_ASSERTCRASH(playerTemplateIdx == -1, ("Non-random bad playerTemplate %d in slot %d\n", playerTemplateIdx, i)); @@ -756,7 +756,7 @@ static void populateRandomSideAndColor( GameInfo *game ) } else { - DEBUG_LOG(("Setting playerTemplateIdx %d to %d\n", i, playerTemplateIdx)); + DEBUG_LOG(("Setting playerTemplateIdx %d to %d", i, playerTemplateIdx)); slot->setPlayerTemplate(playerTemplateIdx); } } @@ -771,7 +771,7 @@ static void populateRandomSideAndColor( GameInfo *game ) if (game->isColorTaken(colorIdx)) colorIdx = -1; } - DEBUG_LOG(("Setting color %d to %d\n", i, colorIdx)); + DEBUG_LOG(("Setting color %d to %d", i, colorIdx)); slot->setColor(colorIdx); } } @@ -911,7 +911,7 @@ static void populateRandomStartPosition( GameInfo *game ) if (game->isStartPositionTaken(posIdx)) posIdx = -1; } - DEBUG_LOG(("Setting start position %d to %d (random choice)\n", i, posIdx)); + DEBUG_LOG(("Setting start position %d to %d (random choice)", i, posIdx)); slot->setStartPos(posIdx); taken[posIdx] = TRUE; hasStartSpotBeenPicked = TRUE; @@ -947,7 +947,7 @@ static void populateRandomStartPosition( GameInfo *game ) if (!game->isStartPositionTaken(posIdx)) posIdx = -1; } - DEBUG_LOG(("Setting observer start position %d to %d\n", i, posIdx)); + DEBUG_LOG(("Setting observer start position %d to %d", i, posIdx)); slot->setStartPos(posIdx); } } @@ -1072,12 +1072,12 @@ void GameLogic::startNewGame( Bool saveGame ) { if (TheLAN) { - DEBUG_LOG(("Starting network game\n")); + DEBUG_LOG(("Starting network game")); TheGameInfo = game = TheLAN->GetMyGame(); } else { - DEBUG_LOG(("Starting gamespy game\n")); + DEBUG_LOG(("Starting gamespy game")); TheGameInfo = game = TheGameSpyGame; /// @todo: MDC add back in after demo } } @@ -1171,7 +1171,7 @@ void GameLogic::startNewGame( Bool saveGame ) GetPrecisionTimer(&endTime64); char Buf[256]; sprintf(Buf,"After terrainlogic->loadmap=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); - //DEBUG_LOG(("Placed a starting building for %s at waypoint %s\n", playerName.str(), waypointName.str())); + //DEBUG_LOG(("Placed a starting building for %s at waypoint %s", playerName.str(), waypointName.str())); DEBUG_LOG(("%s", Buf)); #endif @@ -1185,7 +1185,7 @@ void GameLogic::startNewGame( Bool saveGame ) TheSidesList->prepareForMP_or_Skirmish(); } - //DEBUG_LOG(("Starting LAN game with %d players\n", game->getNumPlayers())); + //DEBUG_LOG(("Starting LAN game with %d players", game->getNumPlayers())); Dict d; for (int i=0; igetTeamNumber(); - DEBUG_LOG(("Looking for allies of player %d, team %d\n", i, team)); + DEBUG_LOG(("Looking for allies of player %d, team %d", i, team)); for(int j=0; j < MAX_SLOTS; ++j) { GameSlot *teamSlot = game->getSlot(j); @@ -1232,7 +1232,7 @@ void GameLogic::startNewGame( Bool saveGame ) if(i == j || !teamSlot->isOccupied()) continue; - DEBUG_LOG(("Player %d is team %d\n", j, teamSlot->getTeamNumber())); + DEBUG_LOG(("Player %d is team %d", j, teamSlot->getTeamNumber())); AsciiString teamPlayerName; teamPlayerName.format("player%d", j); @@ -1240,7 +1240,7 @@ void GameLogic::startNewGame( Bool saveGame ) // then their our enemy Bool isEnemy = FALSE; if(team == -1 || teamSlot->getTeamNumber() != team ) isEnemy = TRUE; - DEBUG_LOG(("Player %d is %s\n", j, (isEnemy)?"enemy":"ally")); + DEBUG_LOG(("Player %d is %s", j, (isEnemy)?"enemy":"ally")); if (isEnemy) { @@ -1258,7 +1258,7 @@ void GameLogic::startNewGame( Bool saveGame ) } d.setAsciiString(TheKey_playerAllies, alliesString); d.setAsciiString(TheKey_playerEnemies, enemiesString); - DEBUG_LOG(("Player %d's teams are: allies=%s, enemies=%s\n", i,alliesString.str(),enemiesString.str())); + DEBUG_LOG(("Player %d's teams are: allies=%s, enemies=%s", i,alliesString.str(),enemiesString.str())); /* Int colorIdx = slot->getColor(); @@ -1271,7 +1271,7 @@ void GameLogic::startNewGame( Bool saveGame ) if (game->isColorTaken(colorIdx)) colorIdx = -1; } - DEBUG_LOG(("Setting color %d to %d\n", i, colorIdx)); + DEBUG_LOG(("Setting color %d to %d", i, colorIdx)); slot->setColor(colorIdx); } */ @@ -1287,7 +1287,7 @@ void GameLogic::startNewGame( Bool saveGame ) if (slot->getIP() == game->getLocalIP()) { localSlot = i; - DEBUG_LOG(("GameLogic::StartNewGame - local slot is %d\n", localSlot)); + DEBUG_LOG(("GameLogic::StartNewGame - local slot is %d", localSlot)); } */ @@ -1319,7 +1319,7 @@ void GameLogic::startNewGame( Bool saveGame ) d.setBool(TheKey_teamIsSingleton, true); TheSidesList->addTeam(&d); - DEBUG_LOG(("Added side %d\n", i)); + DEBUG_LOG(("Added side %d", i)); updateLoadProgress(progressCount + i); } } @@ -1401,7 +1401,7 @@ void GameLogic::startNewGame( Bool saveGame ) DataChunkInput file( pStrm ); file.registerParser( AsciiString("PlayerScriptsList"), AsciiString::TheEmptyString, ScriptList::ParseScriptsDataChunk ); if (!file.parse(NULL)) { - DEBUG_LOG(("ERROR - Unable to read in multiplayer scripts.\n")); + DEBUG_LOG(("ERROR - Unable to read in multiplayer scripts.")); return; } ScriptList *scripts[MAX_PLAYER_COUNT]; @@ -1598,7 +1598,7 @@ void GameLogic::startNewGame( Bool saveGame ) // reveal the map for the permanent observer ThePartitionManager->revealMapForPlayerPermanently( ThePlayerList->findPlayerWithNameKey(TheNameKeyGenerator->nameToKey("ReplayObserver"))->getPlayerIndex() ); - DEBUG_LOG(("Reveal shroud for %ls whose index is %d\n", ThePlayerList->findPlayerWithNameKey(TheNameKeyGenerator->nameToKey("ReplayObserver"))->getPlayerDisplayName().str(),ThePlayerList->findPlayerWithNameKey(TheNameKeyGenerator->nameToKey("ReplayObserver"))->getPlayerIndex())); + DEBUG_LOG(("Reveal shroud for %ls whose index is %d", ThePlayerList->findPlayerWithNameKey(TheNameKeyGenerator->nameToKey("ReplayObserver"))->getPlayerDisplayName().str(),ThePlayerList->findPlayerWithNameKey(TheNameKeyGenerator->nameToKey("ReplayObserver"))->getPlayerIndex())); if (game) { @@ -1615,7 +1615,7 @@ void GameLogic::startNewGame( Bool saveGame ) if (slot->getPlayerTemplate() == PLAYERTEMPLATE_OBSERVER) { - DEBUG_LOG(("Clearing shroud for observer %s in playerList slot %d\n", playerName.str(), player->getPlayerIndex())); + DEBUG_LOG(("Clearing shroud for observer %s in playerList slot %d", playerName.str(), player->getPlayerIndex())); ThePartitionManager->revealMapForPlayerPermanently( player->getPlayerIndex() ); } else @@ -1769,7 +1769,7 @@ void GameLogic::startNewGame( Bool saveGame ) } } } - DEBUG_LOG(("Setting observer's playerTemplate to %d in slot %d\n", slot->getPlayerTemplate(), i)); + DEBUG_LOG(("Setting observer's playerTemplate to %d in slot %d", slot->getPlayerTemplate(), i)); } else { @@ -1829,7 +1829,7 @@ void GameLogic::startNewGame( Bool saveGame ) { Int startPos = slot->getStartPos(); startingCamName.format("Player_%d_Start", startPos+1); // start pos waypoints are 1-based - DEBUG_LOG(("Using %s as the multiplayer initial camera position\n", startingCamName.str())); + DEBUG_LOG(("Using %s as the multiplayer initial camera position", startingCamName.str())); } } @@ -1851,7 +1851,7 @@ void GameLogic::startNewGame( Bool saveGame ) pos.y = 50; pos.z = 0; TheTacticalView->lookAt( &pos ); - DEBUG_LOG(("Failed to find initial camera position waypoint %s\n", startingCamName.str())); + DEBUG_LOG(("Failed to find initial camera position waypoint %s", startingCamName.str())); } // Set up the camera height based on the map height & globalData. @@ -1889,7 +1889,7 @@ void GameLogic::startNewGame( Bool saveGame ) if (pPlayer) { pPlayer->addSkillPoints(m_rankPointsToAddAtGameStart); - DEBUG_LOG(("GameLogic::startNewGame() - adding m_rankPointsToAddAtGameStart==%d to player %d(%ls)\n", + DEBUG_LOG(("GameLogic::startNewGame() - adding m_rankPointsToAddAtGameStart==%d to player %d(%ls)", m_rankPointsToAddAtGameStart, i, pPlayer->getPlayerDisplayName().str())); } } @@ -1987,7 +1987,7 @@ void GameLogic::startNewGame( Bool saveGame ) TheRadar->forceOn(TRUE); ThePartitionManager->refreshShroudForLocalPlayer(); TheControlBar->setControlBarSchemeByPlayer( ThePlayerList->getLocalPlayer()); - DEBUG_LOG(("Start of a replay game %ls, %d\n",ThePlayerList->getLocalPlayer()->getPlayerDisplayName().str(), ThePlayerList->getLocalPlayer()->getPlayerIndex())); + DEBUG_LOG(("Start of a replay game %ls, %d",ThePlayerList->getLocalPlayer()->getPlayerDisplayName().str(), ThePlayerList->getLocalPlayer()->getPlayerIndex())); } else TheControlBar->setControlBarSchemeByPlayer(ThePlayerList->getLocalPlayer()); @@ -2145,14 +2145,14 @@ void GameLogic::loadMapINI( AsciiString mapName ) sprintf(fullFledgeFilename, "%s\\map.ini", filename); if (TheFileSystem->doesFileExist(fullFledgeFilename)) { - DEBUG_LOG(("Loading map.ini\n")); + DEBUG_LOG(("Loading map.ini")); INI ini; ini.load( AsciiString(fullFledgeFilename), INI_LOAD_CREATE_OVERRIDES, NULL ); } sprintf(fullFledgeFilename, "%s\\solo.ini", filename); if (TheFileSystem->doesFileExist(fullFledgeFilename)) { - DEBUG_LOG(("Loading solo.ini\n")); + DEBUG_LOG(("Loading solo.ini")); INI ini; ini.load( AsciiString(fullFledgeFilename), INI_LOAD_CREATE_OVERRIDES, NULL ); } @@ -2289,14 +2289,14 @@ void GameLogic::processCommandList( CommandList *list ) } else { - //DEBUG_LOG(("Comparing %d CRCs on frame %d\n", m_cachedCRCs.size(), m_frame)); + //DEBUG_LOG(("Comparing %d CRCs on frame %d", m_cachedCRCs.size(), m_frame)); std::map::const_iterator crcIt = m_cachedCRCs.begin(); Int validatorCRC = crcIt->second; - //DEBUG_LOG(("Validator CRC from player %d is %8.8X\n", crcIt->first, validatorCRC)); + //DEBUG_LOG(("Validator CRC from player %d is %8.8X", crcIt->first, validatorCRC)); while (++crcIt != m_cachedCRCs.end()) { Int validatedCRC = crcIt->second; - //DEBUG_LOG(("CRC to validate is from player %d: %8.8X\n", crcIt->first, validatedCRC)); + //DEBUG_LOG(("CRC to validate is from player %d: %8.8X", crcIt->first, validatedCRC)); if (validatorCRC != validatedCRC) { DEBUG_CRASH(("CRC mismatch!")); @@ -2309,11 +2309,11 @@ void GameLogic::processCommandList( CommandList *list ) if (sawCRCMismatch) { #ifdef DEBUG_LOGGING - DEBUG_LOG(("CRC Mismatch - saw %d CRCs from %d players\n", m_cachedCRCs.size(), numPlayers)); + DEBUG_LOG(("CRC Mismatch - saw %d CRCs from %d players", m_cachedCRCs.size(), numPlayers)); for (std::map::const_iterator crcIt = m_cachedCRCs.begin(); crcIt != m_cachedCRCs.end(); ++crcIt) { Player *player = ThePlayerList->getNthPlayer(crcIt->first); - DEBUG_LOG(("CRC from player %d (%ls) = %X\n", crcIt->first, + DEBUG_LOG(("CRC from player %d (%ls) = %X", crcIt->first, player?player->getPlayerDisplayName().str():L"", crcIt->second)); } #endif // DEBUG_LOGGING @@ -2340,7 +2340,7 @@ void GameLogic::selectObject(Object *obj, Bool createNewSelection, PlayerMaskTyp } if (!obj->isMassSelectable() && !createNewSelection) { - DEBUG_LOG(("GameLogic::selectObject() - Object attempted to be added to selection, but isn't mass-selectable.\n")); + DEBUG_LOG(("GameLogic::selectObject() - Object attempted to be added to selection, but isn't mass-selectable.")); return; } @@ -2448,10 +2448,10 @@ inline void GameLogic::validateSleepyUpdate() const return; int i; - //DEBUG_LOG(("\n\n")); + //DEBUG_LOG(("\n")); //for (i = 0; i < sz; ++i) //{ - // DEBUG_LOG(("u %04d: %08lx %08lx\n",i,m_sleepyUpdates[i],m_sleepyUpdates[i]->friend_getNextCallFrame())); + // DEBUG_LOG(("u %04d: %08lx %08lx",i,m_sleepyUpdates[i],m_sleepyUpdates[i]->friend_getNextCallFrame())); //} for (i = 0; i < sz; ++i) { @@ -3027,7 +3027,7 @@ static void unitTimings(void) #ifdef SINGLE_UNIT if (btt->getName()!=SINGLE_UNIT) { - DEBUG_LOG(("Skipping %s\n", btt->getName().str())); + DEBUG_LOG(("Skipping %s", btt->getName().str())); continue; } #endif @@ -3193,7 +3193,7 @@ void GameLogic::update( void ) messageList = TheCommandList; messageList->appendMessage(msg); - DEBUG_LOG(("Appended %sCRC on frame %d: %8.8X\n", isPlayback ? "Playback " : "", m_frame, m_CRC)); + DEBUG_LOG(("Appended %sCRC on frame %d: %8.8X", isPlayback ? "Playback " : "", m_frame, m_CRC)); } // collect stats @@ -3842,10 +3842,10 @@ void GameLogic::processProgressComplete(Int playerId) } if(m_progressComplete[playerId] == TRUE) { - DEBUG_LOG(("GameLogic::processProgressComplete, playerId %d is marked TRUE already yet we're trying to mark him as true again\n", playerId)); + DEBUG_LOG(("GameLogic::processProgressComplete, playerId %d is marked TRUE already yet we're trying to mark him as true again", playerId)); return; } - DEBUG_LOG(("Progress Complete for Player %d\n", playerId)); + DEBUG_LOG(("Progress Complete for Player %d", playerId)); m_progressComplete[playerId] = TRUE; lastHeardFrom(playerId); } @@ -3903,7 +3903,7 @@ void GameLogic::testTimeOut( void ) // ------------------------------------------------------------------------------------------------ void GameLogic::timeOutGameStart( void ) { - DEBUG_LOG(("We got the Force TimeOut Start Message\n")); + DEBUG_LOG(("We got the Force TimeOut Start Message")); m_forceGameStartByTimeOut = TRUE; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp index 8b6c56b855..290c1ddade 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp @@ -321,7 +321,7 @@ void GameLogic::prepareNewGame( Int gameMode, GameDifficulty diff, Int rankPoint } m_rankPointsToAddAtGameStart = rankPoints; - DEBUG_LOG(("GameLogic::prepareNewGame() - m_rankPointsToAddAtGameStart = %d\n", m_rankPointsToAddAtGameStart)); + DEBUG_LOG(("GameLogic::prepareNewGame() - m_rankPointsToAddAtGameStart = %d", m_rankPointsToAddAtGameStart)); // If we're about to start a game, hide the shell. if(!TheGameLogic->isInShellGame()) @@ -399,7 +399,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) #if 0 if (commandName.isNotEmpty() /*&& msg->getType() != GameMessage::MSG_FRAME_TICK*/) { - DEBUG_LOG(("Frame %d: GameLogic::logicMessageDispatcher() saw a %s from player %d (%ls)\n", getFrame(), commandName.str(), + DEBUG_LOG(("Frame %d: GameLogic::logicMessageDispatcher() saw a %s from player %d (%ls)", getFrame(), commandName.str(), msg->getPlayerIndex(), thisPlayer->getPlayerDisplayName().str())); } #endif @@ -426,7 +426,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) Int maxFPS = msg->getArgument( 3 )->integer; if (maxFPS < 1 || maxFPS > 1000) maxFPS = TheGlobalData->m_framesPerSecondLimit; - DEBUG_LOG(("Setting max FPS limit to %d FPS\n", maxFPS)); + DEBUG_LOG(("Setting max FPS limit to %d FPS", maxFPS)); TheGameEngine->setFramesPerSecondLimit(maxFPS); TheWritableGlobalData->m_useFpsLimit = true; } @@ -467,7 +467,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) //--------------------------------------------------------------------------------------------- case GameMessage::MSG_META_BEGIN_PATH_BUILD: { - DEBUG_LOG(("META: begin path build\n")); + DEBUG_LOG(("META: begin path build")); DEBUG_ASSERTCRASH(!theBuildPlan, ("mismatched theBuildPlan")); if (theBuildPlan == false) @@ -482,7 +482,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) //--------------------------------------------------------------------------------------------- case GameMessage::MSG_META_END_PATH_BUILD: { - DEBUG_LOG(("META: end path build\n")); + DEBUG_LOG(("META: end path build")); DEBUG_ASSERTCRASH(theBuildPlan, ("mismatched theBuildPlan")); // tell everyone who participated in the plan to move @@ -801,7 +801,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) if( currentlySelectedGroup ) { - //DEBUG_LOG(("GameLogicDispatch - got a MSG_DO_MOVETO command\n")); + //DEBUG_LOG(("GameLogicDispatch - got a MSG_DO_MOVETO command")); currentlySelectedGroup->releaseWeaponLockForGroup(LOCKED_TEMPORARILY); // release any temporary locks. currentlySelectedGroup->groupMoveToPosition( &dest, false, CMD_FROM_PLAYER ); } @@ -816,7 +816,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) if( currentlySelectedGroup ) { - //DEBUG_LOG(("GameLogicDispatch - got a MSG_DO_MOVETO command\n")); + //DEBUG_LOG(("GameLogicDispatch - got a MSG_DO_MOVETO command")); currentlySelectedGroup->releaseWeaponLockForGroup(LOCKED_TEMPORARILY); // release any temporary locks. currentlySelectedGroup->groupMoveToPosition( &dest, true, CMD_FROM_PLAYER ); } @@ -1641,7 +1641,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) // how many does this player have active? Int count; thisPlayer->countObjectsByThingTemplate( 1, &thing, false, &count ); - DEBUG_LOG(("Player already has %d beacons active\n", count)); + DEBUG_LOG(("Player already has %d beacons active", count)); if (count >= TheMultiplayerSettings->getMaxBeaconsPerPlayer()) { if (thisPlayer == ThePlayerList->getLocalPlayer()) @@ -1987,14 +1987,14 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) //UnsignedInt oldCRC = m_cachedCRCs[msg->getPlayerIndex()]; UnsignedInt newCRC = msg->getArgument(0)->integer; - //DEBUG_LOG(("Recieved CRC of %8.8X from %ls on frame %d\n", newCRC, + //DEBUG_LOG(("Recieved CRC of %8.8X from %ls on frame %d", newCRC, //thisPlayer->getPlayerDisplayName().str(), m_frame)); m_cachedCRCs[msg->getPlayerIndex()] = newCRC; // to mask problem: = (oldCRC < newCRC)?newCRC:oldCRC; } else if (TheRecorder && TheRecorder->isPlaybackMode()) { UnsignedInt newCRC = msg->getArgument(0)->integer; - //DEBUG_LOG(("Saw CRC of %X from player %d. Our CRC is %X. Arg count is %d\n", + //DEBUG_LOG(("Saw CRC of %X from player %d. Our CRC is %X. Arg count is %d", //newCRC, thisPlayer->getPlayerIndex(), getCRC(), msg->getArgumentCount())); TheRecorder->handleCRCMessage(newCRC, thisPlayer->getPlayerIndex(), (msg->getArgument(1)->boolean)); diff --git a/Generals/Code/GameEngine/Source/GameNetwork/Connection.cpp b/Generals/Code/GameEngine/Source/GameNetwork/Connection.cpp index 2461eeb70f..9c51221b9c 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/Connection.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/Connection.cpp @@ -208,10 +208,10 @@ void Connection::sendNetCommandMsg(NetCommandMsg *msg, UnsignedByte relay) { /* #if defined(RTS_DEBUG) if (msg->getNetCommandType() == NETCOMMANDTYPE_GAMECOMMAND) { - DEBUG_LOG(("Connection::sendNetCommandMsg - added game command %d to net command list for frame %d.\n", + DEBUG_LOG(("Connection::sendNetCommandMsg - added game command %d to net command list for frame %d.", msg->getID(), msg->getExecutionFrame())); } else if (msg->getNetCommandType() == NETCOMMANDTYPE_FRAMEINFO) { - DEBUG_LOG(("Connection::sendNetCommandMsg - added frame info for frame %d\n", msg->getExecutionFrame())); + DEBUG_LOG(("Connection::sendNetCommandMsg - added frame info for frame %d", msg->getExecutionFrame())); } #endif // RTS_DEBUG */ @@ -229,7 +229,7 @@ void Connection::clearCommandsExceptFrom( Int playerIndex ) NetCommandMsg *msg = tmp->getCommand(); if (msg->getPlayerID() != playerIndex) { - DEBUG_LOG(("Connection::clearCommandsExceptFrom(%d) - clearing a command from %d for frame %d\n", + DEBUG_LOG(("Connection::clearCommandsExceptFrom(%d) - clearing a command from %d for frame %d", playerIndex, tmp->getCommand()->getPlayerID(), tmp->getCommand()->getExecutionFrame())); m_netCommandList->removeMessage(tmp); NetCommandRef *toDelete = tmp; @@ -252,7 +252,7 @@ void Connection::setQuitting( void ) { m_isQuitting = TRUE; m_quitTime = timeGetTime(); - DEBUG_LOG(("Connection::setQuitting() at time %d\n", m_quitTime)); + DEBUG_LOG(("Connection::setQuitting() at time %d", m_quitTime)); } /** @@ -267,13 +267,13 @@ UnsignedInt Connection::doSend() { // Do this check first, since it's an important fail-safe if (m_isQuitting && curtime > m_quitTime + MaxQuitFlushTime) { - DEBUG_LOG(("Timed out a quitting connection. Deleting all %d messages\n", m_netCommandList->length())); + DEBUG_LOG(("Timed out a quitting connection. Deleting all %d messages", m_netCommandList->length())); m_netCommandList->reset(); return 0; } if ((curtime - m_lastTimeSent) < m_frameGrouping) { -// DEBUG_LOG(("not sending packet, time = %d, m_lastFrameSent = %d, m_frameGrouping = %d\n", curtime, m_lastTimeSent, m_frameGrouping)); +// DEBUG_LOG(("not sending packet, time = %d, m_lastFrameSent = %d, m_frameGrouping = %d", curtime, m_lastTimeSent, m_frameGrouping)); return 0; } @@ -313,7 +313,7 @@ UnsignedInt Connection::doSend() { } if (msg != NULL) { - DEBUG_LOG(("didn't finish sending all commands in connection\n")); + DEBUG_LOG(("didn't finish sending all commands in connection")); } ++numpackets; @@ -386,7 +386,7 @@ NetCommandRef * Connection::processAck(UnsignedShort commandID, UnsignedByte ori #if defined(RTS_DEBUG) if (doDebug == TRUE) { - DEBUG_LOG(("Connection::processAck - disconnect frame command %d found, removing from command list.\n", commandID)); + DEBUG_LOG(("Connection::processAck - disconnect frame command %d found, removing from command list.", commandID)); } #endif m_netCommandList->removeMessage(temp); @@ -405,7 +405,7 @@ void Connection::doRetryMetrics() { if ((curTime - m_retryMetricsTime) > 10000) { m_retryMetricsTime = curTime; ++numSeconds; -// DEBUG_LOG(("Retries in the last 10 seconds = %d, average latency = %fms\n", m_numRetries, m_averageLatency)); +// DEBUG_LOG(("Retries in the last 10 seconds = %d, average latency = %fms", m_numRetries, m_averageLatency)); m_numRetries = 0; // m_retryTime = m_averageLatency * 1.5; } @@ -415,7 +415,7 @@ void Connection::doRetryMetrics() { void Connection::debugPrintCommands() { NetCommandRef *ref = m_netCommandList->getFirstMessage(); while (ref != NULL) { - DEBUG_LOG(("Connection::debugPrintCommands - ID: %d\tType: %s\tRelay: 0x%X for frame %d\n", + DEBUG_LOG(("Connection::debugPrintCommands - ID: %d\tType: %s\tRelay: 0x%X for frame %d", ref->getCommand()->getID(), GetAsciiNetCommandType(ref->getCommand()->getNetCommandType()).str(), ref->getRelay(), ref->getCommand()->getExecutionFrame())); ref = ref->getNext(); diff --git a/Generals/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp b/Generals/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp index 6006632fde..b610433cd0 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp @@ -315,7 +315,7 @@ void ConnectionManager::attachTransport(Transport *transport) { void ConnectionManager::zeroFrames(UnsignedInt startingFrame, UnsignedInt numFrames) { for (Int i = 0; i < MAX_SLOTS; ++i) { if (m_frameData[i] != NULL) { -// DEBUG_LOG(("Calling zeroFrames on player %d, starting frame %d, numFrames %d\n", i, startingFrame, numFrames)); +// DEBUG_LOG(("Calling zeroFrames on player %d, starting frame %d, numFrames %d", i, startingFrame, numFrames)); m_frameData[i]->zeroFrames(startingFrame, numFrames); } } @@ -354,7 +354,7 @@ void ConnectionManager::doRelay() { // make a NetPacket out of this data so it can be broken up into individual commands. packet = newInstance(NetPacket)(&(m_transport->m_inBuffer[i])); - //DEBUG_LOG(("ConnectionManager::doRelay() - got a packet with %d commands\n", packet->getNumCommands())); + //DEBUG_LOG(("ConnectionManager::doRelay() - got a packet with %d commands", packet->getNumCommands())); //LOGBUFFER( packet->getData(), packet->getLength() ); // Get the command list from the packet. @@ -363,7 +363,7 @@ void ConnectionManager::doRelay() { // Iterate through the commands in this packet and send them to the proper connections. while (cmd != NULL) { - //DEBUG_LOG(("ConnectionManager::doRelay() - Looking at a command of type %s\n", + //DEBUG_LOG(("ConnectionManager::doRelay() - Looking at a command of type %s", //GetAsciiNetCommandType(cmd->getCommand()->getNetCommandType()).str())); if (CommandRequiresAck(cmd->getCommand())) { ackCommand(cmd, m_localSlot); @@ -468,7 +468,7 @@ Bool ConnectionManager::processNetCommand(NetCommandRef *ref) { if (msg->getNetCommandType() == NETCOMMANDTYPE_PROGRESS) { - //DEBUG_LOG(("ConnectionManager::processNetCommand - got a progress net command from player %d\n", msg->getPlayerID())); + //DEBUG_LOG(("ConnectionManager::processNetCommand - got a progress net command from player %d", msg->getPlayerID())); processProgress((NetProgressCommandMsg *) msg); // need to set the relay so we don't send it to ourselves. @@ -480,7 +480,7 @@ Bool ConnectionManager::processNetCommand(NetCommandRef *ref) { if (msg->getNetCommandType() == NETCOMMANDTYPE_TIMEOUTSTART) { - DEBUG_LOG(("ConnectionManager::processNetCommand - got a TimeOut GameStart net command from player %d\n", msg->getPlayerID())); + DEBUG_LOG(("ConnectionManager::processNetCommand - got a TimeOut GameStart net command from player %d", msg->getPlayerID())); processTimeOutGameStart(msg); return FALSE; } @@ -505,7 +505,7 @@ Bool ConnectionManager::processNetCommand(NetCommandRef *ref) { if (msg->getNetCommandType() == NETCOMMANDTYPE_LOADCOMPLETE) { - DEBUG_LOG(("ConnectionManager::processNetCommand - got a Load Complete net command from player %d\n", msg->getPlayerID())); + DEBUG_LOG(("ConnectionManager::processNetCommand - got a Load Complete net command from player %d", msg->getPlayerID())); processLoadComplete(msg); return FALSE; } @@ -560,7 +560,7 @@ void ConnectionManager::processWrapper(NetCommandRef *ref) { NetWrapperCommandMsg *wrapperMsg = (NetWrapperCommandMsg *)(ref->getCommand()); UnsignedShort commandID = wrapperMsg->getWrappedCommandID(); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - wrapped commandID is %d, commandID is %d\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - wrapped commandID is %d, commandID is %d", commandID, wrapperMsg->getID())); Int origProgress = 0; FileCommandMap::iterator fcIt = s_fileCommandMap.find(commandID); @@ -568,7 +568,7 @@ void ConnectionManager::processWrapper(NetCommandRef *ref) { origProgress = s_fileProgressMap[m_localSlot][commandID]; } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - origProgress[%d] == %d for command %d\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - origProgress[%d] == %d for command %d", m_localSlot, origProgress, commandID)); m_netCommandWrapperList->processWrapper(ref); @@ -576,11 +576,11 @@ void ConnectionManager::processWrapper(NetCommandRef *ref) if (fcIt != s_fileCommandMap.end()) { Int newProgress = m_netCommandWrapperList->getPercentComplete(commandID); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - newProgress[%d] == %d for command %d\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - newProgress[%d] == %d for command %d", m_localSlot, newProgress, commandID)); if (newProgress > origProgress && newProgress < 100) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - sending a NetFileProgressCommandMsg\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - sending a NetFileProgressCommandMsg")); s_fileProgressMap[m_localSlot][commandID] = newProgress; Int progressMask = 0xff ^ (1 << m_localSlot); @@ -609,7 +609,7 @@ void ConnectionManager::processRunAheadMetrics(NetRunAheadMetricsCommandMsg *msg if ((player >= 0) && (player < MAX_SLOTS) && (isPlayerConnected(player))) { m_latencyAverages[player] = msg->getAverageLatency(); m_fpsAverages[player] = msg->getAverageFps(); - //DEBUG_LOG(("ConnectionManager::processRunAheadMetrics - player %d, fps = %d, latency = %f\n", player, msg->getAverageFps(), msg->getAverageLatency())); + //DEBUG_LOG(("ConnectionManager::processRunAheadMetrics - player %d, fps = %d, latency = %f", player, msg->getAverageFps(), msg->getAverageLatency())); if (m_fpsAverages[player] > 100) { // limit the reported frame rate average to 100. This is done because if a // user alt-tab's out of the game their frame rate climbs to in the neighborhood of @@ -630,7 +630,7 @@ void ConnectionManager::processDisconnectChat(NetDisconnectChatCommandMsg *msg) name = m_connections[playerID]->getUser()->GetName(); } unitext.format(L"[%ls] %ls", name.str(), msg->getText().str()); -// DEBUG_LOG(("ConnectionManager::processDisconnectChat - got message from player %d, message is %ls\n", playerID, unitext.str())); +// DEBUG_LOG(("ConnectionManager::processDisconnectChat - got message from player %d, message is %ls", playerID, unitext.str())); TheDisconnectMenu->showChat(unitext); // <-- need to implement this } @@ -639,16 +639,16 @@ void ConnectionManager::processChat(NetChatCommandMsg *msg) UnicodeString unitext; UnicodeString name; UnsignedByte playerID = msg->getPlayerID(); - //DEBUG_LOG(("processChat(): playerID = %d\n", playerID)); + //DEBUG_LOG(("processChat(): playerID = %d", playerID)); if (playerID == m_localSlot) { name = m_localUser->GetName(); - //DEBUG_LOG(("connection is NULL, using %ls\n", name.str())); + //DEBUG_LOG(("connection is NULL, using %ls", name.str())); } else if (((m_connections[playerID] != NULL) && (m_connections[playerID]->isQuitting() == FALSE))) { name = m_connections[playerID]->getUser()->GetName(); - //DEBUG_LOG(("connection is non-NULL, using %ls\n", name.str())); + //DEBUG_LOG(("connection is non-NULL, using %ls", name.str())); } unitext.format(L"[%ls] %ls", name.str(), msg->getText().str()); -// DEBUG_LOG(("ConnectionManager::processChat - got message from player %d (mask %8.8X), message is %ls\n", playerID, msg->getPlayerMask(), unitext.str())); +// DEBUG_LOG(("ConnectionManager::processChat - got message from player %d (mask %8.8X), message is %ls", playerID, msg->getPlayerMask(), unitext.str())); AsciiString playerName; playerName.format("player%d", msg->getPlayerID()); @@ -680,7 +680,7 @@ void ConnectionManager::processFile(NetFileCommandMsg *msg) #ifdef DEBUG_LOGGING UnicodeString log; log.format(L"Saw file transfer: '%hs' of %d bytes from %d", msg->getPortableFilename().str(), msg->getFileLength(), msg->getPlayerID()); - DEBUG_LOG(("%ls\n", log.str())); + DEBUG_LOG(("%ls", log.str())); #endif AsciiString realFileName = msg->getRealFilename(); @@ -689,13 +689,13 @@ void ConnectionManager::processFile(NetFileCommandMsg *msg) // TheSuperHackers @security slurmlord 18/06/2025 As the file name/path from the NetFileCommandMsg failed to normalize, // in other words is bogus and points outside of the approved target directory, avoid an arbitrary file overwrite vulnerability // by simply returning and let the transfer time out. - DEBUG_LOG(("Got a file name transferred that failed to normalize: '%s'!\n", msg->getPortableFilename().str())); + DEBUG_LOG(("Got a file name transferred that failed to normalize: '%s'!", msg->getPortableFilename().str())); return; } if (TheFileSystem->doesFileExist(realFileName.str())) { - DEBUG_LOG(("File exists already!\n")); + DEBUG_LOG(("File exists already!")); //return; } @@ -712,14 +712,14 @@ void ConnectionManager::processFile(NetFileCommandMsg *msg) Int actualLen = CompressionManager::decompressData(buf, len, uncompBuffer, uncompLen); if (actualLen == uncompLen) { - DEBUG_LOG(("Uncompressed Targa after map transfer\n")); + DEBUG_LOG(("Uncompressed Targa after map transfer")); deleteBuf = TRUE; buf = uncompBuffer; len = uncompLen; } else { - DEBUG_LOG(("Failed to uncompress Targa after map transfer\n")); + DEBUG_LOG(("Failed to uncompress Targa after map transfer")); delete[] uncompBuffer; // failed to decompress, so just use the source } } @@ -731,15 +731,15 @@ void ConnectionManager::processFile(NetFileCommandMsg *msg) fp->write(buf, len); fp->close(); fp = NULL; - DEBUG_LOG(("Wrote %d bytes to file %s!\n", len, realFileName.str())); + DEBUG_LOG(("Wrote %d bytes to file %s!", len, realFileName.str())); } else { - DEBUG_LOG(("Cannot open file!\n")); + DEBUG_LOG(("Cannot open file!")); } - DEBUG_LOG(("ConnectionManager::processFile() - sending a NetFileProgressCommandMsg\n")); + DEBUG_LOG(("ConnectionManager::processFile() - sending a NetFileProgressCommandMsg")); Int commandID = msg->getID(); Int newProgress = 100; @@ -771,7 +771,7 @@ void ConnectionManager::processFile(NetFileCommandMsg *msg) void ConnectionManager::processFileAnnounce(NetFileAnnounceCommandMsg *msg) { - DEBUG_LOG(("ConnectionManager::processFileAnnounce() - expecting '%s' (%s) in command %d\n", msg->getPortableFilename().str(), msg->getRealFilename().str(), msg->getFileID())); + DEBUG_LOG(("ConnectionManager::processFileAnnounce() - expecting '%s' (%s) in command %d", msg->getPortableFilename().str(), msg->getRealFilename().str(), msg->getFileID())); s_fileCommandMap[msg->getFileID()] = msg->getRealFilename(); s_fileRecipientMaskMap[msg->getFileID()] = msg->getPlayerMask(); for (Int i=0; igetFileID(), msg->getProgress())); Int oldProgress = s_fileProgressMap[msg->getPlayerID()][msg->getFileID()]; @@ -821,7 +821,7 @@ void ConnectionManager::processFrameInfo(NetFrameCommandMsg *msg) { if ((playerID >= 0) && (playerID < MAX_SLOTS)) { if (m_frameData[playerID] != NULL) { -// DEBUG_LOG(("ConnectionManager::processFrameInfo - player %d, frame %d, command count %d, received on frame %d\n", playerID, msg->getExecutionFrame(), msg->getCommandCount(), TheGameLogic->getFrame())); +// DEBUG_LOG(("ConnectionManager::processFrameInfo - player %d, frame %d, command count %d, received on frame %d", playerID, msg->getExecutionFrame(), msg->getCommandCount(), TheGameLogic->getFrame())); m_frameData[playerID]->setFrameCommandCount(msg->getExecutionFrame(), msg->getCommandCount()); } } @@ -841,7 +841,7 @@ void ConnectionManager::processAckStage1(NetCommandMsg *msg) { #if defined(RTS_DEBUG) if (doDebug == TRUE) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processAck - processing ack for command %d from player %d\n", ((NetAckStage1CommandMsg *)msg)->getCommandID(), playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processAck - processing ack for command %d from player %d", ((NetAckStage1CommandMsg *)msg)->getCommandID(), playerID)); } #endif @@ -882,24 +882,24 @@ void ConnectionManager::processAckStage2(NetCommandMsg *msg) { NetCommandRef *ref = m_pendingCommands->findMessage(commandID, playerID); if (ref != NULL) { - //DEBUG_LOG(("ConnectionManager::processAckStage2 - removing command %d from the pending commands list.\n", commandID)); + //DEBUG_LOG(("ConnectionManager::processAckStage2 - removing command %d from the pending commands list.", commandID)); DEBUG_ASSERTCRASH((m_localSlot == playerID), ("Found a command in the pending commands list that wasn't originated by the local player")); m_pendingCommands->removeMessage(ref); deleteInstance(ref); ref = NULL; } else { - //DEBUG_LOG(("ConnectionManager::processAckStage2 - Couldn't find command %d from player %d in the pending commands list.\n", commandID, playerID)); + //DEBUG_LOG(("ConnectionManager::processAckStage2 - Couldn't find command %d from player %d in the pending commands list.", commandID, playerID)); } ref = m_relayedCommands->findMessage(commandID, playerID); if (ref != NULL) { - //DEBUG_LOG(("ConnectionManager::processAckStage2 - found command ID %d from player %d in the relayed commands list.\n", commandID, playerID)); + //DEBUG_LOG(("ConnectionManager::processAckStage2 - found command ID %d from player %d in the relayed commands list.", commandID, playerID)); UnsignedByte relay = ref->getRelay(); //DEBUG_LOG(("ConnectionManager::processAckStage2 - relay was %d and is now ", relay)); relay = relay & ~(1 << msg->getPlayerID()); - //DEBUG_LOG(("%d\n", relay)); + //DEBUG_LOG(("%d", relay)); if (relay == 0) { - //DEBUG_LOG(("ConnectionManager::processAckStage2 - relay is 0, removing command from the relayed commands list.\n")); + //DEBUG_LOG(("ConnectionManager::processAckStage2 - relay is 0, removing command from the relayed commands list.")); m_relayedCommands->removeMessage(ref); NetAckStage2CommandMsg *ackmsg = newInstance(NetAckStage2CommandMsg)(ref->getCommand()); sendLocalCommand(ackmsg, 1 << ackmsg->getOriginalPlayerID()); @@ -939,12 +939,12 @@ void ConnectionManager::processAck(NetCommandMsg *msg) { PlayerLeaveCode ConnectionManager::processPlayerLeave(NetPlayerLeaveCommandMsg *msg) { UnsignedByte playerID = msg->getLeavingPlayerID(); if ((playerID != m_localSlot) && (m_connections[playerID] != NULL)) { - DEBUG_LOG(("ConnectionManager::processPlayerLeave() - setQuitting() on player %d on frame %d\n", playerID, TheGameLogic->getFrame())); + DEBUG_LOG(("ConnectionManager::processPlayerLeave() - setQuitting() on player %d on frame %d", playerID, TheGameLogic->getFrame())); m_connections[playerID]->setQuitting(); } DEBUG_ASSERTCRASH(m_frameData[playerID]->getIsQuitting() == FALSE, ("Player %d is already quitting", playerID)); if ((playerID != m_localSlot) && (m_frameData[playerID] != NULL) && (m_frameData[playerID]->getIsQuitting() == FALSE)) { - DEBUG_LOG(("ConnectionManager::processPlayerLeave - setQuitFrame on player %d for frame %d\n", playerID, TheGameLogic->getFrame()+1)); + DEBUG_LOG(("ConnectionManager::processPlayerLeave - setQuitFrame on player %d for frame %d", playerID, TheGameLogic->getFrame()+1)); m_frameData[playerID]->setQuitFrame(TheGameLogic->getFrame() + FRAMES_TO_KEEP + 1); } @@ -962,7 +962,7 @@ PlayerLeaveCode ConnectionManager::processPlayerLeave(NetPlayerLeaveCommandMsg * } PlayerLeaveCode code = disconnectPlayer(playerID); - DEBUG_LOG(("ConnectionManager::processPlayerLeave() - just disconnected player %d with ret code %d\n", playerID, code)); + DEBUG_LOG(("ConnectionManager::processPlayerLeave() - just disconnected player %d with ret code %d", playerID, code)); if (code == PLAYERLEAVECODE_PACKETROUTER) resendPendingCommands(); @@ -986,7 +986,7 @@ Bool ConnectionManager::areAllQueuesEmpty(void) { for (Int i = 0; (i < MAX_SLOTS) && retval; ++i) { if (m_connections[i] != NULL) { if (m_connections[i]->isQueueEmpty() == FALSE) { - //DEBUG_LOG(("ConnectionManager::areAllQueuesEmpty() - m_connections[%d] is not empty\n", i)); + //DEBUG_LOG(("ConnectionManager::areAllQueuesEmpty() - m_connections[%d] is not empty", i)); //m_connections[i]->debugPrintCommands(); retval = FALSE; } @@ -1014,7 +1014,7 @@ void ConnectionManager::handleLocalPlayerLeaving(UnsignedInt frame) { } msg->setPlayerID(m_localSlot); - DEBUG_LOG(("ConnectionManager::handleLocalPlayerLeaving - Local player leaving on frame %d\n", frame)); + DEBUG_LOG(("ConnectionManager::handleLocalPlayerLeaving - Local player leaving on frame %d", frame)); DEBUG_ASSERTCRASH(m_packetRouterSlot >= 0, ("ConnectionManager::handleLocalPlayerLeaving, packet router is %d, illegal value.", m_packetRouterSlot)); sendLocalCommand(msg); @@ -1052,7 +1052,7 @@ void ConnectionManager::ackCommand(NetCommandRef *ref, UnsignedInt localSlot) { originalPlayerID = bothmsg->getOriginalPlayerID(); #if defined(RTS_DEBUG) if (doDebug) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::ackCommand - doing ack both for command %d from player %d\n", bothmsg->getCommandID(), bothmsg->getOriginalPlayerID())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::ackCommand - doing ack both for command %d from player %d", bothmsg->getCommandID(), bothmsg->getOriginalPlayerID())); } #endif } else { @@ -1062,7 +1062,7 @@ void ConnectionManager::ackCommand(NetCommandRef *ref, UnsignedInt localSlot) { originalPlayerID = stage1msg->getOriginalPlayerID(); #if defined(RTS_DEBUG) if (doDebug) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::ackCommand - doing ack stage 1 for command %d from player %d\n", stage1msg->getCommandID(), stage1msg->getOriginalPlayerID())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::ackCommand - doing ack stage 1 for command %d from player %d", stage1msg->getCommandID(), stage1msg->getOriginalPlayerID())); } #endif } @@ -1080,13 +1080,13 @@ void ConnectionManager::ackCommand(NetCommandRef *ref, UnsignedInt localSlot) { // The local connection may be the packet router, in that case, the connection would be NULL. So do something about it! if ((m_packetRouterSlot >= 0) && (m_packetRouterSlot < MAX_SLOTS)) { if (m_connections[m_packetRouterSlot] != NULL) { -// DEBUG_LOG(("ConnectionManager::ackCommand - acking command %d from player %d to packet router.\n", commandID, m_packetRouterSlot)); +// DEBUG_LOG(("ConnectionManager::ackCommand - acking command %d from player %d to packet router.", commandID, m_packetRouterSlot)); m_connections[m_packetRouterSlot]->sendNetCommandMsg(ackmsg, 1 << m_packetRouterSlot); } else if (m_localSlot == m_packetRouterSlot) { // we are the packet router, send the ack to the player that sent the command. if ((msg->getPlayerID() >= 0) && (msg->getPlayerID() < MAX_SLOTS)) { if (m_connections[msg->getPlayerID()] != NULL) { -// DEBUG_LOG(("ConnectionManager::ackCommand - acking command %d from player %d directly to player.\n", commandID, msg->getPlayerID())); +// DEBUG_LOG(("ConnectionManager::ackCommand - acking command %d from player %d directly to player.", commandID, msg->getPlayerID())); m_connections[msg->getPlayerID()]->sendNetCommandMsg(ackmsg, 1 << msg->getPlayerID()); } else { // DEBUG_ASSERTCRASH(m_connections[msg->getPlayerID()] != NULL, ("Connection to player is NULL")); @@ -1115,20 +1115,20 @@ void ConnectionManager::sendRemoteCommand(NetCommandRef *msg) { return; } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - sending net command %d of type %s from player %d, relay is 0x%x\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - sending net command %d of type %s from player %d, relay is 0x%x", msg->getCommand()->getID(), GetAsciiNetCommandType(msg->getCommand()->getNetCommandType()).str(), msg->getCommand()->getPlayerID(), msg->getRelay())); UnsignedByte relay = msg->getRelay(); if ((relay & (1 << m_localSlot)) && (m_frameData[msg->getCommand()->getPlayerID()] != NULL)) { if (IsCommandSynchronized(msg->getCommand()->getNetCommandType())) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - adding net command of type %s to player %d for frame %d\n", GetAsciiNetCommandType(msg->getCommand()->getNetCommandType()).str(), msg->getCommand()->getPlayerID(), msg->getCommand()->getExecutionFrame())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - adding net command of type %s to player %d for frame %d", GetAsciiNetCommandType(msg->getCommand()->getNetCommandType()).str(), msg->getCommand()->getPlayerID(), msg->getCommand()->getExecutionFrame())); m_frameData[msg->getCommand()->getPlayerID()]->addNetCommandMsg(msg->getCommand()); } } for (Int i = 0; i < MAX_SLOTS; ++i) { if ((relay & (1 << i)) && ((m_connections[i] != NULL) && (m_connections[i]->isQuitting() == FALSE))) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - relaying command %d to player %d\n", msg->getCommand()->getID(), i)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - relaying command %d to player %d", msg->getCommand()->getID(), i)); m_connections[i]->sendNetCommandMsg(msg->getCommand(), 1 << i); actualRelay = actualRelay | (1 << i); } @@ -1138,20 +1138,20 @@ void ConnectionManager::sendRemoteCommand(NetCommandRef *msg) { NetCommandRef *ref = m_relayedCommands->addMessage(msg->getCommand()); if (ref != NULL) { ref->setRelay(actualRelay); - //DEBUG_LOG(("ConnectionManager::sendRemoteCommand - command %d added to relayed commands with relay %d\n", msg->getCommand()->getID(), ref->getRelay())); + //DEBUG_LOG(("ConnectionManager::sendRemoteCommand - command %d added to relayed commands with relay %d", msg->getCommand()->getID(), ref->getRelay())); } } // Do some metrics to find the minimum packet arrival cushion. if (IsCommandSynchronized(msg->getCommand()->getNetCommandType())) { -// DEBUG_LOG(("ConnectionManager::sendRemoteCommand - about to call allCommandsReady\n")); +// DEBUG_LOG(("ConnectionManager::sendRemoteCommand - about to call allCommandsReady")); if (allCommandsReady(msg->getCommand()->getExecutionFrame(), TRUE)) { UnsignedInt cushion = msg->getCommand()->getExecutionFrame() - TheGameLogic->getFrame(); if ((cushion < m_smallestPacketArrivalCushion) || (m_smallestPacketArrivalCushion == -1)) { m_smallestPacketArrivalCushion = cushion; } m_frameMetrics.addCushion(cushion); -// DEBUG_LOG(("Adding %d to cushion for frame %d\n", cushion, msg->getCommand()->getExecutionFrame())); +// DEBUG_LOG(("Adding %d to cushion for frame %d", cushion, msg->getCommand()->getExecutionFrame())); } } } @@ -1192,7 +1192,7 @@ void ConnectionManager::update(Bool isInGame) { if (m_connections[i] != NULL) { /* if (m_connections[i]->isQueueEmpty() == FALSE) { -// DEBUG_LOG(("ConnectionManager::update - calling doSend on connection %d\n", i)); +// DEBUG_LOG(("ConnectionManager::update - calling doSend on connection %d", i)); } */ @@ -1200,7 +1200,7 @@ void ConnectionManager::update(Bool isInGame) { if (m_connections[i]->isQuitting() && m_connections[i]->isQueueEmpty()) { - DEBUG_LOG(("ConnectionManager::update - deleting connection for slot %d\n", i)); + DEBUG_LOG(("ConnectionManager::update - deleting connection for slot %d", i)); deleteInstance(m_connections[i]); m_connections[i] = NULL; } @@ -1208,7 +1208,7 @@ void ConnectionManager::update(Bool isInGame) { if ((m_frameData[i] != NULL) && (m_frameData[i]->getIsQuitting() == TRUE)) { if (m_frameData[i]->getQuitFrame() == TheGameLogic->getFrame()) { - DEBUG_LOG(("ConnectionManager::update - deleting frame data for slot %d on quitting frame %d\n", i, m_frameData[i]->getQuitFrame())); + DEBUG_LOG(("ConnectionManager::update - deleting frame data for slot %d on quitting frame %d", i, m_frameData[i]->getQuitFrame())); deleteInstance(m_frameData[i]); m_frameData[i] = NULL; } @@ -1235,14 +1235,14 @@ void ConnectionManager::updateRunAhead(Int oldRunAhead, Int frameRate, Bool didS m_fpsAverages[m_localSlot] = m_frameMetrics.getAverageFPS(); // } if (didSelfSlug) { - //DEBUG_LOG(("ConnectionManager::updateRunAhead - local player run ahead metrics, fps = %d, actual fps = %d, latency = %f, didSelfSlug = true\n", m_fpsAverages[m_localSlot], m_frameMetrics.getAverageFPS(), m_latencyAverages[m_localSlot])); + //DEBUG_LOG(("ConnectionManager::updateRunAhead - local player run ahead metrics, fps = %d, actual fps = %d, latency = %f, didSelfSlug = true", m_fpsAverages[m_localSlot], m_frameMetrics.getAverageFPS(), m_latencyAverages[m_localSlot])); } else { - //DEBUG_LOG(("ConnectionManager::updateRunAhead - local player run ahead metrics, fps = %d, latency = %f, didSelfSlug = false\n", m_fpsAverages[m_localSlot], m_latencyAverages[m_localSlot])); + //DEBUG_LOG(("ConnectionManager::updateRunAhead - local player run ahead metrics, fps = %d, latency = %f, didSelfSlug = false", m_fpsAverages[m_localSlot], m_latencyAverages[m_localSlot])); } Int minFps; Int minFpsPlayer; getMinimumFps(minFps, minFpsPlayer); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::updateRunAhead - max latency = %f, min fps = %d, min fps player = %d old FPS = %d\n", getMaximumLatency(), minFps, minFpsPlayer, frameRate)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::updateRunAhead - max latency = %f, min fps = %d, min fps player = %d old FPS = %d", getMaximumLatency(), minFps, minFpsPlayer, frameRate)); if ((minFps >= ((frameRate * 9) / 10)) && (minFps < frameRate)) { // if the minimum fps is within 10% of the desired framerate, then keep the current minimum fps. minFps = frameRate; @@ -1253,7 +1253,7 @@ void ConnectionManager::updateRunAhead(Int oldRunAhead, Int frameRate, Bool didS if (minFps > TheGlobalData->m_framesPerSecondLimit) { minFps = TheGlobalData->m_framesPerSecondLimit; // Cap to 30 FPS. } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::updateRunAhead - minFps after adjustment is %d\n", minFps)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::updateRunAhead - minFps after adjustment is %d", minFps)); Int newRunAhead = (Int)((getMaximumLatency() / 2.0) * (Real)minFps); newRunAhead += (newRunAhead * TheGlobalData->m_networkRunAheadSlack) / 100; // Add in 10% of slack to the run ahead in case of network hiccups. if (newRunAhead < MIN_RUNAHEAD) { @@ -1288,7 +1288,7 @@ void ConnectionManager::updateRunAhead(Int oldRunAhead, Int frameRate, Bool didS msg->setRunAhead(newRunAhead); msg->setFrameRate(minFps); - //DEBUG_LOG(("ConnectionManager::updateRunAhead - new run ahead = %d, new frame rate = %d, execution frame %d\n", newRunAhead, minFps, msg->getExecutionFrame())); + //DEBUG_LOG(("ConnectionManager::updateRunAhead - new run ahead = %d, new frame rate = %d, execution frame %d", newRunAhead, minFps, msg->getExecutionFrame())); sendLocalCommand(msg, 0xff ^ (1 << minFpsPlayer)); // Send the packet to everyone but the lowest FPS player. NetRunAheadCommandMsg *msg2 = newInstance(NetRunAheadCommandMsg); @@ -1350,9 +1350,9 @@ void ConnectionManager::updateRunAhead(Int oldRunAhead, Int frameRate, Bool didS msg->setAverageFps(m_frameMetrics.getAverageFPS()); // } if (didSelfSlug) { - //DEBUG_LOG(("ConnectionManager::updateRunAhead - average latency = %f, average fps = %d, actual fps = %d, didSelfSlug = true\n", m_frameMetrics.getAverageLatency(), m_frameMetrics.getAverageFPS(), m_frameMetrics.getAverageFPS())); + //DEBUG_LOG(("ConnectionManager::updateRunAhead - average latency = %f, average fps = %d, actual fps = %d, didSelfSlug = true", m_frameMetrics.getAverageLatency(), m_frameMetrics.getAverageFPS(), m_frameMetrics.getAverageFPS())); } else { - //DEBUG_LOG(("ConnectionManager::updateRunAhead - average latency = %f, average fps = %d, didSelfSlug = false\n", m_frameMetrics.getAverageLatency(), m_frameMetrics.getAverageFPS())); + //DEBUG_LOG(("ConnectionManager::updateRunAhead - average latency = %f, average fps = %d, didSelfSlug = false", m_frameMetrics.getAverageLatency(), m_frameMetrics.getAverageFPS())); } m_connections[m_packetRouterSlot]->sendNetCommandMsg(msg, 1 << m_packetRouterSlot); msg->detach(); @@ -1397,7 +1397,7 @@ void ConnectionManager::getMinimumFps(Int &minFps, Int &minFpsPlayer) { } } } -// DEBUG_LOG(("\n")); +// DEBUG_LOG(("")); } UnsignedInt ConnectionManager::getMinimumCushion() { @@ -1423,7 +1423,7 @@ void ConnectionManager::processFrameTick(UnsignedInt frame) { m_frameMetrics.doPerFrameMetrics(frame); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processFrameTick - sending frame info for frame %d, ID %d, command count %d\n", frame, msg->getID(), commandCount)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processFrameTick - sending frame info for frame %d, ID %d, command count %d", frame, msg->getID(), commandCount)); sendLocalCommand(msg, 0xff & ~(1 << m_localSlot)); @@ -1434,7 +1434,7 @@ void ConnectionManager::processFrameTick(UnsignedInt frame) { * Set the local address. */ void ConnectionManager::setLocalAddress(UnsignedInt ip, UnsignedInt port) { - DEBUG_LOG(("ConnectionManager::setLocalAddress() - local address is %X:%d\n", ip, port)); + DEBUG_LOG(("ConnectionManager::setLocalAddress() - local address is %X:%d", ip, port)); m_localAddr = ip; m_localPort = port; } @@ -1444,7 +1444,7 @@ void ConnectionManager::setLocalAddress(UnsignedInt ip, UnsignedInt port) { */ void ConnectionManager::initTransport() { DEBUG_ASSERTCRASH((m_transport == NULL), ("m_transport already exists when trying to init it.")); - DEBUG_LOG(("ConnectionManager::initTransport - Initializing Transport\n")); + DEBUG_LOG(("ConnectionManager::initTransport - Initializing Transport")); if (m_transport != NULL) { delete m_transport; m_transport = NULL; @@ -1486,11 +1486,11 @@ void ConnectionManager::sendLocalCommand(NetCommandMsg *msg, UnsignedByte relay } msg->attach(); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommand - sending net command %d of type %s\n", msg->getID(), + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommand - sending net command %d of type %s", msg->getID(), GetAsciiNetCommandType(msg->getNetCommandType()).str())); if (relay & (1 << m_localSlot)) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommand - adding net command of type %s to player %d for frame %d\n", GetAsciiNetCommandType(msg->getNetCommandType()).str(), msg->getPlayerID(), msg->getExecutionFrame())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommand - adding net command of type %s to player %d for frame %d", GetAsciiNetCommandType(msg->getNetCommandType()).str(), msg->getPlayerID(), msg->getExecutionFrame())); m_frameData[m_localSlot]->addNetCommandMsg(msg); } @@ -1515,7 +1515,7 @@ void ConnectionManager::sendLocalCommand(NetCommandMsg *msg, UnsignedByte relay if (CommandRequiresAck(msg)) { NetCommandRef *ref = m_pendingCommands->addMessage(msg); - //DEBUG_LOG(("ConnectionManager::sendLocalCommand - added command %d to pending commands list.\n", msg->getID())); + //DEBUG_LOG(("ConnectionManager::sendLocalCommand - added command %d to pending commands list.", msg->getID())); if (ref != NULL) { ref->setRelay(temprelay); } @@ -1534,7 +1534,7 @@ void ConnectionManager::sendLocalCommandDirect(NetCommandMsg *msg, UnsignedByte if (((relay & (1 << m_localSlot)) != 0) && (m_frameData[m_localSlot] != NULL)) { if (IsCommandSynchronized(msg->getNetCommandType()) == TRUE) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommandDirect - adding net command of type %s to player %d for frame %d\n", GetAsciiNetCommandType(msg->getNetCommandType()).str(), msg->getPlayerID(), msg->getExecutionFrame())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommandDirect - adding net command of type %s to player %d for frame %d", GetAsciiNetCommandType(msg->getNetCommandType()).str(), msg->getPlayerID(), msg->getExecutionFrame())); m_frameData[m_localSlot]->addNetCommandMsg(msg); } } @@ -1544,7 +1544,7 @@ void ConnectionManager::sendLocalCommandDirect(NetCommandMsg *msg, UnsignedByte if ((m_connections[i] != NULL) && (m_connections[i]->isQuitting() == FALSE)) { UnsignedByte temprelay = 1 << i; m_connections[i]->sendNetCommandMsg(msg, temprelay); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommandDirect - Sending direct command %d of type %s to player %d\n", msg->getID(), GetAsciiNetCommandType(msg->getNetCommandType()).str(), i)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommandDirect - Sending direct command %d of type %s to player %d", msg->getID(), GetAsciiNetCommandType(msg->getNetCommandType()).str(), i)); } } } @@ -1567,12 +1567,12 @@ Bool ConnectionManager::allCommandsReady(UnsignedInt frame, Bool justTesting /* /* if (!(m_frameData[i]->allCommandsReady(frame, (frame != commandsReadyDebugSpewage) && (justTesting == FALSE)))) { if ((frame != commandsReadyDebugSpewage) && (justTesting == FALSE)) { - DEBUG_LOG(("ConnectionManager::allCommandsReady, frame %d player %d not ready.\n", frame, i)); + DEBUG_LOG(("ConnectionManager::allCommandsReady, frame %d player %d not ready.", frame, i)); commandsReadyDebugSpewage = frame; } retval = FALSE; } else { -// DEBUG_LOG(("ConnectionManager::allCommandsReady, frame %d player %d is ready.\n", frame, i)); +// DEBUG_LOG(("ConnectionManager::allCommandsReady, frame %d player %d is ready.", frame, i)); } */ @@ -1631,7 +1631,7 @@ NetCommandList *ConnectionManager::getFrameCommandList(UnsignedInt frame) m_frameData[i]->resetFrame(frame - FRAMES_TO_KEEP); // After getting the commands for that frame from this // FrameDataManager object, we need to tell it that we're // done with the messages for that frame. - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("getFrameCommandList - called reset frame on player %d for frame %d\n", i, frame - FRAMES_TO_KEEP)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("getFrameCommandList - called reset frame on player %d for frame %d", i, frame - FRAMES_TO_KEEP)); } } } @@ -1684,14 +1684,14 @@ void ConnectionManager::doKeepAlive() { time_t numSeconds = (curTime - startTime) / 1000; while ((nextIndex <= numSeconds) && (nextIndex < MAX_SLOTS)) { -// DEBUG_LOG(("ConnectionManager::doKeepAlive - trying to send keep alive message to player %d\n", nextIndex)); +// DEBUG_LOG(("ConnectionManager::doKeepAlive - trying to send keep alive message to player %d", nextIndex)); if (m_connections[nextIndex] != NULL) { NetKeepAliveCommandMsg *msg = newInstance(NetKeepAliveCommandMsg); msg->setPlayerID(m_localSlot); if (DoesCommandRequireACommandID(msg->getNetCommandType()) == TRUE) { msg->setID(GenerateNextCommandID()); } -// DEBUG_LOG(("ConnectionManager::doKeepAlive - sending keep alive message to player %d\n", nextIndex)); +// DEBUG_LOG(("ConnectionManager::doKeepAlive - sending keep alive message to player %d", nextIndex)); sendLocalCommandDirect(msg, 1 << nextIndex); msg->detach(); } @@ -1706,7 +1706,7 @@ void ConnectionManager::doKeepAlive() { PlayerLeaveCode ConnectionManager::disconnectPlayer(Int slot) { // Need to do the deletion of the slot's connection and frame data here. PlayerLeaveCode retval = PLAYERLEAVECODE_CLIENT; - DEBUG_LOG(("ConnectionManager::disconnectPlayer - disconnecting slot %d on frame %d\n", slot, TheGameLogic->getFrame())); + DEBUG_LOG(("ConnectionManager::disconnectPlayer - disconnecting slot %d on frame %d", slot, TheGameLogic->getFrame())); if ((slot < 0) || (slot >= MAX_SLOTS)) { return PLAYERLEAVECODE_UNKNOWN; @@ -1717,7 +1717,7 @@ PlayerLeaveCode ConnectionManager::disconnectPlayer(Int slot) { GameSlot *gSlot = TheGameInfo->getSlot( slot ); if (gSlot && !gSlot->lastFrameInGame()) { - DEBUG_LOG(("ConnectionManager::disconnectPlayer(%d) - slot is last in the game on frame %d\n", + DEBUG_LOG(("ConnectionManager::disconnectPlayer(%d) - slot is last in the game on frame %d", slot, TheGameLogic->getFrame())); gSlot->setLastFrameInGame(TheGameLogic->getFrame()); } @@ -1734,13 +1734,13 @@ PlayerLeaveCode ConnectionManager::disconnectPlayer(Int slot) { } if ((m_frameData[slot] != NULL) && (m_frameData[slot]->getIsQuitting() == FALSE)) { - DEBUG_LOG(("ConnectionManager::disconnectPlayer - deleting player %d frame data\n", slot)); + DEBUG_LOG(("ConnectionManager::disconnectPlayer - deleting player %d frame data", slot)); deleteInstance(m_frameData[slot]); m_frameData[slot] = NULL; } if (m_connections[slot] != NULL && !m_connections[slot]->isQuitting()) { - DEBUG_LOG(("ConnectionManager::disconnectPlayer - deleting player %d connection\n", slot)); + DEBUG_LOG(("ConnectionManager::disconnectPlayer - deleting player %d connection", slot)); deleteInstance(m_connections[slot]); m_connections[slot] = NULL; } @@ -1756,11 +1756,11 @@ PlayerLeaveCode ConnectionManager::disconnectPlayer(Int slot) { } ++index; m_packetRouterSlot = m_packetRouterFallback[index]; - DEBUG_LOG(("Packet router left. New packet router is slot %d\n", m_packetRouterSlot)); + DEBUG_LOG(("Packet router left. New packet router is slot %d", m_packetRouterSlot)); retval = PLAYERLEAVECODE_PACKETROUTER; } if (m_localSlot == slot) { - DEBUG_LOG(("Disconnecting self\n")); + DEBUG_LOG(("Disconnecting self")); retval = PLAYERLEAVECODE_LOCAL; } @@ -1786,12 +1786,12 @@ void ConnectionManager::quitGame() { if (DoesCommandRequireACommandID(disconnectMsg->getNetCommandType())) { disconnectMsg->setID(GenerateNextCommandID()); } - //DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer - about to send disconnect command\n")); + //DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer - about to send disconnect command")); sendLocalCommandDirect(disconnectMsg, 0xff ^ (1 << m_localSlot)); - //DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer - about to flush connections\n")); + //DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer - about to flush connections")); flushConnections(); // need to do this so our packet actually gets sent before the connections are deleted. - //DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer - done flushing connections\n")); + //DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer - done flushing connections")); disconnectMsg->detach(); @@ -1814,7 +1814,7 @@ void ConnectionManager::quitGame() { void ConnectionManager::disconnectLocalPlayer() { // kill the frame data and the connections for all the other players. - DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer()\n")); + DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer()")); for (Int i = 0; i < MAX_SLOTS; ++i) { if (i != m_localSlot) { disconnectPlayer(i); @@ -1828,10 +1828,10 @@ void ConnectionManager::disconnectLocalPlayer() { void ConnectionManager::flushConnections() { for (Int i = 0; i < MAX_SLOTS; ++i) { if (m_connections[i] != NULL) { -// DEBUG_LOG(("ConnectionManager::flushConnections - flushing connection to player %d\n", i)); +// DEBUG_LOG(("ConnectionManager::flushConnections - flushing connection to player %d", i)); /* if (m_connections[i]->isQueueEmpty()) { -// DEBUG_LOG(("ConnectionManager::flushConnections - connection queue empty\n")); +// DEBUG_LOG(("ConnectionManager::flushConnections - connection queue empty")); } */ m_connections[i]->doSend(); @@ -1844,14 +1844,14 @@ void ConnectionManager::flushConnections() { } void ConnectionManager::resendPendingCommands() { - //DEBUG_LOG(("ConnectionManager::resendPendingCommands()\n")); + //DEBUG_LOG(("ConnectionManager::resendPendingCommands()")); if (m_pendingCommands == NULL) { return; } NetCommandRef *ref = m_pendingCommands->getFirstMessage(); while (ref != NULL) { - //DEBUG_LOG(("ConnectionManager::resendPendingCommands - resending command %d\n", ref->getCommand()->getID())); + //DEBUG_LOG(("ConnectionManager::resendPendingCommands - resending command %d", ref->getCommand()->getID())); sendLocalCommand(ref->getCommand(), ref->getRelay()); ref = ref->getNext(); } @@ -1883,7 +1883,7 @@ void ConnectionManager::parseUserList(const GameInfo *game) Int i; Int numUsers = 0; m_localSlot = -1; - DEBUG_LOG(("Local slot is %d\n", game->getLocalSlotNum())); + DEBUG_LOG(("Local slot is %d", game->getLocalSlotNum())); for (i=0; igetConstSlot(i); // badness, but since we cast right back to const, we should be ok @@ -1904,11 +1904,11 @@ void ConnectionManager::parseUserList(const GameInfo *game) UnsignedShort port = slot->getPort(); m_connections[i]->setUser(newInstance(User)(slot->getName(), slot->getIP(), port)); m_frameData[i] = newInstance(FrameDataManager)(FALSE); - DEBUG_LOG(("Remote user is at %X:%d\n", slot->getIP(), slot->getPort())); + DEBUG_LOG(("Remote user is at %X:%d", slot->getIP(), slot->getPort())); } else { - DEBUG_LOG(("Local user is %d (%X:%d)\n", m_localSlot, slot->getIP(), slot->getPort())); + DEBUG_LOG(("Local user is %d (%X:%d)", m_localSlot, slot->getIP(), slot->getPort())); m_frameData[i] = newInstance(FrameDataManager)(TRUE); } m_frameData[i]->init(); @@ -1950,7 +1950,7 @@ void ConnectionManager::parseUserList(const GameInfo *game) char *listPos; - DEBUG_LOG(("ConnectionManager::parseUserList - looking for local user at %d.%d.%d.%d:%d\n", + DEBUG_LOG(("ConnectionManager::parseUserList - looking for local user at %d.%d.%d.%d:%d", PRINTF_IP_AS_4_INTS(m_localAddr), m_localPort)); @@ -1966,7 +1966,7 @@ void ConnectionManager::parseUserList(const GameInfo *game) if (!portStr || numUsers >= MAX_SLOTS) { - DEBUG_LOG(("ConnectionManager::parseUserList - (numUsers = %d) FAILED parseUserList with list [%s]\n", numUsers, buf)); + DEBUG_LOG(("ConnectionManager::parseUserList - (numUsers = %d) FAILED parseUserList with list [%s]", numUsers, buf)); return; } @@ -1983,13 +1983,13 @@ void ConnectionManager::parseUserList(const GameInfo *game) m_frameData[numUsers] = newInstance(FrameDataManager)(FALSE); - DEBUG_LOG(("ConnectionManager::parseUserList - User %d is %s\n", numUsers, nameStr)); + DEBUG_LOG(("ConnectionManager::parseUserList - User %d is %s", numUsers, nameStr)); } else { m_localSlot = numUsers; m_localUser.setName(nameStr); - DEBUG_LOG(("ConnectionManager::parseUserList - User %d is %s\n", numUsers, nameStr)); - DEBUG_LOG(("Local user is %d\n", m_localSlot)); + DEBUG_LOG(("ConnectionManager::parseUserList - User %d is %s", numUsers, nameStr)); + DEBUG_LOG(("Local user is %d", m_localSlot)); m_frameData[numUsers] = newInstance(FrameDataManager)(TRUE); } @@ -2003,7 +2003,7 @@ void ConnectionManager::parseUserList(const GameInfo *game) if (numUsers < 2 || m_localSlot == -1) { - DEBUG_LOG(("ConnectionManager::parseUserList - FAILED (local user = %d, num players = %d) with list [%s]\n", m_localSlot, numUsers, buf)); + DEBUG_LOG(("ConnectionManager::parseUserList - FAILED (local user = %d, num players = %d) with list [%s]", m_localSlot, numUsers, buf)); return; } @@ -2102,7 +2102,7 @@ void ConnectionManager::sendChat(UnicodeString text, Int playerMask, UnsignedInt { msg->setID(GenerateNextCommandID()); } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Chat message has ID of %d, mask of %8.8X, text of %ls\n", msg->getID(), msg->getPlayerMask(), msg->getText().str())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Chat message has ID of %d, mask of %8.8X, text of %ls", msg->getID(), msg->getPlayerMask(), msg->getText().str())); sendLocalCommand(msg, 0xff ^ (1 << m_localSlot)); processChat(msg); @@ -2129,7 +2129,7 @@ UnsignedShort ConnectionManager::sendFileAnnounce(AsciiString path, UnsignedByte { UnicodeString log; log.format(L"Not sending file '%hs' to %X\n", path.str(), playerMask); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%ls\n", log.str())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%ls", log.str())); if (TheLAN) TheLAN->OnChat(UnicodeString(L"sendFile"), 0, log, LANAPI::LANCHAT_SYSTEM); return 0; @@ -2147,13 +2147,13 @@ UnsignedShort ConnectionManager::sendFileAnnounce(AsciiString path, UnsignedByte announceMsg->setPlayerMask(playerMask); UnsignedShort fileID = GenerateNextCommandID(); announceMsg->setFileID(fileID); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFileAnnounce() - creating announce message with ID of %d from %d to mask %X for '%s' going to %X as command %d\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFileAnnounce() - creating announce message with ID of %d from %d to mask %X for '%s' going to %X as command %d", announceMsg->getID(), announceMsg->getPlayerID(), announceMask, announceMsg->getRealFilename().str(), announceMsg->getPlayerMask(), announceMsg->getFileID())); processFileAnnounce(announceMsg); // set up things for the host - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Sending file announce to %X\n", announceMask)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Sending file announce to %X", announceMask)); sendLocalCommand(announceMsg, announceMask); announceMsg->detach(); @@ -2167,7 +2167,7 @@ void ConnectionManager::sendFile(AsciiString path, UnsignedByte playerMask, Unsi { UnicodeString log; log.format(L"Not sending file '%hs' to %X\n", path.str(), playerMask); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%ls\n", log.str())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%ls", log.str())); if (TheLAN) TheLAN->OnChat(UnicodeString(L"sendFile"), 0, log, LANAPI::LANCHAT_SYSTEM); return; @@ -2199,7 +2199,7 @@ void ConnectionManager::sendFile(AsciiString path, UnsignedByte playerMask, Unsi #ifdef COMPRESS_TARGAS if (compressedBuf) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Compressed '%s' from %d to %d (%g%%) before transfer\n", path.str(), len, compressedSize, + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Compressed '%s' from %d to %d (%g%%) before transfer", path.str(), len, compressedSize, (Real)compressedSize/(Real)len*100.0f)); fileMsg->setFileData((unsigned char *)compressedBuf, compressedSize); } @@ -2209,7 +2209,7 @@ void ConnectionManager::sendFile(AsciiString path, UnsignedByte playerMask, Unsi fileMsg->setFileData((unsigned char *)buf, len); } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFile() - creating file message with ID of %d for '%s' going to %X from %d, size of %d\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFile() - creating file message with ID of %d for '%s' going to %X from %d, size of %d", fileMsg->getID(), fileMsg->getRealFilename().str(), playerMask, fileMsg->getPlayerID(), fileMsg->getFileLength())); delete[] buf; @@ -2222,7 +2222,7 @@ void ConnectionManager::sendFile(AsciiString path, UnsignedByte playerMask, Unsi } #endif // COMPRESS_TARGAS - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Sending file: '%s', len %d, to %X\n", path.str(), len, playerMask)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Sending file: '%s', len %d, to %X", path.str(), len, playerMask)); sendLocalCommand(fileMsg, playerMask); @@ -2234,7 +2234,7 @@ Int ConnectionManager::getFileTransferProgress(Int playerID, AsciiString path) FileCommandMap::iterator commandIt = s_fileCommandMap.begin(); while (commandIt != s_fileCommandMap.end()) { - //DEBUG_LOG(("ConnectionManager::getFileTransferProgress(%s): looking at existing transfer of '%s'\n", + //DEBUG_LOG(("ConnectionManager::getFileTransferProgress(%s): looking at existing transfer of '%s'", // path.str(), commandIt->second.str())); if (commandIt->second == path) { @@ -2242,8 +2242,8 @@ Int ConnectionManager::getFileTransferProgress(Int playerID, AsciiString path) } ++commandIt; } - //DEBUG_LOG(("Falling back to 0, since we couldn't find the map\n")); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::getFileTransferProgress: path %s not found\n",path.str())); + //DEBUG_LOG(("Falling back to 0, since we couldn't find the map")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::getFileTransferProgress: path %s not found",path.str())); return 0; } @@ -2333,14 +2333,14 @@ Int ConnectionManager::getSlotAverageFPS(Int slot) { #if defined(RTS_DEBUG) void ConnectionManager::debugPrintConnectionCommands() { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::debugPrintConnectionCommands - begin commands\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::debugPrintConnectionCommands - begin commands")); for (Int i = 0; i < MAX_SLOTS; ++i) { if (m_connections[i] != NULL) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::debugPrintConnectionCommands - commands for connection %d\n", i)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::debugPrintConnectionCommands - commands for connection %d", i)); m_connections[i]->debugPrintCommands(); } } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::debugPrintConnectionCommands - end commands\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::debugPrintConnectionCommands - end commands")); } #endif @@ -2353,7 +2353,7 @@ void ConnectionManager::notifyOthersOfCurrentFrame(Int frame) { msg->setID(GenerateNextCommandID()); } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::notifyOthersOfCurrentFrame - sending disconnect frame of %d, command ID = %d\n", frame, msg->getID())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::notifyOthersOfCurrentFrame - sending disconnect frame of %d, command ID = %d", frame, msg->getID())); sendLocalCommandDirect(msg, 0xff ^ (1 << m_localSlot)); NetCommandRef *ref = NEW_NETCOMMANDREF(msg); ref->setRelay(1 << m_localSlot); @@ -2362,7 +2362,7 @@ void ConnectionManager::notifyOthersOfCurrentFrame(Int frame) { msg->detach(); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::notifyOthersOfCurrentFrame - start screen on debug stuff\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::notifyOthersOfCurrentFrame - start screen on debug stuff")); #if defined(RTS_DEBUG) debugPrintConnectionCommands(); #endif @@ -2387,29 +2387,29 @@ void ConnectionManager::notifyOthersOfNewFrame(UnsignedInt frame) { } void ConnectionManager::sendFrameDataToPlayer(UnsignedInt playerID, UnsignedInt startingFrame) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending frame data to player %d starting with frame %d\n", playerID, startingFrame)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending frame data to player %d starting with frame %d", playerID, startingFrame)); for (UnsignedInt frame = startingFrame; frame < TheGameLogic->getFrame(); ++frame) { sendSingleFrameToPlayer(playerID, frame); } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - done sending commands to player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - done sending commands to player %d", playerID)); } void ConnectionManager::sendSingleFrameToPlayer(UnsignedInt playerID, UnsignedInt frame) { if ((TheGameLogic->getFrame() - FRAMES_TO_KEEP) > frame) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendSingleFrameToPlayer - player %d requested frame %d when we are on frame %d, this is too far in the past.\n", playerID, frame, TheGameLogic->getFrame())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendSingleFrameToPlayer - player %d requested frame %d when we are on frame %d, this is too far in the past.", playerID, frame, TheGameLogic->getFrame())); return; } UnsignedByte relay = 1 << playerID; - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending data for frame %d\n", frame)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending data for frame %d", frame)); for (Int i = 0; i < MAX_SLOTS; ++i) { if ((m_frameData[i] != NULL) && (i != playerID)) { // no need to send his own commands to him. NetCommandList *list = m_frameData[i]->getFrameCommandList(frame); if (list != NULL) { NetCommandRef *ref = list->getFirstMessage(); while (ref != NULL) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending command %d from player %d to player %d using relay 0x%x\n", ref->getCommand()->getID(), i, playerID, relay)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending command %d from player %d to player %d using relay 0x%x", ref->getCommand()->getID(), i, playerID, relay)); sendLocalCommandDirect(ref->getCommand(), relay); ref = ref->getNext(); } @@ -2422,7 +2422,7 @@ void ConnectionManager::sendSingleFrameToPlayer(UnsignedInt playerID, UnsignedIn msg->setID(GenerateNextCommandID()); } msg->setPlayerID(i); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending frame info from player %d to player %d for frame %d with command count %d and ID %d and relay %d\n", i, playerID, msg->getExecutionFrame(), msg->getCommandCount(), msg->getID(), relay)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending frame info from player %d to player %d for frame %d with command count %d and ID %d and relay %d", i, playerID, msg->getExecutionFrame(), msg->getCommandCount(), msg->getID(), relay)); sendLocalCommandDirect(msg, relay); msg->detach(); } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/DisconnectManager.cpp b/Generals/Code/GameEngine/Source/GameNetwork/DisconnectManager.cpp index 49913671ec..c4f368d5d3 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/DisconnectManager.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/DisconnectManager.cpp @@ -150,7 +150,7 @@ void DisconnectManager::update(ConnectionManager *conMgr) { req.timeout = 2000; m_pingsSent = req.repetitions; ThePinger->addRequest(req); - DEBUG_LOG(("DisconnectManager::update() - requesting %d pings of %d from %s\n", + DEBUG_LOG(("DisconnectManager::update() - requesting %d pings of %d from %s", req.repetitions, req.timeout, req.hostname.c_str())); } } @@ -165,13 +165,13 @@ void DisconnectManager::update(ConnectionManager *conMgr) { if (m_pingFrame != TheGameLogic->getFrame()) { // wrong frame - we're not pinging yet - DEBUG_LOG(("DisconnectManager::update() - discarding ping of %d from %s (%d reps)\n", + DEBUG_LOG(("DisconnectManager::update() - discarding ping of %d from %s (%d reps)", resp.avgPing, resp.hostname.c_str(), resp.repetitions)); } else { // right frame - DEBUG_LOG(("DisconnectManager::update() - keeping ping of %d from %s (%d reps)\n", + DEBUG_LOG(("DisconnectManager::update() - keeping ping of %d from %s (%d reps)", resp.avgPing, resp.hostname.c_str(), resp.repetitions)); if (resp.avgPing < 2000) { @@ -216,7 +216,7 @@ void DisconnectManager::updateDisconnectStatus(ConnectionManager *conMgr) { m_haveNotifiedOtherPlayersOfCurrentFrame = TRUE; } - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - curTime = %d, m_timeOfDisconnectScreenOn = %d, curTime - m_timeOfDisconnectScreenOn = %d\n", curTime, m_timeOfDisconnectScreenOn, curTime - m_timeOfDisconnectScreenOn)); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - curTime = %d, m_timeOfDisconnectScreenOn = %d, curTime - m_timeOfDisconnectScreenOn = %d", curTime, m_timeOfDisconnectScreenOn, curTime - m_timeOfDisconnectScreenOn)); if (m_timeOfDisconnectScreenOn != 0) { if ((curTime - m_timeOfDisconnectScreenOn) > TheGlobalData->m_networkDisconnectScreenNotifyTime) { @@ -228,20 +228,20 @@ void DisconnectManager::updateDisconnectStatus(ConnectionManager *conMgr) { if ((newTime < 0) || (isPlayerVotedOut(slot, conMgr) == TRUE)) { newTime = 0; - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - player %d(translated slot %d) has been voted out or timed out\n", i, slot)); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - player %d(translated slot %d) has been voted out or timed out", i, slot)); if (allOnSameFrame(conMgr) == TRUE) { - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - all on same frame\n")); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - all on same frame")); if (isLocalPlayerNextPacketRouter(conMgr) == TRUE) { - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - local player is next packet router\n")); - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - about to do the disconnect procedure for player %d\n", i)); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - local player is next packet router")); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - about to do the disconnect procedure for player %d", i)); sendDisconnectCommand(i, conMgr); disconnectPlayer(i, conMgr); sendPlayerDestruct(i, conMgr); } else { - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - local player is not the next packet router\n")); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - local player is not the next packet router")); } } else { - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - not all on same frame\n")); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - not all on same frame")); } } TheDisconnectMenu->setPlayerTimeoutTime(slot, newTime); @@ -259,7 +259,7 @@ void DisconnectManager::updateWaitForPacketRouter(ConnectionManager *conMgr) { // The guy that we were hoping would be the new packet router isn't. We're screwed, get out of the game. - DEBUG_LOG(("DisconnectManager::updateWaitForPacketRouter - timed out waiting for new packet router, quitting game\n")); + DEBUG_LOG(("DisconnectManager::updateWaitForPacketRouter - timed out waiting for new packet router, quitting game")); TheNetwork->quitGame(); } TheDisconnectMenu->setPacketRouterTimeoutTime(newTime); @@ -295,14 +295,14 @@ void DisconnectManager::processDisconnectKeepAlive(NetCommandMsg *msg, Connectio void DisconnectManager::processDisconnectPlayer(NetCommandMsg *msg, ConnectionManager *conMgr) { NetDisconnectPlayerCommandMsg *cmdMsg = (NetDisconnectPlayerCommandMsg *)msg; - DEBUG_LOG(("DisconnectManager::processDisconnectPlayer - Got disconnect player command from player %d. Disconnecting player %d on frame %d\n", msg->getPlayerID(), cmdMsg->getDisconnectSlot(), cmdMsg->getDisconnectFrame())); + DEBUG_LOG(("DisconnectManager::processDisconnectPlayer - Got disconnect player command from player %d. Disconnecting player %d on frame %d", msg->getPlayerID(), cmdMsg->getDisconnectSlot(), cmdMsg->getDisconnectFrame())); DEBUG_ASSERTCRASH(TheGameLogic->getFrame() == cmdMsg->getDisconnectFrame(), ("disconnecting player on the wrong frame!!!")); disconnectPlayer(cmdMsg->getDisconnectSlot(), conMgr); } void DisconnectManager::processPacketRouterQuery(NetCommandMsg *msg, ConnectionManager *conMgr) { NetPacketRouterQueryCommandMsg *cmdMsg = (NetPacketRouterQueryCommandMsg *)msg; - DEBUG_LOG(("DisconnectManager::processPacketRouterQuery - got a packet router query command from player %d\n", msg->getPlayerID())); + DEBUG_LOG(("DisconnectManager::processPacketRouterQuery - got a packet router query command from player %d", msg->getPlayerID())); if (conMgr->getPacketRouterSlot() == conMgr->getLocalPlayerID()) { NetPacketRouterAckCommandMsg *ackmsg = newInstance(NetPacketRouterAckCommandMsg); @@ -310,20 +310,20 @@ void DisconnectManager::processPacketRouterQuery(NetCommandMsg *msg, ConnectionM if (DoesCommandRequireACommandID(ackmsg->getNetCommandType()) == TRUE) { ackmsg->setID(GenerateNextCommandID()); } - DEBUG_LOG(("DisconnectManager::processPacketRouterQuery - We are the new packet router, responding with an packet router ack. Local player is %d\n", ackmsg->getPlayerID())); + DEBUG_LOG(("DisconnectManager::processPacketRouterQuery - We are the new packet router, responding with an packet router ack. Local player is %d", ackmsg->getPlayerID())); conMgr->sendLocalCommandDirect(ackmsg, 1 << cmdMsg->getPlayerID()); ackmsg->detach(); } else { - DEBUG_LOG(("DisconnectManager::processPacketRouterQuery - We are NOT the new packet router, these are not the droids you're looking for.\n")); + DEBUG_LOG(("DisconnectManager::processPacketRouterQuery - We are NOT the new packet router, these are not the droids you're looking for.")); } } void DisconnectManager::processPacketRouterAck(NetCommandMsg *msg, ConnectionManager *conMgr) { NetPacketRouterAckCommandMsg *cmdMsg = (NetPacketRouterAckCommandMsg *)msg; - DEBUG_LOG(("DisconnectManager::processPacketRouterAck - got packet router ack command from player %d\n", msg->getPlayerID())); + DEBUG_LOG(("DisconnectManager::processPacketRouterAck - got packet router ack command from player %d", msg->getPlayerID())); if (conMgr->getPacketRouterSlot() == cmdMsg->getPlayerID()) { - DEBUG_LOG(("DisconnectManager::processPacketRouterAck - packet router command is from who it should be.\n")); + DEBUG_LOG(("DisconnectManager::processPacketRouterAck - packet router command is from who it should be.")); resetPacketRouterTimeout(); Int currentPacketRouterSlot = conMgr->getPacketRouterSlot(); Int currentPacketRouterIndex = 0; @@ -332,17 +332,17 @@ void DisconnectManager::processPacketRouterAck(NetCommandMsg *msg, ConnectionMan } DEBUG_ASSERTCRASH((currentPacketRouterIndex < MAX_SLOTS), ("Invalid packet router index")); - DEBUG_LOG(("DisconnectManager::processPacketRouterAck - New packet router confirmed, resending pending commands\n")); + DEBUG_LOG(("DisconnectManager::processPacketRouterAck - New packet router confirmed, resending pending commands")); conMgr->resendPendingCommands(); m_currentPacketRouterIndex = currentPacketRouterIndex; - DEBUG_LOG(("DisconnectManager::processPacketRouterAck - Setting disconnect state to screen on.\n")); + DEBUG_LOG(("DisconnectManager::processPacketRouterAck - Setting disconnect state to screen on.")); m_disconnectState = DISCONNECTSTATETYPE_SCREENON; ///< set it to screen on so that the next call to AllCommandsReady can set up everything for the next frame properly. } } void DisconnectManager::processDisconnectVote(NetCommandMsg *msg, ConnectionManager *conMgr) { NetDisconnectVoteCommandMsg *cmdMsg = (NetDisconnectVoteCommandMsg *)msg; - DEBUG_LOG(("DisconnectManager::processDisconnectVote - Got a disconnect vote for player %d command from player %d\n", cmdMsg->getSlot(), cmdMsg->getPlayerID())); + DEBUG_LOG(("DisconnectManager::processDisconnectVote - Got a disconnect vote for player %d command from player %d", cmdMsg->getSlot(), cmdMsg->getPlayerID())); Int transSlot = translatedSlotPosition(msg->getPlayerID(), conMgr->getLocalPlayerID()); if (isPlayerInGame(transSlot, conMgr) == FALSE) { @@ -362,18 +362,18 @@ void DisconnectManager::processDisconnectFrame(NetCommandMsg *msg, ConnectionMan } if (m_disconnectFramesReceived[playerID] == TRUE) { - DEBUG_LOG(("DisconnectManager::processDisconnectFrame - Got two disconnect frames without an intervening disconnect screen off command from player %d. Frames are %d and %d\n", playerID, m_disconnectFrames[playerID], cmdMsg->getDisconnectFrame())); + DEBUG_LOG(("DisconnectManager::processDisconnectFrame - Got two disconnect frames without an intervening disconnect screen off command from player %d. Frames are %d and %d", playerID, m_disconnectFrames[playerID], cmdMsg->getDisconnectFrame())); } - DEBUG_LOG(("DisconnectManager::processDisconnectFrame - about to call resetPlayersVotes for player %d\n", playerID)); + DEBUG_LOG(("DisconnectManager::processDisconnectFrame - about to call resetPlayersVotes for player %d", playerID)); resetPlayersVotes(playerID, cmdMsg->getDisconnectFrame()-1, conMgr); m_disconnectFrames[playerID] = cmdMsg->getDisconnectFrame(); m_disconnectFramesReceived[playerID] = TRUE; - DEBUG_LOG(("DisconnectManager::processDisconnectFrame - Got a disconnect frame for player %d, frame = %d, local player is %d, local disconnect frame = %d, command id = %d\n", cmdMsg->getPlayerID(), cmdMsg->getDisconnectFrame(), conMgr->getLocalPlayerID(), m_disconnectFrames[conMgr->getLocalPlayerID()], cmdMsg->getID())); + DEBUG_LOG(("DisconnectManager::processDisconnectFrame - Got a disconnect frame for player %d, frame = %d, local player is %d, local disconnect frame = %d, command id = %d", cmdMsg->getPlayerID(), cmdMsg->getDisconnectFrame(), conMgr->getLocalPlayerID(), m_disconnectFrames[conMgr->getLocalPlayerID()], cmdMsg->getID())); if (playerID == conMgr->getLocalPlayerID()) { - DEBUG_LOG(("DisconnectManager::processDisconnectFrame - player %d is the local player\n", playerID)); + DEBUG_LOG(("DisconnectManager::processDisconnectFrame - player %d is the local player", playerID)); // we just got the message from the local player, check to see if we need to send // commands to anyone we already have heard from. for (Int i = 0; i < MAX_SLOTS; ++i) { @@ -381,14 +381,14 @@ void DisconnectManager::processDisconnectFrame(NetCommandMsg *msg, ConnectionMan Int transSlot = translatedSlotPosition(i, conMgr->getLocalPlayerID()); if (isPlayerInGame(transSlot, conMgr) == TRUE) { if ((m_disconnectFrames[i] < m_disconnectFrames[playerID]) && (m_disconnectFramesReceived[i] == TRUE)) { - DEBUG_LOG(("DisconnectManager::processDisconnectFrame - I have more frames than player %d, my frame = %d, their frame = %d\n", i, m_disconnectFrames[conMgr->getLocalPlayerID()], m_disconnectFrames[i])); + DEBUG_LOG(("DisconnectManager::processDisconnectFrame - I have more frames than player %d, my frame = %d, their frame = %d", i, m_disconnectFrames[conMgr->getLocalPlayerID()], m_disconnectFrames[i])); conMgr->sendFrameDataToPlayer(i, m_disconnectFrames[i]); } } } } } else if ((m_disconnectFrames[playerID] < m_disconnectFrames[conMgr->getLocalPlayerID()]) && (m_disconnectFramesReceived[playerID] == TRUE)) { - DEBUG_LOG(("DisconnectManager::processDisconnectFrame - I have more frames than player %d, my frame = %d, their frame = %d\n", playerID, m_disconnectFrames[conMgr->getLocalPlayerID()], m_disconnectFrames[playerID])); + DEBUG_LOG(("DisconnectManager::processDisconnectFrame - I have more frames than player %d, my frame = %d, their frame = %d", playerID, m_disconnectFrames[conMgr->getLocalPlayerID()], m_disconnectFrames[playerID])); conMgr->sendFrameDataToPlayer(playerID, m_disconnectFrames[playerID]); } } @@ -397,7 +397,7 @@ void DisconnectManager::processDisconnectScreenOff(NetCommandMsg *msg, Connectio NetDisconnectScreenOffCommandMsg *cmdMsg = (NetDisconnectScreenOffCommandMsg *)msg; UnsignedInt playerID = cmdMsg->getPlayerID(); - DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - got a screen off command from player %d for frame %d\n", cmdMsg->getPlayerID(), cmdMsg->getNewFrame())); + DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - got a screen off command from player %d for frame %d", cmdMsg->getPlayerID(), cmdMsg->getNewFrame())); if ((playerID < 0) || (playerID >= MAX_SLOTS)) { return; @@ -405,11 +405,11 @@ void DisconnectManager::processDisconnectScreenOff(NetCommandMsg *msg, Connectio UnsignedInt newFrame = cmdMsg->getNewFrame(); if (newFrame >= m_disconnectFrames[playerID]) { - DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - resetting the disconnect screen status for player %d\n", playerID)); + DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - resetting the disconnect screen status for player %d", playerID)); m_disconnectFramesReceived[playerID] = FALSE; m_disconnectFrames[playerID] = newFrame; // just in case we get packets out of order and the disconnect screen off message gets here before the disconnect frame message. - DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - about to call resetPlayersVotes for player %d\n", playerID)); + DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - about to call resetPlayersVotes for player %d", playerID)); resetPlayersVotes(playerID, cmdMsg->getNewFrame(), conMgr); } } @@ -418,7 +418,7 @@ void DisconnectManager::applyDisconnectVote(Int slot, UnsignedInt frame, Int fro m_playerVotes[slot][fromSlot].vote = TRUE; m_playerVotes[slot][fromSlot].frame = frame; Int numVotes = countVotesForPlayer(slot); - DEBUG_LOG(("DisconnectManager::applyDisconnectVote - added a vote to disconnect slot %d, from slot %d, for frame %d, current votes are %d\n", slot, fromSlot, frame, numVotes)); + DEBUG_LOG(("DisconnectManager::applyDisconnectVote - added a vote to disconnect slot %d, from slot %d, for frame %d, current votes are %d", slot, fromSlot, frame, numVotes)); Int transSlot = translatedSlotPosition(slot, conMgr->getLocalPlayerID()); if (transSlot != -1) { TheDisconnectMenu->updateVotes(transSlot, numVotes); @@ -433,7 +433,7 @@ void DisconnectManager::nextFrame(UnsignedInt frame, ConnectionManager *conMgr) void DisconnectManager::allCommandsReady(UnsignedInt frame, ConnectionManager *conMgr, Bool waitForPacketRouter) { if (m_disconnectState != DISCONNECTSTATETYPE_SCREENOFF) { - DEBUG_LOG(("DisconnectManager::allCommandsReady - setting screen state to off.\n")); + DEBUG_LOG(("DisconnectManager::allCommandsReady - setting screen state to off.")); TheDisconnectMenu->hideScreen(); m_disconnectState = DISCONNECTSTATETYPE_SCREENOFF; @@ -444,7 +444,7 @@ void DisconnectManager::allCommandsReady(UnsignedInt frame, ConnectionManager *c m_playerVotes[i][conMgr->getLocalPlayerID()].vote = FALSE; } - DEBUG_LOG(("DisconnectManager::allCommandsReady - resetting m_timeOfDisconnectScreenOn\n")); + DEBUG_LOG(("DisconnectManager::allCommandsReady - resetting m_timeOfDisconnectScreenOn")); m_timeOfDisconnectScreenOn = 0; } } @@ -529,7 +529,7 @@ void DisconnectManager::resetPacketRouterTimeout() { void DisconnectManager::turnOnScreen(ConnectionManager *conMgr) { TheDisconnectMenu->showScreen(); - DEBUG_LOG(("DisconnectManager::turnOnScreen - turning on screen on frame %d\n", TheGameLogic->getFrame())); + DEBUG_LOG(("DisconnectManager::turnOnScreen - turning on screen on frame %d", TheGameLogic->getFrame())); m_disconnectState = DISCONNECTSTATETYPE_SCREENON; m_lastKeepAliveSendTime = -1; populateDisconnectScreen(conMgr); @@ -539,11 +539,11 @@ void DisconnectManager::turnOnScreen(ConnectionManager *conMgr) { m_haveNotifiedOtherPlayersOfCurrentFrame = FALSE; m_timeOfDisconnectScreenOn = timeGetTime(); - DEBUG_LOG(("DisconnectManager::turnOnScreen - turned on screen at time %d\n", m_timeOfDisconnectScreenOn)); + DEBUG_LOG(("DisconnectManager::turnOnScreen - turned on screen at time %d", m_timeOfDisconnectScreenOn)); } void DisconnectManager::disconnectPlayer(Int slot, ConnectionManager *conMgr) { - DEBUG_LOG(("DisconnectManager::disconnectPlayer - Disconnecting slot number %d on frame %d\n", slot, TheGameLogic->getFrame())); + DEBUG_LOG(("DisconnectManager::disconnectPlayer - Disconnecting slot number %d on frame %d", slot, TheGameLogic->getFrame())); DEBUG_ASSERTCRASH((slot >= 0) && (slot < MAX_SLOTS), ("Attempting to disconnect an invalid slot number")); if ((slot < 0) || (slot >= (MAX_SLOTS))) { return; @@ -572,7 +572,7 @@ void DisconnectManager::disconnectPlayer(Int slot, ConnectionManager *conMgr) { DEBUG_ASSERTCRASH((retcode != PLAYERLEAVECODE_UNKNOWN), ("Invalid player leave code")); if (retcode == PLAYERLEAVECODE_PACKETROUTER) { - DEBUG_LOG(("DisconnectManager::disconnectPlayer - disconnecting player was packet router.\n")); + DEBUG_LOG(("DisconnectManager::disconnectPlayer - disconnecting player was packet router.")); conMgr->resendPendingCommands(); } @@ -580,7 +580,7 @@ void DisconnectManager::disconnectPlayer(Int slot, ConnectionManager *conMgr) { } void DisconnectManager::sendDisconnectCommand(Int slot, ConnectionManager *conMgr) { - DEBUG_LOG(("DisconnectManager::sendDisconnectCommand - Sending disconnect command for slot number %d\n", slot)); + DEBUG_LOG(("DisconnectManager::sendDisconnectCommand - Sending disconnect command for slot number %d", slot)); DEBUG_ASSERTCRASH((slot >= 0) && (slot < MAX_SLOTS), ("Attempting to send a disconnect command for an invalid slot number")); if ((slot < 0) || (slot >= (MAX_SLOTS))) { return; @@ -599,7 +599,7 @@ void DisconnectManager::sendDisconnectCommand(Int slot, ConnectionManager *conMg conMgr->sendLocalCommand(msg); - DEBUG_LOG(("DisconnectManager::sendDisconnectCommand - Sending disconnect command for slot number %d for frame %d\n", slot, disconnectFrame)); + DEBUG_LOG(("DisconnectManager::sendDisconnectCommand - Sending disconnect command for slot number %d for frame %d", slot, disconnectFrame)); msg->detach(); } @@ -709,7 +709,7 @@ void DisconnectManager::sendPlayerDestruct(Int slot, ConnectionManager *conMgr) currentID = GenerateNextCommandID(); } - DEBUG_LOG(("Queueing DestroyPlayer %d for frame %d on frame %d as command %d\n", + DEBUG_LOG(("Queueing DestroyPlayer %d for frame %d on frame %d as command %d", slot, TheNetwork->getExecutionFrame()+1, TheGameLogic->getFrame(), currentID)); NetDestroyPlayerCommandMsg *netmsg = newInstance(NetDestroyPlayerCommandMsg); @@ -789,18 +789,18 @@ Int DisconnectManager::countVotesForPlayer(Int slot) { } void DisconnectManager::resetPlayersVotes(Int playerID, UnsignedInt frame, ConnectionManager *conMgr) { - DEBUG_LOG(("DisconnectManager::resetPlayersVotes - resetting player %d's votes on frame %d\n", playerID, frame)); + DEBUG_LOG(("DisconnectManager::resetPlayersVotes - resetting player %d's votes on frame %d", playerID, frame)); // we need to reset this player's votes that happened before or on the given frame. for(Int i = 0; i < MAX_SLOTS; ++i) { if (m_playerVotes[i][playerID].frame <= frame) { - DEBUG_LOG(("DisconnectManager::resetPlayersVotes - resetting player %d's vote for player %d from frame %d on frame %d\n", playerID, i, m_playerVotes[i][playerID].frame, frame)); + DEBUG_LOG(("DisconnectManager::resetPlayersVotes - resetting player %d's vote for player %d from frame %d on frame %d", playerID, i, m_playerVotes[i][playerID].frame, frame)); m_playerVotes[i][playerID].vote = FALSE; } } Int numVotes = countVotesForPlayer(playerID); - DEBUG_LOG(("DisconnectManager::resetPlayersVotes - after adjusting votes, player %d has %d votes\n", playerID, numVotes)); + DEBUG_LOG(("DisconnectManager::resetPlayersVotes - after adjusting votes, player %d has %d votes", playerID, numVotes)); Int transSlot = translatedSlotPosition(playerID, conMgr->getLocalPlayerID()); if (transSlot != -1) { TheDisconnectMenu->updateVotes(transSlot, numVotes); diff --git a/Generals/Code/GameEngine/Source/GameNetwork/DownloadManager.cpp b/Generals/Code/GameEngine/Source/GameNetwork/DownloadManager.cpp index 1429a83e6c..139c950ebc 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/DownloadManager.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/DownloadManager.cpp @@ -164,27 +164,27 @@ HRESULT DownloadManager::OnError( Int error ) break; } m_errorString = TheGameText->fetch(s); - DEBUG_LOG(("DownloadManager::OnError(): %s(%d)\n", s.str(), error)); + DEBUG_LOG(("DownloadManager::OnError(): %s(%d)", s.str(), error)); return S_OK; } HRESULT DownloadManager::OnEnd() { m_sawEnd = true; - DEBUG_LOG(("DownloadManager::OnEnd()\n")); + DEBUG_LOG(("DownloadManager::OnEnd()")); return S_OK; } HRESULT DownloadManager::OnQueryResume() { - DEBUG_LOG(("DownloadManager::OnQueryResume()\n")); + DEBUG_LOG(("DownloadManager::OnQueryResume()")); //return DOWNLOADEVENT_DONOTRESUME; return DOWNLOADEVENT_RESUME; } HRESULT DownloadManager::OnProgressUpdate( Int bytesread, Int totalsize, Int timetaken, Int timeleft ) { - DEBUG_LOG(("DownloadManager::OnProgressUpdate(): %d/%d %d/%d\n", bytesread, totalsize, timetaken, timeleft)); + DEBUG_LOG(("DownloadManager::OnProgressUpdate(): %d/%d %d/%d", bytesread, totalsize, timetaken, timeleft)); return S_OK; } @@ -219,6 +219,6 @@ HRESULT DownloadManager::OnStatusUpdate( Int status ) break; } m_statusString = TheGameText->fetch(s); - DEBUG_LOG(("DownloadManager::OnStatusUpdate(): %s(%d)\n", s.str(), status)); + DEBUG_LOG(("DownloadManager::OnStatusUpdate(): %s(%d)", s.str(), status)); return S_OK; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/FileTransfer.cpp b/Generals/Code/GameEngine/Source/GameNetwork/FileTransfer.cpp index 0f63cd1847..0ea61dc576 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/FileTransfer.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/FileTransfer.cpp @@ -67,7 +67,7 @@ static Bool doFileTransfer( AsciiString filename, MapTransferLoadScreen *ls, Int sentFile = TRUE; } - DEBUG_LOG(("Starting file transfer loop\n")); + DEBUG_LOG(("Starting file transfer loop")); while (!fileTransferDone) { @@ -105,14 +105,14 @@ static Bool doFileTransfer( AsciiString filename, MapTransferLoadScreen *ls, Int } else { - DEBUG_LOG(("File transfer is 100%%!\n")); + DEBUG_LOG(("File transfer is 100%%!")); ls->processProgress(0, fileTransferPercent, "MapTransfer:Done"); } Int now = timeGetTime(); if (now > startTime + timeoutPeriod) // bail if we don't finish in a reasonable amount of time { - DEBUG_LOG(("Timing out file transfer\n")); + DEBUG_LOG(("Timing out file transfer")); break; } else @@ -250,7 +250,7 @@ Bool DoAnyMapTransfers(GameInfo *game) { if (TheGameInfo->getConstSlot(i)->isHuman() && !TheGameInfo->getConstSlot(i)->hasMap()) { - DEBUG_LOG(("Adding player %d to transfer mask\n", i)); + DEBUG_LOG(("Adding player %d to transfer mask", i)); mask |= (1<m_firewallBehavior, TheWritableGlobalData->m_firewallPortAllocationDelta)); + DEBUG_LOG(("FirewallHelperClass::detectFirewall - firewall behavior already specified as %d, port allocation delta is %d, skipping detection.", TheWritableGlobalData->m_firewallBehavior, TheWritableGlobalData->m_firewallPortAllocationDelta)); } return TRUE; @@ -291,7 +291,7 @@ UnsignedShort FirewallHelperClass::getNextTemporarySourcePort(Int skip) closeSpareSocket(return_port); return(return_port); } else { - DEBUG_LOG(("FirewallHelperClass::getNextTemporarySourcePort - failed to open socket on port %d\n")); + DEBUG_LOG(("FirewallHelperClass::getNextTemporarySourcePort - failed to open socket on port %d")); } } @@ -320,7 +320,7 @@ UnsignedShort FirewallHelperClass::getNextTemporarySourcePort(Int skip) *=============================================================================================*/ Bool FirewallHelperClass::sendToManglerFromPort(UnsignedInt address, UnsignedShort port, UnsignedShort packetID, Bool blitzme) { - DEBUG_LOG(("sizeof(ManglerMessage) == %d, sizeof(ManglerData) == %d\n", + DEBUG_LOG(("sizeof(ManglerMessage) == %d, sizeof(ManglerData) == %d", sizeof(ManglerMessage), sizeof(ManglerData))); /* @@ -342,7 +342,7 @@ Bool FirewallHelperClass::sendToManglerFromPort(UnsignedInt address, UnsignedSho for (Int i = 0; i < sizeof(ManglerData); ++i) { DEBUG_LOG(("%02x", *(((unsigned char *)(&(packet.data))) + i))); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); */ byteAdjust(&(packet.data)); /* @@ -350,7 +350,7 @@ Bool FirewallHelperClass::sendToManglerFromPort(UnsignedInt address, UnsignedSho for (i = 0; i < sizeof(ManglerData); ++i) { DEBUG_LOG(("%02x", *(((unsigned char *)(&(packet.data))) + i))); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); */ CRC crc; crc.computeCRC((unsigned char *)(&(packet.data.magic)), sizeof(ManglerData) - sizeof(unsigned int)); @@ -358,22 +358,22 @@ Bool FirewallHelperClass::sendToManglerFromPort(UnsignedInt address, UnsignedSho packet.length = sizeof(ManglerData); - DEBUG_LOG(("FirewallHelperClass::sendToManglerFromPort - Sending from port %d to %d.%d.%d.%d:%d\n", (UnsignedInt)port, + DEBUG_LOG(("FirewallHelperClass::sendToManglerFromPort - Sending from port %d to %d.%d.%d.%d:%d", (UnsignedInt)port, PRINTF_IP_AS_4_INTS(address), MANGLER_PORT)); /* DEBUG_LOG(("Buffer = ")); for (i = 0; i < sizeof(ManglerData); ++i) { DEBUG_LOG(("%02x", *(((unsigned char *)(&(packet.data))) + i))); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); */ SpareSocketStruct *spareSocket = findSpareSocketByPort(port); -// DEBUG_LOG(("PacketID = %u\n", packetID)); -// DEBUG_LOG(("OriginalPortNumber = %u\n", port)); +// DEBUG_LOG(("PacketID = %u", packetID)); +// DEBUG_LOG(("OriginalPortNumber = %u", port)); if (spareSocket == NULL) { DEBUG_ASSERTCRASH(spareSocket != NULL, ("Could not find spare socket for send.")); - DEBUG_LOG(("FirewallHelperClass::sendToManglerFromPort - failed to find the spare socket for port %d\n", port)); + DEBUG_LOG(("FirewallHelperClass::sendToManglerFromPort - failed to find the spare socket for port %d", port)); return FALSE; } @@ -384,15 +384,15 @@ Bool FirewallHelperClass::sendToManglerFromPort(UnsignedInt address, UnsignedSho SpareSocketStruct * FirewallHelperClass::findSpareSocketByPort(UnsignedShort port) { - DEBUG_LOG(("FirewallHelperClass::findSpareSocketByPort - trying to find spare socket with port %d\n", port)); + DEBUG_LOG(("FirewallHelperClass::findSpareSocketByPort - trying to find spare socket with port %d", port)); for (Int i = 0; i < MAX_SPARE_SOCKETS; ++i) { if (m_spareSockets[i].port == port) { - DEBUG_LOG(("FirewallHelperClass::findSpareSocketByPort - found it!\n")); + DEBUG_LOG(("FirewallHelperClass::findSpareSocketByPort - found it!")); return &(m_spareSockets[i]); } } - DEBUG_LOG(("FirewallHelperClass::findSpareSocketByPort - didn't find it\n")); + DEBUG_LOG(("FirewallHelperClass::findSpareSocketByPort - didn't find it")); return NULL; } @@ -452,20 +452,20 @@ UnsignedShort FirewallHelperClass::getManglerResponse(UnsignedShort packetID, In CRC crc; crc.computeCRC((unsigned char *)(&(message->data.magic)), sizeof(ManglerData) - sizeof(unsigned int)); if (crc.get() != htonl(message->data.CRC)) { - DEBUG_LOG(("FirewallHelperClass::getManglerResponse - Saw message, CRC mismatch. Expected CRC %u, computed CRC %u\n", message->data.CRC, crc.get())); + DEBUG_LOG(("FirewallHelperClass::getManglerResponse - Saw message, CRC mismatch. Expected CRC %u, computed CRC %u", message->data.CRC, crc.get())); continue; } byteAdjust(&(message->data)); message->length = retval; - DEBUG_LOG(("FirewallHelperClass::getManglerResponse - Saw message of %d bytes from mangler %d on port %u\n", retval, i, m_spareSockets[i].port)); - DEBUG_LOG(("FirewallHelperClass::getManglerResponse - Message has packet ID %d 0x%08X, looking for packet id %d 0x%08X\n", message->data.PacketID, message->data.PacketID, packetID, packetID)); + DEBUG_LOG(("FirewallHelperClass::getManglerResponse - Saw message of %d bytes from mangler %d on port %u", retval, i, m_spareSockets[i].port)); + DEBUG_LOG(("FirewallHelperClass::getManglerResponse - Message has packet ID %d 0x%08X, looking for packet id %d 0x%08X", message->data.PacketID, message->data.PacketID, packetID, packetID)); if (message->data.PacketID == packetID) { - DEBUG_LOG(("FirewallHelperClass::getManglerResponse - packet ID's match, returning message\n")); + DEBUG_LOG(("FirewallHelperClass::getManglerResponse - packet ID's match, returning message")); msg = message; message->length = 0; } if (ntohs(message->data.PacketID) == packetID) { - DEBUG_LOG(("FirewallHelperClass::getManglerResponse - NETWORK BYTE ORDER packet ID's match, returning message\n")); + DEBUG_LOG(("FirewallHelperClass::getManglerResponse - NETWORK BYTE ORDER packet ID's match, returning message")); msg = message; message->length = 0; } @@ -488,7 +488,7 @@ UnsignedShort FirewallHelperClass::getManglerResponse(UnsignedShort packetID, In } UnsignedShort mangled_port = msg->data.MyMangledPortNumber; - DEBUG_LOG(("Mangler is seeing packets from port %d as coming from port %d\n", (UnsignedInt)msg->data.OriginalPortNumber, (UnsignedInt)mangled_port)); + DEBUG_LOG(("Mangler is seeing packets from port %d as coming from port %d", (UnsignedInt)msg->data.OriginalPortNumber, (UnsignedInt)mangled_port)); return mangled_port; } @@ -636,13 +636,13 @@ Bool FirewallHelperClass::detectionBeginUpdate() { */ if (TheWritableGlobalData->m_firewallPortOverride != 0) { m_behavior = FIREWALL_TYPE_SIMPLE; - DEBUG_LOG(("Source port %d specified by user\n", TheGlobalData->m_firewallPortOverride)); + DEBUG_LOG(("Source port %d specified by user", TheGlobalData->m_firewallPortOverride)); if (TheGlobalData->m_firewallSendDelay) { UnsignedInt addbehavior = FIREWALL_TYPE_NETGEAR_BUG; addbehavior |= (UnsignedInt)m_behavior; m_behavior = (FirewallBehaviorType) addbehavior; - DEBUG_LOG(("Netgear bug specified by command line or SendDelay flag\n")); + DEBUG_LOG(("Netgear bug specified by command line or SendDelay flag")); } m_currentState = DETECTIONSTATE_DONE; return TRUE; @@ -652,7 +652,7 @@ Bool FirewallHelperClass::detectionBeginUpdate() { m_timeoutStart = timeGetTime(); m_timeoutLength = 5000; - DEBUG_LOG(("About to call gethostbyname for the mangler address\n")); + DEBUG_LOG(("About to call gethostbyname for the mangler address")); int namenum = 0; do { @@ -669,7 +669,7 @@ Bool FirewallHelperClass::detectionBeginUpdate() { // mangler_name_ptr = &ManglerServerAddress[namenum][0]; // mangler_port = ManglerServerPort[namenum]; //current_mangler = CurrentManglerServer; -// DEBUG_LOG(("Using mangler from servserv\n")); +// DEBUG_LOG(("Using mangler from servserv")); // } namenum++; @@ -685,7 +685,7 @@ Bool FirewallHelperClass::detectionBeginUpdate() { struct hostent *host_info = gethostbyname(temp_name); if (!host_info) { - DEBUG_LOG(("gethostbyname failed! Error code %d\n", WSAGetLastError())); + DEBUG_LOG(("gethostbyname failed! Error code %d", WSAGetLastError())); break; } @@ -706,7 +706,7 @@ Bool FirewallHelperClass::detectionBeginUpdate() { Int m = m_numManglers++; memcpy(&mangler_addresses[m][0], &host_info->h_addr_list[0][0], 4); ntohl((UnsignedInt)mangler_addresses[m]); - DEBUG_LOG(("Found mangler address at %d.%d.%d.%d\n", mangler_addresses[m][0], mangler_addresses[m][1], mangler_addresses[m][2], mangler_addresses[m][3])); + DEBUG_LOG(("Found mangler address at %d.%d.%d.%d", mangler_addresses[m][0], mangler_addresses[m][1], mangler_addresses[m][2], mangler_addresses[m][3])); } } while ((m_numManglers < MAX_NUM_MANGLERS) && ((timeGetTime() - m_timeoutStart) < m_timeoutLength)); @@ -728,7 +728,7 @@ Bool FirewallHelperClass::detectionBeginUpdate() { // memcpy(&(m_manglers[i]), &mangler_addresses[i][0], 4); } - DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Testing for Netgear bug\n")); + DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Testing for Netgear bug")); /* ** See if the user specified a netgear firewall - that will save us the trouble. @@ -737,9 +737,9 @@ Bool FirewallHelperClass::detectionBeginUpdate() { UnsignedInt addbehavior = FIREWALL_TYPE_NETGEAR_BUG; addbehavior |= (UnsignedInt)m_behavior; m_behavior = (FirewallBehaviorType) addbehavior; - DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Netgear bug specified by command line or SendDelay flag\n")); + DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Netgear bug specified by command line or SendDelay flag")); } else { - DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Netgear bug not specified\n")); + DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Netgear bug not specified")); } /* @@ -751,7 +751,7 @@ Bool FirewallHelperClass::detectionBeginUpdate() { ** */ - DEBUG_LOG(("About to start mangler test 1\n")); + DEBUG_LOG(("About to start mangler test 1")); /* ** Get a spare port number and create a new socket to bind it to. */ @@ -783,16 +783,16 @@ Bool FirewallHelperClass::detectionTest1Update() { if (m_mangledPorts[0] == 0 || m_mangledPorts[0] == m_sparePorts[0]) { if (m_mangledPorts[0] == m_sparePorts[0]) { m_sourcePortAllocationDelta = 0; - DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - Non-mangled response from mangler, quitting test.\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - Non-mangled response from mangler, quitting test.")); } if ((m_mangledPorts[0] == 0) && ((timeGetTime() - m_timeoutStart) < m_timeoutLength)) { // we are still waiting for a response and haven't timed out yet. - DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - waiting for response from mangler.\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - waiting for response from mangler.")); return FALSE; } if ((m_mangledPorts[0] == 0) && ((timeGetTime() - m_timeoutStart) >= m_timeoutLength)) { // we are still waiting for a response and we timed out. - DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - timed out waiting for response from mangler.\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - timed out waiting for response from mangler.")); } // either we have received a non-mangled response or we timed out waiting for a response. closeSpareSocket(m_sparePorts[0]); @@ -801,7 +801,7 @@ Bool FirewallHelperClass::detectionTest1Update() { return TRUE; } - DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - test 1 complete\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - test 1 complete")); /* ** Test one completed, time to start up the second test. ** @@ -831,7 +831,7 @@ Bool FirewallHelperClass::detectionTest2Update() { if ((timeGetTime() - m_timeoutStart) <= m_timeoutLength) { return FALSE; } - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - timed out waiting for mangler response\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - timed out waiting for mangler response")); m_currentState = DETECTIONSTATE_DONE; return TRUE; } @@ -851,21 +851,21 @@ Bool FirewallHelperClass::detectionTest2Update() { m_behavior = (FirewallBehaviorType)addBehavior; if (m_mangledPorts[1] == 0) { - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - got no response from mangler\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - got no response from mangler")); } else { - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - got a mangler response, no port mangling\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - got a mangler response, no port mangling")); } - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - Setting behavior to SIMPLE, done testing\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - Setting behavior to SIMPLE, done testing")); return TRUE; } if (m_mangledPorts[0] == m_mangledPorts[1]) { - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - port mangling doesn't depend on destination IP, setting to DUMB_MANGLING\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - port mangling doesn't depend on destination IP, setting to DUMB_MANGLING")); UnsignedInt addBehavior = (UnsignedInt)FIREWALL_TYPE_DUMB_MANGLING; addBehavior |= (UnsignedInt)m_behavior; m_behavior = (FirewallBehaviorType)addBehavior; } else { - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - port mangling depends on destination IP, setting to SMART_MANGLING\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - port mangling depends on destination IP, setting to SMART_MANGLING")); UnsignedInt addBehavior = (UnsignedInt)FIREWALL_TYPE_SMART_MANGLING; addBehavior |= (UnsignedInt)m_behavior; m_behavior = (FirewallBehaviorType)addBehavior; @@ -885,7 +885,7 @@ Bool FirewallHelperClass::detectionTest2Update() { m_currentTry = 0; m_packetID = m_packetID + 10; - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - moving on to 3rd test\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - moving on to 3rd test")); m_currentState = DETECTIONSTATE_TEST3; return FALSE; @@ -917,7 +917,7 @@ Bool FirewallHelperClass::detectionTest3Update() { closeSpareSocket(m_sparePorts[j]); } } - DEBUG_LOG(("FirewallHelperClass::detectionTest3Update - Failed to open all the spare sockets, bailing test\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3Update - Failed to open all the spare sockets, bailing test")); m_currentState = DETECTIONSTATE_DONE; return TRUE; } @@ -932,7 +932,7 @@ Bool FirewallHelperClass::detectionTest3Update() { m_timeoutStart = timeGetTime(); m_timeoutLength = 12000; - DEBUG_LOG(("FirewallHelperClass::detectionTest3Update - Sending to %d manglers\n", NUM_TEST_PORTS)); + DEBUG_LOG(("FirewallHelperClass::detectionTest3Update - Sending to %d manglers", NUM_TEST_PORTS)); for (i=0 ; i (Int)FIREWALL_TYPE_SIMPLE) { /* ** If the delta we got last time we played looks good then use that. */ - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForResponsesUpdate - using the port allocation delta we have from before which is %d\n", m_lastSourcePortAllocationDelta)); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForResponsesUpdate - using the port allocation delta we have from before which is %d", m_lastSourcePortAllocationDelta)); m_sourcePortAllocationDelta = m_lastSourcePortAllocationDelta; } ++m_currentTry; @@ -1041,7 +1041,7 @@ Bool FirewallHelperClass::detectionTest3WaitForResponsesUpdate() { return FALSE; } - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - starting 4th test\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - starting 4th test")); /* ** Fourth test. ** @@ -1051,7 +1051,7 @@ Bool FirewallHelperClass::detectionTest3WaitForResponsesUpdate() { if ((m_behavior & FIREWALL_TYPE_SIMPLE_PORT_ALLOCATION) != 0) { - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - simple port allocation, Testing to see if the NAT mangles differently per destination port at the same IP\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - simple port allocation, Testing to see if the NAT mangles differently per destination port at the same IP")); /* ** We need 2 source ports for this. @@ -1059,7 +1059,7 @@ Bool FirewallHelperClass::detectionTest3WaitForResponsesUpdate() { m_sparePorts[0] = getNextTemporarySourcePort(0); if (!openSpareSocket(m_sparePorts[0])) { m_currentState = DETECTIONSTATE_DONE; - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - Failed to open first spare port, bailing\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - Failed to open first spare port, bailing")); return TRUE; } @@ -1067,7 +1067,7 @@ Bool FirewallHelperClass::detectionTest3WaitForResponsesUpdate() { if (!openSpareSocket(m_sparePorts[1])) { closeSpareSocket(m_sparePorts[0]); m_currentState = DETECTIONSTATE_DONE; - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - Failed to open second spare port, bailing\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - Failed to open second spare port, bailing")); return TRUE; } @@ -1090,18 +1090,18 @@ Bool FirewallHelperClass::detectionTest3WaitForResponsesUpdate() { /* ** NAT32 uses different mangled source ports for different destination ports. */ - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - relative port allocation, NAT32 right?\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - relative port allocation, NAT32 right?")); UnsignedInt addbehavior = 0; addbehavior = (UnsignedInt)FIREWALL_TYPE_DESTINATION_PORT_DELTA; - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - adding DESTINATION PORT DELTA to behavior\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - adding DESTINATION PORT DELTA to behavior")); addbehavior |= (UnsignedInt)m_behavior; m_behavior = (FirewallBehaviorType) addbehavior; } } else { - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForResponsesUpdate - We don't have smart mangling, skipping test 4, entering test 5\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForResponsesUpdate - We don't have smart mangling, skipping test 4, entering test 5")); } - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - entering test 5\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - entering test 5")); m_currentState = DETECTIONSTATE_TEST5; return FALSE; @@ -1117,7 +1117,7 @@ Bool FirewallHelperClass::detectionTest4Stage1Update() { closeSpareSocket(m_sparePorts[0]); closeSpareSocket(m_sparePorts[1]); m_currentState = DETECTIONSTATE_DONE; - DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage1Update - timed out waiting for mangler response, quitting\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage1Update - timed out waiting for mangler response, quitting")); return TRUE; } return FALSE; @@ -1156,14 +1156,14 @@ Bool FirewallHelperClass::detectionTest4Stage2Update() { closeSpareSocket(m_sparePorts[0]); closeSpareSocket(m_sparePorts[1]); m_currentState = DETECTIONSTATE_DONE; - DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - timed out waiting for the second mangler response, quitting\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - timed out waiting for the second mangler response, quitting")); return TRUE; } return FALSE; } if (m_mangledPorts[1] != m_mangledPorts[0] + m_sourcePortAllocationDelta) { - DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - NAT uses different source ports for different destination ports\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - NAT uses different source ports for different destination ports")); UnsignedInt addbehavior = 0; addbehavior = (UnsignedInt)FIREWALL_TYPE_DESTINATION_PORT_DELTA; @@ -1172,9 +1172,9 @@ Bool FirewallHelperClass::detectionTest4Stage2Update() { } else { DEBUG_ASSERTCRASH(m_mangledPorts[1] == m_mangledPorts[0] + m_sourcePortAllocationDelta, ("Problem getting the source port deltas.")); if (m_mangledPorts[1] == m_mangledPorts[0] + m_sourcePortAllocationDelta) { - DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - NAT uses the same source port for different destination ports\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - NAT uses the same source port for different destination ports")); } else { - DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - Unable to complete destination port mangling test\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - Unable to complete destination port mangling test")); DEBUG_CRASH(("Unable to complete destination port mangling test\n")); } } @@ -1195,7 +1195,7 @@ Bool FirewallHelperClass::detectionTest5Update() { // for testing purposes and never get this far because it has behavior that doesn't require // all the tests to be performed. // BGC 10/1/02 - DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Testing for Netgear bug\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Testing for Netgear bug")); /* ** See if the user specified a netgear firewall - that will save us the trouble. @@ -1204,9 +1204,9 @@ Bool FirewallHelperClass::detectionTest5Update() { UnsignedInt addbehavior = FIREWALL_TYPE_NETGEAR_BUG; addbehavior |= (UnsignedInt)m_behavior; m_behavior = (FirewallBehaviorType) addbehavior; - DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Netgear bug specified by command line or SendDelay flag\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Netgear bug specified by command line or SendDelay flag")); } else { - DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Netgear bug not specified\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Netgear bug not specified")); } #endif // #if (0) @@ -1234,7 +1234,7 @@ Bool FirewallHelperClass::detectionTest5Update() { DEBUG_LOG((" FIREWALL_TYPE_DESTINATION_PORT_DELTA ")); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); m_currentState = DETECTIONSTATE_DONE; return TRUE; @@ -1263,7 +1263,7 @@ Int FirewallHelperClass::getNATPortAllocationScheme(Int numPorts, UnsignedShort { DEBUG_ASSERTCRASH(numPorts > 3, ("numPorts too small")); - DEBUG_LOG(("Looking for port allocation pattern in originalPorts %d, %d, %d, %d\n", originalPorts[0], originalPorts[1], originalPorts[2], originalPorts[3])); + DEBUG_LOG(("Looking for port allocation pattern in originalPorts %d, %d, %d, %d", originalPorts[0], originalPorts[1], originalPorts[2], originalPorts[3])); /* ** Sort the mangled ports into order - should be easier to detect patterns. @@ -1297,7 +1297,7 @@ Int FirewallHelperClass::getNATPortAllocationScheme(Int numPorts, UnsignedShort if (mangledPorts[1] - mangledPorts[0] == 1) { if (mangledPorts[2] - mangledPorts[1] == 1) { if (mangledPorts[3] - mangledPorts[2] == 1) { - DEBUG_LOG(("Incremental port allocation detected\n")); + DEBUG_LOG(("Incremental port allocation detected")); relativeDelta = FALSE; looksGood = TRUE; return(1); @@ -1311,7 +1311,7 @@ Int FirewallHelperClass::getNATPortAllocationScheme(Int numPorts, UnsignedShort if (mangledPorts[1] - mangledPorts[0] == 2) { if (mangledPorts[2] - mangledPorts[1] == 2) { if (mangledPorts[3] - mangledPorts[2] == 2) { - DEBUG_LOG(("Semi-incremental port allocation detected\n")); + DEBUG_LOG(("Semi-incremental port allocation detected")); relativeDelta = FALSE; looksGood = TRUE; return(2); @@ -1328,21 +1328,21 @@ Int FirewallHelperClass::getNATPortAllocationScheme(Int numPorts, UnsignedShort ** 3. Check for absolute scheme skipping 'n' ports. */ if (diff1 == diff2 && diff2 == diff3) { - DEBUG_LOG(("Looks good for absolute allocation sequence delta of %d\n", diff1)); + DEBUG_LOG(("Looks good for absolute allocation sequence delta of %d", diff1)); relativeDelta = FALSE; looksGood = TRUE; return(diff1); } if (diff1 == diff2) { - DEBUG_LOG(("Probable absolute allocation sequence delta of %d\n", diff1)); + DEBUG_LOG(("Probable absolute allocation sequence delta of %d", diff1)); relativeDelta = FALSE; looksGood = FALSE; return(diff1); } if (diff2 == diff3) { - DEBUG_LOG(("Probable absolute allocation sequence delta of %d\n", diff2)); + DEBUG_LOG(("Probable absolute allocation sequence delta of %d", diff2)); relativeDelta = FALSE; looksGood = FALSE; return(diff2); @@ -1376,7 +1376,7 @@ Int FirewallHelperClass::getNATPortAllocationScheme(Int numPorts, UnsignedShort /* ** Return a -ve result to indicate that port mangling is relative. */ - DEBUG_LOG(("Looks good for a relative port range delta of %d\n", diff1)); + DEBUG_LOG(("Looks good for a relative port range delta of %d", diff1)); relativeDelta = TRUE; looksGood = TRUE; return(diff1); @@ -1386,14 +1386,14 @@ Int FirewallHelperClass::getNATPortAllocationScheme(Int numPorts, UnsignedShort ** Look for a broken pattern. Maybe the NAT skipped a whole range. */ if (diff1 == diff2 || diff1 == diff3) { - DEBUG_LOG(("Detected probable broken relative port range delta of %d\n", diff1)); + DEBUG_LOG(("Detected probable broken relative port range delta of %d", diff1)); relativeDelta = TRUE; looksGood = FALSE; return(diff1); } if (diff2 == diff3) { - DEBUG_LOG(("Detected probable broken relative port range delta of %d\n", diff2)); + DEBUG_LOG(("Detected probable broken relative port range delta of %d", diff2)); relativeDelta = TRUE; looksGood = FALSE; return(diff2); @@ -1537,7 +1537,7 @@ Bool FirewallHelperClass::openSpareSocket(UnsignedShort port) { m_spareSockets[i].udp = NEW UDP(); if (m_spareSockets[i].udp == NULL) { - DEBUG_LOG(("FirewallHelperClass::openSpareSocket - failed to create UDP object\n")); + DEBUG_LOG(("FirewallHelperClass::openSpareSocket - failed to create UDP object")); return FALSE; } @@ -1547,7 +1547,7 @@ Bool FirewallHelperClass::openSpareSocket(UnsignedShort port) { } m_spareSockets[i].port = port; - DEBUG_LOG(("FirewallHelperClass::openSpareSocket - port %d is open for send\n", port)); + DEBUG_LOG(("FirewallHelperClass::openSpareSocket - port %d is open for send", port)); return TRUE; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/FrameData.cpp b/Generals/Code/GameEngine/Source/GameNetwork/FrameData.cpp index 9e7159c2fc..3b8c10ec3b 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/FrameData.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/FrameData.cpp @@ -68,7 +68,7 @@ void FrameData::init() m_commandList->reset(); m_frameCommandCount = -1; - //DEBUG_LOG(("FrameData::init\n")); + //DEBUG_LOG(("FrameData::init")); m_commandCount = 0; m_lastFailedCC = -2; m_lastFailedFrameCC = -2; @@ -113,23 +113,23 @@ FrameDataReturnType FrameData::allCommandsReady(Bool debugSpewage) { if (debugSpewage) { if ((m_lastFailedFrameCC != m_frameCommandCount) || (m_lastFailedCC != m_commandCount)) { - DEBUG_LOG(("FrameData::allCommandsReady - failed, frame command count = %d, command count = %d\n", m_frameCommandCount, m_commandCount)); + DEBUG_LOG(("FrameData::allCommandsReady - failed, frame command count = %d, command count = %d", m_frameCommandCount, m_commandCount)); m_lastFailedFrameCC = m_frameCommandCount; m_lastFailedCC = m_commandCount; } } if (m_commandCount > m_frameCommandCount) { - DEBUG_LOG(("FrameData::allCommandsReady - There are more commands than there should be (%d, should be %d). Commands in command list are...\n", m_commandCount, m_frameCommandCount)); + DEBUG_LOG(("FrameData::allCommandsReady - There are more commands than there should be (%d, should be %d). Commands in command list are...", m_commandCount, m_frameCommandCount)); NetCommandRef *ref = m_commandList->getFirstMessage(); while (ref != NULL) { - DEBUG_LOG(("%s, frame = %d, id = %d\n", GetAsciiNetCommandType(ref->getCommand()->getNetCommandType()).str(), ref->getCommand()->getExecutionFrame(), ref->getCommand()->getID())); + DEBUG_LOG(("%s, frame = %d, id = %d", GetAsciiNetCommandType(ref->getCommand()->getNetCommandType()).str(), ref->getCommand()->getExecutionFrame(), ref->getCommand()->getID())); ref = ref->getNext(); } - DEBUG_LOG(("FrameData::allCommandsReady - End of command list.\n")); - DEBUG_LOG(("FrameData::allCommandsReady - about to clear the command list\n")); + DEBUG_LOG(("FrameData::allCommandsReady - End of command list.")); + DEBUG_LOG(("FrameData::allCommandsReady - about to clear the command list")); reset(); - DEBUG_LOG(("FrameData::allCommandsReady - command list cleared. command list length = %d, command count = %d, frame command count = %d\n", m_commandList->length(), m_commandCount, m_frameCommandCount)); + DEBUG_LOG(("FrameData::allCommandsReady - command list cleared. command list length = %d, command count = %d, frame command count = %d", m_commandList->length(), m_commandCount, m_frameCommandCount)); return FRAMEDATA_RESEND; } return FRAMEDATA_NOTREADY; @@ -139,7 +139,7 @@ FrameDataReturnType FrameData::allCommandsReady(Bool debugSpewage) { * Set the command count for this frame */ void FrameData::setFrameCommandCount(UnsignedInt frameCommandCount) { - //DEBUG_LOG(("setFrameCommandCount to %d for frame %d\n", frameCommandCount, m_frame)); + //DEBUG_LOG(("setFrameCommandCount to %d for frame %d", frameCommandCount, m_frame)); m_frameCommandCount = frameCommandCount; } @@ -174,7 +174,7 @@ void FrameData::addCommand(NetCommandMsg *msg) { m_commandList->addMessage(msg); ++m_commandCount; - //DEBUG_LOG(("added command %d, type = %d(%s), command count = %d, frame command count = %d\n", msg->getID(), msg->getNetCommandType(), GetAsciiNetCommandType(msg->getNetCommandType()).str(), m_commandCount, m_frameCommandCount)); + //DEBUG_LOG(("added command %d, type = %d(%s), command count = %d, frame command count = %d", msg->getID(), msg->getNetCommandType(), GetAsciiNetCommandType(msg->getNetCommandType()).str(), m_commandCount, m_frameCommandCount)); } /** diff --git a/Generals/Code/GameEngine/Source/GameNetwork/FrameDataManager.cpp b/Generals/Code/GameEngine/Source/GameNetwork/FrameDataManager.cpp index 9cca5954e7..6413da01b2 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/FrameDataManager.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/FrameDataManager.cpp @@ -90,7 +90,7 @@ void FrameDataManager::update() { void FrameDataManager::addNetCommandMsg(NetCommandMsg *msg) { UnsignedInt frame = msg->getExecutionFrame(); UnsignedInt frameindex = frame % FRAME_DATA_LENGTH; - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("FrameDataManager::addNetCommandMsg - about to add a command of type %s for frame %d, frame index %d\n", GetAsciiNetCommandType(msg->getNetCommandType()).str(), frame, frameindex)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("FrameDataManager::addNetCommandMsg - about to add a command of type %s for frame %d, frame index %d", GetAsciiNetCommandType(msg->getNetCommandType()).str(), frame, frameindex)); m_frameData[frameindex].addCommand(msg); if (m_isLocal) { @@ -168,7 +168,7 @@ UnsignedInt FrameDataManager::getFrameCommandCount(UnsignedInt frame) { void FrameDataManager::zeroFrames(UnsignedInt startingFrame, UnsignedInt numFrames) { UnsignedInt frameIndex = startingFrame % FRAME_DATA_LENGTH; for (UnsignedInt i = 0; i < numFrames; ++i) { - //DEBUG_LOG(("Calling zeroFrame for frame index %d\n", frameIndex)); + //DEBUG_LOG(("Calling zeroFrame for frame index %d", frameIndex)); m_frameData[frameIndex].zeroFrame(); ++frameIndex; frameIndex = frameIndex % FRAME_DATA_LENGTH; diff --git a/Generals/Code/GameEngine/Source/GameNetwork/FrameMetrics.cpp b/Generals/Code/GameEngine/Source/GameNetwork/FrameMetrics.cpp index 8a9131b74e..a181ac0711 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/FrameMetrics.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/FrameMetrics.cpp @@ -98,7 +98,7 @@ void FrameMetrics::doPerFrameMetrics(UnsignedInt frame) { m_fpsList[m_fpsListIndex] = TheDisplay->getAverageFPS(); // m_fpsList[m_fpsListIndex] = TheGameClient->getFrame() - m_fpsStartingFrame; m_averageFps += ((Real)(m_fpsList[m_fpsListIndex])) / TheGlobalData->m_networkFPSHistoryLength; // add the new value to the average. -// DEBUG_LOG(("average after: %f\n", m_averageFps)); +// DEBUG_LOG(("average after: %f", m_averageFps)); ++m_fpsListIndex; m_fpsListIndex %= TheGlobalData->m_networkFPSHistoryLength; m_lastFpsTimeThing = curTime; @@ -120,7 +120,7 @@ void FrameMetrics::processLatencyResponse(UnsignedInt frame) { m_averageLatency += m_latencyList[latencyListIndex] / TheGlobalData->m_networkLatencyHistoryLength; if (frame % 16 == 0) { -// DEBUG_LOG(("ConnectionManager::processFrameInfoAck - average latency = %f\n", m_averageLatency)); +// DEBUG_LOG(("ConnectionManager::processFrameInfoAck - average latency = %f", m_averageLatency)); } } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameInfo.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameInfo.cpp index 324fa10e78..719988407e 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameInfo.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameInfo.cpp @@ -77,12 +77,12 @@ void GameSlot::reset() void GameSlot::saveOffOriginalInfo( void ) { - DEBUG_LOG(("GameSlot::saveOffOriginalInfo() - orig was color=%d, pos=%d, house=%d\n", + DEBUG_LOG(("GameSlot::saveOffOriginalInfo() - orig was color=%d, pos=%d, house=%d", m_origColor, m_origStartPos, m_origPlayerTemplate)); m_origPlayerTemplate = m_playerTemplate; m_origStartPos = m_startPos; m_origColor = m_color; - DEBUG_LOG(("GameSlot::saveOffOriginalInfo() - color=%d, pos=%d, house=%d\n", + DEBUG_LOG(("GameSlot::saveOffOriginalInfo() - color=%d, pos=%d, house=%d", m_color, m_startPos, m_playerTemplate)); } @@ -133,7 +133,7 @@ UnicodeString GameSlot::getApparentPlayerTemplateDisplayName( void ) const { return TheGameText->fetch("GUI:Observer"); } - DEBUG_LOG(("Fetching player template display name for player template %d (orig is %d)\n", + DEBUG_LOG(("Fetching player template display name for player template %d (orig is %d)", m_playerTemplate, m_origPlayerTemplate)); if (m_playerTemplate < 0) { @@ -434,7 +434,7 @@ void GameInfo::setSlot( Int slotNum, GameSlot slotInfo ) UnsignedInt ip = slotInfo.getIP(); #endif - DEBUG_LOG(("GameInfo::setSlot - setting slot %d to be player %ls with IP %d.%d.%d.%d\n", slotNum, slotInfo.getName().str(), + DEBUG_LOG(("GameInfo::setSlot - setting slot %d to be player %ls with IP %d.%d.%d.%d", slotNum, slotInfo.getName().str(), PRINTF_IP_AS_4_INTS(ip))); } @@ -516,7 +516,7 @@ void GameInfo::setMap( AsciiString mapName ) path.removeLastChar(); path.removeLastChar(); path.concat("tga"); - DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'\n", path.str())); + DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'", path.str())); File *fp = TheFileSystem->openFile(path.str()); if (fp) { @@ -546,7 +546,7 @@ void GameInfo::setMap( AsciiString mapName ) } } newMapName.concat("/map.ini"); - DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'\n", newMapName.str())); + DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'", newMapName.str())); fp = TheFileSystem->openFile(newMapName.str()); if (fp) { @@ -556,7 +556,7 @@ void GameInfo::setMap( AsciiString mapName ) } path = GetStrFileFromMap(m_mapName); - DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'\n", path.str())); + DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'", path.str())); fp = TheFileSystem->openFile(path.str()); if (fp) { @@ -566,7 +566,7 @@ void GameInfo::setMap( AsciiString mapName ) } path = GetSoloINIFromMap(m_mapName); - DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'\n", path.str())); + DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'", path.str())); fp = TheFileSystem->openFile(path.str()); if (fp) { @@ -576,7 +576,7 @@ void GameInfo::setMap( AsciiString mapName ) } path = GetAssetUsageFromMap(m_mapName); - DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'\n", path.str())); + DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'", path.str())); fp = TheFileSystem->openFile(path.str()); if (fp) { @@ -586,7 +586,7 @@ void GameInfo::setMap( AsciiString mapName ) } path = GetReadmeFromMap(m_mapName); - DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'\n", path.str())); + DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'", path.str())); fp = TheFileSystem->openFile(path.str()); if (fp) { @@ -619,16 +619,16 @@ void GameInfo::setMapCRC( UnsignedInt mapCRC ) //TheMapCache->updateCache(); AsciiString lowerMap = m_mapName; lowerMap.toLower(); - //DEBUG_LOG(("GameInfo::setMapCRC - looking for map file \"%s\" in the map cache\n", lowerMap.str())); + //DEBUG_LOG(("GameInfo::setMapCRC - looking for map file \"%s\" in the map cache", lowerMap.str())); std::map::iterator it = TheMapCache->find(lowerMap); if (it == TheMapCache->end()) { /* - DEBUG_LOG(("GameInfo::setMapCRC - could not find map file.\n")); + DEBUG_LOG(("GameInfo::setMapCRC - could not find map file.")); it = TheMapCache->begin(); while (it != TheMapCache->end()) { - DEBUG_LOG(("\t\"%s\"\n", it->first.str())); + DEBUG_LOG(("\t\"%s\"", it->first.str())); ++it; } */ @@ -636,12 +636,12 @@ void GameInfo::setMapCRC( UnsignedInt mapCRC ) } else if (m_mapCRC != it->second.m_CRC) { - DEBUG_LOG(("GameInfo::setMapCRC - map CRC's do not match (%X/%X).\n", m_mapCRC, it->second.m_CRC)); + DEBUG_LOG(("GameInfo::setMapCRC - map CRC's do not match (%X/%X).", m_mapCRC, it->second.m_CRC)); getSlot(getLocalSlotNum())->setMapAvailability(false); } else { - //DEBUG_LOG(("GameInfo::setMapCRC - map CRC's match.\n")); + //DEBUG_LOG(("GameInfo::setMapCRC - map CRC's match.")); getSlot(getLocalSlotNum())->setMapAvailability(true); } } @@ -662,17 +662,17 @@ void GameInfo::setMapSize( UnsignedInt mapSize ) std::map::iterator it = TheMapCache->find(lowerMap); if (it == TheMapCache->end()) { - DEBUG_LOG(("GameInfo::setMapSize - could not find map file.\n")); + DEBUG_LOG(("GameInfo::setMapSize - could not find map file.")); getSlot(getLocalSlotNum())->setMapAvailability(false); } else if (m_mapCRC != it->second.m_CRC) { - DEBUG_LOG(("GameInfo::setMapSize - map CRC's do not match.\n")); + DEBUG_LOG(("GameInfo::setMapSize - map CRC's do not match.")); getSlot(getLocalSlotNum())->setMapAvailability(false); } else { - //DEBUG_LOG(("GameInfo::setMapSize - map CRC's match.\n")); + //DEBUG_LOG(("GameInfo::setMapSize - map CRC's match.")); getSlot(getLocalSlotNum())->setMapAvailability(true); } } @@ -905,7 +905,7 @@ AsciiString GameInfoToAsciiString( const GameInfo *game ) newMapName.concat(token); mapName.nextToken(&token, "\\/"); } - DEBUG_LOG(("Map name is %s\n", mapName.str())); + DEBUG_LOG(("Map name is %s", mapName.str())); } AsciiString optionsString; @@ -992,8 +992,8 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) Bool sawMap, sawMapCRC, sawMapSize, sawSeed, sawSlotlist; sawMap = sawMapCRC = sawMapSize = sawSeed = sawSlotlist = FALSE; - //DEBUG_LOG(("Saw options of %s\n", options.str())); - DEBUG_LOG(("ParseAsciiStringToGameInfo - parsing [%s]\n", options.str())); + //DEBUG_LOG(("Saw options of %s", options.str())); + DEBUG_LOG(("ParseAsciiStringToGameInfo - parsing [%s]", options.str())); while ( (keyValPair = strtok_r(bufPtr, ";", &strPos)) != NULL ) @@ -1013,7 +1013,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) if (val.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - saw empty value, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - saw empty value, quitting")); break; } @@ -1022,7 +1022,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) if (val.getLength() < 3) { optionsOk = FALSE; - DEBUG_LOG(("ParseAsciiStringToGameInfo - saw bogus map; quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - saw bogus map; quitting")); break; } mapContentsMask = grabHexInt(val.str()); @@ -1048,12 +1048,12 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) // in other words is bogus and points outside of the approved target directory for maps, avoid an arbitrary file overwrite vulnerability // if the save or network game embeds a custom map to store at the location, by flagging the options as not OK and rejecting the game. optionsOk = FALSE; - DEBUG_LOG(("ParseAsciiStringToGameInfo - saw bogus map name ('%s'); quitting\n", mapName.str())); + DEBUG_LOG(("ParseAsciiStringToGameInfo - saw bogus map name ('%s'); quitting", mapName.str())); break; } mapName = realMapName; sawMap = true; - DEBUG_LOG(("ParseAsciiStringToGameInfo - map name is %s\n", mapName.str())); + DEBUG_LOG(("ParseAsciiStringToGameInfo - map name is %s", mapName.str())); } else if (key.compare("MC") == 0) { @@ -1070,7 +1070,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) { seed = atoi(val.str()); sawSeed = true; -// DEBUG_LOG(("ParseAsciiStringToGameInfo - random seed is %d\n", seed)); +// DEBUG_LOG(("ParseAsciiStringToGameInfo - random seed is %d", seed)); } else if (key.compare("C") == 0) { @@ -1086,7 +1086,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) AsciiString rawSlot; // Bool slotsOk = true; //flag that lets us know whether or not the slot list is good. -// DEBUG_LOG(("ParseAsciiStringToGameInfo - Parsing slot list\n")); +// DEBUG_LOG(("ParseAsciiStringToGameInfo - Parsing slot list")); for (int i=0; i= TheMultiplayerSettings->getNumColors()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - player color was invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - player color was invalid, quitting")); break; } newSlot[i].setColor(color); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - player color set to %d\n", color)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - player color set to %d", color)); //Read playerTemplate index slotValue = strtok_r(NULL,",",&slotPos); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue player template is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue player template is empty, quitting")); break; } Int playerTemplate = atoi(slotValue.str()); if (playerTemplate < PLAYERTEMPLATE_MIN || playerTemplate >= ThePlayerTemplateStore->getPlayerTemplateCount()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - player template value is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - player template value is invalid, quitting")); break; } newSlot[i].setPlayerTemplate(playerTemplate); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - player template is %d\n", playerTemplate)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - player template is %d", playerTemplate)); //Read start position index slotValue = strtok_r(NULL,",",&slotPos); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue start position is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue start position is empty, quitting")); break; } Int startPos = atoi(slotValue.str()); if (startPos < -1 || startPos >= MAX_SLOTS) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - player start position is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - player start position is invalid, quitting")); break; } newSlot[i].setStartPos(startPos); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - player start position is %d\n", startPos)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - player start position is %d", startPos)); //Read team index slotValue = strtok_r(NULL,",",&slotPos); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue team number is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue team number is empty, quitting")); break; } Int team = atoi(slotValue.str()); if (team < -1 || team >= MAX_SLOTS/2) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is invalid, quitting")); break; } newSlot[i].setTeamNumber(team); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is %d\n", team)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is %d", team)); // Read the NAT behavior slotValue = strtok_r(NULL, ",",&slotPos); if (slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - NAT behavior is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - NAT behavior is empty, quitting")); break; } FirewallHelperClass::FirewallBehaviorType NATType = (FirewallHelperClass::FirewallBehaviorType)atoi(slotValue.str()); if ((NATType < FirewallHelperClass::FIREWALL_MIN) || (NATType > FirewallHelperClass::FIREWALL_MAX)) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - NAT behavior is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - NAT behavior is invalid, quitting")); break; } newSlot[i].setNATBehavior(NATType); - DEBUG_LOG(("ParseAsciiStringToGameInfo - NAT behavior is %X\n", NATType)); + DEBUG_LOG(("ParseAsciiStringToGameInfo - NAT behavior is %X", NATType)); }// case 'H': break; case 'C': { - DEBUG_LOG(("ParseAsciiStringToGameInfo - AI player\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - AI player")); char *slotPos = NULL; //Parse out the Name AsciiString slotValue(strtok_r((char *)rawSlot.str(),",",&slotPos)); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue AI Type is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue AI Type is empty, quitting")); break; } @@ -1274,25 +1274,25 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) case 'E': { newSlot[i].setState(SLOT_EASY_AI); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - Easy AI\n")); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - Easy AI")); } break; case 'M': { newSlot[i].setState(SLOT_MED_AI); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - Medium AI\n")); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - Medium AI")); } break; case 'H': { newSlot[i].setState(SLOT_BRUTAL_AI); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - Brutal AI\n")); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - Brutal AI")); } break; default: { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - Unknown AI, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - Unknown AI, quitting")); } break; }//switch(*rawSlot.str()+1) @@ -1302,43 +1302,43 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue color is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue color is empty, quitting")); break; } Int color = atoi(slotValue.str()); if (color < -1 || color >= TheMultiplayerSettings->getNumColors()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - player color was invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - player color was invalid, quitting")); break; } newSlot[i].setColor(color); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - player color set to %d\n", color)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - player color set to %d", color)); //Read playerTemplate index slotValue = strtok_r(NULL,",",&slotPos); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue player template is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue player template is empty, quitting")); break; } Int playerTemplate = atoi(slotValue.str()); if (playerTemplate < PLAYERTEMPLATE_MIN || playerTemplate >= ThePlayerTemplateStore->getPlayerTemplateCount()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - player template value is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - player template value is invalid, quitting")); break; } newSlot[i].setPlayerTemplate(playerTemplate); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - player template is %d\n", playerTemplate)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - player template is %d", playerTemplate)); //Read start pos slotValue = strtok_r(NULL,",",&slotPos); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue start pos is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue start pos is empty, quitting")); break; } Int startPos = atoi(slotValue.str()); @@ -1357,48 +1357,48 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) if (isStartPosBad) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - start pos is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - start pos is invalid, quitting")); break; } newSlot[i].setStartPos(startPos); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - start spot is %d\n", startPos)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - start spot is %d", startPos)); //Read team index slotValue = strtok_r(NULL,",",&slotPos); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue team number is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue team number is empty, quitting")); break; } Int team = atoi(slotValue.str()); if (team < -1 || team >= MAX_SLOTS/2) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is invalid, quitting")); break; } newSlot[i].setTeamNumber(team); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is %d\n", team)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is %d", team)); }//case 'C': break; case 'O': { newSlot[i].setState( SLOT_OPEN ); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - Slot is open\n")); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - Slot is open")); }// case 'O': break; case 'X': { newSlot[i].setState( SLOT_CLOSED ); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - Slot is closed\n")); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - Slot is closed")); }// case 'X': break; default: { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - unrecognized slot entry, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - unrecognized slot entry, quitting")); } break; } @@ -1415,7 +1415,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) if( buf ) free(buf); - //DEBUG_LOG(("Options were ok == %d\n", optionsOk)); + //DEBUG_LOG(("Options were ok == %d", optionsOk)); if (optionsOk && sawMap && sawMapCRC && sawMapSize && sawSeed && sawSlotlist && sawCRC) { // We were setting the Global Data directly here, but Instead, I'm now @@ -1424,7 +1424,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) if (!game) return true; - //DEBUG_LOG(("ParseAsciiStringToGameInfo - game options all good, setting info\n")); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - game options all good, setting info")); for(Int i = 0; isetSlot(i,newSlot[i]); @@ -1439,7 +1439,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) return true; } - DEBUG_LOG(("ParseAsciiStringToGameInfo - game options messed up\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - game options messed up")); return false; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy.cpp index d9853f3b69..155eb517ac 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy.cpp @@ -407,7 +407,7 @@ void GameSpyChat::createStagingRoom( AsciiString gameName, AsciiString password, TheGameSpyChat->leaveRoom(GroupRoom); TheGameSpyChat->setCurrentGroupRoomID(0); - DEBUG_LOG(("GameSpyChat::createStagingRoom - creating staging room, name is %s\n", m_loginName.str())); + DEBUG_LOG(("GameSpyChat::createStagingRoom - creating staging room, name is %s", m_loginName.str())); peerCreateStagingRoom(m_peer, m_loginName.str(), maxPlayers, password.str(), createRoomCallback, (void *)oldGroupID, PEERFalse); } @@ -422,7 +422,7 @@ void GameSpyChat::joinBestGroupRoom( void ) while (iter != m_groupRooms.end()) { GameSpyGroupRoom room = iter->second; - DEBUG_LOG(("Group room %d: %s (%d, %d, %d, %d)\n", room.m_groupID, room.m_name.str(), room.m_numWaiting, room.m_maxWaiting, + DEBUG_LOG(("Group room %d: %s (%d, %d, %d, %d)", room.m_groupID, room.m_name.str(), room.m_numWaiting, room.m_maxWaiting, room.m_numGames, room.m_numPlaying)); if (minPlayers > 25 && room.m_numWaiting < minPlayers) @@ -535,13 +535,13 @@ void PlayerJoinedCallback(PEER peer, RoomType roomType, } if (roomType == StagingRoom && TheGameSpyGame) { - DEBUG_LOG(("StagingRoom, Game OK\n")); + DEBUG_LOG(("StagingRoom, Game OK")); for (Int i=1; igetSlot(i); if (slot && slot->getState() == SLOT_OPEN) { - DEBUG_LOG(("Putting %s in slot %d\n", nick, i)); + DEBUG_LOG(("Putting %s in slot %d", nick, i)); UnicodeString uName; uName.translate(nick); slot->setState(SLOT_PLAYER, uName); @@ -553,7 +553,7 @@ void PlayerJoinedCallback(PEER peer, RoomType roomType, Int id; UnsignedInt ip; PEERBool success = peerGetPlayerInfoNoWait(TheGameSpyChat->getPeer(), nick, &ip, &id); - DEBUG_LOG(("PlayerJoinedCallback - result from peerGetPlayerInfoNoWait, %d: ip=%d.%d.%d.%d, id=%d\n", success, + DEBUG_LOG(("PlayerJoinedCallback - result from peerGetPlayerInfoNoWait, %d: ip=%d.%d.%d.%d, id=%d", success, (ip >> 24) & 0xff, (ip >> 16) & 0xff, (ip >> 8) & 0xff, @@ -599,7 +599,7 @@ void PlayerLeftCallback(PEER peer, RoomType roomType, if (slot) { slot->setState(SLOT_OPEN); - DEBUG_LOG(("Removing %s from slot %d\n", nick, slotNum)); + DEBUG_LOG(("Removing %s from slot %d", nick, slotNum)); if (TheGameSpyGame->amIHost()) { peerUTMRoom(TheGameSpyChat->getPeer(), StagingRoom, "SL/", GameInfoToAsciiString(TheGameSpyGame).str(), PEERFalse); @@ -625,21 +625,21 @@ void PlayerChangedNickCallback(PEER peer, RoomType roomType, void PingCallback(PEER peer, const char * nick, int ping, void * param) { - DEBUG_LOG(("PingCallback\n")); + DEBUG_LOG(("PingCallback")); } void CrossPingCallback(PEER peer, const char * nick1, const char * nick2, int crossPing, void * param) { - DEBUG_LOG(("CrossPingCallback\n")); + DEBUG_LOG(("CrossPingCallback")); } static void RoomUTMCallback(PEER peer, RoomType roomType, const char * nick, const char * command, const char * parameters, PEERBool authenticated, void * param) { - DEBUG_LOG(("RoomUTMCallback: %s says %s = [%s]\n", nick, command, parameters)); + DEBUG_LOG(("RoomUTMCallback: %s says %s = [%s]", nick, command, parameters)); if (roomType == StagingRoom && TheGameSpyGame) { Int slotNum = TheGameSpyGame->getSlotNum(nick); @@ -669,7 +669,7 @@ static void PlayerUTMCallback(PEER peer, const char * nick, const char * command, const char * parameters, PEERBool authenticated, void * param) { - DEBUG_LOG(("PlayerUTMCallback: %s says %s = [%s]\n", nick, command, parameters)); + DEBUG_LOG(("PlayerUTMCallback: %s says %s = [%s]", nick, command, parameters)); if (TheGameSpyGame) { Int slotNum = TheGameSpyGame->getSlotNum(nick); @@ -687,7 +687,7 @@ static void PlayerUTMCallback(PEER peer, const char * nick, options.nextToken(&key, "="); Int val = atoi(options.str()+1); UnsignedInt uVal = atoi(options.str()+1); - DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d\n", key.str(), options.str(), slotNum)); + DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d", key.str(), options.str(), slotNum)); GameSlot *slot = TheGameSpyGame->getSlot(slotNum); if (!slot) @@ -716,7 +716,7 @@ static void PlayerUTMCallback(PEER peer, const char * nick, } else { - DEBUG_LOG(("Rejecting invalid color %d\n", val)); + DEBUG_LOG(("Rejecting invalid color %d", val)); } } else if (key == "PlayerTemplate") @@ -729,7 +729,7 @@ static void PlayerUTMCallback(PEER peer, const char * nick, } else { - DEBUG_LOG(("Rejecting invalid PlayerTemplate %d\n", val)); + DEBUG_LOG(("Rejecting invalid PlayerTemplate %d", val)); } } else if (key == "StartPos") @@ -742,7 +742,7 @@ static void PlayerUTMCallback(PEER peer, const char * nick, } else { - DEBUG_LOG(("Rejecting invalid startPos %d\n", val)); + DEBUG_LOG(("Rejecting invalid startPos %d", val)); } } else if (key == "Team") @@ -755,7 +755,7 @@ static void PlayerUTMCallback(PEER peer, const char * nick, } else { - DEBUG_LOG(("Rejecting invalid team %d\n", val)); + DEBUG_LOG(("Rejecting invalid team %d", val)); } } else if (key == "IP") @@ -768,7 +768,7 @@ static void PlayerUTMCallback(PEER peer, const char * nick, } else { - DEBUG_LOG(("Rejecting invalid IP %d\n", uVal)); + DEBUG_LOG(("Rejecting invalid IP %d", uVal)); } } else if (key == "NAT") @@ -777,12 +777,12 @@ static void PlayerUTMCallback(PEER peer, const char * nick, (val <= FirewallHelperClass::FIREWALL_TYPE_DESTINATION_PORT_DELTA)) { slot->setNATBehavior((FirewallHelperClass::FirewallBehaviorType)val); - DEBUG_LOG(("Setting NAT behavior to %d for player %d\n", val, slotNum)); + DEBUG_LOG(("Setting NAT behavior to %d for player %d", val, slotNum)); change = true; } else { - DEBUG_LOG(("Rejecting invalid NAT behavior %d from player %d\n", val, slotNum)); + DEBUG_LOG(("Rejecting invalid NAT behavior %d from player %d", val, slotNum)); } } @@ -792,9 +792,9 @@ static void PlayerUTMCallback(PEER peer, const char * nick, TheGameSpyGame->resetAccepted(); peerUTMRoom(TheGameSpyChat->getPeer(), StagingRoom, "SL/", GameInfoToAsciiString(TheGameSpyGame).str(), PEERFalse); WOLDisplaySlotList(); - DEBUG_LOG(("Slot value is color=%d, PlayerTemplate=%d, startPos=%d, team=%d, IP=0x%8.8X\n", + DEBUG_LOG(("Slot value is color=%d, PlayerTemplate=%d, startPos=%d, team=%d, IP=0x%8.8X", slot->getColor(), slot->getPlayerTemplate(), slot->getStartPos(), slot->getTeamNumber(), slot->getIP())); - DEBUG_LOG(("Slot list updated to %s\n", GameInfoToAsciiString(TheGameSpyGame).str())); + DEBUG_LOG(("Slot list updated to %s", GameInfoToAsciiString(TheGameSpyGame).str())); } @@ -808,7 +808,7 @@ void GOABasicCallback(PEER peer, PEERBool playing, char * outbuf, { snprintf(outbuf, maxlen, "\\gamename\\c&cgenerals\\gamever\\%s\\location\\%d", TheVersion->getAsciiVersion().str(), 0); - DEBUG_LOG(("GOABasicCallback: [%s]\n", outbuf)); + DEBUG_LOG(("GOABasicCallback: [%s]", outbuf)); TheGameSpyGame->gotGOACall(); } @@ -817,7 +817,7 @@ void GOAInfoCallback(PEER peer, PEERBool playing, char * outbuf, { snprintf(outbuf, maxlen, "\\hostname\\%s\\hostport\\%d\\mapname\\%s\\gametype\\%s\\numplayers\\%d\\maxplayers\\%d\\gamemode\\%s", TheGameSpyChat->getLoginName().str(), 0, TheGameSpyGame->getMap().str(), "battle", TheGameSpyGame->getNumPlayers(), TheGameSpyGame->getMaxPlayers(), "wait"); - DEBUG_LOG(("GOAInfoCallback: [%s]\n", outbuf)); + DEBUG_LOG(("GOAInfoCallback: [%s]", outbuf)); TheGameSpyGame->gotGOACall(); } @@ -826,7 +826,7 @@ void GOARulesCallback(PEER peer, PEERBool playing, char * outbuf, { snprintf(outbuf, maxlen, "\\password\\0\\seed\\%d", TheGameSpyGame->getSeed()); - DEBUG_LOG(("GOARulesCallback: [%s]\n", outbuf)); + DEBUG_LOG(("GOARulesCallback: [%s]", outbuf)); TheGameSpyGame->gotGOACall(); } @@ -836,7 +836,7 @@ void GOAPlayersCallback(PEER peer, PEERBool playing, char * outbuf, AsciiString buf, tmp; for (Int i=0; igetSlot(i); AsciiString name; switch (slot->getState()) @@ -876,13 +876,13 @@ void GOAPlayersCallback(PEER peer, PEERBool playing, char * outbuf, buf.concat(tmp); } snprintf(outbuf, maxlen, buf.str()); - DEBUG_LOG(("GOAPlayersCallback: [%s]\n", outbuf)); + DEBUG_LOG(("GOAPlayersCallback: [%s]", outbuf)); TheGameSpyGame->gotGOACall(); } void JoinRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, RoomType roomType, void *param) { - DEBUG_LOG(("JoinRoomCallback: success==%d, result==%d\n", success, result)); + DEBUG_LOG(("JoinRoomCallback: success==%d, result==%d", success, result)); switch (roomType) { case GroupRoom: @@ -896,7 +896,7 @@ void JoinRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, RoomTy // see if we need to change screens WindowLayout *layout = TheShell->top(); AsciiString windowFile = layout->getFilename(); - DEBUG_LOG(("Joined group room, active screen was %s\n", windowFile.str())); + DEBUG_LOG(("Joined group room, active screen was %s", windowFile.str())); if (windowFile.compareNoCase("Menus/WOLCustomLobby.wnd") == 0) { // already on the right screen - just refresh it @@ -914,7 +914,7 @@ void JoinRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, RoomTy // failed to join lobby - bail to welcome screen WindowLayout *layout = TheShell->top(); AsciiString windowFile = layout->getFilename(); - DEBUG_LOG(("Joined group room, active screen was %s\n", windowFile.str())); + DEBUG_LOG(("Joined group room, active screen was %s", windowFile.str())); if (windowFile.compareNoCase("Menus/WOLWelcomeMenu.wnd") != 0) { TheShell->pop(); @@ -944,7 +944,7 @@ void JoinRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, RoomTy ((GameSpyChat *)TheGameSpyChat)->finishJoiningStagingRoom(); if (success) { - DEBUG_LOG(("JoinRoomCallback - Joined staging room\n")); + DEBUG_LOG(("JoinRoomCallback - Joined staging room")); GServer server = (GServer)param; // leave any chat channels @@ -979,7 +979,7 @@ void JoinRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, RoomTy { // let the user know GSMessageBoxOk(UnicodeString(L"Oops"), UnicodeString(L"Unable to join game"), NULL); - DEBUG_LOG(("JoinRoomCallback - Failed to join staging room.\n")); + DEBUG_LOG(("JoinRoomCallback - Failed to join staging room.")); } // Update buddy location @@ -1005,7 +1005,7 @@ void JoinRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, RoomTy void createRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, RoomType roomType, void *param) { - DEBUG_LOG(("CreateRoomCallback: success==%d, result==%d\n", success, result)); + DEBUG_LOG(("CreateRoomCallback: success==%d, result==%d", success, result)); if (roomType != StagingRoom) { @@ -1021,10 +1021,10 @@ void createRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, Room { // set up the game info UnsignedInt localIP = peerGetLocalIP(TheGameSpyChat->getPeer()); - DEBUG_LOG(("createRoomCallback - peerGetLocalIP returned %d.%d.%d.%d as the local IP\n", + DEBUG_LOG(("createRoomCallback - peerGetLocalIP returned %d.%d.%d.%d as the local IP", localIP >> 24, (localIP >> 16) & 0xff, (localIP >> 8) & 0xff, localIP & 0xff)); // GetLocalChatConnectionAddress("peerchat.gamespy.com", 6667, localIP); -// DEBUG_LOG(("createRoomCallback - GetLocalChatConnectionAddress returned %d.%d.%d.%d as the local IP\n", +// DEBUG_LOG(("createRoomCallback - GetLocalChatConnectionAddress returned %d.%d.%d.%d as the local IP", // localIP >> 24, (localIP >> 16) & 0xff, (localIP >> 8) & 0xff, localIP & 0xff)); localIP = ntohl(localIP); // The IP returned from GetLocalChatConnectionAddress is in network byte order. TheGameSpyGame->setLocalIP(localIP); @@ -1094,7 +1094,7 @@ void ListGroupRoomsCallback(PEER peer, PEERBool success, int maxWaiting, int numGames, int numPlaying, void * param) { - DEBUG_LOG(("ListGroupRoomsCallback\n")); + DEBUG_LOG(("ListGroupRoomsCallback")); if (success) { if (groupID) @@ -1142,7 +1142,7 @@ void GameSpyChat::_connectCallback(PEER peer, PEERBool success, void * param) if (!success) { GSMessageBoxOk(UnicodeString(L"Error connecting"), UnicodeString(L"Failed to connect"), NULL); - DEBUG_LOG(("GameSpyChat::_connectCallback - failed to connect.\n")); + DEBUG_LOG(("GameSpyChat::_connectCallback - failed to connect.")); } if(!success) @@ -1157,7 +1157,7 @@ void GameSpyChat::_connectCallback(PEER peer, PEERBool success, void * param) return; } - DEBUG_LOG(("Connected as profile %d (%s)\n", m_profileID, m_loginName.str())); + DEBUG_LOG(("Connected as profile %d (%s)", m_profileID, m_loginName.str())); TheGameSpyGame = NEW GameSpyGameInfo; @@ -1195,13 +1195,13 @@ void GameSpyChat::_nickErrorCallback(PEER peer, int type, const char * nick, voi { intVal = atoi(appendedVal.str()) + 1; } - DEBUG_LOG(("Nickname taken: origName=%s, tries=%d\n", origName.str(), intVal)); + DEBUG_LOG(("Nickname taken: origName=%s, tries=%d", origName.str(), intVal)); if (intVal < 10) { nickStr.format("%s{%d}", origName.str(), intVal); // Retry the connect with a similar nick. - DEBUG_LOG(("GameSpyChat::_nickErrorCallback - nick was taken, setting to %s\n", nickStr.str())); + DEBUG_LOG(("GameSpyChat::_nickErrorCallback - nick was taken, setting to %s", nickStr.str())); m_loginName = nickStr; peerRetryWithNick(peer, nickStr.str()); } @@ -1230,7 +1230,7 @@ void GameSpyChat::_nickErrorCallback(PEER peer, int type, const char * nick, voi void GameSpyChat::_GPConnectCallback(GPConnection * pconnection, GPConnectResponseArg * arg, void * param) { - DEBUG_LOG(("GPConnectCallback:\n")); + DEBUG_LOG(("GPConnectCallback:")); GPResult *res = (GPResult *)param; *res = arg->result; @@ -1255,7 +1255,7 @@ static Bool inGPReconnect = false; void GameSpyChat::_GPReconnectCallback(GPConnection * pconnection, GPConnectResponseArg * arg, void * param) { inGPReconnect = false; - DEBUG_LOG(("GPConnectCallback:\n")); + DEBUG_LOG(("GPConnectCallback:")); setProfileID(arg->profile); @@ -1287,7 +1287,7 @@ void GameSpyChat::loginProfile(AsciiString loginName, AsciiString password, Asci GPResult res = GP_PARAMETER_ERROR; m_loginName = loginName; - DEBUG_LOG(("GameSpyChat::loginProfile - m_loginName set to %s\n", m_loginName.str())); + DEBUG_LOG(("GameSpyChat::loginProfile - m_loginName set to %s", m_loginName.str())); m_password = password; m_email = email; gpConnect(TheGPConnection, loginName.str(), email.str(), password.str(), GP_FIREWALL, GP_NON_BLOCKING, (GPCallback)GPConnectCallback, &res); @@ -1332,7 +1332,7 @@ void GameSpyChat::loginQuick(AsciiString login) // Connect to chat. /////////////////// m_loginName = login; - DEBUG_LOG(("GameSpyChat::loginQuick - setting login to %s\n", m_loginName)); + DEBUG_LOG(("GameSpyChat::loginQuick - setting login to %s", m_loginName)); peerConnect(m_peer, login.str(), 0, nickErrorCallback, connectCallback, NULL, PEERFalse); } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/GSConfig.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/GSConfig.cpp index a08a48733d..ce8a314f41 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/GSConfig.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/GSConfig.cpp @@ -411,12 +411,12 @@ m_qmChannel(0) } else { - DEBUG_LOG(("Unknown key '%s' = '%s' in NAT block of GameSpy Config\n", key.str(), val.str())); + DEBUG_LOG(("Unknown key '%s' = '%s' in NAT block of GameSpy Config", key.str(), val.str())); } } else { - DEBUG_LOG(("Key '%s' missing val in NAT block of GameSpy Config\n", key.str())); + DEBUG_LOG(("Key '%s' missing val in NAT block of GameSpy Config", key.str())); } } else if (inCustom) @@ -431,12 +431,12 @@ m_qmChannel(0) } else { - DEBUG_LOG(("Unknown key '%s' = '%s' in Custom block of GameSpy Config\n", key.str(), val.str())); + DEBUG_LOG(("Unknown key '%s' = '%s' in Custom block of GameSpy Config", key.str(), val.str())); } } else { - DEBUG_LOG(("Key '%s' missing val in Custom block of GameSpy Config\n", key.str())); + DEBUG_LOG(("Key '%s' missing val in Custom block of GameSpy Config", key.str())); } } else diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/LadderDefs.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/LadderDefs.cpp index 650f48b9bf..81260cd63f 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/LadderDefs.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/LadderDefs.cpp @@ -58,7 +58,7 @@ LadderInfo::LadderInfo() static LadderInfo *parseLadder(AsciiString raw) { - DEBUG_LOG(("Looking at ladder:\n%s\n", raw.str())); + DEBUG_LOG(("Looking at ladder:\n%s", raw.str())); LadderInfo *lad = NULL; AsciiString line; while (raw.nextToken(&line, "\n")) @@ -158,7 +158,7 @@ static LadderInfo *parseLadder(AsciiString raw) } else if ( lad && line.compare("") == 0 ) { - DEBUG_LOG(("Saw a ladder: name=%ls, addr=%s:%d, players=%dv%d, pass=%s, replay=%d, homepage=%s\n", + DEBUG_LOG(("Saw a ladder: name=%ls, addr=%s:%d, players=%dv%d, pass=%s, replay=%d, homepage=%s", lad->name.str(), lad->address.str(), lad->port, lad->playersPerTeam, lad->playersPerTeam, lad->cryptedPassword.str(), lad->submitReplay, lad->homepageURL.str())); // end of a ladder @@ -166,7 +166,7 @@ static LadderInfo *parseLadder(AsciiString raw) { if (lad->validFactions.size() == 0) { - DEBUG_LOG(("No factions specified. Using all.\n")); + DEBUG_LOG(("No factions specified. Using all.")); lad->validFactions.push_back("America"); lad->validFactions.push_back("China"); lad->validFactions.push_back("GLA"); @@ -179,13 +179,13 @@ static LadderInfo *parseLadder(AsciiString raw) AsciiString faction = *it; AsciiString marker; marker.format("INI:Faction%s", faction.str()); - DEBUG_LOG(("Faction %s has marker %s corresponding to str %ls\n", faction.str(), marker.str(), TheGameText->fetch(marker).str())); + DEBUG_LOG(("Faction %s has marker %s corresponding to str %ls", faction.str(), marker.str(), TheGameText->fetch(marker).str())); } } if (lad->validMaps.size() == 0) { - DEBUG_LOG(("No maps specified. Using all.\n")); + DEBUG_LOG(("No maps specified. Using all.")); std::list qmMaps = TheGameSpyConfig->getQMMaps(); for (std::list::const_iterator it = qmMaps.begin(); it != qmMaps.end(); ++it) { @@ -305,12 +305,12 @@ LadderList::LadderList() lad->index = index++; if (inLadders) { - DEBUG_LOG(("Adding to standard ladders\n")); + DEBUG_LOG(("Adding to standard ladders")); m_standardLadders.push_back(lad); } else { - DEBUG_LOG(("Adding to special ladders\n")); + DEBUG_LOG(("Adding to special ladders")); m_specialLadders.push_back(lad); } } @@ -327,7 +327,7 @@ LadderList::LadderList() // look for local ladders loadLocalLadders(); - DEBUG_LOG(("After looking for ladders, we have %d local, %d special && %d normal\n", m_localLadders.size(), m_specialLadders.size(), m_standardLadders.size())); + DEBUG_LOG(("After looking for ladders, we have %d local, %d special && %d normal", m_localLadders.size(), m_specialLadders.size(), m_standardLadders.size())); } LadderList::~LadderList() @@ -449,7 +449,7 @@ void LadderList::loadLocalLadders( void ) while (it != filenameList.end()) { AsciiString filename = *it; - DEBUG_LOG(("Looking at possible ladder info file '%s'\n", filename.str())); + DEBUG_LOG(("Looking at possible ladder info file '%s'", filename.str())); filename.toLower(); checkLadder( filename, index-- ); ++it; @@ -475,7 +475,7 @@ void LadderList::checkLadder( AsciiString fname, Int index ) fp = NULL; } - DEBUG_LOG(("Read %d bytes from '%s'\n", rawData.getLength(), fname.str())); + DEBUG_LOG(("Read %d bytes from '%s'", rawData.getLength(), fname.str())); if (rawData.isEmpty()) return; @@ -488,21 +488,21 @@ void LadderList::checkLadder( AsciiString fname, Int index ) // sanity check if (li->address.isEmpty()) { - DEBUG_LOG(("Bailing because of li->address.isEmpty()\n")); + DEBUG_LOG(("Bailing because of li->address.isEmpty()")); delete li; return; } if (!li->port) { - DEBUG_LOG(("Bailing because of !li->port\n")); + DEBUG_LOG(("Bailing because of !li->port")); delete li; return; } if (li->validMaps.size() == 0) { - DEBUG_LOG(("Bailing because of li->validMaps.size() == 0\n")); + DEBUG_LOG(("Bailing because of li->validMaps.size() == 0")); delete li; return; } @@ -517,6 +517,6 @@ void LadderList::checkLadder( AsciiString fname, Int index ) // fname.removeLastChar(); // remove .lad //li->name = UnicodeString(MultiByteToWideCharSingleLine(fname.reverseFind('\\')+1).c_str()); - DEBUG_LOG(("Adding local ladder %ls\n", li->name.str())); + DEBUG_LOG(("Adding local ladder %ls", li->name.str())); m_localLadders.push_back(li); } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp index ad08e00df9..eebb4e3e35 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp @@ -282,7 +282,7 @@ static void queuePatch(Bool mandatory, AsciiString downloadURL) AsciiString fileName = "patches\\"; fileName.concat(fileStr); - DEBUG_LOG(("download URL split: %d [%s] [%s] [%s] [%s] [%s] [%s]\n", + DEBUG_LOG(("download URL split: %d [%s] [%s] [%s] [%s] [%s] [%s]", success, connectionType.str(), server.str(), user.str(), pass.str(), filePath.str(), fileName.str())); @@ -338,9 +338,9 @@ static GHTTPBool motdCallback( GHTTPRequest request, GHTTPResult result, onlineCancelWindow = NULL; } - DEBUG_LOG(("------- Got MOTD before going online -------\n")); - DEBUG_LOG(("%s\n", (MOTDBuffer)?MOTDBuffer:"")); - DEBUG_LOG(("--------------------------------------------\n")); + DEBUG_LOG(("------- Got MOTD before going online -------")); + DEBUG_LOG(("%s", (MOTDBuffer)?MOTDBuffer:"")); + DEBUG_LOG(("--------------------------------------------")); if (!checksLeftBeforeOnline) startOnline(); @@ -405,7 +405,7 @@ static GHTTPBool configCallback( GHTTPRequest request, GHTTPResult result, onlineCancelWindow = NULL; } - DEBUG_LOG(("Got Config before going online\n")); + DEBUG_LOG(("Got Config before going online")); if (!checksLeftBeforeOnline) startOnline(); @@ -425,11 +425,11 @@ static GHTTPBool configHeadCallback( GHTTPRequest request, GHTTPResult result, return GHTTPTrue; } - DEBUG_LOG(("HTTP head resp: res=%d, len=%d, buf=[%s]\n", result, bufferLen, buffer)); + DEBUG_LOG(("HTTP head resp: res=%d, len=%d, buf=[%s]", result, bufferLen, buffer)); if (result == GHTTPSuccess) { - DEBUG_LOG(("Headers are [%s]\n", ghttpGetHeaders( request ))); + DEBUG_LOG(("Headers are [%s]", ghttpGetHeaders( request ))); AsciiString headers(ghttpGetHeaders( request )); AsciiString line; @@ -480,7 +480,7 @@ static GHTTPBool configHeadCallback( GHTTPRequest request, GHTTPResult result, configBuffer[fileLen-1] = 0; fclose(fp); - DEBUG_LOG(("Got Config before going online\n")); + DEBUG_LOG(("Got Config before going online")); if (!checksLeftBeforeOnline) startOnline(); @@ -515,7 +515,7 @@ static GHTTPBool gamePatchCheckCallback( GHTTPRequest request, GHTTPResult resul --checksLeftBeforeOnline; DEBUG_ASSERTCRASH(checksLeftBeforeOnline>=0, ("Too many callbacks")); - DEBUG_LOG(("Result=%d, buffer=[%s], len=%d\n", result, buffer, bufferLen)); + DEBUG_LOG(("Result=%d, buffer=[%s], len=%d", result, buffer, bufferLen)); if (result != GHTTPSuccess) { if (!checkingForPatchBeforeGameSpy) @@ -539,7 +539,7 @@ static GHTTPBool gamePatchCheckCallback( GHTTPRequest request, GHTTPResult resul ok &= line.nextToken(&url, " "); if (ok && type == "patch") { - DEBUG_LOG(("Saw a patch: %d/[%s]\n", atoi(req.str()), url.str())); + DEBUG_LOG(("Saw a patch: %d/[%s]", atoi(req.str()), url.str())); queuePatch( atoi(req.str()), url ); if (atoi(req.str())) { @@ -595,7 +595,7 @@ void CancelPatchCheckCallback( void ) static GHTTPBool overallStatsCallback( GHTTPRequest request, GHTTPResult result, char * buffer, GHTTPByteCount bufferLen, void * param ) { - DEBUG_LOG(("overallStatsCallback() - Result=%d, len=%d\n", result, bufferLen)); + DEBUG_LOG(("overallStatsCallback() - Result=%d, len=%d", result, bufferLen)); if (result != GHTTPSuccess) { return GHTTPTrue; @@ -677,7 +677,7 @@ static GHTTPBool overallStatsCallback( GHTTPRequest request, GHTTPResult result, static GHTTPBool numPlayersOnlineCallback( GHTTPRequest request, GHTTPResult result, char * buffer, GHTTPByteCount bufferLen, void * param ) { - DEBUG_LOG(("numPlayersOnlineCallback() - Result=%d, buffer=[%s], len=%d\n", result, buffer, bufferLen)); + DEBUG_LOG(("numPlayersOnlineCallback() - Result=%d, buffer=[%s], len=%d", result, buffer, bufferLen)); if (result != GHTTPSuccess) { return GHTTPTrue; @@ -694,7 +694,7 @@ static GHTTPBool numPlayersOnlineCallback( GHTTPRequest request, GHTTPResult res if (*s == '\\') ++s; - DEBUG_LOG(("Message was '%s', trimmed to '%s'=%d\n", buffer, s, atoi(s))); + DEBUG_LOG(("Message was '%s', trimmed to '%s'=%d", buffer, s, atoi(s))); HandleNumPlayersOnline(atoi(s)); return GHTTPTrue; @@ -873,10 +873,10 @@ static void reallyStartPatchCheck( void ) } // check for a patch first - DEBUG_LOG(("Game patch check: [%s]\n", gameURL.c_str())); - DEBUG_LOG(("Map patch check: [%s]\n", mapURL.c_str())); - DEBUG_LOG(("Config: [%s]\n", configURL.c_str())); - DEBUG_LOG(("MOTD: [%s]\n", motdURL.c_str())); + DEBUG_LOG(("Game patch check: [%s]", gameURL.c_str())); + DEBUG_LOG(("Map patch check: [%s]", mapURL.c_str())); + DEBUG_LOG(("Config: [%s]", configURL.c_str())); + DEBUG_LOG(("MOTD: [%s]", motdURL.c_str())); ghttpGet(gameURL.c_str(), GHTTPFalse, gamePatchCheckCallback, (void *)timeThroughOnline); ghttpGet(mapURL.c_str(), GHTTPFalse, gamePatchCheckCallback, (void *)timeThroughOnline); ghttpHead(configURL.c_str(), GHTTPFalse, configHeadCallback, (void *)timeThroughOnline); diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/PeerDefs.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/PeerDefs.cpp index 0ac952a5a1..576564e5fa 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/PeerDefs.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/PeerDefs.cpp @@ -132,12 +132,12 @@ void GameSpyInfo::setLocalIPs(UnsignedInt internalIP, UnsignedInt externalIP) void GameSpyInfo::readAdditionalDisconnects( void ) { m_additionalDisconnects = GetAdditionalDisconnectsFromUserFile(m_localProfileID); - DEBUG_LOG(("GameSpyInfo::readAdditionalDisconnects() found %d disconnects.\n", m_additionalDisconnects)); + DEBUG_LOG(("GameSpyInfo::readAdditionalDisconnects() found %d disconnects.", m_additionalDisconnects)); } Int GameSpyInfo::getAdditionalDisconnects( void ) { - DEBUG_LOG(("GameSpyInfo::getAdditionalDisconnects() would have returned %d. Returning 0 instead.\n", m_additionalDisconnects)); + DEBUG_LOG(("GameSpyInfo::getAdditionalDisconnects() would have returned %d. Returning 0 instead.", m_additionalDisconnects)); return 0; } @@ -347,14 +347,14 @@ void GameSpyInfo::addGroupRoom( GameSpyGroupRoom room ) } else { - DEBUG_LOG(("Adding group room %d (%s)\n", room.m_groupID, room.m_name.str())); + DEBUG_LOG(("Adding group room %d (%s)", room.m_groupID, room.m_name.str())); AsciiString groupLabel; groupLabel.format("GUI:%s", room.m_name.str()); room.m_translatedName = TheGameText->fetch(groupLabel); m_groupRooms[room.m_groupID] = room; if ( !stricmp("quickmatch", room.m_name.str()) ) { - DEBUG_LOG(("Group room %d (%s) is the QuickMatch room\n", room.m_groupID, room.m_name.str())); + DEBUG_LOG(("Group room %d (%s) is the QuickMatch room", room.m_groupID, room.m_name.str())); TheGameSpyConfig->setQMChannel(room.m_groupID); } } @@ -385,7 +385,7 @@ void GameSpyInfo::joinBestGroupRoom( void ) { if (m_currentGroupRoomID) { - DEBUG_LOG(("Bailing from GameSpyInfo::joinBestGroupRoom() - we were already in a room\n")); + DEBUG_LOG(("Bailing from GameSpyInfo::joinBestGroupRoom() - we were already in a room")); m_currentGroupRoomID = 0; return; } @@ -398,7 +398,7 @@ void GameSpyInfo::joinBestGroupRoom( void ) while (iter != m_groupRooms.end()) { GameSpyGroupRoom room = iter->second; - DEBUG_LOG(("Group room %d: %s (%d, %d, %d, %d)\n", room.m_groupID, room.m_name.str(), room.m_numWaiting, room.m_maxWaiting, + DEBUG_LOG(("Group room %d: %s (%d, %d, %d, %d)", room.m_groupID, room.m_name.str(), room.m_numWaiting, room.m_maxWaiting, room.m_numGames, room.m_numPlaying)); if (TheGameSpyConfig->getQMChannel() != room.m_groupID && minPlayers > 25 && room.m_numWaiting < minPlayers) @@ -572,7 +572,7 @@ void GameSpyInfo::markAsStagingRoomJoiner( Int game ) m_localStagingRoom.setAllowObservers(info->getAllowObservers()); m_localStagingRoom.setHasPassword(info->getHasPassword()); m_localStagingRoom.setGameName(info->getGameName()); - DEBUG_LOG(("Joining game: host is %ls\n", m_localStagingRoom.getConstSlot(0)->getName().str())); + DEBUG_LOG(("Joining game: host is %ls", m_localStagingRoom.getConstSlot(0)->getName().str())); } } @@ -870,11 +870,11 @@ void GameSpyInfo::updateAdditionalGameSpyDisconnections(Int count) Int ptIdx; const PlayerTemplate *myTemplate = player->getPlayerTemplate(); - DEBUG_LOG(("myTemplate = %X(%s)\n", myTemplate, myTemplate->getName().str())); + DEBUG_LOG(("myTemplate = %X(%s)", myTemplate, myTemplate->getName().str())); for (ptIdx = 0; ptIdx < ThePlayerTemplateStore->getPlayerTemplateCount(); ++ptIdx) { const PlayerTemplate *nthTemplate = ThePlayerTemplateStore->getNthPlayerTemplate(ptIdx); - DEBUG_LOG(("nthTemplate = %X(%s)\n", nthTemplate, nthTemplate->getName().str())); + DEBUG_LOG(("nthTemplate = %X(%s)", nthTemplate, nthTemplate->getName().str())); if (nthTemplate == myTemplate) { break; @@ -899,7 +899,7 @@ void GameSpyInfo::updateAdditionalGameSpyDisconnections(Int count) Int disCons=stats.discons[ptIdx]; disCons += count; if (disCons < 0) - { DEBUG_LOG(("updateAdditionalGameSpyDisconnections() - disconnection count below zero\n")); + { DEBUG_LOG(("updateAdditionalGameSpyDisconnections() - disconnection count below zero")); return; //something is wrong here } stats.discons[ptIdx] = disCons; //add an additional disconnection to their stats. diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp index 3c3bed3c0a..c46f4a0bb1 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp @@ -165,18 +165,18 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP "DELETE_TCB" }; - DEBUG_LOG(("Finding local address used to talk to the chat server\n")); - DEBUG_LOG(("Current chat server name is %s\n", serverName.str())); - DEBUG_LOG(("Chat server port is %d\n", serverPort)); + DEBUG_LOG(("Finding local address used to talk to the chat server")); + DEBUG_LOG(("Current chat server name is %s", serverName.str())); + DEBUG_LOG(("Chat server port is %d", serverPort)); /* ** Get the address of the chat server. */ - DEBUG_LOG( ("About to call gethostbyname\n")); + DEBUG_LOG( ("About to call gethostbyname")); struct hostent *host_info = gethostbyname(serverName.str()); if (!host_info) { - DEBUG_LOG( ("gethostbyname failed! Error code %d\n", WSAGetLastError())); + DEBUG_LOG( ("gethostbyname failed! Error code %d", WSAGetLastError())); return(false); } @@ -185,24 +185,24 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP temp = ntohl(temp); *((unsigned long*)(&serverAddress[0])) = temp; - DEBUG_LOG(("Host address is %d.%d.%d.%d\n", serverAddress[3], serverAddress[2], serverAddress[1], serverAddress[0])); + DEBUG_LOG(("Host address is %d.%d.%d.%d", serverAddress[3], serverAddress[2], serverAddress[1], serverAddress[0])); /* ** Load the MIB-II SNMP DLL. */ - DEBUG_LOG(("About to load INETMIB1.DLL\n")); + DEBUG_LOG(("About to load INETMIB1.DLL")); HINSTANCE mib_ii_dll = LoadLibrary("inetmib1.dll"); if (mib_ii_dll == NULL) { - DEBUG_LOG(("Failed to load INETMIB1.DLL\n")); + DEBUG_LOG(("Failed to load INETMIB1.DLL")); return(false); } - DEBUG_LOG(("About to load SNMPAPI.DLL\n")); + DEBUG_LOG(("About to load SNMPAPI.DLL")); HINSTANCE snmpapi_dll = LoadLibrary("snmpapi.dll"); if (snmpapi_dll == NULL) { - DEBUG_LOG(("Failed to load SNMPAPI.DLL\n")); + DEBUG_LOG(("Failed to load SNMPAPI.DLL")); FreeLibrary(mib_ii_dll); return(false); } @@ -215,7 +215,7 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP SnmpUtilMemAllocPtr = (void *(__stdcall *)(unsigned long)) GetProcAddress(snmpapi_dll, "SnmpUtilMemAlloc"); SnmpUtilMemFreePtr = (void (__stdcall *)(void *)) GetProcAddress(snmpapi_dll, "SnmpUtilMemFree"); if (SnmpExtensionInitPtr == NULL || SnmpExtensionQueryPtr == NULL || SnmpUtilMemAllocPtr == NULL || SnmpUtilMemFreePtr == NULL) { - DEBUG_LOG(("Failed to get proc addresses for linked functions\n")); + DEBUG_LOG(("Failed to get proc addresses for linked functions")); FreeLibrary(snmpapi_dll); FreeLibrary(mib_ii_dll); return(false); @@ -228,14 +228,14 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP /* ** OK, here we go. Try to initialise the .dll */ - DEBUG_LOG(("About to init INETMIB1.DLL\n")); + DEBUG_LOG(("About to init INETMIB1.DLL")); int ok = SnmpExtensionInitPtr(GetCurrentTime(), &trap_handle, &first_supported_region); if (!ok) { /* ** Aw crap. */ - DEBUG_LOG(("Failed to init the .dll\n")); + DEBUG_LOG(("Failed to init the .dll")); SnmpUtilMemFreePtr(bind_list_ptr); SnmpUtilMemFreePtr(bind_ptr); FreeLibrary(snmpapi_dll); @@ -284,7 +284,7 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP if (!SnmpExtensionQueryPtr(SNMP_PDU_GETNEXT, bind_list_ptr, &error_status, &error_index)) { //if (!SnmpExtensionQueryPtr(ASN_RFC1157_GETNEXTREQUEST, bind_list_ptr, &error_status, &error_index)) { - DEBUG_LOG(("SnmpExtensionQuery returned false\n")); + DEBUG_LOG(("SnmpExtensionQuery returned false")); SnmpUtilMemFreePtr(bind_list_ptr); SnmpUtilMemFreePtr(bind_ptr); FreeLibrary(snmpapi_dll); @@ -388,7 +388,7 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP SnmpUtilMemFreePtr(bind_ptr); SnmpUtilMemFreePtr(mib_ii_name_ptr); - DEBUG_LOG(("Got %d connections in list, parsing...\n", connectionVector.size())); + DEBUG_LOG(("Got %d connections in list, parsing...", connectionVector.size())); /* ** Right, we got the lot. Lets see if any of them have the same address as the chat @@ -405,29 +405,29 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP ** See if this connection has the same address as our server. */ if (!found && memcmp(remoteAddress, serverAddress, 4) == 0) { - DEBUG_LOG(("Found connection with same remote address as server\n")); + DEBUG_LOG(("Found connection with same remote address as server")); if (serverPort == 0 || serverPort == (unsigned int)connection.RemotePort) { - DEBUG_LOG(("Connection has same port\n")); + DEBUG_LOG(("Connection has same port")); /* ** Make sure the connection is current. */ if (connection.State == ESTABLISHED) { - DEBUG_LOG(("Connection is ESTABLISHED\n")); + DEBUG_LOG(("Connection is ESTABLISHED")); localIP = connection.LocalIP; found = true; } else { - DEBUG_LOG(("Connection is not ESTABLISHED - skipping\n")); + DEBUG_LOG(("Connection is not ESTABLISHED - skipping")); } } else { - DEBUG_LOG(("Connection has different port. Port is %d, looking for %d\n", connection.RemotePort, serverPort)); + DEBUG_LOG(("Connection has different port. Port is %d, looking for %d", connection.RemotePort, serverPort)); } } } if (found) { - DEBUG_LOG(("Using address 0x%8.8X to talk to chat server\n", localIP)); + DEBUG_LOG(("Using address 0x%8.8X to talk to chat server", localIP)); } FreeLibrary(snmpapi_dll); @@ -500,7 +500,7 @@ void GameSpyStagingRoom::resetAccepted( void ) /* peerStateChanged(TheGameSpyChat->getPeer()); m_hasBeenQueried = false; - DEBUG_LOG(("resetAccepted() called peerStateChange()\n")); + DEBUG_LOG(("resetAccepted() called peerStateChange()")); */ } } @@ -528,7 +528,7 @@ Int GameSpyStagingRoom::getLocalSlotNum( void ) const void GameSpyStagingRoom::startGame(Int gameID) { DEBUG_ASSERTCRASH(m_inGame, ("Starting a game while not in game")); - DEBUG_LOG(("GameSpyStagingRoom::startGame - game id = %d\n", gameID)); + DEBUG_LOG(("GameSpyStagingRoom::startGame - game id = %d", gameID)); DEBUG_ASSERTCRASH(m_transport == NULL, ("m_transport is not NULL when it should be")); DEBUG_ASSERTCRASH(TheNAT == NULL, ("TheNAT is not NULL when it should be")); @@ -829,7 +829,7 @@ void GameSpyStagingRoom::launchGame( void ) TheMapCache->updateCache(); if (!filesOk || TheMapCache->findMap(getMap()) == NULL) { - DEBUG_LOG(("After transfer, we didn't really have the map. Bailing...\n")); + DEBUG_LOG(("After transfer, we didn't really have the map. Bailing...")); if (TheNetwork != NULL) { delete TheNetwork; TheNetwork = NULL; @@ -855,7 +855,7 @@ void GameSpyStagingRoom::launchGame( void ) // Set the random seed InitGameLogicRandom( getSeed() ); - DEBUG_LOG(("InitGameLogicRandom( %d )\n", getSeed())); + DEBUG_LOG(("InitGameLogicRandom( %d )", getSeed())); // mark us as "Loading" in the buddy list BuddyRequest req; @@ -879,7 +879,7 @@ void GameSpyStagingRoom::reset(void) WindowLayout *theLayout = TheShell->findScreenByFilename("Menus/GameSpyGameOptionsMenu.wnd"); if (theLayout) { - DEBUG_LOG(("Resetting TheGameSpyGame on the game options menu!\n")); + DEBUG_LOG(("Resetting TheGameSpyGame on the game options menu!")); } } #endif diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp index 7c3b8e7484..a5e03de319 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp @@ -313,7 +313,7 @@ void BuddyThreadClass::Thread_Function() case BuddyRequest::BUDDYREQUEST_MESSAGE: { std::string s = WideCharStringToMultiByte( incomingRequest.arg.message.text ); - DEBUG_LOG(("Sending a buddy message to %d [%s]\n", incomingRequest.arg.message.recipient, s.c_str())); + DEBUG_LOG(("Sending a buddy message to %d [%s]", incomingRequest.arg.message.recipient, s.c_str())); gpSendBuddyMessage( con, incomingRequest.arg.message.recipient, s.c_str() ); } break; @@ -362,7 +362,7 @@ void BuddyThreadClass::Thread_Function() if (lastStatus == GP_PLAYING && lastStatusString == "Loading" && incomingRequest.arg.status.status == GP_ONLINE) break; - DEBUG_LOG(("BUDDYREQUEST_SETSTATUS: status is now %d:%s/%s\n", + DEBUG_LOG(("BUDDYREQUEST_SETSTATUS: status is now %d:%s/%s", incomingRequest.arg.status.status, incomingRequest.arg.status.statusString, incomingRequest.arg.status.locationString)); gpSetStatus( con, incomingRequest.arg.status.status, incomingRequest.arg.status.statusString, incomingRequest.arg.status.locationString ); @@ -393,7 +393,7 @@ void BuddyThreadClass::Thread_Function() void BuddyThreadClass::errorCallback( GPConnection *con, GPErrorArg *arg ) { // log the error - DEBUG_LOG(("GPErrorCallback\n")); + DEBUG_LOG(("GPErrorCallback")); m_lastErrorCode = arg->errorCode; char errorCodeString[256]; @@ -467,19 +467,19 @@ void BuddyThreadClass::errorCallback( GPConnection *con, GPErrorArg *arg ) if(arg->fatal) { - DEBUG_LOG(( "-----------\n")); - DEBUG_LOG(( "GP FATAL ERROR\n")); - DEBUG_LOG(( "-----------\n")); + DEBUG_LOG(( "-----------")); + DEBUG_LOG(( "GP FATAL ERROR")); + DEBUG_LOG(( "-----------")); } else { - DEBUG_LOG(( "-----\n")); - DEBUG_LOG(( "GP ERROR\n")); - DEBUG_LOG(( "-----\n")); + DEBUG_LOG(( "-----")); + DEBUG_LOG(( "GP ERROR")); + DEBUG_LOG(( "-----")); } - DEBUG_LOG(( "RESULT: %s (%d)\n", resultString, arg->result)); - DEBUG_LOG(( "ERROR CODE: %s (0x%X)\n", errorCodeString, arg->errorCode)); - DEBUG_LOG(( "ERROR STRING: %s\n", arg->errorString)); + DEBUG_LOG(( "RESULT: %s (%d)", resultString, arg->result)); + DEBUG_LOG(( "ERROR CODE: %s (0x%X)", errorCodeString, arg->errorCode)); + DEBUG_LOG(( "ERROR STRING: %s", arg->errorString)); if (arg->fatal == GP_FATAL) { @@ -521,7 +521,7 @@ void BuddyThreadClass::messageCallback( GPConnection *con, GPRecvBuddyMessageArg wcsncpy(messageResponse.arg.message.text, s.c_str(), MAX_BUDDY_CHAT_LEN); messageResponse.arg.message.text[MAX_BUDDY_CHAT_LEN-1] = 0; messageResponse.arg.message.date = arg->date; - DEBUG_LOG(("Got a buddy message from %d [%ls]\n", arg->profile, s.c_str())); + DEBUG_LOG(("Got a buddy message from %d [%ls]", arg->profile, s.c_str())); TheGameSpyBuddyMessageQueue->addResponse( messageResponse ); } @@ -538,7 +538,7 @@ void BuddyThreadClass::connectCallback( GPConnection *con, GPConnectResponseArg if (!TheGameSpyPeerMessageQueue->isConnected() && !TheGameSpyPeerMessageQueue->isConnecting()) { - DEBUG_LOG(("Buddy connect: trying chat connect\n")); + DEBUG_LOG(("Buddy connect: trying chat connect")); PeerRequest req; req.peerRequestType = PeerRequest::PEERREQUEST_LOGIN; req.nick = m_nick; @@ -556,7 +556,7 @@ void BuddyThreadClass::connectCallback( GPConnection *con, GPConnectResponseArg { m_isNewAccount = FALSE; // they just hit 'create account' instead of 'log in'. Fix them. - DEBUG_LOG(("User Error: Create Account instead of Login. Fixing them...\n")); + DEBUG_LOG(("User Error: Create Account instead of Login. Fixing them...")); BuddyRequest req; req.buddyRequestType = BuddyRequest::BUDDYREQUEST_LOGIN; strcpy(req.arg.login.nick, m_nick.c_str()); @@ -566,7 +566,7 @@ void BuddyThreadClass::connectCallback( GPConnection *con, GPConnectResponseArg TheGameSpyBuddyMessageQueue->addRequest( req ); return; } - DEBUG_LOG(("Buddy connect failed (%d/%d): posting a failed chat connect\n", arg->result, m_lastErrorCode)); + DEBUG_LOG(("Buddy connect failed (%d/%d): posting a failed chat connect", arg->result, m_lastErrorCode)); PeerResponse resp; resp.peerResponseType = PeerResponse::PEERRESPONSE_DISCONNECT; resp.discon.reason = DISCONNECT_COULDNOTCONNECT; @@ -666,7 +666,7 @@ void BuddyThreadClass::statusCallback( GPConnection *con, GPRecvBuddyStatusArg * strcpy(response.arg.status.location, status.locationString); strcpy(response.arg.status.statusString, status.statusString); response.arg.status.status = status.status; - DEBUG_LOG(("Got buddy status for %d(%s) - status %d\n", status.profile, response.arg.status.nick, status.status)); + DEBUG_LOG(("Got buddy status for %d(%s) - status %d", status.profile, response.arg.status.nick, status.status)); // relay to UI TheGameSpyBuddyMessageQueue->addResponse( response ); diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp index f1684e0e4c..1d726f4683 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp @@ -250,7 +250,7 @@ void GameResultsThreadClass::Thread_Function() IP = inet_addr(hostnameBuffer); in_addr hostNode; hostNode.s_addr = IP; - DEBUG_LOG(("sending game results to %s - IP = %s\n", hostnameBuffer, inet_ntoa(hostNode) )); + DEBUG_LOG(("sending game results to %s - IP = %s", hostnameBuffer, inet_ntoa(hostNode) )); } else { @@ -259,7 +259,7 @@ void GameResultsThreadClass::Thread_Function() hostStruct = gethostbyname(hostnameBuffer); if (hostStruct == NULL) { - DEBUG_LOG(("sending game results to %s - host lookup failed\n", hostnameBuffer)); + DEBUG_LOG(("sending game results to %s - host lookup failed", hostnameBuffer)); // Even though this failed to resolve IP, still need to send a // callback. @@ -269,7 +269,7 @@ void GameResultsThreadClass::Thread_Function() { hostNode = (in_addr *) hostStruct->h_addr; IP = hostNode->s_addr; - DEBUG_LOG(("sending game results to %s IP = %s\n", hostnameBuffer, inet_ntoa(*hostNode) )); + DEBUG_LOG(("sending game results to %s IP = %s", hostnameBuffer, inet_ntoa(*hostNode) )); } } @@ -368,7 +368,7 @@ Int GameResultsThreadClass::sendGameResults( UnsignedInt IP, UnsignedShort port, Int sock = socket( AF_INET, SOCK_STREAM, 0 ); if (sock < 0) { - DEBUG_LOG(("GameResultsThreadClass::sendGameResults() - socket() returned %d(%s)\n", sock, getWSAErrorString(sock))); + DEBUG_LOG(("GameResultsThreadClass::sendGameResults() - socket() returned %d(%s)", sock, getWSAErrorString(sock))); return sock; } @@ -383,7 +383,7 @@ Int GameResultsThreadClass::sendGameResults( UnsignedInt IP, UnsignedShort port, if( connect( sock, (struct sockaddr *)&sockAddr, sizeof( sockAddr ) ) == -1 ) { error = WSAGetLastError(); - DEBUG_LOG(("GameResultsThreadClass::sendGameResults() - connect() returned %d(%s)\n", error, getWSAErrorString(error))); + DEBUG_LOG(("GameResultsThreadClass::sendGameResults() - connect() returned %d(%s)", error, getWSAErrorString(error))); if( ( error == WSAEWOULDBLOCK ) || ( error == WSAEINVAL ) || ( error == WSAEALREADY ) ) { return( -1 ); @@ -399,7 +399,7 @@ Int GameResultsThreadClass::sendGameResults( UnsignedInt IP, UnsignedShort port, if (send( sock, results.c_str(), results.length(), 0 ) == SOCKET_ERROR) { error = WSAGetLastError(); - DEBUG_LOG(("GameResultsThreadClass::sendGameResults() - send() returned %d(%s)\n", error, getWSAErrorString(error))); + DEBUG_LOG(("GameResultsThreadClass::sendGameResults() - send() returned %d(%s)", error, getWSAErrorString(error))); closesocket(sock); return WSAGetLastError(); } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp index 1a5c487625..3259b10573 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp @@ -390,7 +390,7 @@ void PeerThreadClass::clearPlayerStats(RoomType roomType) void PeerThreadClass::pushStatsToRoom(PEER peer) { - DEBUG_LOG(("PeerThreadClass::pushStatsToRoom(): stats are %s=%s,%s=%s,%s=%s,%s=%s,%s=%s,%s=%s\n", + DEBUG_LOG(("PeerThreadClass::pushStatsToRoom(): stats are %s=%s,%s=%s,%s=%s,%s=%s,%s=%s,%s=%s", s_keys[0], s_values[0], s_keys[1], s_values[1], s_keys[2], s_values[2], @@ -511,7 +511,7 @@ enum CallbackType void connectCallbackWrapper( PEER peer, PEERBool success, int failureReason, void *param ) { #ifdef SERVER_DEBUGGING - DEBUG_LOG(("In connectCallbackWrapper()\n")); + DEBUG_LOG(("In connectCallbackWrapper()")); CheckServers(peer); #endif // SERVER_DEBUGGING if (param != NULL) @@ -697,7 +697,7 @@ static void updateBuddyStatus( GameSpyBuddyStatus status, Int groupRoom = 0, std strcpy(req.arg.status.locationString, ""); break; } - DEBUG_LOG(("updateBuddyStatus %d:%s\n", req.arg.status.status, req.arg.status.statusString)); + DEBUG_LOG(("updateBuddyStatus %d:%s", req.arg.status.status, req.arg.status.statusString)); TheGameSpyBuddyMessageQueue->addRequest(req); } @@ -750,11 +750,11 @@ static void QRServerKeyCallback void * param ) { - //DEBUG_LOG(("QR_SERVER_KEY | %d (%s)\n", key, qr2_registered_key_list[key])); + //DEBUG_LOG(("QR_SERVER_KEY | %d (%s)", key, qr2_registered_key_list[key])); PeerThreadClass *t = (PeerThreadClass *)param; if (!t) { - DEBUG_LOG(("QRServerKeyCallback: bailing because of no thread info\n")); + DEBUG_LOG(("QRServerKeyCallback: bailing because of no thread info")); return; } @@ -821,11 +821,11 @@ static void QRServerKeyCallback break; default: ADD(""); - //DEBUG_LOG(("QR_SERVER_KEY | %d (%s)\n", key, qr2_registered_key_list[key])); + //DEBUG_LOG(("QR_SERVER_KEY | %d (%s)", key, qr2_registered_key_list[key])); break; } - DEBUG_LOG(("QR_SERVER_KEY | %d (%s) = [%s]\n", key, qr2_registered_key_list[key], val.str())); + DEBUG_LOG(("QR_SERVER_KEY | %d (%s) = [%s]", key, qr2_registered_key_list[key], val.str())); } static void QRPlayerKeyCallback @@ -837,11 +837,11 @@ static void QRPlayerKeyCallback void * param ) { - //DEBUG_LOG(("QR_PLAYER_KEY | %d | %d (%s)\n", key, index, qr2_registered_key_list[key])); + //DEBUG_LOG(("QR_PLAYER_KEY | %d | %d (%s)", key, index, qr2_registered_key_list[key])); PeerThreadClass *t = (PeerThreadClass *)param; if (!t) { - DEBUG_LOG(("QRPlayerKeyCallback: bailing because of no thread info\n")); + DEBUG_LOG(("QRPlayerKeyCallback: bailing because of no thread info")); return; } @@ -881,11 +881,11 @@ static void QRPlayerKeyCallback break; default: ADD(""); - //DEBUG_LOG(("QR_PLAYER_KEY | %d | %d (%s)\n", key, index, qr2_registered_key_list[key])); + //DEBUG_LOG(("QR_PLAYER_KEY | %d | %d (%s)", key, index, qr2_registered_key_list[key])); break; } - DEBUG_LOG(("QR_PLAYER_KEY | %d | %d (%s) = [%s]\n", key, index, qr2_registered_key_list[key], val.str())); + DEBUG_LOG(("QR_PLAYER_KEY | %d | %d (%s) = [%s]", key, index, qr2_registered_key_list[key], val.str())); } static void QRTeamKeyCallback @@ -897,12 +897,12 @@ static void QRTeamKeyCallback void * param ) { - //DEBUG_LOG(("QR_TEAM_KEY | %d | %d\n", key, index)); + //DEBUG_LOG(("QR_TEAM_KEY | %d | %d", key, index)); PeerThreadClass *t = (PeerThreadClass *)param; if (!t) { - DEBUG_LOG(("QRTeamKeyCallback: bailing because of no thread info\n")); + DEBUG_LOG(("QRTeamKeyCallback: bailing because of no thread info")); return; } if (!t->isHosting()) @@ -920,13 +920,13 @@ static void QRKeyListCallback void * param ) { - DEBUG_LOG(("QR_KEY_LIST | %s\n", KeyTypeToString(type))); + DEBUG_LOG(("QR_KEY_LIST | %s", KeyTypeToString(type))); /* PeerThreadClass *t = (PeerThreadClass *)param; if (!t) { - DEBUG_LOG(("QRKeyListCallback: bailing because of no thread info\n")); + DEBUG_LOG(("QRKeyListCallback: bailing because of no thread info")); return; } if (!t->isHosting()) @@ -976,7 +976,7 @@ static int QRCountCallback PeerThreadClass *t = (PeerThreadClass *)param; if (!t) { - DEBUG_LOG(("QRCountCallback: bailing because of no thread info\n")); + DEBUG_LOG(("QRCountCallback: bailing because of no thread info")); return 0; } if (!t->isHosting()) @@ -984,16 +984,16 @@ static int QRCountCallback if(type == key_player) { - DEBUG_LOG(("QR_COUNT | %s = %d\n", KeyTypeToString(type), t->getNumPlayers() + t->getNumObservers())); + DEBUG_LOG(("QR_COUNT | %s = %d", KeyTypeToString(type), t->getNumPlayers() + t->getNumObservers())); return t->getNumPlayers() + t->getNumObservers(); } else if(type == key_team) { - DEBUG_LOG(("QR_COUNT | %s = %d\n", KeyTypeToString(type), 0)); + DEBUG_LOG(("QR_COUNT | %s = %d", KeyTypeToString(type), 0)); return 0; } - DEBUG_LOG(("QR_COUNT | %s = %d\n", KeyTypeToString(type), 0)); + DEBUG_LOG(("QR_COUNT | %s = %d", KeyTypeToString(type), 0)); return 0; } @@ -1018,7 +1018,7 @@ static void QRAddErrorCallback void * param ) { - DEBUG_LOG(("QR_ADD_ERROR | %s | %s\n", ErrorTypeToString(error), errorString)); + DEBUG_LOG(("QR_ADD_ERROR | %s | %s", ErrorTypeToString(error), errorString)); PeerResponse resp; resp.peerResponseType = PeerResponse::PEERRESPONSE_FAILEDTOHOST; TheGameSpyPeerMessageQueue->addResponse(resp); @@ -1031,7 +1031,7 @@ static void QRNatNegotiateCallback void * param ) { - DEBUG_LOG(("QR_NAT_NEGOTIATE | 0x%08X\n", cookie)); + DEBUG_LOG(("QR_NAT_NEGOTIATE | 0x%08X", cookie)); } static void KickedCallback @@ -1043,7 +1043,7 @@ static void KickedCallback void * param ) { - DEBUG_LOG(("Kicked from %d by %s: \"%s\"\n", roomType, nick, reason)); + DEBUG_LOG(("Kicked from %d by %s: \"%s\"", roomType, nick, reason)); } static void NewPlayerListCallback @@ -1053,7 +1053,7 @@ static void NewPlayerListCallback void * param ) { - DEBUG_LOG(("NewPlayerListCallback\n")); + DEBUG_LOG(("NewPlayerListCallback")); } static void AuthenticateCDKeyCallback @@ -1064,7 +1064,7 @@ static void AuthenticateCDKeyCallback void * param ) { - DEBUG_LOG(("CD Key Result: %s (%d) %X\n", message, result, param)); + DEBUG_LOG(("CD Key Result: %s (%d) %X", message, result, param)); #ifdef SERVER_DEBUGGING CheckServers(peer); #endif // SERVER_DEBUGGING @@ -1095,12 +1095,12 @@ static SerialAuthResult doCDKeyAuthentication( PEER peer ) if (GetStringFromRegistry("\\ergc", "", s) && s.isNotEmpty()) { #ifdef SERVER_DEBUGGING - DEBUG_LOG(("Before peerAuthenticateCDKey()\n")); + DEBUG_LOG(("Before peerAuthenticateCDKey()")); CheckServers(peer); #endif // SERVER_DEBUGGING peerAuthenticateCDKey(peer, s.str(), AuthenticateCDKeyCallback, &retval, PEERTrue); #ifdef SERVER_DEBUGGING - DEBUG_LOG(("After peerAuthenticateCDKey()\n")); + DEBUG_LOG(("After peerAuthenticateCDKey()")); CheckServers(peer); #endif // SERVER_DEBUGGING } @@ -1301,16 +1301,16 @@ void PeerThreadClass::Thread_Function() OptionPreferences pref; UnsignedInt preferredIP = INADDR_ANY; UnsignedInt selectedIP = pref.getOnlineIPAddress(); - DEBUG_LOG(("Looking for IP %X\n", selectedIP)); + DEBUG_LOG(("Looking for IP %X", selectedIP)); IPEnumeration IPs; EnumeratedIP *IPlist = IPs.getAddresses(); while (IPlist) { - DEBUG_LOG(("Looking at IP %s\n", IPlist->getIPstring().str())); + DEBUG_LOG(("Looking at IP %s", IPlist->getIPstring().str())); if (selectedIP == IPlist->getIP()) { preferredIP = IPlist->getIP(); - DEBUG_LOG(("Connecting to GameSpy chat server via IP address %8.8X\n", preferredIP)); + DEBUG_LOG(("Connecting to GameSpy chat server via IP address %8.8X", preferredIP)); break; } IPlist = IPlist->getNext(); @@ -1330,7 +1330,7 @@ void PeerThreadClass::Thread_Function() // deal with requests if (TheGameSpyPeerMessageQueue->getRequest(incomingRequest)) { - DEBUG_LOG(("TheGameSpyPeerMessageQueue->getRequest() got request of type %d\n", incomingRequest.peerRequestType)); + DEBUG_LOG(("TheGameSpyPeerMessageQueue->getRequest() got request of type %d", incomingRequest.peerRequestType)); switch (incomingRequest.peerRequestType) { case PeerRequest::PEERREQUEST_LOGIN: @@ -1343,7 +1343,7 @@ void PeerThreadClass::Thread_Function() m_email = incomingRequest.email; peerConnect( peer, incomingRequest.nick.c_str(), incomingRequest.login.profileID, nickErrorCallbackWrapper, connectCallbackWrapper, this, PEERTrue ); #ifdef SERVER_DEBUGGING - DEBUG_LOG(("After peerConnect()\n")); + DEBUG_LOG(("After peerConnect()")); CheckServers(peer); #endif // SERVER_DEBUGGING if (m_isConnected) @@ -1387,7 +1387,7 @@ void PeerThreadClass::Thread_Function() } m_isHosting = false; m_localRoomID = m_groupRoomID; - DEBUG_LOG(("Requesting to join room %d in thread %X\n", m_localRoomID, this)); + DEBUG_LOG(("Requesting to join room %d in thread %X", m_localRoomID, this)); peerJoinGroupRoom( peer, incomingRequest.groupRoom.id, joinRoomCallback, (void *)this, PEERTrue ); break; @@ -1406,9 +1406,9 @@ void PeerThreadClass::Thread_Function() peerLeaveRoom( peer, StagingRoom, NULL ); m_isHosting = false; SBServer server = findServerByID(incomingRequest.stagingRoom.id); m_localStagingServerName = incomingRequest.text; - DEBUG_LOG(("Setting m_localStagingServerName to [%ls]\n", m_localStagingServerName.c_str())); + DEBUG_LOG(("Setting m_localStagingServerName to [%ls]", m_localStagingServerName.c_str())); m_localRoomID = incomingRequest.stagingRoom.id; - DEBUG_LOG(("Requesting to join room %d\n", m_localRoomID)); + DEBUG_LOG(("Requesting to join room %d", m_localRoomID)); if (server) { peerJoinStagingRoom( peer, server, incomingRequest.password.c_str(), joinRoomCallback, (void *)this, PEERTrue ); @@ -1461,7 +1461,7 @@ void PeerThreadClass::Thread_Function() case PeerRequest::PEERREQUEST_PUSHSTATS: { - DEBUG_LOG(("PEERREQUEST_PUSHSTATS: stats are %d,%d,%d,%d,%d,%d\n", + DEBUG_LOG(("PEERREQUEST_PUSHSTATS: stats are %d,%d,%d,%d,%d,%d", incomingRequest.statsToPush.locale, incomingRequest.statsToPush.wins, incomingRequest.statsToPush.losses, incomingRequest.statsToPush.rankPoints, incomingRequest.statsToPush.side, incomingRequest.statsToPush.preorder)); // Testing alternate way to push stats @@ -1499,7 +1499,7 @@ void PeerThreadClass::Thread_Function() m_numPlayers = incomingRequest.gameOptions.numPlayers; m_numObservers = incomingRequest.gameOptions.numObservers; m_maxPlayers = incomingRequest.gameOptions.maxPlayers; - DEBUG_LOG(("peerStateChanged(): Marking game options state as changed - %d players, %d observers\n", m_numPlayers, m_numObservers)); + DEBUG_LOG(("peerStateChanged(): Marking game options state as changed - %d players, %d observers", m_numPlayers, m_numObservers)); for (Int i=0; isawMatchbot(nick); @@ -1933,7 +1933,7 @@ void PeerThreadClass::doQuickMatch( PEER peer ) peerLeaveRoom( peer, StagingRoom, NULL ); m_isHosting = false; m_localRoomID = m_groupRoomID; m_roomJoined = false; - DEBUG_LOG(("Requesting to join room %d in thread %X\n", m_localRoomID, this)); + DEBUG_LOG(("Requesting to join room %d in thread %X", m_localRoomID, this)); peerJoinGroupRoom( peer, m_localRoomID, joinRoomCallback, (void *)this, PEERTrue ); if (m_roomJoined) { @@ -2005,7 +2005,7 @@ void PeerThreadClass::doQuickMatch( PEER peer ) else msg.append("0"); } - DEBUG_LOG(("Sending QM options of [%s] to %s\n", msg.c_str(), m_matchbotName.c_str())); + DEBUG_LOG(("Sending QM options of [%s] to %s", msg.c_str(), m_matchbotName.c_str())); peerMessagePlayer( peer, m_matchbotName.c_str(), msg.c_str(), NormalMessage ); m_qmStatus = QM_WORKING; PeerResponse resp; @@ -2080,7 +2080,7 @@ static void getPlayerProfileIDCallback(PEER peer, PEERBool success, const char static void stagingRoomPlayerEnum( PEER peer, PEERBool success, RoomType roomType, int index, const char * nick, int flags, void * param ) { - DEBUG_LOG(("Enum: success=%d, index=%d, nick=%s, flags=%d\n", success, index, nick, flags)); + DEBUG_LOG(("Enum: success=%d, index=%d, nick=%s, flags=%d", success, index, nick, flags)); if (!nick || !success) return; @@ -2109,13 +2109,13 @@ static void stagingRoomPlayerEnum( PEER peer, PEERBool success, RoomType roomTyp static void joinRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, RoomType roomType, void *param) { - DEBUG_LOG(("JoinRoomCallback: success==%d, result==%d\n", success, result)); + DEBUG_LOG(("JoinRoomCallback: success==%d, result==%d", success, result)); PeerThreadClass *t = (PeerThreadClass *)param; if (!t) return; - DEBUG_LOG(("Room id was %d from thread %X\n", t->getLocalRoomID(), t)); - DEBUG_LOG(("Current staging server name is [%ls]\n", t->getLocalStagingServerName().c_str())); - DEBUG_LOG(("Room type is %d (GroupRoom=%d, StagingRoom=%d, TitleRoom=%d)\n", roomType, GroupRoom, StagingRoom, TitleRoom)); + DEBUG_LOG(("Room id was %d from thread %X", t->getLocalRoomID(), t)); + DEBUG_LOG(("Current staging server name is [%ls]", t->getLocalStagingServerName().c_str())); + DEBUG_LOG(("Room type is %d (GroupRoom=%d, StagingRoom=%d, TitleRoom=%d)", roomType, GroupRoom, StagingRoom, TitleRoom)); #ifdef USE_BROADCAST_KEYS if (success) @@ -2138,10 +2138,10 @@ static void joinRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, resp.joinGroupRoom.ok = success; TheGameSpyPeerMessageQueue->addResponse(resp); t->roomJoined(success == PEERTrue); - DEBUG_LOG(("Entered group room %d, qm is %d\n", t->getLocalRoomID(), t->getQMGroupRoom())); + DEBUG_LOG(("Entered group room %d, qm is %d", t->getLocalRoomID(), t->getQMGroupRoom())); if ((!t->getQMGroupRoom()) || (t->getQMGroupRoom() != t->getLocalRoomID())) { - DEBUG_LOG(("Updating buddy status\n")); + DEBUG_LOG(("Updating buddy status")); updateBuddyStatus( BUDDY_LOBBY, t->getLocalRoomID() ); } } @@ -2158,14 +2158,14 @@ static void joinRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, resp.joinStagingRoom.result = result; if (success) { - DEBUG_LOG(("joinRoomCallback() - game name is now '%ls'\n", t->getLocalStagingServerName().c_str())); + DEBUG_LOG(("joinRoomCallback() - game name is now '%ls'", t->getLocalStagingServerName().c_str())); updateBuddyStatus( BUDDY_STAGING, 0, WideCharStringToMultiByte(t->getLocalStagingServerName().c_str()) ); } resp.joinStagingRoom.isHostPresent = FALSE; - DEBUG_LOG(("Enum of staging room players\n")); + DEBUG_LOG(("Enum of staging room players")); peerEnumPlayers(peer, StagingRoom, stagingRoomPlayerEnum, &resp); - DEBUG_LOG(("Host %s present\n", (resp.joinStagingRoom.isHostPresent)?"is":"is not")); + DEBUG_LOG(("Host %s present", (resp.joinStagingRoom.isHostPresent)?"is":"is not")); TheGameSpyPeerMessageQueue->addResponse(resp); } @@ -2183,20 +2183,20 @@ static void listGroupRoomsCallback(PEER peer, PEERBool success, int maxWaiting, int numGames, int numPlaying, void * param) { - DEBUG_LOG(("listGroupRoomsCallback, success=%d, server=%X, groupID=%d\n", success, server, groupID)); + DEBUG_LOG(("listGroupRoomsCallback, success=%d, server=%X, groupID=%d", success, server, groupID)); #ifdef SERVER_DEBUGGING CheckServers(peer); #endif // SERVER_DEBUGGING PeerThreadClass *t = (PeerThreadClass *)param; if (!t) { - DEBUG_LOG(("No thread! Bailing!\n")); + DEBUG_LOG(("No thread! Bailing!")); return; } if (success) { - DEBUG_LOG(("Saw group room of %d (%s) at address %X %X\n", groupID, name, server, (server)?server->keyvals:0)); + DEBUG_LOG(("Saw group room of %d (%s) at address %X %X", groupID, name, server, (server)?server->keyvals:0)); PeerResponse resp; resp.peerResponseType = PeerResponse::PEERRESPONSE_GROUPROOM; resp.groupRoom.id = groupID; @@ -2212,12 +2212,12 @@ static void listGroupRoomsCallback(PEER peer, PEERBool success, TheGameSpyPeerMessageQueue->addResponse(resp); #ifdef SERVER_DEBUGGING CheckServers(peer); - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); #endif // SERVER_DEBUGGING } else { - DEBUG_LOG(("Failure!\n")); + DEBUG_LOG(("Failure!")); } } @@ -2236,7 +2236,7 @@ void PeerThreadClass::connectCallback( PEER peer, PEERBool success ) updateBuddyStatus( BUDDY_ONLINE ); m_isConnected = true; - DEBUG_LOG(("Connected as profile %d (%s)\n", m_profileID, m_loginName.c_str())); + DEBUG_LOG(("Connected as profile %d (%s)", m_profileID, m_loginName.c_str())); resp.peerResponseType = PeerResponse::PEERRESPONSE_LOGIN; resp.player.profileID = m_profileID; resp.nick = m_loginName; @@ -2255,12 +2255,12 @@ void PeerThreadClass::connectCallback( PEER peer, PEERBool success ) TheGameSpyPSMessageQueue->addRequest(psReq); #ifdef SERVER_DEBUGGING - DEBUG_LOG(("Before peerListGroupRooms()\n")); + DEBUG_LOG(("Before peerListGroupRooms()")); CheckServers(peer); #endif // SERVER_DEBUGGING peerListGroupRooms( peer, NULL, listGroupRoomsCallback, this, PEERTrue ); #ifdef SERVER_DEBUGGING - DEBUG_LOG(("After peerListGroupRooms()\n")); + DEBUG_LOG(("After peerListGroupRooms()")); CheckServers(peer); #endif // SERVER_DEBUGGING } @@ -2278,7 +2278,7 @@ void PeerThreadClass::nickErrorCallback( PEER peer, Int type, const char *nick ) nickStr.erase(len-3, 3); } - DEBUG_LOG(("Nickname taken: was %s, new val = %d, new nick = %s\n", nick, newVal, nickStr.c_str())); + DEBUG_LOG(("Nickname taken: was %s, new val = %d, new nick = %s", nick, newVal, nickStr.c_str())); if (newVal < 10) { @@ -2317,7 +2317,7 @@ void PeerThreadClass::nickErrorCallback( PEER peer, Int type, const char *nick ) void disconnectedCallback(PEER peer, const char * reason, void * param) { - DEBUG_LOG(("disconnectedCallback(): reason was '%s'\n", reason)); + DEBUG_LOG(("disconnectedCallback(): reason was '%s'", reason)); PeerThreadClass *t = (PeerThreadClass *)param; DEBUG_ASSERTCRASH(t, ("No Peer thread!")); if (t) @@ -2351,7 +2351,7 @@ void roomMessageCallback(PEER peer, RoomType roomType, const char * nick, const resp.message.isPrivate = FALSE; resp.message.isAction = (messageType == ActionMessage); TheGameSpyPeerMessageQueue->addResponse(resp); - DEBUG_LOG(("Saw text [%hs] (%ls) %d chars Orig was %s (%d chars)\n", nick, resp.text.c_str(), resp.text.length(), message, strlen(message))); + DEBUG_LOG(("Saw text [%hs] (%ls) %d chars Orig was %s (%d chars)", nick, resp.text.c_str(), resp.text.length(), message, strlen(message))); UnsignedInt IP; peerGetPlayerInfoNoWait(peer, nick, &IP, &resp.message.profileID); @@ -2458,7 +2458,7 @@ void playerMessageCallback(PEER peer, const char * nick, const char * message, M if (numPlayers > 1) { // woohoo! got everything needed for a match! - DEBUG_LOG(("Saw %d-player QM match: map index = %s, seed = %s\n", numPlayers, mapNumStr, seedStr)); + DEBUG_LOG(("Saw %d-player QM match: map index = %s, seed = %s", numPlayers, mapNumStr, seedStr)); t->handleQMMatch(peer, atoi(mapNumStr), atoi(seedStr), playerStr, playerIPStr, playerSideStr, playerColorStr, playerNATStr); } } @@ -2487,7 +2487,7 @@ void playerMessageCallback(PEER peer, const char * nick, const char * message, M void roomUTMCallback(PEER peer, RoomType roomType, const char * nick, const char * command, const char * parameters, PEERBool authenticated, void * param) { - DEBUG_LOG(("roomUTMCallback: %s says %s = [%s]\n", nick, command, parameters)); + DEBUG_LOG(("roomUTMCallback: %s says %s = [%s]", nick, command, parameters)); if (roomType != StagingRoom) return; PeerResponse resp; @@ -2500,7 +2500,7 @@ void roomUTMCallback(PEER peer, RoomType roomType, const char * nick, const char void playerUTMCallback(PEER peer, const char * nick, const char * command, const char * parameters, PEERBool authenticated, void * param) { - DEBUG_LOG(("playerUTMCallback: %s says %s = [%s]\n", nick, command, parameters)); + DEBUG_LOG(("playerUTMCallback: %s says %s = [%s]", nick, command, parameters)); PeerResponse resp; resp.peerResponseType = PeerResponse::PEERRESPONSE_PLAYERUTM; resp.nick = nick; @@ -2545,7 +2545,7 @@ static void getPlayerInfo(PeerThreadClass *t, PEER peer, const char *nick, Int& #endif // USE_BROADCAST_KEYS flags = 0; peerGetPlayerFlags(peer, nick, roomType, &flags); - DEBUG_LOG(("getPlayerInfo(%d) - %s has locale %s, wins:%d, losses:%d, rankPoints:%d, side:%d, preorder:%d\n", + DEBUG_LOG(("getPlayerInfo(%d) - %s has locale %s, wins:%d, losses:%d, rankPoints:%d, side:%d, preorder:%d", id, nick, locale.c_str(), wins, losses, rankPoints, side, preorder)); } @@ -2566,7 +2566,7 @@ static void roomKeyChangedCallback(PEER peer, RoomType roomType, const char *nic #ifdef DEBUG_LOGGING if (strcmp(key, "username") && strcmp(key, "b_flags")) { - DEBUG_LOG(("roomKeyChangedCallback() - %s set %s=%s\n", nick, key, val)); + DEBUG_LOG(("roomKeyChangedCallback() - %s set %s=%s", nick, key, val)); } #endif @@ -2758,7 +2758,7 @@ static void playerFlagsChangedCallback(PEER peer, RoomType roomType, const char /* static void enumFunc(char *key, char *val, void *param) { - DEBUG_LOG((" [%s] = [%s]\n", key, val)); + DEBUG_LOG((" [%s] = [%s]", key, val)); } */ #endif @@ -2785,14 +2785,14 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, cmdStr = "PEER_COMPLETE"; break; } - DEBUG_LOG(("listingGamesCallback() - doing command %s on server %X\n", cmdStr.str(), server)); + DEBUG_LOG(("listingGamesCallback() - doing command %s on server %X", cmdStr.str(), server)); #endif // DEBUG_LOGGING PeerThreadClass *t = (PeerThreadClass *)param; DEBUG_ASSERTCRASH(name, ("Game has no name!\n")); if (!t || !success || (!name && (msg == PEER_ADD || msg == PEER_UPDATE))) { - DEBUG_LOG(("Bailing from listingGamesCallback() - success=%d, name=%X, server=%X, msg=%X\n", success, name, server, msg)); + DEBUG_LOG(("Bailing from listingGamesCallback() - success=%d, name=%X, server=%X, msg=%X", success, name, server, msg)); return; } if (!name) @@ -2809,14 +2809,14 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, if (server && success && (msg == PEER_ADD || msg == PEER_UPDATE)) { - DEBUG_LOG(("Game name is '%s'\n", name)); + DEBUG_LOG(("Game name is '%s'", name)); const char *newname = SBServerGetStringValue(server, "gamename", (char *)name); if (strcmp(newname, "ccgenerals")) name = newname; - DEBUG_LOG(("Game name is now '%s'\n", name)); + DEBUG_LOG(("Game name is now '%s'", name)); } - DEBUG_LOG(("listingGamesCallback - got percent complete %d\n", percentListed)); + DEBUG_LOG(("listingGamesCallback - got percent complete %d", percentListed)); if (percentListed == 100) { if (!t->getSawCompleteGameList()) @@ -2837,7 +2837,7 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, { gameName.set(firstSpace + 1); //gameName.trim(); - DEBUG_LOG(("Hostname/Gamename split leaves '%s' hosting '%s'\n", hostName.str(), gameName.str())); + DEBUG_LOG(("Hostname/Gamename split leaves '%s' hosting '%s'", hostName.str(), gameName.str())); } PeerResponse resp; resp.peerResponseType = PeerResponse::PEERRESPONSE_STAGINGROOM; @@ -2881,7 +2881,7 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, #ifdef DEBUG_LOGGING if (resp.stagingRoomPlayerNames[i].length()) { - DEBUG_LOG(("Player %d raw stuff: [%s] [%d] [%d] [%d]\n", i, resp.stagingRoomPlayerNames[i].c_str(), resp.stagingRoom.wins[i], resp.stagingRoom.losses[i], resp.stagingRoom.profileID[i])); + DEBUG_LOG(("Player %d raw stuff: [%s] [%d] [%d] [%d]", i, resp.stagingRoomPlayerNames[i].c_str(), resp.stagingRoom.wins[i], resp.stagingRoom.losses[i], resp.stagingRoom.profileID[i])); } #endif } @@ -2890,9 +2890,9 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, resp.stagingRoomPlayerNames[0] = hostName.str(); } DEBUG_ASSERTCRASH(resp.stagingRoomPlayerNames[0].empty() == false, ("No host!")); - DEBUG_LOG(("Raw stuff: [%s] [%s] [%s] [%d] [%d]\n", verStr, exeStr, iniStr, hasPassword, allowObservers)); - DEBUG_LOG(("Raw stuff: [%s] [%s] [%d]\n", pingStr, ladIPStr, ladPort)); - DEBUG_LOG(("Saw game with stuff %s %d %X %X %X %s\n", resp.stagingRoomMapName.c_str(), hasPassword, verVal, exeVal, iniVal, SBServerGetStringValue(server, "password", "missing"))); + DEBUG_LOG(("Raw stuff: [%s] [%s] [%s] [%d] [%d]", verStr, exeStr, iniStr, hasPassword, allowObservers)); + DEBUG_LOG(("Raw stuff: [%s] [%s] [%d]", pingStr, ladIPStr, ladPort)); + DEBUG_LOG(("Saw game with stuff %s %d %X %X %X %s", resp.stagingRoomMapName.c_str(), hasPassword, verVal, exeVal, iniVal, SBServerGetStringValue(server, "password", "missing"))); #ifdef PING_TEST PING_LOG(("%s\n", pingStr)); #endif @@ -2904,19 +2904,19 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, { if (SBServerHasBasicKeys(server)) { - DEBUG_LOG(("Server %x does not have basic keys\n", server)); + DEBUG_LOG(("Server %x does not have basic keys", server)); return; } else { - DEBUG_LOG(("Server %x has basic keys, yet has no info\n", server)); + DEBUG_LOG(("Server %x has basic keys, yet has no info", server)); } if (msg == PEER_UPDATE) { PeerRequest req; req.peerRequestType = PeerRequest::PEERREQUEST_GETEXTENDEDSTAGINGROOMINFO; req.stagingRoom.id = t->findServer( server ); - DEBUG_LOG(("Add/update a 0/0 server %X (%d, %s) - requesting full update to see if that helps.\n", + DEBUG_LOG(("Add/update a 0/0 server %X (%d, %s) - requesting full update to see if that helps.", server, resp.stagingRoom.id, gameName.str())); TheGameSpyPeerMessageQueue->addRequest(req); } @@ -2932,15 +2932,15 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, case PEER_ADD: case PEER_UPDATE: resp.stagingRoom.id = t->findServer( server ); - DEBUG_LOG(("Add/update on server %X (%d, %s)\n", server, resp.stagingRoom.id, gameName.str())); + DEBUG_LOG(("Add/update on server %X (%d, %s)", server, resp.stagingRoom.id, gameName.str())); resp.stagingServerName = MultiByteToWideCharSingleLine( gameName.str() ); - DEBUG_LOG(("Server had basic=%d, full=%d\n", SBServerHasBasicKeys(server), SBServerHasFullKeys(server))); + DEBUG_LOG(("Server had basic=%d, full=%d", SBServerHasBasicKeys(server), SBServerHasFullKeys(server))); #ifdef DEBUG_LOGGING //SBServerEnumKeys(server, enumFunc, NULL); #endif break; case PEER_REMOVE: - DEBUG_LOG(("Removing server %X (%d)\n", server, resp.stagingRoom.id)); + DEBUG_LOG(("Removing server %X (%d)", server, resp.stagingRoom.id)); resp.stagingRoom.id = t->removeServerFromMap( server ); break; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp index a57677bbe7..ede800d31d 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp @@ -58,14 +58,14 @@ PSRequest::PSRequest() { \ if (it->second > 0) \ { \ - DEBUG_LOG(("%s(%d): %d\n", #x, it->first, it->second)); \ + DEBUG_LOG(("%s(%d): %d", #x, it->first, it->second)); \ } \ } static void debugDumpPlayerStats( const PSPlayerStats& stats ) { - DEBUG_LOG(("-----------------------------------------\n")); - DEBUG_LOG(("Tracking player stats for player %d:\n", stats.id)); + DEBUG_LOG(("-----------------------------------------")); + DEBUG_LOG(("Tracking player stats for player %d:", stats.id)); PerGeneralMap::const_iterator it; DEBUG_MAP(wins); DEBUG_MAP(losses); @@ -94,99 +94,99 @@ static void debugDumpPlayerStats( const PSPlayerStats& stats ) if (stats.locale > 0) { - DEBUG_LOG(("Locale: %d\n", stats.locale)); + DEBUG_LOG(("Locale: %d", stats.locale)); } if (stats.gamesAsRandom > 0) { - DEBUG_LOG(("gamesAsRandom: %d\n", stats.gamesAsRandom)); + DEBUG_LOG(("gamesAsRandom: %d", stats.gamesAsRandom)); } if (stats.options.length()) { - DEBUG_LOG(("Options: %s\n", stats.options.c_str())); + DEBUG_LOG(("Options: %s", stats.options.c_str())); } if (stats.systemSpec.length()) { - DEBUG_LOG(("systemSpec: %s\n", stats.systemSpec.c_str())); + DEBUG_LOG(("systemSpec: %s", stats.systemSpec.c_str())); } if (stats.lastFPS > 0.0f) { - DEBUG_LOG(("lastFPS: %g\n", stats.lastFPS)); + DEBUG_LOG(("lastFPS: %g", stats.lastFPS)); } if (stats.battleHonors > 0) { - DEBUG_LOG(("battleHonors: %x\n", stats.battleHonors)); + DEBUG_LOG(("battleHonors: %x", stats.battleHonors)); } if (stats.challengeMedals > 0) { - DEBUG_LOG(("challengeMedals: %x\n", stats.challengeMedals)); + DEBUG_LOG(("challengeMedals: %x", stats.challengeMedals)); } if (stats.lastGeneral >= 0) { - DEBUG_LOG(("lastGeneral: %d\n", stats.lastGeneral)); + DEBUG_LOG(("lastGeneral: %d", stats.lastGeneral)); } if (stats.gamesInRowWithLastGeneral >= 0) { - DEBUG_LOG(("gamesInRowWithLastGeneral: %d\n", stats.gamesInRowWithLastGeneral)); + DEBUG_LOG(("gamesInRowWithLastGeneral: %d", stats.gamesInRowWithLastGeneral)); } if (stats.builtSCUD >= 0) { - DEBUG_LOG(("builtSCUD: %d\n", stats.builtSCUD)); + DEBUG_LOG(("builtSCUD: %d", stats.builtSCUD)); } if (stats.builtNuke >= 0) { - DEBUG_LOG(("builtNuke: %d\n", stats.builtNuke)); + DEBUG_LOG(("builtNuke: %d", stats.builtNuke)); } if (stats.builtParticleCannon >= 0) { - DEBUG_LOG(("builtParticleCannon: %d\n", stats.builtParticleCannon)); + DEBUG_LOG(("builtParticleCannon: %d", stats.builtParticleCannon)); } if (stats.winsInARow >= 0) { - DEBUG_LOG(("winsInARow: %d\n", stats.winsInARow)); + DEBUG_LOG(("winsInARow: %d", stats.winsInARow)); } if (stats.maxWinsInARow >= 0) { - DEBUG_LOG(("maxWinsInARow: %d\n", stats.maxWinsInARow)); + DEBUG_LOG(("maxWinsInARow: %d", stats.maxWinsInARow)); } if (stats.disconsInARow >= 0) { - DEBUG_LOG(("disconsInARow: %d\n", stats.disconsInARow)); + DEBUG_LOG(("disconsInARow: %d", stats.disconsInARow)); } if (stats.maxDisconsInARow >= 0) { - DEBUG_LOG(("maxDisconsInARow: %d\n", stats.maxDisconsInARow)); + DEBUG_LOG(("maxDisconsInARow: %d", stats.maxDisconsInARow)); } if (stats.lossesInARow >= 0) { - DEBUG_LOG(("lossesInARow: %d\n", stats.lossesInARow)); + DEBUG_LOG(("lossesInARow: %d", stats.lossesInARow)); } if (stats.maxLossesInARow >= 0) { - DEBUG_LOG(("maxLossesInARow: %d\n", stats.maxLossesInARow)); + DEBUG_LOG(("maxLossesInARow: %d", stats.maxLossesInARow)); } if (stats.desyncsInARow >= 0) { - DEBUG_LOG(("desyncsInARow: %d\n", stats.desyncsInARow)); + DEBUG_LOG(("desyncsInARow: %d", stats.desyncsInARow)); } if (stats.maxDesyncsInARow >= 0) { - DEBUG_LOG(("maxDesyncsInARow: %d\n", stats.maxDesyncsInARow)); + DEBUG_LOG(("maxDesyncsInARow: %d", stats.maxDesyncsInARow)); } if (stats.lastLadderPort >= 0) { - DEBUG_LOG(("lastLadderPort: %d\n", stats.lastLadderPort)); + DEBUG_LOG(("lastLadderPort: %d", stats.lastLadderPort)); } if (stats.lastLadderHost.length()) { - DEBUG_LOG(("lastLadderHost: %s\n", stats.lastLadderHost.c_str())); + DEBUG_LOG(("lastLadderHost: %s", stats.lastLadderHost.c_str())); } @@ -579,11 +579,11 @@ Bool PSThreadClass::tryConnect( void ) { Int result; - DEBUG_LOG(("m_opCount = %d - opening connection\n", m_opCount)); + DEBUG_LOG(("m_opCount = %d - opening connection", m_opCount)); if (IsStatsConnected()) { - DEBUG_LOG(("connection already open!\n")); + DEBUG_LOG(("connection already open!")); return true; } @@ -603,12 +603,12 @@ Bool PSThreadClass::tryConnect( void ) if (result != GE_NOERROR) { - DEBUG_LOG(("InitStatsConnection() returned %d (%s)\n", result, retValStrings[result])); + DEBUG_LOG(("InitStatsConnection() returned %d (%s)", result, retValStrings[result])); return false; } else { - DEBUG_LOG(("InitStatsConnection() succeeded\n")); + DEBUG_LOG(("InitStatsConnection() succeeded")); } return true; @@ -617,7 +617,7 @@ Bool PSThreadClass::tryConnect( void ) static void persAuthCallback(int localid, int profileid, int authenticated, char *errmsg, void *instance) { PSThreadClass *t = (PSThreadClass *)instance; - DEBUG_LOG(("Auth callback: localid: %d profileid: %d auth: %d err: %s\n",localid, profileid, authenticated, errmsg)); + DEBUG_LOG(("Auth callback: localid: %d profileid: %d auth: %d err: %s",localid, profileid, authenticated, errmsg)); if (t) t->persAuthCallback(authenticated != 0); } @@ -625,7 +625,7 @@ static void persAuthCallback(int localid, int profileid, int authenticated, char Bool PSThreadClass::tryLogin( Int id, std::string nick, std::string password, std::string email ) { char validate[33]; - DEBUG_LOG(("PSThreadClass::tryLogin id = %d, nick = %s, password = %s, email = %s\n", id, nick.c_str(), password.c_str(), email.c_str())); + DEBUG_LOG(("PSThreadClass::tryLogin id = %d, nick = %s, password = %s, email = %s", id, nick.c_str(), password.c_str(), email.c_str())); /*********** We'll go ahead and start the authentication, using a Presence & Messaging SDK profileid / password. To generate the new validation token, we'll need to pass @@ -651,13 +651,13 @@ Bool PSThreadClass::tryLogin( Int id, std::string nick, std::string password, st PreAuthenticatePlayerPM(id, id, validate, ::persAuthCallback, this); while (!m_doneTryingToLogin && IsStatsConnected()) PersistThink(); - DEBUG_LOG(("Persistant Storage Login success %d\n", m_loginOK)); + DEBUG_LOG(("Persistant Storage Login success %d", m_loginOK)); return m_loginOK; } static void getPersistentDataCallback(int localid, int profileid, persisttype_t type, int index, int success, time_t modified, char *data, int len, void *instance) { - DEBUG_LOG(("Data get callback: localid: %d profileid: %d success: %d len: %d data: %s\n",localid, profileid, success, len, data)); + DEBUG_LOG(("Data get callback: localid: %d profileid: %d success: %d len: %d data: %s",localid, profileid, success, len, data)); PSThreadClass *t = (PSThreadClass *)instance; if (!t) return; @@ -674,7 +674,7 @@ static void getPersistentDataCallback(int localid, int profileid, persisttype_t if (!t->getOpCount() && !t->sawLocalPlayerData()) { // we haven't gotten stats for ourselves - try again - DEBUG_LOG(("Requesting retry for reading local player's stats\n")); + DEBUG_LOG(("Requesting retry for reading local player's stats")); PSRequest req; req.requestType = PSRequest::PSREQUEST_READPLAYERSTATS; req.player.id = MESSAGE_QUEUE->getLocalPlayerID(); @@ -686,46 +686,46 @@ static void getPersistentDataCallback(int localid, int profileid, persisttype_t if (profileid == MESSAGE_QUEUE->getLocalPlayerID()) { t->gotLocalPlayerData(); - DEBUG_LOG(("getPersistentDataCallback() - got local player info\n")); + DEBUG_LOG(("getPersistentDataCallback() - got local player info")); // check if we have discons we should update on the server UserPreferences pref; AsciiString userPrefFilename; userPrefFilename.format("GeneralsOnline\\MiscPref%d.ini", MESSAGE_QUEUE->getLocalPlayerID()); - DEBUG_LOG(("using the file %s\n", userPrefFilename.str())); + DEBUG_LOG(("using the file %s", userPrefFilename.str())); pref.load(userPrefFilename); Int addedInDesyncs2 = pref.getInt("0", 0); - DEBUG_LOG(("addedInDesyncs2 = %d\n", addedInDesyncs2)); + DEBUG_LOG(("addedInDesyncs2 = %d", addedInDesyncs2)); if (addedInDesyncs2 < 0) addedInDesyncs2 = 10; Int addedInDesyncs3 = pref.getInt("1", 0); - DEBUG_LOG(("addedInDesyncs3 = %d\n", addedInDesyncs3)); + DEBUG_LOG(("addedInDesyncs3 = %d", addedInDesyncs3)); if (addedInDesyncs3 < 0) addedInDesyncs3 = 10; Int addedInDesyncs4 = pref.getInt("2", 0); - DEBUG_LOG(("addedInDesyncs4 = %d\n", addedInDesyncs4)); + DEBUG_LOG(("addedInDesyncs4 = %d", addedInDesyncs4)); if (addedInDesyncs4 < 0) addedInDesyncs4 = 10; Int addedInDiscons2 = pref.getInt("3", 0); - DEBUG_LOG(("addedInDiscons2 = %d\n", addedInDiscons2)); + DEBUG_LOG(("addedInDiscons2 = %d", addedInDiscons2)); if (addedInDiscons2 < 0) addedInDiscons2 = 10; Int addedInDiscons3 = pref.getInt("4", 0); - DEBUG_LOG(("addedInDiscons3 = %d\n", addedInDiscons3)); + DEBUG_LOG(("addedInDiscons3 = %d", addedInDiscons3)); if (addedInDiscons3 < 0) addedInDiscons3 = 10; Int addedInDiscons4 = pref.getInt("5", 0); - DEBUG_LOG(("addedInDiscons4 = %d\n", addedInDiscons4)); + DEBUG_LOG(("addedInDiscons4 = %d", addedInDiscons4)); if (addedInDiscons4 < 0) addedInDiscons4 = 10; - DEBUG_LOG(("addedInDesync=%d,%d,%d, addedInDiscon=%d,%d,%d\n", + DEBUG_LOG(("addedInDesync=%d,%d,%d, addedInDiscon=%d,%d,%d", addedInDesyncs2, addedInDesyncs3, addedInDesyncs4, addedInDiscons2, addedInDiscons3, addedInDiscons4)); if (addedInDesyncs2 || addedInDesyncs3 || addedInDesyncs4 || addedInDiscons2 || addedInDiscons3 || addedInDiscons4) { - DEBUG_LOG(("We have a previous discon we can attempt to update! Bummer...\n")); + DEBUG_LOG(("We have a previous discon we can attempt to update! Bummer...")); PSRequest req; req.requestType = PSRequest::PSREQUEST_UPDATEPLAYERSTATS; @@ -750,7 +750,7 @@ static void getPersistentDataCallback(int localid, int profileid, persisttype_t static void setPersistentDataLocaleCallback(int localid, int profileid, persisttype_t type, int index, int success, time_t modified, void *instance) { - DEBUG_LOG(("Data save callback: localid: %d profileid: %d success: %d\n", localid, profileid, success)); + DEBUG_LOG(("Data save callback: localid: %d profileid: %d success: %d", localid, profileid, success)); PSThreadClass *t = (PSThreadClass *)instance; if (!t) @@ -761,7 +761,7 @@ static void setPersistentDataLocaleCallback(int localid, int profileid, persistt static void setPersistentDataCallback(int localid, int profileid, persisttype_t type, int index, int success, time_t modified, void *instance) { - DEBUG_LOG(("Data save callback: localid: %d profileid: %d success: %d\n", localid, profileid, success)); + DEBUG_LOG(("Data save callback: localid: %d profileid: %d success: %d", localid, profileid, success)); PSThreadClass *t = (PSThreadClass *)instance; if (!t) @@ -772,7 +772,7 @@ static void setPersistentDataCallback(int localid, int profileid, persisttype_t UserPreferences pref; AsciiString userPrefFilename; userPrefFilename.format("GeneralsOnline\\MiscPref%d.ini", profileid); - DEBUG_LOG(("setPersistentDataCallback - writing stats to file %s\n", userPrefFilename.str())); + DEBUG_LOG(("setPersistentDataCallback - writing stats to file %s", userPrefFilename.str())); pref.load(userPrefFilename); pref.clear(); pref.write(); @@ -789,7 +789,7 @@ struct CDAuthInfo void preAuthCDCallback(int localid, int profileid, int authenticated, char *errmsg, void *instance) { - DEBUG_LOG(("preAuthCDCallback(): profileid: %d auth: %d err: %s\n", profileid, authenticated, errmsg)); + DEBUG_LOG(("preAuthCDCallback(): profileid: %d auth: %d err: %s", profileid, authenticated, errmsg)); CDAuthInfo *authInfo = (CDAuthInfo *)instance; authInfo->success = authenticated; @@ -809,13 +809,13 @@ static void getPreorderCallback(int localid, int profileid, persisttype_t type, if (!success) { - DEBUG_LOG(("Failed getPreorderCallback()\n")); + DEBUG_LOG(("Failed getPreorderCallback()")); return; } resp.responseType = PSResponse::PSRESPONSE_PREORDER; resp.preorder = (data && strcmp(data, "\\preorder\\1") == 0); - DEBUG_LOG(("getPreorderCallback() - data was '%s'\n", data)); + DEBUG_LOG(("getPreorderCallback() - data was '%s'", data)); TheGameSpyPSMessageQueue->addResponse(resp); } @@ -867,7 +867,7 @@ void PSThreadClass::Thread_Function() Int res = #endif // DEBUG_LOGGING SendGameSnapShot(NULL, req.results.c_str(), SNAP_FINAL); - DEBUG_LOG(("Just sent game results - res was %d\n", res)); + DEBUG_LOG(("Just sent game results - res was %d", res)); FreeGame(NULL); } } @@ -881,20 +881,20 @@ void PSThreadClass::Thread_Function() MESSAGE_QUEUE->setEmail(req.email); MESSAGE_QUEUE->setNick(req.nick); MESSAGE_QUEUE->setPassword(req.password); - DEBUG_LOG(("Setting email/nick/password = %s/%s/%s\n", req.email.c_str(), req.nick.c_str(), req.password.c_str())); + DEBUG_LOG(("Setting email/nick/password = %s/%s/%s", req.email.c_str(), req.nick.c_str(), req.password.c_str())); initialConnection = TRUE; } - DEBUG_LOG(("Processing PSRequest::PSREQUEST_READPLAYERSTATS\n")); + DEBUG_LOG(("Processing PSRequest::PSREQUEST_READPLAYERSTATS")); if (tryConnect()) { - DEBUG_LOG(("Successful login\n")); + DEBUG_LOG(("Successful login")); incrOpCount(); gsi_char keys[] = ""; GetPersistDataValues(0, req.player.id, pd_public_rw, 0, keys, getPersistentDataCallback, this); } else { - DEBUG_LOG(("Unsuccessful login - retry=%d\n", initialConnection)); + DEBUG_LOG(("Unsuccessful login - retry=%d", initialConnection)); PSResponse resp; resp.responseType = PSResponse::PSRESPONSE_COULDNOTCONNECT; resp.player.id = req.player.id; @@ -902,7 +902,7 @@ void PSThreadClass::Thread_Function() if (initialConnection) { // we haven't gotten stats for ourselves - try again - DEBUG_LOG(("Requesting retry for reading local player's stats\n")); + DEBUG_LOG(("Requesting retry for reading local player's stats")); PSRequest req; req.requestType = PSRequest::PSREQUEST_READPLAYERSTATS; req.player.id = MESSAGE_QUEUE->getLocalPlayerID(); @@ -913,7 +913,7 @@ void PSThreadClass::Thread_Function() break; case PSRequest::PSREQUEST_UPDATEPLAYERLOCALE: { - DEBUG_LOG(("Processing PSRequest::PSREQUEST_UPDATEPLAYERLOCALE\n")); + DEBUG_LOG(("Processing PSRequest::PSREQUEST_UPDATEPLAYERLOCALE")); if (tryConnect() && tryLogin(req.player.id, req.nick, req.password, req.email)) { char kvbuf[256]; @@ -928,38 +928,38 @@ void PSThreadClass::Thread_Function() /* ** NOTE THAT THIS IS HIGHLY DEPENDENT ON INI ORDERING FOR THE PLAYERTEMPLATES!!! */ - DEBUG_LOG(("Processing PSRequest::PSREQUEST_UPDATEPLAYERSTATS\n")); + DEBUG_LOG(("Processing PSRequest::PSREQUEST_UPDATEPLAYERSTATS")); UserPreferences pref; AsciiString userPrefFilename; userPrefFilename.format("GeneralsOnline\\MiscPref%d.ini", MESSAGE_QUEUE->getLocalPlayerID()); - DEBUG_LOG(("using the file %s\n", userPrefFilename.str())); + DEBUG_LOG(("using the file %s", userPrefFilename.str())); pref.load(userPrefFilename); Int addedInDesyncs2 = pref.getInt("0", 0); - DEBUG_LOG(("addedInDesyncs2 = %d\n", addedInDesyncs2)); + DEBUG_LOG(("addedInDesyncs2 = %d", addedInDesyncs2)); if (addedInDesyncs2 < 0) addedInDesyncs2 = 10; Int addedInDesyncs3 = pref.getInt("1", 0); - DEBUG_LOG(("addedInDesyncs3 = %d\n", addedInDesyncs3)); + DEBUG_LOG(("addedInDesyncs3 = %d", addedInDesyncs3)); if (addedInDesyncs3 < 0) addedInDesyncs3 = 10; Int addedInDesyncs4 = pref.getInt("2", 0); - DEBUG_LOG(("addedInDesyncs4 = %d\n", addedInDesyncs4)); + DEBUG_LOG(("addedInDesyncs4 = %d", addedInDesyncs4)); if (addedInDesyncs4 < 0) addedInDesyncs4 = 10; Int addedInDiscons2 = pref.getInt("3", 0); - DEBUG_LOG(("addedInDiscons2 = %d\n", addedInDiscons2)); + DEBUG_LOG(("addedInDiscons2 = %d", addedInDiscons2)); if (addedInDiscons2 < 0) addedInDiscons2 = 10; Int addedInDiscons3 = pref.getInt("4", 0); - DEBUG_LOG(("addedInDiscons3 = %d\n", addedInDiscons3)); + DEBUG_LOG(("addedInDiscons3 = %d", addedInDiscons3)); if (addedInDiscons3 < 0) addedInDiscons3 = 10; Int addedInDiscons4 = pref.getInt("5", 0); - DEBUG_LOG(("addedInDiscons4 = %d\n", addedInDiscons4)); + DEBUG_LOG(("addedInDiscons4 = %d", addedInDiscons4)); if (addedInDiscons4 < 0) addedInDiscons4 = 10; - DEBUG_LOG(("req.addDesync=%d, req.addDiscon=%d, addedInDesync=%d,%d,%d, addedInDiscon=%d,%d,%d\n", + DEBUG_LOG(("req.addDesync=%d, req.addDiscon=%d, addedInDesync=%d,%d,%d, addedInDiscon=%d,%d,%d", req.addDesync, req.addDiscon, addedInDesyncs2, addedInDesyncs3, addedInDesyncs4, addedInDiscons2, addedInDiscons3, addedInDiscons4)); @@ -972,7 +972,7 @@ void PSThreadClass::Thread_Function() pref["0"] = val; val.format("%d", addedInDiscons2 + req.addDiscon); pref["3"] = val; - DEBUG_LOG(("house 2 req.addDesync || req.addDiscon: %d %d\n", + DEBUG_LOG(("house 2 req.addDesync || req.addDiscon: %d %d", addedInDesyncs2 + req.addDesync, addedInDiscons2 + req.addDiscon)); } else if (req.lastHouse == 3) @@ -981,7 +981,7 @@ void PSThreadClass::Thread_Function() pref["1"] = val; val.format("%d", addedInDiscons3 + req.addDiscon); pref["4"] = val; - DEBUG_LOG(("house 3 req.addDesync || req.addDiscon: %d %d\n", + DEBUG_LOG(("house 3 req.addDesync || req.addDiscon: %d %d", addedInDesyncs3 + req.addDesync, addedInDiscons3 + req.addDiscon)); } else @@ -990,7 +990,7 @@ void PSThreadClass::Thread_Function() pref["2"] = val; val.format("%d", addedInDiscons4 + req.addDiscon); pref["5"] = val; - DEBUG_LOG(("house 4 req.addDesync || req.addDiscon: %d %d\n", + DEBUG_LOG(("house 4 req.addDesync || req.addDiscon: %d %d", addedInDesyncs4 + req.addDesync, addedInDiscons4 + req.addDiscon)); } pref.write(); @@ -999,7 +999,7 @@ void PSThreadClass::Thread_Function() } if (!req.player.id) { - DEBUG_LOG(("Bailing because ID is NULL!\n")); + DEBUG_LOG(("Bailing because ID is NULL!")); return; } req.player.desyncs[2] += addedInDesyncs2; @@ -1014,26 +1014,26 @@ void PSThreadClass::Thread_Function() req.player.games[4] += addedInDesyncs4; req.player.discons[4] += addedInDiscons4; req.player.games[4] += addedInDiscons4; - DEBUG_LOG(("House2: %d/%d/%d, House3: %d/%d/%d, House4: %d/%d/%d\n", + DEBUG_LOG(("House2: %d/%d/%d, House3: %d/%d/%d, House4: %d/%d/%d", req.player.desyncs[2], req.player.discons[2], req.player.games[2], req.player.desyncs[3], req.player.discons[3], req.player.games[3], req.player.desyncs[4], req.player.discons[4], req.player.games[4] )); if (tryConnect() && tryLogin(req.player.id, req.nick, req.password, req.email)) { - DEBUG_LOG(("Logged in!\n")); + DEBUG_LOG(("Logged in!")); if (TheGameSpyPSMessageQueue) TheGameSpyPSMessageQueue->trackPlayerStats(req.player); char *munkeeHack = strdup(GameSpyPSMessageQueueInterface::formatPlayerKVPairs(req.player).c_str()); // GS takes a char* for some reason incrOpCount(); - DEBUG_LOG(("Setting values %s\n", munkeeHack)); + DEBUG_LOG(("Setting values %s", munkeeHack)); SetPersistDataValues(0, req.player.id, pd_public_rw, 0, munkeeHack, setPersistentDataCallback, this); free(munkeeHack); } else { - DEBUG_LOG(("Cannot connect!\n")); + DEBUG_LOG(("Cannot connect!")); //if (IsStatsConnected()) //CloseStatsConnection(); } @@ -1041,7 +1041,7 @@ void PSThreadClass::Thread_Function() break; case PSRequest::PSREQUEST_READCDKEYSTATS: { - DEBUG_LOG(("Processing PSRequest::PSREQUEST_READCDKEYSTATS\n")); + DEBUG_LOG(("Processing PSRequest::PSREQUEST_READCDKEYSTATS")); if (tryConnect()) { incrOpCount(); @@ -1063,7 +1063,7 @@ void PSThreadClass::Thread_Function() while (running && IsStatsConnected() && !cdAuthInfo.done) PersistThink(); - DEBUG_LOG(("Looking for preorder status for %d (success=%d, done=%d) from CDKey %s with hash %s\n", + DEBUG_LOG(("Looking for preorder status for %d (success=%d, done=%d) from CDKey %s with hash %s", cdAuthInfo.id, cdAuthInfo.success, cdAuthInfo.done, req.cdkey.c_str(), cdkeyHash)); if (cdAuthInfo.done && cdAuthInfo.success) { @@ -1085,7 +1085,7 @@ void PSThreadClass::Thread_Function() if (m_opCount <= 0) { DEBUG_ASSERTCRASH(m_opCount == 0, ("Negative operations pending!!!")); - DEBUG_LOG(("m_opCount = %d - closing connection\n", m_opCount)); + DEBUG_LOG(("m_opCount = %d - closing connection", m_opCount)); CloseStatsConnection(); m_opCount = 0; } @@ -1171,7 +1171,7 @@ PSPlayerStats GameSpyPSMessageQueueInterface::parsePlayerKVPairs( std::string kv generalMarker = atoi(g.c_str()); } v = kvPairs.substr(secondMarker + 1, thirdMarker - secondMarker - 1); - //DEBUG_LOG(("%d [%s] [%s]\n", generalMarker, k.c_str(), v.c_str())); + //DEBUG_LOG(("%d [%s] [%s]", generalMarker, k.c_str(), v.c_str())); offset = thirdMarker - 1; CHECK(wins); @@ -1502,7 +1502,7 @@ std::string GameSpyPSMessageQueueInterface::formatPlayerKVPairs( PSPlayerStats s s.append(kvbuf); } - DEBUG_LOG(("Formatted persistent values as '%s'\n", s.c_str())); + DEBUG_LOG(("Formatted persistent values as '%s'", s.c_str())); return s; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp index 8ca7ed0cfb..81c74a1049 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp @@ -270,7 +270,7 @@ void PingThreadClass::Thread_Function() IP = inet_addr(hostnameBuffer); in_addr hostNode; hostNode.s_addr = IP; - DEBUG_LOG(("pinging %s - IP = %s\n", hostnameBuffer, inet_ntoa(hostNode) )); + DEBUG_LOG(("pinging %s - IP = %s", hostnameBuffer, inet_ntoa(hostNode) )); } else { @@ -279,7 +279,7 @@ void PingThreadClass::Thread_Function() hostStruct = gethostbyname(hostnameBuffer); if (hostStruct == NULL) { - DEBUG_LOG(("pinging %s - host lookup failed\n", hostnameBuffer)); + DEBUG_LOG(("pinging %s - host lookup failed", hostnameBuffer)); // Even though this failed to resolve IP, still need to send a // callback. @@ -289,7 +289,7 @@ void PingThreadClass::Thread_Function() { hostNode = (in_addr *) hostStruct->h_addr; IP = hostNode->s_addr; - DEBUG_LOG(("pinging %s IP = %s\n", hostnameBuffer, inet_ntoa(*hostNode) )); + DEBUG_LOG(("pinging %s IP = %s", hostnameBuffer, inet_ntoa(*hostNode) )); } } @@ -459,7 +459,7 @@ Int PingThreadClass::doPing(UnsignedInt IP, Int timeout) hICMP_DLL = LoadLibrary("ICMP.DLL"); if (hICMP_DLL == 0) { - DEBUG_LOG(("LoadLibrary() failed: Unable to locate ICMP.DLL!\n")); + DEBUG_LOG(("LoadLibrary() failed: Unable to locate ICMP.DLL!")); goto cleanup; } @@ -475,7 +475,7 @@ Int PingThreadClass::doPing(UnsignedInt IP, Int timeout) (!lpfnIcmpCloseHandle) || (!lpfnIcmpSendEcho)) { - DEBUG_LOG(("GetProcAddr() failed for at least one function.\n")); + DEBUG_LOG(("GetProcAddr() failed for at least one function.")); goto cleanup; } @@ -541,13 +541,13 @@ Int PingThreadClass::doPing(UnsignedInt IP, Int timeout) dwStatus = *(DWORD *) & (achRepData[4]); if (dwStatus != IP_SUCCESS) { - DEBUG_LOG(("ICMPERR: %d\n", dwStatus)); + DEBUG_LOG(("ICMPERR: %d", dwStatus)); } } else { - DEBUG_LOG(("IcmpSendEcho() failed: %d\n", dwReplyCount)); + DEBUG_LOG(("IcmpSendEcho() failed: %d", dwReplyCount)); // Ok we didn't get a packet, just say everything's OK // and the time was -1 pingTime = -1; @@ -561,7 +561,7 @@ Int PingThreadClass::doPing(UnsignedInt IP, Int timeout) fRet = lpfnIcmpCloseHandle(hICMP); if (fRet == FALSE) { - DEBUG_LOG(("Error closing ICMP handle\n")); + DEBUG_LOG(("Error closing ICMP handle")); } // Say what you will about goto's but it's handy for stuff like this diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpyChat.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpyChat.cpp index 908f56b37e..970dc4e7d6 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpyChat.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpyChat.cpp @@ -375,7 +375,7 @@ void RoomMessageCallback(PEER peer, RoomType roomType, const char * nick, const char * message, MessageType messageType, void * param) { - DEBUG_LOG(("RoomMessageCallback\n")); + DEBUG_LOG(("RoomMessageCallback")); handleUnicodeMessage(nick, QuotedPrintableToUnicodeString(message), true, (messageType == ActionMessage)); } @@ -383,7 +383,7 @@ void PlayerMessageCallback(PEER peer, const char * nick, const char * message, MessageType messageType, void * param) { - DEBUG_LOG(("PlayerMessageCallback\n")); + DEBUG_LOG(("PlayerMessageCallback")); handleUnicodeMessage(nick, QuotedPrintableToUnicodeString(message), false, (messageType == ActionMessage)); } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpyGP.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpyGP.cpp index 751d81d21f..6d8d777849 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpyGP.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpyGP.cpp @@ -40,7 +40,7 @@ char GameSpyProfilePassword[64]; void GPRecvBuddyMessageCallback(GPConnection * pconnection, GPRecvBuddyMessageArg * arg, void * param) { - DEBUG_LOG(("GPRecvBuddyMessageCallback: message from %d is %s\n", arg->profile, arg->message)); + DEBUG_LOG(("GPRecvBuddyMessageCallback: message from %d is %s", arg->profile, arg->message)); //gpGetInfo(pconn, arg->profile, GP_DONT_CHECK_CACHE, GP_BLOCKING, (GPCallback)Whois, NULL); //printf("MESSAGE (%d): %s: %s\n", msgCount,whois, arg->message); @@ -53,7 +53,7 @@ static void buddyTryReconnect( void ) void GPErrorCallback(GPConnection * pconnection, GPErrorArg * arg, void * param) { - DEBUG_LOG(("GPErrorCallback\n")); + DEBUG_LOG(("GPErrorCallback")); AsciiString errorCodeString; AsciiString resultString; @@ -126,9 +126,9 @@ void GPErrorCallback(GPConnection * pconnection, GPErrorArg * arg, void * param) if(arg->fatal) { - DEBUG_LOG(( "-----------\n")); - DEBUG_LOG(( "GP FATAL ERROR\n")); - DEBUG_LOG(( "-----------\n")); + DEBUG_LOG(( "-----------")); + DEBUG_LOG(( "GP FATAL ERROR")); + DEBUG_LOG(( "-----------")); // if we're still connected to the chat server, tell the user. He can always hit the buddy // button to try reconnecting. Oh yes, also hide the buddy popup. @@ -140,23 +140,23 @@ void GPErrorCallback(GPConnection * pconnection, GPErrorArg * arg, void * param) } else { - DEBUG_LOG(( "-----\n")); - DEBUG_LOG(( "GP ERROR\n")); - DEBUG_LOG(( "-----\n")); + DEBUG_LOG(( "-----")); + DEBUG_LOG(( "GP ERROR")); + DEBUG_LOG(( "-----")); } - DEBUG_LOG(( "RESULT: %s (%d)\n", resultString.str(), arg->result)); - DEBUG_LOG(( "ERROR CODE: %s (0x%X)\n", errorCodeString.str(), arg->errorCode)); - DEBUG_LOG(( "ERROR STRING: %s\n", arg->errorString)); + DEBUG_LOG(( "RESULT: %s (%d)", resultString.str(), arg->result)); + DEBUG_LOG(( "ERROR CODE: %s (0x%X)", errorCodeString.str(), arg->errorCode)); + DEBUG_LOG(( "ERROR STRING: %s", arg->errorString)); } void GPRecvBuddyStatusCallback(GPConnection * connection, GPRecvBuddyStatusArg * arg, void * param) { - DEBUG_LOG(("GPRecvBuddyStatusCallback: info on %d is in %d\n", arg->profile, arg->index)); + DEBUG_LOG(("GPRecvBuddyStatusCallback: info on %d is in %d", arg->profile, arg->index)); //GameSpyUpdateBuddyOverlay(); } void GPRecvBuddyRequestCallback(GPConnection * connection, GPRecvBuddyRequestArg * arg, void * param) { - DEBUG_LOG(("GPRecvBuddyRequestCallback: %d wants to be our buddy because '%s'\n", arg->profile, arg->reason)); + DEBUG_LOG(("GPRecvBuddyRequestCallback: %d wants to be our buddy because '%s'", arg->profile, arg->reason)); } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpyGameInfo.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpyGameInfo.cpp index 1f24ff9f7e..0ccfc77a75 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpyGameInfo.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpyGameInfo.cpp @@ -159,18 +159,18 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP "DELETE_TCB" }; - DEBUG_LOG(("Finding local address used to talk to the chat server\n")); - DEBUG_LOG(("Current chat server name is %s\n", serverName.str())); - DEBUG_LOG(("Chat server port is %d\n", serverPort)); + DEBUG_LOG(("Finding local address used to talk to the chat server")); + DEBUG_LOG(("Current chat server name is %s", serverName.str())); + DEBUG_LOG(("Chat server port is %d", serverPort)); /* ** Get the address of the chat server. */ - DEBUG_LOG( ("About to call gethostbyname\n")); + DEBUG_LOG( ("About to call gethostbyname")); struct hostent *host_info = gethostbyname(serverName.str()); if (!host_info) { - DEBUG_LOG( ("gethostbyname failed! Error code %d\n", WSAGetLastError())); + DEBUG_LOG( ("gethostbyname failed! Error code %d", WSAGetLastError())); return(false); } @@ -179,24 +179,24 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP temp = ntohl(temp); *((unsigned long*)(&serverAddress[0])) = temp; - DEBUG_LOG(("Host address is %d.%d.%d.%d\n", serverAddress[3], serverAddress[2], serverAddress[1], serverAddress[0])); + DEBUG_LOG(("Host address is %d.%d.%d.%d", serverAddress[3], serverAddress[2], serverAddress[1], serverAddress[0])); /* ** Load the MIB-II SNMP DLL. */ - DEBUG_LOG(("About to load INETMIB1.DLL\n")); + DEBUG_LOG(("About to load INETMIB1.DLL")); HINSTANCE mib_ii_dll = LoadLibrary("inetmib1.dll"); if (mib_ii_dll == NULL) { - DEBUG_LOG(("Failed to load INETMIB1.DLL\n")); + DEBUG_LOG(("Failed to load INETMIB1.DLL")); return(false); } - DEBUG_LOG(("About to load SNMPAPI.DLL\n")); + DEBUG_LOG(("About to load SNMPAPI.DLL")); HINSTANCE snmpapi_dll = LoadLibrary("snmpapi.dll"); if (snmpapi_dll == NULL) { - DEBUG_LOG(("Failed to load SNMPAPI.DLL\n")); + DEBUG_LOG(("Failed to load SNMPAPI.DLL")); FreeLibrary(mib_ii_dll); return(false); } @@ -209,7 +209,7 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP SnmpUtilMemAllocPtr = (void *(__stdcall *)(unsigned long)) GetProcAddress(snmpapi_dll, "SnmpUtilMemAlloc"); SnmpUtilMemFreePtr = (void (__stdcall *)(void *)) GetProcAddress(snmpapi_dll, "SnmpUtilMemFree"); if (SnmpExtensionInitPtr == NULL || SnmpExtensionQueryPtr == NULL || SnmpUtilMemAllocPtr == NULL || SnmpUtilMemFreePtr == NULL) { - DEBUG_LOG(("Failed to get proc addresses for linked functions\n")); + DEBUG_LOG(("Failed to get proc addresses for linked functions")); FreeLibrary(snmpapi_dll); FreeLibrary(mib_ii_dll); return(false); @@ -222,14 +222,14 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP /* ** OK, here we go. Try to initialise the .dll */ - DEBUG_LOG(("About to init INETMIB1.DLL\n")); + DEBUG_LOG(("About to init INETMIB1.DLL")); int ok = SnmpExtensionInitPtr(GetCurrentTime(), &trap_handle, &first_supported_region); if (!ok) { /* ** Aw crap. */ - DEBUG_LOG(("Failed to init the .dll\n")); + DEBUG_LOG(("Failed to init the .dll")); SnmpUtilMemFreePtr(bind_list_ptr); SnmpUtilMemFreePtr(bind_ptr); FreeLibrary(snmpapi_dll); @@ -278,7 +278,7 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP if (!SnmpExtensionQueryPtr(SNMP_PDU_GETNEXT, bind_list_ptr, &error_status, &error_index)) { //if (!SnmpExtensionQueryPtr(ASN_RFC1157_GETNEXTREQUEST, bind_list_ptr, &error_status, &error_index)) { - DEBUG_LOG(("SnmpExtensionQuery returned false\n")); + DEBUG_LOG(("SnmpExtensionQuery returned false")); SnmpUtilMemFreePtr(bind_list_ptr); SnmpUtilMemFreePtr(bind_ptr); FreeLibrary(snmpapi_dll); @@ -382,7 +382,7 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP SnmpUtilMemFreePtr(bind_ptr); SnmpUtilMemFreePtr(mib_ii_name_ptr); - DEBUG_LOG(("Got %d connections in list, parsing...\n", connectionVector.size())); + DEBUG_LOG(("Got %d connections in list, parsing...", connectionVector.size())); /* ** Right, we got the lot. Lets see if any of them have the same address as the chat @@ -399,29 +399,29 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP ** See if this connection has the same address as our server. */ if (!found && memcmp(remoteAddress, serverAddress, 4) == 0) { - DEBUG_LOG(("Found connection with same remote address as server\n")); + DEBUG_LOG(("Found connection with same remote address as server")); if (serverPort == 0 || serverPort == (unsigned int)connection.RemotePort) { - DEBUG_LOG(("Connection has same port\n")); + DEBUG_LOG(("Connection has same port")); /* ** Make sure the connection is current. */ if (connection.State == ESTABLISHED) { - DEBUG_LOG(("Connection is ESTABLISHED\n")); + DEBUG_LOG(("Connection is ESTABLISHED")); localIP = connection.LocalIP; found = true; } else { - DEBUG_LOG(("Connection is not ESTABLISHED - skipping\n")); + DEBUG_LOG(("Connection is not ESTABLISHED - skipping")); } } else { - DEBUG_LOG(("Connection has different port. Port is %d, looking for %d\n", connection.RemotePort, serverPort)); + DEBUG_LOG(("Connection has different port. Port is %d, looking for %d", connection.RemotePort, serverPort)); } } } if (found) { - DEBUG_LOG(("Using address 0x%8.8X to talk to chat server\n", localIP)); + DEBUG_LOG(("Using address 0x%8.8X to talk to chat server", localIP)); } FreeLibrary(snmpapi_dll); @@ -564,7 +564,7 @@ void GameSpyLaunchGame( void ) // Set the random seed InitGameLogicRandom( TheGameSpyGame->getSeed() ); - DEBUG_LOG(("InitGameLogicRandom( %d )\n", TheGameSpyGame->getSeed())); + DEBUG_LOG(("InitGameLogicRandom( %d )", TheGameSpyGame->getSeed())); if (TheNAT != NULL) { delete TheNAT; @@ -588,7 +588,7 @@ void GameSpyGameInfo::resetAccepted( void ) { // ANCIENTMUNKEE peerStateChanged(TheGameSpyChat->getPeer()); m_hasBeenQueried = false; - DEBUG_LOG(("resetAccepted() called peerStateChange()\n")); + DEBUG_LOG(("resetAccepted() called peerStateChange()")); } } @@ -614,13 +614,13 @@ Int GameSpyGameInfo::getLocalSlotNum( void ) const void GameSpyGameInfo::gotGOACall( void ) { - DEBUG_LOG(("gotGOACall()\n")); + DEBUG_LOG(("gotGOACall()")); m_hasBeenQueried = true; } void GameSpyGameInfo::startGame(Int gameID) { - DEBUG_LOG(("GameSpyGameInfo::startGame - game id = %d\n", gameID)); + DEBUG_LOG(("GameSpyGameInfo::startGame - game id = %d", gameID)); DEBUG_ASSERTCRASH(m_transport == NULL, ("m_transport is not NULL when it should be")); DEBUG_ASSERTCRASH(TheNAT == NULL, ("TheNAT is not NULL when it should be")); diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpyOverlay.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpyOverlay.cpp index 8f55ee217f..2e44286c49 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpyOverlay.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpyOverlay.cpp @@ -235,28 +235,28 @@ void GameSpyCloseOverlay( GSOverlayType overlay ) switch(overlay) { case GSOVERLAY_PLAYERINFO: - DEBUG_LOG(("Closing overlay GSOVERLAY_PLAYERINFO\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_PLAYERINFO")); break; case GSOVERLAY_MAPSELECT: - DEBUG_LOG(("Closing overlay GSOVERLAY_MAPSELECT\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_MAPSELECT")); break; case GSOVERLAY_BUDDY: - DEBUG_LOG(("Closing overlay GSOVERLAY_BUDDY\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_BUDDY")); break; case GSOVERLAY_PAGE: - DEBUG_LOG(("Closing overlay GSOVERLAY_PAGE\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_PAGE")); break; case GSOVERLAY_GAMEOPTIONS: - DEBUG_LOG(("Closing overlay GSOVERLAY_GAMEOPTIONS\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_GAMEOPTIONS")); break; case GSOVERLAY_GAMEPASSWORD: - DEBUG_LOG(("Closing overlay GSOVERLAY_GAMEPASSWORD\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_GAMEPASSWORD")); break; case GSOVERLAY_LADDERSELECT: - DEBUG_LOG(("Closing overlay GSOVERLAY_LADDERSELECT\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_LADDERSELECT")); break; case GSOVERLAY_OPTIONS: - DEBUG_LOG(("Closing overlay GSOVERLAY_OPTIONS\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_OPTIONS")); if( overlayLayouts[overlay] ) { SignalUIInteraction(SHELL_SCRIPT_HOOK_OPTIONS_CLOSED); diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpyPersistentStorage.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpyPersistentStorage.cpp index 980a3b24ba..12d75ab4aa 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpyPersistentStorage.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpyPersistentStorage.cpp @@ -86,7 +86,7 @@ void GameSpyPlayerInfo::update( void ) { if (m_shouldDisconnect) { - DEBUG_LOG(("Persistent Storage close\n")); + DEBUG_LOG(("Persistent Storage close")); CloseStatsConnection(); } else @@ -108,7 +108,7 @@ void GameSpyPlayerInfo::threadReadFromServer( void ) { // get persistent info m_operationCount++; - DEBUG_LOG(("GameSpyPlayerInfo::readFromServer() operation count = %d\n", m_operationCount)); + DEBUG_LOG(("GameSpyPlayerInfo::readFromServer() operation count = %d", m_operationCount)); GetPersistDataValues(0, TheGameSpyChat->getProfileID(), pd_public_rw, 0, "\\locale\\wins\\losses", getPersistentDataCallback, &m_operationCount); } else @@ -180,7 +180,7 @@ void GameSpyPlayerInfo::threadSetLocale( AsciiString val ) str.format("\\%s\\%s", key.str(), val.str()); char *writable = strdup(str.str()); m_operationCount++; - DEBUG_LOG(("GameSpyPlayerInfo::set%s() operation count = %d\n", key.str(), m_operationCount)); + DEBUG_LOG(("GameSpyPlayerInfo::set%s() operation count = %d", key.str(), m_operationCount)); SetPersistDataValues(0, TheGameSpyChat->getProfileID(), pd_public_rw, 0, writable, setPersistentDataCallback, &m_operationCount); free(writable); } @@ -197,7 +197,7 @@ void GameSpyPlayerInfo::threadSetWins( AsciiString val ) str.format("\\%s\\%s", key.str(), val.str()); char *writable = strdup(str.str()); m_operationCount++; - DEBUG_LOG(("GameSpyPlayerInfo::set%s() operation count = %d\n", key.str(), m_operationCount)); + DEBUG_LOG(("GameSpyPlayerInfo::set%s() operation count = %d", key.str(), m_operationCount)); SetPersistDataValues(0, TheGameSpyChat->getProfileID(), pd_public_rw, 0, writable, setPersistentDataCallback, &m_operationCount); free(writable); } @@ -214,7 +214,7 @@ void GameSpyPlayerInfo::threadSetLosses( AsciiString val ) str.format("\\%s\\%s", key.str(), val.str()); char *writable = strdup(str.str()); m_operationCount++; - DEBUG_LOG(("GameSpyPlayerInfo::set%s() operation count = %d\n", key.str(), m_operationCount)); + DEBUG_LOG(("GameSpyPlayerInfo::set%s() operation count = %d", key.str(), m_operationCount)); SetPersistDataValues(0, TheGameSpyChat->getProfileID(), pd_public_rw, 0, writable, setPersistentDataCallback, &m_operationCount); free(writable); } @@ -236,13 +236,13 @@ GameSpyPlayerInfoInterface *createGameSpyPlayerInfo( void ) static void persAuthCallback(int localid, int profileid, int authenticated, char *errmsg, void *instance) { - DEBUG_LOG(("Auth callback: localid: %d profileid: %d auth: %d err: %s\n",localid, profileid, authenticated, errmsg)); + DEBUG_LOG(("Auth callback: localid: %d profileid: %d auth: %d err: %s",localid, profileid, authenticated, errmsg)); isProfileAuthorized = (authenticated != 0); } static void getPersistentDataCallback(int localid, int profileid, persisttype_t type, int index, int success, char *data, int len, void *instance) { - DEBUG_LOG(("Data get callback: localid: %d profileid: %d success: %d len: %d data: %s\n",localid, profileid, success, len, data)); + DEBUG_LOG(("Data get callback: localid: %d profileid: %d success: %d len: %d data: %s",localid, profileid, success, len, data)); if (!TheGameSpyPlayerInfo) { @@ -278,10 +278,10 @@ static void getPersistentDataCallback(int localid, int profileid, persisttype_t // decrement count of active operations Int *opCount = (Int *)instance; (*opCount) --; - DEBUG_LOG(("getPersistentDataCallback() operation count = %d\n", (*opCount))); + DEBUG_LOG(("getPersistentDataCallback() operation count = %d", (*opCount))); if (!*opCount) { - DEBUG_LOG(("getPersistentDataCallback() queue disconnect\n")); + DEBUG_LOG(("getPersistentDataCallback() queue disconnect")); ((GameSpyPlayerInfo *)TheGameSpyPlayerInfo)->queueDisconnect(); } @@ -304,14 +304,14 @@ static void getPersistentDataCallback(int localid, int profileid, persisttype_t static void setPersistentDataCallback(int localid, int profileid, persisttype_t type, int index, int success, void *instance) { - DEBUG_LOG(("Data save callback: localid: %d profileid: %d success: %d\n", localid, profileid, success)); + DEBUG_LOG(("Data save callback: localid: %d profileid: %d success: %d", localid, profileid, success)); Int *opCount = (Int *)instance; (*opCount) --; - DEBUG_LOG(("setPersistentDataCallback() operation count = %d\n", (*opCount))); + DEBUG_LOG(("setPersistentDataCallback() operation count = %d", (*opCount))); if (!*opCount) { - DEBUG_LOG(("setPersistentDataCallback() queue disconnect\n")); + DEBUG_LOG(("setPersistentDataCallback() queue disconnect")); ((GameSpyPlayerInfo *)TheGameSpyPlayerInfo)->queueDisconnect(); } } @@ -344,7 +344,7 @@ static Bool gameSpyInitPersistentStorageConnection( void ) if (result != GE_NOERROR) { - DEBUG_LOG(("InitStatsConnection returned %d\n",result)); + DEBUG_LOG(("InitStatsConnection returned %d",result)); return isProfileAuthorized; } @@ -386,7 +386,7 @@ static Bool gameSpyInitPersistentStorageConnection( void ) msleep(10); } - DEBUG_LOG(("Persistent Storage connect: %d\n", isProfileAuthorized)); + DEBUG_LOG(("Persistent Storage connect: %d", isProfileAuthorized)); return isProfileAuthorized; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/IPEnumeration.cpp b/Generals/Code/GameEngine/Source/GameNetwork/IPEnumeration.cpp index 72c556e5f1..f2f0acf800 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/IPEnumeration.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/IPEnumeration.cpp @@ -77,23 +77,23 @@ EnumeratedIP * IPEnumeration::getAddresses( void ) char hostname[256]; if (gethostname(hostname, sizeof(hostname))) { - DEBUG_LOG(("Failed call to gethostname; WSAGetLastError returned %d\n", WSAGetLastError())); + DEBUG_LOG(("Failed call to gethostname; WSAGetLastError returned %d", WSAGetLastError())); return NULL; } - DEBUG_LOG(("Hostname is '%s'\n", hostname)); + DEBUG_LOG(("Hostname is '%s'", hostname)); // get host information from the host name HOSTENT* hostEnt = gethostbyname(hostname); if (hostEnt == NULL) { - DEBUG_LOG(("Failed call to gethostbyname; WSAGetLastError returned %d\n", WSAGetLastError())); + DEBUG_LOG(("Failed call to gethostbyname; WSAGetLastError returned %d", WSAGetLastError())); return NULL; } // sanity-check the length of the IP adress if (hostEnt->h_length != 4) { - DEBUG_LOG(("gethostbyname returns oddly-sized IP addresses!\n")); + DEBUG_LOG(("gethostbyname returns oddly-sized IP addresses!")); return NULL; } @@ -135,7 +135,7 @@ void IPEnumeration::addNewIP( UnsignedByte a, UnsignedByte b, UnsignedByte c, Un newIP->setIPstring(str); newIP->setIP(ip); - DEBUG_LOG(("IP: 0x%8.8X (%s)\n", ip, str.str())); + DEBUG_LOG(("IP: 0x%8.8X (%s)", ip, str.str())); // Add the IP to the list in ascending order if (!m_IPlist) @@ -186,7 +186,7 @@ AsciiString IPEnumeration::getMachineName( void ) char hostname[256]; if (gethostname(hostname, sizeof(hostname))) { - DEBUG_LOG(("Failed call to gethostname; WSAGetLastError returned %d\n", WSAGetLastError())); + DEBUG_LOG(("Failed call to gethostname; WSAGetLastError returned %d", WSAGetLastError())); return NULL; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/LANAPI.cpp b/Generals/Code/GameEngine/Source/GameNetwork/LANAPI.cpp index 1d6214326f..5abf73c50d 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/LANAPI.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/LANAPI.cpp @@ -67,7 +67,7 @@ LANGame::LANGame( void ) LANAPI::LANAPI( void ) : m_transport(NULL) { - DEBUG_LOG(("LANAPI::LANAPI() - max game option size is %d, sizeof(LANMessage)=%d, MAX_PACKET_SIZE=%d\n", + DEBUG_LOG(("LANAPI::LANAPI() - max game option size is %d, sizeof(LANMessage)=%d, MAX_PACKET_SIZE=%d", m_lanMaxOptionsLength, sizeof(LANMessage), MAX_PACKET_SIZE)); m_lastResendTime = 0; @@ -348,49 +348,49 @@ void LANAPI::update( void ) } LANMessage *msg = (LANMessage *)(m_transport->m_inBuffer[i].data); - //DEBUG_LOG(("LAN message type %s from %ls (%s@%s)\n", GetMessageTypeString(msg->LANMessageType).str(), + //DEBUG_LOG(("LAN message type %s from %ls (%s@%s)", GetMessageTypeString(msg->LANMessageType).str(), // msg->name, msg->userName, msg->hostName)); switch (msg->LANMessageType) { // Location specification case LANMessage::MSG_REQUEST_LOCATIONS: // Hey, where is everybody? - DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_LOCATIONS from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_LOCATIONS from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleRequestLocations( msg, senderIP ); break; case LANMessage::MSG_GAME_ANNOUNCE: // Here someone is, and here's his game info! - DEBUG_LOG(("LANAPI::update - got a MSG_GAME_ANNOUNCE from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_GAME_ANNOUNCE from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleGameAnnounce( msg, senderIP ); break; case LANMessage::MSG_LOBBY_ANNOUNCE: // Hey, I'm in the lobby! - DEBUG_LOG(("LANAPI::update - got a MSG_LOBBY_ANNOUNCE from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_LOBBY_ANNOUNCE from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleLobbyAnnounce( msg, senderIP ); break; case LANMessage::MSG_REQUEST_GAME_INFO: - DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_GAME_INFO from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_GAME_INFO from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleRequestGameInfo( msg, senderIP ); break; // Joining games case LANMessage::MSG_REQUEST_JOIN: // Let me in! Let me in! - DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_JOIN from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_JOIN from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleRequestJoin( msg, senderIP ); break; case LANMessage::MSG_JOIN_ACCEPT: // Okay, you can join. - DEBUG_LOG(("LANAPI::update - got a MSG_JOIN_ACCEPT from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_JOIN_ACCEPT from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleJoinAccept( msg, senderIP ); break; case LANMessage::MSG_JOIN_DENY: // Go away! We don't want any! - DEBUG_LOG(("LANAPI::update - got a MSG_JOIN_DENY from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_JOIN_DENY from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleJoinDeny( msg, senderIP ); break; // Leaving games, lobby case LANMessage::MSG_REQUEST_GAME_LEAVE: // I'm outa here! - DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_GAME_LEAVE from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_GAME_LEAVE from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleRequestGameLeave( msg, senderIP ); break; case LANMessage::MSG_REQUEST_LOBBY_LEAVE: // I'm outa here! - DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_LOBBY_LEAVE from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_LOBBY_LEAVE from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleRequestLobbyLeave( msg, senderIP ); break; @@ -411,7 +411,7 @@ void LANAPI::update( void ) handleGameStartTimer( msg, senderIP ); break; case LANMessage::MSG_GAME_OPTIONS: // Here's some info about the game. - DEBUG_LOG(("LANAPI::update - got a MSG_GAME_OPTIONS from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_GAME_OPTIONS from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleGameOptions( msg, senderIP ); break; case LANMessage::MSG_INACTIVE: // someone is telling us that we're inactive. @@ -419,7 +419,7 @@ void LANAPI::update( void ) break; default: - DEBUG_LOG(("Unknown LAN message type %d\n", msg->LANMessageType)); + DEBUG_LOG(("Unknown LAN message type %d", msg->LANMessageType)); } // Mark it as read @@ -586,7 +586,7 @@ void LANAPI::update( void ) } else if (m_gameStartTime && m_gameStartTime <= now) { -// DEBUG_LOG(("m_gameStartTime=%d, now=%d, m_gameStartSeconds=%d\n", m_gameStartTime, now, m_gameStartSeconds)); +// DEBUG_LOG(("m_gameStartTime=%d, now=%d, m_gameStartSeconds=%d", m_gameStartTime, now, m_gameStartSeconds)); ResetGameStartTimer(); RequestGameStart(); } @@ -897,7 +897,7 @@ void LANAPI::RequestGameCreate( UnicodeString gameName, Bool isDirectConnect ) while (s.getLength() > g_lanGameNameLength) s.removeLastChar(); - DEBUG_LOG(("Setting local game name to '%ls'\n", s.str())); + DEBUG_LOG(("Setting local game name to '%ls'", s.str())); myGame->setName(s); @@ -1276,16 +1276,16 @@ Bool LANAPI::AmIHost( void ) } void LANAPI::setIsActive(Bool isActive) { - DEBUG_LOG(("LANAPI::setIsActive - entering\n")); + DEBUG_LOG(("LANAPI::setIsActive - entering")); if (isActive != m_isActive) { - DEBUG_LOG(("LANAPI::setIsActive - m_isActive changed to %s\n", isActive ? "TRUE" : "FALSE")); + DEBUG_LOG(("LANAPI::setIsActive - m_isActive changed to %s", isActive ? "TRUE" : "FALSE")); if (isActive == FALSE) { if ((m_inLobby == FALSE) && (m_currentGame != NULL)) { LANMessage msg; fillInLANMessage( &msg ); msg.LANMessageType = LANMessage::MSG_INACTIVE; sendMessage(&msg); - DEBUG_LOG(("LANAPI::setIsActive - sent an IsActive message\n")); + DEBUG_LOG(("LANAPI::setIsActive - sent an IsActive message")); } } } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp b/Generals/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp index 934a7c595b..c8ea381f19 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp @@ -184,8 +184,8 @@ void LANAPI::OnGameStartTimer( Int seconds ) void LANAPI::OnGameStart( void ) { - //DEBUG_LOG(("Map is '%s', preview is '%s'\n", m_currentGame->getMap().str(), GetPreviewFromMap(m_currentGame->getMap()).str())); - //DEBUG_LOG(("Map is '%s', INI is '%s'\n", m_currentGame->getMap().str(), GetINIFromMap(m_currentGame->getMap()).str())); + //DEBUG_LOG(("Map is '%s', preview is '%s'", m_currentGame->getMap().str(), GetPreviewFromMap(m_currentGame->getMap()).str())); + //DEBUG_LOG(("Map is '%s', INI is '%s'", m_currentGame->getMap().str(), GetINIFromMap(m_currentGame->getMap()).str())); if (m_currentGame) { @@ -228,7 +228,7 @@ void LANAPI::OnGameStart( void ) TheMapCache->updateCache(); if (!filesOk || TheMapCache->findMap(m_currentGame->getMap()) == NULL) { - DEBUG_LOG(("After transfer, we didn't really have the map. Bailing...\n")); + DEBUG_LOG(("After transfer, we didn't really have the map. Bailing...")); OnPlayerLeave(m_name); removeGame(m_currentGame); m_currentGame = NULL; @@ -256,7 +256,7 @@ void LANAPI::OnGameStart( void ) // Set the random seed InitGameLogicRandom( m_currentGame->getSeed() ); - DEBUG_LOG(("InitGameLogicRandom( %d )\n", m_currentGame->getSeed())); + DEBUG_LOG(("InitGameLogicRandom( %d )", m_currentGame->getSeed())); } } @@ -305,7 +305,7 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op AsciiString key; AsciiString munkee = options; munkee.nextToken(&key, "="); - //DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d\n", key.str(), munkee.str(), playerSlot)); + //DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d", key.str(), munkee.str(), playerSlot)); LANGameSlot *slot = m_currentGame->getLANSlot(playerSlot); if (!slot) @@ -338,7 +338,7 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op AsciiString key; options.nextToken(&key, "="); Int val = atoi(options.str()+1); - DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d\n", key.str(), options.str(), playerSlot)); + DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d", key.str(), options.str(), playerSlot)); LANGameSlot *slot = m_currentGame->getLANSlot(playerSlot); if (!slot) @@ -367,7 +367,7 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op } else { - DEBUG_LOG(("Rejecting invalid color %d\n", val)); + DEBUG_LOG(("Rejecting invalid color %d", val)); } } else if (key == "PlayerTemplate") @@ -386,7 +386,7 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op } else { - DEBUG_LOG(("Rejecting invalid PlayerTemplate %d\n", val)); + DEBUG_LOG(("Rejecting invalid PlayerTemplate %d", val)); } } else if (key == "StartPos" && slot->getPlayerTemplate() != PLAYERTEMPLATE_OBSERVER) @@ -412,7 +412,7 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op } else { - DEBUG_LOG(("Rejecting invalid startPos %d\n", val)); + DEBUG_LOG(("Rejecting invalid startPos %d", val)); } } else if (key == "Team") @@ -425,7 +425,7 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op } else { - DEBUG_LOG(("Rejecting invalid team %d\n", val)); + DEBUG_LOG(("Rejecting invalid team %d", val)); } } else if (key == "NAT") @@ -434,12 +434,12 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op (val <= FirewallHelperClass::FIREWALL_TYPE_DESTINATION_PORT_DELTA)) { slot->setNATBehavior((FirewallHelperClass::FirewallBehaviorType)val); - DEBUG_LOG(("NAT behavior set to %d for player %d\n", val, playerSlot)); + DEBUG_LOG(("NAT behavior set to %d for player %d", val, playerSlot)); change = true; } else { - DEBUG_LOG(("Rejecting invalid NAT behavior %d\n", (Int)val)); + DEBUG_LOG(("Rejecting invalid NAT behavior %d", (Int)val)); } } @@ -449,9 +449,9 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op m_currentGame->resetAccepted(); RequestGameOptions(GenerateGameOptionsString(), true); lanUpdateSlotList(); - DEBUG_LOG(("Slot value is color=%d, PlayerTemplate=%d, startPos=%d, team=%d\n", + DEBUG_LOG(("Slot value is color=%d, PlayerTemplate=%d, startPos=%d, team=%d", slot->getColor(), slot->getPlayerTemplate(), slot->getStartPos(), slot->getTeamNumber())); - DEBUG_LOG(("Slot list updated to %s\n", GenerateGameOptionsString().str())); + DEBUG_LOG(("Slot list updated to %s", GenerateGameOptionsString().str())); } } } @@ -536,7 +536,7 @@ void LANAPI::OnHostLeave( void ) if (m_inLobby || !m_currentGame) return; LANbuttonPushed = true; - DEBUG_LOG(("Host left - popping to lobby\n")); + DEBUG_LOG(("Host left - popping to lobby")); TheShell->pop(); } @@ -563,7 +563,7 @@ void LANAPI::OnPlayerLeave( UnicodeString player ) pref.write(); } LANbuttonPushed = true; - DEBUG_LOG(("OnPlayerLeave says we're leaving! pop away!\n")); + DEBUG_LOG(("OnPlayerLeave says we're leaving! pop away!")); TheShell->pop(); } else diff --git a/Generals/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp b/Generals/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp index b9a978fcbc..bbdaee94f2 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp @@ -224,7 +224,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) reply.GameNotJoined.reason = LANAPIInterface::RET_GAME_STARTED; reply.GameNotJoined.gameIP = m_localIP; reply.GameNotJoined.playerIP = senderIP; - DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because game already started.\n")); + DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because game already started.")); } else { @@ -238,7 +238,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) if (msg->GameToJoin.iniCRC != TheGlobalData->m_iniCRC || msg->GameToJoin.exeCRC != TheGlobalData->m_exeCRC) { - DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because of CRC mismatch. CRCs are them/us INI:%X/%X exe:%X/%X\n", + DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because of CRC mismatch. CRCs are them/us INI:%X/%X exe:%X/%X", msg->GameToJoin.iniCRC, TheGlobalData->m_iniCRC, msg->GameToJoin.exeCRC, TheGlobalData->m_exeCRC)); reply.LANMessageType = LANMessage::MSG_JOIN_DENY; @@ -272,7 +272,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) if (s.isNotEmpty()) { - DEBUG_LOG(("Checking serial '%s' in slot %d\n", s.str(), player)); + DEBUG_LOG(("Checking serial '%s' in slot %d", s.str(), player)); if (!strncmp(s.str(), msg->GameToJoin.serial, g_maxSerialLength)) { @@ -283,7 +283,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) reply.GameNotJoined.playerIP = senderIP; canJoin = false; - DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because of duplicate serial # (%s).\n", s.str())); + DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because of duplicate serial # (%s).", s.str())); break; } } @@ -303,7 +303,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) reply.GameNotJoined.playerIP = senderIP; canJoin = false; - DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because of duplicate names.\n")); + DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because of duplicate names.")); break; } } @@ -348,7 +348,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) newSlot.setLastHeard(timeGetTime()); newSlot.setSerial(msg->GameToJoin.serial); m_currentGame->setSlot(player,newSlot); - DEBUG_LOG(("LANAPI::handleRequestJoin - added player %ls at ip 0x%08x to the game\n", msg->name, senderIP)); + DEBUG_LOG(("LANAPI::handleRequestJoin - added player %ls at ip 0x%08x to the game", msg->name, senderIP)); OnPlayerJoin(player, UnicodeString(msg->name)); responseIP = 0; @@ -365,7 +365,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) reply.GameNotJoined.reason = LANAPIInterface::RET_GAME_FULL; reply.GameNotJoined.gameIP = m_localIP; reply.GameNotJoined.playerIP = senderIP; - DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because game is full.\n")); + DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because game is full.")); } } } @@ -589,10 +589,10 @@ void LANAPI::handleChat( LANMessage *msg, UnsignedInt senderIP ) { if (LookupGame(UnicodeString(msg->Chat.gameName)) != m_currentGame) { - DEBUG_LOG(("Game '%ls' is not my game\n", msg->Chat.gameName)); + DEBUG_LOG(("Game '%ls' is not my game", msg->Chat.gameName)); if (m_currentGame) { - DEBUG_LOG(("Current game is '%ls'\n", m_currentGame->getName().str())); + DEBUG_LOG(("Current game is '%ls'", m_currentGame->getName().str())); } return; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp b/Generals/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp index 1ad02416bc..553353c81c 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp @@ -270,7 +270,7 @@ Bool ParseGameOptionsString(LANGameInfo *game, AsciiString options) LANGameSlot *slot = game->getLANSlot(i); if (slot && slot->isHuman()) { - //DEBUG_LOG(("Saving off %ls@%ls for %ls\n", slot->getUser()->getLogin().str(), slot->getUser()->getHost().str(), slot->getName().str())); + //DEBUG_LOG(("Saving off %ls@%ls for %ls", slot->getUser()->getLogin().str(), slot->getUser()->getHost().str(), slot->getName().str())); oldLogins[slot->getName()] = slot->getUser()->getLogin(); oldMachines[slot->getName()] = slot->getUser()->getHost(); } @@ -284,7 +284,7 @@ Bool ParseGameOptionsString(LANGameInfo *game, AsciiString options) { // Int hasMap = game->getSlot(newLocalSlotNum)->hasMap(); newMapCRC = game->getMapCRC(); - //DEBUG_LOG(("wasInGame:%d isInGame:%d hadMap:%d hasMap:%d oldMap:%s newMap:%s\n", wasInGame, isInGame, hadMap, hasMap, oldMap.str(), game->getMap().str())); + //DEBUG_LOG(("wasInGame:%d isInGame:%d hadMap:%d hasMap:%d oldMap:%s newMap:%s", wasInGame, isInGame, hadMap, hasMap, oldMap.str(), game->getMap().str())); if ( (oldMapCRC ^ newMapCRC)/*(hasMap ^ hadMap)*/ || (!wasInGame && isInGame) ) { // it changed. send it @@ -308,7 +308,7 @@ Bool ParseGameOptionsString(LANGameInfo *game, AsciiString options) mapIt = oldMachines.find(slot->getName()); if (mapIt != oldMachines.end()) slot->setHost(mapIt->second); - //DEBUG_LOG(("Restored %ls@%ls for %ls\n", slot->getUser()->getLogin().str(), slot->getUser()->getHost().str(), slot->getName().str())); + //DEBUG_LOG(("Restored %ls@%ls for %ls", slot->getUser()->getLogin().str(), slot->getUser()->getHost().str(), slot->getName().str())); } } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/NAT.cpp b/Generals/Code/GameEngine/Source/GameNetwork/NAT.cpp index feb93ccc69..9eeb3674ef 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/NAT.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/NAT.cpp @@ -198,7 +198,7 @@ NATStateType NAT::update() { if (stats.id == 0) { gotAllStats = FALSE; - //DEBUG_LOG(("Failed to find stats for %ls(%d)\n", slot->getName().str(), slot->getProfileID())); + //DEBUG_LOG(("Failed to find stats for %ls(%d)", slot->getName().str(), slot->getProfileID())); } } } @@ -207,7 +207,7 @@ NATStateType NAT::update() { UnsignedInt now = timeGetTime(); if (now > s_startStatWaitTime + MS_TO_WAIT_FOR_STATS) { - DEBUG_LOG(("Timed out waiting for stats. Let's just start the dang game.\n")); + DEBUG_LOG(("Timed out waiting for stats. Let's just start the dang game.")); timedOut = TRUE; } if (gotAllStats || timedOut) @@ -225,7 +225,7 @@ NATStateType NAT::update() { ++m_connectionRound; // m_roundTimeout = timeGetTime() + TheGameSpyConfig->getRoundTimeout(); m_roundTimeout = timeGetTime() + m_timeForRoundTimeout; - DEBUG_LOG(("NAT::update - done with connection round, moving on to round %d\n", m_connectionRound)); + DEBUG_LOG(("NAT::update - done with connection round, moving on to round %d", m_connectionRound)); // we finished that round, now check to see if we're done, or if there are more rounds to go. if (allConnectionsDone() == TRUE) { @@ -237,7 +237,7 @@ NATStateType NAT::update() { TheFirewallHelper->flagNeedToRefresh(FALSE); s_startStatWaitTime = timeGetTime(); - DEBUG_LOG(("NAT::update - done with all connections, woohoo!!\n")); + DEBUG_LOG(("NAT::update - done with all connections, woohoo!!")); /* m_NATState = NATSTATE_DONE; TheEstablishConnectionsMenu->endMenu(); @@ -253,7 +253,7 @@ NATStateType NAT::update() { NATConnectionState state = connectionUpdate(); if (timeGetTime() > m_roundTimeout) { - DEBUG_LOG(("NAT::update - round timeout expired\n")); + DEBUG_LOG(("NAT::update - round timeout expired")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); notifyUsersOfConnectionFailed(m_localNodeNumber); } @@ -320,7 +320,7 @@ NATConnectionState NAT::connectionUpdate() { DEBUG_ASSERTCRASH(slot != NULL, ("Trying to send keepalive to a NULL slot")); if (slot != NULL) { UnsignedInt ip = slot->getIP(); - DEBUG_LOG(("NAT::connectionUpdate - sending keep alive to node %d at %d.%d.%d.%d:%d\n", node, + DEBUG_LOG(("NAT::connectionUpdate - sending keep alive to node %d at %d.%d.%d.%d:%d", node, PRINTF_IP_AS_4_INTS(ip), slot->getPort())); m_transport->queueSend(ip, slot->getPort(), (const unsigned char *)"KEEPALIVE", strlen("KEEPALIVE") + 1); } @@ -338,15 +338,15 @@ NATConnectionState NAT::connectionUpdate() { #ifdef DEBUG_LOGGING UnsignedInt ip = m_transport->m_inBuffer[i].addr; #endif - DEBUG_LOG(("NAT::connectionUpdate - got a packet from %d.%d.%d.%d:%d, length = %d\n", + DEBUG_LOG(("NAT::connectionUpdate - got a packet from %d.%d.%d.%d:%d, length = %d", PRINTF_IP_AS_4_INTS(ip), m_transport->m_inBuffer[i].port, m_transport->m_inBuffer[i].length)); UnsignedByte *data = m_transport->m_inBuffer[i].data; if (memcmp(data, "PROBE", strlen("PROBE")) == 0) { Int fromNode = atoi((char *)data + strlen("PROBE")); - DEBUG_LOG(("NAT::connectionUpdate - we've been probed by node %d.\n", fromNode)); + DEBUG_LOG(("NAT::connectionUpdate - we've been probed by node %d.", fromNode)); if (fromNode == m_targetNodeNumber) { - DEBUG_LOG(("NAT::connectionUpdate - probe was sent by our target, setting connection state %d to done.\n", m_targetNodeNumber)); + DEBUG_LOG(("NAT::connectionUpdate - probe was sent by our target, setting connection state %d to done.", m_targetNodeNumber)); setConnectionState(m_targetNodeNumber, NATCONNECTIONSTATE_DONE); if (m_transport->m_inBuffer[i].addr != targetSlot->getIP()) { @@ -354,13 +354,13 @@ NATConnectionState NAT::connectionUpdate() { #ifdef DEBUG_LOGGING UnsignedInt slotIP = targetSlot->getIP(); #endif - DEBUG_LOG(("NAT::connectionUpdate - incomming packet has different from address than we expected, incoming: %d.%d.%d.%d expected: %d.%d.%d.%d\n", + DEBUG_LOG(("NAT::connectionUpdate - incomming packet has different from address than we expected, incoming: %d.%d.%d.%d expected: %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(fromIP), PRINTF_IP_AS_4_INTS(slotIP))); targetSlot->setIP(fromIP); } if (m_transport->m_inBuffer[i].port != targetSlot->getPort()) { - DEBUG_LOG(("NAT::connectionUpdate - incoming packet came from a different port than we expected, incoming: %d expected: %d\n", + DEBUG_LOG(("NAT::connectionUpdate - incoming packet came from a different port than we expected, incoming: %d expected: %d", m_transport->m_inBuffer[i].port, targetSlot->getPort())); targetSlot->setPort(m_transport->m_inBuffer[i].port); m_sourcePorts[m_targetNodeNumber] = m_transport->m_inBuffer[i].port; @@ -372,7 +372,7 @@ NATConnectionState NAT::connectionUpdate() { } if (memcmp(data, "KEEPALIVE", strlen("KEEPALIVE")) == 0) { // keep alive packet, just toss it. - DEBUG_LOG(("NAT::connectionUpdate - got keepalive from %d.%d.%d.%d:%d\n", + DEBUG_LOG(("NAT::connectionUpdate - got keepalive from %d.%d.%d.%d:%d", PRINTF_IP_AS_4_INTS(ip), m_transport->m_inBuffer[i].port)); m_transport->m_inBuffer[i].length = 0; } @@ -384,12 +384,12 @@ NATConnectionState NAT::connectionUpdate() { // check to see if it's time to probe our target. if ((m_timeTillNextSend != -1) && (m_timeTillNextSend <= timeGetTime())) { if (m_numRetries > m_maxNumRetriesAllowed) { - DEBUG_LOG(("NAT::connectionUpdate - too many retries, connection failed.\n")); + DEBUG_LOG(("NAT::connectionUpdate - too many retries, connection failed.")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); notifyUsersOfConnectionFailed(m_localNodeNumber); } else { - DEBUG_LOG(("NAT::connectionUpdate - trying to send another probe (#%d) to our target\n", m_numRetries+1)); + DEBUG_LOG(("NAT::connectionUpdate - trying to send another probe (#%d) to our target", m_numRetries+1)); // Send a probe. sendAProbe(targetSlot->getIP(), targetSlot->getPort(), m_localNodeNumber); // m_timeTillNextSend = timeGetTime() + TheGameSpyConfig->getRetryInterval(); @@ -423,13 +423,13 @@ NATConnectionState NAT::connectionUpdate() { if (m_manglerRetries > m_maxAllowedManglerRetries) { // we couldn't communicate with the mangler, just use our non-mangled // port number and hope that works. - DEBUG_LOG(("NAT::connectionUpdate - couldn't talk with the mangler using default port number\n")); + DEBUG_LOG(("NAT::connectionUpdate - couldn't talk with the mangler using default port number")); sendMangledPortNumberToTarget(getSlotPort(m_connectionNodes[m_localNodeNumber].m_slotIndex), targetSlot); m_sourcePorts[m_targetNodeNumber] = getSlotPort(m_connectionNodes[m_localNodeNumber].m_slotIndex); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORRESPONSE); } else { if (TheFirewallHelper != NULL) { - DEBUG_LOG(("NAT::connectionUpdate - trying to send to the mangler again. mangler address: %d.%d.%d.%d, from port: %d, packet ID:%d\n", + DEBUG_LOG(("NAT::connectionUpdate - trying to send to the mangler again. mangler address: %d.%d.%d.%d, from port: %d, packet ID:%d", PRINTF_IP_AS_4_INTS(m_manglerAddress), m_spareSocketPort, m_packetID)); TheFirewallHelper->sendToManglerFromPort(m_manglerAddress, m_spareSocketPort, m_packetID); } @@ -442,7 +442,7 @@ NATConnectionState NAT::connectionUpdate() { if (m_connectionStates[m_localNodeNumber] == NATCONNECTIONSTATE_WAITINGFORMANGLEDPORT) { if (timeGetTime() > m_timeoutTime) { - DEBUG_LOG(("NAT::connectionUpdate - waiting too long to get the other player's port number, failed.\n")); + DEBUG_LOG(("NAT::connectionUpdate - waiting too long to get the other player's port number, failed.")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); notifyUsersOfConnectionFailed(m_localNodeNumber); @@ -456,9 +456,9 @@ NATConnectionState NAT::connectionUpdate() { // after calling this, you should call the update function untill it returns // NATSTATE_DONE. void NAT::establishConnectionPaths() { - DEBUG_LOG(("NAT::establishConnectionPaths - entering\n")); + DEBUG_LOG(("NAT::establishConnectionPaths - entering")); m_NATState = NATSTATE_DOCONNECTIONPATHS; - DEBUG_LOG(("NAT::establishConnectionPaths - using %d as our starting port number\n", m_startingPortNumber)); + DEBUG_LOG(("NAT::establishConnectionPaths - using %d as our starting port number", m_startingPortNumber)); if (TheEstablishConnectionsMenu == NULL) { TheEstablishConnectionsMenu = NEW EstablishConnectionsMenu; } @@ -479,12 +479,12 @@ void NAT::establishConnectionPaths() { for (; i < MAX_SLOTS; ++i) { if (m_slotList[i] != NULL) { if (m_slotList[i]->isHuman()) { - DEBUG_LOG(("NAT::establishConnectionPaths - slot %d is %ls\n", i, m_slotList[i]->getName().str())); + DEBUG_LOG(("NAT::establishConnectionPaths - slot %d is %ls", i, m_slotList[i]->getName().str())); ++m_numNodes; } } } - DEBUG_LOG(("NAT::establishConnectionPaths - number of nodes: %d\n", m_numNodes)); + DEBUG_LOG(("NAT::establishConnectionPaths - number of nodes: %d", m_numNodes)); if (m_numNodes < 2) { @@ -513,8 +513,8 @@ void NAT::establishConnectionPaths() { // the NAT table from being reset for connections to other nodes. This also happens // to be the reason why I call them "nodes" rather than "slots" or "players" as the // ordering has to be messed with to get the netgears to make love, not war. - DEBUG_LOG(("NAT::establishConnectionPaths - about to set up the node list\n")); - DEBUG_LOG(("NAT::establishConnectionPaths - doing the netgear stuff\n")); + DEBUG_LOG(("NAT::establishConnectionPaths - about to set up the node list")); + DEBUG_LOG(("NAT::establishConnectionPaths - doing the netgear stuff")); UnsignedInt otherNetgearNum = -1; for (i = 0; i < MAX_SLOTS; ++i) { if ((m_slotList != NULL) && (m_slotList[i] != NULL)) { @@ -529,7 +529,7 @@ void NAT::establishConnectionPaths() { m_connectionNodes[nodeindex].m_behavior = m_slotList[i]->getNATBehavior(); connectionAssigned[i] = TRUE; otherNetgearNum = nodeindex; - DEBUG_LOG(("NAT::establishConnectionPaths - first netgear in pair. assigning node %d to slot %d (%ls)\n", nodeindex, i, m_slotList[i]->getName().str())); + DEBUG_LOG(("NAT::establishConnectionPaths - first netgear in pair. assigning node %d to slot %d (%ls)", nodeindex, i, m_slotList[i]->getName().str())); } else { // this is the second in the pair of netgears, pair this up with the other one // for the first round. @@ -541,14 +541,14 @@ void NAT::establishConnectionPaths() { m_connectionNodes[nodeindex].m_behavior = m_slotList[i]->getNATBehavior(); connectionAssigned[i] = TRUE; otherNetgearNum = -1; - DEBUG_LOG(("NAT::establishConnectionPaths - second netgear in pair. assigning node %d to slot %d (%ls)\n", nodeindex, i, m_slotList[i]->getName().str())); + DEBUG_LOG(("NAT::establishConnectionPaths - second netgear in pair. assigning node %d to slot %d (%ls)", nodeindex, i, m_slotList[i]->getName().str())); } } } } // fill in the rest of the nodes with the remaining slots. - DEBUG_LOG(("NAT::establishConnectionPaths - doing the non-Netgear nodes\n")); + DEBUG_LOG(("NAT::establishConnectionPaths - doing the non-Netgear nodes")); for (i = 0; i < MAX_SLOTS; ++i) { if (connectionAssigned[i] == TRUE) { continue; @@ -564,7 +564,7 @@ void NAT::establishConnectionPaths() { while (m_connectionNodes[nodeindex].m_slotIndex != -1) { ++nodeindex; } - DEBUG_LOG(("NAT::establishConnectionPaths - assigning node %d to slot %d (%ls)\n", nodeindex, i, m_slotList[i]->getName().str())); + DEBUG_LOG(("NAT::establishConnectionPaths - assigning node %d to slot %d (%ls)", nodeindex, i, m_slotList[i]->getName().str())); m_connectionNodes[nodeindex].m_slotIndex = i; m_connectionNodes[nodeindex].m_behavior = m_slotList[i]->getNATBehavior(); connectionAssigned[i] = TRUE; @@ -581,7 +581,7 @@ void NAT::establishConnectionPaths() { for (i = 0; i < m_numNodes; ++i) { if (m_connectionNodes[i].m_slotIndex == TheGameSpyGame->getLocalSlotNum()) { m_localNodeNumber = i; - DEBUG_LOG(("NAT::establishConnectionPaths - local node is %d\n", m_localNodeNumber)); + DEBUG_LOG(("NAT::establishConnectionPaths - local node is %d", m_localNodeNumber)); break; } } @@ -614,11 +614,11 @@ void NAT::attachSlotList(GameSlot *slotList[], Int localSlot, UnsignedInt localI m_slotList = slotList; m_localIP = localIP; m_transport = new Transport; - DEBUG_LOG(("NAT::attachSlotList - initting the transport socket with address %d.%d.%d.%d:%d\n", + DEBUG_LOG(("NAT::attachSlotList - initting the transport socket with address %d.%d.%d.%d:%d", PRINTF_IP_AS_4_INTS(m_localIP), getSlotPort(localSlot))); m_startingPortNumber = NETWORK_BASE_PORT_NUMBER + ((timeGetTime() / 1000) % 20000); - DEBUG_LOG(("NAT::attachSlotList - using %d as the starting port number\n", m_startingPortNumber)); + DEBUG_LOG(("NAT::attachSlotList - using %d as the starting port number", m_startingPortNumber)); generatePortNumbers(slotList, localSlot); m_transport->init(m_localIP, getSlotPort(localSlot)); } @@ -651,7 +651,7 @@ Transport * NAT::getTransport() { // send the port number to our target for this round. // init the m_connectionStates for all players. void NAT::doThisConnectionRound() { - DEBUG_LOG(("NAT::doThisConnectionRound - starting process for connection round %d\n", m_connectionRound)); + DEBUG_LOG(("NAT::doThisConnectionRound - starting process for connection round %d", m_connectionRound)); // clear out the states from the last round. m_targetNodeNumber = -1; @@ -665,26 +665,26 @@ void NAT::doThisConnectionRound() { for (i = 0; i < m_numNodes; ++i) { Int targetNodeNumber = m_connectionPairs[m_connectionPairIndex][m_connectionRound][i]; - DEBUG_LOG(("NAT::doThisConnectionRound - node %d needs to connect to node %d\n", i, targetNodeNumber)); + DEBUG_LOG(("NAT::doThisConnectionRound - node %d needs to connect to node %d", i, targetNodeNumber)); if (targetNodeNumber != -1) { if (i == m_localNodeNumber) { m_targetNodeNumber = targetNodeNumber; - DEBUG_LOG(("NAT::doThisConnectionRound - Local node is connecting to node %d\n", m_targetNodeNumber)); + DEBUG_LOG(("NAT::doThisConnectionRound - Local node is connecting to node %d", m_targetNodeNumber)); UnsignedInt targetSlotIndex = m_connectionNodes[(m_connectionPairs[m_connectionPairIndex][m_connectionRound][i])].m_slotIndex; GameSlot *targetSlot = m_slotList[targetSlotIndex]; GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(localSlot != NULL, ("local slot is NULL")); DEBUG_ASSERTCRASH(targetSlot != NULL, ("trying to negotiate with a NULL target slot, slot is %d", m_connectionPairs[m_connectionPairIndex][m_connectionRound][i])); - DEBUG_LOG(("NAT::doThisConnectionRound - Target slot index = %d (%ls)\n", targetSlotIndex, m_slotList[targetSlotIndex]->getName().str())); - DEBUG_LOG(("NAT::doThisConnectionRound - Target slot has NAT behavior 0x%8X, local slot has NAT behavior 0x%8X\n", targetSlot->getNATBehavior(), localSlot->getNATBehavior())); + DEBUG_LOG(("NAT::doThisConnectionRound - Target slot index = %d (%ls)", targetSlotIndex, m_slotList[targetSlotIndex]->getName().str())); + DEBUG_LOG(("NAT::doThisConnectionRound - Target slot has NAT behavior 0x%8X, local slot has NAT behavior 0x%8X", targetSlot->getNATBehavior(), localSlot->getNATBehavior())); #if defined(DEBUG_LOGGING) UnsignedInt targetIP = targetSlot->getIP(); UnsignedInt localIP = localSlot->getIP(); #endif - DEBUG_LOG(("NAT::doThisConnectionRound - Target slot has IP %d.%d.%d.%d Local slot has IP %d.%d.%d.%d\n", + DEBUG_LOG(("NAT::doThisConnectionRound - Target slot has IP %d.%d.%d.%d Local slot has IP %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(targetIP), PRINTF_IP_AS_4_INTS(localIP))); @@ -694,14 +694,14 @@ void NAT::doThisConnectionRound() { // we have a netgear bug type behavior and the target does not, so we need them to send to us // first to avoid having our NAT table reset. - DEBUG_LOG(("NAT::doThisConnectionRound - Local node has a netgear and the target node does not, need to delay our probe.\n")); + DEBUG_LOG(("NAT::doThisConnectionRound - Local node has a netgear and the target node does not, need to delay our probe.")); m_timeTillNextSend = -1; } // figure out which port number I'm using for this connection // this merely starts to talk to the mangler server, we have to keep calling // the update function till we get a response. - DEBUG_LOG(("NAT::doThisConnectionRound - About to attempt to get the next mangled source port\n")); + DEBUG_LOG(("NAT::doThisConnectionRound - About to attempt to get the next mangled source port")); sendMangledSourcePort(); // m_nextPortSendTime = timeGetTime() + TheGameSpyConfig->getRetryInterval(); m_nextPortSendTime = timeGetTime() + m_timeBetweenRetries; @@ -714,14 +714,14 @@ void NAT::doThisConnectionRound() { } } else { // no one to connect to, so this one is done. - DEBUG_LOG(("NAT::doThisConnectionRound - node %d has no one to connect to, so they're done\n", i)); + DEBUG_LOG(("NAT::doThisConnectionRound - node %d has no one to connect to, so they're done", i)); setConnectionState(i, NATCONNECTIONSTATE_DONE); } } } void NAT::sendAProbe(UnsignedInt ip, UnsignedShort port, Int fromNode) { - DEBUG_LOG(("NAT::sendAProbe - sending a probe from port %d to %d.%d.%d.%d:%d\n", getSlotPort(m_connectionNodes[m_localNodeNumber].m_slotIndex), + DEBUG_LOG(("NAT::sendAProbe - sending a probe from port %d to %d.%d.%d.%d:%d", getSlotPort(m_connectionNodes[m_localNodeNumber].m_slotIndex), PRINTF_IP_AS_4_INTS(ip), port)); AsciiString str; str.format("PROBE%d", fromNode); @@ -739,7 +739,7 @@ void NAT::sendMangledSourcePort() { GameSlot *targetSlot = m_slotList[m_connectionNodes[m_targetNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(targetSlot != NULL, ("NAT::sendMangledSourcePort - targetSlot is NULL")); if (targetSlot == NULL) { - DEBUG_LOG(("NAT::sendMangledSourcePort - targetSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::sendMangledSourcePort - targetSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } @@ -747,7 +747,7 @@ void NAT::sendMangledSourcePort() { GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(localSlot != NULL, ("NAT::sendMangledSourcePort - localSlot is NULL, WTF?")); if (localSlot == NULL) { - DEBUG_LOG(("NAT::sendMangledSourcePort - localSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::sendMangledSourcePort - localSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } @@ -758,8 +758,8 @@ void NAT::sendMangledSourcePort() { UnsignedInt localip = localSlot->getIP(); UnsignedInt targetip = targetSlot->getIP(); #endif - DEBUG_LOG(("NAT::sendMangledSourcePort - target and I are behind the same NAT, no mangling\n")); - DEBUG_LOG(("NAT::sendMangledSourcePort - I am %ls, target is %ls, my IP is %d.%d.%d.%d, target IP is %d.%d.%d.%d\n", localSlot->getName().str(), targetSlot->getName().str(), + DEBUG_LOG(("NAT::sendMangledSourcePort - target and I are behind the same NAT, no mangling")); + DEBUG_LOG(("NAT::sendMangledSourcePort - I am %ls, target is %ls, my IP is %d.%d.%d.%d, target IP is %d.%d.%d.%d", localSlot->getName().str(), targetSlot->getName().str(), PRINTF_IP_AS_4_INTS(localip), PRINTF_IP_AS_4_INTS(targetip))); @@ -776,7 +776,7 @@ void NAT::sendMangledSourcePort() { // check to see if we are NAT'd at all. if ((fwType == 0) || (fwType == FirewallHelperClass::FIREWALL_TYPE_SIMPLE)) { // no mangling, just return the source port - DEBUG_LOG(("NAT::sendMangledSourcePort - no mangling, just using the source port\n")); + DEBUG_LOG(("NAT::sendMangledSourcePort - no mangling, just using the source port")); sendMangledPortNumberToTarget(sourcePort, targetSlot); m_previousSourcePort = sourcePort; m_sourcePorts[m_targetNodeNumber] = sourcePort; @@ -789,15 +789,15 @@ void NAT::sendMangledSourcePort() { // then we don't have to figure it out again. if (((fwType & FirewallHelperClass::FIREWALL_TYPE_DESTINATION_PORT_DELTA) == 0) && ((fwType & FirewallHelperClass::FIREWALL_TYPE_SMART_MANGLING) == 0)) { - DEBUG_LOG(("NAT::sendMangledSourcePort - our firewall doesn't NAT based on destination address, checking for old connections from this address\n")); + DEBUG_LOG(("NAT::sendMangledSourcePort - our firewall doesn't NAT based on destination address, checking for old connections from this address")); if (m_previousSourcePort != 0) { - DEBUG_LOG(("NAT::sendMangledSourcePort - Previous source port was %d, using that one\n", m_previousSourcePort)); + DEBUG_LOG(("NAT::sendMangledSourcePort - Previous source port was %d, using that one", m_previousSourcePort)); sendMangledPortNumberToTarget(m_previousSourcePort, targetSlot); m_sourcePorts[m_targetNodeNumber] = m_previousSourcePort; setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORMANGLEDPORT); return; } else { - DEBUG_LOG(("NAT::sendMangledSourcePort - Previous source port not found\n")); + DEBUG_LOG(("NAT::sendMangledSourcePort - Previous source port not found")); } } @@ -808,11 +808,11 @@ void NAT::sendMangledSourcePort() { // get the address of the mangler we need to talk to. Char manglerName[256]; FirewallHelperClass::getManglerName(1, manglerName); - DEBUG_LOG(("NAT::sendMangledSourcePort - about to call gethostbyname for mangler at %s\n", manglerName)); + DEBUG_LOG(("NAT::sendMangledSourcePort - about to call gethostbyname for mangler at %s", manglerName)); struct hostent *hostInfo = gethostbyname(manglerName); if (hostInfo == NULL) { - DEBUG_LOG(("NAT::sendMangledSourcePort - gethostbyname failed for mangler address %s\n", manglerName)); + DEBUG_LOG(("NAT::sendMangledSourcePort - gethostbyname failed for mangler address %s", manglerName)); // can't find the mangler, we're screwed so just send the source port. sendMangledPortNumberToTarget(sourcePort, targetSlot); m_sourcePorts[m_targetNodeNumber] = sourcePort; @@ -822,10 +822,10 @@ void NAT::sendMangledSourcePort() { memcpy(&m_manglerAddress, &(hostInfo->h_addr_list[0][0]), 4); m_manglerAddress = ntohl(m_manglerAddress); - DEBUG_LOG(("NAT::sendMangledSourcePort - mangler %s address is %d.%d.%d.%d\n", manglerName, + DEBUG_LOG(("NAT::sendMangledSourcePort - mangler %s address is %d.%d.%d.%d", manglerName, PRINTF_IP_AS_4_INTS(m_manglerAddress))); - DEBUG_LOG(("NAT::sendMangledSourcePort - NAT behavior = 0x%08x\n", fwType)); + DEBUG_LOG(("NAT::sendMangledSourcePort - NAT behavior = 0x%08x", fwType)); // m_manglerRetryTime = TheGameSpyConfig->getRetryInterval() + timeGetTime(); m_manglerRetryTime = m_manglerRetryTimeInterval + timeGetTime(); @@ -843,12 +843,12 @@ void NAT::sendMangledSourcePort() { } void NAT::processManglerResponse(UnsignedShort mangledPort) { - DEBUG_LOG(("NAT::processManglerResponse - Work out what my NAT'd port will be\n")); + DEBUG_LOG(("NAT::processManglerResponse - Work out what my NAT'd port will be")); GameSlot *targetSlot = m_slotList[m_connectionNodes[m_targetNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(targetSlot != NULL, ("NAT::processManglerResponse - targetSlot is NULL")); if (targetSlot == NULL) { - DEBUG_LOG(("NAT::processManglerResponse - targetSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::processManglerResponse - targetSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } @@ -893,7 +893,7 @@ void NAT::processManglerResponse(UnsignedShort mangledPort) { returnPort += 1024; } - DEBUG_LOG(("NAT::processManglerResponse - mangled port is %d\n", returnPort)); + DEBUG_LOG(("NAT::processManglerResponse - mangled port is %d", returnPort)); m_previousSourcePort = returnPort; sendMangledPortNumberToTarget(returnPort, targetSlot); @@ -966,29 +966,29 @@ void NAT::probed(Int nodeNumber) { GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(localSlot != NULL, ("NAT::probed - localSlot is NULL, WTF?")); if (localSlot == NULL) { - DEBUG_LOG(("NAT::probed - localSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::probed - localSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } if (m_beenProbed == FALSE) { m_beenProbed = TRUE; - DEBUG_LOG(("NAT::probed - just got probed for the first time.\n")); + DEBUG_LOG(("NAT::probed - just got probed for the first time.")); if ((localSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) != 0) { - DEBUG_LOG(("NAT::probed - we have a NETGEAR and we were just probed for the first time\n")); + DEBUG_LOG(("NAT::probed - we have a NETGEAR and we were just probed for the first time")); GameSlot *targetSlot = m_slotList[m_connectionNodes[m_targetNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(targetSlot != NULL, ("NAT::probed - targetSlot is NULL")); if (targetSlot == NULL) { - DEBUG_LOG(("NAT::probed - targetSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::probed - targetSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } if (targetSlot->getPort() == 0) { setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORMANGLEDPORT); - DEBUG_LOG(("NAT::probed - still waiting for mangled port\n")); + DEBUG_LOG(("NAT::probed - still waiting for mangled port")); } else { - DEBUG_LOG(("NAT::probed - sending a probe to %ls\n", targetSlot->getName().str())); + DEBUG_LOG(("NAT::probed - sending a probe to %ls", targetSlot->getName().str())); sendAProbe(targetSlot->getIP(), targetSlot->getPort(), m_localNodeNumber); notifyTargetOfProbe(targetSlot); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORRESPONSE); @@ -1002,14 +1002,14 @@ void NAT::gotMangledPort(Int nodeNumber, UnsignedShort mangledPort) { // if we've already finished the connection, then we don't need to process this. if (m_connectionStates[m_localNodeNumber] == NATCONNECTIONSTATE_DONE) { - DEBUG_LOG(("NAT::gotMangledPort - got a mangled port, but we've already finished this connection, ignoring.\n")); + DEBUG_LOG(("NAT::gotMangledPort - got a mangled port, but we've already finished this connection, ignoring.")); return; } GameSlot *targetSlot = m_slotList[m_connectionNodes[m_targetNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(targetSlot != NULL, ("NAT::gotMangledPort - targetSlot is NULL")); if (targetSlot == NULL) { - DEBUG_LOG(("NAT::gotMangledPort - targetSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::gotMangledPort - targetSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } @@ -1017,31 +1017,31 @@ void NAT::gotMangledPort(Int nodeNumber, UnsignedShort mangledPort) { GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(localSlot != NULL, ("NAT::gotMangledPort - localSlot is NULL, WTF?")); if (localSlot == NULL) { - DEBUG_LOG(("NAT::gotMangledPort - localSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::gotMangledPort - localSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } if (nodeNumber != m_targetNodeNumber) { - DEBUG_LOG(("NAT::gotMangledPort - got a mangled port number for someone that isn't my target. node = %d, target node = %d\n", nodeNumber, m_targetNodeNumber)); + DEBUG_LOG(("NAT::gotMangledPort - got a mangled port number for someone that isn't my target. node = %d, target node = %d", nodeNumber, m_targetNodeNumber)); return; } targetSlot->setPort(mangledPort); - DEBUG_LOG(("NAT::gotMangledPort - got mangled port number %d from our target node (%ls)\n", mangledPort, targetSlot->getName().str())); + DEBUG_LOG(("NAT::gotMangledPort - got mangled port number %d from our target node (%ls)", mangledPort, targetSlot->getName().str())); if (((localSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) == 0) || (m_beenProbed == TRUE) || (((localSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) != 0) && ((targetSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) != 0))) { #ifdef DEBUG_LOGGING UnsignedInt ip = targetSlot->getIP(); #endif - DEBUG_LOG(("NAT::gotMangledPort - don't have a netgear or we have already been probed, or both my target and I have a netgear, send a PROBE. Sending to %d.%d.%d.%d:%d\n", + DEBUG_LOG(("NAT::gotMangledPort - don't have a netgear or we have already been probed, or both my target and I have a netgear, send a PROBE. Sending to %d.%d.%d.%d:%d", PRINTF_IP_AS_4_INTS(ip), targetSlot->getPort())); sendAProbe(targetSlot->getIP(), targetSlot->getPort(), m_localNodeNumber); notifyTargetOfProbe(targetSlot); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORRESPONSE); } else { - DEBUG_LOG(("NAT::gotMangledPort - we are a netgear, not sending a PROBE yet.\n")); + DEBUG_LOG(("NAT::gotMangledPort - we are a netgear, not sending a PROBE yet.")); } } @@ -1059,14 +1059,14 @@ void NAT::gotInternalAddress(Int nodeNumber, UnsignedInt address) { } if (nodeNumber != m_targetNodeNumber) { - DEBUG_LOG(("NAT::gotInternalAddress - got a internal address for someone that isn't my target. node = %d, target node = %d\n", nodeNumber, m_targetNodeNumber)); + DEBUG_LOG(("NAT::gotInternalAddress - got a internal address for someone that isn't my target. node = %d, target node = %d", nodeNumber, m_targetNodeNumber)); return; } if (localSlot->getIP() == targetSlot->getIP()) { // we have the same IP address, i.e. we are behind the same NAT. // I need to talk directly to his internal address. - DEBUG_LOG(("NAT::gotInternalAddress - target and local players have same external address, using internal address.\n")); + DEBUG_LOG(("NAT::gotInternalAddress - target and local players have same external address, using internal address.")); targetSlot->setIP(address); // use the slot's internal address from now on } } @@ -1083,14 +1083,14 @@ void NAT::notifyTargetOfProbe(GameSlot *targetSlot) { req.nick = hostName.str(); req.options = options.str(); TheGameSpyPeerMessageQueue->addRequest(req); - DEBUG_LOG(("NAT::notifyTargetOfProbe - notifying %ls that we have probed them.\n", targetSlot->getName().str())); + DEBUG_LOG(("NAT::notifyTargetOfProbe - notifying %ls that we have probed them.", targetSlot->getName().str())); } void NAT::notifyUsersOfConnectionDone(Int nodeIndex) { GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(localSlot != NULL, ("NAT::notifyUsersOfConnectionDone - localSlot is NULL, WTF?")); if (localSlot == NULL) { - DEBUG_LOG(("NAT::notifyUsersOfConnectionDone - localSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::notifyUsersOfConnectionDone - localSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } @@ -1124,7 +1124,7 @@ void NAT::notifyUsersOfConnectionDone(Int nodeIndex) { req.nick = names.str(); req.options = options.str(); - DEBUG_LOG(("NAT::notifyUsersOfConnectionDone - sending %s to %s\n", options.str(), names.str())); + DEBUG_LOG(("NAT::notifyUsersOfConnectionDone - sending %s to %s", options.str(), names.str())); TheGameSpyPeerMessageQueue->addRequest(req); } @@ -1132,7 +1132,7 @@ void NAT::notifyUsersOfConnectionFailed(Int nodeIndex) { GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(localSlot != NULL, ("NAT::notifyUsersOfConnectionFailed - localSlot is NULL, WTF?")); if (localSlot == NULL) { - DEBUG_LOG(("NAT::notifyUsersOfConnectionFailed - localSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::notifyUsersOfConnectionFailed - localSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } @@ -1146,7 +1146,7 @@ void NAT::notifyUsersOfConnectionFailed(Int nodeIndex) { req.id = "NAT/"; req.options = options.str(); - DEBUG_LOG(("NAT::notifyUsersOfConnectionFailed - sending %s to room\n", options.str())); + DEBUG_LOG(("NAT::notifyUsersOfConnectionFailed - sending %s to room", options.str())); */ req.peerRequestType = PeerRequest::PEERREQUEST_UTMPLAYER; @@ -1174,7 +1174,7 @@ void NAT::notifyUsersOfConnectionFailed(Int nodeIndex) { req.nick = names.str(); req.options = options.str(); - DEBUG_LOG(("NAT::notifyUsersOfConnectionFailed - sending %s to %s\n", options.str(), names.str())); + DEBUG_LOG(("NAT::notifyUsersOfConnectionFailed - sending %s to %s", options.str(), names.str())); TheGameSpyPeerMessageQueue->addRequest(req); } @@ -1191,7 +1191,7 @@ void NAT::sendMangledPortNumberToTarget(UnsignedShort mangledPort, GameSlot *tar hostName.translate(targetSlot->getName()); req.nick = hostName.str(); req.options = options.str(); - DEBUG_LOG(("NAT::sendMangledPortNumberToTarget - sending \"%s\" to %s\n", options.str(), hostName.str())); + DEBUG_LOG(("NAT::sendMangledPortNumberToTarget - sending \"%s\" to %s", options.str(), hostName.str())); TheGameSpyPeerMessageQueue->addRequest(req); } @@ -1201,7 +1201,7 @@ void NAT::processGlobalMessage(Int slotNum, const char *options) { while (isspace(*ptr)) { ++ptr; } - DEBUG_LOG(("NAT::processGlobalMessage - got message from slot %d, message is \"%s\"\n", slotNum, ptr)); + DEBUG_LOG(("NAT::processGlobalMessage - got message from slot %d, message is \"%s\"", slotNum, ptr)); if (!strncmp(ptr, "PROBED", strlen("PROBED"))) { // format: PROBED // a probe has been sent at us, if we are waiting because of a netgear or something, we @@ -1211,7 +1211,7 @@ void NAT::processGlobalMessage(Int slotNum, const char *options) { // make sure we're being probed by who we're supposed to be probed by. probed(node); } else { - DEBUG_LOG(("NAT::processGlobalMessage - probed by node %d, not our target\n", node)); + DEBUG_LOG(("NAT::processGlobalMessage - probed by node %d, not our target", node)); } } else if (!strncmp(ptr, "CONNDONE", strlen("CONNDONE"))) { // format: CONNDONE @@ -1230,13 +1230,13 @@ void NAT::processGlobalMessage(Int slotNum, const char *options) { if (m_connectionPairs[m_connectionPairIndex][m_connectionRound][node] == sendingNode) { // Int node = atoi(ptr + strlen("CONNDONE")); - DEBUG_LOG(("NAT::processGlobalMessage - got a CONNDONE message for node %d\n", node)); + DEBUG_LOG(("NAT::processGlobalMessage - got a CONNDONE message for node %d", node)); if ((node >= 0) && (node <= m_numNodes)) { - DEBUG_LOG(("NAT::processGlobalMessage - node %d's connection is complete, setting connection state to done\n", node)); + DEBUG_LOG(("NAT::processGlobalMessage - node %d's connection is complete, setting connection state to done", node)); setConnectionState(node, NATCONNECTIONSTATE_DONE); } } else { - DEBUG_LOG(("NAT::processGlobalMessage - got a connection done message that isn't from this round. node: %d sending node: %d\n", node, sendingNode)); + DEBUG_LOG(("NAT::processGlobalMessage - got a connection done message that isn't from this round. node: %d sending node: %d", node, sendingNode)); } } else if (!strncmp(ptr, "CONNFAILED", strlen("CONNFAILED"))) { // format: CONNFAILED @@ -1244,7 +1244,7 @@ void NAT::processGlobalMessage(Int slotNum, const char *options) { // and mark that down as part of the connectionStates. Int node = atoi(ptr + strlen("CONNFAILED")); if ((node >= 0) && (node < m_numNodes)) { - DEBUG_LOG(("NAT::processGlobalMessage - node %d's connection failed, setting connection state to failed\n", node)); + DEBUG_LOG(("NAT::processGlobalMessage - node %d's connection failed, setting connection state to failed", node)); setConnectionState(node, NATCONNECTIONSTATE_FAILED); } } else if (!strncmp(ptr, "PORT", strlen("PORT"))) { @@ -1265,7 +1265,7 @@ void NAT::processGlobalMessage(Int slotNum, const char *options) { sscanf(c, "%d %X", &intport, &addr); UnsignedShort port = (UnsignedShort)intport; - DEBUG_LOG(("NAT::processGlobalMessage - got port message from node %d, port: %d, internal address: %d.%d.%d.%d\n", node, port, + DEBUG_LOG(("NAT::processGlobalMessage - got port message from node %d, port: %d, internal address: %d.%d.%d.%d", node, port, PRINTF_IP_AS_4_INTS(addr))); if ((node >= 0) && (node < m_numNodes)) { diff --git a/Generals/Code/GameEngine/Source/GameNetwork/NetCommandRef.cpp b/Generals/Code/GameEngine/Source/GameNetwork/NetCommandRef.cpp index aa2612b799..0f44091217 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/NetCommandRef.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/NetCommandRef.cpp @@ -48,7 +48,7 @@ NetCommandRef::NetCommandRef(NetCommandMsg *msg) #ifdef DEBUG_NETCOMMANDREF m_id = ++refNum; - DEBUG_LOG(("NetCommandRef %d allocated in file %s line %d\n", m_id, filename, line)); + DEBUG_LOG(("NetCommandRef %d allocated in file %s line %d", m_id, filename, line)); #endif } @@ -65,7 +65,7 @@ NetCommandRef::~NetCommandRef() DEBUG_ASSERTCRASH(m_prev == NULL, ("NetCommandRef::~NetCommandRef - m_prev != NULL")); #ifdef DEBUG_NETCOMMANDREF - DEBUG_LOG(("NetCommandRef %d deleted\n", m_id)); + DEBUG_LOG(("NetCommandRef %d deleted", m_id)); #endif } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp b/Generals/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp index 3eefca9622..e8a823fcab 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp @@ -98,7 +98,7 @@ void NetCommandWrapperListNode::copyChunkData(NetWrapperCommandMsg *msg) { if (msg->getChunkNumber() >= m_numChunks) return; - DEBUG_LOG(("NetCommandWrapperListNode::copyChunkData() - copying chunk %d\n", + DEBUG_LOG(("NetCommandWrapperListNode::copyChunkData() - copying chunk %d", msg->getChunkNumber())); if (m_chunksPresent[msg->getChunkNumber()] == TRUE) { diff --git a/Generals/Code/GameEngine/Source/GameNetwork/NetMessageStream.cpp b/Generals/Code/GameEngine/Source/GameNetwork/NetMessageStream.cpp index 36044f3c82..8aca843874 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/NetMessageStream.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/NetMessageStream.cpp @@ -71,7 +71,7 @@ static Bool AddToNetCommandList(GameMessage *msg, UnsignedInt timestamp, Command CommandMsg *cmdMsg = NEW CommandMsg(timestamp, msg); if (!cmdMsg) { - DEBUG_LOG(("Alloc failed!\n")); + DEBUG_LOG(("Alloc failed!")); return false; } @@ -98,7 +98,7 @@ Bool AddToNetCommandList(Int playerNum, GameMessage *msg, UnsignedInt timestamp) if (playerNum < 0 || playerNum >= MAX_SLOTS) return false; - DEBUG_LOG(("Adding msg to NetCommandList %d\n", playerNum)); + DEBUG_LOG(("Adding msg to NetCommandList %d", playerNum)); return AddToNetCommandList(msg, timestamp, CommandHead[playerNum], CommandTail[playerNum]); } @@ -113,7 +113,7 @@ static GameMessage * GetCommandMsg(UnsignedInt timestamp, CommandMsg *& CommandH if (CommandHead->GetTimestamp() < timestamp) { - DEBUG_LOG(("Time is %d, yet message timestamp is %d!\n", timestamp, CommandHead->GetTimestamp())); + DEBUG_LOG(("Time is %d, yet message timestamp is %d!", timestamp, CommandHead->GetTimestamp())); return NULL; } @@ -145,7 +145,7 @@ GameMessage * GetCommandMsg(UnsignedInt timestamp, Int playerNum) if (playerNum < 0 || playerNum >= MAX_SLOTS) return NULL; - //DEBUG_LOG(("Adding msg to NetCommandList %d\n", playerNum)); + //DEBUG_LOG(("Adding msg to NetCommandList %d", playerNum)); return GetCommandMsg(timestamp, CommandHead[playerNum], CommandTail[playerNum]); } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/NetPacket.cpp b/Generals/Code/GameEngine/Source/GameNetwork/NetPacket.cpp index a7941a8a97..3f477e610d 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/NetPacket.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/NetPacket.cpp @@ -206,7 +206,7 @@ NetPacketList NetPacket::ConstructBigCommandPacketList(NetCommandRef *ref) { ref->setRelay(ref->getRelay()); if (packet->addCommand(ref) == FALSE) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::BeginBigCommandPacketList - failed to add a wrapper command to the packet\n")); // I still have a drinking problem. + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::BeginBigCommandPacketList - failed to add a wrapper command to the packet")); // I still have a drinking problem. } packetList.push_back(packet); @@ -822,7 +822,7 @@ void NetPacket::FillBufferWithGameCommand(UnsignedByte *buffer, NetCommandRef *m // get the game message from the NetCommandMsg GameMessage *gmsg = cmdMsg->constructGameMessage(); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::FillBufferWithGameCommand for command ID %d\n", cmdMsg->getID())); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::FillBufferWithGameCommand for command ID %d", cmdMsg->getID())); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -929,7 +929,7 @@ void NetPacket::FillBufferWithGameCommand(UnsignedByte *buffer, NetCommandRef *m deleteInstance(parser); parser = NULL; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addGameMessage - added game message, frame %d, player %d, command ID %d\n", m_lastFrame, m_lastPlayerID, m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addGameMessage - added game message, frame %d, player %d, command ID %d", m_lastFrame, m_lastPlayerID, m_lastCommandID)); if (gmsg) deleteInstance(gmsg); @@ -937,7 +937,7 @@ void NetPacket::FillBufferWithGameCommand(UnsignedByte *buffer, NetCommandRef *m } void NetPacket::FillBufferWithAckCommand(UnsignedByte *buffer, NetCommandRef *msg) { -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::FillBufferWithAckCommand - adding ack for command %d for player %d\n", cmdMsg->getCommandID(), msg->getCommand()->getPlayerID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::FillBufferWithAckCommand - adding ack for command %d for player %d", cmdMsg->getCommandID(), msg->getCommand()->getPlayerID())); NetCommandMsg *cmdMsg = msg->getCommand(); UnsignedShort offset = 0; @@ -977,13 +977,13 @@ void NetPacket::FillBufferWithAckCommand(UnsignedByte *buffer, NetCommandRef *ms memcpy(buffer + offset, &originalPlayerID, sizeof(UnsignedByte)); offset += sizeof(UnsignedByte); - // DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added ACK, original player %d, command id %d\n", origPlayerID, cmdID)); + // DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added ACK, original player %d, command id %d", origPlayerID, cmdID)); } void NetPacket::FillBufferWithFrameCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetFrameCommandMsg *cmdMsg = (NetFrameCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; - // DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addFrameCommand - adding frame command for frame %d, command count = %d, command id = %d\n", cmdMsg->getExecutionFrame(), cmdMsg->getCommandCount(), cmdMsg->getID())); + // DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addFrameCommand - adding frame command for frame %d, command count = %d, command id = %d", cmdMsg->getExecutionFrame(), cmdMsg->getCommandCount(), cmdMsg->getID())); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1021,7 +1021,7 @@ void NetPacket::FillBufferWithFrameCommand(UnsignedByte *buffer, NetCommandRef * memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1030,13 +1030,13 @@ void NetPacket::FillBufferWithFrameCommand(UnsignedByte *buffer, NetCommandRef * offset += sizeof(UnsignedShort); // frameinfodebug -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added frame %d, player %d, command count = %d, command id = %d\n", cmdMsg->getExecutionFrame(), cmdMsg->getPlayerID(), cmdMsg->getCommandCount(), cmdMsg->getID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added frame %d, player %d, command count = %d, command id = %d", cmdMsg->getExecutionFrame(), cmdMsg->getPlayerID(), cmdMsg->getCommandCount(), cmdMsg->getID())); } void NetPacket::FillBufferWithPlayerLeaveCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetPlayerLeaveCommandMsg *cmdMsg = (NetPlayerLeaveCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPlayerLeaveCommand - adding player leave command for player %d\n", cmdMsg->getLeavingPlayerID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPlayerLeaveCommand - adding player leave command for player %d", cmdMsg->getLeavingPlayerID())); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1074,7 +1074,7 @@ void NetPacket::FillBufferWithPlayerLeaveCommand(UnsignedByte *buffer, NetComman memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1086,7 +1086,7 @@ void NetPacket::FillBufferWithPlayerLeaveCommand(UnsignedByte *buffer, NetComman void NetPacket::FillBufferWithRunAheadMetricsCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetRunAheadMetricsCommandMsg *cmdMsg = (NetRunAheadMetricsCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadMetricsCommand - adding run ahead metrics for player %d, fps = %d, latency = %f\n", cmdMsg->getPlayerID(), cmdMsg->getAverageFps(), cmdMsg->getAverageLatency())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadMetricsCommand - adding run ahead metrics for player %d, fps = %d, latency = %f", cmdMsg->getPlayerID(), cmdMsg->getAverageFps(), cmdMsg->getAverageLatency())); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1117,7 +1117,7 @@ void NetPacket::FillBufferWithRunAheadMetricsCommand(UnsignedByte *buffer, NetCo memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1134,7 +1134,7 @@ void NetPacket::FillBufferWithRunAheadMetricsCommand(UnsignedByte *buffer, NetCo void NetPacket::FillBufferWithRunAheadCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetRunAheadCommandMsg *cmdMsg = (NetRunAheadCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::FillBufferWithRunAheadCommand - adding run ahead command\n")); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::FillBufferWithRunAheadCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1172,7 +1172,7 @@ void NetPacket::FillBufferWithRunAheadCommand(UnsignedByte *buffer, NetCommandRe memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1184,13 +1184,13 @@ void NetPacket::FillBufferWithRunAheadCommand(UnsignedByte *buffer, NetCommandRe memcpy(buffer + offset, &newFrameRate, sizeof(UnsignedByte)); offset += sizeof(UnsignedByte); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added run ahead command, frame %d, player id %d command id %d\n", m_lastFrame, m_lastPlayerID, m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added run ahead command, frame %d, player id %d command id %d", m_lastFrame, m_lastPlayerID, m_lastCommandID)); } void NetPacket::FillBufferWithDestroyPlayerCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetDestroyPlayerCommandMsg *cmdMsg = (NetDestroyPlayerCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1228,7 +1228,7 @@ void NetPacket::FillBufferWithDestroyPlayerCommand(UnsignedByte *buffer, NetComm memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1293,7 +1293,7 @@ void NetPacket::FillBufferWithDisconnectKeepAliveCommand(UnsignedByte *buffer, N void NetPacket::FillBufferWithDisconnectPlayerCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetDisconnectPlayerCommandMsg *cmdMsg = (NetDisconnectPlayerCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1324,7 +1324,7 @@ void NetPacket::FillBufferWithDisconnectPlayerCommand(UnsignedByte *buffer, NetC memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); - // DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); + // DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1340,7 +1340,7 @@ void NetPacket::FillBufferWithDisconnectPlayerCommand(UnsignedByte *buffer, NetC void NetPacket::FillBufferWithPacketRouterQueryCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetPacketRouterQueryCommandMsg *cmdMsg = (NetPacketRouterQueryCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterQueryCommand - adding packet router query command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterQueryCommand - adding packet router query command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1370,7 +1370,7 @@ void NetPacket::FillBufferWithPacketRouterQueryCommand(UnsignedByte *buffer, Net void NetPacket::FillBufferWithPacketRouterAckCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetPacketRouterAckCommandMsg *cmdMsg = (NetPacketRouterAckCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterAckCommand - adding packet router query command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterAckCommand - adding packet router query command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1401,7 +1401,7 @@ void NetPacket::FillBufferWithPacketRouterAckCommand(UnsignedByte *buffer, NetCo void NetPacket::FillBufferWithDisconnectChatCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetDisconnectChatCommandMsg *cmdMsg = (NetDisconnectChatCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1439,7 +1439,7 @@ void NetPacket::FillBufferWithDisconnectChatCommand(UnsignedByte *buffer, NetCom void NetPacket::FillBufferWithDisconnectVoteCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetDisconnectVoteCommandMsg *cmdMsg = (NetDisconnectVoteCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1470,7 +1470,7 @@ void NetPacket::FillBufferWithDisconnectVoteCommand(UnsignedByte *buffer, NetCom memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1486,7 +1486,7 @@ void NetPacket::FillBufferWithDisconnectVoteCommand(UnsignedByte *buffer, NetCom void NetPacket::FillBufferWithChatCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetChatCommandMsg *cmdMsg = (NetChatCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1524,7 +1524,7 @@ void NetPacket::FillBufferWithChatCommand(UnsignedByte *buffer, NetCommandRef *m memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -2107,7 +2107,7 @@ Bool NetPacket::addFrameResendRequestCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &frameToResend, sizeof(frameToResend)); m_packetLen += sizeof(frameToResend); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addFrameResendRequest - added frame resend request command from player %d for frame %d, command id = %d\n", m_lastPlayerID, frameToResend, m_lastCommandID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addFrameResendRequest - added frame resend request command from player %d for frame %d, command id = %d", m_lastPlayerID, frameToResend, m_lastCommandID)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -2218,7 +2218,7 @@ Bool NetPacket::addDisconnectScreenOffCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &newFrame, sizeof(newFrame)); m_packetLen += sizeof(newFrame); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectScreenOff - added disconnect screen off command from player %d for frame %d, command id = %d\n", m_lastPlayerID, newFrame, m_lastCommandID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectScreenOff - added disconnect screen off command from player %d for frame %d, command id = %d", m_lastPlayerID, newFrame, m_lastCommandID)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -2337,7 +2337,7 @@ Bool NetPacket::addDisconnectFrameCommand(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectFrame - added disconnect frame command from player %d for frame %d, command id = %d\n", m_lastPlayerID, disconnectFrame, m_lastCommandID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectFrame - added disconnect frame command from player %d for frame %d, command id = %d", m_lastPlayerID, disconnectFrame, m_lastCommandID)); return TRUE; } @@ -2550,11 +2550,11 @@ Bool NetPacket::addFileAnnounceCommand(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Adding file announce message for fileID %d, ID %d to packet\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Adding file announce message for fileID %d, ID %d to packet", cmdMsg->getFileID(), cmdMsg->getID())); return TRUE; } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("No room to add file announce message to packet\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("No room to add file announce message to packet")); return FALSE; } @@ -2886,7 +2886,7 @@ Bool NetPacket::addTimeOutGameStartMessage(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.")); return TRUE; } @@ -2980,7 +2980,7 @@ Bool NetPacket::addLoadCompleteMessage(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.")); return TRUE; } @@ -3066,7 +3066,7 @@ Bool NetPacket::addProgressMessage(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.")); return TRUE; } @@ -3104,11 +3104,11 @@ Bool NetPacket::isRoomForProgressMessage(NetCommandRef *msg) { Bool NetPacket::addDisconnectVoteCommand(NetCommandRef *msg) { Bool needNewCommandID = FALSE; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - entering...\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - entering...")); // need type, player id, relay, command id, slot number if (isRoomForDisconnectVoteMessage(msg)) { NetDisconnectVoteCommandMsg *cmdMsg = (NetDisconnectVoteCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3155,7 +3155,7 @@ Bool NetPacket::addDisconnectVoteCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -3167,7 +3167,7 @@ Bool NetPacket::addDisconnectVoteCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &voteFrame, sizeof(voteFrame)); m_packetLen += sizeof(voteFrame); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - added disconnect vote command, player id %d command id %d, voted slot %d\n", m_lastPlayerID, m_lastCommandID, slot)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - added disconnect vote command, player id %d command id %d, voted slot %d", m_lastPlayerID, m_lastCommandID, slot)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -3217,10 +3217,10 @@ Bool NetPacket::isRoomForDisconnectVoteMessage(NetCommandRef *msg) { Bool NetPacket::addDisconnectChatCommand(NetCommandRef *msg) { // type, player, id, relay, data // data format: 1 byte string length, string (two bytes per character) -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - Entering...\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - Entering...")); if (isRoomForDisconnectChatMessage(msg)) { NetDisconnectChatCommandMsg *cmdMsg = (NetDisconnectChatCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3266,7 +3266,7 @@ Bool NetPacket::addDisconnectChatCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, unitext.str(), length * sizeof(UnsignedShort)); m_packetLen += length * sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added disconnect chat command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added disconnect chat command")); ++m_numCommands; if (m_lastCommand != NULL) { @@ -3309,7 +3309,7 @@ Bool NetPacket::addChatCommand(NetCommandRef *msg) { Bool needNewCommandID = FALSE; if (isRoomForChatMessage(msg)) { NetChatCommandMsg *cmdMsg = (NetChatCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3367,7 +3367,7 @@ Bool NetPacket::addChatCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -3383,7 +3383,7 @@ Bool NetPacket::addChatCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &playerMask, sizeof(Int)); m_packetLen += sizeof(Int); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added chat command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added chat command")); ++m_numCommands; if (m_lastCommand != NULL) { @@ -3435,7 +3435,7 @@ Bool NetPacket::addPacketRouterAckCommand(NetCommandRef *msg) { // need type, player id, relay, command id, slot number if (isRoomForPacketRouterAckMessage(msg)) { NetPacketRouterAckCommandMsg *cmdMsg = (NetPacketRouterAckCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterAckCommand - adding packet router query command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterAckCommand - adding packet router query command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3474,7 +3474,7 @@ Bool NetPacket::addPacketRouterAckCommand(NetCommandRef *msg) { m_packet[m_packetLen] = 'D'; ++m_packetLen; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added packet router ack command, player id %d\n", m_lastPlayerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added packet router ack command, player id %d", m_lastPlayerID)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -3517,7 +3517,7 @@ Bool NetPacket::addPacketRouterQueryCommand(NetCommandRef *msg) { // need type, player id, relay, command id, slot number if (isRoomForPacketRouterQueryMessage(msg)) { NetPacketRouterQueryCommandMsg *cmdMsg = (NetPacketRouterQueryCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterQueryCommand - adding packet router query command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterQueryCommand - adding packet router query command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3556,7 +3556,7 @@ Bool NetPacket::addPacketRouterQueryCommand(NetCommandRef *msg) { m_packet[m_packetLen] = 'D'; ++m_packetLen; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added packet router query command, player id %d\n", m_lastPlayerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added packet router query command, player id %d", m_lastPlayerID)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -3598,11 +3598,11 @@ Bool NetPacket::isRoomForPacketRouterQueryMessage(NetCommandRef *msg) { Bool NetPacket::addDisconnectPlayerCommand(NetCommandRef *msg) { Bool needNewCommandID = FALSE; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - entering...\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - entering...")); // need type, player id, relay, command id, slot number if (isRoomForDisconnectPlayerMessage(msg)) { NetDisconnectPlayerCommandMsg *cmdMsg = (NetDisconnectPlayerCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3649,7 +3649,7 @@ Bool NetPacket::addDisconnectPlayerCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -3661,7 +3661,7 @@ Bool NetPacket::addDisconnectPlayerCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &disconnectFrame, sizeof(disconnectFrame)); m_packetLen += sizeof(disconnectFrame); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - added disconnect player command, player id %d command id %d, disconnecting slot %d\n", m_lastPlayerID, m_lastCommandID, slot)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - added disconnect player command, player id %d command id %d, disconnecting slot %d", m_lastPlayerID, m_lastCommandID, slot)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -3756,7 +3756,7 @@ Bool NetPacket::addDisconnectKeepAliveCommand(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.")); return TRUE; } @@ -3836,7 +3836,7 @@ Bool NetPacket::addKeepAliveCommand(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.")); return TRUE; } @@ -3875,7 +3875,7 @@ Bool NetPacket::addRunAheadCommand(NetCommandRef *msg) { Bool needNewCommandID = FALSE; if (isRoomForRunAheadMessage(msg)) { NetRunAheadCommandMsg *cmdMsg = (NetRunAheadCommandMsg *)(msg->getCommand()); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadCommand - adding run ahead command\n")); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3933,7 +3933,7 @@ Bool NetPacket::addRunAheadCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -3945,7 +3945,7 @@ Bool NetPacket::addRunAheadCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &newFrameRate, sizeof(UnsignedByte)); m_packetLen += sizeof(UnsignedByte); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added run ahead command, frame %d, player id %d command id %d\n", m_lastFrame, m_lastPlayerID, m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added run ahead command, frame %d, player id %d command id %d", m_lastFrame, m_lastPlayerID, m_lastCommandID)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -4058,7 +4058,7 @@ Bool NetPacket::addDestroyPlayerCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -4066,7 +4066,7 @@ Bool NetPacket::addDestroyPlayerCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &newVal, sizeof(UnsignedInt)); m_packetLen += sizeof(UnsignedInt); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added CRC:0x%8.8X info command, frame %d, player id %d command id %d\n", newCRC, m_lastFrame, m_lastPlayerID, m_lastCommandID)); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added CRC:0x%8.8X info command, frame %d, player id %d command id %d", newCRC, m_lastFrame, m_lastPlayerID, m_lastCommandID)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -4121,7 +4121,7 @@ Bool NetPacket::addRunAheadMetricsCommand(NetCommandRef *msg) { Bool needNewCommandID = FALSE; if (isRoomForRunAheadMetricsMessage(msg)) { NetRunAheadMetricsCommandMsg *cmdMsg = (NetRunAheadMetricsCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadMetricsCommand - adding run ahead metrics for player %d, fps = %d, latency = %f\n", cmdMsg->getPlayerID(), cmdMsg->getAverageFps(), cmdMsg->getAverageLatency())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadMetricsCommand - adding run ahead metrics for player %d, fps = %d, latency = %f", cmdMsg->getPlayerID(), cmdMsg->getAverageFps(), cmdMsg->getAverageLatency())); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -4168,7 +4168,7 @@ Bool NetPacket::addRunAheadMetricsCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -4234,7 +4234,7 @@ Bool NetPacket::addPlayerLeaveCommand(NetCommandRef *msg) { Bool needNewCommandID = FALSE; if (isRoomForPlayerLeaveMessage(msg)) { NetPlayerLeaveCommandMsg *cmdMsg = (NetPlayerLeaveCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPlayerLeaveCommand - adding player leave command for player %d\n", cmdMsg->getLeavingPlayerID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPlayerLeaveCommand - adding player leave command for player %d", cmdMsg->getLeavingPlayerID())); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -4292,7 +4292,7 @@ Bool NetPacket::addPlayerLeaveCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -4365,12 +4365,12 @@ Bool NetPacket::addFrameCommand(NetCommandRef *msg) { ++m_lastFrame; // need this cause we're actually advancing to the next frame by adding this command. ++m_numCommands; // frameinfodebug -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added frame %d, player %d, command count = %d, command id = %d, repeat\n", m_lastFrame, m_lastPlayerID, 0, m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added frame %d, player %d, command count = %d, command id = %d, repeat", m_lastFrame, m_lastPlayerID, 0, m_lastCommandID)); return TRUE; } if (isRoomForFrameMessage(msg)) { NetFrameCommandMsg *cmdMsg = (NetFrameCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addFrameCommand - adding frame command for frame %d, command count = %d, command id = %d\n", cmdMsg->getExecutionFrame(), cmdMsg->getCommandCount(), cmdMsg->getID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addFrameCommand - adding frame command for frame %d, command count = %d, command id = %d", cmdMsg->getExecutionFrame(), cmdMsg->getCommandCount(), cmdMsg->getID())); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -4428,7 +4428,7 @@ Bool NetPacket::addFrameCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -4437,7 +4437,7 @@ Bool NetPacket::addFrameCommand(NetCommandRef *msg) { m_packetLen += sizeof(UnsignedShort); // frameinfodebug -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added frame %d, player %d, command count = %d, command id = %d\n", cmdMsg->getExecutionFrame(), cmdMsg->getPlayerID(), cmdMsg->getCommandCount(), cmdMsg->getID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added frame %d, player %d, command count = %d, command id = %d", cmdMsg->getExecutionFrame(), cmdMsg->getPlayerID(), cmdMsg->getCommandCount(), cmdMsg->getID())); if (m_lastCommand != NULL) { deleteInstance(m_lastCommand); @@ -4554,7 +4554,7 @@ Bool NetPacket::addAckCommand(NetCommandRef *msg, UnsignedShort commandID, Unsig } if (isRoomForAckMessage(msg)) { NetCommandMsg *cmdMsg = msg->getCommand(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addAckCommand - adding ack for command %d for player %d\n", cmdMsg->getCommandID(), msg->getCommand()->getPlayerID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addAckCommand - adding ack for command %d for player %d", cmdMsg->getCommandID(), msg->getCommand()->getPlayerID())); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { m_packet[m_packetLen] = 'T'; @@ -4589,7 +4589,7 @@ Bool NetPacket::addAckCommand(NetCommandRef *msg, UnsignedShort commandID, Unsig m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added ACK, original player %d, command id %d\n", origPlayerID, cmdID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added ACK, original player %d, command id %d", origPlayerID, cmdID)); ++m_numCommands; return TRUE; } @@ -4693,7 +4693,7 @@ Bool NetPacket::addGameCommand(NetCommandRef *msg) { // get the game message from the NetCommandMsg GameMessage *gmsg = cmdMsg->constructGameMessage(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addGameCommand for command ID %d\n", cmdMsg->getID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addGameCommand for command ID %d", cmdMsg->getID())); if (isRoomForGameMessage(msg, gmsg)) { // Now we know there is enough room, put the new game message into the packet. @@ -4791,7 +4791,7 @@ Bool NetPacket::addGameCommand(NetCommandRef *msg) { deleteInstance(parser); parser = NULL; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addGameMessage - added game message, frame %d, player %d, command ID %d\n", m_lastFrame, m_lastPlayerID, m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addGameMessage - added game message, frame %d, player %d, command ID %d", m_lastFrame, m_lastPlayerID, m_lastCommandID)); ++m_numCommands; @@ -4929,7 +4929,7 @@ Bool NetPacket::isRoomForGameMessage(NetCommandRef *msg, GameMessage *gmsg) { */ NetCommandList * NetPacket::getCommandList() { NetCommandList *retval = newInstance(NetCommandList); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList, packet length = %d\n", m_packetLen)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList, packet length = %d", m_packetLen)); retval->init(); // These need to be the same as the default values for m_lastPlayerID, m_lastFrame, etc. @@ -4967,13 +4967,13 @@ NetCommandList * NetPacket::getCommandList() { NetCommandMsg *msg = NULL; - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList() - command of type %d(%s)\n", commandType, GetAsciiNetCommandType((NetCommandType)commandType).str())); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList() - command of type %d(%s)", commandType, GetAsciiNetCommandType((NetCommandType)commandType).str())); switch((NetCommandType)commandType) { case NETCOMMANDTYPE_GAMECOMMAND: msg = readGameMessage(m_packet, i); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read game command from player %d for frame %d\n", playerID, frame)); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read game command from player %d for frame %d", playerID, frame)); break; case NETCOMMANDTYPE_ACKBOTH: msg = readAckBothMessage(m_packet, i); @@ -4987,95 +4987,95 @@ NetCommandList * NetPacket::getCommandList() { case NETCOMMANDTYPE_FRAMEINFO: msg = readFrameMessage(m_packet, i); // frameinfodebug - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read frame %d from player %d, command count = %d, relay = 0x%X\n", frame, playerID, ((NetFrameCommandMsg *)msg)->getCommandCount(), relay)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read frame %d from player %d, command count = %d, relay = 0x%X", frame, playerID, ((NetFrameCommandMsg *)msg)->getCommandCount(), relay)); break; case NETCOMMANDTYPE_PLAYERLEAVE: msg = readPlayerLeaveMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read player leave message from player %d for execution on frame %d\n", playerID, frame)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read player leave message from player %d for execution on frame %d", playerID, frame)); break; case NETCOMMANDTYPE_RUNAHEADMETRICS: msg = readRunAheadMetricsMessage(m_packet, i); break; case NETCOMMANDTYPE_RUNAHEAD: msg = readRunAheadMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read run ahead message from player %d for execution on frame %d\n", playerID, frame)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read run ahead message from player %d for execution on frame %d", playerID, frame)); break; case NETCOMMANDTYPE_DESTROYPLAYER: msg = readDestroyPlayerMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read CRC info message from player %d for execution on frame %d\n", playerID, frame)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read CRC info message from player %d for execution on frame %d", playerID, frame)); break; case NETCOMMANDTYPE_KEEPALIVE: msg = readKeepAliveMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read keep alive message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read keep alive message from player %d", playerID)); break; case NETCOMMANDTYPE_DISCONNECTKEEPALIVE: msg = readDisconnectKeepAliveMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read keep alive message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read keep alive message from player %d", playerID)); break; case NETCOMMANDTYPE_DISCONNECTPLAYER: msg = readDisconnectPlayerMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect player message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect player message from player %d", playerID)); break; case NETCOMMANDTYPE_PACKETROUTERQUERY: msg = readPacketRouterQueryMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read packet router query message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read packet router query message from player %d", playerID)); break; case NETCOMMANDTYPE_PACKETROUTERACK: msg = readPacketRouterAckMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read packet router ack message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read packet router ack message from player %d", playerID)); break; case NETCOMMANDTYPE_DISCONNECTCHAT: msg = readDisconnectChatMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect chat message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect chat message from player %d", playerID)); break; case NETCOMMANDTYPE_DISCONNECTVOTE: msg = readDisconnectVoteMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect vote message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect vote message from player %d", playerID)); break; case NETCOMMANDTYPE_CHAT: msg = readChatMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read chat message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read chat message from player %d", playerID)); break; case NETCOMMANDTYPE_PROGRESS: msg = readProgressMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read Progress message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read Progress message from player %d", playerID)); break; case NETCOMMANDTYPE_LOADCOMPLETE: msg = readLoadCompleteMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read LoadComplete message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read LoadComplete message from player %d", playerID)); break; case NETCOMMANDTYPE_TIMEOUTSTART: msg = readTimeOutGameStartMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read TimeOutGameStart message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read TimeOutGameStart message from player %d", playerID)); break; case NETCOMMANDTYPE_WRAPPER: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read Wrapper message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read Wrapper message from player %d", playerID)); msg = readWrapperMessage(m_packet, i); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Done reading Wrapper message from player %d - wrapped command was %d\n", playerID, + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Done reading Wrapper message from player %d - wrapped command was %d", playerID, ((NetWrapperCommandMsg *)msg)->getWrappedCommandID())); break; case NETCOMMANDTYPE_FILE: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read file message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read file message from player %d", playerID)); msg = readFileMessage(m_packet, i); break; case NETCOMMANDTYPE_FILEANNOUNCE: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read file announce message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read file announce message from player %d", playerID)); msg = readFileAnnounceMessage(m_packet, i); break; case NETCOMMANDTYPE_FILEPROGRESS: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read file progress message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read file progress message from player %d", playerID)); msg = readFileProgressMessage(m_packet, i); break; case NETCOMMANDTYPE_DISCONNECTFRAME: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect frame message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect frame message from player %d", playerID)); msg = readDisconnectFrameMessage(m_packet, i); break; case NETCOMMANDTYPE_DISCONNECTSCREENOFF: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect screen off message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect screen off message from player %d", playerID)); msg = readDisconnectScreenOffMessage(m_packet, i); break; case NETCOMMANDTYPE_FRAMERESENDREQUEST: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read frame resend request message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read frame resend request message from player %d", playerID)); msg = readFrameResendRequestMessage(m_packet, i); break; } @@ -5091,7 +5091,7 @@ NetCommandList * NetPacket::getCommandList() { msg->setNetCommandType((NetCommandType)commandType); msg->setID(commandID); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("frame = %d, player = %d, command type = %d, id = %d\n", frame, playerID, commandType, commandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("frame = %d, player = %d, command type = %d, id = %d", frame, playerID, commandType, commandID)); // increment to the next command ID. if (DoesCommandRequireACommandID((NetCommandType)commandType)) { @@ -5103,7 +5103,7 @@ NetCommandList * NetPacket::getCommandList() { if (ref != NULL) { ref->setRelay(relay); } else { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList - failed to set relay for message %d\n", msg->getID())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList - failed to set relay for message %d", msg->getID())); } if (lastCommand != NULL) { @@ -5142,7 +5142,7 @@ NetCommandList * NetPacket::getCommandList() { msg = newInstance(NetFrameCommandMsg)(); ++frame; // this is set below. ((NetFrameCommandMsg *)msg)->setCommandCount(0); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Read a repeated frame command, frame = %d, player = %d, commandID = %d\n", frame, playerID, commandID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Read a repeated frame command, frame = %d, player = %d, commandID = %d", frame, playerID, commandID)); } else { DEBUG_CRASH(("Trying to repeat a command that shouldn't be repeated.")); continue; @@ -5153,7 +5153,7 @@ NetCommandList * NetPacket::getCommandList() { msg->setNetCommandType((NetCommandType)commandType); msg->setID(commandID); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("frame = %d, player = %d, command type = %d, id = %d\n", frame, playerID, commandType, commandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("frame = %d, player = %d, command type = %d, id = %d", frame, playerID, commandType, commandID)); // increment to the next command ID. if (DoesCommandRequireACommandID((NetCommandType)commandType)) { @@ -5178,7 +5178,7 @@ NetCommandList * NetPacket::getCommandList() { } else { // we don't recognize this command, but we have to increment i so we don't fall into an infinite loop. DEBUG_CRASH(("Unrecognized packet entry, ignoring.")); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList - Unrecognized packet entry at index %d\n", i)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList - Unrecognized packet entry at index %d", i)); dumpPacketToLog(); ++i; } @@ -5198,7 +5198,7 @@ NetCommandMsg * NetPacket::readGameMessage(UnsignedByte *data, Int &i) { NetGameCommandMsg *msg = newInstance(NetGameCommandMsg); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readGameMessage\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readGameMessage")); // Get the GameMessage command type. GameMessage::Type newType; @@ -5359,7 +5359,7 @@ NetCommandMsg * NetPacket::readAckBothMessage(UnsignedByte *data, Int &i) { memcpy(&origPlayerID, data + i, sizeof(UnsignedByte)); i += sizeof(UnsignedByte); msg->setOriginalPlayerID(origPlayerID); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("original player id = %d\n", origPlayerID)); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("original player id = %d", origPlayerID)); return msg; } @@ -5382,7 +5382,7 @@ NetCommandMsg * NetPacket::readAckStage1Message(UnsignedByte *data, Int &i) { memcpy(&origPlayerID, data + i, sizeof(UnsignedByte)); i += sizeof(UnsignedByte); msg->setOriginalPlayerID(origPlayerID); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("original player id = %d\n", origPlayerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("original player id = %d", origPlayerID)); return msg; } @@ -5405,7 +5405,7 @@ NetCommandMsg * NetPacket::readAckStage2Message(UnsignedByte *data, Int &i) { memcpy(&origPlayerID, data + i, sizeof(UnsignedByte)); i += sizeof(UnsignedByte); msg->setOriginalPlayerID(origPlayerID); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("original player id = %d\n", origPlayerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("original player id = %d", origPlayerID)); return msg; } @@ -5490,7 +5490,7 @@ NetCommandMsg * NetPacket::readDestroyPlayerMessage(UnsignedByte *data, Int &i) memcpy(&newVal, data + i, sizeof(UnsignedInt)); i += sizeof(UnsignedInt); msg->setPlayerIndex(newVal); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Saw CRC of 0x%8.8X\n", newCRC)); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Saw CRC of 0x%8.8X", newCRC)); return msg; } @@ -5567,7 +5567,7 @@ NetCommandMsg * NetPacket::readDisconnectChatMessage(UnsignedByte *data, Int &i) UnicodeString unitext; unitext.set(text); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readDisconnectChatMessage - read message, message is %ls\n", unitext.str())); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readDisconnectChatMessage - read message, message is %ls", unitext.str())); msg->setText(unitext); return msg; @@ -5594,7 +5594,7 @@ NetCommandMsg * NetPacket::readChatMessage(UnsignedByte *data, Int &i) { UnicodeString unitext; unitext.set(text); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readChatMessage - read message, message is %ls\n", unitext.str())); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readChatMessage - read message, message is %ls", unitext.str())); msg->setText(unitext); msg->setPlayerMask(playerMask); @@ -5652,40 +5652,40 @@ NetCommandMsg * NetPacket::readWrapperMessage(UnsignedByte *data, Int &i) { memcpy(&wrappedCommandID, data + i, sizeof(wrappedCommandID)); msg->setWrappedCommandID(wrappedCommandID); i += sizeof(wrappedCommandID); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - wrapped command ID == %d\n", wrappedCommandID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - wrapped command ID == %d", wrappedCommandID)); // get the chunk number. UnsignedInt chunkNumber = 0; memcpy(&chunkNumber, data + i, sizeof(chunkNumber)); msg->setChunkNumber(chunkNumber); i += sizeof(chunkNumber); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - chunk number = %d\n", chunkNumber)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - chunk number = %d", chunkNumber)); // get the number of chunks UnsignedInt numChunks = 0; memcpy(&numChunks, data + i, sizeof(numChunks)); msg->setNumChunks(numChunks); i += sizeof(numChunks); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - number of chunks = %d\n", numChunks)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - number of chunks = %d", numChunks)); // get the total data length UnsignedInt totalDataLength = 0; memcpy(&totalDataLength, data + i, sizeof(totalDataLength)); msg->setTotalDataLength(totalDataLength); i += sizeof(totalDataLength); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - total data length = %d\n", totalDataLength)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - total data length = %d", totalDataLength)); // get the data length for this chunk UnsignedInt dataLength = 0; memcpy(&dataLength, data + i, sizeof(dataLength)); i += sizeof(dataLength); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - data length = %d\n", dataLength)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - data length = %d", dataLength)); UnsignedInt dataOffset = 0; memcpy(&dataOffset, data + i, sizeof(dataOffset)); msg->setDataOffset(dataOffset); i += sizeof(dataOffset); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - data offset = %d\n", dataOffset)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - data offset = %d", dataOffset)); msg->setData(data + i, dataLength); i += dataLength; @@ -5771,7 +5771,7 @@ NetCommandMsg * NetPacket::readDisconnectFrameMessage(UnsignedByte *data, Int &i i += sizeof(disconnectFrame); msg->setDisconnectFrame(disconnectFrame); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readDisconnectFrameMessage - read disconnect frame for frame %d\n", disconnectFrame)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readDisconnectFrameMessage - read disconnect frame for frame %d", disconnectFrame)); return msg; } @@ -5837,7 +5837,7 @@ Int NetPacket::getLength() { * Dumps the packet to the debug log file */ void NetPacket::dumpPacketToLog() { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::dumpPacketToLog() - packet is %d bytes\n", m_packetLen)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::dumpPacketToLog() - packet is %d bytes", m_packetLen)); Int numLines = m_packetLen / 8; if ((m_packetLen % 8) != 0) { ++numLines; @@ -5847,7 +5847,7 @@ void NetPacket::dumpPacketToLog() { for (Int dumpindex2 = 0; (dumpindex2 < 8) && ((dumpindex*8 + dumpindex2) < m_packetLen); ++dumpindex2) { DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%02x '%c' ", m_packet[dumpindex*8 + dumpindex2], m_packet[dumpindex*8 + dumpindex2])); } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("")); } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("End of packet dump\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("End of packet dump")); } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/Network.cpp b/Generals/Code/GameEngine/Source/GameNetwork/Network.cpp index 2f499ff032..9375c82f59 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/Network.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/Network.cpp @@ -320,7 +320,7 @@ void Network::init() { if (!deinit()) { - DEBUG_LOG(("Could not deinit network prior to init!\n")); + DEBUG_LOG(("Could not deinit network prior to init!")); return; } @@ -342,19 +342,19 @@ void Network::init() m_sawCRCMismatch = FALSE; m_checkCRCsThisFrame = FALSE; - DEBUG_LOG(("Network timing values:\n")); - DEBUG_LOG(("NetworkFPSHistoryLength: %d\n", TheGlobalData->m_networkFPSHistoryLength)); - DEBUG_LOG(("NetworkLatencyHistoryLength: %d\n", TheGlobalData->m_networkLatencyHistoryLength)); - DEBUG_LOG(("NetworkRunAheadMetricsTime: %d\n", TheGlobalData->m_networkRunAheadMetricsTime)); - DEBUG_LOG(("NetworkCushionHistoryLength: %d\n", TheGlobalData->m_networkCushionHistoryLength)); - DEBUG_LOG(("NetworkRunAheadSlack: %d\n", TheGlobalData->m_networkRunAheadSlack)); - DEBUG_LOG(("NetworkKeepAliveDelay: %d\n", TheGlobalData->m_networkKeepAliveDelay)); - DEBUG_LOG(("NetworkDisconnectTime: %d\n", TheGlobalData->m_networkDisconnectTime)); - DEBUG_LOG(("NetworkPlayerTimeoutTime: %d\n", TheGlobalData->m_networkPlayerTimeoutTime)); - DEBUG_LOG(("NetworkDisconnectScreenNotifyTime: %d\n", TheGlobalData->m_networkDisconnectScreenNotifyTime)); - DEBUG_LOG(("Other network stuff:\n")); - DEBUG_LOG(("FRAME_DATA_LENGTH = %d\n", FRAME_DATA_LENGTH)); - DEBUG_LOG(("FRAMES_TO_KEEP = %d\n", FRAMES_TO_KEEP)); + DEBUG_LOG(("Network timing values:")); + DEBUG_LOG(("NetworkFPSHistoryLength: %d", TheGlobalData->m_networkFPSHistoryLength)); + DEBUG_LOG(("NetworkLatencyHistoryLength: %d", TheGlobalData->m_networkLatencyHistoryLength)); + DEBUG_LOG(("NetworkRunAheadMetricsTime: %d", TheGlobalData->m_networkRunAheadMetricsTime)); + DEBUG_LOG(("NetworkCushionHistoryLength: %d", TheGlobalData->m_networkCushionHistoryLength)); + DEBUG_LOG(("NetworkRunAheadSlack: %d", TheGlobalData->m_networkRunAheadSlack)); + DEBUG_LOG(("NetworkKeepAliveDelay: %d", TheGlobalData->m_networkKeepAliveDelay)); + DEBUG_LOG(("NetworkDisconnectTime: %d", TheGlobalData->m_networkDisconnectTime)); + DEBUG_LOG(("NetworkPlayerTimeoutTime: %d", TheGlobalData->m_networkPlayerTimeoutTime)); + DEBUG_LOG(("NetworkDisconnectScreenNotifyTime: %d", TheGlobalData->m_networkDisconnectScreenNotifyTime)); + DEBUG_LOG(("Other network stuff:")); + DEBUG_LOG(("FRAME_DATA_LENGTH = %d", FRAME_DATA_LENGTH)); + DEBUG_LOG(("FRAMES_TO_KEEP = %d", FRAMES_TO_KEEP)); #if defined(RTS_DEBUG) @@ -375,24 +375,24 @@ void Network::setSawCRCMismatch( void ) TheRecorder->logCRCMismatch(); // dump GameLogic random seed - DEBUG_LOG(("Latest frame for mismatch = %d GameLogic frame = %d\n", + DEBUG_LOG(("Latest frame for mismatch = %d GameLogic frame = %d", TheGameLogic->getFrame()-m_runAhead-1, TheGameLogic->getFrame())); - DEBUG_LOG(("GetGameLogicRandomSeedCRC() = %d\n", GetGameLogicRandomSeedCRC())); + DEBUG_LOG(("GetGameLogicRandomSeedCRC() = %d", GetGameLogicRandomSeedCRC())); // dump CRCs { - DEBUG_LOG(("--- GameState Dump ---\n")); + DEBUG_LOG(("--- GameState Dump ---")); #ifdef DEBUG_CRC outputCRCDumpLines(); #endif - DEBUG_LOG(("------ End Dump ------\n")); + DEBUG_LOG(("------ End Dump ------")); } { - DEBUG_LOG(("--- DebugInfo Dump ---\n")); + DEBUG_LOG(("--- DebugInfo Dump ---")); #ifdef DEBUG_CRC outputCRCDebugLines(); #endif - DEBUG_LOG(("------ End Dump ------\n")); + DEBUG_LOG(("------ End Dump ------")); } } @@ -403,7 +403,7 @@ void Network::parseUserList( const GameInfo *game ) { if (!game) { - DEBUG_LOG(("FAILED parseUserList with a NULL game\n")); + DEBUG_LOG(("FAILED parseUserList with a NULL game")); return; } @@ -524,12 +524,12 @@ Bool Network::processCommand(GameMessage *msg) // Send command counts for all the frames we can. for (Int i = m_lastFrameCompleted + 1; i < executionFrame; ++i) { m_conMgr->processFrameTick(i); - //DEBUG_LOG(("Network::processCommand - calling processFrameTick for frame %d\n", i)); + //DEBUG_LOG(("Network::processCommand - calling processFrameTick for frame %d", i)); m_lastFrameCompleted = i; } } - //DEBUG_LOG(("Next Execution Frame - %d, last frame completed - %d\n", getExecutionFrame(), m_lastFrameCompleted)); + //DEBUG_LOG(("Next Execution Frame - %d, last frame completed - %d", getExecutionFrame(), m_lastFrameCompleted)); m_lastFrame = TheGameLogic->getFrame(); } @@ -539,7 +539,7 @@ Bool Network::processCommand(GameMessage *msg) // frame where everyone else is going to see that we left. if ((msg->getType() == GameMessage::MSG_CLEAR_GAME_DATA) && (m_localStatus == NETLOCALSTATUS_INGAME)) { Int executionFrame = getExecutionFrame(); - DEBUG_LOG(("Network::processCommand - local player leaving, executionFrame = %d, player leaving on frame %d\n", executionFrame, executionFrame+1)); + DEBUG_LOG(("Network::processCommand - local player leaving, executionFrame = %d, player leaving on frame %d", executionFrame, executionFrame+1)); m_conMgr->handleLocalPlayerLeaving(executionFrame+1); m_conMgr->processFrameTick(executionFrame); // This is the last command we will execute, so send the command count. @@ -548,7 +548,7 @@ Bool Network::processCommand(GameMessage *msg) // worry about messing up the other players. m_conMgr->processFrameTick(executionFrame+1); // since we send it for executionFrame+1, we need to process both ticks m_lastFrameCompleted = executionFrame; - DEBUG_LOG(("Network::processCommand - player leaving on frame %d\n", executionFrame)); + DEBUG_LOG(("Network::processCommand - player leaving on frame %d", executionFrame)); m_localStatus = NETLOCALSTATUS_LEAVING; return TRUE; } @@ -588,7 +588,7 @@ void Network::RelayCommandsToCommandList(UnsignedInt frame) { while (msg != NULL) { NetCommandType cmdType = msg->getCommand()->getNetCommandType(); if (cmdType == NETCOMMANDTYPE_GAMECOMMAND) { - //DEBUG_LOG(("Network::RelayCommandsToCommandList - appending command %d of type %s to command list on frame %d\n", msg->getCommand()->getID(), ((NetGameCommandMsg *)msg->getCommand())->constructGameMessage()->getCommandAsAsciiString().str(), TheGameLogic->getFrame())); + //DEBUG_LOG(("Network::RelayCommandsToCommandList - appending command %d of type %s to command list on frame %d", msg->getCommand()->getID(), ((NetGameCommandMsg *)msg->getCommand())->constructGameMessage()->getCommandAsAsciiString().str(), TheGameLogic->getFrame())); TheCommandList->appendMessage(((NetGameCommandMsg *)msg->getCommand())->constructGameMessage()); } else { processFrameSynchronizedNetCommand(msg); @@ -617,23 +617,23 @@ void Network::processFrameSynchronizedNetCommand(NetCommandRef *msg) { if (cmdMsg->getNetCommandType() == NETCOMMANDTYPE_PLAYERLEAVE) { PlayerLeaveCode retval = m_conMgr->processPlayerLeave((NetPlayerLeaveCommandMsg *)cmdMsg); if (retval == PLAYERLEAVECODE_LOCAL) { - DEBUG_LOG(("Network::processFrameSynchronizedNetCommand - Local player left the game on frame %d.\n", TheGameLogic->getFrame())); + DEBUG_LOG(("Network::processFrameSynchronizedNetCommand - Local player left the game on frame %d.", TheGameLogic->getFrame())); m_localStatus = NETLOCALSTATUS_LEFT; } else if (retval == PLAYERLEAVECODE_PACKETROUTER) { - DEBUG_LOG(("Network::processFrameSynchronizedNetCommand - Packet router left the game on frame %d\n", TheGameLogic->getFrame())); + DEBUG_LOG(("Network::processFrameSynchronizedNetCommand - Packet router left the game on frame %d", TheGameLogic->getFrame())); } else { - DEBUG_LOG(("Network::processFrameSynchronizedNetCommand - Client left the game on frame %d\n", TheGameLogic->getFrame())); + DEBUG_LOG(("Network::processFrameSynchronizedNetCommand - Client left the game on frame %d", TheGameLogic->getFrame())); } } else if (cmdMsg->getNetCommandType() == NETCOMMANDTYPE_RUNAHEAD) { NetRunAheadCommandMsg *netmsg = (NetRunAheadCommandMsg *)cmdMsg; processRunAheadCommand(netmsg); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command to set run ahead to %d and frame rate to %d on frame %d actually executed on frame %d\n", netmsg->getRunAhead(), netmsg->getFrameRate(), netmsg->getExecutionFrame(), TheGameLogic->getFrame())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command to set run ahead to %d and frame rate to %d on frame %d actually executed on frame %d", netmsg->getRunAhead(), netmsg->getFrameRate(), netmsg->getExecutionFrame(), TheGameLogic->getFrame())); } else if (cmdMsg->getNetCommandType() == NETCOMMANDTYPE_DESTROYPLAYER) { NetDestroyPlayerCommandMsg *netmsg = (NetDestroyPlayerCommandMsg *)cmdMsg; processDestroyPlayerCommand(netmsg); - //DEBUG_LOG(("CRC command (%8.8X) on frame %d actually executed on frame %d\n", netmsg->getCRC(), netmsg->getExecutionFrame(), TheGameLogic->getFrame())); + //DEBUG_LOG(("CRC command (%8.8X) on frame %d actually executed on frame %d", netmsg->getCRC(), netmsg->getExecutionFrame(), TheGameLogic->getFrame())); } } @@ -642,7 +642,7 @@ void Network::processRunAheadCommand(NetRunAheadCommandMsg *msg) { m_frameRate = msg->getFrameRate(); time_t frameGrouping = (1000 * m_runAhead) / m_frameRate; // number of miliseconds between packet sends frameGrouping = frameGrouping / 2; // since we only want the latency for one way to be a factor. -// DEBUG_LOG(("Network::processRunAheadCommand - trying to set frame grouping to %d. run ahead = %d, m_frameRate = %d\n", frameGrouping, m_runAhead, m_frameRate)); +// DEBUG_LOG(("Network::processRunAheadCommand - trying to set frame grouping to %d. run ahead = %d, m_frameRate = %d", frameGrouping, m_runAhead, m_frameRate)); if (frameGrouping < 1) { frameGrouping = 1; // Having a value less than 1 doesn't make sense. } @@ -670,7 +670,7 @@ void Network::processDestroyPlayerCommand(NetDestroyPlayerCommandMsg *msg) TheCommandList->appendMessage(msg); } - DEBUG_LOG(("Saw DestroyPlayer from %d about %d for frame %d on frame %d\n", msg->getPlayerID(), msg->getPlayerIndex(), + DEBUG_LOG(("Saw DestroyPlayer from %d about %d for frame %d on frame %d", msg->getPlayerID(), msg->getPlayerIndex(), msg->getExecutionFrame(), TheGameLogic->getFrame())); } @@ -711,7 +711,7 @@ void Network::update( void ) if (AllCommandsReady(TheGameLogic->getFrame())) { // If all the commands are ready for the next frame... m_conMgr->handleAllCommandsReady(); -// DEBUG_LOG(("Network::update - frame %d is ready\n", TheGameLogic->getFrame())); +// DEBUG_LOG(("Network::update - frame %d is ready", TheGameLogic->getFrame())); if (timeForNewFrame()) { // This needs to come after any other pre-frame execution checks as this changes the timing variables. RelayCommandsToCommandList(TheGameLogic->getFrame()); // Put the commands for the next frame on TheCommandList. m_frameDataReady = TRUE; // Tell the GameEngine to run the commands for the new frame. @@ -743,7 +743,7 @@ void Network::endOfGameCheck() { TheMessageStream->appendMessage(GameMessage::MSG_CLEAR_GAME_DATA); m_localStatus = NETLOCALSTATUS_POSTGAME; - DEBUG_LOG(("Network::endOfGameCheck - about to show the shell\n")); + DEBUG_LOG(("Network::endOfGameCheck - about to show the shell")); } #if defined(RTS_DEBUG) else { @@ -769,31 +769,31 @@ Bool Network::timeForNewFrame() { if (cushion < runAheadPercentage) { // DEBUG_LOG(("Average cushion = %f, run ahead percentage = %f. Adjusting frameDelay from %I64d to ", cushion, runAheadPercentage, frameDelay)); frameDelay += frameDelay / 10; // temporarily decrease the frame rate by 20%. -// DEBUG_LOG(("%I64d\n", frameDelay)); +// DEBUG_LOG(("%I64d", frameDelay)); m_didSelfSlug = TRUE; // } else { -// DEBUG_LOG(("Average cushion = %f, run ahead percentage = %f\n", cushion, runAheadPercentage)); +// DEBUG_LOG(("Average cushion = %f, run ahead percentage = %f", cushion, runAheadPercentage)); } } // Check to see if we can run another frame. if (curTime >= m_nextFrameTime) { -// DEBUG_LOG(("Allowing a new frame, frameDelay = %I64d, curTime - m_nextFrameTime = %I64d\n", frameDelay, curTime - m_nextFrameTime)); +// DEBUG_LOG(("Allowing a new frame, frameDelay = %I64d, curTime - m_nextFrameTime = %I64d", frameDelay, curTime - m_nextFrameTime)); // if (m_nextFrameTime + frameDelay < curTime) { if ((m_nextFrameTime + (2 * frameDelay)) < curTime) { // If we get too far behind on our framerate we need to reset the nextFrameTime thing. m_nextFrameTime = curTime; -// DEBUG_LOG(("Initializing m_nextFrameTime to %I64d\n", m_nextFrameTime)); +// DEBUG_LOG(("Initializing m_nextFrameTime to %I64d", m_nextFrameTime)); } else { // Set the soonest possible starting time for the next frame. m_nextFrameTime += frameDelay; -// DEBUG_LOG(("m_nextFrameTime = %I64d\n", m_nextFrameTime)); +// DEBUG_LOG(("m_nextFrameTime = %I64d", m_nextFrameTime)); } return TRUE; } -// DEBUG_LOG(("Slowing down frame rate. frame rate = %d, frame delay = %I64d, curTime - m_nextFrameTime = %I64d\n", m_frameRate, frameDelay, curTime - m_nextFrameTime)); +// DEBUG_LOG(("Slowing down frame rate. frame rate = %d, frame delay = %I64d, curTime - m_nextFrameTime = %I64d", m_frameRate, frameDelay, curTime - m_nextFrameTime)); return FALSE; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/NetworkUtil.cpp b/Generals/Code/GameEngine/Source/GameNetwork/NetworkUtil.cpp index 32d2eba6b6..3b22b96a1b 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/NetworkUtil.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/NetworkUtil.cpp @@ -36,8 +36,8 @@ Int FRAMES_TO_KEEP = (MAX_FRAMES_AHEAD/2) + 1; void dumpBufferToLog(const void *vBuf, Int len, const char *fname, Int line) { - DEBUG_LOG(("======= dumpBufferToLog() %d bytes =======\n", len)); - DEBUG_LOG(("Source: %s:%d\n", fname, line)); + DEBUG_LOG(("======= dumpBufferToLog() %d bytes =======", len)); + DEBUG_LOG(("Source: %s:%d", fname, line)); const char *buf = (const char *)vBuf; Int numLines = len / 8; if ((len % 8) != 0) @@ -65,9 +65,9 @@ void dumpBufferToLog(const void *vBuf, Int len, const char *fname, Int line) char c = buf[offset + dumpindex2]; DEBUG_LOG(("%c", (isprint(c)?c:'.'))); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } - DEBUG_LOG(("End of packet dump\n")); + DEBUG_LOG(("End of packet dump")); } #endif // DEBUG_LOGGING @@ -83,7 +83,7 @@ UnsignedInt ResolveIP(AsciiString host) if (host.getLength() == 0) { - DEBUG_LOG(("ResolveIP(): Can't resolve NULL\n")); + DEBUG_LOG(("ResolveIP(): Can't resolve NULL")); return 0; } @@ -97,7 +97,7 @@ UnsignedInt ResolveIP(AsciiString host) hostStruct = gethostbyname(host.str()); if (hostStruct == NULL) { - DEBUG_LOG(("ResolveIP(): Can't resolve %s\n", host.str())); + DEBUG_LOG(("ResolveIP(): Can't resolve %s", host.str())); return 0; } hostNode = (struct in_addr *) hostStruct->h_addr; diff --git a/Generals/Code/GameEngine/Source/GameNetwork/Transport.cpp b/Generals/Code/GameEngine/Source/GameNetwork/Transport.cpp index 2599111bb8..dcdf000244 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/Transport.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/Transport.cpp @@ -119,7 +119,7 @@ Bool Transport::init( UnsignedInt ip, UnsignedShort port ) if (retval != 0) { DEBUG_CRASH(("Could not bind to 0x%8.8X:%d\n", ip, port)); - DEBUG_LOG(("Transport::init - Failure to bind socket with error code %x\n", retval)); + DEBUG_LOG(("Transport::init - Failure to bind socket with error code %x", retval)); delete m_udpsock; m_udpsock = NULL; return false; @@ -194,7 +194,7 @@ Bool Transport::update( void ) Bool Transport::doSend() { if (!m_udpsock) { - DEBUG_LOG(("Transport::doSend() - m_udpSock is NULL!\n")); + DEBUG_LOG(("Transport::doSend() - m_udpSock is NULL!")); return FALSE; } @@ -225,22 +225,22 @@ Bool Transport::doSend() { // Send this message if ((bytesSent = m_udpsock->Write((unsigned char *)(&m_outBuffer[i]), bytesToSend, m_outBuffer[i].addr, m_outBuffer[i].port)) > 0) { - //DEBUG_LOG(("Sending %d bytes to %d.%d.%d.%d:%d\n", bytesToSend, PRINTF_IP_AS_4_INTS(m_outBuffer[i].addr), m_outBuffer[i].port)); + //DEBUG_LOG(("Sending %d bytes to %d.%d.%d.%d:%d", bytesToSend, PRINTF_IP_AS_4_INTS(m_outBuffer[i].addr), m_outBuffer[i].port)); m_outgoingPackets[m_statisticsSlot]++; m_outgoingBytes[m_statisticsSlot] += m_outBuffer[i].length + sizeof(TransportMessageHeader); m_outBuffer[i].length = 0; // Remove from queue if (bytesSent != bytesToSend) { - DEBUG_LOG(("Transport::doSend - wanted to send %d bytes, only sent %d bytes to %d.%d.%d.%d:%d\n", + DEBUG_LOG(("Transport::doSend - wanted to send %d bytes, only sent %d bytes to %d.%d.%d.%d:%d", bytesToSend, bytesSent, PRINTF_IP_AS_4_INTS(m_outBuffer[i].addr), m_outBuffer[i].port)); } } else { - //DEBUG_LOG(("Could not write to socket!!! Not discarding message!\n")); + //DEBUG_LOG(("Could not write to socket!!! Not discarding message!")); retval = FALSE; - //DEBUG_LOG(("Transport::doSend returning FALSE\n")); + //DEBUG_LOG(("Transport::doSend returning FALSE")); } } } // for (i=0; iRead(buf, MAX_MESSAGE_LEN, &from)) > 0 ) { #if defined(RTS_DEBUG) @@ -303,27 +303,27 @@ Bool Transport::doRecv() } #endif -// DEBUG_LOG(("Transport::doRecv - Got something! len = %d\n", len)); +// DEBUG_LOG(("Transport::doRecv - Got something! len = %d", len)); // Decrypt the packet // DEBUG_LOG(("buffer = ")); // for (Int munkee = 0; munkee < len; ++munkee) { // DEBUG_LOG(("%02x", *(buf + munkee))); // } -// DEBUG_LOG(("\n")); +// DEBUG_LOG(("")); decryptBuf(buf, len); incomingMessage.length = len - sizeof(TransportMessageHeader); if (len <= sizeof(TransportMessageHeader) || !isGeneralsPacket( &incomingMessage )) { - DEBUG_LOG(("Transport::doRecv - unknownPacket! len = %d\n", len)); + DEBUG_LOG(("Transport::doRecv - unknownPacket! len = %d", len)); m_unknownPackets[m_statisticsSlot]++; m_unknownBytes[m_statisticsSlot] += len; continue; } // Something there; stick it somewhere -// DEBUG_LOG(("Saw %d bytes from %d:%d\n", len, ntohl(from.sin_addr.S_un.S_addr), ntohs(from.sin_port))); +// DEBUG_LOG(("Saw %d bytes from %d:%d", len, ntohl(from.sin_addr.S_un.S_addr), ntohs(from.sin_port))); m_incomingPackets[m_statisticsSlot]++; m_incomingBytes[m_statisticsSlot] += len; @@ -368,7 +368,7 @@ Bool Transport::doRecv() if (len == -1) { // there was a socket error trying to perform a read. - //DEBUG_LOG(("Transport::doRecv returning FALSE\n")); + //DEBUG_LOG(("Transport::doRecv returning FALSE")); retval = FALSE; } @@ -382,7 +382,7 @@ Bool Transport::queueSend(UnsignedInt addr, UnsignedShort port, const UnsignedBy if (len < 1 || len > MAX_PACKET_SIZE) { - DEBUG_LOG(("Transport::queueSend - Invalid Packet size\n")); + DEBUG_LOG(("Transport::queueSend - Invalid Packet size")); return false; } @@ -401,18 +401,18 @@ Bool Transport::queueSend(UnsignedInt addr, UnsignedShort port, const UnsignedBy CRC crc; crc.computeCRC( (unsigned char *)(&(m_outBuffer[i].header.magic)), m_outBuffer[i].length + sizeof(TransportMessageHeader) - sizeof(UnsignedInt) ); -// DEBUG_LOG(("About to assign the CRC for the packet\n")); +// DEBUG_LOG(("About to assign the CRC for the packet")); m_outBuffer[i].header.crc = crc.get(); // Encrypt packet // DEBUG_LOG(("buffer: ")); encryptBuf((unsigned char *)&m_outBuffer[i], len + sizeof(TransportMessageHeader)); -// DEBUG_LOG(("\n")); +// DEBUG_LOG(("")); return true; } } - DEBUG_LOG(("Send Queue is getting full, dropping packets\n")); + DEBUG_LOG(("Send Queue is getting full, dropping packets")); return false; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/WOLBrowser/WebBrowser.cpp b/Generals/Code/GameEngine/Source/GameNetwork/WOLBrowser/WebBrowser.cpp index e81641644e..dac9be9055 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/WOLBrowser/WebBrowser.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/WOLBrowser/WebBrowser.cpp @@ -89,7 +89,7 @@ CComObject * TheWebBrowser = NULL; WebBrowser::WebBrowser() : mRefCount(1) { - DEBUG_LOG(("Instantiating embedded WebBrowser\n")); + DEBUG_LOG(("Instantiating embedded WebBrowser")); m_urlList = NULL; } @@ -112,9 +112,9 @@ WebBrowser::WebBrowser() : WebBrowser::~WebBrowser() { - DEBUG_LOG(("Destructing embedded WebBrowser\n")); + DEBUG_LOG(("Destructing embedded WebBrowser")); if (this == TheWebBrowser) { - DEBUG_LOG(("WebBrowser::~WebBrowser - setting TheWebBrowser to NULL\n")); + DEBUG_LOG(("WebBrowser::~WebBrowser - setting TheWebBrowser to NULL")); TheWebBrowser = NULL; } WebBrowserURL *url = m_urlList; @@ -292,7 +292,7 @@ ULONG STDMETHODCALLTYPE WebBrowser::Release(void) IUNKNOWN_NOEXCEPT if (mRefCount == 0) { - DEBUG_LOG(("WebBrowser::Release - all references released, deleting the object.\n")); + DEBUG_LOG(("WebBrowser::Release - all references released, deleting the object.")); if (this == TheWebBrowser) { TheWebBrowser = NULL; } @@ -305,6 +305,6 @@ ULONG STDMETHODCALLTYPE WebBrowser::Release(void) IUNKNOWN_NOEXCEPT STDMETHODIMP WebBrowser::TestMethod(Int num1) { - DEBUG_LOG(("WebBrowser::TestMethod - num1 = %d\n", num1)); + DEBUG_LOG(("WebBrowser::TestMethod - num1 = %d", num1)); return S_OK; } diff --git a/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp b/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp index da2ac93348..9d6f97bda0 100644 --- a/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp +++ b/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp @@ -441,7 +441,7 @@ void MilesAudioManager::init() { AudioManager::init(); #ifdef INTENSE_DEBUG - DEBUG_LOG(("Sound has temporarily been disabled in debug builds only. jkmcd\n")); + DEBUG_LOG(("Sound has temporarily been disabled in debug builds only. jkmcd")); // for now, RTS_DEBUG builds only should have no sound. ask jkmcd or srj about this. return; #endif @@ -677,7 +677,7 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event ) case AT_Streaming: { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("- Stream\n")); + DEBUG_LOG(("- Stream")); #endif if ((info->m_soundType == AT_Streaming) && event->getUninterruptable()) { @@ -803,14 +803,14 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event ) { m_playing3DSounds.pop_back(); #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" Killed (no handles available)\n")); + DEBUG_LOG((" Killed (no handles available)")); #endif } else { audio = NULL; #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" Playing.\n")); + DEBUG_LOG((" Playing.")); #endif } } @@ -872,7 +872,7 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event ) if (!audio->m_file) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" Killed (no handles available)\n")); + DEBUG_LOG((" Killed (no handles available)")); #endif m_playingSounds.pop_back(); } else { @@ -880,7 +880,7 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event ) } #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" Playing.\n")); + DEBUG_LOG((" Playing.")); #endif } break; @@ -898,7 +898,7 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event ) void MilesAudioManager::stopAudioEvent( AudioHandle handle ) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("MILES (%d) - Processing stop request: %d\n", TheGameLogic->getFrame(), handle)); + DEBUG_LOG(("MILES (%d) - Processing stop request: %d", TheGameLogic->getFrame(), handle)); #endif std::list::iterator it; @@ -961,7 +961,7 @@ void MilesAudioManager::stopAudioEvent( AudioHandle handle ) if (audio->m_audioEventRTS->getPlayingHandle() == handle) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" (%s)\n", audio->m_audioEventRTS->getEventName())); + DEBUG_LOG((" (%s)", audio->m_audioEventRTS->getEventName())); #endif audio->m_requestStop = true; break; diff --git a/Generals/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp b/Generals/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp index a0606c36a7..53dbbcfce1 100644 --- a/Generals/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp +++ b/Generals/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp @@ -205,10 +205,10 @@ VideoStreamInterface* BinkVideoPlayer::createStream( HBINK handle ) // never let volume go to 0, as Bink will interpret that as "play at full volume". Int mod = (Int) ((TheAudio->getVolume(AudioAffect_Speech) * 0.8f) * 100) + 1; Int volume = (32768*mod)/100; - DEBUG_LOG(("BinkVideoPlayer::createStream() - About to set volume (%g -> %d -> %d\n", + DEBUG_LOG(("BinkVideoPlayer::createStream() - About to set volume (%g -> %d -> %d", TheAudio->getVolume(AudioAffect_Speech), mod, volume)); BinkSetVolume( stream->m_handle,0, volume); - DEBUG_LOG(("BinkVideoPlayer::createStream() - set volume\n")); + DEBUG_LOG(("BinkVideoPlayer::createStream() - set volume")); } return stream; @@ -224,7 +224,7 @@ VideoStreamInterface* BinkVideoPlayer::open( AsciiString movieTitle ) const Video* pVideo = getVideo(movieTitle); if (pVideo) { - DEBUG_LOG(("BinkVideoPlayer::createStream() - About to open bink file\n")); + DEBUG_LOG(("BinkVideoPlayer::createStream() - About to open bink file")); if (TheGlobalData->m_modDir.isNotEmpty()) { @@ -250,7 +250,7 @@ VideoStreamInterface* BinkVideoPlayer::open( AsciiString movieTitle ) DEBUG_ASSERTLOG(!handle, ("opened bink file %s\n", localizedFilePath)); } - DEBUG_LOG(("BinkVideoPlayer::createStream() - About to create stream\n")); + DEBUG_LOG(("BinkVideoPlayer::createStream() - About to create stream")); stream = createStream( handle ); } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDependencyModelDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDependencyModelDraw.cpp index 7baa8b0da8..ef7e642782 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDependencyModelDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDependencyModelDraw.cpp @@ -123,7 +123,7 @@ void W3DDependencyModelDraw::adjustTransformMtx(Matrix3D& mtx) const } else { - DEBUG_LOG(("m_attachToDrawableBoneInContainer %s not found\n",getW3DDependencyModelDrawModuleData()->m_attachToDrawableBoneInContainer.str())); + DEBUG_LOG(("m_attachToDrawableBoneInContainer %s not found",getW3DDependencyModelDrawModuleData()->m_attachToDrawableBoneInContainer.str())); } } } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index ea3f381eef..657f59b83b 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -501,7 +501,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, if (findSingleBone(robj, boneNameTmp, info.mtx, info.boneIndex)) { -//DEBUG_LOG(("added bone %s\n",boneNameTmp.str())); +//DEBUG_LOG(("added bone %s",boneNameTmp.str())); BONEPOS_LOG(("Caching bone %s (index %d)\n", boneNameTmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); @@ -514,7 +514,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, tmp.format("%s%02d", boneNameTmp.str(), i); if (findSingleBone(robj, tmp, info.mtx, info.boneIndex)) { -//DEBUG_LOG(("added bone %s\n",tmp.str())); +//DEBUG_LOG(("added bone %s",tmp.str())); BONEPOS_LOG(("Caching bone %s (index %d)\n", tmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(tmp)] = info; @@ -530,7 +530,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, { if (findSingleSubObj(robj, boneNameTmp, info.mtx, info.boneIndex)) { -//DEBUG_LOG(("added subobj %s\n",boneNameTmp.str())); +//DEBUG_LOG(("added subobj %s",boneNameTmp.str())); BONEPOS_LOG(("Caching bone from subobject %s (index %d)\n", boneNameTmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(boneNameTmp)] = info; @@ -542,7 +542,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, tmp.format("%s%02d", boneNameTmp.str(), i); if (findSingleSubObj(robj, tmp, info.mtx, info.boneIndex)) { -//DEBUG_LOG(("added subobj %s\n",tmp.str())); +//DEBUG_LOG(("added subobj %s",tmp.str())); BONEPOS_LOG(("Caching bone from subobject %s (index %d)\n", tmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(tmp)] = info; @@ -675,7 +675,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c } //else //{ - // DEBUG_LOG(("global bone %s (or variations thereof) found in model %s\n",it->str(),m_modelName.str())); + // DEBUG_LOG(("global bone %s (or variations thereof) found in model %s",it->str(),m_modelName.str())); //} } } @@ -688,7 +688,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c } //else //{ - // DEBUG_LOG(("extra bone %s (or variations thereof) found in model %s\n",it->str(),m_modelName.str())); + // DEBUG_LOG(("extra bone %s (or variations thereof) found in model %s",it->str(),m_modelName.str())); //} } @@ -772,7 +772,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const if (info.m_fxBone == 0 && info.m_recoilBone == 0 && info.m_muzzleFlashBone == 0 && plbBoneIndex == 0) break; - CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s wslot %d\n", m_modelName.str(), wslot)); + CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s wslot %d", m_modelName.str(), wslot)); DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s wslot %d\n", m_modelName.str(), wslot)); BONEPOS_DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); @@ -810,7 +810,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const if (info.m_fxBone != 0 || info.m_recoilBone != 0 || info.m_muzzleFlashBone != 0 || plbMtx != NULL) { - CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) wslot %d\n", m_modelName.str(), wslot)); + CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) wslot %d", m_modelName.str(), wslot)); DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) wslot %d\n", m_modelName.str(), wslot)); BONEPOS_DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); @@ -820,7 +820,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const } else { - CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) found nothing\n", m_modelName.str())); + CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) found nothing", m_modelName.str())); BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) found nothing\n", m_modelName.str())); } } // if empty @@ -1441,7 +1441,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void // note, this is size(), not size()-1, since we haven't actually modified the list yet self->m_defaultState = self->m_conditionStates.size(); - //DEBUG_LOG(("set default state to %d\n",self->m_defaultState)); + //DEBUG_LOG(("set default state to %d",self->m_defaultState)); // add an empty conditionstateflag set ModelConditionFlags blankConditions; @@ -1975,7 +1975,7 @@ void W3DModelDraw::adjustTransformMtx(Matrix3D& mtx) const } else { - DEBUG_LOG(("m_attachToDrawableBone %s not found\n",getW3DModelDrawModuleData()->m_attachToDrawableBone.str())); + DEBUG_LOG(("m_attachToDrawableBone %s not found",getW3DModelDrawModuleData()->m_attachToDrawableBone.str())); } } #endif @@ -2016,7 +2016,7 @@ void W3DModelDraw::doDrawModule(const Matrix3D* transformMtx) { if (m_curState != NULL && m_nextState != NULL) { - //DEBUG_LOG(("transition %s is complete\n",m_curState->m_description.str())); + //DEBUG_LOG(("transition %s is complete",m_curState->m_description.str())); const ModelConditionInfo* nextState = m_nextState; UnsignedInt nextDuration = m_nextStateAnimLoopDuration; m_nextState = NULL; @@ -2024,7 +2024,7 @@ void W3DModelDraw::doDrawModule(const Matrix3D* transformMtx) setModelState(nextState); if (nextDuration != NO_NEXT_DURATION) { - //DEBUG_LOG(("restoring pending duration of %d frames\n",nextDuration)); + //DEBUG_LOG(("restoring pending duration of %d frames",nextDuration)); setAnimationLoopDuration(nextDuration); } } @@ -2035,7 +2035,7 @@ void W3DModelDraw::doDrawModule(const Matrix3D* transformMtx) { if (m_curState->m_animations[m_whichAnimInCurState].isIdleAnim()) { - //DEBUG_LOG(("randomly switching to new idle state!\n")); + //DEBUG_LOG(("randomly switching to new idle state!")); // state hasn't changed, if it's been awhile, switch the idle anim // (yes, that's right: pass curState for prevState) @@ -2466,7 +2466,7 @@ void W3DModelDraw::handleClientRecoil() if (barrels[i].m_muzzleFlashBone != 0) { Bool hidden = recoils[i].m_state != WeaponRecoilInfo::RECOIL_START; - //DEBUG_LOG(("adjust muzzleflash %08lx for Draw %08lx state %s to %d at frame %d\n",subObjToHide,this,m_curState->m_description.str(),hidden?1:0,TheGameLogic->getFrame())); + //DEBUG_LOG(("adjust muzzleflash %08lx for Draw %08lx state %s to %d at frame %d",subObjToHide,this,m_curState->m_description.str(),hidden?1:0,TheGameLogic->getFrame())); barrels[i].setMuzzleFlashHidden(m_renderObject, hidden); } @@ -2518,7 +2518,7 @@ void W3DModelDraw::handleClientRecoil() else { recoils[i].m_state = WeaponRecoilInfo::IDLE; - //DEBUG_LOG(("reset Draw %08lx state %08lx\n",this,m_curState)); + //DEBUG_LOG(("reset Draw %08lx state %08lx",this,m_curState)); } } } @@ -2855,7 +2855,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) #ifdef DEBUG_OBJECT_ID_EXISTS if (getDrawable() && getDrawable()->getObject() && getDrawable()->getObject()->getID() == TheObjectIDToDebug) { - DEBUG_LOG(("REQUEST switching to state %s for obj %s %d\n",newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); + DEBUG_LOG(("REQUEST switching to state %s for obj %s %d",newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); } #endif const ModelConditionInfo* nextState = NULL; @@ -2886,7 +2886,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) #ifdef DEBUG_OBJECT_ID_EXISTS if (getDrawable() && getDrawable()->getObject() && getDrawable()->getObject()->getID() == TheObjectIDToDebug) { - DEBUG_LOG(("IGNORE duplicate state %s for obj %s %d\n",newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); + DEBUG_LOG(("IGNORE duplicate state %s for obj %s %d",newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); } #endif // I don't think he'll be interested... @@ -2903,7 +2903,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) #ifdef DEBUG_OBJECT_ID_EXISTS if (getDrawable() && getDrawable()->getObject() && getDrawable()->getObject()->getID() == TheObjectIDToDebug) { - DEBUG_LOG(("ALLOW_TO_FINISH state %s for obj %s %d\n",newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); + DEBUG_LOG(("ALLOW_TO_FINISH state %s for obj %s %d",newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); } #endif m_nextState = newState; @@ -2922,7 +2922,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) #ifdef DEBUG_OBJECT_ID_EXISTS if (getDrawable() && getDrawable()->getObject() && getDrawable()->getObject()->getID() == TheObjectIDToDebug) { - DEBUG_LOG(("using TRANSITION state %s before requested state %s for obj %s %d\n",transState->m_description.str(),newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); + DEBUG_LOG(("using TRANSITION state %s before requested state %s for obj %s %d",transState->m_description.str(),newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); } #endif nextState = newState; @@ -3210,12 +3210,12 @@ Bool W3DModelDraw::getProjectileLaunchOffset( const ModelConditionInfo* stateToUse = findBestInfo(condition); if (!stateToUse) { - CRCDEBUG_LOG(("can't find best info\n")); + CRCDEBUG_LOG(("can't find best info")); //BONEPOS_LOG(("can't find best info\n")); return false; } #if defined(RTS_DEBUG) - CRCDEBUG_LOG(("W3DModelDraw::getProjectileLaunchOffset() for %s\n", + CRCDEBUG_LOG(("W3DModelDraw::getProjectileLaunchOffset() for %s", stateToUse->getDescription().str())); #endif @@ -3233,7 +3233,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( #endif // INTENSE_DEBUG const W3DModelDrawModuleData* d = getW3DModelDrawModuleData(); - //CRCDEBUG_LOG(("validateStuffs() from within W3DModelDraw::getProjectileLaunchOffset()\n")); + //CRCDEBUG_LOG(("validateStuffs() from within W3DModelDraw::getProjectileLaunchOffset()")); //DUMPREAL(getDrawable()->getScale()); //BONEPOS_LOG(("validateStuffs() from within W3DModelDraw::getProjectileLaunchOffset()\n")); //BONEPOS_DUMPREAL(getDrawable()->getScale()); @@ -3260,12 +3260,12 @@ Bool W3DModelDraw::getProjectileLaunchOffset( } #endif - CRCDEBUG_LOG(("wslot = %d\n", wslot)); + CRCDEBUG_LOG(("wslot = %d", wslot)); const ModelConditionInfo::WeaponBarrelInfoVec& wbvec = stateToUse->m_weaponBarrelInfoVec[wslot]; if( wbvec.empty() ) { // Can't find the launch pos, but they might still want the other info they asked for - CRCDEBUG_LOG(("empty wbvec\n")); + CRCDEBUG_LOG(("empty wbvec")); //BONEPOS_LOG(("empty wbvec\n")); launchPos = NULL; } @@ -3276,7 +3276,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( if (launchPos) { - CRCDEBUG_LOG(("specificBarrelToUse = %d\n", specificBarrelToUse)); + CRCDEBUG_LOG(("specificBarrelToUse = %d", specificBarrelToUse)); *launchPos = wbvec[specificBarrelToUse].m_projectileOffsetMtx; if (tur != TURRET_INVALID) @@ -3362,9 +3362,9 @@ Int W3DModelDraw::getPristineBonePositionsForConditionState( // if (isValidTimeToCalcLogicStuff()) // { -// CRCDEBUG_LOG(("W3DModelDraw::getPristineBonePositionsForConditionState() - state = '%s'\n", +// CRCDEBUG_LOG(("W3DModelDraw::getPristineBonePositionsForConditionState() - state = '%s'", // stateToUse->getDescription().str())); -// //CRCDEBUG_LOG(("renderObject == NULL: %d\n", (stateToUse==m_curState)?(m_renderObject == NULL):1)); +// //CRCDEBUG_LOG(("renderObject == NULL: %d", (stateToUse==m_curState)?(m_renderObject == NULL):1)); // } //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::getPristineBonePositionsForConditionState()\n")); @@ -3445,7 +3445,7 @@ Int W3DModelDraw::getPristineBonePositionsForConditionState( // if (isValidTimeToCalcLogicStuff()) // { -// CRCDEBUG_LOG(("end of W3DModelDraw::getPristineBonePositionsForConditionState()\n")); +// CRCDEBUG_LOG(("end of W3DModelDraw::getPristineBonePositionsForConditionState()")); // } return posCount; @@ -3652,13 +3652,13 @@ Bool W3DModelDraw::handleWeaponFireFX(WeaponSlotType wslot, Int specificBarrelTo } else { - DEBUG_LOG(("*** no FXBone found for a non-null FXL\n")); + DEBUG_LOG(("*** no FXBone found for a non-null FXL")); } } if (info.m_recoilBone || info.m_muzzleFlashBone) { - //DEBUG_LOG(("START muzzleflash %08lx for Draw %08lx state %s at frame %d\n",info.m_muzzleFlashBone,this,m_curState->m_description.str(),TheGameLogic->getFrame())); + //DEBUG_LOG(("START muzzleflash %08lx for Draw %08lx state %s at frame %d",info.m_muzzleFlashBone,this,m_curState->m_description.str(),TheGameLogic->getFrame())); WeaponRecoilInfo& recoil = m_weaponRecoilInfoVec[wslot][specificBarrelToUse]; recoil.m_state = WeaponRecoilInfo::RECOIL_START; recoil.m_recoilRate = getW3DModelDrawModuleData()->m_initialRecoil; @@ -3677,7 +3677,7 @@ void W3DModelDraw::setAnimationLoopDuration(UnsignedInt numFrames) if (m_curState != NULL && m_curState->m_transition != NO_TRANSITION && m_nextState != NULL && m_nextState->m_transition == NO_TRANSITION) { - DEBUG_LOG(("deferring pending duration of %d frames\n",numFrames)); + DEBUG_LOG(("deferring pending duration of %d frames",numFrames)); m_nextStateAnimLoopDuration = numFrames; return; } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp index 95e1fa16e4..925c282f28 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp @@ -244,7 +244,7 @@ void W3DTankTruckDraw::createEmitters( void ) m_dustEffect->setSaveable(FALSE); } else { if (!getW3DTankTruckDrawModuleData()->m_dustEffectName.isEmpty()) { - DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'\n", + DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'", getW3DTankTruckDrawModuleData()->m_dustEffectName.str(), getDrawable()->getObject()->getTemplate()->getName().str())); } } @@ -260,7 +260,7 @@ void W3DTankTruckDraw::createEmitters( void ) m_dirtEffect->setSaveable(FALSE); } else { if (!getW3DTankTruckDrawModuleData()->m_dirtEffectName.isEmpty()) { - DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'\n", + DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'", getW3DTankTruckDrawModuleData()->m_dirtEffectName.str(), getDrawable()->getObject()->getTemplate()->getName().str())); } } @@ -275,7 +275,7 @@ void W3DTankTruckDraw::createEmitters( void ) m_powerslideEffect->setSaveable(FALSE); } else { if (!getW3DTankTruckDrawModuleData()->m_powerslideEffectName.isEmpty()) { - DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'\n", + DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'", getW3DTankTruckDrawModuleData()->m_powerslideEffectName.str(), getDrawable()->getObject()->getTemplate()->getName().str())); } } @@ -488,7 +488,7 @@ void W3DTankTruckDraw::updateTreadObjects(void) //------------------------------------------------------------------------------------------------- void W3DTankTruckDraw::onRenderObjRecreated(void) { - //DEBUG_LOG(("Old obj %x, newObj %x, new bones %d, old bones %d\n", + //DEBUG_LOG(("Old obj %x, newObj %x, new bones %d, old bones %d", // m_prevRenderObj, getRenderObject(), getRenderObject()->Get_Num_Bones(), // m_prevNumBones)); m_prevRenderObj = NULL; @@ -623,7 +623,7 @@ void W3DTankTruckDraw::doDrawModule(const Matrix3D* transformMtx) Coord3D accel = *physics->getAcceleration(); accel.z = 0; // ignore gravitational force. Bool accelerating = accel.length()>ACCEL_THRESHOLD; - //DEBUG_LOG(("Accel %f, speed %f\n", accel.length(), speed)); + //DEBUG_LOG(("Accel %f, speed %f", accel.length(), speed)); if (accelerating) { Real dot = accel.x*vel->x + accel.y*vel->y; if (dot<0) { diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp index 1647432f8f..a35c0f232f 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp @@ -185,7 +185,7 @@ void W3DTruckDraw::createEmitters( void ) m_dustEffect->setSaveable(FALSE); } else { if (!getW3DTruckDrawModuleData()->m_dustEffectName.isEmpty()) { - DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'\n", + DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'", getW3DTruckDrawModuleData()->m_dustEffectName.str(), getDrawable()->getObject()->getTemplate()->getName().str())); } } @@ -201,7 +201,7 @@ void W3DTruckDraw::createEmitters( void ) m_dirtEffect->setSaveable(FALSE); } else { if (!getW3DTruckDrawModuleData()->m_dirtEffectName.isEmpty()) { - DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'\n", + DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'", getW3DTruckDrawModuleData()->m_dirtEffectName.str(), getDrawable()->getObject()->getTemplate()->getName().str())); } } @@ -216,7 +216,7 @@ void W3DTruckDraw::createEmitters( void ) m_powerslideEffect->setSaveable(FALSE); } else { if (!getW3DTruckDrawModuleData()->m_powerslideEffectName.isEmpty()) { - DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'\n", + DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'", getW3DTruckDrawModuleData()->m_powerslideEffectName.str(), getDrawable()->getObject()->getTemplate()->getName().str())); } } @@ -361,7 +361,7 @@ void W3DTruckDraw::setHidden(Bool h) //------------------------------------------------------------------------------------------------- void W3DTruckDraw::onRenderObjRecreated(void) { - //DEBUG_LOG(("Old obj %x, newObj %x, new bones %d, old bones %d\n", + //DEBUG_LOG(("Old obj %x, newObj %x, new bones %d, old bones %d", // m_prevRenderObj, getRenderObject(), getRenderObject()->Get_Num_Bones(), // m_prevNumBones)); m_prevRenderObj = NULL; @@ -405,7 +405,7 @@ void W3DTruckDraw::doDrawModule(const Matrix3D* transformMtx) if (getRenderObject()==NULL) return; if (getRenderObject() != m_prevRenderObj) { - DEBUG_LOG(("W3DTruckDraw::doDrawModule - shouldn't update bones. jba\n")); + DEBUG_LOG(("W3DTruckDraw::doDrawModule - shouldn't update bones. jba")); updateBones(); } @@ -577,7 +577,7 @@ void W3DTruckDraw::doDrawModule(const Matrix3D* transformMtx) Coord3D accel = *physics->getAcceleration(); accel.z = 0; // ignore gravitational force. Bool accelerating = accel.length()>ACCEL_THRESHOLD; - //DEBUG_LOG(("Accel %f, speed %f\n", accel.length(), speed)); + //DEBUG_LOG(("Accel %f, speed %f", accel.length(), speed)); if (accelerating) { Real dot = accel.x*vel->x + accel.y*vel->y; if (dot<0) { diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp index d45fe88250..90faaf1f89 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp @@ -91,7 +91,7 @@ Bool W3DFontLibrary::loadFontData( GameFont *font ) if( fontChar == NULL ) { - DEBUG_LOG(( "W3D load font: unable to find font '%s' from asset manager\n", + DEBUG_LOG(( "W3D load font: unable to find font '%s' from asset manager", font->nameString.str() )); DEBUG_ASSERTCRASH(fontChar, ("Missing or Corrupted Font. Pleas see log for details")); return FALSE; diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp index 40aaabac13..6f839204dc 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp @@ -969,7 +969,7 @@ void W3DShadowGeometryMesh::buildPolygonNeighbors( void ) pv[0] /= 3.0f; //find center of polygon // sprintf(errorText,"%s: Shadow Polygon with too many neighbors at %f,%f,%f",m_parentGeometry->Get_Name(),pv[0].X,pv[0].Y,pv[0].Z); -// DEBUG_LOG(("****%s Shadow Polygon with too many neighbors at %f,%f,%f\n",m_parentGeometry->Get_Name(),pv[0].X,pv[0].Y,pv[0].Z)); +// DEBUG_LOG(("****%s Shadow Polygon with too many neighbors at %f,%f,%f",m_parentGeometry->Get_Name(),pv[0].X,pv[0].Y,pv[0].Z)); // DEBUG_ASSERTCRASH(a != MAX_POLYGON_NEIGHBORS,(errorText)); } @@ -3888,7 +3888,7 @@ int W3DShadowGeometryManager::Load_Geom(RenderObjClass *robj, const char *name) if (res != TRUE) { // load failed! newgeom->Release_Ref(); - //DEBUG_LOG(("****Shadow Volume Creation Failed on %s\n",name)); + //DEBUG_LOG(("****Shadow Volume Creation Failed on %s",name)); goto Error; } else if (Peek_Geom(newgeom->Get_Name()) != NULL) { // duplicate exists! diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp index 6abf20269e..484d371ba1 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp @@ -1126,7 +1126,7 @@ void W3DAssetManager::Report_Used_Prototypes(void) PrototypeClass * proto = Prototypes[count]; if (proto->Get_Class_ID() == RenderObjClass::CLASSID_HLOD || proto->Get_Class_ID() == RenderObjClass::CLASSID_MESH) { - DEBUG_LOG(("**Unfreed Prototype On Map Reset: %s\n",proto->Get_Name())); + DEBUG_LOG(("**Unfreed Prototype On Map Reset: %s",proto->Get_Name())); } } } @@ -1156,7 +1156,7 @@ void W3DAssetManager::Report_Used_FontChars(void) { if (FontCharsList[count]->Num_Refs() >= 1) { - DEBUG_LOG(("**Unfreed FontChar On Map Reset: %s\n",FontCharsList[count]->Get_Name())); + DEBUG_LOG(("**Unfreed FontChar On Map Reset: %s",FontCharsList[count]->Get_Name())); //FontCharsList[count]->Release_Ref(); //FontCharsList.Delete(count); } @@ -1192,7 +1192,7 @@ void W3DAssetManager::Report_Used_Textures(void) } else { - DEBUG_LOG(("**Texture \"%s\" referenced %d times on map reset\n",tex->Get_Texture_Name().str(),tex->Num_Refs()-1)); + DEBUG_LOG(("**Texture \"%s\" referenced %d times on map reset",tex->Get_Texture_Name().str(),tex->Num_Refs()-1)); } } /* for (unsigned i=0;iName)); + DEBUG_LOG(("**Unfreed Font3DDatas On Map Reset: %s",font->Name)); } } } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp index 9ed1158049..35a719578b 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp @@ -267,7 +267,7 @@ Bool W3DBridge::load(BodyDamageType curDamageState) strcpy(right, pSub->Get_Name()); } REF_PTR_RELEASE(pSub); - //DEBUG_LOG(("Sub obj name %s\n", pSub->Get_Name())); + //DEBUG_LOG(("Sub obj name %s", pSub->Get_Name())); } REF_PTR_RELEASE(pObj); @@ -811,7 +811,7 @@ void W3DBridgeBuffer::loadBridges(W3DTerrainLogic *pTerrainLogic, Bool saveGame) if (pMapObj->getFlag(FLAG_BRIDGE_POINT1)) { pMapObj2 = pMapObj->getNext(); if ( !pMapObj2 || !pMapObj2->getFlag(FLAG_BRIDGE_POINT2)) { - DEBUG_LOG(("Missing second bridge point. Ignoring first.\n")); + DEBUG_LOG(("Missing second bridge point. Ignoring first.")); } if (pMapObj2==NULL) break; if (!pMapObj2->getFlag(FLAG_BRIDGE_POINT2)) continue; @@ -984,7 +984,7 @@ void W3DBridgeBuffer::worldBuilderUpdateBridgeTowers( W3DAssetManager *assetMana pMapObj2 = pMapObj->getNext(); if( !pMapObj2 || !pMapObj2->getFlag( FLAG_BRIDGE_POINT2 ) ) - DEBUG_LOG(("Missing second bridge point. Ignoring first.\n")); + DEBUG_LOG(("Missing second bridge point. Ignoring first.")); if( pMapObj2 == NULL ) break; diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDebugIcons.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDebugIcons.cpp index 7125f97952..509be0540b 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDebugIcons.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDebugIcons.cpp @@ -187,7 +187,7 @@ void W3DDebugIcons::addIcon(const Coord3D *pos, Real width, Int numFramesDuratio { if (pos==NULL) { if (m_numDebugIcons > maxIcons) { - DEBUG_LOG(("Max icons %d\n", m_numDebugIcons)); + DEBUG_LOG(("Max icons %d", m_numDebugIcons)); maxIcons = m_numDebugIcons; } m_numDebugIcons = 0; diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp index 3a8ed72575..a385436e67 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp @@ -1914,7 +1914,7 @@ void W3DDisplay::draw( void ) if (couldRender) { couldRender = false; - DEBUG_LOG(("Could not do WW3D::Begin_Render()! Are we ALT-Tabbed out?\n")); + DEBUG_LOG(("Could not do WW3D::Begin_Render()! Are we ALT-Tabbed out?")); } } } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp index 6d3c134ecd..9dcf23c826 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp @@ -116,7 +116,7 @@ DisplayString *W3DDisplayStringManager::newDisplayString( void ) if( newString == NULL ) { - DEBUG_LOG(( "newDisplayString: Could not allcoate new W3D display string\n" )); + DEBUG_LOG(( "newDisplayString: Could not allcoate new W3D display string" )); assert( 0 ); return NULL; diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp index d84bf83e67..02b32aa584 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp @@ -1342,7 +1342,7 @@ void W3DRoadBuffer::moveRoadSegTo(Int fromNdx, Int toNdx) { if (fromNdx<0 || fromNdx>=m_numRoads || toNdx<0 || toNdx>=m_numRoads) { #ifdef RTS_DEBUG - DEBUG_LOG(("bad moveRoadSegTo\n")); + DEBUG_LOG(("bad moveRoadSegTo")); #endif return; } @@ -1470,7 +1470,7 @@ void W3DRoadBuffer::checkLinkAfter(Int ndx) } static Bool warnSegments = true; -#define CHECK_SEGMENTS {if (m_numRoads >= m_maxRoadSegments) { if (warnSegments) DEBUG_LOG(("****** Too many road segments. Need to increase ini values. See john a.\n")); warnSegments = false; return;}} +#define CHECK_SEGMENTS {if (m_numRoads >= m_maxRoadSegments) { if (warnSegments) DEBUG_LOG(("****** Too many road segments. Need to increase ini values. See john a.")); warnSegments = false; return;}} //============================================================================= // W3DRoadBuffer::addMapObject diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp index 6990205eec..e54c1553f6 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp @@ -2413,7 +2413,7 @@ void W3DShaderManager::init(void) } } - DEBUG_LOG(("ShaderManager ChipsetID %d\n", res)); + DEBUG_LOG(("ShaderManager ChipsetID %d", res)); } // W3DShaderManager::shutdown ======================================================= diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp index 01ac84bb1d..72de7ca3d0 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp @@ -561,7 +561,7 @@ W3DTreeBuffer::W3DTreeBuffer(void) } if (m_typeMesh[0] == NULL) { - //DEBUG_LOG("!!!!!!!!!!!!*************** W3DTreeBuffer failed to initialize.\n"); + //DEBUG_LOG("!!!!!!!!!!!!*************** W3DTreeBuffer failed to initialize."); return; // didn't initialize. } m_initialized = true; diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index c4445e49c4..911ef313dd 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -335,7 +335,7 @@ void W3DView::calcCameraConstraints() { // const Matrix3D& cameraTransform = m_3DCamera->Get_Transform(); -// DEBUG_LOG(("*** rebuilding cam constraints\n")); +// DEBUG_LOG(("*** rebuilding cam constraints")); // ok, now check to ensure that we can't see outside the map region, // and twiddle the camera if needed @@ -1184,7 +1184,7 @@ void W3DView::update(void) { // if we are in a scripted camera movement, take its height above ground as our desired height. m_heightAboveGround = m_currentHeightAboveGround; - //DEBUG_LOG(("Frame %d: height above ground: %g %g %g %g\n", TheGameLogic->getFrame(), m_heightAboveGround, + //DEBUG_LOG(("Frame %d: height above ground: %g %g %g %g", TheGameLogic->getFrame(), m_heightAboveGround, // m_cameraOffset.z, m_zoom, m_terrainHeightUnderCamera)); } if (TheInGameUI->isScrolling()) @@ -1207,7 +1207,7 @@ void W3DView::update(void) Real zoomAdjAbs = fabs(zoomAdj); if (zoomAdjAbs >= 0.0001 && !didScriptedMovement) { - //DEBUG_LOG(("W3DView::update() - m_zoom=%g, desiredHeight=%g\n", m_zoom, desiredZoom)); + //DEBUG_LOG(("W3DView::update() - m_zoom=%g, desiredHeight=%g", m_zoom, desiredZoom)); m_zoom -= zoomAdj; recalcCamera = true; } @@ -1666,7 +1666,7 @@ void W3DView::scrollBy( Coord2D *delta ) Coord3D pos = *getPosition(); pos.x += world.X; pos.y += world.Y; - //DEBUG_LOG(("Delta %.2f, %.2f\n", world.X, world.Z)); + //DEBUG_LOG(("Delta %.2f, %.2f", world.X, world.Z)); // no change to z setPosition(&pos); @@ -1815,7 +1815,7 @@ void W3DView::setZoomToDefault( void ) Real desiredZoom = desiredHeight / m_cameraOffset.z; m_mcwpInfo.cameraZoom[2] = desiredZoom;//m_maxZoom; - DEBUG_LOG(("W3DView::setZoomToDefault() Current zoom: %g Desired zoom: %g\n", m_zoom, desiredZoom)); + DEBUG_LOG(("W3DView::setZoomToDefault() Current zoom: %g Desired zoom: %g", m_zoom, desiredZoom)); m_zoom = desiredZoom; m_heightAboveGround = m_maxHeightAboveGround; @@ -2613,7 +2613,7 @@ void W3DView::resetCamera(const Coord3D *location, Int milliseconds) zoomCamera( desiredZoom, milliseconds ); // this isn't right... or is it? pitchCamera( 1.0, milliseconds ); - DEBUG_LOG(("W3DView::resetCamera() Current zoom: %g Desired zoom: %g Current pitch: %g Desired pitch: %g\n", + DEBUG_LOG(("W3DView::resetCamera() Current zoom: %g Desired zoom: %g Current pitch: %g Desired pitch: %g", m_zoom, desiredZoom, m_pitchAngle, m_defaultPitchAngle)); } @@ -2701,7 +2701,7 @@ void W3DView::setupWaypointPath(Bool orient) angle -= PI/2; normAngle(angle); } - //DEBUG_LOG(("Original Index %d, angle %.2f\n", i, angle*180/PI)); + //DEBUG_LOG(("Original Index %d, angle %.2f", i, angle*180/PI)); m_mcwpInfo.cameraAngle[i] = angle; } m_mcwpInfo.cameraAngle[1] = getAngle(); @@ -2725,7 +2725,7 @@ void W3DView::setupWaypointPath(Bool orient) m_mcwpInfo.timeMultiplier[i] = m_timeMultiplier; m_mcwpInfo.groundHeight[i] = m_groundLevel*factor1 + newGround*factor2; curDistance += m_mcwpInfo.waySegLength[i]; - //DEBUG_LOG(("New Index %d, angle %.2f\n", i, m_mcwpInfo.cameraAngle[i]*180/PI)); + //DEBUG_LOG(("New Index %d, angle %.2f", i, m_mcwpInfo.cameraAngle[i]*180/PI)); } // Pad the end. @@ -2819,7 +2819,7 @@ void W3DView::rotateCameraOneFrame(void) //m_zoom = m_rcInfo.startZoom + (m_rcInfo.endZoom-m_rcInfo.startZoom)*factor; //m_FXPitch = m_rcInfo.startPitch + (m_rcInfo.endPitch-m_rcInfo.startPitch)*factor; normAngle(m_angle); - //DEBUG_LOG(("\tm_angle:%g\n", m_angle)); + //DEBUG_LOG(("\tm_angle:%g", m_angle)); m_timeMultiplier = m_rcInfo.startTimeMultiplier + REAL_TO_INT_FLOOR(0.5 + (m_rcInfo.endTimeMultiplier-m_rcInfo.startTimeMultiplier)*factor); } else if (m_rcInfo.curFrame <= m_rcInfo.numFrames + m_rcInfo.numHoldFrames && m_rcInfo.trackObject) @@ -2878,7 +2878,7 @@ void W3DView::zoomCameraOneFrame(void) m_zoom = m_zcInfo.endZoom; } - //DEBUG_LOG(("W3DView::zoomCameraOneFrame() - m_zoom = %g\n", m_zoom)); + //DEBUG_LOG(("W3DView::zoomCameraOneFrame() - m_zoom = %g", m_zoom)); } // ------------------------------------------------------------------------------------------------ @@ -2978,7 +2978,7 @@ void W3DView::moveAlongWaypointPath(Int milliseconds) Real deltaAngle = angle-m_angle; normAngle(deltaAngle); if (fabs(deltaAngle) > PI/10) { - DEBUG_LOG(("Huh.\n")); + DEBUG_LOG(("Huh.")); } m_angle += avgFactor*(deltaAngle); normAngle(m_angle); @@ -3040,7 +3040,7 @@ void W3DView::moveAlongWaypointPath(Int milliseconds) result.z = 0; /* static Real prevGround = 0; - DEBUG_LOG(("Dx %.2f, dy %.2f, DeltaANgle = %.2f, %.2f DeltaGround %.2f\n", m_pos.x-result.x, m_pos.y-result.y, deltaAngle, m_groundLevel, m_groundLevel-prevGround)); + DEBUG_LOG(("Dx %.2f, dy %.2f, DeltaANgle = %.2f, %.2f DeltaGround %.2f", m_pos.x-result.x, m_pos.y-result.y, deltaAngle, m_groundLevel, m_groundLevel-prevGround)); prevGround = m_groundLevel; */ setPosition(&result); diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DWebBrowser.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DWebBrowser.cpp index 24934f9d22..8c9d614c55 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DWebBrowser.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DWebBrowser.cpp @@ -53,7 +53,7 @@ Bool W3DWebBrowser::createBrowserWindow(const char *tag, GameWindow *win) WebBrowserURL *url = findURL( AsciiString(tag) ); if (url == NULL) { - DEBUG_LOG(("W3DWebBrowser::createBrowserWindow - couldn't find URL for page %s\n", tag)); + DEBUG_LOG(("W3DWebBrowser::createBrowserWindow - couldn't find URL for page %s", tag)); return FALSE; } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp index ead813f657..c7ff411951 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp @@ -1085,7 +1085,7 @@ Bool WorldHeightMap::ParseObjectData(DataChunkInput &file, DataChunkInfo *info, } if (loc.zmaxZ) { - DEBUG_LOG(("Removing object at z height %f\n", loc.z)); + DEBUG_LOG(("Removing object at z height %f", loc.z)); return true; } @@ -1095,7 +1095,7 @@ Bool WorldHeightMap::ParseObjectData(DataChunkInput &file, DataChunkInfo *info, pThisOne = newInstance( MapObject )( loc, name, angle, flags, &d, TheThingFactory->findTemplate( name ) ); -//DEBUG_LOG(("obj %s owner %s\n",name.str(),d.getAsciiString(TheKey_originalOwner).str())); +//DEBUG_LOG(("obj %s owner %s",name.str(),d.getAsciiString(TheKey_originalOwner).str())); if (pThisOne->getProperties()->getType(TheKey_waypointID) == Dict::DICT_INT) pThisOne->setIsWaypoint(); diff --git a/Generals/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp b/Generals/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp index f5ebda42f2..b477d4822e 100644 --- a/Generals/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp +++ b/Generals/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp @@ -72,7 +72,7 @@ ArchiveFile * Win32BIGFileSystem::openArchiveFile(const Char *filename) { Int archiveFileSize = 0; Int numLittleFiles = 0; - DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - opening BIG file %s\n", filename)); + DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - opening BIG file %s", filename)); if (fp == NULL) { DEBUG_CRASH(("Could not open archive file %s for parsing", filename)); @@ -93,7 +93,7 @@ ArchiveFile * Win32BIGFileSystem::openArchiveFile(const Char *filename) { // read in the file size. fp->read(&archiveFileSize, 4); - DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - size of archive file is %d bytes\n", archiveFileSize)); + DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - size of archive file is %d bytes", archiveFileSize)); // char t; @@ -102,7 +102,7 @@ ArchiveFile * Win32BIGFileSystem::openArchiveFile(const Char *filename) { fp->read(&numLittleFiles, 4); numLittleFiles = betoh(numLittleFiles); - DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - %d are contained in archive\n", numLittleFiles)); + DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - %d are contained in archive", numLittleFiles)); // for (Int i = 0; i < 2; ++i) { // t = buffer[i]; // buffer[i] = buffer[(4-i)-1]; @@ -151,7 +151,7 @@ ArchiveFile * Win32BIGFileSystem::openArchiveFile(const Char *filename) { AsciiString debugpath; debugpath = path; debugpath.concat(fileInfo->m_filename); -// DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - adding file %s to archive file %s, file number %d\n", debugpath.str(), fileInfo->m_archiveFilename.str(), i)); +// DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - adding file %s to archive file %s, file number %d", debugpath.str(), fileInfo->m_archiveFilename.str(), i)); archiveFile->addFile(path, fileInfo); } @@ -204,10 +204,10 @@ Bool Win32BIGFileSystem::loadBigFilesFromDirectory(AsciiString dir, AsciiString ArchiveFile *archiveFile = openArchiveFile((*it).str()); if (archiveFile != NULL) { - DEBUG_LOG(("Win32BIGFileSystem::loadBigFilesFromDirectory - loading %s into the directory tree.\n", (*it).str())); + DEBUG_LOG(("Win32BIGFileSystem::loadBigFilesFromDirectory - loading %s into the directory tree.", (*it).str())); loadIntoDirectoryTree(archiveFile, *it, overwrite); m_archiveFileMap[(*it)] = archiveFile; - DEBUG_LOG(("Win32BIGFileSystem::loadBigFilesFromDirectory - %s inserted into the archive file map.\n", (*it).str())); + DEBUG_LOG(("Win32BIGFileSystem::loadBigFilesFromDirectory - %s inserted into the archive file map.", (*it).str())); actuallyAdded = TRUE; } diff --git a/Generals/Code/GameEngineDevice/Source/Win32Device/Common/Win32LocalFileSystem.cpp b/Generals/Code/GameEngineDevice/Source/Win32Device/Common/Win32LocalFileSystem.cpp index c768553cff..761bd5b53d 100644 --- a/Generals/Code/GameEngineDevice/Source/Win32Device/Common/Win32LocalFileSystem.cpp +++ b/Generals/Code/GameEngineDevice/Source/Win32Device/Common/Win32LocalFileSystem.cpp @@ -220,7 +220,7 @@ AsciiString Win32LocalFileSystem::normalizePath(const AsciiString& filePath) con DWORD retval = GetFullPathNameA(filePath.str(), 0, NULL, NULL); if (retval == 0) { - DEBUG_LOG(("Unable to determine buffer size for normalized file path. Error=(%u).\n", GetLastError())); + DEBUG_LOG(("Unable to determine buffer size for normalized file path. Error=(%u).", GetLastError())); return AsciiString::TheEmptyString; } @@ -228,7 +228,7 @@ AsciiString Win32LocalFileSystem::normalizePath(const AsciiString& filePath) con retval = GetFullPathNameA(filePath.str(), retval, normalizedFilePath.getBufferForRead(retval - 1), NULL); if (retval == 0) { - DEBUG_LOG(("Unable to normalize file path '%s'. Error=(%u).\n", filePath.str(), GetLastError())); + DEBUG_LOG(("Unable to normalize file path '%s'. Error=(%u).", filePath.str(), GetLastError())); return AsciiString::TheEmptyString; } diff --git a/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp b/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp index be810e08d6..d02fb75c3e 100644 --- a/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp +++ b/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp @@ -100,7 +100,7 @@ static void printReturnCode( char *label, HRESULT hr ) if( error->error == hr ) { - DEBUG_LOG(( "%s: '%s' - '0x%08x'\n", label, error->string, hr )); + DEBUG_LOG(( "%s: '%s' - '0x%08x'", label, error->string, hr )); break; } error++; @@ -125,7 +125,7 @@ void DirectInputKeyboard::openKeyboard( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openKeyboard: DirectInputCreate failed\r\n" )); + DEBUG_LOG(( "ERROR - openKeyboard: DirectInputCreate failed" )); assert( 0 ); closeKeyboard(); return; @@ -139,7 +139,7 @@ void DirectInputKeyboard::openKeyboard( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openKeyboard: Unabled to create keyboard device\n" )); + DEBUG_LOG(( "ERROR - openKeyboard: Unabled to create keyboard device" )); assert( 0 ); closeKeyboard(); return; @@ -151,7 +151,7 @@ void DirectInputKeyboard::openKeyboard( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openKeyboard: Unabled to set data format for keyboard\n" )); + DEBUG_LOG(( "ERROR - openKeyboard: Unabled to set data format for keyboard" )); assert( 0 ); closeKeyboard(); return; @@ -169,7 +169,7 @@ void DirectInputKeyboard::openKeyboard( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openKeyboard: Unabled to set cooperative level\n" )); + DEBUG_LOG(( "ERROR - openKeyboard: Unabled to set cooperative level" )); assert( 0 ); closeKeyboard(); return; @@ -187,7 +187,7 @@ void DirectInputKeyboard::openKeyboard( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openKeyboard: Unable to set keyboard buffer size property\n" )); + DEBUG_LOG(( "ERROR - openKeyboard: Unable to set keyboard buffer size property" )); assert( 0 ); closeKeyboard(); return; @@ -199,7 +199,7 @@ void DirectInputKeyboard::openKeyboard( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openKeyboard: Unable to acquire keyboard device\n" )); + DEBUG_LOG(( "ERROR - openKeyboard: Unable to acquire keyboard device" )); // Note - This can happen in windowed mode, and we can re-acquire later. So don't // close the keyboard. jba. // closeKeyboard(); @@ -207,7 +207,7 @@ void DirectInputKeyboard::openKeyboard( void ) } // end if - DEBUG_LOG(( "OK - Keyboard initialized successfully.\n" )); + DEBUG_LOG(( "OK - Keyboard initialized successfully." )); } // end openKeyboard @@ -223,7 +223,7 @@ void DirectInputKeyboard::closeKeyboard( void ) m_pKeyboardDevice->Unacquire(); m_pKeyboardDevice->Release(); m_pKeyboardDevice = NULL; - DEBUG_LOG(( "OK - Keyboard deviced closed\n" )); + DEBUG_LOG(( "OK - Keyboard deviced closed" )); } // end if if( m_pDirectInput ) @@ -231,11 +231,11 @@ void DirectInputKeyboard::closeKeyboard( void ) m_pDirectInput->Release(); m_pDirectInput = NULL; - DEBUG_LOG(( "OK - Keyboard direct input interface closed\n" )); + DEBUG_LOG(( "OK - Keyboard direct input interface closed" )); } // end if - DEBUG_LOG(( "OK - Keyboard shutdown complete\n" )); + DEBUG_LOG(( "OK - Keyboard shutdown complete" )); } // end closeKeyboard diff --git a/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp b/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp index 233a605ce8..a5f0a7f6b2 100644 --- a/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp +++ b/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp @@ -54,7 +54,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openMouse: Unabled to create direct input interface\n" )); + DEBUG_LOG(( "ERROR - openMouse: Unabled to create direct input interface" )); assert( 0 ); closeMouse(); return; @@ -68,7 +68,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openMouse: Unable to create mouse device\n" )); + DEBUG_LOG(( "ERROR - openMouse: Unable to create mouse device" )); assert( 0 ); closeMouse(); return; @@ -80,7 +80,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openMouse: Unabled to set mouse data format\n" )); + DEBUG_LOG(( "ERROR - openMouse: Unabled to set mouse data format" )); assert( 0 ); closeMouse(); return; @@ -94,7 +94,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openMouse: Unabled to set coop level\n" )); + DEBUG_LOG(( "ERROR - openMouse: Unabled to set coop level" )); assert( 0 ); closeMouse(); return; @@ -112,7 +112,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openMouse: Unabled to set buffer property\n" )); + DEBUG_LOG(( "ERROR - openMouse: Unabled to set buffer property" )); assert( 0 ); closeMouse(); return; @@ -124,7 +124,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openMouse: Unabled to acquire mouse\n" )); + DEBUG_LOG(( "ERROR - openMouse: Unabled to acquire mouse" )); assert( 0 ); closeMouse(); return; @@ -139,7 +139,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "WARNING - openMouse: Cann't get capabilities of mouse for button setup\n" )); + DEBUG_LOG(( "WARNING - openMouse: Cann't get capabilities of mouse for button setup" )); } // end if else @@ -150,12 +150,12 @@ void DirectInputMouse::openMouse( void ) m_numAxes = (UnsignedByte)diDevCaps.dwAxes; m_forceFeedback = BitIsSet( diDevCaps.dwFlags, DIDC_FORCEFEEDBACK ); - DEBUG_LOG(( "OK - Mouse info: Buttons = '%d', Force Feedback = '%s', Axes = '%d'\n", + DEBUG_LOG(( "OK - Mouse info: Buttons = '%d', Force Feedback = '%s', Axes = '%d'", m_numButtons, m_forceFeedback ? "Yes" : "No", m_numAxes )); } // end else - DEBUG_LOG(( "OK - Mouse initialized successfully\n" )); + DEBUG_LOG(( "OK - Mouse initialized successfully" )); } // end openMouse @@ -172,7 +172,7 @@ void DirectInputMouse::closeMouse( void ) m_pMouseDevice->Unacquire(); m_pMouseDevice->Release(); m_pMouseDevice = NULL; - DEBUG_LOG(( "OK - Mouse device closed\n" )); + DEBUG_LOG(( "OK - Mouse device closed" )); } // end if @@ -182,11 +182,11 @@ void DirectInputMouse::closeMouse( void ) m_pDirectInput->Release(); m_pDirectInput = NULL; - DEBUG_LOG(( "OK - Mouse direct input interface closed\n" )); + DEBUG_LOG(( "OK - Mouse direct input interface closed" )); } // end if - DEBUG_LOG(( "OK - Mouse shutdown complete\n" )); + DEBUG_LOG(( "OK - Mouse shutdown complete" )); } // end closeMouse diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp index 8f1ca3c895..0768a1be95 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp @@ -849,7 +849,7 @@ void DX8Wrapper::Resize_And_Position_Window() { ::SetWindowPos(_Hwnd, HWND_TOPMOST, 0, 0, width, height, SWP_NOSIZE | SWP_NOMOVE); - DEBUG_LOG(("Window resized to w:%d h:%d\n", width, height)); + DEBUG_LOG(("Window resized to w:%d h:%d", width, height)); } else { @@ -872,7 +872,7 @@ void DX8Wrapper::Resize_And_Position_Window() ::SetWindowPos (_Hwnd, NULL, left, top, width, height, SWP_NOZORDER); - DEBUG_LOG(("Window positioned to x:%d y:%d, resized to w:%d h:%d\n", left, top, width, height)); + DEBUG_LOG(("Window positioned to x:%d y:%d, resized to w:%d h:%d", left, top, width, height)); } } } diff --git a/Generals/Code/Main/WinMain.cpp b/Generals/Code/Main/WinMain.cpp index 5f75bf1a91..bf6b77e355 100644 --- a/Generals/Code/Main/WinMain.cpp +++ b/Generals/Code/Main/WinMain.cpp @@ -826,15 +826,15 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, ShowWindow(ccwindow, SW_RESTORE); } - DEBUG_LOG(("Generals is already running...Bail!\n")); + DEBUG_LOG(("Generals is already running...Bail!")); delete TheVersion; TheVersion = NULL; shutdownMemoryManager(); DEBUG_SHUTDOWN(); return exitcode; } - DEBUG_LOG(("Create Generals Mutex okay.\n")); - DEBUG_LOG(("CRC message is %d\n", GameMessage::MSG_LOGIC_CRC)); + DEBUG_LOG(("Create Generals Mutex okay.")); + DEBUG_LOG(("CRC message is %d", GameMessage::MSG_LOGIC_CRC)); // run the game main loop exitcode = GameMain(); diff --git a/Generals/Code/Tools/GUIEdit/Source/GUIEdit.cpp b/Generals/Code/Tools/GUIEdit/Source/GUIEdit.cpp index 7b4e2c8cfb..20e00c82eb 100644 --- a/Generals/Code/Tools/GUIEdit/Source/GUIEdit.cpp +++ b/Generals/Code/Tools/GUIEdit/Source/GUIEdit.cpp @@ -757,7 +757,7 @@ Bool GUIEdit::writeConfigFile( const char *filename ) if( fp == NULL ) { - DEBUG_LOG(( "writeConfigFile: Unable to open file '%s'\n", filename )); + DEBUG_LOG(( "writeConfigFile: Unable to open file '%s'", filename )); assert( 0 ); return FALSE; @@ -3389,7 +3389,7 @@ void GUIEdit::statusMessage( StatusPart part, const char *message ) if( part < 0 || part >= STATUS_NUM_PARTS ) { - DEBUG_LOG(( "Status message part out of range '%d', '%s'\n", part, message )); + DEBUG_LOG(( "Status message part out of range '%d', '%s'", part, message )); assert( 0 ); return; @@ -3890,7 +3890,7 @@ void GUIEdit::selectWindow( GameWindow *window ) if( entry == NULL ) { - DEBUG_LOG(( "Unable to allocate selection entry for window\n" )); + DEBUG_LOG(( "Unable to allocate selection entry for window" )); assert( 0 ); return; @@ -4029,7 +4029,7 @@ void GUIEdit::deleteSelected( void ) if( deleteList == NULL ) { - DEBUG_LOG(( "Cannot allocate delete list!\n" )); + DEBUG_LOG(( "Cannot allocate delete list!" )); assert( 0 ); return; @@ -4072,7 +4072,7 @@ void GUIEdit::bringSelectedToTop( void ) if( snapshot == NULL ) { - DEBUG_LOG(( "bringSelectedToTop: Unabled to allocate selectList\n" )); + DEBUG_LOG(( "bringSelectedToTop: Unabled to allocate selectList" )); assert( 0 ); return; diff --git a/Generals/Code/Tools/GUIEdit/Source/HierarchyView.cpp b/Generals/Code/Tools/GUIEdit/Source/HierarchyView.cpp index 887c33b708..8731e35db9 100644 --- a/Generals/Code/Tools/GUIEdit/Source/HierarchyView.cpp +++ b/Generals/Code/Tools/GUIEdit/Source/HierarchyView.cpp @@ -699,7 +699,7 @@ void HierarchyView::addWindowToTree( GameWindow *window, if( newItem == NULL ) { - DEBUG_LOG(( "Error adding window to tree\n" )); + DEBUG_LOG(( "Error adding window to tree" )); assert( 0 ); return; @@ -966,7 +966,7 @@ void HierarchyView::bringWindowToTop( GameWindow *window ) if( item == NULL ) { - DEBUG_LOG(( "Cannot bring window to top, no entry in tree!\n" )); + DEBUG_LOG(( "Cannot bring window to top, no entry in tree!" )); assert( 0 ); return; @@ -999,7 +999,7 @@ void HierarchyView::updateWindowName( GameWindow *window ) if( item == NULL ) { - DEBUG_LOG(( "updateWindowName: No hierarchy entry for window!\n" )); + DEBUG_LOG(( "updateWindowName: No hierarchy entry for window!" )); assert( 0 ); return; @@ -1103,7 +1103,7 @@ void HierarchyView::moveWindowAheadOf( GameWindow *window, if( aheadOfItem == NULL ) { - DEBUG_LOG(( "moveWindowAheadOf: aheadOf has no hierarchy entry!\n" )); + DEBUG_LOG(( "moveWindowAheadOf: aheadOf has no hierarchy entry!" )); assert( 0 ); return; @@ -1139,7 +1139,7 @@ void HierarchyView::moveWindowAheadOf( GameWindow *window, if( newItem == NULL ) { - DEBUG_LOG(( "moveWindowAheadOf: Error adding window to tree\n" )); + DEBUG_LOG(( "moveWindowAheadOf: Error adding window to tree" )); assert( 0 ); return; @@ -1187,7 +1187,7 @@ void HierarchyView::moveWindowChildOf( GameWindow *window, GameWindow *parent ) if( parentItem == NULL ) { - DEBUG_LOG(( "moveWindowChildOf: No parent entry\n" )); + DEBUG_LOG(( "moveWindowChildOf: No parent entry" )); assert( 0 ); return; diff --git a/Generals/Code/Tools/GUIEdit/Source/LayoutScheme.cpp b/Generals/Code/Tools/GUIEdit/Source/LayoutScheme.cpp index ef558cf7fa..b15b077811 100644 --- a/Generals/Code/Tools/GUIEdit/Source/LayoutScheme.cpp +++ b/Generals/Code/Tools/GUIEdit/Source/LayoutScheme.cpp @@ -2178,7 +2178,7 @@ ImageAndColorInfo *LayoutScheme::findEntry( StateIdentifier id ) if( id < 0 || id >= NUM_STATE_IDENTIFIERS ) { - DEBUG_LOG(( "Illegal state to to layout 'findEntry' '%d'\n", id )); + DEBUG_LOG(( "Illegal state to to layout 'findEntry' '%d'", id )); assert( 0 ); return NULL; @@ -2207,7 +2207,7 @@ ImageAndColorInfo *LayoutScheme::getImageAndColor( StateIdentifier id ) if( id < 0 || id >= NUM_STATE_IDENTIFIERS ) { - DEBUG_LOG(( "getImageAndColor: Illegal state '%d'\n", id )); + DEBUG_LOG(( "getImageAndColor: Illegal state '%d'", id )); assert( 0 ); return NULL; @@ -2229,7 +2229,7 @@ void LayoutScheme::storeImageAndColor( StateIdentifier id, const Image *image, if( id < 0 || id >= NUM_STATE_IDENTIFIERS ) { - DEBUG_LOG(( "Illegal state identifier in layout scheme store image and color '%d'\n", id )); + DEBUG_LOG(( "Illegal state identifier in layout scheme store image and color '%d'", id )); assert( 0 ); return; @@ -2262,7 +2262,7 @@ Bool LayoutScheme::saveScheme( char *filename ) if( fp == NULL ) { - DEBUG_LOG(( "saveScheme: Unable to open file '%s'\n", filename )); + DEBUG_LOG(( "saveScheme: Unable to open file '%s'", filename )); MessageBox( TheEditor->getWindowHandle(), "Unable to open scheme for for saving. Read only?", "Save Error", MB_OK ); return FALSE; @@ -2354,7 +2354,7 @@ Bool LayoutScheme::loadScheme( char *filename ) if( version != SCHEME_VERSION ) { - DEBUG_LOG(( "loadScheme: Old layout file version '%d'\n", version )); + DEBUG_LOG(( "loadScheme: Old layout file version '%d'", version )); MessageBox( TheEditor->getWindowHandle(), "Old layout version, cannot open.", "Old File", MB_OK ); return FALSE; diff --git a/Generals/Code/Tools/GUIEdit/Source/Properties.cpp b/Generals/Code/Tools/GUIEdit/Source/Properties.cpp index e817d86920..fe4ee5eabd 100644 --- a/Generals/Code/Tools/GUIEdit/Source/Properties.cpp +++ b/Generals/Code/Tools/GUIEdit/Source/Properties.cpp @@ -432,7 +432,7 @@ void InitPropertiesDialog( GameWindow *window, Int x, Int y ) if( dialog == NULL ) { - DEBUG_LOG(( "Error creating properties dialog\n" )); + DEBUG_LOG(( "Error creating properties dialog" )); MessageBox( TheEditor->getWindowHandle(), "Error creating property dialog!", "Error", MB_OK ); assert( 0 ); return; @@ -983,7 +983,7 @@ static void adjustGadgetDrawMethods( Bool useImages, GameWindow *window ) else { - DEBUG_LOG(( "Unable to adjust draw method, undefined gadget\n" )); + DEBUG_LOG(( "Unable to adjust draw method, undefined gadget" )); assert( 0 ); return; @@ -1021,7 +1021,7 @@ static void adjustGadgetDrawMethods( Bool useImages, GameWindow *window ) else { - DEBUG_LOG(( "Unable to adjust draw method, undefined gadget\n" )); + DEBUG_LOG(( "Unable to adjust draw method, undefined gadget" )); assert( 0 ); return; @@ -1351,7 +1351,7 @@ void SwitchToState( StateIdentifier id, HWND dialog ) if( info == NULL ) { - DEBUG_LOG(( "Invalid state request\n" )); + DEBUG_LOG(( "Invalid state request" )); assert( 0 ); return; diff --git a/Generals/Code/Tools/GUIEdit/Source/Save.cpp b/Generals/Code/Tools/GUIEdit/Source/Save.cpp index e5a028666a..be8d11ccd1 100644 --- a/Generals/Code/Tools/GUIEdit/Source/Save.cpp +++ b/Generals/Code/Tools/GUIEdit/Source/Save.cpp @@ -577,7 +577,7 @@ static Bool saveDrawData( const char *token, GameWindow *window, else { - DEBUG_LOG(( "Save draw data, unknown token '%s'\n", token )); + DEBUG_LOG(( "Save draw data, unknown token '%s'", token )); assert( 0 ); return FALSE; @@ -616,7 +616,7 @@ static Bool saveListboxData( GameWindow *window, FILE *fp, Int dataIndent ) if( listData == NULL ) { - DEBUG_LOG(( "No listbox data to save for window '%d'\n", + DEBUG_LOG(( "No listbox data to save for window '%d'", window->winGetWindowId() )); assert( 0 ); return FALSE; @@ -702,7 +702,7 @@ static Bool saveComboBoxData( GameWindow *window, FILE *fp, Int dataIndent ) if( comboData == NULL ) { - DEBUG_LOG(( "No comboData data to save for window '%d'\n", + DEBUG_LOG(( "No comboData data to save for window '%d'", window->winGetWindowId() )); assert( 0 ); return FALSE; @@ -802,7 +802,7 @@ static Bool saveRadioButtonData( GameWindow *window, FILE *fp, Int dataIndent ) { - DEBUG_LOG(( "No radio button data to save for window '%d'\n", + DEBUG_LOG(( "No radio button data to save for window '%d'", window->winGetWindowId() )); assert( 0 ); return FALSE; @@ -827,7 +827,7 @@ static Bool saveSliderData( GameWindow *window, FILE *fp, Int dataIndent ) if( sliderData == NULL ) { - DEBUG_LOG(( "No slider data in window to save for window %d\n", + DEBUG_LOG(( "No slider data in window to save for window %d", window->winGetWindowId() )); assert( 0 ); return FALSE; @@ -865,7 +865,7 @@ static Bool saveStaticTextData( GameWindow *window, FILE *fp, Int dataIndent ) if( textData == NULL ) { - DEBUG_LOG(( "No text data in window to save for window %d\n", + DEBUG_LOG(( "No text data in window to save for window %d", window->winGetWindowId() )); assert( 0 ); return FALSE; @@ -890,7 +890,7 @@ static Bool saveTextEntryData( GameWindow *window, FILE *fp, Int dataIndent ) if( entryData == NULL ) { - DEBUG_LOG(( "No text entry data in window to save for window %d\n", + DEBUG_LOG(( "No text entry data in window to save for window %d", window->winGetWindowId() )); assert( 0 ); return FALSE; @@ -923,7 +923,7 @@ static Bool saveTabControlData( GameWindow *window, FILE *fp, Int dataIndent ) if( tabControlData == NULL ) { - DEBUG_LOG(( "No text entry data in window to save for window %d\n", + DEBUG_LOG(( "No text entry data in window to save for window %d", window->winGetWindowId() )); assert( 0 ); return FALSE; diff --git a/Generals/Code/Tools/ParticleEditor/ParticleTypePanels.cpp b/Generals/Code/Tools/ParticleEditor/ParticleTypePanels.cpp index 219fb3c3ce..645bddbc2f 100644 --- a/Generals/Code/Tools/ParticleEditor/ParticleTypePanels.cpp +++ b/Generals/Code/Tools/ParticleEditor/ParticleTypePanels.cpp @@ -64,7 +64,7 @@ void ParticlePanelParticle::InitPanel( void ) findString = PATH; findString += PREFIX; findString += POSTFIX; -// DEBUG_LOG(("ParticlePanedParticle::InitPanel - looking for textures, search string is '%s'\n", findString.begin())); +// DEBUG_LOG(("ParticlePanedParticle::InitPanel - looking for textures, search string is '%s'", findString.begin())); BOOL bWorkin = finder.FindFile(findString.c_str()); while (bWorkin) { bWorkin = finder.FindNextFile(); diff --git a/Generals/Code/Tools/WorldBuilder/src/BuildList.cpp b/Generals/Code/Tools/WorldBuilder/src/BuildList.cpp index c194295c2c..f7b7d32690 100644 --- a/Generals/Code/Tools/WorldBuilder/src/BuildList.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/BuildList.cpp @@ -117,7 +117,7 @@ void BuildList::loadSides(void) { CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_SIDES_COMBO); if (!pCombo) { - DEBUG_LOG(("*** BuildList::loadSides Missing resource!!!\n")); + DEBUG_LOG(("*** BuildList::loadSides Missing resource!!!")); return; } pCombo->ResetContent(); @@ -144,7 +144,7 @@ void BuildList::updateCurSide(void) CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_SIDES_COMBO); if (!pCombo) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!!\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!!")); return; } if (m_curSide<0 || m_curSide >= TheSidesList->getNumSides()) { @@ -157,7 +157,7 @@ void BuildList::updateCurSide(void) CListBox *pList = (CListBox*)GetDlgItem(IDC_BUILD_LIST); if (!pList) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST")); return; } pList->ResetContent(); @@ -178,7 +178,7 @@ void BuildList::OnSelchangeSidesCombo() CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_SIDES_COMBO); if (!pCombo) { - DEBUG_LOG(("*** BuildList::OnSelchangeSidesCombo Missing resource!!!\n")); + DEBUG_LOG(("*** BuildList::OnSelchangeSidesCombo Missing resource!!!")); return; } @@ -198,7 +198,7 @@ void BuildList::OnMoveUp() { CListBox *pList = (CListBox*)GetDlgItem(IDC_BUILD_LIST); if (!pList) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST")); return; } m_curBuildList = pList->GetCurSel(); @@ -231,7 +231,7 @@ void BuildList::OnMoveDown() { CListBox *pList = (CListBox*)GetDlgItem(IDC_BUILD_LIST); if (!pList) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST")); return; } if (m_curBuildList < 0) return; @@ -330,7 +330,7 @@ void BuildList::OnSelchangeBuildList() CListBox *pList = (CListBox*)GetDlgItem(IDC_BUILD_LIST); if (!pList) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST")); return; } m_curBuildList = pList->GetCurSel(); @@ -419,7 +419,7 @@ void BuildList::OnSelchangeBuildList() { energyUsed = 1.0f; } - //DEBUG_LOG(("Energy: %d/%d - %g\n", energyConsumption, energyProduction, energyUsed)); + //DEBUG_LOG(("Energy: %d/%d - %g", energyConsumption, energyProduction, energyUsed)); CProgressCtrl *progressWnd = (CProgressCtrl *)GetDlgItem(IDC_POWER); if (progressWnd) { @@ -485,7 +485,7 @@ void BuildList::OnAlreadyBuild() { CListBox *pList = (CListBox*)GetDlgItem(IDC_BUILD_LIST); if (!pList) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST")); return; } SidesInfo *pSide = TheSidesList->getSideInfo(m_curSide); @@ -508,7 +508,7 @@ void BuildList::OnDeleteBuilding() { CListBox *pList = (CListBox*)GetDlgItem(IDC_BUILD_LIST); if (!pList) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST")); return; } m_curBuildList = pList->GetCurSel(); diff --git a/Generals/Code/Tools/WorldBuilder/src/GlobalLightOptions.cpp b/Generals/Code/Tools/WorldBuilder/src/GlobalLightOptions.cpp index 9919cd9c0d..0c84f162c6 100644 --- a/Generals/Code/Tools/WorldBuilder/src/GlobalLightOptions.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/GlobalLightOptions.cpp @@ -142,7 +142,7 @@ static void SpitLights() { #ifdef DEBUG_LOGGING CString lightstrings[100]; - DEBUG_LOG(("GlobalLighting\n\n")); + DEBUG_LOG(("GlobalLighting\n")); Int redA, greenA, blueA; Int redD, greenD, blueD; Real x, y, z; @@ -172,9 +172,9 @@ static void SpitLights() y = TheGlobalData->m_terrainLighting[time+TIME_OF_DAY_FIRST][light].lightPos.y; z = TheGlobalData->m_terrainLighting[time+TIME_OF_DAY_FIRST][light].lightPos.z; - DEBUG_LOG(("TerrainLighting%sAmbient%s = R:%d G:%d B:%d\n", times[time], lights[light], redA, greenA, blueA)); - DEBUG_LOG(("TerrainLighting%sDiffuse%s = R:%d G:%d B:%d\n", times[time], lights[light], redD, greenD, blueD)); - DEBUG_LOG(("TerrainLighting%sLightPos%s = X:%0.2f Y:%0.2f Z:%0.2f\n", times[time], lights[light], x, y, z)); + DEBUG_LOG(("TerrainLighting%sAmbient%s = R:%d G:%d B:%d", times[time], lights[light], redA, greenA, blueA)); + DEBUG_LOG(("TerrainLighting%sDiffuse%s = R:%d G:%d B:%d", times[time], lights[light], redD, greenD, blueD)); + DEBUG_LOG(("TerrainLighting%sLightPos%s = X:%0.2f Y:%0.2f Z:%0.2f", times[time], lights[light], x, y, z)); redA = TheGlobalData->m_terrainObjectsLighting[time+TIME_OF_DAY_FIRST][light].ambient.red*255; greenA = TheGlobalData->m_terrainObjectsLighting[time+TIME_OF_DAY_FIRST][light].ambient.green*255; @@ -188,50 +188,50 @@ static void SpitLights() y = TheGlobalData->m_terrainObjectsLighting[time+TIME_OF_DAY_FIRST][light].lightPos.y; z = TheGlobalData->m_terrainObjectsLighting[time+TIME_OF_DAY_FIRST][light].lightPos.z; - DEBUG_LOG(("TerrainObjectsLighting%sAmbient%s = R:%d G:%d B:%d\n", times[time], lights[light], redA, greenA, blueA)); - DEBUG_LOG(("TerrainObjectsLighting%sDiffuse%s = R:%d G:%d B:%d\n", times[time], lights[light], redD, greenD, blueD)); - DEBUG_LOG(("TerrainObjectsLighting%sLightPos%s = X:%0.2f Y:%0.2f Z:%0.2f\n", times[time], lights[light], x, y, z)); + DEBUG_LOG(("TerrainObjectsLighting%sAmbient%s = R:%d G:%d B:%d", times[time], lights[light], redA, greenA, blueA)); + DEBUG_LOG(("TerrainObjectsLighting%sDiffuse%s = R:%d G:%d B:%d", times[time], lights[light], redD, greenD, blueD)); + DEBUG_LOG(("TerrainObjectsLighting%sLightPos%s = X:%0.2f Y:%0.2f Z:%0.2f", times[time], lights[light], x, y, z)); - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } - DEBUG_LOG(("GlobalLighting Code\n\n")); + DEBUG_LOG(("GlobalLighting Code\n")); for (time=0; time<4; time++) { for (Int light=0; light<3; light++) { Int theTime = time+TIME_OF_DAY_FIRST; GlobalData::TerrainLighting tl = TheGlobalData->m_terrainLighting[theTime][light]; - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].ambient.red = %0.4ff;\n", theTime, light, tl.ambient.red)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].ambient.green = %0.4ff;\n", theTime, light, tl.ambient.green)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].ambient.blue = %0.4ff;\n", theTime, light, tl.ambient.blue)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].ambient.red = %0.4ff;", theTime, light, tl.ambient.red)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].ambient.green = %0.4ff;", theTime, light, tl.ambient.green)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].ambient.blue = %0.4ff;", theTime, light, tl.ambient.blue)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].diffuse.red = %0.4ff;\n", theTime, light, tl.diffuse.red)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].diffuse.green = %0.4ff;\n", theTime, light, tl.diffuse.green)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].diffuse.blue = %0.4ff;\n", theTime, light, tl.diffuse.blue)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].diffuse.red = %0.4ff;", theTime, light, tl.diffuse.red)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].diffuse.green = %0.4ff;", theTime, light, tl.diffuse.green)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].diffuse.blue = %0.4ff;", theTime, light, tl.diffuse.blue)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].lightPos.x = %0.4ff;\n", theTime, light, tl.lightPos.x)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].lightPos.y = %0.4ff;\n", theTime, light, tl.lightPos.y)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].lightPos.z = %0.4ff;\n", theTime, light, tl.lightPos.z)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].lightPos.x = %0.4ff;", theTime, light, tl.lightPos.x)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].lightPos.y = %0.4ff;", theTime, light, tl.lightPos.y)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].lightPos.z = %0.4ff;", theTime, light, tl.lightPos.z)); tl = TheGlobalData->m_terrainObjectsLighting[theTime][light]; - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].ambient.red = %0.4ff;\n", theTime, light, tl.ambient.red)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].ambient.green = %0.4ff;\n", theTime, light, tl.ambient.green)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].ambient.blue = %0.4ff;\n", theTime, light, tl.ambient.blue)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].ambient.red = %0.4ff;", theTime, light, tl.ambient.red)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].ambient.green = %0.4ff;", theTime, light, tl.ambient.green)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].ambient.blue = %0.4ff;", theTime, light, tl.ambient.blue)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].diffuse.red = %0.4ff;\n", theTime, light, tl.diffuse.red)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].diffuse.green = %0.4ff;\n", theTime, light, tl.diffuse.green)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].diffuse.blue = %0.4ff;\n", theTime, light, tl.diffuse.blue)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].diffuse.red = %0.4ff;", theTime, light, tl.diffuse.red)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].diffuse.green = %0.4ff;", theTime, light, tl.diffuse.green)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].diffuse.blue = %0.4ff;", theTime, light, tl.diffuse.blue)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].lightPos.x = %0.4ff;\n", theTime, light, tl.lightPos.x)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].lightPos.y = %0.4ff;\n", theTime, light, tl.lightPos.y)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].lightPos.z = %0.4ff;\n", theTime, light, tl.lightPos.z)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].lightPos.x = %0.4ff;", theTime, light, tl.lightPos.x)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].lightPos.y = %0.4ff;", theTime, light, tl.lightPos.y)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].lightPos.z = %0.4ff;", theTime, light, tl.lightPos.z)); - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } #endif } diff --git a/Generals/Code/Tools/WorldBuilder/src/MapPreview.cpp b/Generals/Code/Tools/WorldBuilder/src/MapPreview.cpp index 1ce0db6cb0..e1f8717b3c 100644 --- a/Generals/Code/Tools/WorldBuilder/src/MapPreview.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/MapPreview.cpp @@ -82,17 +82,17 @@ void MapPreview::save( CString mapName ) chunkWriter.openDataChunk("MapPreview", K_MAPPREVIEW_VERSION_1); chunkWriter.writeInt(MAP_PREVIEW_WIDTH); chunkWriter.writeInt(MAP_PREVIEW_HEIGHT); - DEBUG_LOG(("BeginMapPreviewInfo\n")); + DEBUG_LOG(("BeginMapPreviewInfo")); for(Int i = 0; i < MAP_PREVIEW_HEIGHT; ++i) { for(Int j = 0; j < MAP_PREVIEW_WIDTH; ++j) { chunkWriter.writeInt(m_pixelBuffer[i][j]); - DEBUG_LOG(("x:%d, y:%d, %X\n", j, i, m_pixelBuffer[i][j])); + DEBUG_LOG(("x:%d, y:%d, %X", j, i, m_pixelBuffer[i][j])); } } chunkWriter.closeDataChunk(); - DEBUG_LOG(("EndMapPreviewInfo\n")); + DEBUG_LOG(("EndMapPreviewInfo")); */ } diff --git a/Generals/Code/Tools/WorldBuilder/src/ScriptDialog.cpp b/Generals/Code/Tools/WorldBuilder/src/ScriptDialog.cpp index a06f0c534a..55f189347f 100644 --- a/Generals/Code/Tools/WorldBuilder/src/ScriptDialog.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/ScriptDialog.cpp @@ -1521,7 +1521,7 @@ Bool ScriptDialog::ParseObjectDataChunk(DataChunkInput &file, DataChunkInfo *inf if (pThis->m_maxWaypoint < pThisOne->getWaypointID()) pThis->m_maxWaypoint = pThisOne->getWaypointID(); } - DEBUG_LOG(("Adding object %s (%s)\n", name.str(), pThisOne->getProperties()->getAsciiString(TheKey_originalOwner).str())); + DEBUG_LOG(("Adding object %s (%s)", name.str(), pThisOne->getProperties()->getAsciiString(TheKey_originalOwner).str())); // Check for duplicates. MapObject *pObj; @@ -1601,7 +1601,7 @@ Bool ScriptDialog::ParseTeamsDataChunk(DataChunkInput &file, DataChunkInfo *info if (pThis->m_sides.findTeamInfo(teamName)) { continue; } - DEBUG_LOG(("Adding team %s\n", teamName.str())); + DEBUG_LOG(("Adding team %s", teamName.str())); AsciiString player = teamDict.getAsciiString(TheKey_teamOwner); if (pThis->m_sides.findSideInfo(player)) { // player exists, so just add it. diff --git a/Generals/Code/Tools/WorldBuilder/src/ShadowOptions.cpp b/Generals/Code/Tools/WorldBuilder/src/ShadowOptions.cpp index 3f08ab650e..08163308b7 100644 --- a/Generals/Code/Tools/WorldBuilder/src/ShadowOptions.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/ShadowOptions.cpp @@ -82,7 +82,7 @@ void ShadowOptions::setShadowColor(void) if (b<0) b = 0; UnsignedInt clr = (255<<24) + (r<<16) + (g<<8) + b; - DEBUG_LOG(("Setting shadows to %x\n", clr)); + DEBUG_LOG(("Setting shadows to %x", clr)); TheW3DShadowManager->setShadowColor(clr); } diff --git a/Generals/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp b/Generals/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp index 87f8fa53b8..832ba04fd8 100644 --- a/Generals/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp @@ -2208,7 +2208,7 @@ Bool WorldHeightMapEdit::selectInvalidTeam(void) if (anySelected) { - DEBUG_LOG(("%s\n", report.str())); + DEBUG_LOG(("%s", report.str())); MessageBox(NULL, report.str(), "Missing team report", MB_OK); } @@ -2472,7 +2472,7 @@ Bool WorldHeightMapEdit::doCliffAdjustment(Int xIndex, Int yIndex) ndx = (j*m_width)+i; if (pProcessed[ndx]) continue; CProcessNode *pNewNode = new CProcessNode(i,j); - DEBUG_LOG(("Adding node %d, %d\n", i, j)); + DEBUG_LOG(("Adding node %d, %d", i, j)); pNodes[k++] = pNewNode; Real dx, dy; if (im_x) { @@ -3273,7 +3273,7 @@ void WorldHeightMapEdit::updateFlatCellForAdjacentCliffs(Int xIndex, Int yIndex, } if (!gotXVec && !gotYVec) { - DEBUG_LOG(("Unexpected. jba\n")); + DEBUG_LOG(("Unexpected. jba")); return; } if (gotXVec && !gotYVec) { diff --git a/Generals/Code/Tools/WorldBuilder/src/WaterTool.cpp b/Generals/Code/Tools/WorldBuilder/src/WaterTool.cpp index 3f316ce0ec..ee33b60c53 100644 --- a/Generals/Code/Tools/WorldBuilder/src/WaterTool.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/WaterTool.cpp @@ -260,13 +260,13 @@ void WaterTool::fillTheArea(TTrackingMode m, CPoint viewPt, WbView* pView, CWorl intMapHeight = pMap->getHeight(i, j); #ifdef INTENSE_DEBUG if (bottom) { - DEBUG_LOG(("Bottom %d,%d\n", i, j)); + DEBUG_LOG(("Bottom %d,%d", i, j)); } else if (left) { - DEBUG_LOG(("Left %d,%d\n", i, j)); + DEBUG_LOG(("Left %d,%d", i, j)); } else if (right) { - DEBUG_LOG(("Right %d,%d\n", i, j)); + DEBUG_LOG(("Right %d,%d", i, j)); } else if (top) { - DEBUG_LOG(("Top %d,%d\n", i, j)); + DEBUG_LOG(("Top %d,%d", i, j)); } #endif if (bottom) { diff --git a/Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp b/Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp index 43bed5d81d..7d4d063008 100644 --- a/Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp @@ -276,9 +276,9 @@ BOOL CWorldBuilderApp::InitInstance() // start the log DEBUG_INIT(DEBUG_FLAGS_DEFAULT); - DEBUG_LOG(("starting Worldbuilder.\n")); + DEBUG_LOG(("starting Worldbuilder.")); #ifdef RTS_DEBUG - DEBUG_LOG(("RTS_DEBUG defined.\n")); + DEBUG_LOG(("RTS_DEBUG defined.")); #endif initMemoryManager(); #ifdef MEMORYPOOL_CHECKPOINTING diff --git a/Generals/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp b/Generals/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp index e3be477347..79a99719bd 100644 --- a/Generals/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp @@ -189,7 +189,7 @@ class CachedMFCFileOutputStream : public OutputStream c.pData = tmp; c.size = numBytes; m_cachedChunks.push_back(c); - DEBUG_LOG(("Caching %d bytes in chunk %d\n", numBytes, m_cachedChunks.size())); + DEBUG_LOG(("Caching %d bytes in chunk %d", numBytes, m_cachedChunks.size())); m_totalBytes += numBytes; return(numBytes); }; @@ -199,7 +199,7 @@ class CachedMFCFileOutputStream : public OutputStream CachedChunk c = m_cachedChunks.front(); m_cachedChunks.pop_front(); try { - DEBUG_LOG(("Flushing %d bytes\n", c.size)); + DEBUG_LOG(("Flushing %d bytes", c.size)); m_file->Write(c.pData, c.size); } catch(...) {} delete[] c.pData; @@ -223,7 +223,7 @@ class CompressedCachedMFCFileOutputStream : public OutputStream c.pData = tmp; c.size = numBytes; m_cachedChunks.push_back(c); - //DEBUG_LOG(("Caching %d bytes in chunk %d\n", numBytes, m_cachedChunks.size())); + //DEBUG_LOG(("Caching %d bytes in chunk %d", numBytes, m_cachedChunks.size())); m_totalBytes += numBytes; return(numBytes); }; @@ -237,7 +237,7 @@ class CompressedCachedMFCFileOutputStream : public OutputStream CachedChunk c = m_cachedChunks.front(); m_cachedChunks.pop_front(); try { - //DEBUG_LOG(("Flushing %d bytes\n", c.size)); + //DEBUG_LOG(("Flushing %d bytes", c.size)); memcpy(insertPos, c.pData, c.size); insertPos += c.size; } catch(...) {} @@ -256,7 +256,7 @@ class CompressedCachedMFCFileOutputStream : public OutputStream Int compressedLen = CompressionManager::getMaxCompressedSize( m_totalBytes, compressionToUse ); UnsignedByte *destBuffer = NEW UnsignedByte[compressedLen]; compressedLen = CompressionManager::compressData( compressionToUse, srcBuffer, m_totalBytes, destBuffer, compressedLen ); - DEBUG_LOG(("Compressed %d bytes to %d bytes - compression of %g%%\n", m_totalBytes, compressedLen, + DEBUG_LOG(("Compressed %d bytes to %d bytes - compression of %g%%", m_totalBytes, compressedLen, compressedLen/(Real)m_totalBytes*100.0f)); DEBUG_ASSERTCRASH(compressedLen, ("Failed to compress!\n")); if (compressedLen) @@ -454,7 +454,7 @@ AsciiString ConvertFaction(AsciiString name) void CWorldBuilderDoc::validate(void) { - DEBUG_LOG(("Validating\n")); + DEBUG_LOG(("Validating")); Dict swapDict; Bool changed = false; @@ -467,11 +467,11 @@ void CWorldBuilderDoc::validate(void) AsciiString tmplname = pSide->getDict()->getAsciiString(TheKey_playerFaction); const PlayerTemplate* pt = ThePlayerTemplateStore->findPlayerTemplate(NAMEKEY(tmplname)); if (!pt) { - DEBUG_LOG(("Faction %s could not be found in sides list!\n", tmplname.str())); + DEBUG_LOG(("Faction %s could not be found in sides list!", tmplname.str())); if (tmplname.startsWith("FactionFundamentalist")) { swapName = ConvertFaction(tmplname); if (swapName != AsciiString::TheEmptyString) { - DEBUG_LOG(("Changing Faction from %s to %s\n", tmplname.str(), swapName.str())); + DEBUG_LOG(("Changing Faction from %s to %s", tmplname.str(), swapName.str())); pSide->getDict()->setAsciiString(TheKey_playerFaction, swapName); } } @@ -483,7 +483,7 @@ void CWorldBuilderDoc::validate(void) if (name.startsWith("Fundamentalist")) { swapName = ConvertName(name); if (swapName != AsciiString::TheEmptyString) { - DEBUG_LOG(("Changing BuildList from %s to %s\n", name.str(), swapName.str())); + DEBUG_LOG(("Changing BuildList from %s to %s", name.str(), swapName.str())); pBuild->setTemplateName(swapName); } } @@ -498,7 +498,7 @@ void CWorldBuilderDoc::validate(void) if (type.startsWith("Fundamentalist")) { \ swapName = ConvertName(type); \ if (swapName != AsciiString::TheEmptyString) { \ - DEBUG_LOG(("Changing Team Ref from %s to %s\n", type.str(), swapName.str())); \ + DEBUG_LOG(("Changing Team Ref from %s to %s", type.str(), swapName.str())); \ teamDict->setAsciiString(key, swapName); \ } \ } \ @@ -573,7 +573,7 @@ void CWorldBuilderDoc::validate(void) changed = true; pMapObj->setName(swapName); pMapObj->setThingTemplate(tt); - DEBUG_LOG(("Changing Map Object from %s to %s\n", name.str(), swapName.str())); + DEBUG_LOG(("Changing Map Object from %s to %s", name.str(), swapName.str())); } } } @@ -592,23 +592,23 @@ void CWorldBuilderDoc::validate(void) AsciiString tmplname = pSide->getDict()->getAsciiString(TheKey_playerFaction); const PlayerTemplate* pt = ThePlayerTemplateStore->findPlayerTemplate(NAMEKEY(tmplname)); if (!pt) { - DEBUG_LOG(("Faction %s could not be found in sides list!\n", tmplname.str())); + DEBUG_LOG(("Faction %s could not be found in sides list!", tmplname.str())); if (tmplname.startsWith("FactionFundamentalist")) { swapName = ConvertFaction(tmplname); if (swapName != AsciiString::TheEmptyString) { - DEBUG_LOG(("Changing Faction from %s to %s\n", tmplname.str(), swapName.str())); + DEBUG_LOG(("Changing Faction from %s to %s", tmplname.str(), swapName.str())); pSide->getDict()->setAsciiString(TheKey_playerFaction, swapName); } } } } else { - DEBUG_LOG(("Side %s could not be found in sides list!\n", teamOwner.str())); + DEBUG_LOG(("Side %s could not be found in sides list!", teamOwner.str())); } } else { - DEBUG_LOG(("Team %s could not be found in sides list!\n", teamName.str())); + DEBUG_LOG(("Team %s could not be found in sides list!", teamName.str())); } } else { - DEBUG_LOG(("Object %s does not have a team at all!\n", name.str())); + DEBUG_LOG(("Object %s does not have a team at all!", name.str())); } } } @@ -618,7 +618,7 @@ void CWorldBuilderDoc::OnJumpToGame() try { DoFileSave(); CString filename; - DEBUG_LOG(("strTitle=%s strPathName=%s\n", m_strTitle, m_strPathName)); + DEBUG_LOG(("strTitle=%s strPathName=%s", m_strTitle, m_strPathName)); if (strstr(m_strPathName, TheGlobalData->getPath_UserData().str()) != NULL) filename.Format("%sMaps\\%s", TheGlobalData->getPath_UserData().str(), static_cast(m_strTitle)); else @@ -787,7 +787,7 @@ Bool CWorldBuilderDoc::ParseWaypointData(DataChunkInput &file, DataChunkInfo *in for (i=0; im_waypointLinks[i].waypoint1 = file.readInt(); this->m_waypointLinks[i].waypoint2 = file.readInt(); - //DEBUG_LOG(("Waypoint link from %d to %d\n", m_waypointLinks[i].waypoint1, m_waypointLinks[i].waypoint2)); + //DEBUG_LOG(("Waypoint link from %d to %d", m_waypointLinks[i].waypoint1, m_waypointLinks[i].waypoint2)); } DEBUG_ASSERTCRASH(file.atEndOfChunk(), ("Unexpected data left over.")); return true; @@ -1351,7 +1351,7 @@ BOOL CWorldBuilderDoc::OnOpenDocument(LPCTSTR lpszPathName) while (s.getLength() && s.getCharAt(s.getLength()-1) != '\\') s.removeLastChar(); s.concat("map.str"); - DEBUG_LOG(("Looking for map-specific text in [%s]\n", s.str())); + DEBUG_LOG(("Looking for map-specific text in [%s]", s.str())); TheGameText->initMapStringFile(s); WbApp()->setCurrentDirectory(AsciiString(buf)); diff --git a/Generals/Code/Tools/WorldBuilder/src/playerlistdlg.cpp b/Generals/Code/Tools/WorldBuilder/src/playerlistdlg.cpp index d21c4e5944..9f9d71e5ba 100644 --- a/Generals/Code/Tools/WorldBuilder/src/playerlistdlg.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/playerlistdlg.cpp @@ -53,7 +53,7 @@ static void fixDefaultTeamName(SidesList& sides, AsciiString oldpname, AsciiStri { tname.set("team"); tname.concat(newpname); - DEBUG_LOG(("rename team %s -> %s\n",ti->getDict()->getAsciiString(TheKey_teamName).str(),tname.str())); + DEBUG_LOG(("rename team %s -> %s",ti->getDict()->getAsciiString(TheKey_teamName).str(),tname.str())); ti->getDict()->setAsciiString(TheKey_teamName, tname); ti->getDict()->setAsciiString(TheKey_teamOwner, newpname); } @@ -159,7 +159,7 @@ static AsciiString extractFromAlliesList(CListBox *alliesList, SidesList& sides) allies.concat(UIToInternal(sides, nm)); } } -//DEBUG_LOG(("a/e is (%s)\n",allies.str())); +//DEBUG_LOG(("a/e is (%s)",allies.str())); return allies; } diff --git a/Generals/Code/Tools/WorldBuilder/src/wbview.cpp b/Generals/Code/Tools/WorldBuilder/src/wbview.cpp index bf6b06db56..8d83eaf6d0 100644 --- a/Generals/Code/Tools/WorldBuilder/src/wbview.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/wbview.cpp @@ -190,7 +190,7 @@ void WbView::mouseMove(TTrackingMode m, CPoint viewPt) while (::PeekMessage(&msg, m_hWnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE)) { viewPt.x = (short)LOWORD(msg.lParam); // horizontal position of cursor viewPt.y = (short)HIWORD(msg.lParam); // vertical position of cursor - DEBUG_LOG(("Peek mouse %d, %d\n", viewPt.x, viewPt.y)); + DEBUG_LOG(("Peek mouse %d, %d", viewPt.x, viewPt.y)); } if (m_trackingMode == TRACK_NONE) { diff --git a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp index 87916e081e..de3452b468 100644 --- a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp @@ -619,7 +619,7 @@ void WbView3d::setupCamera() Real zAbs = zOffset + zPos; if (zAbs<0) zAbs = -zAbs; if (zAbs<0.01) zAbs = 0.01f; - //DEBUG_LOG(("zOffset = %.2f, zAbs = %.2f, zPos = %.2f\n", zOffset, zAbs, zPos)); + //DEBUG_LOG(("zOffset = %.2f, zAbs = %.2f, zPos = %.2f", zOffset, zAbs, zPos)); if (zOffset > 0) { zOffset *= zAbs; } else if (zOffset < -0.3f) { @@ -628,7 +628,7 @@ void WbView3d::setupCamera() if (zOffset < -0.6f) { zOffset = -0.3f + zOffset/2.0f; } - //DEBUG_LOG(("zOffset = %.2f\n", zOffset)); + //DEBUG_LOG(("zOffset = %.2f", zOffset)); zoom = zAbs; } @@ -698,7 +698,7 @@ void WbView3d::setupCamera() m_cameraSource = sourcePos; m_cameraTarget = targetPos; /* - DEBUG_LOG(("Camera: pos=(%g,%g) height=%g pitch=%g FXPitch=%g yaw=%g groundLevel=%g\n", + DEBUG_LOG(("Camera: pos=(%g,%g) height=%g pitch=%g FXPitch=%g yaw=%g groundLevel=%g", targetPos.X, targetPos.Y, m_actualHeightAboveGround, pitch, diff --git a/GeneralsMD/Code/GameEngine/Include/Common/ScopedMutex.h b/GeneralsMD/Code/GameEngine/Include/Common/ScopedMutex.h index 7283ab2530..0346465676 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/ScopedMutex.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/ScopedMutex.h @@ -36,7 +36,7 @@ class ScopedMutex { DWORD status = WaitForSingleObject(m_mutex, 500); if (status != WAIT_OBJECT_0) { - DEBUG_LOG(("ScopedMutex WaitForSingleObject timed out - status %d\n", status)); + DEBUG_LOG(("ScopedMutex WaitForSingleObject timed out - status %d", status)); } } diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LanguageFilter.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LanguageFilter.h index 6699328098..b4cdb2a8c9 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/LanguageFilter.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LanguageFilter.h @@ -57,9 +57,9 @@ struct UnicodeStringsEqual Bool retval = (a.compareNoCase(b) == 0); DEBUG_LOG(("Comparing %ls with %ls, return value is ", a.str(), b.str())); if (retval) { - DEBUG_LOG(("true.\n")); + DEBUG_LOG(("true.")); } else { - DEBUG_LOG(("false.\n")); + DEBUG_LOG(("false.")); } return retval; } diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/LANGameInfo.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/LANGameInfo.h index 9c8b88996e..10cc21ee16 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/LANGameInfo.h +++ b/GeneralsMD/Code/GameEngine/Include/GameNetwork/LANGameInfo.h @@ -151,7 +151,7 @@ class LANGameInfo : public GameInfo /// Set the last time we heard from the player inline void setPlayerLastHeard( int who, UnsignedInt lastHeard ) { - DEBUG_LOG(("LANGameInfo::setPlayerLastHeard - changing player %d last heard from %d to %d\n", who, getPlayerLastHeard(who), lastHeard)); + DEBUG_LOG(("LANGameInfo::setPlayerLastHeard - changing player %d last heard from %d to %d", who, getPlayerLastHeard(who), lastHeard)); if (m_LANSlot[who].isHuman()) m_LANSlot[who].setLastHeard(lastHeard); } diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h index ac06d3ff5d..33745c07bf 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h +++ b/GeneralsMD/Code/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h @@ -84,7 +84,7 @@ public C if ( m_dispatch == NULL ) { - DEBUG_LOG(("Error creating Dispatch for Web interface\n")); + DEBUG_LOG(("Error creating Dispatch for Web interface")); } } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp index a3964500c7..37c3781381 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp @@ -470,7 +470,7 @@ AudioHandle AudioManager::addAudioEvent(const AudioEventRTS *eventToAdd) // cull muted audio if (audioEvent->getVolume() < TheAudio->getAudioSettings()->m_minVolume) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" - culled due to muting (%d).\n", audioEvent->getVolume())); + DEBUG_LOG((" - culled due to muting (%d).", audioEvent->getVolume())); #endif releaseAudioEventRTS(audioEvent); return AHSV_Muted; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameSounds.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameSounds.cpp index aa588c5886..b0445c5341 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameSounds.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameSounds.cpp @@ -141,7 +141,7 @@ void SoundManager::addAudioEvent(AudioEventRTS *&eventToAdd) if (canPlayNow(eventToAdd)) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" - appended to request list with handle '%d'.\n", (UnsignedInt) eventToAdd->getPlayingHandle())); + DEBUG_LOG((" - appended to request list with handle '%d'.", (UnsignedInt) eventToAdd->getPlayingHandle())); #endif AudioRequest *audioRequest = TheAudio->allocateAudioRequest( true ); audioRequest->m_pendingEvent = eventToAdd; @@ -223,7 +223,7 @@ Bool SoundManager::canPlayNow( AudioEventRTS *event ) if (distance.length() >= event->getAudioEventInfo()->m_maxDistance) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("- culled due to distance (%.2f).\n", distance.length())); + DEBUG_LOG(("- culled due to distance (%.2f).", distance.length())); #endif return false; } @@ -233,7 +233,7 @@ Bool SoundManager::canPlayNow( AudioEventRTS *event ) ThePartitionManager->getShroudStatusForPlayer(localPlayerNdx, pos) != CELLSHROUD_CLEAR ) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("- culled due to shroud.\n")); + DEBUG_LOG(("- culled due to shroud.")); #endif return false; } @@ -250,7 +250,7 @@ Bool SoundManager::canPlayNow( AudioEventRTS *event ) else { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("- culled due to voice.\n")); + DEBUG_LOG(("- culled due to voice.")); #endif return false; } @@ -259,7 +259,7 @@ Bool SoundManager::canPlayNow( AudioEventRTS *event ) if( TheAudio->doesViolateLimit( event ) ) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("- culled due to limit.\n" )); + DEBUG_LOG(("- culled due to limit." )); #endif return false; } @@ -302,7 +302,7 @@ Bool SoundManager::canPlayNow( AudioEventRTS *event ) else { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("- culled due to no channels available and non-interrupting.\n" )); + DEBUG_LOG(("- culled due to no channels available and non-interrupting." )); #endif return false; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Audio/simpleplayer.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Audio/simpleplayer.cpp index 8d134cb56f..5823ae63b0 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Audio/simpleplayer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Audio/simpleplayer.cpp @@ -159,14 +159,14 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnSample( return( E_UNEXPECTED ); } - DEBUG_LOG(( " New Sample of length %d and PS time %d ms\n", + DEBUG_LOG(( " New Sample of length %d and PS time %d ms", cbData, ( DWORD ) ( cnsSampleTime / 10000 ) )); LPWAVEHDR pwh = (LPWAVEHDR) new BYTE[ sizeof( WAVEHDR ) + cbData ]; if( NULL == pwh ) { - DEBUG_LOG(( "OnSample OUT OF MEMORY! \n")); + DEBUG_LOG(( "OnSample OUT OF MEMORY! ")); *m_phrCompletion = E_OUTOFMEMORY; SetEvent( m_hCompletionEvent ); @@ -189,7 +189,7 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnSample( if( mmr != MMSYSERR_NOERROR ) { - DEBUG_LOG(( "failed to prepare wave buffer, error=%lu\n" , mmr )); + DEBUG_LOG(( "failed to prepare wave buffer, error=%lu" , mmr )); *m_phrCompletion = E_UNEXPECTED; SetEvent( m_hCompletionEvent ); return( E_UNEXPECTED ); @@ -202,7 +202,7 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnSample( { delete pwh; - DEBUG_LOG(( "failed to write wave sample, error=%lu\n" , mmr )); + DEBUG_LOG(( "failed to write wave sample, error=%lu" , mmr )); *m_phrCompletion = E_UNEXPECTED; SetEvent( m_hCompletionEvent ); return( E_UNEXPECTED ); @@ -235,7 +235,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if( NULL == pszCheck ) { - DEBUG_LOG(( "internal error %lu\n" , GetLastError() )); + DEBUG_LOG(( "internal error %lu" , GetLastError() )); return E_UNEXPECTED ; } @@ -251,7 +251,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if( NULL == m_pszUrl ) { - DEBUG_LOG(( "insufficient Memory\n" )) ; + DEBUG_LOG(( "insufficient Memory" )) ; return( E_OUTOFMEMORY ); } @@ -276,7 +276,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if( FAILED( hr ) ) { - DEBUG_LOG(( "failed to create audio reader (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "failed to create audio reader (hr=0x%08x)" , hr )); return( hr ); } @@ -291,13 +291,13 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple } if ( NS_E_NO_STREAM == hr ) { - DEBUG_LOG(( "Waiting for transmission to begin...\n" )); + DEBUG_LOG(( "Waiting for transmission to begin..." )); WaitForSingleObject( m_hOpenEvent, INFINITE ); hr = m_hrOpen; } if ( FAILED( hr ) ) { - DEBUG_LOG(( "failed to open (hr=0x%08x)\n", hr )); + DEBUG_LOG(( "failed to open (hr=0x%08x)", hr )); return( hr ); } @@ -308,7 +308,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple hr = m_pReader->QueryInterface( IID_IWMHeaderInfo, ( VOID ** )&m_pHeader ); if ( FAILED( hr ) ) { - DEBUG_LOG(( "failed to qi for header interface (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "failed to qi for header interface (hr=0x%08x)" , hr )); return( hr ); } @@ -317,7 +317,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple hr = m_pHeader->GetAttributeCount( 0, &wAttrCnt ); if ( FAILED( hr ) ) { - DEBUG_LOG(( "GetAttributeCount Failed (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "GetAttributeCount Failed (hr=0x%08x)" , hr )); return( hr ); } @@ -334,7 +334,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple hr = m_pHeader->GetAttributeByIndex( i, &wStream, NULL, &cchNamelen, &type, NULL, &cbLength ); if ( FAILED( hr ) ) { - DEBUG_LOG(( "GetAttributeByIndex Failed (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "GetAttributeByIndex Failed (hr=0x%08x)" , hr )); break; } @@ -350,35 +350,35 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple hr = m_pHeader->GetAttributeByIndex( i, &wStream, pwszName, &cchNamelen, &type, pValue, &cbLength ); if ( FAILED( hr ) ) { - DEBUG_LOG(( "GetAttributeByIndex Failed (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "GetAttributeByIndex Failed (hr=0x%08x)" , hr )); break; } switch ( type ) { case WMT_TYPE_DWORD: - DEBUG_LOG(("%ws: %u\n" , pwszName, *((DWORD *) pValue) )); + DEBUG_LOG(("%ws: %u" , pwszName, *((DWORD *) pValue) )); break; case WMT_TYPE_STRING: - DEBUG_LOG(("%ws: %ws\n" , pwszName, (WCHAR *) pValue )); + DEBUG_LOG(("%ws: %ws" , pwszName, (WCHAR *) pValue )); break; case WMT_TYPE_BINARY: - DEBUG_LOG(("%ws: Type = Binary of Length %u\n" , pwszName, cbLength )); + DEBUG_LOG(("%ws: Type = Binary of Length %u" , pwszName, cbLength )); break; case WMT_TYPE_BOOL: - DEBUG_LOG(("%ws: %s\n" , pwszName, ( * ( ( BOOL * ) pValue) ? _T( "true" ) : _T( "false" ) ) )); + DEBUG_LOG(("%ws: %s" , pwszName, ( * ( ( BOOL * ) pValue) ? _T( "true" ) : _T( "false" ) ) )); break; case WMT_TYPE_WORD: - DEBUG_LOG(("%ws: %hu\n" , pwszName, *((WORD *) pValue) )); + DEBUG_LOG(("%ws: %hu" , pwszName, *((WORD *) pValue) )); break; case WMT_TYPE_QWORD: - DEBUG_LOG(("%ws: %I64u\n" , pwszName, *((QWORD *) pValue) )); + DEBUG_LOG(("%ws: %I64u" , pwszName, *((QWORD *) pValue) )); break; case WMT_TYPE_GUID: - DEBUG_LOG(("%ws: %I64x%I64x\n" , pwszName, *((QWORD *) pValue), *((QWORD *) pValue + 1) )); + DEBUG_LOG(("%ws: %I64x%I64x" , pwszName, *((QWORD *) pValue), *((QWORD *) pValue + 1) )); break; default: - DEBUG_LOG(("%ws: Type = %d, Length %u\n" , pwszName, type, cbLength )); + DEBUG_LOG(("%ws: Type = %d, Length %u" , pwszName, type, cbLength )); break; } @@ -408,13 +408,13 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple hr = m_pReader->GetOutputCount( &cOutputs ); if ( FAILED( hr ) ) { - DEBUG_LOG(( "failed GetOutputCount(), (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "failed GetOutputCount(), (hr=0x%08x)" , hr )); return( hr ); } if ( cOutputs != 1 ) { - DEBUG_LOG(( "Not audio only (cOutputs = %d).\n" , cOutputs )); + DEBUG_LOG(( "Not audio only (cOutputs = %d)." , cOutputs )); // return( E_UNEXPECTED ); } @@ -422,7 +422,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple hr = m_pReader->GetOutputProps( 0, &pProps ); if ( FAILED( hr ) ) { - DEBUG_LOG(( "failed GetOutputProps(), (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "failed GetOutputProps(), (hr=0x%08x)" , hr )); return( hr ); } @@ -432,7 +432,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if ( FAILED( hr ) ) { pProps->Release( ); - DEBUG_LOG(( "GetMediaType failed (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "GetMediaType failed (hr=0x%08x)" , hr )); return( hr ); } @@ -442,7 +442,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if ( FAILED( hr ) ) { pProps->Release( ); - DEBUG_LOG(( "GetMediaType failed (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "GetMediaType failed (hr=0x%08x)" , hr )); return( hr ); } @@ -451,7 +451,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if ( pMediaType->majortype != WMMEDIATYPE_Audio ) { delete[] (BYTE *) pMediaType ; - DEBUG_LOG(( "Not audio only (major type mismatch).\n" )); + DEBUG_LOG(( "Not audio only (major type mismatch)." )); return( E_UNEXPECTED ); } @@ -477,7 +477,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if( mmr != MMSYSERR_NOERROR ) { - DEBUG_LOG(( "failed to open wav output device, error=%lu\n" , mmr )); + DEBUG_LOG(( "failed to open wav output device, error=%lu" , mmr )); return( E_UNEXPECTED ); } @@ -489,7 +489,7 @@ HRESULT CSimplePlayer::Play( LPCWSTR pszUrl, DWORD dwSecDuration, HANDLE hComple if( FAILED( hr ) ) { - DEBUG_LOG(( "failed Start(), (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "failed Start(), (hr=0x%08x)" , hr )); return( hr ); } @@ -508,39 +508,39 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnStatus( switch( Status ) { case WMT_OPENED: - DEBUG_LOG(( "OnStatus( WMT_OPENED )\n" )); + DEBUG_LOG(( "OnStatus( WMT_OPENED )" )); m_hrOpen = hr; SetEvent( m_hOpenEvent ); break; case WMT_SOURCE_SWITCH: - DEBUG_LOG(( "OnStatus( WMT_SOURCE_SWITCH )\n" )); + DEBUG_LOG(( "OnStatus( WMT_SOURCE_SWITCH )" )); m_hrOpen = hr; SetEvent( m_hOpenEvent ); break; case WMT_ERROR: - DEBUG_LOG(( "OnStatus( WMT_ERROR )\n" )); + DEBUG_LOG(( "OnStatus( WMT_ERROR )" )); break; case WMT_STARTED: - DEBUG_LOG(( "OnStatus( WMT_STARTED )\n" )); + DEBUG_LOG(( "OnStatus( WMT_STARTED )" )); break; case WMT_STOPPED: - DEBUG_LOG(( "OnStatus( WMT_STOPPED )\n" )); + DEBUG_LOG(( "OnStatus( WMT_STOPPED )" )); break; case WMT_BUFFERING_START: - DEBUG_LOG(( "OnStatus( WMT_BUFFERING START)\n" )); + DEBUG_LOG(( "OnStatus( WMT_BUFFERING START)" )); break; case WMT_BUFFERING_STOP: - DEBUG_LOG(( "OnStatus( WMT_BUFFERING STOP)\n" )); + DEBUG_LOG(( "OnStatus( WMT_BUFFERING STOP)" )); break; case WMT_EOF: - DEBUG_LOG(( "OnStatus( WMT_EOF )\n" )); + DEBUG_LOG(( "OnStatus( WMT_EOF )" )); // // cleanup and exit @@ -556,7 +556,7 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnStatus( break; case WMT_END_OF_SEGMENT: - DEBUG_LOG(( "OnStatus( WMT_END_OF_SEGMENT )\n" )); + DEBUG_LOG(( "OnStatus( WMT_END_OF_SEGMENT )" )); // // cleanup and exit @@ -572,11 +572,11 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnStatus( break; case WMT_LOCATING: - DEBUG_LOG(( "OnStatus( WMT_LOCATING )\n" )); + DEBUG_LOG(( "OnStatus( WMT_LOCATING )" )); break; case WMT_CONNECTING: - DEBUG_LOG(( "OnStatus( WMT_CONNECTING )\n" )); + DEBUG_LOG(( "OnStatus( WMT_CONNECTING )" )); break; case WMT_NO_RIGHTS: @@ -595,7 +595,7 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnStatus( if( FAILED( hr ) ) { - DEBUG_LOG(( "Unable to launch web browser to retrieve playback license (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "Unable to launch web browser to retrieve playback license (hr=0x%08x)" , hr )); } delete [] pwszEscapedURL; @@ -606,7 +606,7 @@ HRESULT STDMETHODCALLTYPE CSimplePlayer::OnStatus( case WMT_MISSING_CODEC: { - DEBUG_LOG(( "Missing codec: (hr=0x%08x)\n" , hr )); + DEBUG_LOG(( "Missing codec: (hr=0x%08x)" , hr )); break; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CRCDebug.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CRCDebug.cpp index 4cbf29b7dc..c47b561516 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/CRCDebug.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/CRCDebug.cpp @@ -82,7 +82,7 @@ CRCVerification::~CRCVerification() { TheInGameUI->message(UnicodeString(L"GameLogic changed outside of GameLogic::update() - call Matt (x36804)!")); } - CRCDEBUG_LOG(("GameLogic changed outside of GameLogic::update()!!!\n")); + CRCDEBUG_LOG(("GameLogic changed outside of GameLogic::update()!!!")); } /**/ #endif @@ -102,7 +102,7 @@ void outputCRCDebugLines( void ) for (Int i=start; igetPath_UserData().str(), args[1]); } - DEBUG_LOG(("Looking for mod '%s'\n", modPath.str())); + DEBUG_LOG(("Looking for mod '%s'", modPath.str())); if (!TheLocalFileSystem->doesFileExist(modPath.str())) { - DEBUG_LOG(("Mod does not exist.\n")); + DEBUG_LOG(("Mod does not exist.")); return 2; // no such file/dir. } @@ -1081,7 +1081,7 @@ Int parseMod(char *args[], Int num) struct _stat statBuf; if (_stat(modPath.str(), &statBuf) != 0) { - DEBUG_LOG(("Could not _stat() mod.\n")); + DEBUG_LOG(("Could not _stat() mod.")); return 2; // could not stat the file/dir. } @@ -1089,12 +1089,12 @@ Int parseMod(char *args[], Int num) { if (!modPath.endsWith("\\") && !modPath.endsWith("/")) modPath.concat('\\'); - DEBUG_LOG(("Mod dir is '%s'.\n", modPath.str())); + DEBUG_LOG(("Mod dir is '%s'.", modPath.str())); TheWritableGlobalData->m_modDir = modPath; } else { - DEBUG_LOG(("Mod file is '%s'.\n", modPath.str())); + DEBUG_LOG(("Mod file is '%s'.", modPath.str())); TheWritableGlobalData->m_modBIG = modPath; } @@ -1405,7 +1405,7 @@ static void parseCommandLine(const CommandLineParam* params, int numParams) { DEBUG_LOG((" %s", argv[arg])); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); DebugSetFlags(debugFlags); // turn timestamps back on iff they were on before arg = 1; #endif // DEBUG_LOGGING diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp index f47af3fe48..63dc4a0b34 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp @@ -136,7 +136,7 @@ void DeepCRCSanityCheck::reset(void) fname.format("%sCRCAfter%dMaps.dat", TheGlobalData->getPath_UserData().str(), timesThrough); UnsignedInt thisCRC = TheGameLogic->getCRC( CRC_RECALC, fname ); - DEBUG_LOG(("DeepCRCSanityCheck: CRC is %X\n", thisCRC)); + DEBUG_LOG(("DeepCRCSanityCheck: CRC is %X", thisCRC)); DEBUG_ASSERTCRASH(timesThrough == 0 || thisCRC == lastCRC, ("CRC after reset did not match beginning CRC!\nNetwork games won't work after this.\nOld: 0x%8.8X, New: 0x%8.8X", lastCRC, thisCRC)); @@ -239,7 +239,7 @@ GameEngine::~GameEngine() void GameEngine::setFramesPerSecondLimit( Int fps ) { - DEBUG_LOG(("GameEngine::setFramesPerSecondLimit() - setting max fps to %d (TheGlobalData->m_useFpsLimit == %d)\n", fps, TheGlobalData->m_useFpsLimit)); + DEBUG_LOG(("GameEngine::setFramesPerSecondLimit() - setting max fps to %d (TheGlobalData->m_useFpsLimit == %d)", fps, TheGlobalData->m_useFpsLimit)); m_maxFPS = fps; } @@ -255,22 +255,22 @@ void GameEngine::init() #ifdef DEBUG_LOGGING if (TheVersion) { - DEBUG_LOG(("================================================================================\n")); + DEBUG_LOG(("================================================================================")); #if defined RTS_DEBUG const char *buildType = "Debug"; #else const char *buildType = "Release"; #endif - DEBUG_LOG(("Generals version %s (%s)\n", TheVersion->getAsciiVersion().str(), buildType)); - DEBUG_LOG(("Build date: %s\n", TheVersion->getAsciiBuildTime().str())); - DEBUG_LOG(("Build location: %s\n", TheVersion->getAsciiBuildLocation().str())); - DEBUG_LOG(("Built by: %s\n", TheVersion->getAsciiBuildUser().str())); - DEBUG_LOG(("================================================================================\n")); + DEBUG_LOG(("Generals version %s (%s)", TheVersion->getAsciiVersion().str(), buildType)); + DEBUG_LOG(("Build date: %s", TheVersion->getAsciiBuildTime().str())); + DEBUG_LOG(("Build location: %s", TheVersion->getAsciiBuildLocation().str())); + DEBUG_LOG(("Built by: %s", TheVersion->getAsciiBuildUser().str())); + DEBUG_LOG(("================================================================================")); } #endif #if defined(PERF_TIMERS) || defined(DUMP_PERF_STATS) - DEBUG_LOG(("Calculating CPU frequency for performance timers.\n")); + DEBUG_LOG(("Calculating CPU frequency for performance timers.")); InitPrecisionTimer(); #endif #ifdef PERF_TIMERS @@ -559,7 +559,7 @@ void GameEngine::init() xferCRC.close(); TheWritableGlobalData->m_iniCRC = xferCRC.getCRC(); - DEBUG_LOG(("INI CRC is 0x%8.8X\n", TheGlobalData->m_iniCRC)); + DEBUG_LOG(("INI CRC is 0x%8.8X", TheGlobalData->m_iniCRC)); TheSubsystemList->postProcessLoadAll(); @@ -873,7 +873,7 @@ void GameEngine::execute( void ) now = timeGetTime(); } //Int slept = now - prevTime; - //DEBUG_LOG(("delayed %d\n",slept)); + //DEBUG_LOG(("delayed %d",slept)); prevTime = now; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp index 8cffa7734c..1389dd15a9 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp @@ -1241,7 +1241,7 @@ UnsignedInt GlobalData::generateExeCRC() #define GENERALSMD_104_EAAPP_EXE_CRC 0xc4181eb9u exeCRC.set(GENERALSMD_104_CD_EXE_CRC); - DEBUG_LOG(("Fake EXE CRC is 0x%8.8X\n", exeCRC.get())); + DEBUG_LOG(("Fake EXE CRC is 0x%8.8X", exeCRC.get())); #else { @@ -1255,7 +1255,7 @@ UnsignedInt GlobalData::generateExeCRC() { exeCRC.computeCRC(crcBlock, amtRead); } - DEBUG_LOG(("EXE CRC is 0x%8.8X\n", exeCRC.get())); + DEBUG_LOG(("EXE CRC is 0x%8.8X", exeCRC.get())); fp->close(); fp = NULL; } @@ -1295,7 +1295,7 @@ UnsignedInt GlobalData::generateExeCRC() fp = NULL; } - DEBUG_LOG(("EXE+Version(%d.%d)+SCB CRC is 0x%8.8X\n", version >> 16, version & 0xffff, exeCRC.get())); + DEBUG_LOG(("EXE+Version(%d.%d)+SCB CRC is 0x%8.8X", version >> 16, version & 0xffff, exeCRC.get())); return exeCRC.get(); } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp index 59cf63dc6f..bd21f455a8 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp @@ -478,7 +478,7 @@ void INI::readLine( void ) if (s_xfer) { s_xfer->xferUser( m_buffer, sizeof( char ) * strlen( m_buffer ) ); - //DEBUG_LOG(("Xfer val is now 0x%8.8X in %s, line %s\n", ((XferCRC *)s_xfer)->getCRC(), + //DEBUG_LOG(("Xfer val is now 0x%8.8X in %s, line %s", ((XferCRC *)s_xfer)->getCRC(), //m_filename.str(), m_buffer)); } } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIMapCache.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIMapCache.cpp index 4f95569aa6..c26e7a3c4b 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIMapCache.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIMapCache.cpp @@ -194,7 +194,7 @@ void INI::parseMapCacheDefinition( INI* ini ) AsciiString lowerName = name; lowerName.toLower(); md.m_fileName = lowerName; -// DEBUG_LOG(("INI::parseMapCacheDefinition - adding %s to map cache\n", lowerName.str())); +// DEBUG_LOG(("INI::parseMapCacheDefinition - adding %s to map cache", lowerName.str())); (*TheMapCache)[lowerName] = md; } } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp index 1be51ef267..db531da003 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp @@ -116,7 +116,7 @@ void INI::parseWebpageURLDefinition( INI* ini ) getcwd(cwd, _MAX_PATH); url->m_url.format("file://%s\\Data\\%s\\%s", encodeURL(cwd).str(), GetRegistryLanguage().str(), url->m_url.str()+7); - DEBUG_LOG(("INI::parseWebpageURLDefinition() - converted URL to [%s]\n", url->m_url.str())); + DEBUG_LOG(("INI::parseWebpageURLDefinition() - converted URL to [%s]", url->m_url.str())); } } // end parseMusicTrackDefinition diff --git a/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp b/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp index c015087cb0..474ae8d21c 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp @@ -188,7 +188,7 @@ void InitPrecisionTimer() GetPrecisionTimer(&bogus[7]); } TheTicksToGetTicks = (bogus[7] - start) / (ITERS*8); - DEBUG_LOG(("TheTicksToGetTicks is %d (%f usec)\n",(int)TheTicksToGetTicks,TheTicksToGetTicks/s_ticksPerUSec)); + DEBUG_LOG(("TheTicksToGetTicks is %d (%f usec)",(int)TheTicksToGetTicks,TheTicksToGetTicks/s_ticksPerUSec)); #endif #endif @@ -383,7 +383,7 @@ void PerfGather::reset() } GetPrecisionTimer(&end); s_stopStartOverhead = (end - start) / (ITERS*8); - DEBUG_LOG(("s_stopStartOverhead is %d (%f usec)\n",(int)s_stopStartOverhead,s_stopStartOverhead/s_ticksPerUSec)); + DEBUG_LOG(("s_stopStartOverhead is %d (%f usec)",(int)s_stopStartOverhead,s_stopStartOverhead/s_ticksPerUSec)); } } @@ -612,7 +612,7 @@ void PerfTimer::outputInfo( void ) m_callCount, 1000.0f / avgTimePerFrame)); } else { - DEBUG_LOG(("%s\n" + DEBUG_LOG(("%s" "Average Time (per call): %.4f ms\n" "Average Time (per frame): %.4f ms\n" "Average calls per frame: %.2f\n" diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp index 34ab9806b1..6ebca097ad 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -176,7 +176,7 @@ AsciiString kindofMaskAsAsciiString(KindOfMaskType m) } void dumpBattlePlanBonuses(const BattlePlanBonuses *b, AsciiString name, const Player *p, const Object *o, AsciiString fname, Int line, Bool doDebugLog) { - CRCDEBUG_LOG(("dumpBattlePlanBonuses() %s:%d %s\n Player %d(%ls) object %d(%s) armor:%g/%8.8X bombardment:%d, holdTheLine:%d, searchAndDestroy:%d sight:%g/%8.8X, valid:%s invalid:%s\n", + CRCDEBUG_LOG(("dumpBattlePlanBonuses() %s:%d %s\n Player %d(%ls) object %d(%s) armor:%g/%8.8X bombardment:%d, holdTheLine:%d, searchAndDestroy:%d sight:%g/%8.8X, valid:%s invalid:%s", fname.str(), line, name.str(), (p)?p->getPlayerIndex():-1, (p)?((Player *)p)->getPlayerDisplayName().str():L"", (o)?o->getID():-1, (o)?o->getTemplate()->getName().str():"", b->m_armorScalar, AS_INT(b->m_armorScalar), @@ -186,7 +186,7 @@ void dumpBattlePlanBonuses(const BattlePlanBonuses *b, AsciiString name, const P kindofMaskAsAsciiString(b->m_invalidKindOf).str())); if (!doDebugLog) return; - DEBUG_LOG(("dumpBattlePlanBonuses() %s:%d %s\n Player %d(%ls) object %d(%s) armor:%g/%8.8X bombardment:%d, holdTheLine:%d, searchAndDestroy:%d sight:%g/%8.8X, valid:%s invalid:%s\n", + DEBUG_LOG(("dumpBattlePlanBonuses() %s:%d %s\n Player %d(%ls) object %d(%s) armor:%g/%8.8X bombardment:%d, holdTheLine:%d, searchAndDestroy:%d sight:%g/%8.8X, valid:%s invalid:%s", fname.str(), line, name.str(), (p)?p->getPlayerIndex():-1, (p)?((Player *)p)->getPlayerDisplayName().str():L"", (o)?o->getID():-1, (o)?o->getTemplate()->getName().str():"", b->m_armorScalar, AS_INT(b->m_armorScalar), @@ -2537,7 +2537,7 @@ Bool Player::addScience(ScienceType science) if (hasScience(science)) return false; - //DEBUG_LOG(("Adding Science %s\n",TheScienceStore->getInternalNameForScience(science).str())); + //DEBUG_LOG(("Adding Science %s",TheScienceStore->getInternalNameForScience(science).str())); m_sciences.push_back(science); @@ -2586,7 +2586,7 @@ Bool Player::addScience(ScienceType science) //============================================================================= void Player::addSciencePurchasePoints(Int delta) { - //DEBUG_LOG(("Adding SciencePurchasePoints %d -> %d\n",m_sciencePurchasePoints,m_sciencePurchasePoints+delta)); + //DEBUG_LOG(("Adding SciencePurchasePoints %d -> %d",m_sciencePurchasePoints,m_sciencePurchasePoints+delta)); Int oldSPP = m_sciencePurchasePoints; m_sciencePurchasePoints += delta; if (m_sciencePurchasePoints < 0) @@ -2696,7 +2696,7 @@ Bool Player::setRankLevel(Int newLevel) if (newLevel == m_rankLevel) return false; - //DEBUG_LOG(("Set Rank Level %d -> %d\n",m_rankLevel,newLevel)); + //DEBUG_LOG(("Set Rank Level %d -> %d",m_rankLevel,newLevel)); Int oldSPP = m_sciencePurchasePoints; @@ -2735,7 +2735,7 @@ Bool Player::setRankLevel(Int newLevel) m_rankLevel = newLevel; DEBUG_ASSERTCRASH(m_skillPoints >= m_levelDown && m_skillPoints < m_levelUp, ("hmm, wrong")); - //DEBUG_LOG(("Rank %d, Skill %d, down %d, up %d\n",m_rankLevel,m_skillPoints, m_levelDown, m_levelUp)); + //DEBUG_LOG(("Rank %d, Skill %d, down %d, up %d",m_rankLevel,m_skillPoints, m_levelDown, m_levelUp)); if (TheControlBar != NULL) { @@ -3521,7 +3521,7 @@ static void localApplyBattlePlanBonusesToObject( Object *obj, void *userData ) Object *objectToValidate = obj; Object *objectToModify = obj; - DEBUG_LOG(("localApplyBattlePlanBonusesToObject() - looking at object %d (%s)\n", + DEBUG_LOG(("localApplyBattlePlanBonusesToObject() - looking at object %d (%s)", (objectToValidate)?objectToValidate->getID():INVALID_ID, (objectToValidate)?objectToValidate->getTemplate()->getName().str():"")); @@ -3531,30 +3531,30 @@ static void localApplyBattlePlanBonusesToObject( Object *obj, void *userData ) if( isProjectile ) { objectToValidate = TheGameLogic->findObjectByID( obj->getProducerID() ); - DEBUG_LOG(("Object is a projectile - looking at object %d (%s) instead\n", + DEBUG_LOG(("Object is a projectile - looking at object %d (%s) instead", (objectToValidate)?objectToValidate->getID():INVALID_ID, (objectToValidate)?objectToValidate->getTemplate()->getName().str():"")); } if( objectToValidate && objectToValidate->isAnyKindOf( bonus->m_validKindOf ) ) { - DEBUG_LOG(("Is valid kindof\n")); + DEBUG_LOG(("Is valid kindof")); if( !objectToValidate->isAnyKindOf( bonus->m_invalidKindOf ) ) { - DEBUG_LOG(("Is not invalid kindof\n")); + DEBUG_LOG(("Is not invalid kindof")); //Quite the trek eh? Now we can apply the bonuses! if( !isProjectile ) { - DEBUG_LOG(("Is not projectile. Armor scalar is %g\n", bonus->m_armorScalar)); + DEBUG_LOG(("Is not projectile. Armor scalar is %g", bonus->m_armorScalar)); //Really important to not apply certain bonuses like health augmentation to projectiles! if( bonus->m_armorScalar != 1.0f ) { BodyModuleInterface *body = objectToModify->getBodyModule(); body->applyDamageScalar( bonus->m_armorScalar ); - CRCDEBUG_LOG(("Applying armor scalar of %g (%8.8X) to object %d (%ls) owned by player %d\n", + CRCDEBUG_LOG(("Applying armor scalar of %g (%8.8X) to object %d (%ls) owned by player %d", bonus->m_armorScalar, AS_INT(bonus->m_armorScalar), objectToModify->getID(), objectToModify->getTemplate()->getDisplayName().str(), objectToModify->getControllingPlayer()->getPlayerIndex())); - DEBUG_LOG(("After apply, armor scalar is %g\n", body->getDamageScalar())); + DEBUG_LOG(("After apply, armor scalar is %g", body->getDamageScalar())); } if( bonus->m_sightRangeScalar != 1.0f ) { @@ -3629,13 +3629,13 @@ void Player::applyBattlePlanBonusesForPlayerObjects( const BattlePlanBonuses *bo //Only allocate the battle plan bonuses if we actually use it! if( !m_battlePlanBonuses ) { - DEBUG_LOG(("Allocating new m_battlePlanBonuses\n")); + DEBUG_LOG(("Allocating new m_battlePlanBonuses")); m_battlePlanBonuses = newInstance( BattlePlanBonuses ); *m_battlePlanBonuses = *bonus; } else { - DEBUG_LOG(("Adding bonus into existing m_battlePlanBonuses\n")); + DEBUG_LOG(("Adding bonus into existing m_battlePlanBonuses")); DUMPBATTLEPLANBONUSES(m_battlePlanBonuses, this, NULL); //Just apply the differences by multiplying the scalars together (kindofs won't change) //These bonuses are used for new objects that are created or objects that are transferred @@ -3973,7 +3973,7 @@ void Player::crc( Xfer *xfer ) // Player battle plan bonuses Bool battlePlanBonus = m_battlePlanBonuses != NULL; xfer->xferBool( &battlePlanBonus ); - CRCDEBUG_LOG(("Player %d[%ls] %s battle plans\n", m_playerIndex, m_playerDisplayName.str(), (battlePlanBonus)?"has":"doesn't have")); + CRCDEBUG_LOG(("Player %d[%ls] %s battle plans", m_playerIndex, m_playerDisplayName.str(), (battlePlanBonus)?"has":"doesn't have")); if( m_battlePlanBonuses ) { CRCDUMPBATTLEPLANBONUSES(m_battlePlanBonuses, this, NULL); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp index 8f1a59e1b6..c24ef8dc78 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp @@ -147,7 +147,7 @@ void PlayerList::newGame() Bool exists; // throwaway, since we don't care if it exists if (d->getBool(TheKey_multiplayerIsLocal, &exists)) { - DEBUG_LOG(("Player %s is multiplayer local\n", pname.str())); + DEBUG_LOG(("Player %s is multiplayer local", pname.str())); setLocalPlayer(p); setLocal = true; } @@ -200,7 +200,7 @@ void PlayerList::newGame() } else { - DEBUG_LOG(("unknown enemy %s\n",tok.str())); + DEBUG_LOG(("unknown enemy %s",tok.str())); } } @@ -214,7 +214,7 @@ void PlayerList::newGame() } else { - DEBUG_LOG(("unknown ally %s\n",tok.str())); + DEBUG_LOG(("unknown ally %s",tok.str())); } } @@ -290,7 +290,7 @@ Team *PlayerList::validateTeam( AsciiString owner ) Team *t = TheTeamFactory->findTeam(owner); if (t) { - //DEBUG_LOG(("assigned obj %08lx to team %s\n",obj,owner.str())); + //DEBUG_LOG(("assigned obj %08lx to team %s",obj,owner.str())); } else { @@ -322,9 +322,9 @@ void PlayerList::setLocalPlayer(Player *player) #ifdef INTENSE_DEBUG if (player) { - DEBUG_LOG(("\n----------\n")); + DEBUG_LOG(("\n----------")); // did you know? you can use "%ls" to print a doublebyte string, even in a single-byte printf... - DEBUG_LOG(("Switching local players. The new player is named '%ls' (%s) and owns the following objects:\n", + DEBUG_LOG(("Switching local players. The new player is named '%ls' (%s) and owns the following objects:", player->getPlayerDisplayName().str(), TheNameKeyGenerator->keyToName(player->getPlayerNameKey()).str() )); @@ -335,9 +335,9 @@ void PlayerList::setLocalPlayer(Player *player) { DEBUG_LOG((" (NOT BUILDABLE)")); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } - DEBUG_LOG(("\n----------\n")); + DEBUG_LOG(("\n----------")); } #endif diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp index a0a36d0e23..2dd6866ccf 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp @@ -173,7 +173,7 @@ void InitRandom( UnsignedInt seed ) seedRandom(seed, theGameLogicSeed); theGameLogicBaseSeed = seed; #ifdef DEBUG_RANDOM_LOGIC -DEBUG_LOG(( "InitRandom %08lx\n",seed)); +DEBUG_LOG(( "InitRandom %08lx",seed)); #endif } @@ -188,7 +188,7 @@ void InitGameLogicRandom( UnsignedInt seed ) theGameLogicBaseSeed = seed; #endif #ifdef DEBUG_RANDOM_LOGIC -DEBUG_LOG(( "InitRandom Logic %08lx\n",seed)); +DEBUG_LOG(( "InitRandom Logic %08lx",seed)); #endif } @@ -220,7 +220,7 @@ Int GetGameLogicRandomValue( int lo, int hi, const char *file, int line ) /**/ #ifdef DEBUG_RANDOM_LOGIC -DEBUG_LOG(( "%d: GetGameLogicRandomValue = %d (%d - %d), %s line %d\n", +DEBUG_LOG(( "%d: GetGameLogicRandomValue = %d (%d - %d), %s line %d", TheGameLogic->getFrame(), rval, lo, hi, file, line )); #endif /**/ @@ -243,7 +243,7 @@ Int GetGameClientRandomValue( int lo, int hi, const char *file, int line ) /**/ #ifdef DEBUG_RANDOM_CLIENT -DEBUG_LOG(( "%d: GetGameClientRandomValue = %d (%d - %d), %s line %d\n", +DEBUG_LOG(( "%d: GetGameClientRandomValue = %d (%d - %d), %s line %d", TheGameLogic ? TheGameLogic->getFrame() : -1, rval, lo, hi, file, line )); #endif /**/ @@ -266,7 +266,7 @@ Int GetGameAudioRandomValue( int lo, int hi, const char *file, int line ) /**/ #ifdef DEBUG_RANDOM_AUDIO -DEBUG_LOG(( "%d: GetGameAudioRandomValue = %d (%d - %d), %s line %d\n", +DEBUG_LOG(( "%d: GetGameAudioRandomValue = %d (%d - %d), %s line %d", TheGameLogic->getFrame(), rval, lo, hi, file, line )); #endif /**/ @@ -290,7 +290,7 @@ Real GetGameLogicRandomValueReal( Real lo, Real hi, const char *file, int line ) DEBUG_ASSERTCRASH( rval >= lo && rval <= hi, ("Bad random val")); /**/ #ifdef DEBUG_RANDOM_LOGIC -DEBUG_LOG(( "%d: GetGameLogicRandomValueReal = %f, %s line %d\n", +DEBUG_LOG(( "%d: GetGameLogicRandomValueReal = %f, %s line %d", TheGameLogic->getFrame(), rval, file, line )); #endif /**/ @@ -314,7 +314,7 @@ Real GetGameClientRandomValueReal( Real lo, Real hi, const char *file, int line DEBUG_ASSERTCRASH( rval >= lo && rval <= hi, ("Bad random val")); /**/ #ifdef DEBUG_RANDOM_CLIENT -DEBUG_LOG(( "%d: GetGameClientRandomValueReal = %f, %s line %d\n", +DEBUG_LOG(( "%d: GetGameClientRandomValueReal = %f, %s line %d", TheGameLogic->getFrame(), rval, file, line )); #endif /**/ @@ -338,7 +338,7 @@ Real GetGameAudioRandomValueReal( Real lo, Real hi, const char *file, int line ) DEBUG_ASSERTCRASH( rval >= lo && rval <= hi, ("Bad random val")); /**/ #ifdef DEBUG_RANDOM_AUDIO -DEBUG_LOG(( "%d: GetGameAudioRandomValueReal = %f, %s line %d\n", +DEBUG_LOG(( "%d: GetGameAudioRandomValueReal = %f, %s line %d", TheGameLogic->getFrame(), rval, file, line )); #endif /**/ diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp index 7578c2f8e5..1a23e127e5 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp @@ -286,7 +286,7 @@ void RecorderClass::cleanUpReplayFile( void ) char fname[_MAX_PATH+1]; strncpy(fname, TheGlobalData->m_baseStatsDir.str(), _MAX_PATH); strncat(fname, m_fileName.str(), _MAX_PATH - strlen(fname)); - DEBUG_LOG(("Saving replay to %s\n", fname)); + DEBUG_LOG(("Saving replay to %s", fname)); AsciiString oldFname; oldFname.format("%s%s", getReplayDir().str(), m_fileName.str()); CopyFile(oldFname.str(), fname, TRUE); @@ -309,18 +309,18 @@ void RecorderClass::cleanUpReplayFile( void ) fileSize = ftell(fp); fclose(fp); fp = NULL; - DEBUG_LOG(("Log file size was %d\n", fileSize)); + DEBUG_LOG(("Log file size was %d", fileSize)); } const int MAX_DEBUG_SIZE = 65536; if (fileSize <= MAX_DEBUG_SIZE || TheGlobalData->m_saveAllStats) { - DEBUG_LOG(("Using CopyFile to copy %s\n", logFileName)); + DEBUG_LOG(("Using CopyFile to copy %s", logFileName)); CopyFile(logFileName, debugFname.str(), TRUE); } else { - DEBUG_LOG(("manual copy of %s\n", logFileName)); + DEBUG_LOG(("manual copy of %s", logFileName)); FILE *ifp = fopen(logFileName, "rb"); FILE *ofp = fopen(debugFname.str(), "wb"); if (ifp && ofp) @@ -495,7 +495,7 @@ void RecorderClass::updateRecord() msg->getArgument(0)->integer != GAME_NONE) { m_originalGameMode = msg->getArgument(0)->integer; - DEBUG_LOG(("RecorderClass::updateRecord() - original game is mode %d\n", m_originalGameMode)); + DEBUG_LOG(("RecorderClass::updateRecord() - original game is mode %d", m_originalGameMode)); lastFrame = 0; GameDifficulty diff = DIFFICULTY_NORMAL; if (msg->getArgumentCount() >= 2) @@ -642,7 +642,7 @@ void RecorderClass::startRecording(GameDifficulty diff, Int originalGameMode, In { TheSkirmishGameInfo->setCRCInterval(REPLAY_CRC_INTERVAL); theSlotList = GameInfoToAsciiString(TheSkirmishGameInfo); - DEBUG_LOG(("GameInfo String: %s\n",theSlotList.str())); + DEBUG_LOG(("GameInfo String: %s",theSlotList.str())); localIndex = 0; } else @@ -653,7 +653,7 @@ void RecorderClass::startRecording(GameDifficulty diff, Int originalGameMode, In } } logGameStart(theSlotList); - DEBUG_LOG(("RecorderClass::startRecording - theSlotList = %s\n", theSlotList.str())); + DEBUG_LOG(("RecorderClass::startRecording - theSlotList = %s", theSlotList.str())); // write slot list (starting spots, color, alliances, etc fwrite(theSlotList.str(), theSlotList.getLength() + 1, 1, m_file); @@ -694,7 +694,7 @@ void RecorderClass::startRecording(GameDifficulty diff, Int originalGameMode, In // Write maxFPS chosen fwrite(&maxFPS, sizeof(maxFPS), 1, m_file); - DEBUG_LOG(("RecorderClass::startRecording() - diff=%d, mode=%d, FPS=%d\n", diff, originalGameMode, maxFPS)); + DEBUG_LOG(("RecorderClass::startRecording() - diff=%d, mode=%d, FPS=%d", diff, originalGameMode, maxFPS)); /* // Write the map name. @@ -756,7 +756,7 @@ void RecorderClass::writeToFile(GameMessage * msg) { commandName.concat(tmp); } - //DEBUG_LOG(("RecorderClass::writeToFile - Adding %s command from player %d to TheCommandList on frame %d\n", + //DEBUG_LOG(("RecorderClass::writeToFile - Adding %s command from player %d to TheCommandList on frame %d", //commandName.str(), msg->getPlayerIndex(), TheGameLogic->getFrame())); #endif // DEBUG_LOGGING @@ -828,7 +828,7 @@ Bool RecorderClass::readReplayHeader(ReplayHeader& header) m_file = fopen(filepath.str(), "rb"); if (m_file == NULL) { - DEBUG_LOG(("Can't open %s (%s)\n", filepath.str(), header.filename.str())); + DEBUG_LOG(("Can't open %s (%s)", filepath.str(), header.filename.str())); return FALSE; } @@ -837,7 +837,7 @@ Bool RecorderClass::readReplayHeader(ReplayHeader& header) fread(&genrep, sizeof(char), 6, m_file); genrep[6] = 0; if (strncmp(genrep, "GENREP", 6)) { - DEBUG_LOG(("RecorderClass::readReplayHeader - replay file did not have GENREP at the start.\n")); + DEBUG_LOG(("RecorderClass::readReplayHeader - replay file did not have GENREP at the start.")); fclose(m_file); m_file = NULL; return FALSE; @@ -876,10 +876,10 @@ Bool RecorderClass::readReplayHeader(ReplayHeader& header) header.gameOptions = readAsciiString(); m_gameInfo.reset(); m_gameInfo.enterGame(); - DEBUG_LOG(("RecorderClass::readReplayHeader - GameInfo = %s\n", header.gameOptions.str())); + DEBUG_LOG(("RecorderClass::readReplayHeader - GameInfo = %s", header.gameOptions.str())); if (!ParseAsciiStringToGameInfo(&m_gameInfo, header.gameOptions)) { - DEBUG_LOG(("RecorderClass::readReplayHeader - replay file did not have a valid GameInfo string.\n")); + DEBUG_LOG(("RecorderClass::readReplayHeader - replay file did not have a valid GameInfo string.")); fclose(m_file); m_file = NULL; return FALSE; @@ -890,7 +890,7 @@ Bool RecorderClass::readReplayHeader(ReplayHeader& header) header.localPlayerIndex = atoi(playerIndex.str()); if (header.localPlayerIndex < -1 || header.localPlayerIndex >= MAX_SLOTS) { - DEBUG_LOG(("RecorderClass::readReplayHeader - invalid local slot number.\n")); + DEBUG_LOG(("RecorderClass::readReplayHeader - invalid local slot number.")); m_gameInfo.endGame(); m_gameInfo.reset(); fclose(m_file); @@ -1004,20 +1004,20 @@ void CRCInfo::addCRC(UnsignedInt val) } m_data.push_back(val); - //DEBUG_LOG(("CRCInfo::addCRC() - crc %8.8X pushes list to %d entries (full=%d)\n", val, m_data.size(), !m_data.empty())); + //DEBUG_LOG(("CRCInfo::addCRC() - crc %8.8X pushes list to %d entries (full=%d)", val, m_data.size(), !m_data.empty())); } UnsignedInt CRCInfo::readCRC(void) { if (m_data.empty()) { - DEBUG_LOG(("CRCInfo::readCRC() - bailing, full=0, size=%d\n", m_data.size())); + DEBUG_LOG(("CRCInfo::readCRC() - bailing, full=0, size=%d", m_data.size())); return 0; } UnsignedInt val = m_data.front(); m_data.pop_front(); - //DEBUG_LOG(("CRCInfo::readCRC() - returning %8.8X, full=%d, size=%d\n", val, !m_data.empty(), m_data.size())); + //DEBUG_LOG(("CRCInfo::readCRC() - returning %8.8X, full=%d, size=%d", val, !m_data.empty(), m_data.size())); return val; } @@ -1030,7 +1030,7 @@ void RecorderClass::handleCRCMessage(UnsignedInt newCRC, Int playerIndex, Bool f { if (fromPlayback) { - //DEBUG_LOG(("RecorderClass::handleCRCMessage() - Adding CRC of %X from %d to m_crcInfo\n", newCRC, playerIndex)); + //DEBUG_LOG(("RecorderClass::handleCRCMessage() - Adding CRC of %X from %d to m_crcInfo", newCRC, playerIndex)); m_crcInfo->addCRC(newCRC); return; } @@ -1045,7 +1045,7 @@ void RecorderClass::handleCRCMessage(UnsignedInt newCRC, Int playerIndex, Bool f if (samePlayer || (localPlayerIndex < 0)) { UnsignedInt playbackCRC = m_crcInfo->readCRC(); - //DEBUG_LOG(("RecorderClass::handleCRCMessage() - Comparing CRCs of InGame:%8.8X Replay:%8.8X Frame:%d from Player %d\n", + //DEBUG_LOG(("RecorderClass::handleCRCMessage() - Comparing CRCs of InGame:%8.8X Replay:%8.8X Frame:%d from Player %d", // playbackCRC, newCRC, TheGameLogic->getFrame()-m_crcInfo->GetQueueSize()-1, playerIndex)); if (TheGameLogic->getFrame() > 0 && newCRC != playbackCRC && !m_crcInfo->sawCRCMismatch()) { @@ -1070,7 +1070,7 @@ void RecorderClass::handleCRCMessage(UnsignedInt newCRC, Int playerIndex, Bool f const UnicodeString mismatchDetailsStr = TheGameText->FETCH_OR_SUBSTITUTE("GUI:CRCMismatchDetails", L"InGame:%8.8X Replay:%8.8X Frame:%d"); TheInGameUI->message(mismatchDetailsStr, playbackCRC, newCRC, mismatchFrame); - DEBUG_LOG(("Replay has gone out of sync!\nInGame:%8.8X Replay:%8.8X\nFrame:%d\n", + DEBUG_LOG(("Replay has gone out of sync!\nInGame:%8.8X Replay:%8.8X\nFrame:%d", playbackCRC, newCRC, mismatchFrame)); // Print Mismatch in case we are simulating replays from console. @@ -1085,7 +1085,7 @@ void RecorderClass::handleCRCMessage(UnsignedInt newCRC, Int playerIndex, Bool f return; } - //DEBUG_LOG(("RecorderClass::handleCRCMessage() - Skipping CRC of %8.8X from %d (our index is %d)\n", newCRC, playerIndex, localPlayerIndex)); + //DEBUG_LOG(("RecorderClass::handleCRCMessage() - Skipping CRC of %8.8X from %d (our index is %d)", newCRC, playerIndex, localPlayerIndex)); } /** @@ -1197,7 +1197,7 @@ Bool RecorderClass::playbackFile(AsciiString filename) #ifdef DEBUG_LOGGING if (header.localPlayerIndex >= 0) { - DEBUG_LOG(("Local player is %ls (slot %d, IP %8.8X)\n", + DEBUG_LOG(("Local player is %ls (slot %d, IP %8.8X)", m_gameInfo.getSlot(header.localPlayerIndex)->getName().str(), header.localPlayerIndex, m_gameInfo.getSlot(header.localPlayerIndex)->getIP())); } #endif @@ -1205,7 +1205,7 @@ Bool RecorderClass::playbackFile(AsciiString filename) Bool isMultiplayer = m_gameInfo.getSlot(header.localPlayerIndex)->getIP() != 0; m_crcInfo = NEW CRCInfo(header.localPlayerIndex, isMultiplayer); REPLAY_CRC_INTERVAL = m_gameInfo.getCRCInterval(); - DEBUG_LOG(("Player index is %d, replay CRC interval is %d\n", m_crcInfo->getLocalPlayer(), REPLAY_CRC_INTERVAL)); + DEBUG_LOG(("Player index is %d, replay CRC interval is %d", m_crcInfo->getLocalPlayer(), REPLAY_CRC_INTERVAL)); Int difficulty = 0; fread(&difficulty, sizeof(difficulty), 1, m_file); @@ -1218,7 +1218,7 @@ Bool RecorderClass::playbackFile(AsciiString filename) Int maxFPS = 0; fread(&maxFPS, sizeof(maxFPS), 1, m_file); - DEBUG_LOG(("RecorderClass::playbackFile() - original game was mode %d\n", m_originalGameMode)); + DEBUG_LOG(("RecorderClass::playbackFile() - original game was mode %d", m_originalGameMode)); // TheSuperHackers @fix helmutbuhler 03/04/2025 // In case we restart a replay, we need to clear the command list. @@ -1313,7 +1313,7 @@ AsciiString RecorderClass::readAsciiString() { void RecorderClass::readNextFrame() { Int retcode = fread(&m_nextFrame, sizeof(m_nextFrame), 1, m_file); if (retcode != 1) { - DEBUG_LOG(("RecorderClass::readNextFrame - fread failed on frame %d\n", TheGameLogic->getFrame())); + DEBUG_LOG(("RecorderClass::readNextFrame - fread failed on frame %d", TheGameLogic->getFrame())); m_nextFrame = -1; stopPlayback(); } @@ -1326,7 +1326,7 @@ void RecorderClass::appendNextCommand() { GameMessage::Type type; Int retcode = fread(&type, sizeof(type), 1, m_file); if (retcode != 1) { - DEBUG_LOG(("RecorderClass::appendNextCommand - fread failed on frame %d\n", m_nextFrame/*TheGameLogic->getFrame()*/)); + DEBUG_LOG(("RecorderClass::appendNextCommand - fread failed on frame %d", m_nextFrame/*TheGameLogic->getFrame()*/)); return; } @@ -1357,7 +1357,7 @@ void RecorderClass::appendNextCommand() { #endif if (logCommand) { - DEBUG_LOG(("RecorderClass::appendNextCommand - Adding %s command from player %d to TheCommandList on frame %d\n", + DEBUG_LOG(("RecorderClass::appendNextCommand - Adding %s command from player %d to TheCommandList on frame %d", commandName.str(), (type == GameMessage::MSG_BEGIN_NETWORK_MESSAGES)?0:msg->getPlayerIndex(), m_nextFrame/*TheGameLogic->getFrame()*/)); } #endif @@ -1424,7 +1424,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Integer argument: %d (%8.8X)\n", theint, theint)); + DEBUG_LOG(("Integer argument: %d (%8.8X)", theint, theint)); } #endif } else if (type == ARGUMENTDATATYPE_REAL) { @@ -1434,7 +1434,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Real argument: %g (%8.8X)\n", thereal, *(int *)&thereal)); + DEBUG_LOG(("Real argument: %g (%8.8X)", thereal, *(int *)&thereal)); } #endif } else if (type == ARGUMENTDATATYPE_BOOLEAN) { @@ -1444,7 +1444,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Bool argument: %d\n", thebool)); + DEBUG_LOG(("Bool argument: %d", thebool)); } #endif } else if (type == ARGUMENTDATATYPE_OBJECTID) { @@ -1454,7 +1454,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Object ID argument: %d\n", theid)); + DEBUG_LOG(("Object ID argument: %d", theid)); } #endif } else if (type == ARGUMENTDATATYPE_DRAWABLEID) { @@ -1464,7 +1464,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Drawable ID argument: %d\n", theid)); + DEBUG_LOG(("Drawable ID argument: %d", theid)); } #endif } else if (type == ARGUMENTDATATYPE_TEAMID) { @@ -1474,7 +1474,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Team ID argument: %d\n", theid)); + DEBUG_LOG(("Team ID argument: %d", theid)); } #endif } else if (type == ARGUMENTDATATYPE_LOCATION) { @@ -1484,7 +1484,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Coord3D argument: %g %g %g (%8.8X %8.8X %8.8X)\n", loc.x, loc.y, loc.z, + DEBUG_LOG(("Coord3D argument: %g %g %g (%8.8X %8.8X %8.8X)", loc.x, loc.y, loc.z, *(int *)&loc.x, *(int *)&loc.y, *(int *)&loc.z)); } #endif @@ -1495,7 +1495,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Pixel argument: %d,%d\n", pixel.x, pixel.y)); + DEBUG_LOG(("Pixel argument: %d,%d", pixel.x, pixel.y)); } #endif } else if (type == ARGUMENTDATATYPE_PIXELREGION) { @@ -1505,7 +1505,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Pixel Region argument: %d,%d -> %d,%d\n", reg.lo.x, reg.lo.y, reg.hi.x, reg.hi.y)); + DEBUG_LOG(("Pixel Region argument: %d,%d -> %d,%d", reg.lo.x, reg.lo.y, reg.hi.x, reg.hi.y)); } #endif } else if (type == ARGUMENTDATATYPE_TIMESTAMP) { // Not to be confused with Terrance Stamp... Kneel before Zod!!! @@ -1515,7 +1515,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("Timestamp argument: %d\n", stamp)); + DEBUG_LOG(("Timestamp argument: %d", stamp)); } #endif } else if (type == ARGUMENTDATATYPE_WIDECHAR) { @@ -1525,7 +1525,7 @@ void RecorderClass::readArgument(GameMessageArgumentDataType type, GameMessage * #ifdef DEBUG_LOGGING if (m_doingAnalysis) { - DEBUG_LOG(("WideChar argument: %d (%lc)\n", theid, theid)); + DEBUG_LOG(("WideChar argument: %d (%lc)", theid, theid)); } #endif } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/StateMachine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/StateMachine.cpp index 605999d9e3..0494bfbda1 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/StateMachine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/StateMachine.cpp @@ -171,7 +171,7 @@ StateReturnType State::friend_checkForTransitions( StateReturnType status ) #ifdef STATE_MACHINE_DEBUG if (getMachine()->getWantsDebugOutput()) { - DEBUG_LOG(("%d '%s' -- '%s' condition '%s' returned true!\n", TheGameLogic->getFrame(), getMachineOwner()->getTemplate()->getName().str(), + DEBUG_LOG(("%d '%s' -- '%s' condition '%s' returned true!", TheGameLogic->getFrame(), getMachineOwner()->getTemplate()->getName().str(), getMachine()->getName().str(), it->description ? it->description : "[no description]")); } #endif @@ -229,7 +229,7 @@ StateReturnType State::friend_checkForSleepTransitions( StateReturnType status ) #ifdef STATE_MACHINE_DEBUG if (getMachine()->getWantsDebugOutput()) { - DEBUG_LOG(("%d '%s' -- '%s' condition '%s' returned true!\n", TheGameLogic->getFrame(), getMachineOwner()->getTemplate()->getName().str(), + DEBUG_LOG(("%d '%s' -- '%s' condition '%s' returned true!", TheGameLogic->getFrame(), getMachineOwner()->getTemplate()->getName().str(), getMachine()->getName().str(), it->description ? it->description : "[no description]")); } #endif @@ -335,7 +335,7 @@ void StateMachine::internalClear() #ifdef STATE_MACHINE_DEBUG if (getWantsDebugOutput()) { - DEBUG_LOG(("%d '%s'%x -- '%s' %x internalClear()\n", TheGameLogic->getFrame(), m_owner->getTemplate()->getName().str(), m_owner, m_name.str(), this)); + DEBUG_LOG(("%d '%s'%x -- '%s' %x internalClear()", TheGameLogic->getFrame(), m_owner->getTemplate()->getName().str(), m_owner, m_name.str(), this)); } #endif } @@ -350,8 +350,8 @@ void StateMachine::clear() if (m_locked) { #ifdef STATE_MACHINE_DEBUG - if (m_currentState) DEBUG_LOG((" cur state '%s'\n", m_currentState->getName().str())); - DEBUG_LOG(("machine is locked (by %s), cannot be cleared (Please don't ignore; this generally indicates a potential logic flaw)\n",m_lockedby)); + if (m_currentState) DEBUG_LOG((" cur state '%s'", m_currentState->getName().str())); + DEBUG_LOG(("machine is locked (by %s), cannot be cleared (Please don't ignore; this generally indicates a potential logic flaw)",m_lockedby)); #endif return; } @@ -375,8 +375,8 @@ StateReturnType StateMachine::resetToDefaultState() if (m_locked) { #ifdef STATE_MACHINE_DEBUG - if (m_currentState) DEBUG_LOG((" cur state '%s'\n", m_currentState->getName().str())); - DEBUG_LOG(("machine is locked (by %s), cannot be cleared (Please don't ignore; this generally indicates a potential logic flaw)\n",m_lockedby)); + if (m_currentState) DEBUG_LOG((" cur state '%s'", m_currentState->getName().str())); + DEBUG_LOG(("machine is locked (by %s), cannot be cleared (Please don't ignore; this generally indicates a potential logic flaw)",m_lockedby)); #endif return STATE_FAILURE; } @@ -521,14 +521,14 @@ State *StateMachine::internalGetState( StateID id ) if (i == m_stateMap.end()) { DEBUG_CRASH( ("StateMachine::internalGetState(): Invalid state for object %s using state %d", m_owner->getTemplate()->getName().str(), id) ); - DEBUG_LOG(("Transisioning to state #d\n", (Int)id)); - DEBUG_LOG(("Attempting to recover - locating default state...\n")); + DEBUG_LOG(("Transisioning to state #d", (Int)id)); + DEBUG_LOG(("Attempting to recover - locating default state...")); i = m_stateMap.find(m_defaultStateID); if (i == m_stateMap.end()) { - DEBUG_LOG(("Failed to located default state. Aborting...\n")); + DEBUG_LOG(("Failed to located default state. Aborting...")); throw ERROR_BAD_ARG; } else { - DEBUG_LOG(("Located default state to recover.\n")); + DEBUG_LOG(("Located default state to recover.")); } } @@ -547,8 +547,8 @@ StateReturnType StateMachine::setState( StateID newStateID ) if (m_locked) { #ifdef STATE_MACHINE_DEBUG - if (m_currentState) DEBUG_LOG((" cur state '%s'\n", m_currentState->getName().str())); - DEBUG_LOG(("machine is locked (by %s), cannot be cleared (Please don't ignore; this generally indicates a potential logic flaw)\n",m_lockedby)); + if (m_currentState) DEBUG_LOG((" cur state '%s'", m_currentState->getName().str())); + DEBUG_LOG(("machine is locked (by %s), cannot be cleared (Please don't ignore; this generally indicates a potential logic flaw)",m_lockedby)); #endif return STATE_CONTINUE; } @@ -600,9 +600,9 @@ StateReturnType StateMachine::internalSetState( StateID newStateID ) DEBUG_LOG((" INVALID_STATE_ID ")); } if (newState) { - DEBUG_LOG(("enter '%s' \n", newState->getName().str())); + DEBUG_LOG(("enter '%s' ", newState->getName().str())); } else { - DEBUG_LOG(("to INVALID_STATE\n")); + DEBUG_LOG(("to INVALID_STATE")); } } #endif @@ -703,8 +703,8 @@ StateReturnType StateMachine::initDefaultState() if (i == m_stateMap.end()) { DEBUG_LOG(("\nState %s(%d) : ", state->getName().str(), id)); - DEBUG_LOG(("Transition %d not found\n", curID)); - DEBUG_LOG(("This MUST BE FIXED!!!jba\n")); + DEBUG_LOG(("Transition %d not found", curID)); + DEBUG_LOG(("This MUST BE FIXED!!!jba")); DEBUG_CRASH(("Invalid transition.")); } else { State *st = (*i).second; @@ -761,7 +761,7 @@ void StateMachine::halt() #ifdef STATE_MACHINE_DEBUG if (getWantsDebugOutput()) { - DEBUG_LOG(("%d '%s' -- '%s' %x halt()\n", TheGameLogic->getFrame(), m_owner->getTemplate()->getName().str(), m_name.str(), this)); + DEBUG_LOG(("%d '%s' -- '%s' %x halt()", TheGameLogic->getFrame(), m_owner->getTemplate()->getName().str(), m_name.str(), this)); } #endif } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp index 9d6d4a58d5..26a1ccdbf6 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp @@ -158,7 +158,7 @@ void ArchiveFileSystem::loadIntoDirectoryTree(const ArchiveFile *archiveFile, co AsciiString path2; path2 = debugpath; path2.concat(token); -// DEBUG_LOG(("ArchiveFileSystem::loadIntoDirectoryTree - adding file %s, archived in %s\n", path2.str(), archiveFilename.str())); +// DEBUG_LOG(("ArchiveFileSystem::loadIntoDirectoryTree - adding file %s, archived in %s", path2.str(), archiveFilename.str())); dirInfo->m_files[token] = archiveFilename; } @@ -172,14 +172,14 @@ void ArchiveFileSystem::loadMods() { ArchiveFile *archiveFile = openArchiveFile(TheGlobalData->m_modBIG.str()); if (archiveFile != NULL) { - DEBUG_LOG(("ArchiveFileSystem::loadMods - loading %s into the directory tree.\n", TheGlobalData->m_modBIG.str())); + DEBUG_LOG(("ArchiveFileSystem::loadMods - loading %s into the directory tree.", TheGlobalData->m_modBIG.str())); loadIntoDirectoryTree(archiveFile, TheGlobalData->m_modBIG, TRUE); m_archiveFileMap[TheGlobalData->m_modBIG] = archiveFile; - DEBUG_LOG(("ArchiveFileSystem::loadMods - %s inserted into the archive file map.\n", TheGlobalData->m_modBIG.str())); + DEBUG_LOG(("ArchiveFileSystem::loadMods - %s inserted into the archive file map.", TheGlobalData->m_modBIG.str())); } else { - DEBUG_LOG(("ArchiveFileSystem::loadMods - could not openArchiveFile(%s)\n", TheGlobalData->m_modBIG.str())); + DEBUG_LOG(("ArchiveFileSystem::loadMods - could not openArchiveFile(%s)", TheGlobalData->m_modBIG.str())); } } @@ -283,14 +283,14 @@ AsciiString ArchiveFileSystem::getArchiveFilenameForFile(const AsciiString& file // the directory doesn't exist, so return NULL // dump the directories; - //DEBUG_LOG(("directory %s not found in %s in archive file system\n", token.str(), debugpath.str())); - //DEBUG_LOG(("directories in %s in archive file system are:\n", debugpath.str())); + //DEBUG_LOG(("directory %s not found in %s in archive file system", token.str(), debugpath.str())); + //DEBUG_LOG(("directories in %s in archive file system are:", debugpath.str())); //ArchivedDirectoryInfoMap::const_iterator it = dirInfo->m_directories.begin(); //while (it != dirInfo->m_directories.end()) { - // DEBUG_LOG(("\t%s\n", it->second.m_directoryName.str())); + // DEBUG_LOG(("\t%s", it->second.m_directoryName.str())); // it++; //} - //DEBUG_LOG(("end of directory list.\n")); + //DEBUG_LOG(("end of directory list.")); return AsciiString::TheEmptyString; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/AsciiString.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/AsciiString.cpp index 60b757f5e0..2848a1d87d 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/AsciiString.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/AsciiString.cpp @@ -115,7 +115,7 @@ void AsciiString::debugIgnoreLeaks() } else { - DEBUG_LOG(("cannot ignore the leak (no data)\n")); + DEBUG_LOG(("cannot ignore the leak (no data)")); } #endif } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp index 4b3ed4fca9..3544526a24 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp @@ -66,32 +66,32 @@ Bool CachedFileInputStream::open(AsciiString path) if (CompressionManager::isDataCompressed(m_buffer, m_size) == 0) { - //DEBUG_LOG(("CachedFileInputStream::open() - file %s is uncompressed at %d bytes!\n", path.str(), m_size)); + //DEBUG_LOG(("CachedFileInputStream::open() - file %s is uncompressed at %d bytes!", path.str(), m_size)); } else { Int uncompLen = CompressionManager::getUncompressedSize(m_buffer, m_size); - //DEBUG_LOG(("CachedFileInputStream::open() - file %s is compressed! It should go from %d to %d\n", path.str(), + //DEBUG_LOG(("CachedFileInputStream::open() - file %s is compressed! It should go from %d to %d", path.str(), // m_size, uncompLen)); char *uncompBuffer = NEW char[uncompLen]; Int actualLen = CompressionManager::decompressData(m_buffer, m_size, uncompBuffer, uncompLen); if (actualLen == uncompLen) { - //DEBUG_LOG(("Using uncompressed data\n")); + //DEBUG_LOG(("Using uncompressed data")); delete[] m_buffer; m_buffer = uncompBuffer; m_size = uncompLen; } else { - //DEBUG_LOG(("Decompression failed - using compressed data\n")); + //DEBUG_LOG(("Decompression failed - using compressed data")); // decompression failed. Maybe we invalidly thought it was compressed? delete[] uncompBuffer; } } //if (m_size >= 4) //{ - // DEBUG_LOG(("File starts as '%c%c%c%c'\n", m_buffer[0], m_buffer[1], + // DEBUG_LOG(("File starts as '%c%c%c%c'", m_buffer[0], m_buffer[1], // m_buffer[2], m_buffer[3])); //} @@ -295,7 +295,7 @@ void DataChunkOutput::openDataChunk( const char *name, DataChunkVersionType ver // remember this m_tmp_file position so we can write the real data size later c->filepos = ::ftell(m_tmp_file); #ifdef VERBOSE - DEBUG_LOG(("Writing chunk %s at %d (%x)\n", name, ::ftell(m_tmp_file), ::ftell(m_tmp_file))); + DEBUG_LOG(("Writing chunk %s at %d (%x)", name, ::ftell(m_tmp_file), ::ftell(m_tmp_file))); #endif // store a placeholder for the data size Int dummy = 0xffff; @@ -328,7 +328,7 @@ void DataChunkOutput::closeDataChunk( void ) // pop the chunk off the stack OutputChunk *c = m_chunkStack; #ifdef VERBOSE - DEBUG_LOG(("Closing chunk %s at %d (%x)\n", m_contents.getName(c->id).str(), here, here)); + DEBUG_LOG(("Closing chunk %s at %d (%x)", m_contents.getName(c->id).str(), here, here)); #endif m_chunkStack = m_chunkStack->next; deleteInstance(c); @@ -725,7 +725,7 @@ AsciiString DataChunkInput::openDataChunk(DataChunkVersionType *ver ) c->id = 0; c->version = 0; c->dataSize = 0; - //DEBUG_LOG(("Opening data chunk at offset %d (%x)\n", m_file->tell(), m_file->tell())); + //DEBUG_LOG(("Opening data chunk at offset %d (%x)", m_file->tell(), m_file->tell())); // read the chunk ID m_file->read( (char *)&c->id, sizeof(UnsignedInt) ); decrementDataLeft( sizeof(UnsignedInt) ); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Directory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/Directory.cpp index 9b4754eefb..bd32e6c3b7 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/Directory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/Directory.cpp @@ -53,7 +53,7 @@ void FileInfo::set( const WIN32_FIND_DATA& info ) modTime = FileTimeToTimet(info.ftLastWriteTime); attributes = info.dwFileAttributes; filesize = info.nFileSizeLow; - //DEBUG_LOG(("FileInfo::set(): fname=%s, size=%d\n", filename.str(), filesize)); + //DEBUG_LOG(("FileInfo::set(): fname=%s, size=%d", filename.str(), filesize)); } //------------------------------------------------------------------------------------------------- @@ -67,7 +67,7 @@ Directory::Directory( const AsciiString& dirPath ) : m_dirPath(dirPath) // sanity if( m_dirPath.isEmpty() ) { - DEBUG_LOG(( "Empty dirname\n")); + DEBUG_LOG(( "Empty dirname")); return; } @@ -77,7 +77,7 @@ Directory::Directory( const AsciiString& dirPath ) : m_dirPath(dirPath) // switch into the directory provided if( SetCurrentDirectory( m_dirPath.str() ) == 0 ) { - DEBUG_LOG(( "Can't set directory '%s'\n", m_dirPath.str() )); + DEBUG_LOG(( "Can't set directory '%s'", m_dirPath.str() )); return; } @@ -86,7 +86,7 @@ Directory::Directory( const AsciiString& dirPath ) : m_dirPath(dirPath) hFile = FindFirstFile( "*", &item); if( hFile == INVALID_HANDLE_VALUE ) { - DEBUG_LOG(( "Can't search directory '%s'\n", m_dirPath.str() )); + DEBUG_LOG(( "Can't search directory '%s'", m_dirPath.str() )); done = true; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/FileSystem.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/FileSystem.cpp index aed60a6b17..ce6da86cb2 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/FileSystem.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/FileSystem.cpp @@ -275,14 +275,14 @@ Bool FileSystem::areMusicFilesOnCD() return TRUE; #else if (!TheCDManager) { - DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - No CD Manager; returning false\n")); + DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - No CD Manager; returning false")); return FALSE; } AsciiString cdRoot; Int dc = TheCDManager->driveCount(); for (Int i = 0; i < dc; ++i) { - DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - checking drive %d\n", i)); + DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - checking drive %d", i)); CDDriveInterface *cdi = TheCDManager->getDrive(i); if (!cdi) { continue; @@ -292,11 +292,11 @@ Bool FileSystem::areMusicFilesOnCD() if (!cdRoot.endsWith("\\")) cdRoot.concat("\\"); cdRoot.concat("genseczh.big"); - DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - checking for %s\n", cdRoot.str())); + DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - checking for %s", cdRoot.str())); File *musicBig = TheLocalFileSystem->openFile(cdRoot.str()); if (musicBig) { - DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - found it!\n")); + DEBUG_LOG(("FileSystem::areMusicFilesOnCD() - found it!")); musicBig->close(); return TRUE; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp index 2f6a9569dc..1f07416773 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp @@ -649,7 +649,7 @@ Bool FunctionLexicon::validate( void ) if( sourceEntry->func == lookAtEntry->func ) { - DEBUG_LOG(( "WARNING! Function lexicon entries match same address! '%s' and '%s'\n", + DEBUG_LOG(( "WARNING! Function lexicon entries match same address! '%s' and '%s'", sourceEntry->name, lookAtEntry->name )); valid = FALSE; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp index 309527ff54..c9451cffec 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp @@ -126,7 +126,7 @@ DECLARE_PERF_TIMER(MemoryPoolInitFilling) s_initFillerValue |= (~(s_initFillerValue << 4)) & 0xf0; s_initFillerValue |= (s_initFillerValue << 8); s_initFillerValue |= (s_initFillerValue << 16); - DEBUG_LOG(("Setting MemoryPool initFillerValue to %08x (index %d)\n",s_initFillerValue,index)); + DEBUG_LOG(("Setting MemoryPool initFillerValue to %08x (index %d)",s_initFillerValue,index)); } #endif @@ -762,7 +762,7 @@ Bool BlockCheckpointInfo::shouldBeInReport(Int flags, Int startCheckpoint, Int e if (!bi) { - DEBUG_LOG(("%s,%32s,%6s,%6s,%6s,%s\n",PREPEND,"POOLNAME","BLKSZ","ALLOC","FREED","BLOCKNAME")); + DEBUG_LOG(("%s,%32s,%6s,%6s,%6s,%s",PREPEND,"POOLNAME","BLKSZ","ALLOC","FREED","BLOCKNAME")); } else { @@ -772,7 +772,7 @@ Bool BlockCheckpointInfo::shouldBeInReport(Int flags, Int startCheckpoint, Int e if (bi->shouldBeInReport(flags, startCheckpoint, endCheckpoint)) { - DEBUG_LOG(("%s,%32s,%6d,%6d,%6d,%s\n",PREPEND,poolName,bi->m_blockSize,bi->m_allocCheckpoint,bi->m_freeCheckpoint,bi->m_debugLiteralTagString)); + DEBUG_LOG(("%s,%32s,%6d,%6d,%6d,%s",PREPEND,poolName,bi->m_blockSize,bi->m_allocCheckpoint,bi->m_freeCheckpoint,bi->m_debugLiteralTagString)); #ifdef MEMORYPOOL_STACKTRACE if (flags & REPORT_CP_STACKTRACE) { @@ -1013,7 +1013,7 @@ Int MemoryPoolSingleBlock::debugSingleBlockReportLeak(const char* owner) } else { - DEBUG_LOG(("Leaked a block of size %d, tagstring %s, from pool/dma %s\n",m_logicalSize,m_debugLiteralTagString,owner)); + DEBUG_LOG(("Leaked a block of size %d, tagstring %s, from pool/dma %s",m_logicalSize,m_debugLiteralTagString,owner)); } #ifdef MEMORYPOOL_SINGLEBLOCK_GETS_STACKTRACE @@ -1462,7 +1462,7 @@ void Checkpointable::debugCheckpointReport( Int flags, Int startCheckpoint, Int if (m_cpiEverFailed) { - DEBUG_LOG((" *** WARNING *** info on freed blocks may be inaccurate or incomplete!\n")); + DEBUG_LOG((" *** WARNING *** info on freed blocks may be inaccurate or incomplete!")); } for (BlockCheckpointInfo *bi = m_firstCheckpointInfo; bi; bi = bi->getNext()) @@ -1857,13 +1857,13 @@ void MemoryPool::removeFromList(MemoryPool **pHead) if (!pool) { - DEBUG_LOG(("%s,%32s,%6s,%6s,%6s,%6s,%6s,%6s\n",PREPEND,"POOLNAME","BLKSZ","INIT","OVRFL","USED","TOTAL","PEAK")); + DEBUG_LOG(("%s,%32s,%6s,%6s,%6s,%6s,%6s,%6s",PREPEND,"POOLNAME","BLKSZ","INIT","OVRFL","USED","TOTAL","PEAK")); if( fp ) fprintf( fp, "%s,%32s,%6s,%6s,%6s,%6s,%6s,%6s\n",PREPEND,"POOLNAME","BLKSZ","INIT","OVRFL","USED","TOTAL","PEAK" ); } else { - DEBUG_LOG(("%s,%32s,%6d,%6d,%6d,%6d,%6d,%6d\n",PREPEND, + DEBUG_LOG(("%s,%32s,%6d,%6d,%6d,%6d,%6d,%6d",PREPEND, pool->m_poolName,pool->m_allocationSize,pool->m_initialAllocationCount,pool->m_overflowAllocationCount, pool->m_usedBlocksInPool,pool->m_totalBlocksInPool,pool->m_peakUsedBlocksInPool)); if( fp ) @@ -2547,10 +2547,10 @@ void DynamicMemoryAllocator::debugDmaInfoReport( FILE *fp ) Int numBlocks; Int bytes = debugCalcRawBlockBytes(&numBlocks); - DEBUG_LOG(("%s,Total Raw Blocks = %d\n",PREPEND,numBlocks)); - DEBUG_LOG(("%s,Total Raw Block Bytes = %d\n",PREPEND,bytes)); - DEBUG_LOG(("%s,Average Raw Block Size = %d\n",PREPEND,numBlocks?bytes/numBlocks:0)); - DEBUG_LOG(("%s,Raw Blocks:\n",PREPEND)); + DEBUG_LOG(("%s,Total Raw Blocks = %d",PREPEND,numBlocks)); + DEBUG_LOG(("%s,Total Raw Block Bytes = %d",PREPEND,bytes)); + DEBUG_LOG(("%s,Average Raw Block Size = %d",PREPEND,numBlocks?bytes/numBlocks:0)); + DEBUG_LOG(("%s,Raw Blocks:",PREPEND)); if( fp ) { fprintf( fp, "%s,Total Raw Blocks = %d\n",PREPEND,numBlocks ); @@ -2560,7 +2560,7 @@ void DynamicMemoryAllocator::debugDmaInfoReport( FILE *fp ) } for (MemoryPoolSingleBlock *b = m_rawBlocks; b; b = b->getNextRawBlock()) { - DEBUG_LOG(("%s, Blocksize=%d\n",PREPEND,b->debugGetLogicalSize())); + DEBUG_LOG(("%s, Blocksize=%d",PREPEND,b->debugGetLogicalSize())); //if( fp ) //{ // fprintf( fp, "%s, Blocksize=%d\n",PREPEND,b->debugGetLogicalSize() ); @@ -3079,16 +3079,16 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en if (flags & REPORT_FACTORYINFO) { - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Begin Factory Info Report\n")); - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Bytes in use (logical) = %d\n",m_usedBytes)); - DEBUG_LOG(("Bytes in use (physical) = %d\n",m_physBytes)); - DEBUG_LOG(("PEAK Bytes in use (logical) = %d\n",m_peakUsedBytes)); - DEBUG_LOG(("PEAK Bytes in use (physical) = %d\n",m_peakPhysBytes)); - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("End Factory Info Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Begin Factory Info Report")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Bytes in use (logical) = %d",m_usedBytes)); + DEBUG_LOG(("Bytes in use (physical) = %d",m_physBytes)); + DEBUG_LOG(("PEAK Bytes in use (logical) = %d",m_peakUsedBytes)); + DEBUG_LOG(("PEAK Bytes in use (physical) = %d",m_peakPhysBytes)); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("End Factory Info Report")); + DEBUG_LOG(("------------------------------------------")); if( fp ) { fprintf( fp, "------------------------------------------\n" ); @@ -3106,9 +3106,9 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en if (flags & REPORT_POOLINFO) { - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Begin Pool Info Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Begin Pool Info Report")); + DEBUG_LOG(("------------------------------------------")); if( fp ) { fprintf( fp, "------------------------------------------\n" ); @@ -3124,9 +3124,9 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en { dma->debugDmaInfoReport( fp ); } - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("End Pool Info Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("End Pool Info Report")); + DEBUG_LOG(("------------------------------------------")); if( fp ) { fprintf( fp, "------------------------------------------\n" ); @@ -3137,43 +3137,43 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en if (flags & REPORT_POOL_OVERFLOW) { - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Begin Pool Overflow Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Begin Pool Overflow Report")); + DEBUG_LOG(("------------------------------------------")); MemoryPool *pool = m_firstPoolInFactory; for (; pool; pool = pool->getNextPoolInList()) { if (pool->getPeakBlockCount() > pool->getInitialBlockCount()) { - DEBUG_LOG(("*** Pool %s overflowed initial allocation of %d (peak allocation was %d)\n",pool->getPoolName(),pool->getInitialBlockCount(),pool->getPeakBlockCount())); + DEBUG_LOG(("*** Pool %s overflowed initial allocation of %d (peak allocation was %d)",pool->getPoolName(),pool->getInitialBlockCount(),pool->getPeakBlockCount())); } } - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("End Pool Overflow Report\n")); - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Begin Pool Underflow Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("End Pool Overflow Report")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Begin Pool Underflow Report")); + DEBUG_LOG(("------------------------------------------")); for (pool = m_firstPoolInFactory; pool; pool = pool->getNextPoolInList()) { Int peak = pool->getPeakBlockCount()*pool->getAllocationSize(); Int initial = pool->getInitialBlockCount()*pool->getAllocationSize(); if (peak < initial/2 && (initial - peak) > 4096) { - DEBUG_LOG(("*** Pool %s used less than half its initial allocation of %d (peak allocation was %d, wasted %dk)\n", + DEBUG_LOG(("*** Pool %s used less than half its initial allocation of %d (peak allocation was %d, wasted %dk)", pool->getPoolName(),pool->getInitialBlockCount(),pool->getPeakBlockCount(),(initial - peak)/1024)); } } - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("End Pool Underflow Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("End Pool Underflow Report")); + DEBUG_LOG(("------------------------------------------")); } if( flags & REPORT_SIMPLE_LEAKS ) { - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Begin Simple Leak Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Begin Simple Leak Report")); + DEBUG_LOG(("------------------------------------------")); Int any = 0; for (MemoryPool *pool = m_firstPoolInFactory; pool; pool = pool->getNextPoolInList()) { @@ -3184,9 +3184,9 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en any += dma->debugDmaReportLeaks(); } DEBUG_ASSERTCRASH(!any, ("There were %d memory leaks. Please fix them.\n",any)); - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("End Simple Leak Report\n")); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("End Simple Leak Report")); + DEBUG_LOG(("------------------------------------------")); } #ifdef MEMORYPOOL_CHECKPOINTING @@ -3194,18 +3194,18 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en { const char* nm = (this == TheMemoryPoolFactory) ? "TheMemoryPoolFactory" : "*** UNKNOWN *** MemoryPoolFactory"; - DEBUG_LOG(("\n")); - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("Begin Block Report for %s\n", nm)); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("Begin Block Report for %s", nm)); + DEBUG_LOG(("------------------------------------------")); char buf[256] = ""; if (flags & _REPORT_CP_ALLOCATED_BEFORE) strcat(buf, "AllocBefore "); if (flags & _REPORT_CP_ALLOCATED_BETWEEN) strcat(buf, "AllocBetween "); if (flags & _REPORT_CP_FREED_BEFORE) strcat(buf, "FreedBefore "); if (flags & _REPORT_CP_FREED_BETWEEN) strcat(buf, "FreedBetween "); if (flags & _REPORT_CP_FREED_NEVER) strcat(buf, "StillExisting "); - DEBUG_LOG(("Options: Between checkpoints %d and %d, report on (%s)\n",startCheckpoint,endCheckpoint,buf)); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("Options: Between checkpoints %d and %d, report on (%s)",startCheckpoint,endCheckpoint,buf)); + DEBUG_LOG(("------------------------------------------")); BlockCheckpointInfo::doBlockCheckpointReport( NULL, "", 0, 0, 0 ); for (MemoryPool *pool = m_firstPoolInFactory; pool; pool = pool->getNextPoolInList()) @@ -3217,9 +3217,9 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en dma->debugCheckpointReport(flags, startCheckpoint, endCheckpoint, "(Oversized)"); } - DEBUG_LOG(("------------------------------------------\n")); - DEBUG_LOG(("End Block Report for %s\n", nm)); - DEBUG_LOG(("------------------------------------------\n")); + DEBUG_LOG(("------------------------------------------")); + DEBUG_LOG(("End Block Report for %s", nm)); + DEBUG_LOG(("------------------------------------------")); } #endif @@ -3479,7 +3479,7 @@ static void preMainInitMemoryManager() if (TheMemoryPoolFactory == NULL) { DEBUG_INIT(DEBUG_FLAGS_DEFAULT); - DEBUG_LOG(("*** Initing Memory Manager prior to main!\n")); + DEBUG_LOG(("*** Initing Memory Manager prior to main!")); Int numSubPools; const PoolInitRec *pParms; @@ -3503,7 +3503,7 @@ void shutdownMemoryManager() if (thePreMainInitFlag) { #ifdef MEMORYPOOL_DEBUG - DEBUG_LOG(("*** Memory Manager was inited prior to main -- skipping shutdown!\n")); + DEBUG_LOG(("*** Memory Manager was inited prior to main -- skipping shutdown!")); #endif } else @@ -3527,8 +3527,8 @@ void shutdownMemoryManager() } #ifdef MEMORYPOOL_DEBUG - DEBUG_LOG(("Peak system allocation was %d bytes\n",thePeakSystemAllocationInBytes)); - DEBUG_LOG(("Wasted DMA space (peak) was %d bytes\n",thePeakWastedDMA)); + DEBUG_LOG(("Peak system allocation was %d bytes",thePeakSystemAllocationInBytes)); + DEBUG_LOG(("Wasted DMA space (peak) was %d bytes",thePeakWastedDMA)); DEBUG_ASSERTCRASH(theTotalSystemAllocationInBytes == 0, ("Leaked a total of %d raw bytes\n", theTotalSystemAllocationInBytes)); #endif } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/LocalFile.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/LocalFile.cpp index e1cfd5c811..6fe98c0bd2 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/LocalFile.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/LocalFile.cpp @@ -272,7 +272,7 @@ Bool LocalFile::open( const Char *filename, Int access ) #endif ++s_totalOpen; -/// DEBUG_LOG(("LocalFile::open %s (total %d)\n",filename,s_totalOpen)); +/// DEBUG_LOG(("LocalFile::open %s (total %d)",filename,s_totalOpen)); if ( m_access & APPEND ) { if ( seek ( 0, END ) < 0 ) diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp index 0f608da490..739cdd245e 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp @@ -565,7 +565,7 @@ SaveCode GameState::saveGame( AsciiString filename, UnicodeString desc, } catch(...) { // print error message to the user TheInGameUI->message( "GUI:Error" ); - DEBUG_LOG(( "Error opening file '%s'\n", filepath.str() )); + DEBUG_LOG(( "Error opening file '%s'", filepath.str() )); return SC_ERROR; } @@ -931,7 +931,7 @@ AsciiString GameState::portableMapPathToRealMapPath(const AsciiString& in) const if (!FileSystem::isPathInDirectory(prefix, containingBasePath)) { - DEBUG_LOG(("Normalized file path for '%s' was outside the expected base path of '%s'.\n", prefix.str(), containingBasePath.str())); + DEBUG_LOG(("Normalized file path for '%s' was outside the expected base path of '%s'.", prefix.str(), containingBasePath.str())); return AsciiString::TheEmptyString; } @@ -1327,7 +1327,7 @@ void GameState::iterateSaveFiles( IterateSaveFileCallback callback, void *userDa // ------------------------------------------------------------------------------------------------ void GameState::friend_xferSaveDataForCRC( Xfer *xfer, SnapshotType which ) { - DEBUG_LOG(("GameState::friend_xferSaveDataForCRC() - SnapshotType %d\n", which)); + DEBUG_LOG(("GameState::friend_xferSaveDataForCRC() - SnapshotType %d", which)); SaveGameInfo *gameInfo = getSaveGameInfo(); gameInfo->description.clear(); gameInfo->saveFileType = SAVE_FILE_TYPE_NORMAL; @@ -1350,7 +1350,7 @@ void GameState::xferSaveData( Xfer *xfer, SnapshotType which ) // save or load all blocks if( xfer->getXferMode() == XFER_SAVE ) { - DEBUG_LOG(("GameState::xferSaveData() - XFER_SAVE\n")); + DEBUG_LOG(("GameState::xferSaveData() - XFER_SAVE")); // save all blocks AsciiString blockName; @@ -1365,7 +1365,7 @@ void GameState::xferSaveData( Xfer *xfer, SnapshotType which ) // get block name blockName = blockInfo->blockName; - DEBUG_LOG(("Looking at block '%s'\n", blockName.str())); + DEBUG_LOG(("Looking at block '%s'", blockName.str())); // // for mission save files, we only save the game state block and campaign manager @@ -1413,7 +1413,7 @@ void GameState::xferSaveData( Xfer *xfer, SnapshotType which ) } // end if, save else { - DEBUG_LOG(("GameState::xferSaveData() - not XFER_SAVE\n")); + DEBUG_LOG(("GameState::xferSaveData() - not XFER_SAVE")); AsciiString token; Int blockSize; Bool done = FALSE; @@ -1443,7 +1443,7 @@ void GameState::xferSaveData( Xfer *xfer, SnapshotType which ) { // log the block not found - DEBUG_LOG(( "GameState::xferSaveData - Skipping unknown block '%s'\n", token.str() )); + DEBUG_LOG(( "GameState::xferSaveData - Skipping unknown block '%s'", token.str() )); // // block was not found, this could have been a block from an older file diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp index 07dd3bd6f2..8387a1cdb6 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp @@ -474,7 +474,7 @@ void WriteStackLine(void*address, void (*callback)(const char*)) //***************************************************************************** void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) { - DEBUG_LOG(( "\n********** EXCEPTION DUMP ****************\n" )); + DEBUG_LOG(( "\n********** EXCEPTION DUMP ****************" )); /* ** List of possible exceptions */ @@ -531,7 +531,7 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) "Error code: ?????\nDescription: Unknown exception." }; - DEBUG_LOG( ("Dump exception info\n") ); + DEBUG_LOG( ("Dump exception info") ); CONTEXT *context = e_info->ContextRecord; /* ** The following are set for access violation only @@ -563,7 +563,7 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) { if ( _codes[i] == e_info->ExceptionRecord->ExceptionCode ) { - DEBUG_LOG ( ("Found exception description\n") ); + DEBUG_LOG ( ("Found exception description") ); break; } } @@ -624,7 +624,7 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) strcat (scrap, "\n"); DOUBLE_DEBUG ( ( (scrap))); - DEBUG_LOG(( "********** END EXCEPTION DUMP ****************\n\n" )); + DEBUG_LOG(( "********** END EXCEPTION DUMP ****************\n" )); } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/registry.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/registry.cpp index 6830a8ea6f..51d8000dda 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/registry.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/registry.cpp @@ -120,7 +120,7 @@ Bool GetStringFromGeneralsRegistry(AsciiString path, AsciiString key, AsciiStrin AsciiString fullPath = "SOFTWARE\\Electronic Arts\\EA Games\\Generals"; fullPath.concat(path); - DEBUG_LOG(("GetStringFromRegistry - looking in %s for key %s\n", fullPath.str(), key.str())); + DEBUG_LOG(("GetStringFromRegistry - looking in %s for key %s", fullPath.str(), key.str())); if (getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val)) { return TRUE; @@ -134,7 +134,7 @@ Bool GetStringFromRegistry(AsciiString path, AsciiString key, AsciiString& val) AsciiString fullPath = "SOFTWARE\\Electronic Arts\\EA Games\\Command and Conquer Generals Zero Hour"; fullPath.concat(path); - DEBUG_LOG(("GetStringFromRegistry - looking in %s for key %s\n", fullPath.str(), key.str())); + DEBUG_LOG(("GetStringFromRegistry - looking in %s for key %s", fullPath.str(), key.str())); if (getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val)) { return TRUE; @@ -148,7 +148,7 @@ Bool GetUnsignedIntFromRegistry(AsciiString path, AsciiString key, UnsignedInt& AsciiString fullPath = "SOFTWARE\\Electronic Arts\\EA Games\\Command and Conquer Generals Zero Hour"; fullPath.concat(path); - DEBUG_LOG(("GetUnsignedIntFromRegistry - looking in %s for key %s\n", fullPath.str(), key.str())); + DEBUG_LOG(("GetUnsignedIntFromRegistry - looking in %s for key %s", fullPath.str(), key.str())); if (getUnsignedIntFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val)) { return TRUE; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp index fbf5f99fb8..1e69e945f3 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -601,7 +601,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const if (replaced) { //Kris: Commented this out for SPAM reasons. Do we really need this? - //DEBUG_LOG(("replaced an AI for %s!\n",self->getName().str())); + //DEBUG_LOG(("replaced an AI for %s!",self->getName().str())); } } @@ -1281,7 +1281,7 @@ void ThingTemplate::resolveNames() // but ThingTemplate can muck with stuff with gleeful abandon. (srj) if( tmpls[ j ] ) const_cast(tmpls[j])->m_isBuildFacility = true; - // DEBUG_LOG(("BF: %s is a buildfacility for %s\n",tmpls[j]->m_nameString.str(),this->m_nameString.str())); + // DEBUG_LOG(("BF: %s is a buildfacility for %s",tmpls[j]->m_nameString.str(),this->m_nameString.str())); } } @@ -1448,7 +1448,7 @@ const AudioEventRTS *ThingTemplate::getPerUnitSound(const AsciiString& soundName if (it == m_perUnitSounds.end()) { #ifndef DO_UNIT_TIMINGS - DEBUG_LOG(("Unknown Audio name (%s) asked for in ThingTemplate (%s).\n", soundName.str(), m_nameString.str())); + DEBUG_LOG(("Unknown Audio name (%s) asked for in ThingTemplate (%s).", soundName.str(), m_nameString.str())); #endif return &s_audioEventNoSound; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/UserPreferences.cpp b/GeneralsMD/Code/GameEngine/Source/Common/UserPreferences.cpp index cd1019b1dd..83e80292fe 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/UserPreferences.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/UserPreferences.cpp @@ -891,7 +891,7 @@ Bool LadderPreferences::loadProfile( Int profileID ) AsciiString ladName = it->first; AsciiString ladData = it->second; - DEBUG_LOG(("Looking at [%s] = [%s]\n", ladName.str(), ladData.str())); + DEBUG_LOG(("Looking at [%s] = [%s]", ladName.str(), ladData.str())); const char *ptr = ladName.reverseFind(':'); DEBUG_ASSERTCRASH(ptr, ("Did not find ':' in ladder name - skipping")); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp index 4d90613ed9..de2e91a078 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp @@ -152,7 +152,7 @@ void BeaconClientUpdate::hideBeacon( void ) } // end if -// DEBUG_LOG(("in hideBeacon(): draw=%d, m_particleSystemID=%d\n", draw, m_particleSystemID)); +// DEBUG_LOG(("in hideBeacon(): draw=%d, m_particleSystemID=%d", draw, m_particleSystemID)); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Eva.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Eva.cpp index 0e8381ac56..77d9dd21f1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Eva.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Eva.cpp @@ -382,7 +382,7 @@ void Eva::setShouldPlay(EvaMessage messageToPlay) { m_shouldPlay[messageToPlay] = TRUE; - // DEBUG_LOG( ( "Eva message %s play requested\n", messageToName( messageToPlay).str() ) ); + // DEBUG_LOG( ( "Eva message %s play requested", messageToName( messageToPlay).str() ) ); } //------------------------------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index e3ea035d06..40c3a1ddef 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -2766,7 +2766,7 @@ void ControlBar::setControlBarSchemeByPlayer(Player *p) { m_isObserverCommandBar = TRUE; switchToContext( CB_CONTEXT_OBSERVER_LIST, NULL ); - DEBUG_LOG(("We're loading the Observer Command Bar\n")); + DEBUG_LOG(("We're loading the Observer Command Bar")); if (buttonPlaceBeacon) buttonPlaceBeacon->winHide(TRUE); @@ -2811,7 +2811,7 @@ void ControlBar::setControlBarSchemeByPlayerTemplate( const PlayerTemplate *pt) { m_isObserverCommandBar = TRUE; switchToContext( CB_CONTEXT_OBSERVER_LIST, NULL ); - DEBUG_LOG(("We're loading the Observer Command Bar\n")); + DEBUG_LOG(("We're loading the Observer Command Bar")); if (buttonPlaceBeacon) buttonPlaceBeacon->winHide(TRUE); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp index fbe52ddae7..3e66a91cea 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp @@ -589,7 +589,7 @@ void ControlBarScheme::init(void) } win->winSetPosition(x,y ); win->winSetSize((m_powerBarLR.x - m_powerBarUL.x)*resMultiplier.x+ COMMAND_BAR_SIZE_OFFSET,(m_powerBarLR.y - m_powerBarUL.y)*resMultiplier.y+ COMMAND_BAR_SIZE_OFFSET); - DEBUG_LOG(("Power Bar UL X:%d Y:%d LR X:%d Y:%d size X:%d Y:%d\n",m_powerBarUL.x, m_powerBarUL.y,m_powerBarLR.x, m_powerBarLR.y, (m_powerBarLR.x - m_powerBarUL.x)*resMultiplier.x+ COMMAND_BAR_SIZE_OFFSET,(m_powerBarLR.y - m_powerBarUL.y)*resMultiplier.y+ COMMAND_BAR_SIZE_OFFSET )); + DEBUG_LOG(("Power Bar UL X:%d Y:%d LR X:%d Y:%d size X:%d Y:%d",m_powerBarUL.x, m_powerBarUL.y,m_powerBarLR.x, m_powerBarLR.y, (m_powerBarLR.x - m_powerBarUL.x)*resMultiplier.x+ COMMAND_BAR_SIZE_OFFSET,(m_powerBarLR.y - m_powerBarUL.y)*resMultiplier.y+ COMMAND_BAR_SIZE_OFFSET )); } win= TheWindowManager->winGetWindowFromId( NULL, TheNameKeyGenerator->nameToKey( "ControlBar.wnd:ButtonGeneral" ) ); @@ -1105,14 +1105,14 @@ void ControlBarSchemeManager::setControlBarSchemeByPlayerTemplate( const PlayerT { m_currentScheme->init(); - DEBUG_LOG(("setControlBarSchemeByPlayer already is using %s as its side\n", side.str())); + DEBUG_LOG(("setControlBarSchemeByPlayer already is using %s as its side", side.str())); return; } // if we don't have a side, set it to Observer shell if(side.isEmpty()) side.set("Observer"); - DEBUG_LOG(("setControlBarSchemeByPlayer used %s as its side\n", side.str())); + DEBUG_LOG(("setControlBarSchemeByPlayer used %s as its side", side.str())); ControlBarScheme *tempScheme = NULL; ControlBarSchemeList::iterator it = m_schemeList.begin(); @@ -1173,14 +1173,14 @@ void ControlBarSchemeManager::setControlBarSchemeByPlayer(Player *p) { m_currentScheme->init(); - DEBUG_LOG(("setControlBarSchemeByPlayer already is using %s as its side\n", side.str())); + DEBUG_LOG(("setControlBarSchemeByPlayer already is using %s as its side", side.str())); return; } // if we don't have a side, set it to Observer shell if(side.isEmpty()) side.set("Observer"); - DEBUG_LOG(("setControlBarSchemeByPlayer used %s as its side\n", side.str())); + DEBUG_LOG(("setControlBarSchemeByPlayer used %s as its side", side.str())); ControlBarScheme *tempScheme = NULL; ControlBarSchemeList::iterator it = m_schemeList.begin(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp index 2b1f9bd70c..4d2807d00f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp @@ -294,7 +294,7 @@ void DisconnectMenu::removePlayer(Int slot, UnicodeString playerName) { } void DisconnectMenu::voteForPlayer(Int slot) { - DEBUG_LOG(("Casting vote for disconnect slot %d\n", slot)); + DEBUG_LOG(("Casting vote for disconnect slot %d", slot)); TheNetwork->voteForPlayerDisconnect(slot); // Do this next. } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp index 55577718c4..a97210e1a7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp @@ -140,7 +140,7 @@ void ControlBar::showBuildTooltipLayout( GameWindow *cmdButton ) m_showBuildToolTipLayout = TRUE; if(!isInitialized && beginWaitTime + cmdButton->getTooltipDelay() < timeGetTime()) { - //DEBUG_LOG(("%d beginwaittime, %d tooltipdelay, %dtimegettime\n", beginWaitTime, cmdButton->getTooltipDelay(), timeGetTime())); + //DEBUG_LOG(("%d beginwaittime, %d tooltipdelay, %dtimegettime", beginWaitTime, cmdButton->getTooltipDelay(), timeGetTime())); passedWaitTime = TRUE; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp index 32ec15c6dc..02aee38bc3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp @@ -231,7 +231,7 @@ WindowMsgHandledType DisconnectControlSystem( GameWindow *window, UnsignedInt ms case GEM_EDIT_DONE: { -// DEBUG_LOG(("DisconnectControlSystem - got GEM_EDIT_DONE.\n")); +// DEBUG_LOG(("DisconnectControlSystem - got GEM_EDIT_DONE.")); GameWindow *control = (GameWindow *)mData1; Int controlID = control->winGetWindowId(); @@ -241,7 +241,7 @@ WindowMsgHandledType DisconnectControlSystem( GameWindow *window, UnsignedInt ms { UnicodeString txtInput; -// DEBUG_LOG(("DisconnectControlSystem - GEM_EDIT_DONE was from the text entry control.\n")); +// DEBUG_LOG(("DisconnectControlSystem - GEM_EDIT_DONE was from the text entry control.")); // read the user's input txtInput.set(GadgetTextEntryGetText( textEntryWindow )); @@ -251,7 +251,7 @@ WindowMsgHandledType DisconnectControlSystem( GameWindow *window, UnsignedInt ms txtInput.trim(); // Echo the user's input to the chat window if (!txtInput.isEmpty()) { -// DEBUG_LOG(("DisconnectControlSystem - sending string %ls\n", txtInput.str())); +// DEBUG_LOG(("DisconnectControlSystem - sending string %ls", txtInput.str())); TheDisconnectMenu->sendChat(txtInput); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp index 361767ca89..9e54d2191b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp @@ -848,7 +848,7 @@ void LanGameOptionsMenuInit( WindowLayout *layout, void *userData ) { // If we init while the game is in progress, we are really returning to the menu // after the game. So, we pop the menu and go back to the lobby. Whee! - DEBUG_LOG(("Popping to lobby after a game!\n")); + DEBUG_LOG(("Popping to lobby after a game!")); TheShell->popImmediate(); return; } @@ -901,7 +901,7 @@ void LanGameOptionsMenuInit( WindowLayout *layout, void *userData ) else { - //DEBUG_LOG(("LanGameOptionsMenuInit(): map is %s\n", TheLAN->GetMyGame()->getMap().str())); + //DEBUG_LOG(("LanGameOptionsMenuInit(): map is %s", TheLAN->GetMyGame()->getMap().str())); buttonStart->winSetText(TheGameText->fetch("GUI:Accept")); buttonSelectMap->winEnable( FALSE ); checkboxLimitSuperweapons->winEnable( FALSE ); // Can look but only host can touch diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp index 32e74af675..a2d981c599 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp @@ -622,7 +622,7 @@ void LanLobbyMenuUpdate( WindowLayout * layout, void *userData) if (LANSocketErrorDetected == TRUE) { LANSocketErrorDetected = FALSE; - DEBUG_LOG(("SOCKET ERROR! BAILING!\n")); + DEBUG_LOG(("SOCKET ERROR! BAILING!")); MessageBoxOk(TheGameText->fetch("GUI:NetworkError"), TheGameText->fetch("GUI:SocketError"), NULL); // we have a socket problem, back out to the main menu. @@ -769,7 +769,7 @@ WindowMsgHandledType LanLobbyMenuSystem( GameWindow *window, UnsignedInt msg, { //shellmapOn = TRUE; LANbuttonPushed = true; - DEBUG_LOG(("Back was hit - popping to main menu\n")); + DEBUG_LOG(("Back was hit - popping to main menu")); TheShell->pop(); delete TheLAN; TheLAN = NULL; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp index f59ac0c21d..ed6969f957 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp @@ -607,7 +607,7 @@ void MainMenuInit( WindowLayout *layout, void *userData ) { // wohoo - we're connected! fire off a check for updates checkedForUpdate = TRUE; - DEBUG_LOG(("Looking for a patch for productID=%d, versionStr=%s, distribution=%d\n", + DEBUG_LOG(("Looking for a patch for productID=%d, versionStr=%s, distribution=%d", gameProductID, gameVersionUniqueIDStr, gameDistributionID)); ptCheckForPatch( gameProductID, gameVersionUniqueIDStr, gameDistributionID, patchAvailableCallback, PTFalse, NULL ); //ptCheckForPatch( productID, versionUniqueIDStr, distributionID, mapPackAvailableCallback, PTFalse, NULL ); @@ -622,7 +622,7 @@ void MainMenuInit( WindowLayout *layout, void *userData ) if (TheGameSpyPeerMessageQueue && !TheGameSpyPeerMessageQueue->isConnected()) { - DEBUG_LOG(("Tearing down GameSpy from MainMenuInit()\n")); + DEBUG_LOG(("Tearing down GameSpy from MainMenuInit()")); TearDownGameSpy(); } if (TheMapCache) @@ -808,7 +808,7 @@ void ResolutionDialogUpdate() //------------------------------------------------------------------------------------------------------ // Used for debugging purposes //------------------------------------------------------------------------------------------------------ - DEBUG_LOG(("Resolution Timer : started at %d, current time at %d, frameTicker is %d\n", timeStarted, + DEBUG_LOG(("Resolution Timer : started at %d, current time at %d, frameTicker is %d", timeStarted, time(NULL) , currentTime)); } */ @@ -989,7 +989,7 @@ WindowMsgHandledType MainMenuInput( GameWindow *window, UnsignedInt msg, if(abs(mouse.x - mousePosX) > 20 || abs(mouse.y - mousePosY) > 20) { - DEBUG_LOG(("Mouse X:%d, Y:%d\n", mouse.x, mouse.y)); + DEBUG_LOG(("Mouse X:%d, Y:%d", mouse.x, mouse.y)); if(notShown) { initialGadgetDelay = 1; @@ -1049,7 +1049,7 @@ WindowMsgHandledType MainMenuSystem( GameWindow *window, UnsignedInt msg, case GWM_DESTROY: { ghttpCleanup(); - DEBUG_LOG(("Tearing down GameSpy from MainMenuSystem(GWM_DESTROY)\n")); + DEBUG_LOG(("Tearing down GameSpy from MainMenuSystem(GWM_DESTROY)")); TearDownGameSpy(); StopAsyncDNSCheck(); // kill off the async DNS check thread in case it is still running break; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp index 720957a13c..7d1d7ca819 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp @@ -226,7 +226,7 @@ void JoinDirectConnectGame() Int ip1, ip2, ip3, ip4; sscanf(ipstr, "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4); - DEBUG_LOG(("JoinDirectConnectGame - joining at %d.%d.%d.%d\n", ip1, ip2, ip3, ip4)); + DEBUG_LOG(("JoinDirectConnectGame - joining at %d.%d.%d.%d", ip1, ip2, ip3, ip4)); ipaddress = (ip1 << 24) + (ip2 << 16) + (ip3 << 8) + ip4; // ipaddress = htonl(ipaddress); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index 92a54431f7..37d339c61c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -1164,7 +1164,7 @@ static void saveOptions( void ) if(val != -1) { TheWritableGlobalData->m_keyboardScrollFactor = val/100.0f; - DEBUG_LOG(("Scroll Spped val %d, keyboard scroll factor %f\n", val, TheGlobalData->m_keyboardScrollFactor)); + DEBUG_LOG(("Scroll Spped val %d, keyboard scroll factor %f", val, TheGlobalData->m_keyboardScrollFactor)); AsciiString prefString; prefString.format("%d", val); (*pref)["ScrollFactor"] = prefString; @@ -1753,7 +1753,7 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) //set scroll options AsciiString test = (*pref)["DrawScrollAnchor"]; - DEBUG_LOG(("DrawScrollAnchor == [%s]\n", test.str())); + DEBUG_LOG(("DrawScrollAnchor == [%s]", test.str())); if (test == "Yes" || (test.isEmpty() && TheInGameUI->getDrawRMBScrollAnchor())) { GadgetCheckBoxSetChecked( checkDrawAnchor, true); @@ -1765,7 +1765,7 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) TheInGameUI->setDrawRMBScrollAnchor(false); } test = (*pref)["MoveScrollAnchor"]; - DEBUG_LOG(("MoveScrollAnchor == [%s]\n", test.str())); + DEBUG_LOG(("MoveScrollAnchor == [%s]", test.str())); if (test == "Yes" || (test.isEmpty() && TheInGameUI->getMoveRMBScrollAnchor())) { GadgetCheckBoxSetChecked( checkMoveAnchor, true); @@ -1789,7 +1789,7 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) // set scroll speed slider Int scrollPos = (Int)(TheGlobalData->m_keyboardScrollFactor*100.0f); GadgetSliderSetPosition( sliderScrollSpeed, scrollPos ); - DEBUG_LOG(("Scroll SPeed %d\n", scrollPos)); + DEBUG_LOG(("Scroll SPeed %d", scrollPos)); // set the send delay check box GadgetCheckBoxSetChecked(checkSendDelay, TheGlobalData->m_firewallSendDelay); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp index 6c284cf06a..ce0d9eaf94 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp @@ -257,7 +257,7 @@ static void joinGame( AsciiString password ) req.stagingRoom.id = ourRoom->getID(); req.password = password.str(); TheGameSpyPeerMessageQueue->addRequest(req); - DEBUG_LOG(("Attempting to join game %d(%ls) with password [%s]\n", ourRoom->getID(), ourRoom->getGameName().str(), password.str())); + DEBUG_LOG(("Attempting to join game %d(%ls) with password [%s]", ourRoom->getID(), ourRoom->getGameName().str(), password.str())); GameSpyCloseOverlay(GSOVERLAY_GAMEPASSWORD); parentPopup = NULL; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp index 3d19a9b8db..32bfacc691 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp @@ -408,7 +408,7 @@ WindowMsgHandledType PopupLadderSelectSystem( GameWindow *window, UnsignedInt ms if ( pass.isNotEmpty() ) // password ok { AsciiString cryptPass = EncryptString(pass.str()); - DEBUG_LOG(("pass is %s, crypted pass is %s, comparing to %s\n", + DEBUG_LOG(("pass is %s, crypted pass is %s, comparing to %s", pass.str(), cryptPass.str(), li->cryptedPassword.str())); if (cryptPass == li->cryptedPassword) ladderSelectedCallback(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp index 051209e36c..345ad7576f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp @@ -143,7 +143,7 @@ static Int getTotalDisconnectsFromFile(Int playerID) UserPreferences pref; AsciiString userPrefFilename; userPrefFilename.format("GeneralsOnline\\MiscPref%d.ini", playerID); - DEBUG_LOG(("getTotalDisconnectsFromFile - reading stats from file %s\n", userPrefFilename.str())); + DEBUG_LOG(("getTotalDisconnectsFromFile - reading stats from file %s", userPrefFilename.str())); pref.load(userPrefFilename); // if there is a file override, use that data instead. @@ -179,7 +179,7 @@ Int GetAdditionalDisconnectsFromUserFile(Int playerID) if (TheGameSpyInfo->getAdditionalDisconnects() > 0 && !retval) { - DEBUG_LOG(("Clearing additional disconnects\n")); + DEBUG_LOG(("Clearing additional disconnects")); TheGameSpyInfo->clearAdditionalDisconnects(); } @@ -199,7 +199,7 @@ void GetAdditionalDisconnectsFromUserFile(PSPlayerStats *stats) if (TheGameSpyInfo->getAdditionalDisconnects() > 0 && !getTotalDisconnectsFromFile(stats->id)) { - DEBUG_LOG(("Clearing additional disconnects\n")); + DEBUG_LOG(("Clearing additional disconnects")); TheGameSpyInfo->clearAdditionalDisconnects(); } @@ -211,7 +211,7 @@ void GetAdditionalDisconnectsFromUserFile(PSPlayerStats *stats) UserPreferences pref; AsciiString userPrefFilename; userPrefFilename.format("GeneralsOnline\\MiscPref%d.ini", stats->id); - DEBUG_LOG(("GetAdditionalDisconnectsFromUserFile - reading stats from file %s\n", userPrefFilename.str())); + DEBUG_LOG(("GetAdditionalDisconnectsFromUserFile - reading stats from file %s", userPrefFilename.str())); pref.load(userPrefFilename); // if there is a file override, use that data instead. @@ -1134,7 +1134,7 @@ void HandlePersistentStorageResponses( void ) break; case PSResponse::PSRESPONSE_PLAYERSTATS: { - DEBUG_LOG(("LocalProfileID %d, resp.player.id %d, resp.player.locale %d\n", TheGameSpyInfo->getLocalProfileID(), resp.player.id, resp.player.locale)); + DEBUG_LOG(("LocalProfileID %d, resp.player.id %d, resp.player.locale %d", TheGameSpyInfo->getLocalProfileID(), resp.player.id, resp.player.locale)); /* if(resp.player.id == TheGameSpyInfo->getLocalProfileID() && resp.player.locale < LOC_MIN) { @@ -1183,7 +1183,7 @@ void HandlePersistentStorageResponses( void ) Bool isPreorder = TheGameSpyInfo->didPlayerPreorder( TheGameSpyInfo->getLocalProfileID() ); req.statsToPush.preorder = isPreorder; - DEBUG_LOG(("PEERREQUEST_PUSHSTATS: stats will be %d,%d,%d,%d,%d,%d\n", + DEBUG_LOG(("PEERREQUEST_PUSHSTATS: stats will be %d,%d,%d,%d,%d,%d", req.statsToPush.locale, req.statsToPush.wins, req.statsToPush.losses, req.statsToPush.rankPoints, req.statsToPush.side, req.statsToPush.preorder)); TheGameSpyPeerMessageQueue->addRequest(req); } @@ -1192,7 +1192,7 @@ void HandlePersistentStorageResponses( void ) { UpdateLocalPlayerStats(); } - DEBUG_LOG(("PopulatePlayerInfoWindows() - lookAtPlayerID is %d, got %d\n", lookAtPlayerID, resp.player.id)); + DEBUG_LOG(("PopulatePlayerInfoWindows() - lookAtPlayerID is %d, got %d", lookAtPlayerID, resp.player.id)); PopulatePlayerInfoWindows("PopupPlayerInfo.wnd"); //GadgetListBoxAddEntryText(listboxInfo, UnicodeString(L"Got info!"), GameSpyColor[GSCOLOR_DEFAULT], -1); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp index 8c5f3513b6..9e96b772a4 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp @@ -233,7 +233,7 @@ static void restartMissionMenu() msg->appendIntegerArgument(diff); msg->appendIntegerArgument(rankPointsStartedWith); msg->appendIntegerArgument(fps); - DEBUG_LOG(("Restarting game mode %d, Diff=%d, RankPoints=%d\n", gameMode, + DEBUG_LOG(("Restarting game mode %d, Diff=%d, RankPoints=%d", gameMode, TheScriptEngine->getGlobalDifficulty(), rankPointsStartedWith) ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index cb7b8ba7ed..1ce609aa44 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -260,7 +260,7 @@ void ScoreScreenInit( WindowLayout *layout, void *userData ) if (TheGameSpyInfo) { - DEBUG_LOG(("ScoreScreenInit(): TheGameSpyInfo->stuff(%s/%s/%s)\n", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); + DEBUG_LOG(("ScoreScreenInit(): TheGameSpyInfo->stuff(%s/%s/%s)", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); } DontShowMainMenu = TRUE; //KRIS @@ -1136,7 +1136,7 @@ static Bool isSlotLocalAlly(GameInfo *game, const GameSlot *slot) static void updateSkirmishBattleHonors(SkirmishBattleHonors& stats) { - DEBUG_LOG(("Updating Skirmish battle honors\n")); + DEBUG_LOG(("Updating Skirmish battle honors")); Player *localPlayer = ThePlayerList->getLocalPlayer(); ScoreKeeper *s = localPlayer->getScoreKeeper(); @@ -1270,7 +1270,7 @@ static void updateSkirmishBattleHonors(SkirmishBattleHonors& stats) static void updateMPBattleHonors(Int& honors, PSPlayerStats& stats) { - DEBUG_LOG(("Updating MP battle honors\n")); + DEBUG_LOG(("Updating MP battle honors")); Player *localPlayer = ThePlayerList->getLocalPlayer(); ScoreKeeper *s = localPlayer->getScoreKeeper(); @@ -1612,7 +1612,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); // If we died, and are watching sparring AIs, we still get the loss. if (player->isPlayerActive()) { - DEBUG_LOG(("Skipping skirmish stats update: sandbox:%d defeat:%d victory:%d\n", + DEBUG_LOG(("Skipping skirmish stats update: sandbox:%d defeat:%d victory:%d", TheGameInfo->isSandbox(), TheVictoryConditions->isLocalAlliedDefeat(), TheVictoryConditions->isLocalAlliedVictory())); return; } @@ -1652,7 +1652,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); if ( screenType == SCORESCREEN_INTERNET ) { - DEBUG_LOG(("populatePlayerInfo() - SCORESCREEN_INTERNET\n")); + DEBUG_LOG(("populatePlayerInfo() - SCORESCREEN_INTERNET")); if (TheGameSpyGame && !TheGameSpyGame->getUseStats() && !TheGameSpyGame->isQMGame() ) //QuickMatch games always record stats return; //the host has requested not to record stats for this game. @@ -1669,7 +1669,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); if (TheVictoryConditions->amIObserver()) { // nothing to track - DEBUG_LOG(("populatePlayerInfo() - not tracking stats for observer\n")); + DEBUG_LOG(("populatePlayerInfo() - not tracking stats for observer")); return; } @@ -1704,28 +1704,28 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); } } } - DEBUG_LOG(("Game ended on frame %d - TheGameLogic->getFrame()=%d\n", lastFrameOfGame-1, TheGameLogic->getFrame()-1)); + DEBUG_LOG(("Game ended on frame %d - TheGameLogic->getFrame()=%d", lastFrameOfGame-1, TheGameLogic->getFrame()-1)); for (i=0; igetConstSlot(i); - DEBUG_LOG(("latestHumanInGame=%d, slot->isOccupied()=%d, slot->disconnected()=%d, slot->isAI()=%d, slot->lastFrameInGame()=%d\n", + DEBUG_LOG(("latestHumanInGame=%d, slot->isOccupied()=%d, slot->disconnected()=%d, slot->isAI()=%d, slot->lastFrameInGame()=%d", latestHumanInGame, slot->isOccupied(), slot->disconnected(), slot->isAI(), slot->lastFrameInGame())); if (slot->isOccupied() && slot->disconnected()) { - DEBUG_LOG(("Marking game as a possible disconnect game\n")); + DEBUG_LOG(("Marking game as a possible disconnect game")); sawAnyDisconnects = TRUE; } if (slot->isOccupied() && !slot->disconnected() && i != localSlotNum && (slot->isAI() || (slot->lastFrameInGame() >= lastFrameOfGame/*TheGameLogic->getFrame()*/-1))) { - DEBUG_LOG(("Marking game as not ending in disconnect\n")); + DEBUG_LOG(("Marking game as not ending in disconnect")); gameEndedInDisconnect = FALSE; } } if (!sawAnyDisconnects) { - DEBUG_LOG(("Didn't see any disconnects - making gameEndedInDisconnect == FALSE\n")); + DEBUG_LOG(("Didn't see any disconnects - making gameEndedInDisconnect == FALSE")); gameEndedInDisconnect = FALSE; } @@ -1737,17 +1737,17 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); // check if we were to blame. if (TheNetwork->getPingsRecieved() < max(1, TheNetwork->getPingsSent()/2)) /// @todo: what's a good percent of pings to have gotten? { - DEBUG_LOG(("We were to blame. Leaving gameEndedInDisconnect = true\n")); + DEBUG_LOG(("We were to blame. Leaving gameEndedInDisconnect = true")); } else { - DEBUG_LOG(("We were not to blame. Changing gameEndedInDisconnect = false\n")); + DEBUG_LOG(("We were not to blame. Changing gameEndedInDisconnect = false")); gameEndedInDisconnect = FALSE; } } else { - DEBUG_LOG(("gameEndedInDisconnect, and we didn't ping on last frame. What's up with that?\n")); + DEBUG_LOG(("gameEndedInDisconnect, and we didn't ping on last frame. What's up with that?")); } } @@ -1765,7 +1765,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); } //Remove the extra disconnection we add to all games when they start. - DEBUG_LOG(("populatePlayerInfo() - removing extra disconnect\n")); + DEBUG_LOG(("populatePlayerInfo() - removing extra disconnect")); if (TheGameSpyInfo) TheGameSpyInfo->updateAdditionalGameSpyDisconnections(-1); @@ -1784,7 +1784,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); } if (!sawEndOfGame) { - DEBUG_LOG(("Not sending results - we didn't finish a game. %d\n", TheVictoryConditions->getEndFrame() )); + DEBUG_LOG(("Not sending results - we didn't finish a game. %d", TheVictoryConditions->getEndFrame() )); return; } @@ -1807,7 +1807,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); } // generate and send a gameres packet AsciiString resultsPacket = TheGameSpyGame->generateGameSpyGameResultsPacket(); - DEBUG_LOG(("About to send results packet: %s\n", resultsPacket.str())); + DEBUG_LOG(("About to send results packet: %s", resultsPacket.str())); PSRequest grReq; grReq.requestType = PSRequest::PSREQUEST_SENDGAMERESTOGAMESPY; grReq.results = resultsPacket.str(); @@ -1815,11 +1815,11 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); Int ptIdx; const PlayerTemplate *myTemplate = player->getPlayerTemplate(); - DEBUG_LOG(("myTemplate = %X(%s)\n", myTemplate, myTemplate->getName().str())); + DEBUG_LOG(("myTemplate = %X(%s)", myTemplate, myTemplate->getName().str())); for (ptIdx = 0; ptIdx < ThePlayerTemplateStore->getPlayerTemplateCount(); ++ptIdx) { const PlayerTemplate *nthTemplate = ThePlayerTemplateStore->getNthPlayerTemplate(ptIdx); - DEBUG_LOG(("nthTemplate = %X(%s)\n", nthTemplate, nthTemplate->getName().str())); + DEBUG_LOG(("nthTemplate = %X(%s)", nthTemplate, nthTemplate->getName().str())); if (nthTemplate == myTemplate) { break; @@ -1843,7 +1843,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); SetUnsignedIntInRegistry("", "dc", discons); SetUnsignedIntInRegistry("", "se", syncs); */ - DEBUG_LOG(("populatePlayerInfo() - need to save off info for disconnect games!\n")); + DEBUG_LOG(("populatePlayerInfo() - need to save off info for disconnect games!")); PSRequest req; req.requestType = PSRequest::PSREQUEST_UPDATEPLAYERSTATS; @@ -1988,7 +1988,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); stats.unitsKilled[ptIdx] += s->getTotalUnitsDestroyed(); stats.unitsLost[ptIdx] += s->getTotalUnitsLost(); - DEBUG_LOG(("Before game built scud:%d, cannon:%d, nuke:%d\n", stats.builtSCUD, stats.builtParticleCannon, stats.builtNuke )); + DEBUG_LOG(("Before game built scud:%d, cannon:%d, nuke:%d", stats.builtSCUD, stats.builtParticleCannon, stats.builtNuke )); stats.builtSCUD += CheckForApocalypse( s, "GLAScudStorm" ); stats.builtSCUD += CheckForApocalypse( s, "Chem_GLAScudStorm" ); stats.builtSCUD += CheckForApocalypse( s, "Demo_GLAScudStorm" ); @@ -2001,7 +2001,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); stats.builtNuke += CheckForApocalypse( s, "Nuke_ChinaNuclearMissileLauncher" ); stats.builtNuke += CheckForApocalypse( s, "Infa_ChinaNuclearMissileLauncher" ); stats.builtNuke += CheckForApocalypse( s, "Tank_ChinaNuclearMissileLauncher" ); - DEBUG_LOG(("After game built scud:%d, cannon:%d, nuke:%d\n", stats.builtSCUD, stats.builtParticleCannon, stats.builtNuke )); + DEBUG_LOG(("After game built scud:%d, cannon:%d, nuke:%d", stats.builtSCUD, stats.builtParticleCannon, stats.builtNuke )); if (TheGameSpyGame->getLadderPort() && TheGameSpyGame->getLadderIP().isNotEmpty()) { @@ -2015,7 +2015,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); updateChallengeMedals(stats.challengeMedals); } - DEBUG_LOG(("populatePlayerInfo() - tracking stats for %s/%s/%s\n", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); + DEBUG_LOG(("populatePlayerInfo() - tracking stats for %s/%s/%s", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); PSRequest req; req.requestType = PSRequest::PSREQUEST_UPDATEPLAYERSTATS; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp index e7e5c15d84..a0f52c61fc 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp @@ -430,7 +430,7 @@ void reallyDoStart( void ) //NameKeyType sliderGameSpeedID = TheNameKeyGenerator->nameToKey( AsciiString( "SkirmishGameOptionsMenu.wnd:SliderGameSpeed" ) ); GameWindow *sliderGameSpeed = TheWindowManager->winGetWindowFromId( parentSkirmishGameOptions, sliderGameSpeedID ); Int maxFPS = GadgetSliderGetPosition( sliderGameSpeed ); - DEBUG_LOG(("GameSpeedSlider was at %d\n", maxFPS)); + DEBUG_LOG(("GameSpeedSlider was at %d", maxFPS)); if (maxFPS > GREATER_NO_FPS_LIMIT) maxFPS = 1000; if (maxFPS < 15) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp index 4e29d14fe5..e38af65784 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp @@ -273,14 +273,14 @@ WindowMsgHandledType BuddyControlSystem( GameWindow *window, UnsignedInt msg, if (recipIt == m->end()) break; - DEBUG_LOG(("Trying to send a buddy message to %d.\n", selectedProfile)); + DEBUG_LOG(("Trying to send a buddy message to %d.", selectedProfile)); if (TheGameSpyGame && TheGameSpyGame->isInGame() && TheGameSpyGame->isGameInProgress() && !ThePlayerList->getLocalPlayer()->isPlayerActive()) { - DEBUG_LOG(("I'm dead - gotta look for cheats.\n")); + DEBUG_LOG(("I'm dead - gotta look for cheats.")); for (Int i=0; igetGameSpySlot(i)->getProfileID())); + DEBUG_LOG(("Slot[%d] profile is %d", i, TheGameSpyGame->getGameSpySlot(i)->getProfileID())); if (TheGameSpyGame->getGameSpySlot(i)->getProfileID() == selectedProfile) { // can't send to someone in our game if we're dead/observing. security breach and all that. no seances for you. @@ -537,7 +537,7 @@ void HandleBuddyResponses( void ) message.m_senderNick = nick; messages->push_back(message); - DEBUG_LOG(("Inserting buddy chat from '%s'/'%s'\n", nick.str(), resp.arg.message.nick)); + DEBUG_LOG(("Inserting buddy chat from '%s'/'%s'", nick.str(), resp.arg.message.nick)); // put message on screen insertChat(message); @@ -1213,7 +1213,7 @@ void RequestBuddyAdd(Int profileID, AsciiString nick) // insert status into box messages->push_back(message); - DEBUG_LOG(("Inserting buddy add request\n")); + DEBUG_LOG(("Inserting buddy add request")); // put message on screen insertChat(message); @@ -1286,7 +1286,7 @@ WindowMsgHandledType WOLBuddyOverlayRCMenuSystem( GameWindow *window, UnsignedIn { if(!isGameSpyUser) break; - DEBUG_LOG(("ButtonAdd was pushed\n")); + DEBUG_LOG(("ButtonAdd was pushed")); if (isRequest) { // ok the request @@ -1335,12 +1335,12 @@ WindowMsgHandledType WOLBuddyOverlayRCMenuSystem( GameWindow *window, UnsignedIn BuddyInfoMap *buddies = (isBuddy)?TheGameSpyInfo->getBuddyMap():TheGameSpyInfo->getBuddyRequestMap(); buddies->erase(profileID); updateBuddyInfo(); - DEBUG_LOG(("ButtonDelete was pushed\n")); + DEBUG_LOG(("ButtonDelete was pushed")); PopulateLobbyPlayerListbox(); } else if( controlID == buttonPlayID ) { - DEBUG_LOG(("buttonPlayID was pushed\n")); + DEBUG_LOG(("buttonPlayID was pushed")); } else if( controlID == buttonIgnoreID ) { @@ -1374,7 +1374,7 @@ WindowMsgHandledType WOLBuddyOverlayRCMenuSystem( GameWindow *window, UnsignedIn } else if( controlID == buttonStatsID ) { - DEBUG_LOG(("buttonStatsID was pushed\n")); + DEBUG_LOG(("buttonStatsID was pushed")); GameSpyCloseOverlay(GSOVERLAY_PLAYERINFO); SetLookAtPlayer(profileID,nick ); GameSpyOpenOverlay(GSOVERLAY_PLAYERINFO); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp index 72ad5aa648..c1285e2b8c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp @@ -125,7 +125,7 @@ void SendStatsToOtherPlayers(const GameInfo *game) AsciiString hostName; hostName.translate(slot->getName()); req.nick = hostName.str(); - DEBUG_LOG(("SendStatsToOtherPlayers() - sending to '%s', data of\n\t'%s'\n", hostName.str(), req.options.c_str())); + DEBUG_LOG(("SendStatsToOtherPlayers() - sending to '%s', data of\n\t'%s'", hostName.str(), req.options.c_str())); TheGameSpyPeerMessageQueue->addRequest(req); } } @@ -254,7 +254,7 @@ void PopBackToLobby( void ) //TheGameSpyInfo->joinBestGroupRoom(); } - DEBUG_LOG(("PopBackToLobby() - parentWOLGameSetup is %X\n", parentWOLGameSetup)); + DEBUG_LOG(("PopBackToLobby() - parentWOLGameSetup is %X", parentWOLGameSetup)); if (parentWOLGameSetup) { nextScreen = "Menus/WOLCustomLobby.wnd"; @@ -1344,18 +1344,18 @@ void WOLGameSetupMenuInit( WindowLayout *layout, void *userData ) GameSpyCloseAllOverlays(); GSMessageBoxOk( title, body ); TheGameSpyInfo->reset(); - DEBUG_LOG(("WOLGameSetupMenuInit() - game was in progress, and we were disconnected, so pop immediate back to main menu\n")); + DEBUG_LOG(("WOLGameSetupMenuInit() - game was in progress, and we were disconnected, so pop immediate back to main menu")); TheShell->popImmediate(); return; } // If we init while the game is in progress, we are really returning to the menu // after the game. So, we pop the menu and go back to the lobby. Whee! - DEBUG_LOG(("WOLGameSetupMenuInit() - game was in progress, so pop immediate back to lobby\n")); + DEBUG_LOG(("WOLGameSetupMenuInit() - game was in progress, so pop immediate back to lobby")); TheShell->popImmediate(); if (TheGameSpyPeerMessageQueue && TheGameSpyPeerMessageQueue->isConnected()) { - DEBUG_LOG(("We're still connected, so pushing back on the lobby\n")); + DEBUG_LOG(("We're still connected, so pushing back on the lobby")); TheShell->push("Menus/WOLCustomLobby.wnd", TRUE); } return; @@ -1523,7 +1523,7 @@ static void shutdownComplete( WindowLayout *layout ) { if (!TheGameSpyPeerMessageQueue || !TheGameSpyPeerMessageQueue->isConnected()) { - DEBUG_LOG(("GameSetup shutdownComplete() - skipping push because we're disconnected\n")); + DEBUG_LOG(("GameSetup shutdownComplete() - skipping push because we're disconnected")); } else { @@ -1669,7 +1669,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) { // haven't seen ourselves buttonPushed = true; - DEBUG_LOG(("Haven't seen ourselves in slotlist\n")); + DEBUG_LOG(("Haven't seen ourselves in slotlist")); if (TheGameSpyGame) TheGameSpyGame->reset(); TheGameSpyInfo->leaveStagingRoom(); @@ -1720,13 +1720,13 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) if (!TheLobbyQueuedUTMs.empty()) { - DEBUG_LOG(("Got response from queued lobby UTM list\n")); + DEBUG_LOG(("Got response from queued lobby UTM list")); resp = TheLobbyQueuedUTMs.front(); TheLobbyQueuedUTMs.pop_front(); } else if (TheGameSpyPeerMessageQueue->getResponse( resp )) { - DEBUG_LOG(("Got response from message queue\n")); + DEBUG_LOG(("Got response from message queue")); } else { @@ -1962,7 +1962,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) #if defined(RTS_DEBUG) if (g_debugSlots) { - DEBUG_LOG(("About to process a room UTM. Command is '%s', command options is '%s'\n", + DEBUG_LOG(("About to process a room UTM. Command is '%s', command options is '%s'", resp.command.c_str(), resp.commandOptions.c_str())); } #endif @@ -1973,26 +1973,26 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) Bool isValidSlotList = game && game->getSlot(0) && game->getSlot(0)->isPlayer( resp.nick.c_str() ) && !TheGameSpyInfo->amIHost(); if (!isValidSlotList) { - SLOTLIST_DEBUG_LOG(("Not a valid slotlist\n")); + SLOTLIST_DEBUG_LOG(("Not a valid slotlist")); if (!game) { - SLOTLIST_DEBUG_LOG(("No game!\n")); + SLOTLIST_DEBUG_LOG(("No game!")); } else { if (!game->getSlot(0)) { - SLOTLIST_DEBUG_LOG(("No slot 0!\n")); + SLOTLIST_DEBUG_LOG(("No slot 0!")); } else { if (TheGameSpyInfo->amIHost()) { - SLOTLIST_DEBUG_LOG(("I'm the host!\n")); + SLOTLIST_DEBUG_LOG(("I'm the host!")); } else { - SLOTLIST_DEBUG_LOG(("Not from the host! isHuman:%d, name:'%ls', sender:'%s'\n", + SLOTLIST_DEBUG_LOG(("Not from the host! isHuman:%d, name:'%ls', sender:'%s'", game->getSlot(0)->isHuman(), game->getSlot(0)->getName().str(), resp.nick.c_str())); } @@ -2049,15 +2049,15 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) Bool isInGame = newLocalSlotNum >= 0; if (!optionsOK) { - SLOTLIST_DEBUG_LOG(("Options are bad! bailing!\n")); + SLOTLIST_DEBUG_LOG(("Options are bad! bailing!")); break; } else { - SLOTLIST_DEBUG_LOG(("Options are good, local slot is %d\n", newLocalSlotNum)); + SLOTLIST_DEBUG_LOG(("Options are good, local slot is %d", newLocalSlotNum)); if (!isInGame) { - SLOTLIST_DEBUG_LOG(("Not in game; players are:\n")); + SLOTLIST_DEBUG_LOG(("Not in game; players are:")); for (Int i=0; igetGameSpySlot(i); @@ -2065,7 +2065,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) { UnicodeString munkee; munkee.format(L"\t%d: %ls", i, slot->getName().str()); - SLOTLIST_DEBUG_LOG(("%ls\n", munkee.str())); + SLOTLIST_DEBUG_LOG(("%ls", munkee.str())); } } } @@ -2125,7 +2125,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) { // can't see ourselves buttonPushed = true; - DEBUG_LOG(("Can't see ourselves in slotlist %s\n", options.str())); + DEBUG_LOG(("Can't see ourselves in slotlist %s", options.str())); TheGameSpyInfo->getCurrentStagingRoom()->reset(); TheGameSpyInfo->leaveStagingRoom(); //TheGameSpyInfo->joinBestGroupRoom(); @@ -2212,7 +2212,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) UnicodeString message = TheGameText->fetch("GUI:GSKicked"); AsciiString commandMessage = resp.commandOptions.c_str(); commandMessage.trim(); - DEBUG_LOG(("We were kicked: reason was '%s'\n", resp.commandOptions.c_str())); + DEBUG_LOG(("We were kicked: reason was '%s'", resp.commandOptions.c_str())); if (commandMessage == "GameStarted") { message = TheGameText->fetch("GUI:GSKickedGameStarted"); @@ -2274,7 +2274,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) options.nextToken(&key, "="); Int val = atoi(options.str()+1); UnsignedInt uVal = atoi(options.str()+1); - DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d\n", key.str(), options.str()+1, slotNum)); + DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d", key.str(), options.str()+1, slotNum)); GameSpyGameSlot *slot = game->getGameSpySlot(slotNum); if (!slot) @@ -2303,7 +2303,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) } else { - DEBUG_LOG(("Rejecting invalid color %d\n", val)); + DEBUG_LOG(("Rejecting invalid color %d", val)); } } else if (key == "PlayerTemplate") @@ -2332,7 +2332,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) } else { - DEBUG_LOG(("Rejecting invalid PlayerTemplate %d\n", val)); + DEBUG_LOG(("Rejecting invalid PlayerTemplate %d", val)); } } else if (key == "StartPos") @@ -2359,7 +2359,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) } else { - DEBUG_LOG(("Rejecting invalid startPos %d\n", val)); + DEBUG_LOG(("Rejecting invalid startPos %d", val)); } } else if (key == "Team") @@ -2372,7 +2372,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) } else { - DEBUG_LOG(("Rejecting invalid team %d\n", val)); + DEBUG_LOG(("Rejecting invalid team %d", val)); } } else if (key == "IP") @@ -2386,7 +2386,7 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) } else { - DEBUG_LOG(("Rejecting invalid IP %d\n", uVal)); + DEBUG_LOG(("Rejecting invalid IP %d", uVal)); } } else if (key == "NAT") @@ -2395,19 +2395,19 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) (val <= FirewallHelperClass::FIREWALL_MAX)) { slot->setNATBehavior((FirewallHelperClass::FirewallBehaviorType)val); - DEBUG_LOG(("Setting NAT behavior to %d for player %d\n", val, slotNum)); + DEBUG_LOG(("Setting NAT behavior to %d for player %d", val, slotNum)); change = true; } else { - DEBUG_LOG(("Rejecting invalid NAT behavior %d from player %d\n", val, slotNum)); + DEBUG_LOG(("Rejecting invalid NAT behavior %d from player %d", val, slotNum)); } } else if (key == "Ping") { slot->setPingString(options.str()+1); TheGameSpyInfo->setGameOptions(); - DEBUG_LOG(("Setting ping string to %s for player %d\n", options.str()+1, slotNum)); + DEBUG_LOG(("Setting ping string to %s for player %d", options.str()+1, slotNum)); } if (change) @@ -2418,9 +2418,9 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) TheGameSpyInfo->setGameOptions(); WOLDisplaySlotList(); - DEBUG_LOG(("Slot value is color=%d, PlayerTemplate=%d, startPos=%d, team=%d, IP=0x%8.8X\n", + DEBUG_LOG(("Slot value is color=%d, PlayerTemplate=%d, startPos=%d, team=%d, IP=0x%8.8X", slot->getColor(), slot->getPlayerTemplate(), slot->getStartPos(), slot->getTeamNumber(), slot->getIP())); - DEBUG_LOG(("Slot list updated to %s\n", GameInfoToAsciiString(game).str())); + DEBUG_LOG(("Slot list updated to %s", GameInfoToAsciiString(game).str())); } } } @@ -2453,7 +2453,7 @@ WindowMsgHandledType WOLGameSetupMenuInput( GameWindow *window, UnsignedInt msg, GameWindow *control = (GameWindow *)mData1; NameKeyType controlID = (NameKeyType)control->winGetWindowId(); - DEBUG_LOG(("GWM_RIGHT_UP for control %d(%s)\n", controlID, TheNameKeyGenerator->keyToName(controlID).str())); + DEBUG_LOG(("GWM_RIGHT_UP for control %d(%s)", controlID, TheNameKeyGenerator->keyToName(controlID).str())); break; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index d9add5e2d0..b6c1a474dc 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -344,7 +344,7 @@ static void populateGroupRoomListbox(GameWindow *lb) GameSpyGroupRoom room = iter->second; if (room.m_groupID != TheGameSpyConfig->getQMChannel()) { - DEBUG_LOG(("populateGroupRoomListbox(): groupID %d\n", room.m_groupID)); + DEBUG_LOG(("populateGroupRoomListbox(): groupID %d", room.m_groupID)); if (room.m_groupID == TheGameSpyInfo->getCurrentGroupRoom()) { Int selected = GadgetComboBoxAddEntry(lb, room.m_translatedName, GameSpyColor[GSCOLOR_CURRENTROOM]); @@ -359,7 +359,7 @@ static void populateGroupRoomListbox(GameWindow *lb) } else { - DEBUG_LOG(("populateGroupRoomListbox(): skipping QM groupID %d\n", room.m_groupID)); + DEBUG_LOG(("populateGroupRoomListbox(): skipping QM groupID %d", room.m_groupID)); } } @@ -516,7 +516,7 @@ void PopulateLobbyPlayerListbox(void) uStr = GadgetListBoxGetText(listboxLobbyPlayers, selectedIndices[i], COLUMN_PLAYERNAME); selectedName.translate(uStr); selectedNames.insert(selectedName); - DEBUG_LOG(("Saving off old selection %d (%s)\n", selectedIndices[i], selectedName.str())); + DEBUG_LOG(("Saving off old selection %d (%s)", selectedIndices[i], selectedName.str())); } // save off old top entry @@ -535,7 +535,7 @@ void PopulateLobbyPlayerListbox(void) selIt = selectedNames.find(info.m_name); if (selIt != selectedNames.end()) { - DEBUG_LOG(("Marking index %d (%s) to re-select\n", index, info.m_name.str())); + DEBUG_LOG(("Marking index %d (%s) to re-select", index, info.m_name.str())); indicesToSelect.insert(index); } } @@ -553,7 +553,7 @@ void PopulateLobbyPlayerListbox(void) selIt = selectedNames.find(info.m_name); if (selIt != selectedNames.end()) { - DEBUG_LOG(("Marking index %d (%s) to re-select\n", index, info.m_name.str())); + DEBUG_LOG(("Marking index %d (%s) to re-select", index, info.m_name.str())); indicesToSelect.insert(index); } } @@ -571,7 +571,7 @@ void PopulateLobbyPlayerListbox(void) selIt = selectedNames.find(info.m_name); if (selIt != selectedNames.end()) { - DEBUG_LOG(("Marking index %d (%s) to re-select\n", index, info.m_name.str())); + DEBUG_LOG(("Marking index %d (%s) to re-select", index, info.m_name.str())); indicesToSelect.insert(index); } } @@ -587,7 +587,7 @@ void PopulateLobbyPlayerListbox(void) while (index < count) { newIndices[index] = *indexIt; - DEBUG_LOG(("Queueing up index %d to re-select\n", *indexIt)); + DEBUG_LOG(("Queueing up index %d to re-select", *indexIt)); ++index; ++indexIt; } @@ -668,19 +668,19 @@ void WOLLobbyMenuInit( WindowLayout *layout, void *userData ) { if (groupRoomToJoin) { - DEBUG_LOG(("WOLLobbyMenuInit() - rejoining group room %d\n", groupRoomToJoin)); + DEBUG_LOG(("WOLLobbyMenuInit() - rejoining group room %d", groupRoomToJoin)); TheGameSpyInfo->joinGroupRoom(groupRoomToJoin); groupRoomToJoin = 0; } else { - DEBUG_LOG(("WOLLobbyMenuInit() - joining best group room\n")); + DEBUG_LOG(("WOLLobbyMenuInit() - joining best group room")); TheGameSpyInfo->joinBestGroupRoom(); } } else { - DEBUG_LOG(("WOLLobbyMenuInit() - not joining group room because we're already in one\n")); + DEBUG_LOG(("WOLLobbyMenuInit() - not joining group room because we're already in one")); } GrabWindowInfo(); @@ -872,15 +872,15 @@ static void refreshGameList( Bool forceRefresh ) { if (TheGameSpyInfo->hasStagingRoomListChanged()) { - //DEBUG_LOG(("################### refreshing game list\n")); - //DEBUG_LOG(("gameRefreshTime=%d, refreshInterval=%d, now=%d\n", gameListRefreshTime, refreshInterval, timeGetTime())); + //DEBUG_LOG(("################### refreshing game list")); + //DEBUG_LOG(("gameRefreshTime=%d, refreshInterval=%d, now=%d", gameListRefreshTime, refreshInterval, timeGetTime())); RefreshGameListBoxes(); gameListRefreshTime = timeGetTime(); } else { //DEBUG_LOG(("-")); } } else { - //DEBUG_LOG(("gameListRefreshTime: %d refreshInterval: %d\n")); + //DEBUG_LOG(("gameListRefreshTime: %d refreshInterval: %d")); } } //------------------------------------------------------------------------------------------------- @@ -972,7 +972,7 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) } else { - DEBUG_LOG(("WOLLobbyMenuUpdate() - joining best group room\n")); + DEBUG_LOG(("WOLLobbyMenuUpdate() - joining best group room")); TheGameSpyInfo->joinBestGroupRoom(); } populateGroupRoomListbox(comboLobbyGroupRooms); @@ -1016,7 +1016,7 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) case PeerResponse::PEERRESPONSE_PLAYERUTM: case PeerResponse::PEERRESPONSE_ROOMUTM: { - DEBUG_LOG(("Putting off a UTM in the lobby\n")); + DEBUG_LOG(("Putting off a UTM in the lobby")); TheLobbyQueuedUTMs.push_back(resp); } break; @@ -1085,7 +1085,7 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) const char *firstPlayer = resp.stagingRoomPlayerNames[i].c_str(); if (!strcmp(hostName.str(), firstPlayer)) { - DEBUG_LOG(("Saw host %s == %s in slot %d\n", hostName.str(), firstPlayer, i)); + DEBUG_LOG(("Saw host %s == %s in slot %d", hostName.str(), firstPlayer, i)); isHostPresent = TRUE; } } @@ -1129,13 +1129,13 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) GSMessageBoxOk(TheGameText->fetch("GUI:JoinFailedDefault"), s); if (groupRoomToJoin) { - DEBUG_LOG(("WOLLobbyMenuUpdate() - rejoining group room %d\n", groupRoomToJoin)); + DEBUG_LOG(("WOLLobbyMenuUpdate() - rejoining group room %d", groupRoomToJoin)); TheGameSpyInfo->joinGroupRoom(groupRoomToJoin); groupRoomToJoin = 0; } else { - DEBUG_LOG(("WOLLobbyMenuUpdate() - joining best group room\n")); + DEBUG_LOG(("WOLLobbyMenuUpdate() - joining best group room")); TheGameSpyInfo->joinBestGroupRoom(); } } @@ -1250,7 +1250,7 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) } } DEBUG_ASSERTCRASH(numPlayers, ("Game had no players!\n")); - //DEBUG_LOG(("Saw room: hasPass=%d, allowsObservers=%d\n", room.getHasPassword(), room.getAllowObservers())); + //DEBUG_LOG(("Saw room: hasPass=%d, allowsObservers=%d", room.getHasPassword(), room.getAllowObservers())); if (resp.stagingRoom.action == PEER_ADD) { TheGameSpyInfo->addStagingRoom(room); @@ -1312,15 +1312,15 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) { if (TheGameSpyInfo->hasStagingRoomListChanged()) { - //DEBUG_LOG(("################### refreshing game list\n")); - //DEBUG_LOG(("gameRefreshTime=%d, refreshInterval=%d, now=%d\n", gameListRefreshTime, refreshInterval, timeGetTime())); + //DEBUG_LOG(("################### refreshing game list")); + //DEBUG_LOG(("gameRefreshTime=%d, refreshInterval=%d, now=%d", gameListRefreshTime, refreshInterval, timeGetTime())); RefreshGameListBoxes(); gameListRefreshTime = timeGetTime(); } else { //DEBUG_LOG(("-")); } } else { - //DEBUG_LOG(("gameListRefreshTime: %d refreshInterval: %d\n")); + //DEBUG_LOG(("gameListRefreshTime: %d refreshInterval: %d")); } #else refreshGameList(); @@ -1570,7 +1570,7 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg, if (!roomToJoin || roomToJoin->getExeCRC() != TheGlobalData->m_exeCRC || roomToJoin->getIniCRC() != TheGlobalData->m_iniCRC) { // bad crc. don't go. - DEBUG_LOG(("WOLLobbyMenuSystem - CRC mismatch with the game I'm trying to join. My CRC's - EXE:0x%08X INI:0x%08X Their CRC's - EXE:0x%08x INI:0x%08x\n", TheGlobalData->m_exeCRC, TheGlobalData->m_iniCRC, roomToJoin->getExeCRC(), roomToJoin->getIniCRC())); + DEBUG_LOG(("WOLLobbyMenuSystem - CRC mismatch with the game I'm trying to join. My CRC's - EXE:0x%08X INI:0x%08X Their CRC's - EXE:0x%08x INI:0x%08x", TheGlobalData->m_exeCRC, TheGlobalData->m_iniCRC, roomToJoin->getExeCRC(), roomToJoin->getIniCRC())); #if defined(RTS_DEBUG) if (TheGlobalData->m_netMinPlayers) { @@ -1666,12 +1666,12 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg, int rowSelected = -1; GadgetComboBoxGetSelectedPos(control, &rowSelected); - DEBUG_LOG(("Row selected = %d\n", rowSelected)); + DEBUG_LOG(("Row selected = %d", rowSelected)); if (rowSelected >= 0) { Int groupID; groupID = (Int)GadgetComboBoxGetItemData(comboLobbyGroupRooms, rowSelected); - DEBUG_LOG(("ItemData was %d, current Group Room is %d\n", groupID, TheGameSpyInfo->getCurrentGroupRoom())); + DEBUG_LOG(("ItemData was %d, current Group Room is %d", groupID, TheGameSpyInfo->getCurrentGroupRoom())); if (groupID && groupID != TheGameSpyInfo->getCurrentGroupRoom()) { TheGameSpyInfo->leaveGroupRoom(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp index cb1d566db2..62283d0887 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp @@ -769,7 +769,7 @@ static void checkLogin( void ) { // save off our ping string, and end those threads AsciiString pingStr = ThePinger->getPingString( 1000 ); - DEBUG_LOG(("Ping string is %s\n", pingStr.str())); + DEBUG_LOG(("Ping string is %s", pingStr.str())); TheGameSpyInfo->setPingString(pingStr); //delete ThePinger; //ThePinger = NULL; @@ -868,7 +868,7 @@ void WOLLoginMenuUpdate( WindowLayout * layout, void *userData) // kill & restart the threads AsciiString motd = TheGameSpyInfo->getMOTD(); AsciiString config = TheGameSpyInfo->getConfig(); - DEBUG_LOG(("Tearing down GameSpy from WOLLoginMenuUpdate(PEERRESPONSE_DISCONNECT)\n")); + DEBUG_LOG(("Tearing down GameSpy from WOLLoginMenuUpdate(PEERRESPONSE_DISCONNECT)")); TearDownGameSpy(); SetUpGameSpy( motd.str(), config.str() ); } @@ -894,7 +894,7 @@ void WOLLoginMenuUpdate( WindowLayout * layout, void *userData) // kill & restart the threads AsciiString motd = TheGameSpyInfo->getMOTD(); AsciiString config = TheGameSpyInfo->getConfig(); - DEBUG_LOG(("Tearing down GameSpy from WOLLoginMenuUpdate(login timeout)\n")); + DEBUG_LOG(("Tearing down GameSpy from WOLLoginMenuUpdate(login timeout)")); TearDownGameSpy(); SetUpGameSpy( motd.str(), config.str() ); } @@ -1273,7 +1273,7 @@ WindowMsgHandledType WOLLoginMenuSystem( GameWindow *window, UnsignedInt msg, //TheGameSpyInfo->setLocalProfileID( resp.player.profileID ); TheGameSpyInfo->setLocalEmail( email ); TheGameSpyInfo->setLocalPassword( password ); - DEBUG_LOG(("before create: TheGameSpyInfo->stuff(%s/%s/%s)\n", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); + DEBUG_LOG(("before create: TheGameSpyInfo->stuff(%s/%s/%s)", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); TheGameSpyBuddyMessageQueue->addRequest( req ); if(checkBoxRememberPassword && GadgetCheckBoxIsChecked(checkBoxRememberPassword)) @@ -1362,7 +1362,7 @@ WindowMsgHandledType WOLLoginMenuSystem( GameWindow *window, UnsignedInt msg, //TheGameSpyInfo->setLocalProfileID( resp.player.profileID ); TheGameSpyInfo->setLocalEmail( email ); TheGameSpyInfo->setLocalPassword( password ); - DEBUG_LOG(("before login: TheGameSpyInfo->stuff(%s/%s/%s)\n", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); + DEBUG_LOG(("before login: TheGameSpyInfo->stuff(%s/%s/%s)", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str())); TheGameSpyBuddyMessageQueue->addRequest( req ); if(checkBoxRememberPassword && GadgetCheckBoxIsChecked(checkBoxRememberPassword)) @@ -1479,7 +1479,7 @@ WindowMsgHandledType WOLLoginMenuSystem( GameWindow *window, UnsignedInt msg, } } //uniLine.trim(); - DEBUG_LOG(("adding TOS line: [%ls]\n", uniLine.str())); + DEBUG_LOG(("adding TOS line: [%ls]", uniLine.str())); GadgetListBoxAddEntryText(listboxTOS, uniLine, tosColor, -1); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp index b2a0d3ae43..ce740ab911 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp @@ -709,7 +709,7 @@ void WOLQuickMatchMenuInit( WindowLayout *layout, void *userData ) GameSpyCloseAllOverlays(); GSMessageBoxOk( title, body ); TheGameSpyInfo->reset(); - DEBUG_LOG(("WOLQuickMatchMenuInit() - game was in progress, and we were disconnected, so pop immediate back to main menu\n")); + DEBUG_LOG(("WOLQuickMatchMenuInit() - game was in progress, and we were disconnected, so pop immediate back to main menu")); TheShell->popImmediate(); return; } @@ -1116,17 +1116,17 @@ void WOLQuickMatchMenuUpdate( WindowLayout * layout, void *userData) { if (!stricmp(resp.command.c_str(), "STATS")) { - DEBUG_LOG(("Saw STATS from %s, data was '%s'\n", resp.nick.c_str(), resp.commandOptions.c_str())); + DEBUG_LOG(("Saw STATS from %s, data was '%s'", resp.nick.c_str(), resp.commandOptions.c_str())); AsciiString data = resp.commandOptions.c_str(); AsciiString idStr; data.nextToken(&idStr, " "); Int id = atoi(idStr.str()); - DEBUG_LOG(("data: %d(%s) - '%s'\n", id, idStr.str(), data.str())); + DEBUG_LOG(("data: %d(%s) - '%s'", id, idStr.str(), data.str())); PSPlayerStats stats = TheGameSpyPSMessageQueue->parsePlayerKVPairs(data.str()); PSPlayerStats oldStats = TheGameSpyPSMessageQueue->findPlayerStatsByID(id); stats.id = id; - DEBUG_LOG(("Parsed ID is %d, old ID is %d\n", stats.id, oldStats.id)); + DEBUG_LOG(("Parsed ID is %d, old ID is %d", stats.id, oldStats.id)); if (stats.id && (oldStats.id == 0)) TheGameSpyPSMessageQueue->trackPlayerStats(stats); @@ -1157,12 +1157,12 @@ void WOLQuickMatchMenuUpdate( WindowLayout * layout, void *userData) (val <= FirewallHelperClass::FIREWALL_TYPE_DESTINATION_PORT_DELTA)) { slot->setNATBehavior((FirewallHelperClass::FirewallBehaviorType)val); - DEBUG_LOG(("Setting NAT behavior to %d for player %d\n", val, slotNum)); + DEBUG_LOG(("Setting NAT behavior to %d for player %d", val, slotNum)); change = true; } else { - DEBUG_LOG(("Rejecting invalid NAT behavior %d from player %d\n", val, slotNum)); + DEBUG_LOG(("Rejecting invalid NAT behavior %d from player %d", val, slotNum)); } } */ @@ -1389,7 +1389,7 @@ void WOLQuickMatchMenuUpdate( WindowLayout * layout, void *userData) } } - DEBUG_LOG(("Starting a QM game: options=[%s]\n", GameInfoToAsciiString(TheGameSpyGame).str())); + DEBUG_LOG(("Starting a QM game: options=[%s]", GameInfoToAsciiString(TheGameSpyGame).str())); SendStatsToOtherPlayers(TheGameSpyGame); TheGameSpyGame->startGame(0); GameWindow *buttonBuddies = TheWindowManager->winGetWindowFromId(NULL, buttonBuddiesID); @@ -1710,7 +1710,7 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms if (ladderInfo && ladderInfo->randomFactions) { Int sideNum = GameClientRandomValue(0, ladderInfo->validFactions.size()-1); - DEBUG_LOG(("Looking for %d out of %d random sides\n", sideNum, ladderInfo->validFactions.size())); + DEBUG_LOG(("Looking for %d out of %d random sides", sideNum, ladderInfo->validFactions.size())); AsciiStringListConstIterator cit = ladderInfo->validFactions.begin(); while (sideNum) { @@ -1721,13 +1721,13 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms { Int numPlayerTemplates = ThePlayerTemplateStore->getPlayerTemplateCount(); AsciiString sideStr = *cit; - DEBUG_LOG(("Chose %s as our side... finding\n", sideStr.str())); + DEBUG_LOG(("Chose %s as our side... finding", sideStr.str())); for (Int c=0; cgetNthPlayerTemplate(c); if (fac && fac->getSide() == sideStr) { - DEBUG_LOG(("Found %s in index %d\n", sideStr.str(), c)); + DEBUG_LOG(("Found %s in index %d", sideStr.str(), c)); req.QM.side = c; break; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp index 839920bffe..9007e49704 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp @@ -286,7 +286,7 @@ static void updateNumPlayersOnline(void) g = grabUByte(aLine.str()+5); b = grabUByte(aLine.str()+7); c = GameMakeColor(r, g, b, a); - DEBUG_LOG(("MOTD line '%s' has color %X\n", aLine.str(), c)); + DEBUG_LOG(("MOTD line '%s' has color %X", aLine.str(), c)); aLine = aLine.str() + 9; } line = UnicodeString(MultiByteToWideCharSingleLine(aLine.str()).c_str()); @@ -325,12 +325,12 @@ static const char* FindNextNumber( const char* pStart ) //parse win/loss stats received from GameSpy void HandleOverallStats( const char* szHTTPStats, unsigned len ) { -//x DEBUG_LOG(("Parsing win percent stats:\n%s\n", szHTTPStats)); +//x DEBUG_LOG(("Parsing win percent stats:\n%s", szHTTPStats)); //find today's stats const char* pToday = strstr( szHTTPStats, "Today" ); if( !pToday ) { //error - DEBUG_LOG(( "Unable to parse win/loss stats. Could not find 'Today' in:\n%s\n", szHTTPStats )); + DEBUG_LOG(( "Unable to parse win/loss stats. Could not find 'Today' in:\n%s", szHTTPStats )); return; } s_winStats.clear(); @@ -351,7 +351,7 @@ void HandleOverallStats( const char* szHTTPStats, unsigned len ) const char* pSide = strstr( pToday, side.str() ); if( pSide == NULL ) { //error, skip this side - DEBUG_LOG(( "Unable to parse win/loss stats for %s in:\n%s\n", side.str(), szHTTPStats )); + DEBUG_LOG(( "Unable to parse win/loss stats for %s in:\n%s", side.str(), szHTTPStats )); continue; } @@ -363,7 +363,7 @@ void HandleOverallStats( const char* szHTTPStats, unsigned len ) s_totalWinPercent += percent; s_winStats.insert(std::make_pair( side, percent )); -//x DEBUG_LOG(("Added win percent: %s, %d\n", side.str(), percent)); +//x DEBUG_LOG(("Added win percent: %s, %d", side.str(), percent)); } //for i } //HandleOverallStats @@ -386,7 +386,7 @@ static void updateOverallStats(void) wndName.format( "WOLWelcomeMenu.wnd:Percent%s", it->first.str() ); pWin = TheWindowManager->winGetWindowFromId( NULL, NAMEKEY(wndName) ); GadgetCheckBoxSetText( pWin, percStr ); -//x DEBUG_LOG(("Initialized win percent: %s -> %s %f=%s\n", wndName.str(), it->first.str(), it->second, percStr.str() )); +//x DEBUG_LOG(("Initialized win percent: %s -> %s %f=%s", wndName.str(), it->first.str(), it->second, percStr.str() )); } //for } //updateOverallStats @@ -796,7 +796,7 @@ WindowMsgHandledType WOLWelcomeMenuSystem( GameWindow *window, UnsignedInt msg, breq.buddyRequestType = BuddyRequest::BUDDYREQUEST_LOGOUT; TheGameSpyBuddyMessageQueue->addRequest( breq ); - DEBUG_LOG(("Tearing down GameSpy from WOLWelcomeMenuSystem(GBM_SELECTED)\n")); + DEBUG_LOG(("Tearing down GameSpy from WOLWelcomeMenuSystem(GBM_SELECTED)")); TearDownGameSpy(); /* diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp index e85ec198cc..4997ac49af 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp @@ -2429,7 +2429,7 @@ void GadgetListBoxAddMultiSelect( GameWindow *listbox ) DEBUG_ASSERTCRASH(listboxData && listboxData->selections == NULL, ("selections is not NULL")); listboxData->selections = NEW Int [listboxData->listLength]; - DEBUG_LOG(( "Enable list box multi select: listLength (select) = %d * %d = %d bytes;\n", + DEBUG_LOG(( "Enable list box multi select: listLength (select) = %d * %d = %d bytes;", listboxData->listLength, sizeof(Int), listboxData->listLength *sizeof(Int) )); @@ -2569,7 +2569,7 @@ void GadgetListBoxSetListLength( GameWindow *listbox, Int newLength ) if( listboxData->listData == NULL ) { - DEBUG_LOG(( "Unable to allocate listbox data pointer\n" )); + DEBUG_LOG(( "Unable to allocate listbox data pointer" )); assert( 0 ); return; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp index 9056c70a29..1b8b18b7b2 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp @@ -208,7 +208,7 @@ GameFont *FontLibrary::getFont( AsciiString name, Int pointSize, Bool bold ) font->bold = bold; font->fontData = NULL; - //DEBUG_LOG(("Font: Loading font '%s' %d point\n", font->nameString.str(), font->pointSize)); + //DEBUG_LOG(("Font: Loading font '%s' %d point", font->nameString.str(), font->pointSize)); // load the device specific data pointer if( loadFontData( font ) == FALSE ) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp index 43cd553632..57da2d2c22 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp @@ -1607,7 +1607,7 @@ Int GameWindow::winSetEnabledImage( Int index, const Image *image ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set enabled image, index out of range '%d'\n", index )); + DEBUG_LOG(( "set enabled image, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1628,7 +1628,7 @@ Int GameWindow::winSetEnabledColor( Int index, Color color ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set enabled color, index out of range '%d'\n", index )); + DEBUG_LOG(( "set enabled color, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1649,7 +1649,7 @@ Int GameWindow::winSetEnabledBorderColor( Int index, Color color ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set enabled border color, index out of range '%d'\n", index )); + DEBUG_LOG(( "set enabled border color, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1670,7 +1670,7 @@ Int GameWindow::winSetDisabledImage( Int index, const Image *image ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set disabled image, index out of range '%d'\n", index )); + DEBUG_LOG(( "set disabled image, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1691,7 +1691,7 @@ Int GameWindow::winSetDisabledColor( Int index, Color color ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set disabled color, index out of range '%d'\n", index )); + DEBUG_LOG(( "set disabled color, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1712,7 +1712,7 @@ Int GameWindow::winSetDisabledBorderColor( Int index, Color color ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set disabled border color, index out of range '%d'\n", index )); + DEBUG_LOG(( "set disabled border color, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1733,7 +1733,7 @@ Int GameWindow::winSetHiliteImage( Int index, const Image *image ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set hilite image, index out of range '%d'\n", index )); + DEBUG_LOG(( "set hilite image, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1754,7 +1754,7 @@ Int GameWindow::winSetHiliteColor( Int index, Color color ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set hilite color, index out of range '%d'\n", index )); + DEBUG_LOG(( "set hilite color, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; @@ -1775,7 +1775,7 @@ Int GameWindow::winSetHiliteBorderColor( Int index, Color color ) if( index < 0 || index >= MAX_DRAW_DATA ) { - DEBUG_LOG(( "set hilite border color, index out of range '%d'\n", index )); + DEBUG_LOG(( "set hilite border color, index out of range '%d'", index )); assert( 0 ); return WIN_ERR_INVALID_PARAMETER; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp index 86c10e7741..7d96774f3a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp @@ -1374,7 +1374,7 @@ void GameWindowManager::dumpWindow( GameWindow *window ) if( window == NULL ) return; - DEBUG_LOG(( "ID: %d\tRedraw: 0x%08X\tUser Data: %d\n", + DEBUG_LOG(( "ID: %d\tRedraw: 0x%08X\tUser Data: %d", window->winGetWindowId(), window->m_draw, window->m_userData )); for( child = window->m_child; child; child = child->m_next ) @@ -1401,7 +1401,7 @@ GameWindow *GameWindowManager::winCreate( GameWindow *parent, if( window == NULL ) { - DEBUG_LOG(( "WinCreate error: Could not allocate new window\n" )); + DEBUG_LOG(( "WinCreate error: Could not allocate new window" )); #ifndef FINAL { GameWindow *win; @@ -1602,7 +1602,7 @@ Int GameWindowManager::winUnsetModal( GameWindow *window ) { // return error if not - DEBUG_LOG(( "WinUnsetModal: Invalid window attempting to unset modal (%d)\n", + DEBUG_LOG(( "WinUnsetModal: Invalid window attempting to unset modal (%d)", window->winGetWindowId() )); return WIN_ERR_GENERAL_FAILURE; @@ -1849,7 +1849,7 @@ GameWindow *GameWindowManager::gogoGadgetPushButton( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_PUSH_BUTTON ) == FALSE ) { - DEBUG_LOG(( "Cann't create button gadget, instance data not button type\n" )); + DEBUG_LOG(( "Cann't create button gadget, instance data not button type" )); assert( 0 ); return NULL; @@ -1863,7 +1863,7 @@ GameWindow *GameWindowManager::gogoGadgetPushButton( GameWindow *parent, if( button == NULL ) { - DEBUG_LOG(( "Unable to create button for push button gadget\n" )); + DEBUG_LOG(( "Unable to create button for push button gadget" )); assert( 0 ); return NULL; @@ -1917,7 +1917,7 @@ GameWindow *GameWindowManager::gogoGadgetCheckbox( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_CHECK_BOX ) == FALSE ) { - DEBUG_LOG(( "Cann't create checkbox gadget, instance data not checkbox type\n" )); + DEBUG_LOG(( "Cann't create checkbox gadget, instance data not checkbox type" )); assert( 0 ); return NULL; @@ -1931,7 +1931,7 @@ GameWindow *GameWindowManager::gogoGadgetCheckbox( GameWindow *parent, if( checkbox == NULL ) { - DEBUG_LOG(( "Unable to create checkbox window\n" )); + DEBUG_LOG(( "Unable to create checkbox window" )); assert( 0 ); return NULL; @@ -1984,7 +1984,7 @@ GameWindow *GameWindowManager::gogoGadgetRadioButton( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_RADIO_BUTTON ) == FALSE ) { - DEBUG_LOG(( "Cann't create radioButton gadget, instance data not radioButton type\n" )); + DEBUG_LOG(( "Cann't create radioButton gadget, instance data not radioButton type" )); assert( 0 ); return NULL; @@ -1998,7 +1998,7 @@ GameWindow *GameWindowManager::gogoGadgetRadioButton( GameWindow *parent, if( radioButton == NULL ) { - DEBUG_LOG(( "Unable to create radio button window\n" )); + DEBUG_LOG(( "Unable to create radio button window" )); assert( 0 ); return NULL; @@ -2056,7 +2056,7 @@ GameWindow *GameWindowManager::gogoGadgetTabControl( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_TAB_CONTROL ) == FALSE ) { - DEBUG_LOG(( "Cann't create tabControl gadget, instance data not tabControl type\n" )); + DEBUG_LOG(( "Cann't create tabControl gadget, instance data not tabControl type" )); assert( 0 ); return NULL; @@ -2070,7 +2070,7 @@ GameWindow *GameWindowManager::gogoGadgetTabControl( GameWindow *parent, if( tabControl == NULL ) { - DEBUG_LOG(( "Unable to create tab control window\n" )); + DEBUG_LOG(( "Unable to create tab control window" )); assert( 0 ); return NULL; @@ -2128,7 +2128,7 @@ GameWindow *GameWindowManager::gogoGadgetListBox( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_SCROLL_LISTBOX ) == FALSE ) { - DEBUG_LOG(( "Cann't create listbox gadget, instance data not listbox type\n" )); + DEBUG_LOG(( "Cann't create listbox gadget, instance data not listbox type" )); assert( 0 ); return NULL; @@ -2141,7 +2141,7 @@ GameWindow *GameWindowManager::gogoGadgetListBox( GameWindow *parent, if( listbox == NULL ) { - DEBUG_LOG(( "Unable to create listbox window\n" )); + DEBUG_LOG(( "Unable to create listbox window" )); assert( 0 ); return NULL; @@ -2307,7 +2307,7 @@ GameWindow *GameWindowManager::gogoGadgetSlider( GameWindow *parent, else { - DEBUG_LOG(( "gogoGadgetSlider warning: unrecognized slider style.\n" )); + DEBUG_LOG(( "gogoGadgetSlider warning: unrecognized slider style." )); assert( 0 ); return NULL; @@ -2317,7 +2317,7 @@ GameWindow *GameWindowManager::gogoGadgetSlider( GameWindow *parent, if( slider == NULL ) { - DEBUG_LOG(( "Unable to create slider control window\n" )); + DEBUG_LOG(( "Unable to create slider control window" )); assert( 0 ); return NULL; @@ -2396,7 +2396,7 @@ GameWindow *GameWindowManager::gogoGadgetComboBox( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_COMBO_BOX) == FALSE ) { - DEBUG_LOG(( "Cann't create ComboBox gadget, instance data not ComboBox type\n" )); + DEBUG_LOG(( "Cann't create ComboBox gadget, instance data not ComboBox type" )); assert( 0 ); return NULL; @@ -2409,7 +2409,7 @@ GameWindow *GameWindowManager::gogoGadgetComboBox( GameWindow *parent, if( comboBox == NULL ) { - DEBUG_LOG(( "Unable to create ComboBox window\n" )); + DEBUG_LOG(( "Unable to create ComboBox window" )); assert( 0 ); return NULL; @@ -2600,7 +2600,7 @@ GameWindow *GameWindowManager::gogoGadgetProgressBar( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_PROGRESS_BAR ) == FALSE ) { - DEBUG_LOG(( "Cann't create progressBar gadget, instance data not progressBar type\n" )); + DEBUG_LOG(( "Cann't create progressBar gadget, instance data not progressBar type" )); assert( 0 ); return NULL; @@ -2614,7 +2614,7 @@ GameWindow *GameWindowManager::gogoGadgetProgressBar( GameWindow *parent, if( progressBar == NULL ) { - DEBUG_LOG(( "Unable to create progress bar control\n" )); + DEBUG_LOG(( "Unable to create progress bar control" )); assert( 0 ); return NULL; @@ -2666,7 +2666,7 @@ GameWindow *GameWindowManager::gogoGadgetStaticText( GameWindow *parent, } else { - DEBUG_LOG(( "gogoGadgetText warning: unrecognized text style.\n" )); + DEBUG_LOG(( "gogoGadgetText warning: unrecognized text style." )); return NULL; } @@ -2728,7 +2728,7 @@ GameWindow *GameWindowManager::gogoGadgetTextEntry( GameWindow *parent, if( BitIsSet( instData->getStyle(), GWS_ENTRY_FIELD ) == FALSE ) { - DEBUG_LOG(( "Unable to create text entry, style not entry type\n" )); + DEBUG_LOG(( "Unable to create text entry, style not entry type" )); assert( 0 ); return NULL; @@ -2740,7 +2740,7 @@ GameWindow *GameWindowManager::gogoGadgetTextEntry( GameWindow *parent, if( entry == NULL ) { - DEBUG_LOG(( "Unable to create text entry window\n" )); + DEBUG_LOG(( "Unable to create text entry window" )); assert( 0 ); return NULL; @@ -2834,7 +2834,7 @@ GameWindow *GameWindowManager::gogoGadgetTextEntry( GameWindow *parent, if( data->constructList == NULL ) { - DEBUG_LOG(( "gogoGadgetEntry warning: Failed to create listbox.\n" )); + DEBUG_LOG(( "gogoGadgetEntry warning: Failed to create listbox." )); assert( 0 ); winDestroy( entry ); return NULL; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp index b8ce0db552..4f2c000634 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp @@ -240,7 +240,7 @@ static void parseBitString( const char *inBuffer, UnsignedInt *bits, const char { if ( !parseBitFlag( tok, bits, flagList ) ) { - DEBUG_LOG(( "ParseBitString: Invalid flag '%s'.\n", tok )); + DEBUG_LOG(( "ParseBitString: Invalid flag '%s'.", tok )); } } } @@ -287,7 +287,7 @@ static void readUntilSemicolon( File *fp, char *buffer, int maxBufLen ) } - DEBUG_LOG(( "ReadUntilSemicolon: ERROR - Read buffer overflow - input truncated.\n" )); + DEBUG_LOG(( "ReadUntilSemicolon: ERROR - Read buffer overflow - input truncated." )); buffer[ maxBufLen - 1 ] = '\000'; @@ -390,7 +390,7 @@ static void pushWindow( GameWindow *window ) if( stackPtr == &windowStack[ WIN_STACK_DEPTH - 1 ] ) { - DEBUG_LOG(( "pushWindow: Warning, stack overflow\n" )); + DEBUG_LOG(( "pushWindow: Warning, stack overflow" )); return; } // end if @@ -994,7 +994,7 @@ static Bool parseTooltipText( const char *token, WinInstanceData *instData, if( strlen( c ) >= MAX_TEXT_LABEL ) { - DEBUG_LOG(( "TextTooltip label '%s' is too long, max is '%d'\n", c, MAX_TEXT_LABEL )); + DEBUG_LOG(( "TextTooltip label '%s' is too long, max is '%d'", c, MAX_TEXT_LABEL )); assert( 0 ); return FALSE; @@ -1044,7 +1044,7 @@ static Bool parseText( const char *token, WinInstanceData *instData, if( strlen( c ) >= MAX_TEXT_LABEL ) { - DEBUG_LOG(( "Text label '%s' is too long, max is '%d'\n", c, MAX_TEXT_LABEL )); + DEBUG_LOG(( "Text label '%s' is too long, max is '%d'", c, MAX_TEXT_LABEL )); assert( 0 ); return FALSE; @@ -1083,7 +1083,7 @@ static Bool parseTextColor( const char *token, WinInstanceData *instData, else { - DEBUG_LOG(( "Undefined state for text color\n" )); + DEBUG_LOG(( "Undefined state for text color" )); assert( 0 ); return FALSE; @@ -1311,7 +1311,7 @@ static Bool parseDrawData( const char *token, WinInstanceData *instData, else { - DEBUG_LOG(( "ParseDrawData, undefined token '%s'\n", token )); + DEBUG_LOG(( "ParseDrawData, undefined token '%s'", token )); assert( 0 ); return FALSE; @@ -2241,7 +2241,7 @@ static Bool parseChildWindows( GameWindow *window, if( lastWindow != window ) { - DEBUG_LOG(( "parseChildWindows: unmatched window on stack. Corrupt stack or bad source\n" )); + DEBUG_LOG(( "parseChildWindows: unmatched window on stack. Corrupt stack or bad source" )); return FALSE; } @@ -2411,7 +2411,7 @@ static GameWindow *parseWindow( File *inFile, char *buffer ) if (parse->parse( token, &instData, buffer, data ) == FALSE ) { - DEBUG_LOG(( "parseGameObject: Error parsing %s\n", parse->name )); + DEBUG_LOG(( "parseGameObject: Error parsing %s", parse->name )); goto cleanupAndExit; } @@ -2434,7 +2434,7 @@ static GameWindow *parseWindow( File *inFile, char *buffer ) if( parseData( &data, type, buffer ) == FALSE ) { - DEBUG_LOG(( "parseGameWindow: Error parsing %s\n", parse->name )); + DEBUG_LOG(( "parseGameWindow: Error parsing %s", parse->name )); goto cleanupAndExit; } @@ -2733,7 +2733,7 @@ GameWindow *GameWindowManager::winCreateFromScript( AsciiString filenameString, inFile = TheFileSystem->openFile(filepath, File::READ); if (inFile == NULL) { - DEBUG_LOG(( "WinCreateFromScript: Cannot access file '%s'.\n", filename )); + DEBUG_LOG(( "WinCreateFromScript: Cannot access file '%s'.", filename )); return NULL; } @@ -2753,7 +2753,7 @@ GameWindow *GameWindowManager::winCreateFromScript( AsciiString filenameString, if( parseLayoutBlock( inFile, buffer, version, &scriptInfo ) == FALSE ) { - DEBUG_LOG(( "WinCreateFromScript: Error parsing layout block\n" )); + DEBUG_LOG(( "WinCreateFromScript: Error parsing layout block" )); return FALSE; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp index 36e9e86c51..377ba8ed88 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp @@ -1493,7 +1493,7 @@ void CountUpTransition::init( GameWindow *win ) AsciiString tempStr; tempStr.translate(m_fullText); m_intValue = atoi(tempStr.str()); - DEBUG_LOG(("CountUpTransition::init %hs %s %d\n", m_fullText.str(), tempStr.str(), m_intValue)); + DEBUG_LOG(("CountUpTransition::init %hs %s %d", m_fullText.str(), tempStr.str(), m_intValue)); if(m_intValue < COUNTUPTRANSITION_END) { m_countState = COUNT_ONES; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp index d5df520a2a..9a8bff5db9 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/HeaderTemplate.cpp @@ -186,7 +186,7 @@ GameFont *HeaderTemplateManager::getFontFromTemplate( AsciiString name ) HeaderTemplate *ht = findHeaderTemplate( name ); if(!ht) { - //DEBUG_LOG(("HeaderTemplateManager::getFontFromTemplate - Could not find header %s\n", name.str())); + //DEBUG_LOG(("HeaderTemplateManager::getFontFromTemplate - Could not find header %s", name.str())); return NULL; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp index 23d95ea320..dbc65b9b3d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp @@ -396,7 +396,7 @@ void IMEManager::printMessageInfo( Int message, Int wParam, Int lParam ) { Char *notifyName = getMessageName( m_notifyInfo, wParam ); if ( notifyName == NULL ) notifyName = "unknown"; - DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x\n", messageText, message, notifyName, wParam, lParam )); + DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x", messageText, message, notifyName, wParam, lParam )); break; } case WM_IME_CONTROL: @@ -404,7 +404,7 @@ void IMEManager::printMessageInfo( Int message, Int wParam, Int lParam ) Char *controlName = getMessageName( m_controlInfo, wParam ); if ( controlName == NULL ) controlName = "unknown"; - DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x\n", messageText, message, controlName, wParam, lParam )); + DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x", messageText, message, controlName, wParam, lParam )); break; } #ifdef WM_IME_REQUEST @@ -413,7 +413,7 @@ void IMEManager::printMessageInfo( Int message, Int wParam, Int lParam ) Char *requestName = getMessageName( m_requestInfo, wParam ); if ( requestName == NULL ) requestName = "unknown"; - DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x\n", messageText, message, requestName, wParam, lParam )); + DEBUG_LOG(( "IMM: %s(0x%04x) - %s(0x%04x) - 0x%08x", messageText, message, requestName, wParam, lParam )); break; } #endif @@ -423,13 +423,13 @@ void IMEManager::printMessageInfo( Int message, Int wParam, Int lParam ) buildFlagsString( m_setContextInfo, lParam, flags ); - DEBUG_LOG(( "IMM: %s(0x%04x) - 0x%08x - %s(0x%04x)\n", messageText, message, wParam, flags.str(), lParam )); + DEBUG_LOG(( "IMM: %s(0x%04x) - 0x%08x - %s(0x%04x)", messageText, message, wParam, flags.str(), lParam )); break; } default: if ( messageText ) { - DEBUG_LOG(( "IMM: %s(0x%04x) - 0x%08x - 0x%08x\n", messageText, message, wParam, lParam )); + DEBUG_LOG(( "IMM: %s(0x%04x) - 0x%08x - 0x%08x", messageText, message, wParam, lParam )); } break; } @@ -450,7 +450,7 @@ void IMEManager::printConversionStatus( void ) buildFlagsString( m_setCmodeInfo, mode, flags ); - DEBUG_LOG(( "IMM: Conversion mode = (%s)\n", flags.str())); + DEBUG_LOG(( "IMM: Conversion mode = (%s)", flags.str())); } } @@ -469,7 +469,7 @@ void IMEManager::printSentenceStatus( void ) buildFlagsString( m_setSmodeInfo, mode, flags ); - DEBUG_LOG(( "IMM: Sentence mode = (%s)\n", flags.str())); + DEBUG_LOG(( "IMM: Sentence mode = (%s)", flags.str())); } } #endif // DEBUG_IME @@ -681,7 +681,7 @@ Bool IMEManager::serviceIMEMessage( void *windowsHandle, UnsignedInt message, In { WideChar wchar = convertCharToWide(wParam); #ifdef DEBUG_IME - DEBUG_LOG(("IMM: WM_IME_CHAR - '%hc'0x%04x\n", wchar, wchar )); + DEBUG_LOG(("IMM: WM_IME_CHAR - '%hc'0x%04x", wchar, wchar )); #endif if ( m_window && (wchar > 32 || wchar == VK_RETURN )) @@ -699,7 +699,7 @@ Bool IMEManager::serviceIMEMessage( void *windowsHandle, UnsignedInt message, In WideChar wchar = (WideChar) (wParam & 0xffff); #ifdef DEBUG_IME - DEBUG_LOG(("IMM: WM_CHAR - '%hc'0x%04x\n", wchar, wchar )); + DEBUG_LOG(("IMM: WM_CHAR - '%hc'0x%04x", wchar, wchar )); #endif if ( m_window && (wchar >= 32 || wchar == VK_RETURN) ) @@ -713,7 +713,7 @@ Bool IMEManager::serviceIMEMessage( void *windowsHandle, UnsignedInt message, In // -------------------------------------------------------------------- case WM_IME_SELECT: - DEBUG_LOG(("IMM: WM_IME_SELECT\n")); + DEBUG_LOG(("IMM: WM_IME_SELECT")); return FALSE; case WM_IME_STARTCOMPOSITION: //The WM_IME_STARTCOMPOSITION message is sent immediately before an @@ -1421,7 +1421,7 @@ void IMEManager::updateCandidateList( Int candidateFlags ) m_selectedIndex = clist->dwSelection; #ifdef DEBUG_IME - DEBUG_LOG(("IME: Candidate Update: Candidates = %d, pageSize = %d pageStart = %d, selected = %d\n", m_candidateCount, m_pageStart, m_pageSize, m_selectedIndex )); + DEBUG_LOG(("IME: Candidate Update: Candidates = %d, pageSize = %d pageStart = %d, selected = %d", m_candidateCount, m_pageStart, m_pageSize, m_selectedIndex )); #endif if ( m_candidateUpArrow ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 270b84081c..ff645814c7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -1322,7 +1322,7 @@ void MultiPlayerLoadScreen::init( GameInfo *game ) // if(loadScreenImage) // m_loadScreen->winSetEnabledImage(0, loadScreenImage); //DEBUG_ASSERTCRASH(TheNetwork, ("Where the Heck is the Network!!!!")); - //DEBUG_LOG(("NumPlayers %d\n", TheNetwork->getNumPlayers())); + //DEBUG_LOG(("NumPlayers %d", TheNetwork->getNumPlayers())); GameWindow *teamWin[MAX_SLOTS]; Int i = 0; @@ -1473,7 +1473,7 @@ void MultiPlayerLoadScreen::processProgress(Int playerId, Int percentage) DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d\n", percentage, playerId)); return; } - //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)\n", percentage, playerId, m_playerLookup[playerId])); + //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)", percentage, playerId, m_playerLookup[playerId])); if(m_progressBars[m_playerLookup[playerId]]) GadgetProgressBarSetProgress(m_progressBars[m_playerLookup[playerId]], percentage ); } @@ -1540,7 +1540,7 @@ void GameSpyLoadScreen::init( GameInfo *game ) m_loadScreen->winBringToTop(); m_mapPreview = TheWindowManager->winGetWindowFromId( m_loadScreen,TheNameKeyGenerator->nameToKey( "GameSpyLoadScreen.wnd:WinMapPreview")); DEBUG_ASSERTCRASH(TheNetwork, ("Where the Heck is the Network!!!!")); - DEBUG_LOG(("NumPlayers %d\n", TheNetwork->getNumPlayers())); + DEBUG_LOG(("NumPlayers %d", TheNetwork->getNumPlayers())); GameSlot *lSlot = game->getSlot(game->getLocalSlotNum()); const PlayerTemplate* pt; if (lSlot->getPlayerTemplate() >= 0) @@ -1672,7 +1672,7 @@ GameSlot *lSlot = game->getSlot(game->getLocalSlotNum()); // Get the stats for the player PSPlayerStats stats = TheGameSpyPSMessageQueue->findPlayerStatsByID(slot->getProfileID()); - DEBUG_LOG(("LoadScreen - populating info for %ls(%d) - stats returned id %d\n", + DEBUG_LOG(("LoadScreen - populating info for %ls(%d) - stats returned id %d", slot->getName().str(), slot->getProfileID(), stats.id)); Bool isPreorder = TheGameSpyInfo->didPlayerPreorder(stats.id); @@ -1841,7 +1841,7 @@ void GameSpyLoadScreen::processProgress(Int playerId, Int percentage) DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d\n", percentage, playerId)); return; } - //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)\n", percentage, playerId, m_playerLookup[playerId])); + //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)", percentage, playerId, m_playerLookup[playerId])); if(m_progressBars[m_playerLookup[playerId]]) GadgetProgressBarSetProgress(m_progressBars[m_playerLookup[playerId]], percentage ); } @@ -1892,7 +1892,7 @@ void MapTransferLoadScreen::init( GameInfo *game ) m_loadScreen->winBringToTop(); DEBUG_ASSERTCRASH(TheNetwork, ("Where the Heck is the Network?!!!!")); - DEBUG_LOG(("NumPlayers %d\n", TheNetwork->getNumPlayers())); + DEBUG_LOG(("NumPlayers %d", TheNetwork->getNumPlayers())); AsciiString winName; Int i; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp index fd79473f45..b418c24481 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp @@ -840,7 +840,7 @@ void ProcessAnimateWindowSlideFromBottomTimed::initReverseAnimateWindow( wnd::An UnsignedInt now = timeGetTime(); - DEBUG_LOG(("initReverseAnimateWindow at %d (%d->%d)\n", now, now, now + m_maxDuration)); + DEBUG_LOG(("initReverseAnimateWindow at %d (%d->%d)", now, now, now + m_maxDuration)); animWin->setAnimData(startPos, endPos, curPos, restPos, vel, now, now + m_maxDuration); } @@ -882,7 +882,7 @@ void ProcessAnimateWindowSlideFromBottomTimed::initAnimateWindow( wnd::AnimateWi UnsignedInt now = timeGetTime(); UnsignedInt delay = animWin->getDelay(); - DEBUG_LOG(("initAnimateWindow at %d (%d->%d)\n", now, now + delay, now + m_maxDuration + delay)); + DEBUG_LOG(("initAnimateWindow at %d (%d->%d)", now, now + delay, now + m_maxDuration + delay)); animWin->setAnimData(startPos, endPos, curPos, restPos, vel, now + delay, now + m_maxDuration + delay); } @@ -929,12 +929,12 @@ Bool ProcessAnimateWindowSlideFromBottomTimed::updateAnimateWindow( wnd::Animate curPos.y = endPos.y; animWin->setFinished( TRUE ); win->winSetPosition(curPos.x, curPos.y); - DEBUG_LOG(("window finished animating at %d (%d->%d)\n", now, startTime, endTime)); + DEBUG_LOG(("window finished animating at %d (%d->%d)", now, startTime, endTime)); return TRUE; } curPos.y = startPos.y + percentDone*(endPos.y - startPos.y); - DEBUG_LOG(("(%d,%d) -> (%d,%d) -> (%d,%d) at %g\n", + DEBUG_LOG(("(%d,%d) -> (%d,%d) -> (%d,%d) at %g", startPos.x, startPos.y, curPos.x, curPos.y, endPos.x, endPos.y, percentDone)); win->winSetPosition(curPos.x, curPos.y); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp index 3046bab3fe..0b8c5dfed6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp @@ -333,10 +333,10 @@ void Shell::push( AsciiString filename, Bool shutdownImmediate ) #ifdef DEBUG_LOGGING - DEBUG_LOG(("Shell:push(%s) - stack was\n", filename.str())); + DEBUG_LOG(("Shell:push(%s) - stack was", filename.str())); for (Int i=0; igetFilename().str())); + DEBUG_LOG(("\t\t%s", m_screenStack[i]->getFilename().str())); } #endif @@ -344,7 +344,7 @@ void Shell::push( AsciiString filename, Bool shutdownImmediate ) if( m_screenCount >= MAX_SHELL_STACK ) { - DEBUG_LOG(( "Unable to load screen '%s', max '%d' reached\n", + DEBUG_LOG(( "Unable to load screen '%s', max '%d' reached", filename.str(), MAX_SHELL_STACK )); return; @@ -400,10 +400,10 @@ void Shell::pop( void ) return; #ifdef DEBUG_LOGGING - DEBUG_LOG(("Shell:pop() - stack was\n")); + DEBUG_LOG(("Shell:pop() - stack was")); for (Int i=0; igetFilename().str())); + DEBUG_LOG(("\t\t%s", m_screenStack[i]->getFilename().str())); } #endif @@ -439,10 +439,10 @@ void Shell::popImmediate( void ) return; #ifdef DEBUG_LOGGING - DEBUG_LOG(("Shell:popImmediate() - stack was\n")); + DEBUG_LOG(("Shell:popImmediate() - stack was")); for (Int i=0; igetFilename().str())); + DEBUG_LOG(("\t\t%s", m_screenStack[i]->getFilename().str())); } #endif @@ -469,7 +469,7 @@ void Shell::popImmediate( void ) //------------------------------------------------------------------------------------------------- void Shell::showShell( Bool runInit ) { - DEBUG_LOG(("Shell:showShell() - %s (%s)\n", TheGlobalData->m_initialFile.str(), (top())?top()->getFilename().str():"no top screen")); + DEBUG_LOG(("Shell:showShell() - %s (%s)", TheGlobalData->m_initialFile.str(), (top())?top()->getFilename().str():"no top screen")); if(!TheGlobalData->m_initialFile.isEmpty() || !TheGlobalData->m_simulateReplays.empty()) { @@ -583,7 +583,7 @@ void Shell::hideShell( void ) // If we have the 3d background running, mark it to close m_clearBackground = TRUE; - DEBUG_LOG(("Shell:hideShell() - %s\n", (top())?top()->getFilename().str():"no top screen")); + DEBUG_LOG(("Shell:hideShell() - %s", (top())?top()->getFilename().str():"no top screen")); WindowLayout *layout = top(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp index 75e07bb123..7d9691a4bc 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/WindowLayout.cpp @@ -208,7 +208,7 @@ Bool WindowLayout::load( AsciiString filename ) { DEBUG_ASSERTCRASH( target, ("WindowLayout::load - Failed to load layout") ); - DEBUG_LOG(( "WindowLayout::load - Unable to load layout file '%s'\n", filename.str() )); + DEBUG_LOG(( "WindowLayout::load - Unable to load layout file '%s'", filename.str() )); return FALSE; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp index b8a444231d..ed0dd40366 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -133,17 +133,17 @@ GameClient::~GameClient() // clear any drawable TOC we might have m_drawableTOC.clear(); - //DEBUG_LOG(("Preloaded texture files ------------------------------------------\n")); + //DEBUG_LOG(("Preloaded texture files ------------------------------------------")); //for (Int oog=0; oog %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d", before.dwAvailPageFile, after.dwAvailPageFile, before.dwAvailPageFile - after.dwAvailPageFile)); - DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d", before.dwAvailPhys, after.dwAvailPhys, before.dwAvailPhys - after.dwAvailPhys)); - DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d", before.dwAvailVirtual, after.dwAvailVirtual, before.dwAvailVirtual - after.dwAvailVirtual)); /* - DEBUG_LOG(("Preloading memory dwLength %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwLength %d --> %d : %d", before.dwLength, after.dwLength, before.dwLength - after.dwLength)); - DEBUG_LOG(("Preloading memory dwMemoryLoad %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwMemoryLoad %d --> %d : %d", before.dwMemoryLoad, after.dwMemoryLoad, before.dwMemoryLoad - after.dwMemoryLoad)); - DEBUG_LOG(("Preloading memory dwTotalPageFile %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwTotalPageFile %d --> %d : %d", before.dwTotalPageFile, after.dwTotalPageFile, before.dwTotalPageFile - after.dwTotalPageFile)); - DEBUG_LOG(("Preloading memory dwTotalPhys %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwTotalPhys %d --> %d : %d", before.dwTotalPhys , after.dwTotalPhys, before.dwTotalPhys - after.dwTotalPhys)); - DEBUG_LOG(("Preloading memory dwTotalVirtual %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwTotalVirtual %d --> %d : %d", before.dwTotalVirtual , after.dwTotalVirtual, before.dwTotalVirtual - after.dwTotalVirtual)); */ @@ -1138,11 +1138,11 @@ void GameClient::preloadAssets( TimeOfDay timeOfDay ) GlobalMemoryStatus(&after); debrisModelNamesGlobalHack.clear(); - DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d", before.dwAvailPageFile, after.dwAvailPageFile, before.dwAvailPageFile - after.dwAvailPageFile)); - DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d", before.dwAvailPhys, after.dwAvailPhys, before.dwAvailPhys - after.dwAvailPhys)); - DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d", before.dwAvailVirtual, after.dwAvailVirtual, before.dwAvailVirtual - after.dwAvailVirtual)); TheControlBar->preloadAssets( timeOfDay ); @@ -1151,11 +1151,11 @@ void GameClient::preloadAssets( TimeOfDay timeOfDay ) TheParticleSystemManager->preloadAssets( timeOfDay ); GlobalMemoryStatus(&after); - DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d", before.dwAvailPageFile, after.dwAvailPageFile, before.dwAvailPageFile - after.dwAvailPageFile)); - DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d", before.dwAvailPhys, after.dwAvailPhys, before.dwAvailPhys - after.dwAvailPhys)); - DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d", before.dwAvailVirtual, after.dwAvailVirtual, before.dwAvailVirtual - after.dwAvailVirtual)); const char *textureNames[] = { @@ -1205,11 +1205,11 @@ void GameClient::preloadAssets( TimeOfDay timeOfDay ) TheDisplay->preloadTextureAssets(textureNames[i]); GlobalMemoryStatus(&after); - DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPageFile %d --> %d : %d", before.dwAvailPageFile, after.dwAvailPageFile, before.dwAvailPageFile - after.dwAvailPageFile)); - DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailPhys %d --> %d : %d", before.dwAvailPhys, after.dwAvailPhys, before.dwAvailPhys - after.dwAvailPhys)); - DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d\n", + DEBUG_LOG(("Preloading memory dwAvailVirtual %d --> %d : %d", before.dwAvailVirtual, after.dwAvailVirtual, before.dwAvailVirtual - after.dwAvailVirtual)); // preloadTextureNamesGlobalHack2 = preloadTextureNamesGlobalHack; @@ -1571,11 +1571,11 @@ void GameClient::xfer( Xfer *xfer ) BriefingList *bList = GetBriefingTextList(); Int numEntries = bList->size(); xfer->xferInt(&numEntries); - DEBUG_LOG(("Saving %d briefing lines\n", numEntries)); + DEBUG_LOG(("Saving %d briefing lines", numEntries)); for (BriefingList::const_iterator bIt = bList->begin(); bIt != bList->end(); ++bIt) { AsciiString tempStr = *bIt; - DEBUG_LOG(("'%s'\n", tempStr.str())); + DEBUG_LOG(("'%s'", tempStr.str())); xfer->xferAsciiString(&tempStr); } } @@ -1583,13 +1583,13 @@ void GameClient::xfer( Xfer *xfer ) { Int numEntries = 0; xfer->xferInt(&numEntries); - DEBUG_LOG(("Loading %d briefing lines\n", numEntries)); + DEBUG_LOG(("Loading %d briefing lines", numEntries)); UpdateDiplomacyBriefingText(AsciiString::TheEmptyString, TRUE); // clear out briefing list first while (numEntries-- > 0) { AsciiString tempStr; xfer->xferAsciiString(&tempStr); - DEBUG_LOG(("'%s'\n", tempStr.str())); + DEBUG_LOG(("'%s'", tempStr.str())); UpdateDiplomacyBriefingText(tempStr, FALSE); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp index e2e1c78244..14a776cc2e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp @@ -49,7 +49,7 @@ GameMessageDisposition GameClientMessageDispatcher::translateGameMessage(const G if (msg->getType() == GameMessage::MSG_FRAME_TICK) return KEEP_MESSAGE; - //DEBUG_LOG(("GameClientMessageDispatcher::translateGameMessage() - eating a %s on frame %d\n", + //DEBUG_LOG(("GameClientMessageDispatcher::translateGameMessage() - eating a %s on frame %d", //((GameMessage *)msg)->getCommandAsAsciiString().str(), TheGameClient->getFrame())); return DESTROY_MESSAGE; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp index a8dfa2f324..32e3839ecd 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp @@ -411,15 +411,15 @@ void GameTextManager::deinit( void ) NoString *noString = m_noStringList; - DEBUG_LOG(("\n*** Missing strings ***\n")); + DEBUG_LOG(("\n*** Missing strings ***")); while ( noString ) { - DEBUG_LOG(("*** %ls ***\n", noString->text.str())); + DEBUG_LOG(("*** %ls ***", noString->text.str())); NoString *next = noString->next; delete noString; noString = next; } - DEBUG_LOG(("*** End missing strings ***\n\n")); + DEBUG_LOG(("*** End missing strings ***\n")); m_noStringList = NULL; @@ -834,7 +834,7 @@ Bool GameTextManager::getStringCount( const char *filename, Int& textCount ) File *file; file = TheFileSystem->openFile(filename, File::READ | File::TEXT); - DEBUG_LOG(("Looking in %s for string file\n", filename)); + DEBUG_LOG(("Looking in %s for string file", filename)); if ( file == NULL ) { @@ -875,7 +875,7 @@ Bool GameTextManager::getCSFInfo ( const Char *filename ) CSFHeader header; Int ok = FALSE; File *file = TheFileSystem->openFile(filename, File::READ | File::BINARY); - DEBUG_LOG(("Looking in %s for compiled string file\n", filename)); + DEBUG_LOG(("Looking in %s for compiled string file", filename)); if ( file != NULL ) { @@ -1318,7 +1318,7 @@ UnicodeString GameTextManager::fetch( const Char *label, Bool *exists ) noString = noString->next; } - //DEBUG_LOG(("*** MISSING:'%s' ***\n", label)); + //DEBUG_LOG(("*** MISSING:'%s' ***", label)); // Remember file could have been altered at this point. noString = NEW NoString; noString->text = missingString; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index 19662d0d8c..219fa642d1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -578,7 +578,7 @@ void InGameUI::addSuperweapon(Int playerIndex, const AsciiString& powerName, Obj Bool hiddenByScience = (powerTemplate->getRequiredScience() != SCIENCE_INVALID) && (player->hasScience(powerTemplate->getRequiredScience()) == false); #ifndef DO_UNIT_TIMINGS - DEBUG_LOG(("Adding superweapon UI timer\n")); + DEBUG_LOG(("Adding superweapon UI timer")); #endif SuperweaponInfo *info = newInstance(SuperweaponInfo)( id, @@ -602,7 +602,7 @@ void InGameUI::addSuperweapon(Int playerIndex, const AsciiString& powerName, Obj // ------------------------------------------------------------------------------------------------ Bool InGameUI::removeSuperweapon(Int playerIndex, const AsciiString& powerName, ObjectID id, const SpecialPowerTemplate *powerTemplate) { - DEBUG_LOG(("Removing superweapon UI timer\n")); + DEBUG_LOG(("Removing superweapon UI timer")); SuperweaponMap::iterator mapIt = m_superweapons[playerIndex].find(powerName); if (mapIt != m_superweapons[playerIndex].end()) { @@ -2489,7 +2489,7 @@ void InGameUI::createMouseoverHint( const GameMessage *msg ) if (oldID != m_mousedOverDrawableID) { - //DEBUG_LOG(("Resetting tooltip delay\n")); + //DEBUG_LOG(("Resetting tooltip delay")); TheMouse->resetTooltipDelay(); } @@ -5054,7 +5054,7 @@ void InGameUI::DEBUG_addFloatingText(const AsciiString& text, const Coord3D * po m_floatingTextList.push_front( newFTD ); // add to the list - //DEBUG_LOG(("%s\n",text.str())); + //DEBUG_LOG(("%s",text.str())); } #endif diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp index 58531975a9..ee3c148ccc 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp @@ -320,7 +320,7 @@ void Mouse::processMouseEvent( Int index ) m_currMouse.deltaPos.x = m_currMouse.pos.x - m_prevMouse.pos.x; m_currMouse.deltaPos.y = m_currMouse.pos.y - m_prevMouse.pos.y; -// DEBUG_LOG(("Mouse dx %d, dy %d, index %d, frame %d\n", m_currMouse.deltaPos.x, m_currMouse.deltaPos.y, index, m_inputFrame)); +// DEBUG_LOG(("Mouse dx %d, dy %d, index %d, frame %d", m_currMouse.deltaPos.x, m_currMouse.deltaPos.y, index, m_inputFrame)); // // check if mouse is still and flag tooltip // if( ((dx*dx) + (dy*dy)) < CURSOR_MOVE_TOL_SQ ) // { @@ -695,7 +695,7 @@ void Mouse::createStreamMessages( void ) } else { - //DEBUG_LOG(("%d %d %d %d\n", TheGameClient->getFrame(), delay, now, m_stillTime)); + //DEBUG_LOG(("%d %d %d %d", TheGameClient->getFrame(), delay, now, m_stillTime)); m_displayTooltip = FALSE; } @@ -829,7 +829,7 @@ void Mouse::createStreamMessages( void ) void Mouse::setCursorTooltip( UnicodeString tooltip, Int delay, const RGBColor *color, Real width ) { - //DEBUG_LOG(("%d Tooltip: %ls\n", TheGameClient->getFrame(), tooltip.str())); + //DEBUG_LOG(("%d Tooltip: %ls", TheGameClient->getFrame(), tooltip.str())); m_isTooltipEmpty = tooltip.isEmpty(); m_tooltipDelay = delay; @@ -847,7 +847,7 @@ void Mouse::setCursorTooltip( UnicodeString tooltip, Int delay, const RGBColor * { widthInPixels = TheDisplay->getWidth(); } - //DEBUG_LOG(("Setting tooltip width to %d pixels (%g%% of the normal tooltip width)\n", widthInPixels, width*100)); + //DEBUG_LOG(("Setting tooltip width to %d pixels (%g%% of the normal tooltip width)", widthInPixels, width*100)); m_tooltipDisplayString->setWordWrap( widthInPixels ); m_lastTooltipWidth = width; } @@ -855,7 +855,7 @@ void Mouse::setCursorTooltip( UnicodeString tooltip, Int delay, const RGBColor * if (forceRecalc || !m_isTooltipEmpty && tooltip.compare(m_tooltipDisplayString->getText())) { m_tooltipDisplayString->setText(tooltip); - //DEBUG_LOG(("Tooltip: %ls\n", tooltip.str())); + //DEBUG_LOG(("Tooltip: %ls", tooltip.str())); } if (color) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/LanguageFilter.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/LanguageFilter.cpp index 23a49e6330..3157617b25 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/LanguageFilter.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/LanguageFilter.cpp @@ -64,7 +64,7 @@ void LanguageFilter::init() { } UnicodeString uniword(word); unHaxor(uniword); - //DEBUG_LOG(("Just read %ls from the bad word file. Entered as %ls\n", word, uniword.str())); + //DEBUG_LOG(("Just read %ls from the bad word file. Entered as %ls", word, uniword.str())); m_wordList[uniword] = true; } @@ -101,7 +101,7 @@ void LanguageFilter::filterLine(UnicodeString &line) unHaxor(token); LangMapIter iter = m_wordList.find(token); if (iter != m_wordList.end()) { - DEBUG_LOG(("Found word %ls in bad word list. Token was %ls\n", (*iter).first.str(), token.str())); + DEBUG_LOG(("Found word %ls in bad word list. Token was %ls", (*iter).first.str(), token.str())); for (Int i = 0; i < len; ++i) { *pos = L'*'; ++pos; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp index 386aab3cc4..d1864381d1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp @@ -148,7 +148,7 @@ static Bool ParseObjectDataChunk(DataChunkInput &file, DataChunkInfo *info, void pThisOne = newInstance( MapObject )( loc, name, angle, flags, &d, TheThingFactory->findTemplate( name, FALSE ) ); -//DEBUG_LOG(("obj %s owner %s\n",name.str(),d.getAsciiString(TheKey_originalOwner).str())); +//DEBUG_LOG(("obj %s owner %s",name.str(),d.getAsciiString(TheKey_originalOwner).str())); if (pThisOne->getProperties()->getType(TheKey_waypointID) == Dict::DICT_INT) { @@ -443,7 +443,7 @@ void MapCache::writeCacheINI( Bool userDir ) } else { - //DEBUG_LOG(("%s does not start %s\n", mapDir.str(), it->first.str())); + //DEBUG_LOG(("%s does not start %s", mapDir.str(), it->first.str())); } ++it; } @@ -585,12 +585,12 @@ Bool MapCache::loadUserMaps() std::set::const_iterator sit = m_allowedMaps.find(fname); if (m_allowedMaps.size() != 0 && sit == m_allowedMaps.end()) { - //DEBUG_LOG(("Skipping map: '%s'\n", fname.str())); + //DEBUG_LOG(("Skipping map: '%s'", fname.str())); skipMap = TRUE; } else { - //DEBUG_LOG(("Parsing map: '%s'\n", fname.str())); + //DEBUG_LOG(("Parsing map: '%s'", fname.str())); } } @@ -680,19 +680,19 @@ Bool MapCache::addMap( AsciiString dirName, AsciiString fname, FileInfo *fileInf (*this)[lowerFname].m_displayName.concat(extension); } } -// DEBUG_LOG(("MapCache::addMap - found match for map %s\n", lowerFname.str())); +// DEBUG_LOG(("MapCache::addMap - found match for map %s", lowerFname.str())); return FALSE; // OK, it checks out. } - DEBUG_LOG(("%s didn't match file in MapCache\n", fname.str())); - DEBUG_LOG(("size: %d / %d\n", filesize, md.m_filesize)); - DEBUG_LOG(("time1: %d / %d\n", fileInfo->timestampHigh, md.m_timestamp.m_highTimeStamp)); - DEBUG_LOG(("time2: %d / %d\n", fileInfo->timestampLow, md.m_timestamp.m_lowTimeStamp)); -// DEBUG_LOG(("size: %d / %d\n", filesize, md.m_filesize)); -// DEBUG_LOG(("time1: %d / %d\n", timestamp.m_highTimeStamp, md.m_timestamp.m_highTimeStamp)); -// DEBUG_LOG(("time2: %d / %d\n", timestamp.m_lowTimeStamp, md.m_timestamp.m_lowTimeStamp)); + DEBUG_LOG(("%s didn't match file in MapCache", fname.str())); + DEBUG_LOG(("size: %d / %d", filesize, md.m_filesize)); + DEBUG_LOG(("time1: %d / %d", fileInfo->timestampHigh, md.m_timestamp.m_highTimeStamp)); + DEBUG_LOG(("time2: %d / %d", fileInfo->timestampLow, md.m_timestamp.m_lowTimeStamp)); +// DEBUG_LOG(("size: %d / %d", filesize, md.m_filesize)); +// DEBUG_LOG(("time1: %d / %d", timestamp.m_highTimeStamp, md.m_timestamp.m_highTimeStamp)); +// DEBUG_LOG(("time2: %d / %d", timestamp.m_lowTimeStamp, md.m_timestamp.m_lowTimeStamp)); } - DEBUG_LOG(("MapCache::addMap(): caching '%s' because '%s' was not found\n", fname.str(), lowerFname.str())); + DEBUG_LOG(("MapCache::addMap(): caching '%s' because '%s' was not found", fname.str(), lowerFname.str())); loadMap(fname); // Just load for querying the data, since we aren't playing this map. @@ -714,7 +714,7 @@ Bool MapCache::addMap( AsciiString dirName, AsciiString fname, FileInfo *fileInf md.m_nameLookupTag = munkee; if (!exists || munkee.isEmpty()) { - DEBUG_LOG(("Missing TheKey_mapName!\n")); + DEBUG_LOG(("Missing TheKey_mapName!")); AsciiString tempdisplayname; tempdisplayname = fname.reverseFind('\\') + 1; md.m_displayName.translate(tempdisplayname); @@ -741,7 +741,7 @@ Bool MapCache::addMap( AsciiString dirName, AsciiString fname, FileInfo *fileInf extension.format(L" (%d)", md.m_numPlayers); md.m_displayName.concat(extension); } - DEBUG_LOG(("Map name is now '%ls'\n", md.m_displayName.str())); + DEBUG_LOG(("Map name is now '%ls'", md.m_displayName.str())); TheGameText->reset(); } @@ -749,16 +749,16 @@ Bool MapCache::addMap( AsciiString dirName, AsciiString fname, FileInfo *fileInf (*this)[lowerFname] = md; - DEBUG_LOG((" filesize = %d bytes\n", md.m_filesize)); - DEBUG_LOG((" displayName = %ls\n", md.m_displayName.str())); - DEBUG_LOG((" CRC = %X\n", md.m_CRC)); - DEBUG_LOG((" timestamp = %d\n", md.m_timestamp)); - DEBUG_LOG((" isOfficial = %s\n", (md.m_isOfficial)?"yes":"no")); + DEBUG_LOG((" filesize = %d bytes", md.m_filesize)); + DEBUG_LOG((" displayName = %ls", md.m_displayName.str())); + DEBUG_LOG((" CRC = %X", md.m_CRC)); + DEBUG_LOG((" timestamp = %d", md.m_timestamp)); + DEBUG_LOG((" isOfficial = %s", (md.m_isOfficial)?"yes":"no")); - DEBUG_LOG((" isMultiplayer = %s\n", (md.m_isMultiplayer)?"yes":"no")); - DEBUG_LOG((" numPlayers = %d\n", md.m_numPlayers)); + DEBUG_LOG((" isMultiplayer = %s", (md.m_isMultiplayer)?"yes":"no")); + DEBUG_LOG((" numPlayers = %d", md.m_numPlayers)); - DEBUG_LOG((" extent = (%2.2f,%2.2f) -> (%2.2f,%2.2f)\n", + DEBUG_LOG((" extent = (%2.2f,%2.2f) -> (%2.2f,%2.2f)", md.m_extent.lo.x, md.m_extent.lo.y, md.m_extent.hi.x, md.m_extent.hi.y)); @@ -767,7 +767,7 @@ Bool MapCache::addMap( AsciiString dirName, AsciiString fname, FileInfo *fileInf while (itw != md.m_waypoints.end()) { pos = itw->second; - DEBUG_LOG((" waypoint %s: (%2.2f,%2.2f)\n", itw->first.str(), pos.x, pos.y)); + DEBUG_LOG((" waypoint %s: (%2.2f,%2.2f)", itw->first.str(), pos.x, pos.y)); ++itw; } @@ -850,7 +850,7 @@ typedef MapDisplayToFileNameList::iterator MapDisplayToFileNameListIter; while (numMapsListed < TheMapCache->size()) { - DEBUG_LOG(("Adding maps with %d players\n", curNumPlayersInMap)); + DEBUG_LOG(("Adding maps with %d players", curNumPlayersInMap)); it = TheMapCache->begin(); while (it != TheMapCache->end()) { const MapMetaData *md = &(it->second); @@ -858,7 +858,7 @@ typedef MapDisplayToFileNameList::iterator MapDisplayToFileNameListIter; if (md->m_numPlayers == curNumPlayersInMap) { tempCache.insert(it->second.m_displayName); filenameMap[it->second.m_displayName] = it->first; - DEBUG_LOG(("Adding map %s to temp cache.\n", it->first.str())); + DEBUG_LOG(("Adding map %s to temp cache.", it->first.str())); ++numMapsListed; } } @@ -876,7 +876,7 @@ typedef MapDisplayToFileNameList::iterator MapDisplayToFileNameListIter; /* if (it != TheMapCache->end()) { - DEBUG_LOG(("populateMapListbox(): looking at %s (displayName = %ls), mp = %d (== %d?) mapDir=%s (ok=%d)\n", + DEBUG_LOG(("populateMapListbox(): looking at %s (displayName = %ls), mp = %d (== %d?) mapDir=%s (ok=%d)", it->first.str(), it->second.m_displayName.str(), it->second.m_isMultiplayer, isMultiplayer, mapDir.str(), it->first.startsWith(mapDir.str()))); } @@ -1141,7 +1141,7 @@ Image *getMapPreviewImage( AsciiString mapName ) { if(!TheGlobalData) return NULL; - DEBUG_LOG(("%s Map Name \n", mapName.str())); + DEBUG_LOG(("%s Map Name ", mapName.str())); AsciiString tgaName = mapName; AsciiString name; AsciiString tempName; @@ -1294,7 +1294,7 @@ Bool parseMapPreviewChunk(DataChunkInput &file, DataChunkInfo *info, void *userD surface = (TextureClass *)mapPreviewImage->getRawTextureData()->Get_Surface_Level(); //texture->Get_Surface_Level(); - DEBUG_LOG(("BeginMapPreviewInfo\n")); + DEBUG_LOG(("BeginMapPreviewInfo")); UnsignedInt *buffer = new UnsignedInt[size.x * size.y]; Int x,y; for (y=0; yDrawPixel( x, y, file.readInt() ); buffer[y + x] = file.readInt(); - DEBUG_LOG(("x:%d, y:%d, %X\n", x, y, buffer[y + x])); + DEBUG_LOG(("x:%d, y:%d, %X", x, y, buffer[y + x])); } } mapPreviewImage->setRawTextureData(buffer); DEBUG_ASSERTCRASH(file.atEndOfChunk(), ("Unexpected data left over.")); - DEBUG_LOG(("EndMapPreviewInfo\n")); + DEBUG_LOG(("EndMapPreviewInfo")); REF_PTR_RELEASE(surface); return true; */ diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index 057d9387ac..099292f6a4 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -101,7 +101,7 @@ void countObjects(Object *obj, void *userData) if (!numObjects || !obj) return; - DEBUG_LOG(("Looking at obj %d (%s) - isEffectivelyDead()==%d, isDestroyed==%d, numObjects==%d\n", + DEBUG_LOG(("Looking at obj %d (%s) - isEffectivelyDead()==%d, isDestroyed==%d, numObjects==%d", obj->getID(), obj->getTemplate()->getName().str(), obj->isEffectivelyDead(), obj->isDestroyed(), *numObjects)); if (!obj->isEffectivelyDead() && !obj->isDestroyed() && !obj->isKindOf(KINDOF_INERT)) @@ -677,7 +677,7 @@ void pickAndPlayUnitVoiceResponse( const DrawableList *list, GameMessage::Type m break; default: - DEBUG_LOG(("Requested to add voice of message type %d, but don't know how - jkmcd\n", msgType)); + DEBUG_LOG(("Requested to add voice of message type %d, but don't know how - jkmcd", msgType)); break; } if( skip ) @@ -972,7 +972,7 @@ GameMessage::Type CommandTranslator::issueAttackCommand( Drawable *target, if( m_teamExists ) { - //DEBUG_LOG(("issuing team-attack cmd against %s\n",enemy->getTemplate()->getName().str())); + //DEBUG_LOG(("issuing team-attack cmd against %s",enemy->getTemplate()->getName().str())); // insert team attack command message into stream switch( command ) @@ -1006,7 +1006,7 @@ GameMessage::Type CommandTranslator::issueAttackCommand( Drawable *target, } else { - DEBUG_LOG(("issuing NON-team-attack cmd against %s\n",target->getTemplate()->getName().str())); + DEBUG_LOG(("issuing NON-team-attack cmd against %s",target->getTemplate()->getName().str())); // send single attack command for selected drawable const DrawableList *selected = TheInGameUI->getAllSelectedDrawables(); @@ -3093,7 +3093,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage Int count; const ThingTemplate *thing = TheThingFactory->findTemplate( ThePlayerList->getLocalPlayer()->getPlayerTemplate()->getBeaconTemplate() ); ThePlayerList->getLocalPlayer()->countObjectsByThingTemplate( 1, &thing, false, &count ); - DEBUG_LOG(("MSG_META_PLACE_BEACON - Player already has %d beacons active\n", count)); + DEBUG_LOG(("MSG_META_PLACE_BEACON - Player already has %d beacons active", count)); if (count < TheMultiplayerSettings->getMaxBeaconsPerPlayer()) { const CommandButton *commandButton = TheControlBar->findCommandButton( "Command_PlaceBeacon" ); @@ -4368,7 +4368,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage UnicodeString umsg; umsg.translate(msg); TheInGameUI->message(umsg); - DEBUG_LOG(("%ls\n", msg.str())); + DEBUG_LOG(("%ls", msg.str())); pObject->setGeometryInfo( newGeometry ); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp index b6932b0045..c35f90bf44 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp @@ -464,7 +464,7 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa ) ) { - //DEBUG_LOG(("Frame %d: MetaEventTranslator::translateGameMessage() Mods-only change: %s\n", TheGameLogic->getFrame(), findGameMessageNameByType(map->m_meta))); + //DEBUG_LOG(("Frame %d: MetaEventTranslator::translateGameMessage() Mods-only change: %s", TheGameLogic->getFrame(), findGameMessageNameByType(map->m_meta))); /*GameMessage *metaMsg =*/ TheMessageStream->appendMessage(map->m_meta); disp = DESTROY_MESSAGE; break; @@ -486,7 +486,7 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa { // if it's an autorepeat of a "known" key, don't generate the meta-event, // but DO eat the keystroke so no one else can mess with it - //DEBUG_LOG(("Frame %d: MetaEventTranslator::translateGameMessage() auto-repeat: %s\n", TheGameLogic->getFrame(), findGameMessageNameByType(map->m_meta))); + //DEBUG_LOG(("Frame %d: MetaEventTranslator::translateGameMessage() auto-repeat: %s", TheGameLogic->getFrame(), findGameMessageNameByType(map->m_meta))); } else { @@ -512,7 +512,7 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa /*GameMessage *metaMsg =*/ TheMessageStream->appendMessage(map->m_meta); - //DEBUG_LOG(("Frame %d: MetaEventTranslator::translateGameMessage() normal: %s\n", TheGameLogic->getFrame(), findGameMessageNameByType(map->m_meta))); + //DEBUG_LOG(("Frame %d: MetaEventTranslator::translateGameMessage() normal: %s", TheGameLogic->getFrame(), findGameMessageNameByType(map->m_meta))); } disp = DESTROY_MESSAGE; break; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index ea77ff674d..e61b7684f1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -1059,7 +1059,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa Int group = t - GameMessage::MSG_META_CREATE_TEAM0; if ( group >= 0 && group < 10 ) { - DEBUG_LOG(("META: create team %d\n",group)); + DEBUG_LOG(("META: create team %d",group)); // Assign selected items to a group GameMessage *newmsg = TheMessageStream->appendMessage((GameMessage::Type)(GameMessage::MSG_CREATE_TEAM0 + group)); Drawable *drawable = TheGameClient->getDrawableList(); @@ -1091,7 +1091,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa Int group = t - GameMessage::MSG_META_SELECT_TEAM0; if ( group >= 0 && group < 10 ) { - DEBUG_LOG(("META: select team %d\n",group)); + DEBUG_LOG(("META: select team %d",group)); UnsignedInt now = TheGameLogic->getFrame(); if ( m_lastGroupSelTime == 0 ) @@ -1102,7 +1102,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa // check for double-press to jump view if ( now - m_lastGroupSelTime < 20 && group == m_lastGroupSelGroup ) { - DEBUG_LOG(("META: DOUBLETAP select team %d\n",group)); + DEBUG_LOG(("META: DOUBLETAP select team %d",group)); Player *player = ThePlayerList->getLocalPlayer(); if (player) { @@ -1164,7 +1164,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa Int group = t - GameMessage::MSG_META_ADD_TEAM0; if ( group >= 0 && group < 10 ) { - DEBUG_LOG(("META: select team %d\n",group)); + DEBUG_LOG(("META: select team %d",group)); UnsignedInt now = TheGameLogic->getFrame(); if ( m_lastGroupSelTime == 0 ) @@ -1176,7 +1176,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa if ( now - m_lastGroupSelTime < 20 && group == m_lastGroupSelGroup ) { - DEBUG_LOG(("META: DOUBLETAP select team %d\n",group)); + DEBUG_LOG(("META: DOUBLETAP select team %d",group)); Player *player = ThePlayerList->getLocalPlayer(); if (player) { @@ -1245,7 +1245,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa Int group = t - GameMessage::MSG_META_VIEW_TEAM0; if ( group >= 1 && group <= 10 ) { - DEBUG_LOG(("META: view team %d\n",group)); + DEBUG_LOG(("META: view team %d",group)); Player *player = ThePlayerList->getLocalPlayer(); if (player) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp index b34072f8b0..2ba16afed8 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp @@ -456,7 +456,7 @@ AIGroupPtr AI::createGroup( void ) #endif // add it to the list -// DEBUG_LOG(("***AIGROUP %x is being added to m_groupList.\n", group )); +// DEBUG_LOG(("***AIGROUP %x is being added to m_groupList.", group )); #if RETAIL_COMPATIBLE_AIGROUP m_groupList.push_back( group ); #else @@ -480,7 +480,7 @@ void AI::destroyGroup( AIGroup *group ) DEBUG_ASSERTCRASH(group != NULL, ("A NULL group made its way into the AIGroup list.. jkmcd")); // remove it -// DEBUG_LOG(("***AIGROUP %x is being removed from m_groupList.\n", group )); +// DEBUG_LOG(("***AIGROUP %x is being removed from m_groupList.", group )); m_groupList.erase( i ); // destroy group @@ -732,7 +732,7 @@ Object *AI::findClosestEnemy( const Object *me, Real range, UnsignedInt qualifie } } if (bestEnemy) { - //DEBUG_LOG(("Find closest found %s, hunter %s, info %s\n", bestEnemy->getTemplate()->getName().str(), + //DEBUG_LOG(("Find closest found %s, hunter %s, info %s", bestEnemy->getTemplate()->getName().str(), // me->getTemplate()->getName().str(), info->getName().str())); } return bestEnemy; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp index 8a667ff2c0..d8668d2b33 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp @@ -70,14 +70,14 @@ */ AIGroup::AIGroup( void ) { -// DEBUG_LOG(("***AIGROUP %x is being constructed.\n", this)); +// DEBUG_LOG(("***AIGROUP %x is being constructed.", this)); m_groundPath = NULL; m_speed = 0.0f; m_dirty = false; m_id = TheAI->getNextGroupID(); m_memberListSize = 0; m_memberList.clear(); - //DEBUG_LOG(( "AIGroup #%d created\n", m_id )); + //DEBUG_LOG(( "AIGroup #%d created", m_id )); } /** @@ -85,7 +85,7 @@ AIGroup::AIGroup( void ) */ AIGroup::~AIGroup() { -// DEBUG_LOG(("***AIGROUP %x is being destructed.\n", this)); +// DEBUG_LOG(("***AIGROUP %x is being destructed.", this)); // disassociate each member from the group #if RETAIL_COMPATIBLE_AIGROUP @@ -115,7 +115,7 @@ AIGroup::~AIGroup() deleteInstance(m_groundPath); m_groundPath = NULL; } - //DEBUG_LOG(( "AIGroup #%d destroyed\n", m_id )); + //DEBUG_LOG(( "AIGroup #%d destroyed", m_id )); } /** @@ -174,7 +174,7 @@ Bool AIGroup::isMember( Object *obj ) */ void AIGroup::add( Object *obj ) { -// DEBUG_LOG(("***AIGROUP %x is adding Object %x (%s).\n", this, obj, obj->getTemplate()->getName().str())); +// DEBUG_LOG(("***AIGROUP %x is adding Object %x (%s).", this, obj, obj->getTemplate()->getName().str())); DEBUG_ASSERTCRASH(obj != NULL, ("trying to add null obj to AIGroup")); if (obj == NULL) return; @@ -197,7 +197,7 @@ void AIGroup::add( Object *obj ) // add to group's list of objects m_memberList.push_back( obj ); ++m_memberListSize; -// DEBUG_LOG(("***AIGROUP %x has size %u now.\n", this, m_memberListSize)); +// DEBUG_LOG(("***AIGROUP %x has size %u now.", this, m_memberListSize)); obj->enterGroup( this ); @@ -215,7 +215,7 @@ Bool AIGroup::remove( Object *obj ) AIGroupPtr refThis = AIGroupPtr::Create_AddRef(this); #endif -// DEBUG_LOG(("***AIGROUP %x is removing Object %x (%s).\n", this, obj, obj->getTemplate()->getName().str())); +// DEBUG_LOG(("***AIGROUP %x is removing Object %x (%s).", this, obj, obj->getTemplate()->getName().str())); std::list::iterator i = std::find( m_memberList.begin(), m_memberList.end(), obj ); // make sure object is actually in the group @@ -225,7 +225,7 @@ Bool AIGroup::remove( Object *obj ) // remove it m_memberList.erase( i ); --m_memberListSize; -// DEBUG_LOG(("***AIGROUP %x has size %u now.\n", this, m_memberListSize)); +// DEBUG_LOG(("***AIGROUP %x has size %u now.", this, m_memberListSize)); // tell object to forget about group obj->leaveGroup(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGuard.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGuard.cpp index 91550ef3ae..bbd44f9f15 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGuard.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGuard.cpp @@ -386,7 +386,7 @@ StateReturnType AIGuardInnerState::onEnter( void ) Object* nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()) ; if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AIGuardInnerState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AIGuardInnerState.")); return STATE_SUCCESS; } m_enterState = newInstance(AIEnterState)(getMachine()); @@ -406,7 +406,7 @@ StateReturnType AIGuardInnerState::onEnter( void ) Object* nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()) ; if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AIGuardInnerState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AIGuardInnerState.")); return STATE_SUCCESS; } m_exitConditions.m_center = pos; @@ -516,7 +516,7 @@ StateReturnType AIGuardOuterState::onEnter( void ) Object* nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()) ; if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AIGuardInnerState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AIGuardInnerState.")); return STATE_SUCCESS; } Object *obj = getMachineOwner(); @@ -708,7 +708,7 @@ StateReturnType AIGuardIdleState::onEnter( void ) //-------------------------------------------------------------------------------------- StateReturnType AIGuardIdleState::update( void ) { - //DEBUG_LOG(("AIGuardIdleState frame %d: %08lx\n",TheGameLogic->getFrame(),getMachineOwner())); + //DEBUG_LOG(("AIGuardIdleState frame %d: %08lx",TheGameLogic->getFrame(),getMachineOwner())); UnsignedInt now = TheGameLogic->getFrame(); if (now < m_nextEnemyScanTime) @@ -818,7 +818,7 @@ StateReturnType AIGuardAttackAggressorState::onEnter( void ) Object *nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()); if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AIGuardAttackAggressorState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AIGuardAttackAggressorState.")); return STATE_SUCCESS; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGuardRetaliate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGuardRetaliate.cpp index 1168761c9f..00a35005f1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGuardRetaliate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGuardRetaliate.cpp @@ -368,7 +368,7 @@ StateReturnType AIGuardRetaliateInnerState::onEnter( void ) Object* nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()) ; if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AIGuardRetaliateInnerState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AIGuardRetaliateInnerState.")); return STATE_SUCCESS; } m_enterState = newInstance(AIEnterState)(getMachine()); @@ -387,7 +387,7 @@ StateReturnType AIGuardRetaliateInnerState::onEnter( void ) Object* nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()) ; if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AIGuardRetaliateInnerState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AIGuardRetaliateInnerState.")); return STATE_SUCCESS; } m_exitConditions.m_center = pos; @@ -489,7 +489,7 @@ StateReturnType AIGuardRetaliateOuterState::onEnter( void ) Object* nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()) ; if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AIGuardRetaliateOuterState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AIGuardRetaliateOuterState.")); return STATE_SUCCESS; } Object *obj = getMachineOwner(); @@ -661,7 +661,7 @@ StateReturnType AIGuardRetaliateIdleState::onEnter( void ) //-------------------------------------------------------------------------------------- StateReturnType AIGuardRetaliateIdleState::update( void ) { - //DEBUG_LOG(("AIGuardRetaliateIdleState frame %d: %08lx\n",TheGameLogic->getFrame(),getMachineOwner())); + //DEBUG_LOG(("AIGuardRetaliateIdleState frame %d: %08lx",TheGameLogic->getFrame(),getMachineOwner())); UnsignedInt now = TheGameLogic->getFrame(); if (now < m_nextEnemyScanTime) @@ -779,7 +779,7 @@ StateReturnType AIGuardRetaliateAttackAggressorState::onEnter( void ) if( !nemesis ) { - DEBUG_LOG(("Unexpected NULL nemesis in AIGuardRetaliateAttackAggressorState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AIGuardRetaliateAttackAggressorState.")); return STATE_SUCCESS; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index e3f64daab0..731c705ac7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -142,7 +142,7 @@ void PathNode::setNextOptimized(PathNode *node) m_nextOptiDist2D = m_nextOptiDirNorm2D.length(); if (m_nextOptiDist2D == 0.0f) { - //DEBUG_LOG(("Warning - Path Seg length == 0, adjusting. john a.\n")); + //DEBUG_LOG(("Warning - Path Seg length == 0, adjusting. john a.")); m_nextOptiDist2D = 0.01f; } m_nextOptiDirNorm2D.x /= m_nextOptiDist2D; @@ -420,7 +420,7 @@ void Path::appendNode( const Coord3D *pos, PathfindLayerEnum layer ) { /* Check for duplicates. */ if (pos->x == m_pathTail->getPosition()->x && pos->y == m_pathTail->getPosition()->y) { - DEBUG_LOG(("Warning - Path Seg length == 0, ignoring. john a.\n")); + DEBUG_LOG(("Warning - Path Seg length == 0, ignoring. john a.")); return; } } @@ -517,7 +517,7 @@ void Path::optimize( const Object *obj, LocomotorSurfaceTypeMask acceptableSurfa for( ; node != anchor; node = node->getPrevious() ) { Bool isPassable = false; - //CRCDEBUG_LOG(("Path::optimize() calling isLinePassable()\n")); + //CRCDEBUG_LOG(("Path::optimize() calling isLinePassable()")); if (TheAI->pathfinder()->isLinePassable( obj, acceptableSurfaces, layer, *anchor->getPosition(), *node->getPosition(), blocked, false)) { @@ -634,7 +634,7 @@ void Path::optimizeGroundPath( Bool crusher, Int pathDiameter ) for( ; node != anchor; node = node->getPrevious() ) { Bool isPassable = false; - //CRCDEBUG_LOG(("Path::optimize() calling isLinePassable()\n")); + //CRCDEBUG_LOG(("Path::optimize() calling isLinePassable()")); if (TheAI->pathfinder()->isGroundPathPassable( crusher, *anchor->getPosition(), layer, *node->getPosition(), pathDiameter)) { @@ -756,7 +756,7 @@ void Path::computePointOnPath( ClosestPointOnPathInfo& out ) { - CRCDEBUG_LOG(("Path::computePointOnPath() for %s\n", DebugDescribeObject(obj).str())); + CRCDEBUG_LOG(("Path::computePointOnPath() for %s", DebugDescribeObject(obj).str())); out.layer = LAYER_GROUND; out.posOnPath.zero(); @@ -773,7 +773,7 @@ void Path::computePointOnPath( { out = m_cpopOut; m_cpopCountdown--; - CRCDEBUG_LOG(("Path::computePointOnPath() end because we're really close\n")); + CRCDEBUG_LOG(("Path::computePointOnPath() end because we're really close")); return; } m_cpopCountdown = MAX_CPOP; @@ -926,7 +926,7 @@ void Path::computePointOnPath( k = 1.0f; Bool gotPos = false; - CRCDEBUG_LOG(("Path::computePointOnPath() calling isLinePassable() 1\n")); + CRCDEBUG_LOG(("Path::computePointOnPath() calling isLinePassable() 1")); if (TheAI->pathfinder()->isLinePassable( obj, locomotorSet.getValidSurfaces(), out.layer, pos, *nextNodePos, false, true )) { @@ -960,7 +960,7 @@ void Path::computePointOnPath( tryPos.x = (nextNodePos->x + next->getPosition()->x) * 0.5; tryPos.y = (nextNodePos->y + next->getPosition()->y) * 0.5; tryPos.z = nextNodePos->z; - CRCDEBUG_LOG(("Path::computePointOnPath() calling isLinePassable() 2\n")); + CRCDEBUG_LOG(("Path::computePointOnPath() calling isLinePassable() 2")); if (veryClose || TheAI->pathfinder()->isLinePassable( obj, locomotorSet.getValidSurfaces(), closeNext->getLayer(), pos, tryPos, false, true )) { gotPos = true; @@ -978,7 +978,7 @@ void Path::computePointOnPath( out.posOnPath.y = closeNodePos->y + tryDist * segmentDirNorm.y; out.posOnPath.z = closeNodePos->z; - CRCDEBUG_LOG(("Path::computePointOnPath() calling isLinePassable() 3\n")); + CRCDEBUG_LOG(("Path::computePointOnPath() calling isLinePassable() 3")); if (TheAI->pathfinder()->isLinePassable( obj, locomotorSet.getValidSurfaces(), out.layer, pos, out.posOnPath, false, true )) { k = 0.5f; @@ -1029,7 +1029,7 @@ void Path::computePointOnPath( m_cpopIn = pos; m_cpopOut = out; m_cpopValid = true; - CRCDEBUG_LOG(("Path::computePointOnPath() end\n")); + CRCDEBUG_LOG(("Path::computePointOnPath() end")); } @@ -2229,7 +2229,7 @@ void PathfindZoneManager::allocateZones(void) while (m_zonesAllocated <= m_maxZone) { m_zonesAllocated *= 2; } - DEBUG_LOG(("Allocating zone tables of size %d\n", m_zonesAllocated)); + DEBUG_LOG(("Allocating zone tables of size %d", m_zonesAllocated)); // pool[]ify m_groundCliffZones = MSGNEW("PathfindZoneInfo") zoneStorageType[m_zonesAllocated]; m_groundWaterZones = MSGNEW("PathfindZoneInfo") zoneStorageType[m_zonesAllocated]; @@ -2369,13 +2369,13 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye } } - //DEBUG_LOG(("Collapsed zones %d\n", m_maxZone)); + //DEBUG_LOG(("Collapsed zones %d", m_maxZone)); } } Int totalZones = m_maxZone; // if (totalZones>maxZones/2) { -// DEBUG_LOG(("Max zones %d\n", m_maxZone)); +// DEBUG_LOG(("Max zones %d", m_maxZone)); // } // Collapse the zones into a 1,2,3... sequence, removing collapsed zones. @@ -2417,7 +2417,7 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye //#if defined(DEBUG_LOGGING) // QueryPerformanceCounter((LARGE_INTEGER *)&endTime64); // timeToUpdate = ((double)(endTime64-startTime64) / (double)(freq64)); -// DEBUG_LOG(("Time to calculate first %f\n", timeToUpdate)); +// DEBUG_LOG(("Time to calculate first %f", timeToUpdate)); //#endif //#endif @@ -2548,7 +2548,7 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye //#if defined(DEBUG_LOGGING) // QueryPerformanceCounter((LARGE_INTEGER *)&endTime64); // timeToUpdate = ((double)(endTime64-startTime64) / (double)(freq64)); -// DEBUG_LOG(("Time to calculate second %f\n", timeToUpdate)); +// DEBUG_LOG(("Time to calculate second %f", timeToUpdate)); //#endif //#endif @@ -2595,7 +2595,7 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye //// Int zone1 = map[i][j].getZone(); //// Int zone2 = map[i-1][j].getZone(); //// if (m_terrainZones[zone1] != m_terrainZones[zone2]) { -//// //DEBUG_LOG(("Matching terrain zone %d to %d.\n", zone1, zone2)); +//// //DEBUG_LOG(("Matching terrain zone %d to %d.", zone1, zone2)); //// } // applyZone(map[i][j], map[i-1][j], m_groundRubbleZones, m_maxZone); // } @@ -2620,7 +2620,7 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye //// Int zone1 = map[i][j].getZone(); //// Int zone2 = map[i][j-1].getZone(); //// if (m_terrainZones[zone1] != m_terrainZones[zone2]) { -//// //DEBUG_LOG(("Matching terrain zone %d to %d.\n", zone1, zone2)); +//// //DEBUG_LOG(("Matching terrain zone %d to %d.", zone1, zone2)); //// } // applyZone(map[i][j], map[i][j-1], m_groundRubbleZones, m_maxZone); // } @@ -2774,17 +2774,17 @@ void PathfindZoneManager::calculateZones( PathfindCell **map, PathfindLayer laye QueryPerformanceCounter((LARGE_INTEGER *)&endTime64); timeToUpdate = ((double)(endTime64-startTime64) / (double)(freq64)); -// DEBUG_LOG(("Time to calculate zones %f, cells %d\n", timeToUpdate, (globalBounds.hi.x-globalBounds.lo.x)*(globalBounds.hi.y-globalBounds.lo.y))); +// DEBUG_LOG(("Time to calculate zones %f, cells %d", timeToUpdate, (globalBounds.hi.x-globalBounds.lo.x)*(globalBounds.hi.y-globalBounds.lo.y))); if ( updateSamples < 400 ) { averageTimeToUpdate = ((averageTimeToUpdate * updateSamples) + timeToUpdate) / (updateSamples + 1.0f); updateSamples++; - DEBUG_LOG(("computing...: %f, \n", averageTimeToUpdate)); + DEBUG_LOG(("computing...: %f, ", averageTimeToUpdate)); } else if ( updateSamples == 400 ) { - DEBUG_LOG((" =============DONE============= Average time to calculate zones: %f, \n", averageTimeToUpdate)); - DEBUG_LOG((" Percent of baseline : %f, \n", averageTimeToUpdate/0.003335f)); + DEBUG_LOG((" =============DONE============= Average time to calculate zones: %f, ", averageTimeToUpdate)); + DEBUG_LOG((" Percent of baseline : %f, ", averageTimeToUpdate/0.003335f)); updateSamples = 777; #ifdef forceRefreshCalling s_stopForceCalling = TRUE; @@ -2928,14 +2928,14 @@ void PathfindZoneManager::updateZonesForModify(PathfindCell **map, PathfindLayer } } } - //DEBUG_LOG(("Collapsed zones %d\n", m_maxZone)); + //DEBUG_LOG(("Collapsed zones %d", m_maxZone)); } } #ifdef DEBUG_QPF #if defined(DEBUG_LOGGING) QueryPerformanceCounter((LARGE_INTEGER *)&endTime64); timeToUpdate = ((double)(endTime64-startTime64) / (double)(freq64)); - //DEBUG_LOG(("Time to update zones %f, cells %d\n", timeToUpdate, (globalBounds.hi.x-globalBounds.lo.x)*(globalBounds.hi.y-globalBounds.lo.y))); + //DEBUG_LOG(("Time to update zones %f, cells %d", timeToUpdate, (globalBounds.hi.x-globalBounds.lo.x)*(globalBounds.hi.y-globalBounds.lo.y))); #endif #endif #if defined(RTS_DEBUG) @@ -3836,7 +3836,7 @@ Pathfinder::~Pathfinder( void ) void Pathfinder::reset( void ) { frameToShowObstacles = 0; - DEBUG_LOG(("Pathfind cell is %d bytes, PathfindCellInfo is %d bytes\n", sizeof(PathfindCell), sizeof(PathfindCellInfo))); + DEBUG_LOG(("Pathfind cell is %d bytes, PathfindCellInfo is %d bytes", sizeof(PathfindCell), sizeof(PathfindCellInfo))); if (m_blockOfMapCells) { delete []m_blockOfMapCells; @@ -3972,7 +3972,7 @@ PathfindLayerEnum Pathfinder::addBridge(Bridge *theBridge) if (m_layers[layer].init(theBridge, (PathfindLayerEnum)layer) ) { return (PathfindLayerEnum)layer; } - DEBUG_LOG(("WARNING: Bridge failed to init in pathfinder\n")); + DEBUG_LOG(("WARNING: Bridge failed to init in pathfinder")); return LAYER_GROUND; // failed to init, usually cause off of the map. jba. } layer++; @@ -3991,7 +3991,7 @@ void Pathfinder::updateLayer(Object *obj, PathfindLayerEnum layer) layer = LAYER_GROUND; } } - //DEBUG_LOG(("Object layer is %d\n", layer)); + //DEBUG_LOG(("Object layer is %d", layer)); obj->setLayer(layer); } @@ -4837,12 +4837,12 @@ void Pathfinder::cleanOpenAndClosedLists(void) { needInfo = true; } if (!needInfo) { - DEBUG_LOG(("leaked cell %d, %d\n", m_map[i][j].getXIndex(), m_map[i][j].getYIndex())); + DEBUG_LOG(("leaked cell %d, %d", m_map[i][j].getXIndex(), m_map[i][j].getYIndex())); m_map[i][j].releaseInfo(); } DEBUG_ASSERTCRASH((needInfo), ("Minor temporary memory leak - Extra cell allocated. Tell JBA steps if repeatable.")); }; - //DEBUG_LOG(("Pathfind used %d cells.\n", count)); + //DEBUG_LOG(("Pathfind used %d cells.", count)); #endif //#endif @@ -5178,7 +5178,7 @@ void Pathfinder::snapClosestGoalPosition(Object *obj, Coord3D *pos) } } } - //DEBUG_LOG(("Couldn't find goal.\n")); + //DEBUG_LOG(("Couldn't find goal.")); } /** @@ -5427,7 +5427,7 @@ Bool Pathfinder::adjustDestination(Object *obj, const LocomotorSet& locomotorSet // Didn't work, so just do simple adjust. return(adjustDestination(obj, locomotorSet, dest, NULL)); } - //DEBUG_LOG(("adjustDestination failed, dest (%f, %f), adj dest (%f,%f), %x %s\n", dest->x, dest->y, adjustDest.x, adjustDest.y, + //DEBUG_LOG(("adjustDestination failed, dest (%f, %f), adj dest (%f,%f), %x %s", dest->x, dest->y, adjustDest.x, adjustDest.y, //obj, obj->getTemplate()->getName().str())); return false; } @@ -5953,7 +5953,7 @@ void Pathfinder::processPathfindQueue(void) { DEBUG_LOG(("%d Pathfind queue: %d paths, %d cells", TheGameLogic->getFrame(), pathsFound, m_cumulativeCellsAllocated)); DEBUG_LOG(("Time %f (%f)", timeToUpdate, (::GetTickCount()-startTimeMS)/1000.0f)); - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } #endif #endif @@ -6098,7 +6098,7 @@ struct ExamineCellsStruct to->setParentCell(from) ; to->setTotalCost(to->getCostSoFar() + costRemaining) ; - //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d\n", + //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d", // to->getXIndex(), to->getYIndex(), // to->costSoFar(from), newCostSoFar, costRemaining, to->getCostSoFar() + costRemaining)); @@ -6364,7 +6364,7 @@ Int Pathfinder::examineNeighboringCells(PathfindCell *parentCell, PathfindCell * } newCell->setTotalCost(newCell->getCostSoFar() + costRemaining) ; - //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d\n", + //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d", // newCell->getXIndex(), newCell->getYIndex(), // newCell->costSoFar(parentCell), newCostSoFar, costRemaining, newCell->getCostSoFar() + costRemaining)); @@ -6430,12 +6430,12 @@ Path *Pathfinder::findPath( Object *obj, const LocomotorSet& locomotorSet, const Path *linkPath = findClosestPath(obj, locomotorSet, node->getPosition(), prior->getPosition(), false, 0, true); if (linkPath==NULL) { - DEBUG_LOG(("Couldn't find path - unexpected. jba.\n")); + DEBUG_LOG(("Couldn't find path - unexpected. jba.")); continue; } PathNode *linkNode = linkPath->getLastNode(); if (linkNode==NULL) { - DEBUG_LOG(("Empty path - unexpected. jba.\n")); + DEBUG_LOG(("Empty path - unexpected. jba.")); continue; } for (linkNode=linkNode->getPrevious(); linkNode; linkNode=linkNode->getPrevious()) { @@ -6464,9 +6464,9 @@ Path *Pathfinder::findPath( Object *obj, const LocomotorSet& locomotorSet, const Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSet, const Coord3D *from, const Coord3D *rawTo) { - //CRCDEBUG_LOG(("Pathfinder::findPath()\n")); + //CRCDEBUG_LOG(("Pathfinder::findPath()")); #ifdef INTENSE_DEBUG - DEBUG_LOG(("internal find path...\n")); + DEBUG_LOG(("internal find path...")); #endif #ifdef DEBUG_LOGGING @@ -6484,7 +6484,7 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe } if (rawTo->x == 0.0f && rawTo->y == 0.0f) { - DEBUG_LOG(("Attempting pathfind to 0,0, generally a bug.\n")); + DEBUG_LOG(("Attempting pathfind to 0,0, generally a bug.")); return NULL; } DEBUG_ASSERTCRASH(m_openList==NULL && m_closedList == NULL, ("Dangling lists.")); @@ -6575,10 +6575,10 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe zone1 = m_zoneManager.getEffectiveZone(locomotorSet.getValidSurfaces(), isCrusher, zone1); } - //DEBUG_LOG(("Zones %d to %d\n", zone1, zone2)); + //DEBUG_LOG(("Zones %d to %d", zone1, zone2)); if ( zone1 != zone2) { - //DEBUG_LOG(("Intense Debug Info - Pathfind Zone screen failed-cannot reach desired location.\n")); + //DEBUG_LOG(("Intense Debug Info - Pathfind Zone screen failed-cannot reach desired location.")); goalCell->releaseInfo(); parentCell->releaseInfo(); return NULL; @@ -6623,15 +6623,15 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe // success - found a path to the goal Bool show = TheGlobalData->m_debugAI==AI_DEBUG_PATHS; #ifdef INTENSE_DEBUG - DEBUG_LOG(("internal find path SUCCESS...\n")); + DEBUG_LOG(("internal find path SUCCESS...")); Int count = 0; if (cellCount>1000 && obj) { show = true; - DEBUG_LOG(("cells %d obj %s %x from (%f,%f) to(%f, %f)\n", count, obj->getTemplate()->getName().str(), obj, from->x, from->y, to->x, to->y)); + DEBUG_LOG(("cells %d obj %s %x from (%f,%f) to(%f, %f)", count, obj->getTemplate()->getName().str(), obj, from->x, from->y, to->x, to->y)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif TheScriptEngine->AppendDebugMessage("Big path", false); @@ -6661,7 +6661,7 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe // failure - goal cannot be reached #if defined(RTS_DEBUG) #ifdef INTENSE_DEBUG - DEBUG_LOG(("internal find path FAILURE...\n")); + DEBUG_LOG(("internal find path FAILURE...")); #endif if (TheGlobalData->m_debugAI == AI_DEBUG_PATHS) { @@ -6702,7 +6702,7 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("state %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("state %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif } @@ -6715,8 +6715,8 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe valid = validMovementPosition( isCrusher, obj->getLayer(), locomotorSet, to ) ; DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("Pathfind failed from (%f,%f) to (%f,%f), OV %d\n", from->x, from->y, to->x, to->y, valid)); - DEBUG_LOG(("Unit '%s', time %f, cells %d\n", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f,cellCount)); + DEBUG_LOG(("Pathfind failed from (%f,%f) to (%f,%f), OV %d", from->x, from->y, to->x, to->y, valid)); + DEBUG_LOG(("Unit '%s', time %f, cells %d", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f,cellCount)); } #endif @@ -6934,7 +6934,7 @@ struct MADStruct { return 0; // Packing or unpacking objects for example } - //DEBUG_LOG(("Moving ally\n")); + //DEBUG_LOG(("Moving ally")); otherObj->getAI()->aiMoveAwayFromUnit(d->obj, CMD_FROM_AI); } } @@ -7014,7 +7014,7 @@ struct GroundCellsStruct Path *Pathfinder::findGroundPath( const Coord3D *from, const Coord3D *rawTo, Int pathDiameter, Bool crusher) { - //CRCDEBUG_LOG(("Pathfinder::findGroundPath()\n")); + //CRCDEBUG_LOG(("Pathfinder::findGroundPath()")); #ifdef DEBUG_LOGGING Int startTimeMS = ::GetTickCount(); #endif @@ -7034,7 +7034,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, } if (rawTo->x == 0.0f && rawTo->y == 0.0f) { - DEBUG_LOG(("Attempting pathfind to 0,0, generally a bug.\n")); + DEBUG_LOG(("Attempting pathfind to 0,0, generally a bug.")); return NULL; } DEBUG_ASSERTCRASH(m_openList==NULL && m_closedList == NULL, ("Dangling lists.")); @@ -7114,7 +7114,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, zone1 = m_zoneManager.getEffectiveZone(LOCOMOTORSURFACE_GROUND, false, parentCell->getZone()); zone2 = m_zoneManager.getEffectiveZone(LOCOMOTORSURFACE_GROUND, false, goalCell->getZone()); - //DEBUG_LOG(("Zones %d to %d\n", zone1, zone2)); + //DEBUG_LOG(("Zones %d to %d", zone1, zone2)); if ( zone1 != zone2) { goalCell->releaseInfo(); @@ -7150,7 +7150,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, // success - found a path to the goal #ifdef INTENSE_DEBUG DEBUG_LOG((" time %d msec %d cells", (::GetTickCount()-startTimeMS), cellCount)); - DEBUG_LOG((" SUCCESS\n")); + DEBUG_LOG((" SUCCESS")); #endif #if defined(RTS_DEBUG) Bool show = TheGlobalData->m_debugAI==AI_DEBUG_GROUND_PATHS; @@ -7296,13 +7296,13 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, } //DEBUG_LOG(("CELL(%d,%d)L%d CD%d CSF %d, CR%d // ",newCell->getXIndex(), newCell->getYIndex(), // newCell->getLayer(), clearDiameter, newCostSoFar, costRemaining)); - //if ((cellCount&7)==0) DEBUG_LOG(("\n")); + //if ((cellCount&7)==0) DEBUG_LOG(("")); newCell->setCostSoFar(newCostSoFar); // keep track of path we're building - point back to cell we moved here from newCell->setParentCell(parentCell) ; newCell->setTotalCost(newCell->getCostSoFar() + costRemaining) ; - //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d\n", + //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d", // newCell->getXIndex(), newCell->getYIndex(), // newCell->costSoFar(parentCell), newCostSoFar, costRemaining, newCell->getCostSoFar() + costRemaining)); @@ -7322,7 +7322,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, } // failure - goal cannot be reached #ifdef INTENSE_DEBUG - DEBUG_LOG((" FAILURE\n")); + DEBUG_LOG((" FAILURE")); #endif #if defined(RTS_DEBUG) if (TheGlobalData->m_debugAI) @@ -7359,8 +7359,8 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, #endif DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("FindGroundPath failed from (%f,%f) to (%f,%f)\n", from->x, from->y, to->x, to->y)); - DEBUG_LOG(("time %f\n", (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("FindGroundPath failed from (%f,%f) to (%f,%f)", from->x, from->y, to->x, to->y)); + DEBUG_LOG(("time %f", (::GetTickCount()-startTimeMS)/1000.0f)); #ifdef DUMP_PERF_STATS TheGameLogic->incrementOverallFailedPathfinds(); @@ -7490,13 +7490,13 @@ Path *Pathfinder::findClosestHierarchicalPath( Bool isHuman, const LocomotorSet& Path *Pathfinder::internal_findHierarchicalPath( Bool isHuman, const LocomotorSurfaceTypeMask locomotorSurface, const Coord3D *from, const Coord3D *rawTo, Bool crusher, Bool closestOK) { - //CRCDEBUG_LOG(("Pathfinder::findGroundPath()\n")); + //CRCDEBUG_LOG(("Pathfinder::findGroundPath()")); #ifdef DEBUG_LOGGING Int startTimeMS = ::GetTickCount(); #endif if (rawTo->x == 0.0f && rawTo->y == 0.0f) { - DEBUG_LOG(("Attempting pathfind to 0,0, generally a bug.\n")); + DEBUG_LOG(("Attempting pathfind to 0,0, generally a bug.")); return NULL; } DEBUG_ASSERTCRASH(m_openList==NULL && m_closedList == NULL, ("Dangling lists.")); @@ -7989,8 +7989,8 @@ Path *Pathfinder::internal_findHierarchicalPath( Bool isHuman, const LocomotorSu #endif DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("FindHierarchicalPath failed from (%f,%f) to (%f,%f)\n", from->x, from->y, to->x, to->y)); - DEBUG_LOG(("time %f\n", (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("FindHierarchicalPath failed from (%f,%f) to (%f,%f)", from->x, from->y, to->x, to->y)); + DEBUG_LOG(("time %f", (::GetTickCount()-startTimeMS)/1000.0f)); #ifdef DUMP_PERF_STATS TheGameLogic->incrementOverallFailedPathfinds(); @@ -8211,7 +8211,7 @@ void Pathfinder::clip( Coord3D *from, Coord3D *to ) Bool Pathfinder::pathDestination( Object *obj, const LocomotorSet& locomotorSet, Coord3D *dest, PathfindLayerEnum layer, const Coord3D *groupDest) { - //CRCDEBUG_LOG(("Pathfinder::pathDestination()\n")); + //CRCDEBUG_LOG(("Pathfinder::pathDestination()")); if (m_isMapReady == false) return NULL; if (!obj) return false; @@ -8406,7 +8406,7 @@ Bool Pathfinder::pathDestination( Object *obj, const LocomotorSet& locomotorSet newCell->setTotalCost(newCell->getCostSoFar() + costRemaining) ; - //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d\n", + //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d", // newCell->getXIndex(), newCell->getYIndex(), // newCell->costSoFar(parentCell), newCostSoFar, costRemaining, newCell->getCostSoFar() + costRemaining)); @@ -8489,7 +8489,7 @@ void Pathfinder::tightenPath(Object *obj, const LocomotorSet& locomotorSet, Coor Int Pathfinder::checkPathCost(Object *obj, const LocomotorSet& locomotorSet, const Coord3D *from, const Coord3D *rawTo) { - //CRCDEBUG_LOG(("Pathfinder::checkPathCost()\n")); + //CRCDEBUG_LOG(("Pathfinder::checkPathCost()")); if (m_isMapReady == false) return NULL; enum {MAX_COST = 0x7fff0000}; if (!obj) return MAX_COST; @@ -8659,7 +8659,7 @@ Int Pathfinder::checkPathCost(Object *obj, const LocomotorSet& locomotorSet, con newCell->setTotalCost(newCell->getCostSoFar() + costRemaining) ; - //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d\n", + //DEBUG_LOG(("Cell (%d,%d), Parent cost %d, newCostSoFar %d, cost rem %d, tot %d", // newCell->getXIndex(), newCell->getYIndex(), // newCell->costSoFar(parentCell), newCostSoFar, costRemaining, newCell->getCostSoFar() + costRemaining)); @@ -8694,7 +8694,7 @@ Int Pathfinder::checkPathCost(Object *obj, const LocomotorSet& locomotorSet, con Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet, const Coord3D *from, Coord3D *rawTo, Bool blocked, Real pathCostMultiplier, Bool moveAllies) { - //CRCDEBUG_LOG(("Pathfinder::findClosestPath()\n")); + //CRCDEBUG_LOG(("Pathfinder::findClosestPath()")); #ifdef DEBUG_LOGGING Int startTimeMS = ::GetTickCount(); #endif @@ -8867,11 +8867,11 @@ Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet } if (count>1000) { show = true; - DEBUG_LOG(("FCP - cells %d obj %s %x\n", count, obj->getTemplate()->getName().str(), obj)); + DEBUG_LOG(("FCP - cells %d obj %s %x", count, obj->getTemplate()->getName().str(), obj)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif TheScriptEngine->AppendDebugMessage("Big path FCP", false); @@ -8940,17 +8940,17 @@ Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet #ifdef INTENSE_DEBUG if (count>5000) { show = true; - DEBUG_LOG(("FCP CC cells %d obj %s %x\n", count, obj->getTemplate()->getName().str(), obj)); + DEBUG_LOG(("FCP CC cells %d obj %s %x", count, obj->getTemplate()->getName().str(), obj)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif DEBUG_LOG(("%d ", TheGameLogic->getFrame())); DEBUG_LOG(("Pathfind(findClosestPath) chugged from (%f,%f) to (%f,%f), --", from->x, from->y, to->x, to->y)); - DEBUG_LOG(("Unit '%s', time %f\n", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #ifdef INTENSE_DEBUG TheScriptEngine->AppendDebugMessage("Big path FCP CC", false); #endif @@ -8976,7 +8976,7 @@ Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet DEBUG_LOG(("%d ", TheGameLogic->getFrame())); DEBUG_LOG(("Pathfind(findClosestPath) failed from (%f,%f) to (%f,%f), original valid %d --", from->x, from->y, to->x, to->y, valid)); - DEBUG_LOG(("Unit '%s', time %f\n", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #endif #if defined(RTS_DEBUG) if (TheGlobalData->m_debugAI) @@ -9419,23 +9419,23 @@ Bool Pathfinder::isViewBlockedByObstacle(const Object* obj, const Object* objOth //----------------------------------------------------------------------------- Bool Pathfinder::isAttackViewBlockedByObstacle(const Object* attacker, const Coord3D& attackerPos, const Object* victim, const Coord3D& victimPos) { - //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() - attackerPos is (%g,%g,%g) (%X,%X,%X)\n", + //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() - attackerPos is (%g,%g,%g) (%X,%X,%X)", // attackerPos.x, attackerPos.y, attackerPos.z, // AS_INT(attackerPos.x),AS_INT(attackerPos.y),AS_INT(attackerPos.z))); - //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() - victimPos is (%g,%g,%g) (%X,%X,%X)\n", + //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() - victimPos is (%g,%g,%g) (%X,%X,%X)", // victimPos.x, victimPos.y, victimPos.z, // AS_INT(victimPos.x),AS_INT(victimPos.y),AS_INT(victimPos.z))); // Global switch to turn this off in case it doesn't work. if (!TheAI->getAiData()->m_attackUsesLineOfSight) { - //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 1\n")); + //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 1")); return false; } // If the attacker doesn't need line of sight, isn't blocked. if (!attacker->isKindOf(KINDOF_ATTACK_NEEDS_LINE_OF_SIGHT)) { - //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 2\n")); + //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 2")); return false; } @@ -9457,7 +9457,7 @@ Bool Pathfinder::isAttackViewBlockedByObstacle(const Object* attacker, const Coo if (viewBlocked) { - //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 3\n")); + //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 3")); return true; } } @@ -9485,7 +9485,7 @@ Bool Pathfinder::isAttackViewBlockedByObstacle(const Object* attacker, const Coo } Int ret = iterateCellsAlongLine(attackerPos, victimPos, layer, attackBlockedByObstacleCallback, &info); - //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 4\n")); + //CRCDEBUG_LOG(("Pathfinder::isAttackViewBlockedByObstacle() 4")); return ret != 0; } @@ -9684,7 +9684,7 @@ Bool Pathfinder::isLinePassable( const Object *obj, LocomotorSurfaceTypeMask acc Bool allowPinched) { LinePassableStruct info; - //CRCDEBUG_LOG(("Pathfinder::isLinePassable(): %d %d %d \n", m_ignoreObstacleID, m_isMapReady, m_isTunneling)); + //CRCDEBUG_LOG(("Pathfinder::isLinePassable(): %d %d %d ", m_ignoreObstacleID, m_isMapReady, m_isTunneling)); info.obj = obj; info.acceptableSurfaces = acceptableSurfaces; @@ -9783,7 +9783,7 @@ void Pathfinder::updateGoal( Object *obj, const Coord3D *newGoalPos, PathfindLay PathfindLayerEnum originalLayer = obj->getDestinationLayer(); - //DEBUG_LOG(("Object Goal layer is %d\n", layer)); + //DEBUG_LOG(("Object Goal layer is %d", layer)); Bool layerChanged = originalLayer != layer; Bool doGround=false; @@ -9832,7 +9832,7 @@ void Pathfinder::updateGoal( Object *obj, const Coord3D *newGoalPos, PathfindLay if (warn && cell->getGoalUnit()!=INVALID_ID && cell->getGoalUnit() != obj->getID()) { warn = false; // jba intense debug - //DEBUG_LOG(, ("Units got stuck close to each other. jba\n")); + //DEBUG_LOG(, ("Units got stuck close to each other. jba")); } cellNdx.x = i; cellNdx.y = j; @@ -9845,7 +9845,7 @@ void Pathfinder::updateGoal( Object *obj, const Coord3D *newGoalPos, PathfindLay if (warn && cell->getGoalUnit()!=INVALID_ID && cell->getGoalUnit() != obj->getID()) { warn = false; // jba intense debug - //DEBUG_LOG(, ("Units got stuck close to each other. jba\n")); + //DEBUG_LOG(, ("Units got stuck close to each other. jba")); } cellNdx.x = i; cellNdx.y = j; @@ -10039,7 +10039,7 @@ void Pathfinder::updatePos( Object *obj, const Coord3D *newPos) ai->setCurPathfindCell(newCell); Int i,j; ICoord2D cellNdx; - //DEBUG_LOG(("Updating unit pos at cell %d, %d\n", newCell.x, newCell.y)); + //DEBUG_LOG(("Updating unit pos at cell %d, %d", newCell.x, newCell.y)); if (curCell.x>=0 && curCell.y>=0) { for (i=curCell.x-radius; i=0 && curCell.y>=0) { for (i=curCell.x-radius; igetAI()->aiMoveAwayFromUnit(obj, CMD_FROM_AI); } } @@ -10392,7 +10392,7 @@ Path *Pathfinder::getMoveAwayFromPath(Object* obj, Object *otherObj, DEBUG_LOG(("%d ", TheGameLogic->getFrame())); DEBUG_LOG(("getMoveAwayFromPath pathfind failed -- ")); - DEBUG_LOG(("Unit '%s', time %f\n", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); m_isTunneling = false; cleanOpenAndClosedLists(); @@ -10406,7 +10406,7 @@ Path *Pathfinder::getMoveAwayFromPath(Object* obj, Object *otherObj, Path *Pathfinder::patchPath( const Object *obj, const LocomotorSet& locomotorSet, Path *originalPath, Bool blocked ) { - //CRCDEBUG_LOG(("Pathfinder::patchPath()\n")); + //CRCDEBUG_LOG(("Pathfinder::patchPath()")); #ifdef DEBUG_LOGGING Int startTimeMS = ::GetTickCount(); #endif @@ -10571,7 +10571,7 @@ Path *Pathfinder::patchPath( const Object *obj, const LocomotorSet& locomotorSet DEBUG_LOG(("%d ", TheGameLogic->getFrame())); DEBUG_LOG(("patchPath Pathfind failed -- ")); - DEBUG_LOG(("Unit '%s', time %f\n", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #if defined(RTS_DEBUG) if (TheGlobalData->m_debugAI) { @@ -10594,30 +10594,30 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot const Object *victim, const Coord3D* victimPos, const Weapon *weapon ) { /* - CRCDEBUG_LOG(("Pathfinder::findAttackPath() for object %d (%s)\n", obj->getID(), obj->getTemplate()->getName().str())); + CRCDEBUG_LOG(("Pathfinder::findAttackPath() for object %d (%s)", obj->getID(), obj->getTemplate()->getName().str())); XferCRC xferCRC; xferCRC.open("lightCRC"); xferCRC.xferSnapshot((Object *)obj); xferCRC.close(); - CRCDEBUG_LOG(("obj CRC is %X\n", xferCRC.getCRC())); + CRCDEBUG_LOG(("obj CRC is %X", xferCRC.getCRC())); if (from) { - CRCDEBUG_LOG(("from: (%g,%g,%g) (%X,%X,%X)\n", + CRCDEBUG_LOG(("from: (%g,%g,%g) (%X,%X,%X)", from->x, from->y, from->z, AS_INT(from->x), AS_INT(from->y), AS_INT(from->z))); } if (victim) { - CRCDEBUG_LOG(("victim is %d (%s)\n", victim->getID(), victim->getTemplate()->getName().str())); + CRCDEBUG_LOG(("victim is %d (%s)", victim->getID(), victim->getTemplate()->getName().str())); XferCRC xferCRC; xferCRC.open("lightCRC"); xferCRC.xferSnapshot((Object *)victim); xferCRC.close(); - CRCDEBUG_LOG(("victim CRC is %X\n", xferCRC.getCRC())); + CRCDEBUG_LOG(("victim CRC is %X", xferCRC.getCRC())); } if (victimPos) { - CRCDEBUG_LOG(("from: (%g,%g,%g) (%X,%X,%X)\n", + CRCDEBUG_LOG(("from: (%g,%g,%g) (%X,%X,%X)", victimPos->x, victimPos->y, victimPos->z, AS_INT(victimPos->x), AS_INT(victimPos->y), AS_INT(victimPos->z))); } @@ -10801,11 +10801,11 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot } if (count>1000) { show = true; - DEBUG_LOG(("FAP cells %d obj %s %x\n", count, obj->getTemplate()->getName().str(), obj)); + DEBUG_LOG(("FAP cells %d obj %s %x", count, obj->getTemplate()->getName().str(), obj)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif TheScriptEngine->AppendDebugMessage("Big Attack path", false); @@ -10814,7 +10814,7 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot if (show) debugShowSearch(true); #if defined(RTS_DEBUG) - //DEBUG_LOG(("Attack path took %d cells, %f sec\n", cellCount, (::GetTickCount()-startTimeMS)/1000.0f)); + //DEBUG_LOG(("Attack path took %d cells, %f sec", cellCount, (::GetTickCount()-startTimeMS)/1000.0f)); #endif // put parent cell onto closed list - its evaluation is finished m_closedList = parentCell->putOnClosedList( m_closedList ); @@ -10910,11 +10910,11 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot } #ifdef INTENSE_DEBUG - DEBUG_LOG(("obj %s %x\n", obj->getTemplate()->getName().str(), obj)); + DEBUG_LOG(("obj %s %x", obj->getTemplate()->getName().str(), obj)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif debugShowSearch(true); @@ -10929,8 +10929,8 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot } #if defined(RTS_DEBUG) DEBUG_LOG(("%d (%d cells)", TheGameLogic->getFrame(), cellCount)); - DEBUG_LOG(("Attack Pathfind failed from (%f,%f) to (%f,%f) -- \n", from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); - DEBUG_LOG(("Unit '%s', attacking '%s' time %f\n", obj->getTemplate()->getName().str(), victim->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("Attack Pathfind failed from (%f,%f) to (%f,%f) -- ", from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); + DEBUG_LOG(("Unit '%s', attacking '%s' time %f", obj->getTemplate()->getName().str(), victim->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #endif #endif #ifdef DUMP_PERF_STATS @@ -10948,7 +10948,7 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotorSet, const Coord3D *from, const Coord3D* repulsorPos1, const Coord3D* repulsorPos2, Real repulsorRadius) { - //CRCDEBUG_LOG(("Pathfinder::findSafePath()\n")); + //CRCDEBUG_LOG(("Pathfinder::findSafePath()")); if (m_isMapReady == false) return NULL; // Should always be ok. #if defined(RTS_DEBUG) // Int startTimeMS = ::GetTickCount(); @@ -11027,7 +11027,7 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor farthestDistanceSqr = distSqr; if (cellCount > MAX_CELLS) { #ifdef INTENSE_DEBUG - DEBUG_LOG(("Took intermediate path, dist %f, goal dist %f\n", sqrt(farthestDistanceSqr), repulsorRadius)); + DEBUG_LOG(("Took intermediate path, dist %f, goal dist %f", sqrt(farthestDistanceSqr), repulsorRadius)); #endif ok = true; // Already a big search, just take this one. } @@ -11045,11 +11045,11 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor } if (count>2000) { show = true; - DEBUG_LOG(("cells %d obj %s %x\n", count, obj->getTemplate()->getName().str(), obj)); + DEBUG_LOG(("cells %d obj %s %x", count, obj->getTemplate()->getName().str(), obj)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif TheScriptEngine->AppendDebugMessage("Big Safe path", false); @@ -11058,7 +11058,7 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor if (show) debugShowSearch(true); #if defined(RTS_DEBUG) - //DEBUG_LOG(("Attack path took %d cells, %f sec\n", cellCount, (::GetTickCount()-startTimeMS)/1000.0f)); + //DEBUG_LOG(("Attack path took %d cells, %f sec", cellCount, (::GetTickCount()-startTimeMS)/1000.0f)); #endif // construct and return path Path *path = buildActualPath( obj, locomotorSet.getValidSurfaces(), obj->getPosition(), parentCell, centerInCell, false); @@ -11078,11 +11078,11 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor } #ifdef INTENSE_DEBUG - DEBUG_LOG(("obj %s %x count %d\n", obj->getTemplate()->getName().str(), obj, cellCount)); + DEBUG_LOG(("obj %s %x count %d", obj->getTemplate()->getName().str(), obj, cellCount)); #ifdef STATE_MACHINE_DEBUG if( obj->getAIUpdateInterface() ) { - DEBUG_LOG(("State %s\n", obj->getAIUpdateInterface()->getCurrentStateName().str())); + DEBUG_LOG(("State %s", obj->getAIUpdateInterface()->getCurrentStateName().str())); } #endif TheScriptEngine->AppendDebugMessage("Overflowed Safe path", false); @@ -11090,8 +11090,8 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor #if 0 #if defined(RTS_DEBUG) DEBUG_LOG(("%d (%d cells)", TheGameLogic->getFrame(), cellCount)); - DEBUG_LOG(("Attack Pathfind failed from (%f,%f) to (%f,%f) -- \n", from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); - DEBUG_LOG(("Unit '%s', attacking '%s' time %f\n", obj->getTemplate()->getName().str(), victim->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); + DEBUG_LOG(("Attack Pathfind failed from (%f,%f) to (%f,%f) -- ", from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); + DEBUG_LOG(("Unit '%s', attacking '%s' time %f", obj->getTemplate()->getName().str(), victim->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #endif #endif #ifdef DUMP_PERF_STATS @@ -11105,42 +11105,42 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor //----------------------------------------------------------------------------- void Pathfinder::crc( Xfer *xfer ) { - CRCDEBUG_LOG(("Pathfinder::crc() on frame %d\n", TheGameLogic->getFrame())); - CRCDEBUG_LOG(("beginning CRC: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("Pathfinder::crc() on frame %d", TheGameLogic->getFrame())); + CRCDEBUG_LOG(("beginning CRC: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferUser( &m_extent, sizeof(IRegion2D) ); - CRCDEBUG_LOG(("m_extent: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_extent: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferBool( &m_isMapReady ); - CRCDEBUG_LOG(("m_isMapReady: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_isMapReady: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferBool( &m_isTunneling ); - CRCDEBUG_LOG(("m_isTunneling: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_isTunneling: %8.8X", ((XferCRC *)xfer)->getCRC())); Int obsolete1 = 0; xfer->xferInt( &obsolete1 ); xfer->xferUser(&m_ignoreObstacleID, sizeof(ObjectID)); - CRCDEBUG_LOG(("m_ignoreObstacleID: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_ignoreObstacleID: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferUser(m_queuedPathfindRequests, sizeof(ObjectID)*PATHFIND_QUEUE_LEN); - CRCDEBUG_LOG(("m_queuedPathfindRequests: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_queuedPathfindRequests: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferInt(&m_queuePRHead); - CRCDEBUG_LOG(("m_queuePRHead: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_queuePRHead: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferInt(&m_queuePRTail); - CRCDEBUG_LOG(("m_queuePRTail: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_queuePRTail: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferInt(&m_numWallPieces); - CRCDEBUG_LOG(("m_numWallPieces: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_numWallPieces: %8.8X", ((XferCRC *)xfer)->getCRC())); for (Int i=0; ixferObjectID(&m_wallPieces[MAX_WALL_PIECES]); } - CRCDEBUG_LOG(("m_wallPieces: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_wallPieces: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferReal(&m_wallHeight); - CRCDEBUG_LOG(("m_wallHeight: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_wallHeight: %8.8X", ((XferCRC *)xfer)->getCRC())); xfer->xferInt(&m_cumulativeCellsAllocated); - CRCDEBUG_LOG(("m_cumulativeCellsAllocated: %8.8X\n", ((XferCRC *)xfer)->getCRC())); + CRCDEBUG_LOG(("m_cumulativeCellsAllocated: %8.8X", ((XferCRC *)xfer)->getCRC())); } // end crc diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp index 676380ca7c..9a87234574 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp @@ -164,7 +164,7 @@ void AIPlayer::onStructureProduced( Object *factory, Object *bldg ) if( rhbi ) { ObjectID spawnedID = rhbi->getReconstructedBuildingID(); if (bldg->getID() == spawnedID) { - DEBUG_LOG(("AI got rebuilt %s\n", bldgPlan->getName().str())); + DEBUG_LOG(("AI got rebuilt %s", bldgPlan->getName().str())); info->setObjectID(bldg->getID()); return; } @@ -175,7 +175,7 @@ void AIPlayer::onStructureProduced( Object *factory, Object *bldg ) } if (TheGameLogic->getFrame()>0) { - DEBUG_LOG(("***AI PLAYER-Structure not found in production queue.\n")); + DEBUG_LOG(("***AI PLAYER-Structure not found in production queue.")); } } @@ -335,7 +335,7 @@ void AIPlayer::queueSupplyTruck( void ) } } } - //DEBUG_LOG(("Expected %d harvesters, found %d, need %d\n", info->getDesiredGatherers(), + //DEBUG_LOG(("Expected %d harvesters, found %d, need %d", info->getDesiredGatherers(), // curGatherers, info->getDesiredGatherers()-curGatherers) ); info->setCurrentGatherers(curGatherers); } @@ -367,7 +367,7 @@ void AIPlayer::queueSupplyTruck( void ) // The supply truck ai issues dock commands, and they become confused. // Thus, player. jba. ;( obj->getAI()->aiDock(center, CMD_FROM_PLAYER); - DEBUG_LOG(("Re-attaching supply truck to supply center.\n")); + DEBUG_LOG(("Re-attaching supply truck to supply center.")); return; } } @@ -713,7 +713,7 @@ void AIPlayer::processBaseBuilding( void ) if (name.isEmpty()) continue; const ThingTemplate *bldgPlan = TheThingFactory->findTemplate( name ); if (!bldgPlan) { - DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.\n", name.str())); + DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.", name.str())); continue; } // check for hole. @@ -734,7 +734,7 @@ void AIPlayer::processBaseBuilding( void ) if( rhbi ) { ObjectID spawnerID = rhbi->getSpawnerID(); if (priorID == spawnerID) { - DEBUG_LOG(("AI Found hole to rebuild %s\n", bldgPlan->getName().str())); + DEBUG_LOG(("AI Found hole to rebuild %s", bldgPlan->getName().str())); info->setObjectID(obj->getID()); } } @@ -748,7 +748,7 @@ void AIPlayer::processBaseBuilding( void ) ObjectID builder = bldg->getBuilderID(); Object* myDozer = TheGameLogic->findObjectByID(builder); if (myDozer==NULL) { - DEBUG_LOG(("AI's Dozer got killed. Find another dozer.\n")); + DEBUG_LOG(("AI's Dozer got killed. Find another dozer.")); myDozer = findDozer(bldg->getPosition()); if (myDozer==NULL || myDozer->getAI()==NULL) { continue; @@ -772,7 +772,7 @@ void AIPlayer::processBaseBuilding( void ) if (info->getObjectTimestamp()+TheAI->getAiData()->m_rebuildDelaySeconds*LOGICFRAMES_PER_SECOND > TheGameLogic->getFrame()) { continue; } else { - DEBUG_LOG(("Enabling rebuild for %s\n", info->getTemplateName().str())); + DEBUG_LOG(("Enabling rebuild for %s", info->getTemplateName().str())); info->setObjectTimestamp(0); // ready to build. } } @@ -1136,7 +1136,7 @@ void AIPlayer::onUnitProduced( Object *factory, Object *unit ) } } if (!found) { - DEBUG_LOG(("***AI PLAYER-Unit not found in production queue.\n")); + DEBUG_LOG(("***AI PLAYER-Unit not found in production queue.")); } m_teamDelay = 0; // Cause the update queues & selection to happen immediately. @@ -1922,7 +1922,7 @@ void AIPlayer::buildBySupplies(Int minimumCash, const AsciiString& thingName) NULL, m_player ) == LBC_OK; if (valid) break; if( TheGlobalData->m_debugSupplyCenterPlacement ) - DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)\n", newPos.x, newPos.y)); + DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)", newPos.x, newPos.y)); newPos.y = yPos+posOffset; valid = TheBuildAssistant->isLocationLegalToBuild( &newPos, tTemplate, angle, BuildAssistant::CLEAR_PATH | @@ -1931,7 +1931,7 @@ void AIPlayer::buildBySupplies(Int minimumCash, const AsciiString& thingName) NULL, m_player ) == LBC_OK; if (valid) break; if( TheGlobalData->m_debugSupplyCenterPlacement ) - DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)\n", newPos.x, newPos.y)); + DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)", newPos.x, newPos.y)); } if (valid) break; xPos = location.x-offset; @@ -1945,7 +1945,7 @@ void AIPlayer::buildBySupplies(Int minimumCash, const AsciiString& thingName) NULL, m_player ) == LBC_OK; if (valid) break; if( TheGlobalData->m_debugSupplyCenterPlacement ) - DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)\n", newPos.x, newPos.y)); + DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)", newPos.x, newPos.y)); newPos.x = xPos+posOffset; valid = TheBuildAssistant->isLocationLegalToBuild( &newPos, tTemplate, angle, BuildAssistant::CLEAR_PATH | @@ -1954,7 +1954,7 @@ void AIPlayer::buildBySupplies(Int minimumCash, const AsciiString& thingName) NULL, m_player ) == LBC_OK; if (valid) break; if( TheGlobalData->m_debugSupplyCenterPlacement ) - DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)\n", newPos.x, newPos.y)); + DEBUG_LOG(("buildBySupplies -- Fail at (%.2f,%.2f)", newPos.x, newPos.y)); } if (valid) break; } @@ -1962,7 +1962,7 @@ void AIPlayer::buildBySupplies(Int minimumCash, const AsciiString& thingName) if (valid) { if( TheGlobalData->m_debugSupplyCenterPlacement ) - DEBUG_LOG(("buildAISupplyCenter -- SUCCESS at (%.2f,%.2f)\n", newPos.x, newPos.y)); + DEBUG_LOG(("buildAISupplyCenter -- SUCCESS at (%.2f,%.2f)", newPos.x, newPos.y)); location = newPos; } TheTerrainVisual->removeAllBibs(); // isLocationLegalToBuild adds bib feedback, turn it off. jba. @@ -2296,12 +2296,12 @@ void AIPlayer::repairStructure(ObjectID structure) Int i; for (i=0; igetID()) { - DEBUG_LOG(("info - Bridge already queued for repair.\n")); + DEBUG_LOG(("info - Bridge already queued for repair.")); return; } } if (m_structuresInQueue>=MAX_STRUCTURES_TO_REPAIR) { - DEBUG_LOG(("Structure repair queue is full, ignoring repair request. JBA\n")); + DEBUG_LOG(("Structure repair queue is full, ignoring repair request. JBA")); return; } m_structuresToRepair[m_structuresInQueue] = structureObj->getID(); @@ -2357,7 +2357,7 @@ void AIPlayer::updateBridgeRepair(void) m_repairDozer = dozer->getID(); m_repairDozerOrigin = *dozer->getPosition(); dozer->getAI()->aiRepair(bridgeObj, CMD_FROM_AI); - DEBUG_LOG(("Telling dozer to repair\n")); + DEBUG_LOG(("Telling dozer to repair")); m_dozerIsRepairing = true; return; } @@ -2382,7 +2382,7 @@ void AIPlayer::updateBridgeRepair(void) if (!dozerAI->isAnyTaskPending()) { // should be done repairing. if (bridgeState==BODY_PRISTINE) { - DEBUG_LOG(("Dozer finished repairing structure.\n")); + DEBUG_LOG(("Dozer finished repairing structure.")); // we're done. Int i; for (i=0; igetAI()->aiRepair(bridgeObj, CMD_FROM_AI); m_dozerIsRepairing = true; - DEBUG_LOG(("Telling dozer to repair\n")); + DEBUG_LOG(("Telling dozer to repair")); } // ------------------------------------------------------------------------------------------------ @@ -2606,7 +2606,7 @@ void AIPlayer::recruitSpecificAITeam(TeamPrototype *teamProto, Real recruitRadiu #if defined(RTS_DEBUG) Coord3D pos = *unit->getPosition(); Coord3D to = teamProto->getTemplateInfo()->m_homeLocation; - DEBUG_LOG(("Moving unit from %f,%f to %f,%f\n", pos.x, pos.y , to.x, to.y )); + DEBUG_LOG(("Moving unit from %f,%f to %f,%f", pos.x, pos.y , to.x, to.y )); #endif ai->aiMoveToPosition( &teamProto->getTemplateInfo()->m_homeLocation, CMD_FROM_AI); } @@ -3063,7 +3063,7 @@ void AIPlayer::newMap( void ) if (name.isEmpty()) continue; const ThingTemplate *bldgPlan = TheThingFactory->findTemplate( name ); if (!bldgPlan) { - DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.\n", name.str())); + DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.", name.str())); continue; } if (info->isInitiallyBuilt()) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp index 9eccc23c26..213613e32a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp @@ -113,7 +113,7 @@ void AISkirmishPlayer::processBaseBuilding( void ) if (name.isEmpty()) continue; const ThingTemplate *curPlan = TheThingFactory->findTemplate( name ); if (!curPlan) { - DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.\n", name.str())); + DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.", name.str())); continue; } bldg = TheGameLogic->findObjectByID( info->getObjectID() ); @@ -135,7 +135,7 @@ void AISkirmishPlayer::processBaseBuilding( void ) if( rhbi ) { ObjectID spawnerID = rhbi->getSpawnerID(); if (priorID == spawnerID) { - DEBUG_LOG(("AI Found hole to rebuild %s\n", curPlan->getName().str())); + DEBUG_LOG(("AI Found hole to rebuild %s", curPlan->getName().str())); info->setObjectID(obj->getID()); } } @@ -160,7 +160,7 @@ void AISkirmishPlayer::processBaseBuilding( void ) } if (myDozer==NULL) { - DEBUG_LOG(("AI's Dozer got killed (or captured). Find another dozer.\n")); + DEBUG_LOG(("AI's Dozer got killed (or captured). Find another dozer.")); queueDozer(); myDozer = findDozer(bldg->getPosition()); if (myDozer==NULL || myDozer->getAI()==NULL) { @@ -185,7 +185,7 @@ void AISkirmishPlayer::processBaseBuilding( void ) if (info->getObjectTimestamp()+TheAI->getAiData()->m_rebuildDelaySeconds*LOGICFRAMES_PER_SECOND > TheGameLogic->getFrame()) { continue; } else { - DEBUG_LOG(("Enabling rebuild for %s\n", info->getTemplateName().str())); + DEBUG_LOG(("Enabling rebuild for %s", info->getTemplateName().str())); info->setObjectTimestamp(0); // ready to build. } } @@ -243,7 +243,7 @@ void AISkirmishPlayer::processBaseBuilding( void ) if (!powerUnderConstruction) { bldgPlan = powerPlan; bldgInfo = powerInfo; - DEBUG_LOG(("Forcing build of power plant.\n")); + DEBUG_LOG(("Forcing build of power plant.")); } } if (bldgPlan && bldgInfo) { @@ -420,7 +420,7 @@ void AISkirmishPlayer::buildSpecificAIBuilding(const AsciiString &thingName) if (name.isEmpty()) continue; const ThingTemplate *bldgPlan = TheThingFactory->findTemplate( name ); if (!bldgPlan) { - DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.\n", name.str())); + DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.", name.str())); continue; } Object *bldg = TheGameLogic->findObjectByID( info->getObjectID() ); @@ -678,8 +678,8 @@ void AISkirmishPlayer::buildAIBaseDefenseStructure(const AsciiString &thingName, // TheSuperHackers @info helmutbuhler 21/04/2025 This debug mutates the code to become CRC incompatible #if defined(RTS_DEBUG) || !RETAIL_COMPATIBLE_CRC - DEBUG_LOG(("buildAIBaseDefenseStructure -- Angle is %f sin %f, cos %f \n", 180*angle/PI, s, c)); - DEBUG_LOG(("buildAIBaseDefenseStructure -- Offset is %f %f, Final Position is %f, %f \n", + DEBUG_LOG(("buildAIBaseDefenseStructure -- Angle is %f sin %f, cos %f ", 180*angle/PI, s, c)); + DEBUG_LOG(("buildAIBaseDefenseStructure -- Offset is %f %f, Final Position is %f, %f ", offset.x, offset.y, offset.x*c - offset.y*s, offset.y*c + offset.x*s @@ -811,7 +811,7 @@ void AISkirmishPlayer::recruitSpecificAITeam(TeamPrototype *teamProto, Real recr #if defined(RTS_DEBUG) Coord3D pos = *unit->getPosition(); Coord3D to = teamProto->getTemplateInfo()->m_homeLocation; - DEBUG_LOG(("Moving unit from %f,%f to %f,%f\n", pos.x, pos.y , to.x, to.y )); + DEBUG_LOG(("Moving unit from %f,%f to %f,%f", pos.x, pos.y , to.x, to.y )); #endif ai->aiMoveToPosition( &teamProto->getTemplateInfo()->m_homeLocation, CMD_FROM_AI); } @@ -984,7 +984,7 @@ void AISkirmishPlayer::adjustBuildList(BuildListInfo *list) } } if (!foundStart) { - DEBUG_LOG(("Couldn't find starting command center for ai player.\n")); + DEBUG_LOG(("Couldn't find starting command center for ai player.")); return; } // Find the location of the command center in the build list. @@ -1075,7 +1075,7 @@ void AISkirmishPlayer::newMap( void ) /* Get our proper build list. */ AsciiString mySide = m_player->getSide(); - DEBUG_LOG(("AI Player side is %s\n", mySide.str())); + DEBUG_LOG(("AI Player side is %s", mySide.str())); const AISideBuildList *build = TheAI->getAiData()->m_sideBuildLists; while (build) { if (build->m_side == mySide) { @@ -1096,7 +1096,7 @@ void AISkirmishPlayer::newMap( void ) if (name.isEmpty()) continue; const ThingTemplate *bldgPlan = TheThingFactory->findTemplate( name ); if (!bldgPlan) { - DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.\n", name.str())); + DEBUG_LOG(("*** ERROR - Build list building '%s' doesn't exist.", name.str())); continue; } if (info->isInitiallyBuilt()) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp index 609e8e6110..a95d4d89af 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp @@ -581,13 +581,13 @@ StateReturnType AIRappelState::update() { const FXList* fx = obj->getTemplate()->getPerUnitFX("CombatDropKillFX"); FXList::doFXObj(fx, bldg, NULL); - DEBUG_LOG(("Killing %d enemies in combat drop!\n",numKilled)); + DEBUG_LOG(("Killing %d enemies in combat drop!",numKilled)); } if (numKilled == MAX_TO_KILL) { obj->kill(); - DEBUG_LOG(("Killing SELF in combat drop!\n")); + DEBUG_LOG(("Killing SELF in combat drop!")); } else { @@ -875,7 +875,7 @@ StateReturnType AIStateMachine::updateStateMachine() //-extraLogging #if defined(RTS_DEBUG) if( !idle && TheGlobalData->m_extraLogging ) - DEBUG_LOG( (" - RETURN EARLY STATE_CONTINUE\n") ); + DEBUG_LOG( (" - RETURN EARLY STATE_CONTINUE") ); #endif //end -extraLogging @@ -907,7 +907,7 @@ StateReturnType AIStateMachine::updateStateMachine() break; } if( !idle ) - DEBUG_LOG( (" - RETURNING %s\n", result.str() ) ); + DEBUG_LOG( (" - RETURNING %s", result.str() ) ); } #endif //end -extraLogging @@ -938,9 +938,9 @@ StateReturnType AIStateMachine::setTemporaryState( StateID newStateID, Int frame DEBUG_LOG((" INVALID_STATE_ID ")); } if (newState) { - DEBUG_LOG(("enter '%s' \n", newState->getName().str())); + DEBUG_LOG(("enter '%s' ", newState->getName().str())); } else { - DEBUG_LOG(("to INVALID_STATE\n")); + DEBUG_LOG(("to INVALID_STATE")); } } #endif @@ -1101,7 +1101,7 @@ Bool outOfWeaponRangeObject( State *thisState, void* userData ) Object *victim = thisState->getMachineGoalObject(); Weapon *weapon = obj->getCurrentWeapon(); - CRCDEBUG_LOG(("outOfWeaponRangeObject()\n")); + CRCDEBUG_LOG(("outOfWeaponRangeObject()")); if (victim && weapon) { Bool viewBlocked = false; @@ -1134,14 +1134,14 @@ Bool outOfWeaponRangeObject( State *thisState, void* userData ) // A weapon with leech range temporarily has unlimited range and is locked onto its target. if (!weapon->hasLeechRange() && viewBlocked) { - //CRCDEBUG_LOG(("outOfWeaponRangeObject() - object %d (%s) view is blocked for attacking %d (%s)\n", + //CRCDEBUG_LOG(("outOfWeaponRangeObject() - object %d (%s) view is blocked for attacking %d (%s)", // obj->getID(), obj->getTemplate()->getName().str(), // victim->getID(), victim->getTemplate()->getName().str())); return true; } if (!weapon->hasLeechRange() && !weapon->isWithinAttackRange(obj, victim)) { - //CRCDEBUG_LOG(("outOfWeaponRangeObject() - object %d (%s) is out of range for attacking %d (%s)\n", + //CRCDEBUG_LOG(("outOfWeaponRangeObject() - object %d (%s) is out of range for attacking %d (%s)", // obj->getID(), obj->getTemplate()->getName().str(), // victim->getID(), victim->getTemplate()->getName().str())); return true; @@ -1818,7 +1818,7 @@ StateReturnType AIInternalMoveToState::update() blocked = true; m_blockedRepathTimestamp = TheGameLogic->getFrame(); // Intense debug logging jba. - //DEBUG_LOG(("Info - Blocked - recomputing.\n")); + //DEBUG_LOG(("Info - Blocked - recomputing.")); } //Determine if we are on a cliff cell... if so, use the climbing model condition @@ -1902,7 +1902,7 @@ StateReturnType AIInternalMoveToState::update() // Check if we have reached our destination // Real onPathDistToGoal = ai->getLocomotorDistanceToGoal(); - //DEBUG_LOG(("onPathDistToGoal = %f %s\n",onPathDistToGoal, obj->getTemplate()->getName().str())); + //DEBUG_LOG(("onPathDistToGoal = %f %s",onPathDistToGoal, obj->getTemplate()->getName().str())); if (ai->getCurLocomotor() && (onPathDistToGoal < ai->getCurLocomotor()->getCloseEnoughDist())) { if (ai->isDoingGroundMovement()) { @@ -1916,7 +1916,7 @@ StateReturnType AIInternalMoveToState::update() delta.y = obj->getPosition()->y - goalPos.y; delta.z = 0; if (delta.length() > 4*PATHFIND_CELL_SIZE_F) { - //DEBUG_LOG(("AIInternalMoveToState Trying to finish early. Continuing...\n")); + //DEBUG_LOG(("AIInternalMoveToState Trying to finish early. Continuing...")); onPathDistToGoal = ai->getLocomotorDistanceToGoal(); return STATE_CONTINUE; } @@ -2116,7 +2116,7 @@ StateReturnType AIMoveToState::update() m_goalPosition.y += dir.y*leadDistance; m_goalPosition.z += dir.z*leadDistance; } - //DEBUG_LOG(("update goal pos to %f %f %f\n",m_goalPosition.x,m_goalPosition.y,m_goalPosition.z)); + //DEBUG_LOG(("update goal pos to %f %f %f",m_goalPosition.x,m_goalPosition.y,m_goalPosition.z)); } else { Bool isMissile = obj->isKindOf(KINDOF_PROJECTILE); if (isMissile) { @@ -2267,7 +2267,7 @@ Bool AIMoveAndTightenState::computePath() ai->requestPath(&m_goalPosition, true); return true; } - //DEBUG_LOG(("AIMoveAndTightenState::computePath - stuck, failing.\n")); + //DEBUG_LOG(("AIMoveAndTightenState::computePath - stuck, failing.")); return false; // don't repath for now. jba. } return true; // just use the existing path. See above. @@ -2410,7 +2410,7 @@ Bool AIAttackApproachTargetState::computePath() if( getMachineOwner()->isMobile() == false ) return false; - //CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - begin for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - begin for object %d", getMachineOwner()->getID())); AIUpdateInterface *ai = getMachineOwner()->getAI(); @@ -2418,7 +2418,7 @@ Bool AIAttackApproachTargetState::computePath() { forceRepath = true; // Intense logging. jba - //CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - stuck, recomputing for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - stuck, recomputing for object %d", getMachineOwner()->getID())); } if (m_waitingForPath) return true; @@ -2431,7 +2431,7 @@ Bool AIAttackApproachTargetState::computePath() /// @todo Unify recomputation conditions & account for obj ID so everyone doesnt compute on the same frame (MSB) if (!forceRepath && TheGameLogic->getFrame() - m_approachTimestamp < MIN_RECOMPUTE_TIME) { - //CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because of min time for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because of min time for object %d", getMachineOwner()->getID())); return true; } @@ -2445,14 +2445,14 @@ Bool AIAttackApproachTargetState::computePath() // if our victim's position hasn't changed, don't re-path if (!forceRepath && isSamePosition(source->getPosition(), &m_prevVictimPos, getMachineGoalObject()->getPosition() )) { - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because victim in same place for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because victim in same place for object %d", getMachineOwner()->getID())); return true; } Weapon* weapon = source->getCurrentWeapon(); if (!weapon) { - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because of no weapon for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because of no weapon for object %d", getMachineOwner()->getID())); return false; } @@ -2478,11 +2478,11 @@ Bool AIAttackApproachTargetState::computePath() Coord3D pos; victim->getGeometryInfo().getCenterPosition( *victim->getPosition(), pos ); - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - requestAttackPath() for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - requestAttackPath() for object %d", getMachineOwner()->getID())); ai->requestAttackPath(victim->getID(), &pos ); m_stopIfInRange = false; // we have calculated a position to shoot from, so go there. - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing after repathing for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing after repathing for object %d", getMachineOwner()->getID())); return true; } else @@ -2493,18 +2493,18 @@ Bool AIAttackApproachTargetState::computePath() m_goalPosition = *getMachineGoalPosition(); if (!forceRepath) { - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because we're aiming for a fixed position for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing because we're aiming for a fixed position for object %d", getMachineOwner()->getID())); return true; // fixed positions don't move. } // must use computeAttackPath so that min ranges are considered. m_waitingForPath = true; ai->requestAttackPath(INVALID_ID, &m_goalPosition); - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing after repathing at a fixed position for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing after repathing at a fixed position for object %d", getMachineOwner()->getID())); return true; } - CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing at end of function for object %d\n", getMachineOwner()->getID())); + CRCDEBUG_LOG(("AIAttackApproachTargetState::computePath - bailing at end of function for object %d", getMachineOwner()->getID())); return true; } @@ -2551,7 +2551,7 @@ StateReturnType AIAttackApproachTargetState::onEnter() { // contained by AIAttackState, so no separate timer // urg. hacky. if we are a projectile, turn on precise z-pos. - //CRCDEBUG_LOG(("AIAttackApproachTargetState::onEnter() - object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::onEnter() - object %d", getMachineOwner()->getID())); Object* source = getMachineOwner(); AIUpdateInterface* ai = source->getAI(); if (source->isKindOf(KINDOF_PROJECTILE)) @@ -2645,7 +2645,7 @@ StateReturnType AIAttackApproachTargetState::onEnter() } // find a good spot to shoot from - //CRCDEBUG_LOG(("AIAttackApproachTargetState::onEnter() - calling computePath() for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::onEnter() - calling computePath() for object %d", getMachineOwner()->getID())); if (computePath() == false) return STATE_FAILURE; @@ -2659,7 +2659,7 @@ StateReturnType AIAttackApproachTargetState::onEnter() StateReturnType AIAttackApproachTargetState::updateInternal() { AIUpdateInterface* ai = getMachineOwner()->getAI(); - //CRCDEBUG_LOG(("AIAttackApproachTargetState::updateInternal() - object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::updateInternal() - object %d", getMachineOwner()->getID())); if (getMachine()->isGoalObjectDestroyed()) { ai->notifyVictimIsDead(); @@ -2706,7 +2706,7 @@ StateReturnType AIAttackApproachTargetState::updateInternal() } } // find a good spot to shoot from - //CRCDEBUG_LOG(("AIAttackApproachTargetState::updateInternal() - calling computePath() to victim for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::updateInternal() - calling computePath() to victim for object %d", getMachineOwner()->getID())); if (computePath() == false) return STATE_SUCCESS; code = AIInternalMoveToState::update(); @@ -2722,7 +2722,7 @@ StateReturnType AIAttackApproachTargetState::updateInternal() { // Attacking a position. // find a good spot to shoot from - //CRCDEBUG_LOG(("AIAttackApproachTargetState::updateInternal() - calling computePath() to position for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackApproachTargetState::updateInternal() - calling computePath() to position for object %d", getMachineOwner()->getID())); if (m_stopIfInRange && weapon && weapon->isWithinAttackRange(source, &m_goalPosition)) { Bool viewBlocked = false; @@ -2945,17 +2945,17 @@ StateReturnType AIAttackPursueTargetState::onEnter() if (source->isKindOf(KINDOF_PROJECTILE)) { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - is a projectile for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - is a projectile for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // Projectiles go directly to AIAttackApproachTargetState. } if (getMachine()->isGoalObjectDestroyed()) { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - goal object is destroyed for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - goal object is destroyed for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // Already killed victim. } if (!m_isAttackingObject) { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - not attacking for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - not attacking for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // only pursue objects - positions don't move. } @@ -2992,11 +2992,11 @@ StateReturnType AIAttackPursueTargetState::onEnter() } if (!canPursue(source, weapon, victim) ) { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - can't pursue for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - can't pursue for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; } } else { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - no victim for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - no victim for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // gotta have a victim. } // If we have a turret, start aiming. @@ -3005,7 +3005,7 @@ StateReturnType AIAttackPursueTargetState::onEnter() { ai->setTurretTargetObject(tur, victim, m_isForceAttacking); } else { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - no turret for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onEnter() - no turret for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // we only pursue with turrets, as non-turreted weapons can't fire on the run. } @@ -3045,7 +3045,7 @@ StateReturnType AIAttackPursueTargetState::updateInternal() code = AIInternalMoveToState::update(); if (code != STATE_CONTINUE) { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::updateInternal() - failed internal update() for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::updateInternal() - failed internal update() for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // Always return state success, as state failure exits the attack. // we may need to aim & do another approach if the target moved. jba. } @@ -3056,7 +3056,7 @@ StateReturnType AIAttackPursueTargetState::updateInternal() WhichTurretType tur = ai->getWhichTurretForCurWeapon(); if (tur == TURRET_INVALID) { - //CRCDEBUG_LOG(("AIAttackPursueTargetState::updateInternal() - no turret for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::updateInternal() - no turret for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); return STATE_SUCCESS; // We currently only pursue with a turret weapon. } @@ -3079,7 +3079,7 @@ StateReturnType AIAttackPursueTargetState::updateInternal() } ai->setDesiredSpeed(victimSpeed); // Really intense debug info. jba. - // DEBUG_LOG(("VS %f, OS %f, goal %f\n", victim->getPhysics()->getForwardSpeed2D(), source->getPhysics()->getForwardSpeed2D(), victimSpeed)); + // DEBUG_LOG(("VS %f, OS %f, goal %f", victim->getPhysics()->getForwardSpeed2D(), source->getPhysics()->getForwardSpeed2D(), victimSpeed)); } else { ai->setDesiredSpeed(FAST_AS_POSSIBLE); } @@ -3116,7 +3116,7 @@ StateReturnType AIAttackPursueTargetState::update() void AIAttackPursueTargetState::onExit( StateExitType status ) { // contained by AIAttackState, so no separate timer - //CRCDEBUG_LOG(("AIAttackPursueTargetState::onExit() for object %d (%s)\n", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); + //CRCDEBUG_LOG(("AIAttackPursueTargetState::onExit() for object %d (%s)", getMachineOwner()->getID(), getMachineOwner()->getTemplate()->getName().str())); AIInternalMoveToState::onExit( status ); m_isInitialApproach = false; // We only want to allow turreted things to fire at enemies during their @@ -3667,7 +3667,7 @@ StateReturnType AIAttackMoveToState::update() if (distSqr < sqr(ATTACK_CLOSE_ENOUGH_CELLS*PATHFIND_CELL_SIZE_F)) { return ret; } - DEBUG_LOG(("AIAttackMoveToState::update Distance from goal %f, retrying.\n", sqrt(distSqr))); + DEBUG_LOG(("AIAttackMoveToState::update Distance from goal %f, retrying.", sqrt(distSqr))); ret = STATE_CONTINUE; m_retryCount--; @@ -4073,7 +4073,7 @@ StateReturnType AIFollowWaypointPathState::onEnter() setAdjustsDestination(ai->isDoingGroundMovement()); if (getAdjustsDestination()) { if (!TheAI->pathfinder()->adjustDestination(getMachineOwner(), ai->getLocomotorSet(), &m_goalPosition)) { - DEBUG_LOG(("Breaking out of follow waypoint path\n")); + DEBUG_LOG(("Breaking out of follow waypoint path")); return STATE_FAILURE; } TheAI->pathfinder()->updateGoal(getMachineOwner(), &m_goalPosition, m_goalLayer); @@ -4086,7 +4086,7 @@ StateReturnType AIFollowWaypointPathState::onEnter() } } if (ret != STATE_CONTINUE) { - DEBUG_LOG(("Breaking out of follow waypoint path\n")); + DEBUG_LOG(("Breaking out of follow waypoint path")); } return ret; } @@ -4146,7 +4146,7 @@ StateReturnType AIFollowWaypointPathState::update() if (m_currentWaypoint) { // TheSuperHackers @info helmutbuhler 05/05/2025 This debug mutates the code to become CRC incompatible #if defined(RTS_DEBUG) || !RETAIL_COMPATIBLE_CRC - DEBUG_LOG(("Breaking out of follow waypoint path %s of %s\n", + DEBUG_LOG(("Breaking out of follow waypoint path %s of %s", m_currentWaypoint->getName().str(), m_currentWaypoint->getPathLabel1().str())); #endif } @@ -4223,7 +4223,7 @@ StateReturnType AIFollowWaypointPathState::update() if (m_currentWaypoint) { // TheSuperHackers @info helmutbuhler 05/05/2025 This debug mutates the code to become CRC incompatible #if defined(RTS_DEBUG) || !RETAIL_COMPATIBLE_CRC - DEBUG_LOG(("Breaking out of follow waypoint path %s of %s\n", + DEBUG_LOG(("Breaking out of follow waypoint path %s of %s", m_currentWaypoint->getName().str(), m_currentWaypoint->getPathLabel1().str())); #endif } @@ -4239,7 +4239,7 @@ StateReturnType AIFollowWaypointPathState::update() return STATE_CONTINUE; } if (status != STATE_CONTINUE) { - DEBUG_LOG(("Breaking out of follow waypoint path\n")); + DEBUG_LOG(("Breaking out of follow waypoint path")); } return status; } @@ -5068,7 +5068,7 @@ StateReturnType AIAttackAimAtTargetState::update() aimDelta = REL_THRESH; } - //DEBUG_LOG(("AIM: desired %f, actual %f, delta %f, aimDelta %f, goalpos %f %f\n",rad2deg(obj->getOrientation() + relAngle),rad2deg(obj->getOrientation()),rad2deg(relAngle),rad2deg(aimDelta),victim->getPosition()->x,victim->getPosition()->y)); + //DEBUG_LOG(("AIM: desired %f, actual %f, delta %f, aimDelta %f, goalpos %f %f",rad2deg(obj->getOrientation() + relAngle),rad2deg(obj->getOrientation()),rad2deg(relAngle),rad2deg(aimDelta),victim->getPosition()->x,victim->getPosition()->y)); if (m_canTurnInPlace) { if (fabs(relAngle) > aimDelta) @@ -5373,7 +5373,7 @@ AIAttackState::AIAttackState( StateMachine *machine, Bool follow, Bool attacking m_originalVictimPos.zero(); #ifdef STATE_MACHINE_DEBUG if (machine->getWantsDebugOutput()) { - DEBUG_LOG(("Creating attack state follow %d, attacking object %d, force attacking %d\n", + DEBUG_LOG(("Creating attack state follow %d, attacking object %d, force attacking %d", follow, attackingObject, forceAttacking)); } #endif @@ -5499,7 +5499,7 @@ DECLARE_PERF_TIMER(AIAttackState) StateReturnType AIAttackState::onEnter() { USE_PERF_TIMER(AIAttackState) - //CRCDEBUG_LOG(("AIAttackState::onEnter() - start for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackState::onEnter() - start for object %d", getMachineOwner()->getID())); Object* source = getMachineOwner(); AIUpdateInterface *ai = source->getAI(); // if we are in sleep mode, we will not attack @@ -5524,7 +5524,7 @@ StateReturnType AIAttackState::onEnter() return STATE_FAILURE; // create new state machine for attack behavior - //CRCDEBUG_LOG(("AIAttackState::onEnter() - constructing state machine for object %d\n", getMachineOwner()->getID())); + //CRCDEBUG_LOG(("AIAttackState::onEnter() - constructing state machine for object %d", getMachineOwner()->getID())); m_attackMachine = newInstance(AttackStateMachine)(source, this, "AIAttackMachine", m_follow, m_isAttackingObject, m_isForceAttacking ); #ifdef STATE_MACHINE_DEBUG @@ -6103,7 +6103,7 @@ StateReturnType AIDockState::onEnter() if (dockWithMe == NULL) { // we have nothing to dock with! - DEBUG_LOG(("No goal in AIDockState::onEnter - exiting.\n")); + DEBUG_LOG(("No goal in AIDockState::onEnter - exiting.")); return STATE_FAILURE; } DockUpdateInterface *dock = NULL; @@ -6111,7 +6111,7 @@ StateReturnType AIDockState::onEnter() // if we have nothing to dock with, fail if (dock == NULL) { - DEBUG_LOG(("Goal is not a dock in AIDockState::onEnter - exiting.\n")); + DEBUG_LOG(("Goal is not a dock in AIDockState::onEnter - exiting.")); return STATE_FAILURE; } @@ -6143,7 +6143,7 @@ void AIDockState::onExit( StateExitType status ) deleteInstance(m_dockMachine); m_dockMachine = NULL; } else { - DEBUG_LOG(("Dock exited immediately\n")); + DEBUG_LOG(("Dock exited immediately")); } // stop ignoring our goal object @@ -6174,10 +6174,10 @@ StateReturnType AIDockState::update() { ai->setCanPathThroughUnits(true); //if (ai->isBlockedAndStuck()) { - //DEBUG_LOG(("Blocked and stuck.\n")); + //DEBUG_LOG(("Blocked and stuck.")); //} //if (ai->getNumFramesBlocked()>5) { - //DEBUG_LOG(("Blocked %d frames\n", ai->getNumFramesBlocked())); + //DEBUG_LOG(("Blocked %d frames", ai->getNumFramesBlocked())); //} } /* @@ -6736,7 +6736,7 @@ void AIGuardState::onExit( StateExitType status ) //---------------------------------------------------------------------------------------------------------- StateReturnType AIGuardState::update() { - //DEBUG_LOG(("AIGuardState frame %d: %08lx\n",TheGameLogic->getFrame(),getMachineOwner())); + //DEBUG_LOG(("AIGuardState frame %d: %08lx",TheGameLogic->getFrame(),getMachineOwner())); if (m_guardMachine == NULL) { @@ -6883,7 +6883,7 @@ void AIGuardRetaliateState::onExit( StateExitType status ) //---------------------------------------------------------------------------------------------------------- StateReturnType AIGuardRetaliateState::update() { - //DEBUG_LOG(("AIGuardRetaliateState frame %d: %08lx\n",TheGameLogic->getFrame(),getMachineOwner())); + //DEBUG_LOG(("AIGuardRetaliateState frame %d: %08lx",TheGameLogic->getFrame(),getMachineOwner())); if (m_guardRetaliateMachine == NULL) { @@ -7014,7 +7014,7 @@ void AITunnelNetworkGuardState::onExit( StateExitType status ) //---------------------------------------------------------------------------------------------------------- StateReturnType AITunnelNetworkGuardState::update() { - //DEBUG_LOG(("AITunnelNetworkGuardState frame %d: %08lx\n",TheGameLogic->getFrame(),getMachineOwner())); + //DEBUG_LOG(("AITunnelNetworkGuardState frame %d: %08lx",TheGameLogic->getFrame(),getMachineOwner())); if (m_guardMachine == NULL) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AITNGuard.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AITNGuard.cpp index 67515d0840..d933796b4d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AITNGuard.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AITNGuard.cpp @@ -325,7 +325,7 @@ StateReturnType AITNGuardInnerState::onEnter( void ) Object* nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()) ; if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardInnerState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardInnerState.")); return STATE_SUCCESS; } m_exitConditions.m_attackGiveUpFrame = TheGameLogic->getFrame() + TheAI->getAiData()->m_guardChaseUnitFrames; @@ -469,7 +469,7 @@ StateReturnType AITNGuardOuterState::onEnter( void ) Object* nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()) ; if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardOuterState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardOuterState.")); return STATE_SUCCESS; } @@ -676,7 +676,7 @@ StateReturnType AITNGuardIdleState::onEnter( void ) //-------------------------------------------------------------------------------------- StateReturnType AITNGuardIdleState::update( void ) { - //DEBUG_LOG(("AITNGuardIdleState frame %d: %08lx\n",TheGameLogic->getFrame(),getMachineOwner())); + //DEBUG_LOG(("AITNGuardIdleState frame %d: %08lx",TheGameLogic->getFrame(),getMachineOwner())); UnsignedInt now = TheGameLogic->getFrame(); if (now < m_nextEnemyScanTime) @@ -704,7 +704,7 @@ StateReturnType AITNGuardIdleState::update( void ) Object *nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()); if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardAttackAggressorState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardAttackAggressorState.")); return STATE_SLEEP(0); } if (getMachineOwner()->getContainedBy()) { @@ -793,7 +793,7 @@ StateReturnType AITNGuardAttackAggressorState::onEnter( void ) Object *nemesis = TheGameLogic->findObjectByID(getGuardMachine()->getNemesisID()); if (nemesis == NULL) { - DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardAttackAggressorState.\n")); + DEBUG_LOG(("Unexpected NULL nemesis in AITNGuardAttackAggressorState.")); return STATE_SUCCESS; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp index e01105498d..12f61d32bf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp @@ -696,7 +696,7 @@ UpdateSleepTime TurretAI::updateTurretAI() return UPDATE_SLEEP(m_sleepUntil - now); } - //DEBUG_LOG(("updateTurretAI frame %d: %08lx\n",TheGameLogic->getFrame(),getOwner())); + //DEBUG_LOG(("updateTurretAI frame %d: %08lx",TheGameLogic->getFrame(),getOwner())); UpdateSleepTime subMachineSleep = UPDATE_SLEEP_FOREVER; // assume the best! // either we don't care about continuous fire stuff, or we care, but time has elapsed @@ -962,7 +962,7 @@ StateReturnType TurretAIAimTurretState::onEnter() */ StateReturnType TurretAIAimTurretState::update() { - //DEBUG_LOG(("TurretAIAimTurretState frame %d: %08lx\n",TheGameLogic->getFrame(),getTurretAI()->getOwner())); + //DEBUG_LOG(("TurretAIAimTurretState frame %d: %08lx",TheGameLogic->getFrame(),getTurretAI()->getOwner())); TurretAI* turret = getTurretAI(); Object* obj = turret->getOwner(); @@ -1220,7 +1220,7 @@ StateReturnType TurretAIRecenterTurretState::onEnter() StateReturnType TurretAIRecenterTurretState::update() { - //DEBUG_LOG(("TurretAIRecenterTurretState frame %d: %08lx\n",TheGameLogic->getFrame(),getTurretAI()->getOwner())); + //DEBUG_LOG(("TurretAIRecenterTurretState frame %d: %08lx",TheGameLogic->getFrame(),getTurretAI()->getOwner())); if( getMachineOwner()->testStatus( OBJECT_STATUS_UNDER_CONSTRUCTION)) @@ -1304,7 +1304,7 @@ StateReturnType TurretAIIdleState::onEnter() //---------------------------------------------------------------------------------------------------------- StateReturnType TurretAIIdleState::update() { - //DEBUG_LOG(("TurretAIIdleState frame %d: %08lx\n",TheGameLogic->getFrame(),getTurretAI()->getOwner())); + //DEBUG_LOG(("TurretAIIdleState frame %d: %08lx",TheGameLogic->getFrame(),getTurretAI()->getOwner())); UnsignedInt now = TheGameLogic->getFrame(); if (now >= m_nextIdleScan) @@ -1375,7 +1375,7 @@ StateReturnType TurretAIIdleScanState::onEnter() StateReturnType TurretAIIdleScanState::update() { - //DEBUG_LOG(("TurretAIIdleScanState frame %d: %08lx\n",TheGameLogic->getFrame(),getTurretAI()->getOwner())); + //DEBUG_LOG(("TurretAIIdleScanState frame %d: %08lx",TheGameLogic->getFrame(),getTurretAI()->getOwner())); if( getMachineOwner()->testStatus( OBJECT_STATUS_UNDER_CONSTRUCTION)) return STATE_CONTINUE;//ML so that under-construction base-defenses do not idle-scan while under construction @@ -1449,7 +1449,7 @@ void TurretAIHoldTurretState::onExit( StateExitType status ) StateReturnType TurretAIHoldTurretState::update() { - //DEBUG_LOG(("TurretAIHoldTurretState frame %d: %08lx\n",TheGameLogic->getFrame(),getTurretAI()->getOwner())); + //DEBUG_LOG(("TurretAIHoldTurretState frame %d: %08lx",TheGameLogic->getFrame(),getTurretAI()->getOwner())); if (TheGameLogic->getFrame() >= m_timestamp) return STATE_SUCCESS; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/PolygonTrigger.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/PolygonTrigger.cpp index a0878a76b4..2662ad0acd 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/PolygonTrigger.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/PolygonTrigger.cpp @@ -191,7 +191,7 @@ Bool PolygonTrigger::ParsePolygonTriggersDataChunk(DataChunkInput &file, DataChu pTrig->addPoint(loc); } if (numPoints<2) { - DEBUG_LOG(("Deleting polygon trigger '%s' with %d points.\n", + DEBUG_LOG(("Deleting polygon trigger '%s' with %d points.", pTrig->getTriggerName().str(), numPoints)); deleteInstance(pTrig); continue; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp index 76cb4286c3..dc20bba141 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp @@ -466,9 +466,9 @@ static Bool ParseTeamsDataChunk(DataChunkInput &file, DataChunkInfo *info, void if (sides->findSkirmishSideInfo(player)) { // player exists, so just add it. sides->addSkirmishTeam(&teamDict); - //DEBUG_LOG(("Adding team %s\n", teamName.str())); + //DEBUG_LOG(("Adding team %s", teamName.str())); } else { - //DEBUG_LOG(("Couldn't add team %s, no player %s\n", teamName.str(), player.str())); + //DEBUG_LOG(("Couldn't add team %s, no player %s", teamName.str(), player.str())); } } DEBUG_ASSERTCRASH(file.atEndOfChunk(), ("Unexpected data left over.")); @@ -517,7 +517,7 @@ void SidesList::prepareForMP_or_Skirmish(void) } if (!gotScripts) { AsciiString path = "data\\Scripts\\SkirmishScripts.scb"; - DEBUG_LOG(("Skirmish map using standard scripts\n")); + DEBUG_LOG(("Skirmish map using standard scripts")); m_skirmishTeamrec.clear(); CachedFileInputStream theInputStream; if (theInputStream.open(path)) { @@ -527,7 +527,7 @@ void SidesList::prepareForMP_or_Skirmish(void) file.registerParser( AsciiString("ScriptsPlayers"), AsciiString::TheEmptyString, ParsePlayersDataChunk ); file.registerParser( AsciiString("ScriptTeams"), AsciiString::TheEmptyString, ParseTeamsDataChunk ); if (!file.parse(this)) { - DEBUG_LOG(("ERROR - Unable to read in skirmish scripts.\n")); + DEBUG_LOG(("ERROR - Unable to read in skirmish scripts.")); return; } ScriptList *scripts[MAX_PLAYER_COUNT]; @@ -771,7 +771,7 @@ Bool SidesList::validateSides() } else { - DEBUG_LOG(("*** default team for player %s missing (should not be possible), adding it...\n",tname.str())); + DEBUG_LOG(("*** default team for player %s missing (should not be possible), adding it...",tname.str())); Dict d; d.setAsciiString(TheKey_teamName, tname); d.setAsciiString(TheKey_teamOwner, pname); @@ -787,14 +787,14 @@ Bool SidesList::validateSides() // (note that owners can be teams or players, but allies/enemies can only be teams.) if (validateAllyEnemyList(pname, allies)) { - DEBUG_LOG(("bad allies...\n")); + DEBUG_LOG(("bad allies...")); pdict->setAsciiString(TheKey_playerAllies, allies); modified = true; } if (validateAllyEnemyList(pname, enemies)) { - DEBUG_LOG(("bad enemies...\n")); + DEBUG_LOG(("bad enemies...")); pdict->setAsciiString(TheKey_playerEnemies, enemies); modified = true; } @@ -824,7 +824,7 @@ Bool SidesList::validateSides() SidesInfo* si = findSideInfo(towner); if (si == NULL || towner == tname) { - DEBUG_LOG(("bad owner %s; reparenting to neutral...\n",towner.str())); + DEBUG_LOG(("bad owner %s; reparenting to neutral...",towner.str())); tdict->setAsciiString(TheKey_teamOwner, AsciiString::TheEmptyString); modified = true; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index 170245f3f8..6ec87f1985 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -856,7 +856,7 @@ Drawable *Bridge::pickBridge(const Vector3 &from, const Vector3 &to, Vector3 *po if (isPointOnBridge(&loc)) { *pos = intersectPos; - //DEBUG_LOG(("Picked bridge %.2f, %.2f, %.2f\n", intersectPos.X, intersectPos.Y, intersectPos.Z)); + //DEBUG_LOG(("Picked bridge %.2f, %.2f, %.2f", intersectPos.X, intersectPos.Y, intersectPos.Z)); Object *bridge = TheGameLogic->findObjectByID(m_bridgeInfo.bridgeObjectID); if (bridge) { return bridge->getDrawable(); @@ -1304,9 +1304,9 @@ Bool TerrainLogic::loadMap( AsciiString filename, Bool query ) } else { DEBUG_LOG(("No links.")); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } - DEBUG_LOG(("Total of %d waypoints.\n", count)); + DEBUG_LOG(("Total of %d waypoints.", count)); #endif if (!query) { @@ -1586,7 +1586,7 @@ Waypoint *TerrainLogic::getClosestWaypointOnPath( const Coord3D *pos, AsciiStrin Real distSqr = 0; Waypoint *pClosestWay = NULL; if (label.isEmpty()) { - DEBUG_LOG(("***Warning - asking for empty path label.\n")); + DEBUG_LOG(("***Warning - asking for empty path label.")); return NULL; } @@ -1617,7 +1617,7 @@ Waypoint *TerrainLogic::getClosestWaypointOnPath( const Coord3D *pos, AsciiStrin Bool TerrainLogic::isPurposeOfPath( Waypoint *pWay, AsciiString label ) { if (label.isEmpty() || pWay==NULL) { - DEBUG_LOG(("***Warning - asking for empth path label.\n")); + DEBUG_LOG(("***Warning - asking for empth path label.")); return false; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/AutoHealBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/AutoHealBehavior.cpp index ede703e467..25f28bcaa4 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/AutoHealBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/AutoHealBehavior.cpp @@ -194,7 +194,7 @@ UpdateSleepTime AutoHealBehavior::update( void ) return UPDATE_SLEEP_FOREVER; } -//DEBUG_LOG(("doing auto heal %d\n",TheGameLogic->getFrame())); +//DEBUG_LOG(("doing auto heal %d",TheGameLogic->getFrame())); if( d->m_affectsWholePlayer ) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp index a186fc683b..252d95a1fb 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp @@ -308,7 +308,7 @@ static Bool calcTrajectory( } } -//DEBUG_LOG(("took %d loops to find a match\n",numLoops)); +//DEBUG_LOG(("took %d loops to find a match",numLoops)); if (exactTarget) return true; @@ -470,7 +470,7 @@ Bool DumbProjectileBehavior::projectileHandleCollision( Object *other ) // if it's not the specific thing we were targeting, see if we should incidentally collide... if (!m_detonationWeaponTmpl->shouldProjectileCollideWith(projectileLauncher, getObject(), other, m_victimID)) { - //DEBUG_LOG(("ignoring projectile collision with %s at frame %d\n",other->getTemplate()->getName().str(),TheGameLogic->getFrame())); + //DEBUG_LOG(("ignoring projectile collision with %s at frame %d",other->getTemplate()->getName().str(),TheGameLogic->getFrame())); return true; } @@ -490,7 +490,7 @@ Bool DumbProjectileBehavior::projectileHandleCollision( Object *other ) Object* thingToKill = *it++; if (!thingToKill->isEffectivelyDead() && thingToKill->isKindOfMulti(d->m_garrisonHitKillKindof, d->m_garrisonHitKillKindofNot)) { - //DEBUG_LOG(("Killed a garrisoned unit (%08lx %s) via Flash-Bang!\n",thingToKill,thingToKill->getTemplate()->getName().str())); + //DEBUG_LOG(("Killed a garrisoned unit (%08lx %s) via Flash-Bang!",thingToKill,thingToKill->getTemplate()->getName().str())); if (projectileLauncher) projectileLauncher->scoreTheKill( thingToKill ); thingToKill->kill(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp index cb24d4afee..87f1e83d4d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp @@ -1334,7 +1334,7 @@ void FlightDeckBehavior::exitObjectViaDoor( Object *newObj, ExitDoorType exitDoo DUMPMATRIX3D(getObject()->getTransformMatrix()); DUMPCOORD3D(getObject()->getPosition()); - CRCDEBUG_LOG(("Produced at hangar (door = %d)\n", exitDoor)); + CRCDEBUG_LOG(("Produced at hangar (door = %d)", exitDoor)); DEBUG_ASSERTCRASH(exitDoor != DOOR_NONE_NEEDED, ("Hmm, unlikely")); if (!reserveSpace(newObj->getID(), parkingOffset, &ppinfo)) //&loc, &orient, NULL, NULL, NULL, NULL, &hangarInternal, &hangOrient)) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp index 370c6bf2e8..81cc84d551 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp @@ -220,7 +220,7 @@ UpdateSleepTime MinefieldBehavior::update() if (TheGameLogic->findObjectByID(m_immunes[i].id) == NULL || now > m_immunes[i].collideTime + 2) { - //DEBUG_LOG(("expiring an immunity %d\n",m_immunes[i].id)); + //DEBUG_LOG(("expiring an immunity %d",m_immunes[i].id)); m_immunes[i].id = INVALID_ID; // he's dead, jim. m_immunes[i].collideTime = 0; } @@ -355,7 +355,7 @@ void MinefieldBehavior::onCollide( Object *other, const Coord3D *loc, const Coor { if (m_immunes[i].id == other->getID()) { - //DEBUG_LOG(("ignoring due to immunity %d\n",m_immunes[i].id)); + //DEBUG_LOG(("ignoring due to immunity %d",m_immunes[i].id)); m_immunes[i].collideTime = now; return; } @@ -395,7 +395,7 @@ void MinefieldBehavior::onCollide( Object *other, const Coord3D *loc, const Coor { if (m_immunes[i].id == INVALID_ID || m_immunes[i].id == other->getID()) { - //DEBUG_LOG(("add/update immunity %d\n",m_immunes[i].id)); + //DEBUG_LOG(("add/update immunity %d",m_immunes[i].id)); m_immunes[i].id = other->getID(); m_immunes[i].collideTime = now; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp index efcd9be367..fed2ffbb38 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp @@ -770,7 +770,7 @@ void ParkingPlaceBehavior::exitObjectViaDoor( Object *newObj, ExitDoorType exitD DUMPCOORD3D(getObject()->getPosition()); if (producedAtHelipad) { - CRCDEBUG_LOG(("Produced at helipad (door = %d)\n", exitDoor)); + CRCDEBUG_LOG(("Produced at helipad (door = %d)", exitDoor)); DEBUG_ASSERTCRASH(exitDoor == DOOR_NONE_NEEDED, ("Hmm, unlikely")); Matrix3D mtx; #ifdef DEBUG_CRASHING @@ -785,7 +785,7 @@ void ParkingPlaceBehavior::exitObjectViaDoor( Object *newObj, ExitDoorType exitD } else { - CRCDEBUG_LOG(("Produced at hangar (door = %d)\n", exitDoor)); + CRCDEBUG_LOG(("Produced at hangar (door = %d)", exitDoor)); DEBUG_ASSERTCRASH(exitDoor != DOOR_NONE_NEEDED, ("Hmm, unlikely")); if (!reserveSpace(newObj->getID(), parkingOffset, &ppinfo)) //&loc, &orient, NULL, NULL, NULL, NULL, &hangarInternal, &hangOrient)) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp index cbfca00cbc..7a68963d29 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp @@ -377,7 +377,7 @@ void SlowDeathBehavior::doPhaseStuff(SlowDeathPhaseType sdphase) //------------------------------------------------------------------------------------------------- UpdateSleepTime SlowDeathBehavior::update() { - //DEBUG_LOG(("updating SlowDeathBehavior %08lx\n",this)); + //DEBUG_LOG(("updating SlowDeathBehavior %08lx",this)); DEBUG_ASSERTCRASH(isSlowDeathActivated(), ("hmm, this should not be possible")); const SlowDeathBehaviorModuleData* d = getSlowDeathBehaviorModuleData(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp index 9488e48806..7681176f88 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp @@ -224,7 +224,7 @@ void OpenContain::addOrRemoveObjFromWorld(Object* obj, Bool add) // check for it here and print a warning // if( obj->isKindOf( KINDOF_STRUCTURE ) ) - DEBUG_LOG(( "WARNING: Containing/Removing structures like '%s' is potentially a very expensive and slow operation\n", + DEBUG_LOG(( "WARNING: Containing/Removing structures like '%s' is potentially a very expensive and slow operation", obj->getTemplate()->getName().str() )); @@ -322,7 +322,7 @@ void OpenContain::addToContain( Object *rider ) if( rider->getContainedBy() != NULL ) { - DEBUG_LOG(( "'%s' is trying to contain '%s', but '%s' is already contained by '%s'\n", + DEBUG_LOG(( "'%s' is trying to contain '%s', but '%s' is already contained by '%s'", getObject()->getTemplate()->getName().str(), rider->getTemplate()->getName().str(), rider->getTemplate()->getName().str(), @@ -389,7 +389,7 @@ void OpenContain::removeFromContain( Object *rider, Bool exposeStealthUnits ) if( containedBy != getObject() ) { - DEBUG_LOG(( "'%s' is trying to un-contain '%s', but '%s' is really contained by '%s'\n", + DEBUG_LOG(( "'%s' is trying to un-contain '%s', but '%s' is really contained by '%s'", getObject()->getTemplate()->getName().str(), rider->getTemplate()->getName().str(), rider->getTemplate()->getName().str(), diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp index 4fb6b187ee..4e2e8cb1c4 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp @@ -173,7 +173,7 @@ void ParachuteContain::updateBonePositions() m_paraAttachBone.zero(); } } - //DEBUG_LOG(("updating para bone positions %d...\n",TheGameLogic->getFrame())); + //DEBUG_LOG(("updating para bone positions %d...",TheGameLogic->getFrame())); } if (m_needToUpdateRiderBones) @@ -187,13 +187,13 @@ void ParachuteContain::updateBonePositions() { if (riderDraw->getPristineBonePositions( "PARA_MAN", 0, &m_riderAttachBone, NULL, 1) != 1) { - //DEBUG_LOG(("*** No parachute-attach bone... using object height!\n")); + //DEBUG_LOG(("*** No parachute-attach bone... using object height!")); m_riderAttachBone.zero(); m_riderAttachBone.z += riderDraw->getDrawableGeometryInfo().getMaxHeightAbovePosition(); } } - //DEBUG_LOG(("updating rider bone positions %d...\n",TheGameLogic->getFrame())); + //DEBUG_LOG(("updating rider bone positions %d...",TheGameLogic->getFrame())); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp index 51022c0061..f104875522 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp @@ -406,19 +406,19 @@ void LocomotorTemplate::validate() if (m_maxSpeed <= 0.0f) { // if one of these was omitted, it defaults to zero... just quietly heal it here, rather than crashing - DEBUG_LOG(("THRUST locos may not have zero m_maxSpeed; healing...\n")); + DEBUG_LOG(("THRUST locos may not have zero m_maxSpeed; healing...")); m_maxSpeed = 0.01f; } if (m_maxSpeedDamaged <= 0.0f) { // if one of these was omitted, it defaults to zero... just quietly heal it here, rather than crashing - DEBUG_LOG(("THRUST locos may not have zero m_maxSpeedDamaged; healing...\n")); + DEBUG_LOG(("THRUST locos may not have zero m_maxSpeedDamaged; healing...")); m_maxSpeedDamaged = 0.01f; } if (m_minSpeed <= 0.0f) { // if one of these was omitted, it defaults to zero... just quietly heal it here, rather than crashing - DEBUG_LOG(("THRUST locos may not have zero m_minSpeed; healing...\n")); + DEBUG_LOG(("THRUST locos may not have zero m_minSpeed; healing...")); m_minSpeed = 0.01f; } } @@ -1240,7 +1240,7 @@ void Locomotor::moveTowardsPositionTreads(Object* obj, PhysicsBehavior *physics, } - //DEBUG_LOG(("Actual speed %f, Braking factor %f, slowDownDist %f, Pathdist %f, goalSpeed %f\n", + //DEBUG_LOG(("Actual speed %f, Braking factor %f, slowDownDist %f, Pathdist %f, goalSpeed %f", // actualSpeed, m_brakingFactor, slowDownDist, onPathDistToGoal, goalSpeed)); // @@ -1449,7 +1449,7 @@ void Locomotor::moveTowardsPositionWheels(Object* obj, PhysicsBehavior *physics, } - //DEBUG_LOG(("Actual speed %f, Braking factor %f, slowDownDist %f, Pathdist %f, goalSpeed %f\n", + //DEBUG_LOG(("Actual speed %f, Braking factor %f, slowDownDist %f, Pathdist %f, goalSpeed %f", // actualSpeed, m_brakingFactor, slowDownDist, onPathDistToGoal, goalSpeed)); @@ -1500,7 +1500,7 @@ void Locomotor::moveTowardsPositionWheels(Object* obj, PhysicsBehavior *physics, if (fabs(accelForce) > fabs(maxForceNeeded)) accelForce = maxForceNeeded; - //DEBUG_LOG(("Braking %d, actualSpeed %f, goalSpeed %f, delta %f, accel %f\n", getFlag(IS_BRAKING), + //DEBUG_LOG(("Braking %d, actualSpeed %f, goalSpeed %f, delta %f, accel %f", getFlag(IS_BRAKING), //actualSpeed, goalSpeed, speedDelta, accelForce)); const Coord3D *dir = obj->getUnitDirectionVector2D(); @@ -2008,7 +2008,7 @@ void Locomotor::moveTowardsPositionThrust(Object* obj, PhysicsBehavior *physics, Vector3 curVel(physics->getVelocity()->x, physics->getVelocity()->y, physics->getVelocity()->z); Vector3 accelVec = thrustDir * maxAccel - curVel * damping; - //DEBUG_LOG(("accel %f (max %f) vel %f (max %f) damping %f\n",accelVec.Length(),maxAccel,curVel.Length(),maxForwardSpeed,damping)); + //DEBUG_LOG(("accel %f (max %f) vel %f (max %f) damping %f",accelVec.Length(),maxAccel,curVel.Length(),maxForwardSpeed,damping)); Real mass = physics->getMass(); @@ -2291,7 +2291,7 @@ Bool Locomotor::handleBehaviorZ(Object* obj, PhysicsBehavior *physics, const Coo Real liftToUse = calcLiftToUseAtPt(obj, physics, pos.z, surfaceHt, preferredHeight); - //DEBUG_LOG(("HandleBZ %d LiftToUse %f\n",TheGameLogic->getFrame(),liftToUse)); + //DEBUG_LOG(("HandleBZ %d LiftToUse %f",TheGameLogic->getFrame(),liftToUse)); if (liftToUse != 0.0f) { Coord3D force; @@ -2324,7 +2324,7 @@ Bool Locomotor::handleBehaviorZ(Object* obj, PhysicsBehavior *physics, const Coo Real liftToUse = calcLiftToUseAtPt(obj, physics, pos.z, surfaceHt, preferredHeight); - //DEBUG_LOG(("HandleBZ %d LiftToUse %f\n",TheGameLogic->getFrame(),liftToUse)); + //DEBUG_LOG(("HandleBZ %d LiftToUse %f",TheGameLogic->getFrame(),liftToUse)); if (liftToUse != 0.0f) { Coord3D force; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 334b84b754..96cb3c7c6c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -2394,12 +2394,12 @@ void Object::onCollide( Object *other, const Coord3D *loc, const Coord3D *normal if( getStatusBits().test( OBJECT_STATUS_NO_COLLISIONS ) ) { #ifdef DEBUG_CRC - //DEBUG_LOG(("Object::onCollide() - OBJECT_STATUS_NO_COLLISIONS set\n")); + //DEBUG_LOG(("Object::onCollide() - OBJECT_STATUS_NO_COLLISIONS set")); #endif break; } #ifdef DEBUG_CRC - //DEBUG_LOG(("Object::onCollide() - calling collide module\n")); + //DEBUG_LOG(("Object::onCollide() - calling collide module")); #endif collide->onCollide(other, loc, normal); } @@ -2717,7 +2717,7 @@ void Object::setLayer(PathfindLayerEnum layer) if (layer!=m_layer) { #define no_SET_LAYER_INTENSE_DEBUG #ifdef SET_LAYER_INTENSE_DEBUG - DEBUG_LOG(("Changing layer from %d to %d\n", m_layer, layer)); + DEBUG_LOG(("Changing layer from %d to %d", m_layer, layer)); if (m_layer != LAYER_GROUND) { if (TheTerrainLogic->objectInteractsWithBridgeLayer(this, m_layer)) { DEBUG_CRASH(("Probably shouldn't be chaging layer. jba.")); @@ -4014,7 +4014,7 @@ void Object::xfer( Xfer *xfer ) xfer->xferObjectID( &id ); setID( id ); - DEBUG_LOG(("Xfer Object %s id=%d\n",getTemplate()->getName().str(),id)); + DEBUG_LOG(("Xfer Object %s id=%d",getTemplate()->getName().str(),id)); if (version >= 7) { @@ -4965,7 +4965,7 @@ void Object::look() m_partitionLastLook->m_forWhom = lookingMask; m_partitionLastLook->m_howFar = getShroudClearingRange(); - // DEBUG_LOG(( "A %s looks at %f, %f for %x at range %f\n", + // DEBUG_LOG(( "A %s looks at %f, %f for %x at range %f", // getTemplate()->getName().str(), // pos.x, // pos.y, @@ -5015,7 +5015,7 @@ void Object::unlook() m_partitionLastLook->m_forWhom ); -// DEBUG_LOG(( "A %s queues an unlook at %f, %f for %x at range %f\n", +// DEBUG_LOG(( "A %s queues an unlook at %f, %f for %x at range %f", // getTemplate()->getName().str(), // m_partitionLastLook.m_where.x, // m_partitionLastLook.m_where.y, @@ -6288,7 +6288,7 @@ AIGroup *Object::getGroup(void) //------------------------------------------------------------------------------------------------- void Object::enterGroup( AIGroup *group ) { -// DEBUG_LOG(("***AIGROUP %x involved in enterGroup on %x\n", group, this)); +// DEBUG_LOG(("***AIGROUP %x involved in enterGroup on %x", group, this)); // if we are in another group, remove ourselves from it first leaveGroup(); @@ -6302,7 +6302,7 @@ void Object::enterGroup( AIGroup *group ) //------------------------------------------------------------------------------------------------- void Object::leaveGroup( void ) { -// DEBUG_LOG(("***AIGROUP %x involved in leaveGroup on %x\n", m_group, this)); +// DEBUG_LOG(("***AIGROUP %x involved in leaveGroup on %x", m_group, this)); // if we are in a group, remove ourselves from it if (m_group) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp index 5fa215f6e2..80d9eb972a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp @@ -1014,7 +1014,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget if (m_inheritsVeterancy && sourceObj && obj->getExperienceTracker()->isTrainable()) { - DEBUG_LOG(("Object %s inherits veterancy level %d from %s\n", + DEBUG_LOG(("Object %s inherits veterancy level %d from %s", obj->getTemplate()->getName().str(), sourceObj->getVeterancyLevel(), sourceObj->getTemplate()->getName().str())); VeterancyLevel v = sourceObj->getVeterancyLevel(); obj->getExperienceTracker()->setVeterancyLevel(v); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index 65d7aa1109..f4ab8482e8 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -246,10 +246,10 @@ inline Bool filtersAllow(PartitionFilter **filters, Object *objOther) if (DoFilterProfiling && calls > 0 && calls % 1000==0) { - DEBUG_LOG(("\n\n")); + DEBUG_LOG(("\n")); for (idx = 0; idx < maxEver; idx++) { - DEBUG_LOG(("rejections[%s] = %d (useful = %d)\n",names[idx],rejections[idx],usefulRejections[idx])); + DEBUG_LOG(("rejections[%s] = %d (useful = %d)",names[idx],rejections[idx],usefulRejections[idx])); } } @@ -1280,7 +1280,7 @@ void PartitionCell::addLooker(Int playerIndex) CellShroudStatus newShroud = getShroudStatusForPlayer( playerIndex ); -// DEBUG_LOG(( "ADD %d, %d. CS = %d, AS = %d for player %d.\n", +// DEBUG_LOG(( "ADD %d, %d. CS = %d, AS = %d for player %d.", // m_cellX, // m_cellY, // m_shroudLevel[playerIndex].m_currentShroud, @@ -1316,7 +1316,7 @@ void PartitionCell::removeLooker(Int playerIndex) } CellShroudStatus newShroud = getShroudStatusForPlayer( playerIndex ); -// DEBUG_LOG(( "REMOVE %d, %d. CS = %d, AS = %d for player %d.\n", +// DEBUG_LOG(( "REMOVE %d, %d. CS = %d, AS = %d for player %d.", // m_cellX, // m_cellY, // m_shroudLevel[playerIndex].m_currentShroud, @@ -1545,7 +1545,7 @@ void PartitionCell::loadPostProcess( void ) //----------------------------------------------------------------------------- PartitionData::PartitionData() { - //DEBUG_LOG(("create pd %08lx\n",this)); + //DEBUG_LOG(("create pd %08lx",this)); m_next = NULL; m_prev = NULL; m_nextDirty = NULL; @@ -1569,13 +1569,13 @@ PartitionData::PartitionData() //----------------------------------------------------------------------------- PartitionData::~PartitionData() { - //DEBUG_LOG(("toss pd for pd %08lx obj %08lx\n",this,m_object)); + //DEBUG_LOG(("toss pd for pd %08lx obj %08lx",this,m_object)); removeAllTouchedCells(); freeCoiArray(); DEBUG_ASSERTCRASH(ThePartitionManager, ("ThePartitionManager is null")); if (ThePartitionManager && ThePartitionManager->isInListDirtyModules(this)) { - //DEBUG_LOG(("remove pd %08lx from dirty list (%08lx %08lx)\n",this,m_prevDirty,m_nextDirty)); + //DEBUG_LOG(("remove pd %08lx from dirty list (%08lx %08lx)",this,m_prevDirty,m_nextDirty)); ThePartitionManager->removeFromDirtyModules(this); //DEBUG_ASSERTCRASH(!ThePartitionManager->isInListDirtyModules(this), ("hmm\n")); } @@ -1938,7 +1938,7 @@ void PartitionData::addPossibleCollisions(PartitionContactList *ctList) } #endif - //DEBUG_LOG(("adding possible collision for %s\n",getObject()->getTemplate()->getName().str())); + //DEBUG_LOG(("adding possible collision for %s",getObject()->getTemplate()->getName().str())); CellAndObjectIntersection *myCoi = m_coiArray; for (Int i = m_coiInUseCount; i > 0; --i, ++myCoi) @@ -2208,7 +2208,7 @@ theObjName = obj->getTemplate()->getName(); //----------------------------------------------------------------------------- void PartitionData::makeDirty(Bool needToUpdateCells) { - //DEBUG_LOG(("makeDirty for pd %08lx obj %08lx\n",this,m_object)); + //DEBUG_LOG(("makeDirty for pd %08lx obj %08lx",this,m_object)); if (!ThePartitionManager->isInListDirtyModules(this)) { if (needToUpdateCells) @@ -2270,7 +2270,7 @@ void PartitionData::attachToObject(Object* object) m_ghostObject = TheGhostObjectManager->addGhostObject(object, this); } - //DEBUG_LOG(("attach pd for pd %08lx obj %08lx\n",this,m_object)); + //DEBUG_LOG(("attach pd for pd %08lx obj %08lx",this,m_object)); // (re)calc maxCoi and (re)alloc cois DEBUG_ASSERTCRASH(m_coiArrayCount == 0 && m_coiArray == NULL, ("hmm, coi should probably be null here")); @@ -2301,7 +2301,7 @@ void PartitionData::detachFromObject() removeAllTouchedCells(); freeCoiArray(); - //DEBUG_LOG(("detach pd for pd %08lx obj %08lx\n",this,m_object)); + //DEBUG_LOG(("detach pd for pd %08lx obj %08lx",this,m_object)); // no longer attached to object m_object = NULL; @@ -2347,7 +2347,7 @@ void PartitionData::detachFromGhostObject(void) removeAllTouchedCells(); freeCoiArray(); - //DEBUG_LOG(("detach pd for pd %08lx obj %08lx\n",this,m_object)); + //DEBUG_LOG(("detach pd for pd %08lx obj %08lx",this,m_object)); // no longer attached to object m_object = NULL; @@ -2425,7 +2425,7 @@ for (PartitionContactListNode *cd2 = m_contactHash[ hashValue ]; cd2; cd2 = cd2- } if (depth > 3) { - DEBUG_LOG(("depth is %d for %s %08lx (%d) - %s %08lx (%d)\n", + DEBUG_LOG(("depth is %d for %s %08lx (%d) - %s %08lx (%d)", depth,obj_obj->getTemplate()->getName().str(),obj_obj,obj_obj->getID(), other_obj->getTemplate()->getName().str(),other_obj,other_obj->getID() )); @@ -2436,7 +2436,7 @@ if (depth > 3) //hashValue %= PartitionContactList_SOCKET_COUNT; - DEBUG_LOG(("ENTRY: %s %08lx (%d) - %s %08lx (%d) [rawhash %d]\n", + DEBUG_LOG(("ENTRY: %s %08lx (%d) - %s %08lx (%d) [rawhash %d]", cd2->m_obj->getObject()->getTemplate()->getName().str(),cd2->m_obj->getObject(),cd2->m_obj->getObject()->getID(), cd2->m_other->getObject()->getTemplate()->getName().str(),cd2->m_other->getObject(),cd2->m_other->getObject()->getID(), rawhash)); @@ -2542,12 +2542,12 @@ void PartitionContactList::processContactList() // if (!obj->isDestroyed() && obj->friend_getPartitionData() != NULL && !obj->isKindOf(KINDOF_IMMOBILE)) { -//DEBUG_LOG(("%d: re-dirtying collision of %s %08lx with %s %08lx\n",TheGameLogic->getFrame(),obj->getTemplate()->getName().str(),obj,other->getTemplate()->getName().str(),other)); +//DEBUG_LOG(("%d: re-dirtying collision of %s %08lx with %s %08lx",TheGameLogic->getFrame(),obj->getTemplate()->getName().str(),obj,other->getTemplate()->getName().str(),other)); obj->friend_getPartitionData()->makeDirty(false); } if (!other->isDestroyed() && other->friend_getPartitionData() != NULL && !other->isKindOf(KINDOF_IMMOBILE)) { -//DEBUG_LOG(("%d: re-dirtying collision of %s %08lx with %s %08lx [other]\n",TheGameLogic->getFrame(),other->getTemplate()->getName().str(),other,obj->getTemplate()->getName().str(),obj)); +//DEBUG_LOG(("%d: re-dirtying collision of %s %08lx with %s %08lx [other]",TheGameLogic->getFrame(),other->getTemplate()->getName().str(),other,obj->getTemplate()->getName().str(),obj)); other->friend_getPartitionData()->makeDirty(false); } } @@ -2858,7 +2858,7 @@ void PartitionManager::registerObject( Object* object ) // if object is already part of this system get out of here if( object->friend_getPartitionData() != NULL ) { - DEBUG_LOG(( "Object '%s' already registered with partition manager\n", + DEBUG_LOG(( "Object '%s' already registered with partition manager", object->getTemplate()->getName().str() )); return; } // end if @@ -2933,7 +2933,7 @@ void PartitionManager::registerGhostObject( GhostObject* object) // if object is already part of this system get out of here if( object->friend_getPartitionData() != NULL ) { - DEBUG_LOG(( "GhostObject already registered with partition manager\n")); + DEBUG_LOG(( "GhostObject already registered with partition manager")); return; } // end if @@ -3205,7 +3205,7 @@ void PartitionManager::calcRadiusVec() for (Int i = 0; i <= m_maxGcoRadius; ++i) { total += m_radiusVec[i].size(); - //DEBUG_LOG(("radius %d has %d entries\n",i,m_radiusVec[i].size())); + //DEBUG_LOG(("radius %d has %d entries",i,m_radiusVec[i].size())); } DEBUG_ASSERTCRASH(total == (cx*2-1)*(cy*2-1),("expected %d, got %d\n",(cx*2-1)*(cy*2-1),total)); #endif @@ -4575,7 +4575,7 @@ Bool PartitionManager::isClearLineOfSightTerrain(const Object* obj, const Coord3 const Real LOS_FUDGE = 0.5f; if (terrainAtHighPoint > lineOfSightAtHighPoint + LOS_FUDGE) { - //DEBUG_LOG(("isClearLineOfSightTerrain fails\n")); + //DEBUG_LOG(("isClearLineOfSightTerrain fails")); return false; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SimpleObjectIterator.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SimpleObjectIterator.cpp index 3845fc00d7..5b878b6b96 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SimpleObjectIterator.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SimpleObjectIterator.cpp @@ -134,10 +134,10 @@ void SimpleObjectIterator::sort(IterOrderType order) #ifdef INTENSE_DEBUG { - DEBUG_LOG(("\n\n---------- BEFORE sort for %d -----------\n",order)); + DEBUG_LOG(("\n\n---------- BEFORE sort for %d -----------",order)); for (Clump *p = m_firstClump; p; p = p->m_nextClump) { - DEBUG_LOG((" obj %08lx numeric %f\n",p->m_obj,p->m_numeric)); + DEBUG_LOG((" obj %08lx numeric %f",p->m_obj,p->m_numeric)); } } #endif @@ -233,10 +233,10 @@ void SimpleObjectIterator::sort(IterOrderType order) #ifdef INTENSE_DEBUG { - DEBUG_LOG(("\n\n---------- sort for %d -----------\n",order)); + DEBUG_LOG(("\n\n---------- sort for %d -----------",order)); for (Clump *p = m_firstClump; p; p = p->m_nextClump) { - DEBUG_LOG((" obj %08lx numeric %f\n",p->m_obj,p->m_numeric)); + DEBUG_LOG((" obj %08lx numeric %f",p->m_obj,p->m_numeric)); } } #endif diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 8e72e8eee0..b466c634eb 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -399,7 +399,7 @@ void AIUpdateInterface::doPathfind( PathfindServicesInterface *pathfinder ) if (!m_waitingForPath) { return; } - //CRCDEBUG_LOG(("AIUpdateInterface::doPathfind() for object %d\n", getObject()->getID())); + //CRCDEBUG_LOG(("AIUpdateInterface::doPathfind() for object %d", getObject()->getID())); m_waitingForPath = FALSE; if (m_isSafePath) { destroyPath(); @@ -443,11 +443,11 @@ void AIUpdateInterface::doPathfind( PathfindServicesInterface *pathfinder ) TheAI->pathfinder()->updateGoal(getObject(), getPath()->getLastNode()->getPosition(), getPath()->getLastNode()->getLayer()); } - //CRCDEBUG_LOG(("AIUpdateInterface::doPathfind() - m_isAttackPath = TRUE after computeAttackPath\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::doPathfind() - m_isAttackPath = TRUE after computeAttackPath")); m_isAttackPath = TRUE; return; } - //CRCDEBUG_LOG(("AIUpdateInterface::doPathfind() - m_isAttackPath = FALSE after computeAttackPath()\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::doPathfind() - m_isAttackPath = FALSE after computeAttackPath()")); m_isAttackPath = FALSE; if (victim) { m_requestedDestination = *victim->getPosition(); @@ -484,10 +484,10 @@ void AIUpdateInterface::requestPath( Coord3D *destination, Bool isFinalGoal ) DEBUG_CRASH(("Attempting to path immobile unit.")); } - //DEBUG_LOG(("Request Frame %d, obj %s %x\n", TheGameLogic->getFrame(), getObject()->getTemplate()->getName().str(), getObject())); + //DEBUG_LOG(("Request Frame %d, obj %s %x", TheGameLogic->getFrame(), getObject()->getTemplate()->getName().str(), getObject())); m_requestedDestination = *destination; m_isFinalGoal = isFinalGoal; - CRCDEBUG_LOG(("AIUpdateInterface::requestPath() - m_isAttackPath = FALSE for object %d\n", getObject()->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::requestPath() - m_isAttackPath = FALSE for object %d", getObject()->getID())); m_isAttackPath = FALSE; m_requestedVictimID = INVALID_ID; m_isApproachPath = FALSE; @@ -499,12 +499,12 @@ void AIUpdateInterface::requestPath( Coord3D *destination, Bool isFinalGoal ) m_waitingForPath = TRUE; if (m_pathTimestamp > TheGameLogic->getFrame()-3) { /* Requesting path very quickly. Can cause a spin. */ - //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 1 second\n", + //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 1 second", //TheGameLogic->getFrame())); setQueueForPathTime(LOGICFRAMES_PER_SECOND); // See if it has been too soon. // jba intense debug - //DEBUG_LOG(("Info - RePathing very quickly %d, %d.\n", m_pathTimestamp, TheGameLogic->getFrame())); + //DEBUG_LOG(("Info - RePathing very quickly %d, %d.", m_pathTimestamp, TheGameLogic->getFrame())); if (m_path && m_isBlockedAndStuck) { setIgnoreCollisionTime(2*LOGICFRAMES_PER_SECOND); m_blockedFrames = 0; @@ -523,7 +523,7 @@ void AIUpdateInterface::requestAttackPath( ObjectID victimID, const Coord3D* vic if (m_locomotorSet.getValidSurfaces() == 0) { DEBUG_CRASH(("Attempting to path immobile unit.")); } - CRCDEBUG_LOG(("AIUpdateInterface::requestAttackPath() - m_isAttackPath = TRUE for object %d\n", getObject()->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::requestAttackPath() - m_isAttackPath = TRUE for object %d", getObject()->getID())); m_requestedDestination = *victimPos; m_requestedVictimID = victimID; m_isAttackPath = TRUE; @@ -532,7 +532,7 @@ void AIUpdateInterface::requestAttackPath( ObjectID victimID, const Coord3D* vic m_waitingForPath = TRUE; if (m_pathTimestamp > TheGameLogic->getFrame()-3) { /* Requesting path very quickly. Can cause a spin. */ - //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 2 second\n",TheGameLogic->getFrame())); + //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 2 second",TheGameLogic->getFrame())); setQueueForPathTime(2*LOGICFRAMES_PER_SECOND); setLocomotorGoalNone(); return; @@ -548,7 +548,7 @@ void AIUpdateInterface::requestApproachPath( Coord3D *destination ) } m_requestedDestination = *destination; m_isFinalGoal = TRUE; - CRCDEBUG_LOG(("AIUpdateInterface::requestApproachPath() - m_isAttackPath = FALSE for object %d\n", getObject()->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::requestApproachPath() - m_isAttackPath = FALSE for object %d", getObject()->getID())); m_isAttackPath = FALSE; m_requestedVictimID = INVALID_ID; m_isApproachPath = TRUE; @@ -556,7 +556,7 @@ void AIUpdateInterface::requestApproachPath( Coord3D *destination ) m_waitingForPath = TRUE; if (m_pathTimestamp > TheGameLogic->getFrame()-3) { /* Requesting path very quickly. Can cause a spin. */ - //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 2 second\n",TheGameLogic->getFrame())); + //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 2 second",TheGameLogic->getFrame())); setQueueForPathTime(2*LOGICFRAMES_PER_SECOND); return; } @@ -572,7 +572,7 @@ void AIUpdateInterface::requestSafePath( ObjectID repulsor ) } m_repulsor1 = repulsor; m_isFinalGoal = FALSE; - CRCDEBUG_LOG(("AIUpdateInterface::requestSafePath() - m_isAttackPath = FALSE for object %d\n", getObject()->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::requestSafePath() - m_isAttackPath = FALSE for object %d", getObject()->getID())); m_isAttackPath = FALSE; m_requestedVictimID = INVALID_ID; m_isApproachPath = FALSE; @@ -580,7 +580,7 @@ void AIUpdateInterface::requestSafePath( ObjectID repulsor ) m_waitingForPath = TRUE; if (m_pathTimestamp > TheGameLogic->getFrame()-3) { /* Requesting path very quickly. Can cause a spin. */ - //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 2 second\n",TheGameLogic->getFrame())); + //DEBUG_LOG(("%d Pathfind - repathing in less than 3 frames. Waiting 2 second",TheGameLogic->getFrame())); setQueueForPathTime(2*LOGICFRAMES_PER_SECOND); return; } @@ -1003,7 +1003,7 @@ void AIUpdateInterface::friend_notifyStateMachineChanged() DECLARE_PERF_TIMER(AIUpdateInterface_update) UpdateSleepTime AIUpdateInterface::update( void ) { - //DEBUG_LOG(("AIUpdateInterface frame %d: %08lx\n",TheGameLogic->getFrame(),getObject())); + //DEBUG_LOG(("AIUpdateInterface frame %d: %08lx",TheGameLogic->getFrame(),getObject())); USE_PERF_TIMER(AIUpdateInterface_update) @@ -1358,7 +1358,7 @@ Bool AIUpdateInterface::blockedBy(Object *other) Real collisionAngle = ThePartitionManager->getRelativeAngle2D( obj, &otherPos ); Real otherAngle = ThePartitionManager->getRelativeAngle2D( other, &pos ); - //DEBUG_LOG(("Collision angle %.2f, %.2f, %s, %x %s\n", collisionAngle*180/PI, otherAngle*180/PI, obj->getTemplate()->getName().str(), obj, other->getTemplate()->getName().str())); + //DEBUG_LOG(("Collision angle %.2f, %.2f, %s, %x %s", collisionAngle*180/PI, otherAngle*180/PI, obj->getTemplate()->getName().str(), obj, other->getTemplate()->getName().str())); Real angleLimit = PI/4; // 45 degrees. if (collisionAngle>PI/2 || collisionAngle<-PI/2) { return FALSE; // we're moving away. @@ -1378,7 +1378,7 @@ Bool AIUpdateInterface::blockedBy(Object *other) return FALSE; } } else { - //DEBUG_LOG(("Moving Away From EachOther\n")); + //DEBUG_LOG(("Moving Away From EachOther")); return FALSE; // moving away, so no need for corrective action. } } else { @@ -1409,7 +1409,7 @@ Bool AIUpdateInterface::needToRotate(void) if (getPath()) { ClosestPointOnPathInfo info; - CRCDEBUG_LOG(("AIUpdateInterface::needToRotate() - calling computePointOnPath() for object %d\n", getObject()->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::needToRotate() - calling computePointOnPath() for object %d", getObject()->getID())); getPath()->computePointOnPath(getObject(), m_locomotorSet, *getObject()->getPosition(), info); deltaAngle = ThePartitionManager->getRelativeAngle2D( getObject(), &info.posOnPath ); } @@ -1501,7 +1501,7 @@ Bool AIUpdateInterface::processCollision(PhysicsBehavior *physics, Object *other #endif } - //DEBUG_LOG(("Blocked %s, %x, %s\n", getObject()->getTemplate()->getName().str(), getObject(), other->getTemplate()->getName().str())); + //DEBUG_LOG(("Blocked %s, %x, %s", getObject()->getTemplate()->getName().str(), getObject(), other->getTemplate()->getName().str())); if (m_blockedFrames==0) m_blockedFrames = 1; if (!needToRotate()) { @@ -1509,7 +1509,7 @@ Bool AIUpdateInterface::processCollision(PhysicsBehavior *physics, Object *other if (!otherMoving) { // Intense logging jba - // DEBUG_LOG(("Blocked&Stuck !otherMoving\n")); + // DEBUG_LOG(("Blocked&Stuck !otherMoving")); m_isBlockedAndStuck = TRUE; return FALSE; } @@ -1526,7 +1526,7 @@ Bool AIUpdateInterface::processCollision(PhysicsBehavior *physics, Object *other aiMoveAwayFromUnit(aiOther->getObject(), CMD_FROM_AI); //m_isBlockedAndStuck = TRUE; // Intense logging jba. - // DEBUG_LOG(("Blocked&Stuck other is blockedByUs, has higher priority\n")); + // DEBUG_LOG(("Blocked&Stuck other is blockedByUs, has higher priority")); } } } @@ -1566,7 +1566,7 @@ Bool AIUpdateInterface::processCollision(PhysicsBehavior *physics, Object *other return false; // we are doing a special ability. Shouldn't move at this time. jba. } // jba intense debug - //DEBUG_LOG(("*****Units ended up on top of each other. Shouldn't happen.\n")); + //DEBUG_LOG(("*****Units ended up on top of each other. Shouldn't happen.")); if (isIdle()) { Coord3D safePosition = *getObject()->getPosition(); @@ -1783,12 +1783,12 @@ Bool AIUpdateInterface::computePath( PathfindServicesInterface *pathServices, Co */ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServices, const Object *victim, const Coord3D* victimPos ) { - //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() for object %d\n", getObject()->getID())); + //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() for object %d", getObject()->getID())); // See if it has been too soon. if (m_pathTimestamp >= TheGameLogic->getFrame()-2) { // jba intense debug - //CRCDEBUG_LOG(("Info - RePathing very quickly %d, %d.\n", m_pathTimestamp, TheGameLogic->getFrame())); + //CRCDEBUG_LOG(("Info - RePathing very quickly %d, %d.", m_pathTimestamp, TheGameLogic->getFrame())); if (m_path && m_isBlockedAndStuck) { setIgnoreCollisionTime(2*LOGICFRAMES_PER_SECOND); @@ -1809,7 +1809,7 @@ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServic Object* source = getObject(); if (!victim && !victimPos) { - //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() - victim is NULL\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() - victim is NULL")); return FALSE; } @@ -1839,7 +1839,7 @@ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServic if (!viewBlocked) { destroyPath(); - //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() - target is in range and visible\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() - target is in range and visible")); return TRUE; } @@ -1856,7 +1856,7 @@ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServic } if (!viewBlocked) { destroyPath(); - //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() target pos is in range and visible\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() target pos is in range and visible")); return TRUE; } } @@ -1891,7 +1891,7 @@ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServic destroyPath(); return false; } - //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() is contact weapon\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() is contact weapon")); return ok; } @@ -2006,7 +2006,7 @@ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServic m_blockedFrames = 0; m_isBlockedAndStuck = FALSE; - //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() done\n")); + //CRCDEBUG_LOG(("AIUpdateInterface::computeAttackPath() done")); if (m_path) return TRUE; @@ -2025,7 +2025,7 @@ void AIUpdateInterface::destroyPath( void ) m_path = NULL; m_waitingForPath = FALSE; // we no longer need it. - //CRCDEBUG_LOG(("AIUpdateInterface::destroyPath() - m_isAttackPath = FALSE for object %d\n", getObject()->getID())); + //CRCDEBUG_LOG(("AIUpdateInterface::destroyPath() - m_isAttackPath = FALSE for object %d", getObject()->getID())); m_isAttackPath = FALSE; setLocomotorGoalNone(); } @@ -2179,9 +2179,9 @@ UpdateSleepTime AIUpdateInterface::doLocomotor( void ) { return UPDATE_SLEEP_FOREVER; // Can't move till we get our path. } - DEBUG_LOG(("Dead %d, obj %s %x\n", isAiInDeadState(), getObject()->getTemplate()->getName().str(), getObject())); + DEBUG_LOG(("Dead %d, obj %s %x", isAiInDeadState(), getObject()->getTemplate()->getName().str(), getObject())); #ifdef STATE_MACHINE_DEBUG - DEBUG_LOG(("Waiting %d, state %s\n", m_waitingForPath, getStateMachine()->getCurrentStateName().str())); + DEBUG_LOG(("Waiting %d, state %s", m_waitingForPath, getStateMachine()->getCurrentStateName().str())); m_stateMachine->setDebugOutput(1); #endif DEBUG_CRASH(("must have a path here (doLocomotor)")); @@ -2199,7 +2199,7 @@ UpdateSleepTime AIUpdateInterface::doLocomotor( void ) // Compute the actual goal position along the path to move towards. Consider // obstacles, and follow the intermediate path points. ClosestPointOnPathInfo info; - CRCDEBUG_LOG(("AIUpdateInterface::doLocomotor() - calling computePointOnPath() for %s\n", + CRCDEBUG_LOG(("AIUpdateInterface::doLocomotor() - calling computePointOnPath() for %s", DebugDescribeObject(getObject()).str())); getPath()->computePointOnPath(getObject(), m_locomotorSet, *getObject()->getPosition(), info); onPathDistToGoal = info.distAlongPath; @@ -2461,7 +2461,7 @@ Real AIUpdateInterface::getLocomotorDistanceToGoal() } else if (!m_curLocomotor) { - //DEBUG_LOG(("no locomotor here, so no dist. (this is ok.)\n")); + //DEBUG_LOG(("no locomotor here, so no dist. (this is ok.)")); return 0.0f; } else if( m_curLocomotor->isCloseEnoughDist3D() || getObject()->isKindOf(KINDOF_PROJECTILE)) @@ -2486,7 +2486,7 @@ Real AIUpdateInterface::getLocomotorDistanceToGoal() } else { // Ground based locomotor. ClosestPointOnPathInfo info; - CRCDEBUG_LOG(("AIUpdateInterface::getLocomotorDistanceToGoal() - calling computePointOnPath() for object %d\n", getObject()->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::getLocomotorDistanceToGoal() - calling computePointOnPath() for object %d", getObject()->getID())); getPath()->computePointOnPath(getObject(), m_locomotorSet, *getObject()->getPosition(), info); goalPos = info.posOnPath; dist = info.distAlongPath; @@ -4650,7 +4650,7 @@ Object* AIUpdateInterface::getNextMoodTarget( Bool calledByAI, Bool calledDuring Object *newVictim = TheAI->findClosestEnemy(obj, rangeToFindWithin, flags, getAttackInfo()); /* -DEBUG_LOG(("GNMT frame %d: %s %08lx (con %s %08lx) uses range %f, flags %08lx, %s finds %s %08lx\n", +DEBUG_LOG(("GNMT frame %d: %s %08lx (con %s %08lx) uses range %f, flags %08lx, %s finds %s %08lx", now, obj->getTemplate()->getName().str(), obj, @@ -4666,7 +4666,7 @@ DEBUG_LOG(("GNMT frame %d: %s %08lx (con %s %08lx) uses range %f, flags %08lx, % if (newVictim) { - CRCDEBUG_LOG(("AIUpdateInterface::getNextMoodTarget() - %d is attacking %d\n", obj->getID(), newVictim->getID())); + CRCDEBUG_LOG(("AIUpdateInterface::getNextMoodTarget() - %d is attacking %d", obj->getID(), newVictim->getID())); /* srj debug hack. ignore. Int ot = getTmpValue(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp index ba0f441fa1..bc10b531da 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp @@ -378,7 +378,7 @@ Bool DeliverPayloadAIUpdate::isCloseEnoughToTarget() if ( inBound ) allowedDistanceSqr = sqr(getAllowedDistanceToTarget() + getPreOpenDistance()); - //DEBUG_LOG(("Dist to target is %f (allowed %f)\n",sqrt(currentDistanceSqr),sqrt(allowedDistanceSqr))); + //DEBUG_LOG(("Dist to target is %f (allowed %f)",sqrt(currentDistanceSqr),sqrt(allowedDistanceSqr))); if ( allowedDistanceSqr > currentDistanceSqr ) @@ -966,10 +966,10 @@ StateReturnType ConsiderNewApproachState::onEnter() // Increment local counter o ++m_numberEntriesToState; - DEBUG_LOG(("Considering approach #%d...\n",m_numberEntriesToState)); + DEBUG_LOG(("Considering approach #%d...",m_numberEntriesToState)); if( m_numberEntriesToState > ai->getMaxNumberAttempts() ) { - DEBUG_LOG(("Too many approaches! Time to give up.\n")); + DEBUG_LOG(("Too many approaches! Time to give up.")); return STATE_FAILURE; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp index f7c1178869..8139cdfdfe 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp @@ -328,7 +328,7 @@ Bool MissileAIUpdate::projectileHandleCollision( Object *other ) // if it's not the specific thing we were targeting, see if we should incidentally collide... if (!m_detonationWeaponTmpl->shouldProjectileCollideWith(projectileLauncher, obj, other, m_victimID)) { - //DEBUG_LOG(("ignoring projectile collision with %s at frame %d\n",other->getTemplate()->getName().str(),TheGameLogic->getFrame())); + //DEBUG_LOG(("ignoring projectile collision with %s at frame %d",other->getTemplate()->getName().str(),TheGameLogic->getFrame())); return true; } @@ -348,7 +348,7 @@ Bool MissileAIUpdate::projectileHandleCollision( Object *other ) Object* thingToKill = *it++; if (!thingToKill->isEffectivelyDead() && thingToKill->isKindOfMulti(d->m_garrisonHitKillKindof, d->m_garrisonHitKillKindofNot)) { - //DEBUG_LOG(("Killed a garrisoned unit (%08lx %s) via Flash-Bang!\n",thingToKill,thingToKill->getTemplate()->getName().str())); + //DEBUG_LOG(("Killed a garrisoned unit (%08lx %s) via Flash-Bang!",thingToKill,thingToKill->getTemplate()->getName().str())); if (projectileLauncher) projectileLauncher->scoreTheKill( thingToKill ); thingToKill->kill(); @@ -611,7 +611,7 @@ void MissileAIUpdate::doKillState(void) closeEnough = curLoco->getMaxSpeedForCondition(BODY_PRISTINE); } Real distanceToTargetSq = ThePartitionManager->getDistanceSquared( getObject(), getGoalObject(), FROM_BOUNDINGSPHERE_3D); - //DEBUG_LOG(("Distance to target %f, closeEnough %f\n", sqrt(distanceToTargetSq), closeEnough)); + //DEBUG_LOG(("Distance to target %f, closeEnough %f", sqrt(distanceToTargetSq), closeEnough)); if (distanceToTargetSq < closeEnough*closeEnough) { Coord3D pos = *getGoalObject()->getPosition(); getObject()->setPosition(&pos); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp index be39ae7e9c..262e50780f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp @@ -992,7 +992,7 @@ void RailroadBehavior::createCarriages( void ) else // or else let's use the defualt template list prvided in the INI { firstCarriage = TheThingFactory->newObject( temp, self->getTeam() ); - DEBUG_LOG(("%s Added a carriage, %s \n", self->getTemplate()->getName().str(),firstCarriage->getTemplate()->getName().str())); + DEBUG_LOG(("%s Added a carriage, %s ", self->getTemplate()->getName().str(),firstCarriage->getTemplate()->getName().str())); } if ( firstCarriage ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp index 2c7d9b9ac1..67512af51b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyWarehouseDockUpdate.cpp @@ -95,7 +95,7 @@ Bool SupplyWarehouseDockUpdate::action( Object* docker, Object *drone ) Real closeEnoughSqr = sqr(docker->getGeometryInfo().getBoundingCircleRadius()*2); Real curDistSqr = ThePartitionManager->getDistanceSquared(docker, getObject(), FROM_BOUNDINGSPHERE_2D); if (curDistSqr > closeEnoughSqr) { - DEBUG_LOG(("Failing dock, dist %f, not close enough(%f).\n", sqrt(curDistSqr), sqrt(closeEnoughSqr))); + DEBUG_LOG(("Failing dock, dist %f, not close enough(%f).", sqrt(curDistSqr), sqrt(closeEnoughSqr))); // Make it twitch a little. Coord3D newPos = *docker->getPosition(); Real range = 0.4*PATHFIND_CELL_SIZE_F; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/MissileLauncherBuildingUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/MissileLauncherBuildingUpdate.cpp index 46de1c8c92..8e50b3e546 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/MissileLauncherBuildingUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/MissileLauncherBuildingUpdate.cpp @@ -74,7 +74,7 @@ void MissileLauncherBuildingUpdate::switchToState(DoorStateType dst) switch (dst) { case DOOR_CLOSED: - DEBUG_LOG(("switch to state DOOR_CLOSED at %d\n",now)); + DEBUG_LOG(("switch to state DOOR_CLOSED at %d",now)); /// @todo srj -- for now, this assumes at most one door clr.set(MODELCONDITION_DOOR_1_WAITING_TO_CLOSE); clr.set(MODELCONDITION_DOOR_1_CLOSING); @@ -94,7 +94,7 @@ void MissileLauncherBuildingUpdate::switchToState(DoorStateType dst) break; case DOOR_OPENING: - DEBUG_LOG(("switch to state DOOR_OPENING at %d\n",now)); + DEBUG_LOG(("switch to state DOOR_OPENING at %d",now)); /// @todo srj -- for now, this assumes at most one door clr.set(MODELCONDITION_DOOR_1_WAITING_TO_CLOSE); clr.set(MODELCONDITION_DOOR_1_CLOSING); @@ -116,7 +116,7 @@ void MissileLauncherBuildingUpdate::switchToState(DoorStateType dst) break; case DOOR_OPEN: - DEBUG_LOG(("switch to state DOOR_OPEN at %d\n",now)); + DEBUG_LOG(("switch to state DOOR_OPEN at %d",now)); /// @todo srj -- for now, this assumes at most one door clr.set(MODELCONDITION_DOOR_1_WAITING_TO_CLOSE); clr.set(MODELCONDITION_DOOR_1_CLOSING); @@ -136,7 +136,7 @@ void MissileLauncherBuildingUpdate::switchToState(DoorStateType dst) break; case DOOR_WAITING_TO_CLOSE: - DEBUG_LOG(("switch to state DOOR_WAITING_TO_CLOSE at %d\n",now)); + DEBUG_LOG(("switch to state DOOR_WAITING_TO_CLOSE at %d",now)); /// @todo srj -- for now, this assumes at most one door clr.set(MODELCONDITION_DOOR_1_CLOSING); clr.set(MODELCONDITION_DOOR_1_OPENING); @@ -156,7 +156,7 @@ void MissileLauncherBuildingUpdate::switchToState(DoorStateType dst) break; case DOOR_CLOSING: - DEBUG_LOG(("switch to state DOOR_CLOSING at %d\n",now)); + DEBUG_LOG(("switch to state DOOR_CLOSING at %d",now)); /// @todo srj -- for now, this assumes at most one door clr.set(MODELCONDITION_DOOR_1_WAITING_TO_CLOSE); clr.set(MODELCONDITION_DOOR_1_WAITING_OPEN); @@ -268,7 +268,7 @@ UpdateSleepTime MissileLauncherBuildingUpdate::update( void ) if (m_doorState != DOOR_OPEN && m_specialPowerModule->isReady()) { - DEBUG_LOG(("*** had to POP the door open!\n")); + DEBUG_LOG(("*** had to POP the door open!")); switchToState(DOOR_OPEN); } else if (m_doorState == DOOR_CLOSED && now >= whenToStartOpening) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp index 144bf3c435..e8bb8d2315 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp @@ -417,9 +417,9 @@ void NeutronMissileUpdate::doAttack( void ) pos.y += m_vel.y; pos.z += m_vel.z; -//DEBUG_LOG(("vel %f accel %f z %f\n",m_vel.length(),m_accel.length(), pos.z)); +//DEBUG_LOG(("vel %f accel %f z %f",m_vel.length(),m_accel.length(), pos.z)); //Real vm = sqrt(m_vel.x*m_vel.x+m_vel.y*m_vel.y+m_vel.z*m_vel.z); -//DEBUG_LOG(("vel is %f %f %f (%f)\n",m_vel.x,m_vel.y,m_vel.z,vm)); +//DEBUG_LOG(("vel is %f %f %f (%f)",m_vel.x,m_vel.y,m_vel.z,vm)); getObject()->setTransformMatrix( &mx ); getObject()->setPosition( &pos ); @@ -513,7 +513,7 @@ UpdateSleepTime NeutronMissileUpdate::update( void ) { Coord3D newPos = *getObject()->getPosition(); Real distThisTurn = sqrt(sqr(newPos.x-oldPos.x) + sqr(newPos.y-oldPos.y) + sqr(newPos.z-oldPos.z)); - //DEBUG_LOG(("noTurnDist goes from %f to %f\n",m_noTurnDistLeft,m_noTurnDistLeft-distThisTurn)); + //DEBUG_LOG(("noTurnDist goes from %f to %f",m_noTurnDistLeft,m_noTurnDistLeft-distThisTurn)); m_noTurnDistLeft -= distThisTurn; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp index 417e361d84..ce04eaa70e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp @@ -880,7 +880,7 @@ UpdateSleepTime PhysicsBehavior::update() damageInfo.in.m_amount = damageAmt; damageInfo.in.m_shockWaveAmount = 0.0f; obj->attemptDamage( &damageInfo ); - //DEBUG_LOG(("Dealing %f (%f %f) points of falling damage to %s!\n",damageAmt,damageInfo.out.m_actualDamageDealt, damageInfo.out.m_actualDamageClipped,obj->getTemplate()->getName().str())); + //DEBUG_LOG(("Dealing %f (%f %f) points of falling damage to %s!",damageAmt,damageInfo.out.m_actualDamageDealt, damageInfo.out.m_actualDamageClipped,obj->getTemplate()->getName().str())); // if this killed us, add SPLATTED to get a cool death. if (obj->isEffectivelyDead()) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp index c3b7503154..1c4608b861 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp @@ -303,7 +303,7 @@ static void buildNonDupRandomIndexList(Int range, Int count, Int idxList[]) //------------------------------------------------------------------------------------------------- void StructureCollapseUpdate::doPhaseStuff(StructureCollapsePhaseType scphase, const Coord3D *target) { - DEBUG_LOG(("Firing phase %d on frame %d\n", scphase, TheGameLogic->getFrame())); + DEBUG_LOG(("Firing phase %d on frame %d", scphase, TheGameLogic->getFrame())); const StructureCollapseUpdateModuleData* d = getStructureCollapseUpdateModuleData(); Int i, idx, count, listSize; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp index 41502e8ffd..8a8affa5e7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp @@ -236,9 +236,9 @@ UpdateSleepTime StructureToppleUpdate::update( void ) if (m_toppleState == TOPPLESTATE_TOPPLING) { UnsignedInt now = TheGameLogic->getFrame(); Real toppleAcceleration = TOPPLE_ACCELERATION_FACTOR * (Sin(m_accumulatedAngle) * (1.0 - m_structuralIntegrity)); -// DEBUG_LOG(("toppleAcceleration = %f\n", toppleAcceleration)); +// DEBUG_LOG(("toppleAcceleration = %f", toppleAcceleration)); m_toppleVelocity += toppleAcceleration; -// DEBUG_LOG(("m_toppleVelocity = %f\n", m_toppleVelocity)); +// DEBUG_LOG(("m_toppleVelocity = %f", m_toppleVelocity)); // doesn't make sense to have a structural integrity less than zero. if (m_structuralIntegrity > 0.0f) { @@ -247,7 +247,7 @@ UpdateSleepTime StructureToppleUpdate::update( void ) m_structuralIntegrity = 0.0f; } } -// DEBUG_LOG(("m_structuralIntegrity = %f\n\n", m_structuralIntegrity)); +// DEBUG_LOG(("m_structuralIntegrity = %f\n", m_structuralIntegrity)); doAngleFX(m_accumulatedAngle, m_accumulatedAngle + m_toppleVelocity); @@ -478,7 +478,7 @@ void StructureToppleUpdate::doToppleDelayBurstFX() const StructureToppleUpdateModuleData *d = getStructureToppleUpdateModuleData(); const DamageInfo *lastDamageInfo = getObject()->getBodyModule()->getLastDamageInfo(); - DEBUG_LOG(("Doing topple delay burst on frame %d\n", TheGameLogic->getFrame())); + DEBUG_LOG(("Doing topple delay burst on frame %d", TheGameLogic->getFrame())); if( lastDamageInfo == NULL || getDamageTypeFlag( d->m_damageFXTypes, lastDamageInfo->in.m_damageType ) ) FXList::doFXPos(d->m_toppleDelayFXList, &m_delayBurstLocation); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ToppleUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ToppleUpdate.cpp index f37e0c29a8..9ec0426349 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ToppleUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ToppleUpdate.cpp @@ -145,7 +145,7 @@ void ToppleUpdate::applyTopplingForce( const Coord3D* toppleDirection, Real topp if (getObject()->isEffectivelyDead()) return; - //DEBUG_LOG(("awaking ToppleUpdate %08lx\n",this)); + //DEBUG_LOG(("awaking ToppleUpdate %08lx",this)); setWakeFrame(getObject(), UPDATE_SLEEP_NONE); const ToppleUpdateModuleData* d = getToppleUpdateModuleData(); @@ -267,7 +267,7 @@ static void deathByToppling(Object* obj) //------------------------------------------------------------------------------------------------- UpdateSleepTime ToppleUpdate::update() { - //DEBUG_LOG(("updating ToppleUpdate %08lx\n",this)); + //DEBUG_LOG(("updating ToppleUpdate %08lx",this)); DEBUG_ASSERTCRASH(m_toppleState != TOPPLE_UPRIGHT, ("hmm, we should be sleeping here")); if ( (m_toppleState == TOPPLE_UPRIGHT) || (m_toppleState == TOPPLE_DOWN) ) return UPDATE_SLEEP_FOREVER; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 86f33017ae..68560b36c8 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -502,7 +502,7 @@ Int WeaponTemplate::getDelayBetweenShots(const WeaponBonus& bonus) const delayToUse = GameLogicRandomValue( m_minDelayBetweenShots, m_maxDelayBetweenShots ); Real bonusROF = bonus.getField(WeaponBonus::RATE_OF_FIRE); - //CRCDEBUG_LOG(("WeaponTemplate::getDelayBetweenShots() - min:%d max:%d val:%d, bonusROF=%g/%8.8X\n", + //CRCDEBUG_LOG(("WeaponTemplate::getDelayBetweenShots() - min:%d max:%d val:%d, bonusROF=%g/%8.8X", //m_minDelayBetweenShots, m_maxDelayBetweenShots, delayToUse, bonusROF, AS_INT(bonusROF))); return REAL_TO_INT_FLOOR(delayToUse / bonusROF); @@ -738,7 +738,7 @@ Bool WeaponTemplate::shouldProjectileCollideWith( if ((getProjectileCollideMask() & requiredMask) != 0) return true; - //DEBUG_LOG(("Rejecting projectile collision between %s and %s!\n",projectile->getTemplate()->getName().str(),thingWeCollidedWith->getTemplate()->getName().str())); + //DEBUG_LOG(("Rejecting projectile collision between %s and %s!",projectile->getTemplate()->getName().str(),thingWeCollidedWith->getTemplate()->getName().str())); return false; } @@ -777,7 +777,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate #endif //end -extraLogging - //CRCDEBUG_LOG(("WeaponTemplate::fireWeaponTemplate() from %s\n", DescribeObject(sourceObj).str())); + //CRCDEBUG_LOG(("WeaponTemplate::fireWeaponTemplate() from %s", DescribeObject(sourceObj).str())); DEBUG_ASSERTCRASH(specificBarrelToUse >= 0, ("specificBarrelToUse should no longer be -1\n")); if (sourceObj == NULL || (victimObj == NULL && victimPos == NULL)) @@ -785,7 +785,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate //-extraLogging #if defined(RTS_DEBUG) if( TheGlobalData->m_extraLogging ) - DEBUG_LOG( ("FAIL 1 (sourceObj %d == NULL || (victimObj %d == NULL && victimPos %d == NULL)\n", sourceObj != 0, victimObj != 0, victimPos != 0) ); + DEBUG_LOG( ("FAIL 1 (sourceObj %d == NULL || (victimObj %d == NULL && victimPos %d == NULL)", sourceObj != 0, victimObj != 0, victimPos != 0) ); #endif //end -extraLogging @@ -850,7 +850,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate distSqr = ThePartitionManager->getDistanceSquared(sourceObj, victimPos, ATTACK_RANGE_CALC_TYPE); } -// DEBUG_LOG(("WeaponTemplate::fireWeaponTemplate: firing weapon %s (source=%s, victim=%s)\n", +// DEBUG_LOG(("WeaponTemplate::fireWeaponTemplate: firing weapon %s (source=%s, victim=%s)", // m_name.str(),sourceObj->getTemplate()->getName().str(),victimObj?victimObj->getTemplate()->getName().str():"NULL")); //Only perform this check if the weapon isn't a leech range weapon (which can have unlimited range!) @@ -864,7 +864,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate //-extraLogging #if defined(RTS_DEBUG) if( TheGlobalData->m_extraLogging ) - DEBUG_LOG( ("FAIL 2 (distSqr %.2f > attackRangeSqr %.2f)\n", distSqr, attackRangeSqr ) ); + DEBUG_LOG( ("FAIL 2 (distSqr %.2f > attackRangeSqr %.2f)", distSqr, attackRangeSqr ) ); #endif //end -extraLogging @@ -886,7 +886,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate //-extraLogging #if defined(RTS_DEBUG) if( TheGlobalData->m_extraLogging ) - DEBUG_LOG( ("FAIL 3 (distSqr %.2f< minAttackRangeSqr %.2f - 0.5f && !isProjectileDetonation %d)\n", distSqr, minAttackRangeSqr, isProjectileDetonation ) ); + DEBUG_LOG( ("FAIL 3 (distSqr %.2f< minAttackRangeSqr %.2f - 0.5f && !isProjectileDetonation %d)", distSqr, minAttackRangeSqr, isProjectileDetonation ) ); #endif //end -extraLogging @@ -942,7 +942,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate if (handled == false && fx != NULL) { // bah. just play it at the drawable's pos. - //DEBUG_LOG(("*** WeaponFireFX not fully handled by the client\n")); + //DEBUG_LOG(("*** WeaponFireFX not fully handled by the client")); const Coord3D* where = isContactWeapon() ? &targetPos : sourceObj->getDrawable()->getPosition(); FXList::doFXPos(fx, where, sourceObj->getDrawable()->getTransformMatrix(), getWeaponSpeed(), &targetPos, getPrimaryDamageRadius(bonus)); } @@ -1044,7 +1044,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate if (delayInFrames < 1.0f) { // go ahead and do it now - //DEBUG_LOG(("WeaponTemplate::fireWeaponTemplate: firing weapon immediately!\n")); + //DEBUG_LOG(("WeaponTemplate::fireWeaponTemplate: firing weapon immediately!")); if( inflictDamage ) { dealDamageInternal(sourceID, damageID, damagePos, bonus, isProjectileDetonation); @@ -1053,7 +1053,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate //-extraLogging #if defined(RTS_DEBUG) if( TheGlobalData->m_extraLogging ) - DEBUG_LOG( ("EARLY 4 (delayed damage applied now)\n") ); + DEBUG_LOG( ("EARLY 4 (delayed damage applied now)") ); #endif //end -extraLogging @@ -1067,14 +1067,14 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate { UnsignedInt delayInWholeFrames = REAL_TO_INT_CEIL(delayInFrames); when = TheGameLogic->getFrame() + delayInWholeFrames; - //DEBUG_LOG(("WeaponTemplate::fireWeaponTemplate: firing weapon in %d frames (= %d)!\n", delayInWholeFrames,when)); + //DEBUG_LOG(("WeaponTemplate::fireWeaponTemplate: firing weapon in %d frames (= %d)!", delayInWholeFrames,when)); TheWeaponStore->setDelayedDamage(this, damagePos, when, sourceID, damageID, bonus); } //-extraLogging #if defined(RTS_DEBUG) if( TheGlobalData->m_extraLogging ) - DEBUG_LOG( ("EARLY 5 (delaying damage applied until frame %d)\n", when ) ); + DEBUG_LOG( ("EARLY 5 (delaying damage applied until frame %d)", when ) ); #endif //end -extraLogging @@ -1165,7 +1165,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate //-extraLogging #if defined(RTS_DEBUG) if( TheGlobalData->m_extraLogging ) - DEBUG_LOG( ("DONE\n") ); + DEBUG_LOG( ("DONE") ); #endif //end -extraLogging @@ -1258,7 +1258,7 @@ void WeaponTemplate::dealDamageInternal(ObjectID sourceID, ObjectID victimID, co } // if historic bonuses -//DEBUG_LOG(("WeaponTemplate::dealDamageInternal: dealing damage %s at frame %d\n",m_name.str(),TheGameLogic->getFrame())); +//DEBUG_LOG(("WeaponTemplate::dealDamageInternal: dealing damage %s at frame %d",m_name.str(),TheGameLogic->getFrame())); // if there's a specific victim, use it's pos (overriding the value passed in) Object *primaryVictim = victimID ? TheGameLogic->findObjectByID(victimID) : NULL; // might be null... @@ -1340,7 +1340,7 @@ void WeaponTemplate::dealDamageInternal(ObjectID sourceID, ObjectID victimID, co // Remember that source is a missile for some units, and they don't want to injure them'selves' either if( source == curVictim || source->getProducerID() == curVictim->getID() ) { - //DEBUG_LOG(("skipping damage done to SELF...\n")); + //DEBUG_LOG(("skipping damage done to SELF...")); continue; } } @@ -1531,7 +1531,7 @@ void WeaponStore::createAndFireTempWeapon(const WeaponTemplate* wt, const Object //------------------------------------------------------------------------------------------------- void WeaponStore::createAndFireTempWeapon(const WeaponTemplate* wt, const Object *source, Object *target) { - //CRCDEBUG_LOG(("WeaponStore::createAndFireTempWeapon() for %s\n", DescribeObject(source))); + //CRCDEBUG_LOG(("WeaponStore::createAndFireTempWeapon() for %s", DescribeObject(source))); if (wt == NULL) return; Weapon* w = TheWeaponStore->allocateNewWeapon(wt, PRIMARY_WEAPON); @@ -1806,7 +1806,7 @@ void Weapon::computeBonus(const Object *source, WeaponBonusConditionFlags extraB { bonus.clear(); WeaponBonusConditionFlags flags = source->getWeaponBonusCondition(); - //CRCDEBUG_LOG(("Weapon::computeBonus() - flags are %X for %s\n", flags, DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::computeBonus() - flags are %X for %s", flags, DescribeObject(source).str())); flags |= extraBonusFlags; if( source->getContainedBy() ) @@ -1860,10 +1860,10 @@ void Weapon::setClipPercentFull(Real percent, Bool allowReduction) { m_ammoInClip = ammo; m_status = m_ammoInClip ? OUT_OF_AMMO : READY_TO_FIRE; - //CRCDEBUG_LOG(("Weapon::setClipPercentFull() just set m_status to %d (ammo in clip is %d)\n", m_status, m_ammoInClip)); + //CRCDEBUG_LOG(("Weapon::setClipPercentFull() just set m_status to %d (ammo in clip is %d)", m_status, m_ammoInClip)); m_whenLastReloadStarted = TheGameLogic->getFrame(); m_whenWeCanFireAgain = m_whenLastReloadStarted; - //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::setClipPercentFull\n", m_whenWeCanFireAgain)); + //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::setClipPercentFull", m_whenWeCanFireAgain)); rebuildScatterTargets(); } } @@ -1897,7 +1897,7 @@ void Weapon::reloadWithBonus(const Object *sourceObj, const WeaponBonus& bonus, Real reloadTime = loadInstantly ? 0 : m_template->getClipReloadTime(bonus); m_whenLastReloadStarted = TheGameLogic->getFrame(); m_whenWeCanFireAgain = m_whenLastReloadStarted + reloadTime; - //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::reloadWithBonus 1\n", m_whenWeCanFireAgain)); + //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::reloadWithBonus 1", m_whenWeCanFireAgain)); // if we are sharing reload times // go through other weapons in weapon set @@ -1911,7 +1911,7 @@ void Weapon::reloadWithBonus(const Object *sourceObj, const WeaponBonus& bonus, if (weapon) { weapon->setPossibleNextShotFrame(m_whenWeCanFireAgain); - //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::reloadWithBonus 2\n", m_whenWeCanFireAgain)); + //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::reloadWithBonus 2", m_whenWeCanFireAgain)); weapon->setStatus(RELOADING_CLIP); } } @@ -2473,7 +2473,7 @@ Bool Weapon::privateFireWeapon( Bool inflictDamage ) { - //CRCDEBUG_LOG(("Weapon::privateFireWeapon() for %s\n", DescribeObject(sourceObj).str())); + //CRCDEBUG_LOG(("Weapon::privateFireWeapon() for %s", DescribeObject(sourceObj).str())); //USE_PERF_TIMER(fireWeapon) if (projectileID) *projectileID = INVALID_ID; @@ -2645,17 +2645,17 @@ Bool Weapon::privateFireWeapon( { m_status = OUT_OF_AMMO; m_whenWeCanFireAgain = 0x7fffffff; - //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::privateFireWeapon 1\n", m_whenWeCanFireAgain)); + //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::privateFireWeapon 1", m_whenWeCanFireAgain)); } } else { m_status = BETWEEN_FIRING_SHOTS; - //CRCDEBUG_LOG(("Weapon::privateFireWeapon() just set m_status to BETWEEN_FIRING_SHOTS\n")); + //CRCDEBUG_LOG(("Weapon::privateFireWeapon() just set m_status to BETWEEN_FIRING_SHOTS")); Int delay = m_template->getDelayBetweenShots(bonus); m_whenLastReloadStarted = now; m_whenWeCanFireAgain = now + delay; - //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d (delay is %d) in Weapon::privateFireWeapon\n", m_whenWeCanFireAgain, delay)); + //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d (delay is %d) in Weapon::privateFireWeapon", m_whenWeCanFireAgain, delay)); // if we are sharing reload times // go through other weapons in weapon set @@ -2670,7 +2670,7 @@ Bool Weapon::privateFireWeapon( if (weapon) { weapon->setPossibleNextShotFrame(m_whenWeCanFireAgain); - //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::privateFireWeapon 3\n", m_whenWeCanFireAgain)); + //CRCDEBUG_LOG(("Just set m_whenWeCanFireAgain to %d in Weapon::privateFireWeapon 3", m_whenWeCanFireAgain)); weapon->setStatus(BETWEEN_FIRING_SHOTS); } } @@ -2701,7 +2701,7 @@ void Weapon::preFireWeapon( const Object *source, const Object *victim ) //------------------------------------------------------------------------------------------------- Bool Weapon::fireWeapon(const Object *source, Object *target, ObjectID* projectileID) { - //CRCDEBUG_LOG(("Weapon::fireWeapon() for %s at %s\n", DescribeObject(source).str(), DescribeObject(target).str())); + //CRCDEBUG_LOG(("Weapon::fireWeapon() for %s at %s", DescribeObject(source).str(), DescribeObject(target).str())); return privateFireWeapon( source, target, NULL, false, false, 0, projectileID, TRUE ); } @@ -2709,21 +2709,21 @@ Bool Weapon::fireWeapon(const Object *source, Object *target, ObjectID* projecti // return true if we auto-reloaded our clip after firing. Bool Weapon::fireWeapon(const Object *source, const Coord3D* pos, ObjectID* projectileID) { - //CRCDEBUG_LOG(("Weapon::fireWeapon() for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::fireWeapon() for %s", DescribeObject(source).str())); return privateFireWeapon( source, NULL, pos, false, false, 0, projectileID, TRUE ); } //------------------------------------------------------------------------------------------------- void Weapon::fireProjectileDetonationWeapon(const Object *source, Object *target, WeaponBonusConditionFlags extraBonusFlags, Bool inflictDamage ) { - //CRCDEBUG_LOG(("Weapon::fireProjectileDetonationWeapon() for %sat %s\n", DescribeObject(source).str(), DescribeObject(target).str())); + //CRCDEBUG_LOG(("Weapon::fireProjectileDetonationWeapon() for %sat %s", DescribeObject(source).str(), DescribeObject(target).str())); privateFireWeapon( source, target, NULL, true, false, extraBonusFlags, NULL, inflictDamage ); } //------------------------------------------------------------------------------------------------- void Weapon::fireProjectileDetonationWeapon(const Object *source, const Coord3D* pos, WeaponBonusConditionFlags extraBonusFlags, Bool inflictDamage ) { - //CRCDEBUG_LOG(("Weapon::fireProjectileDetonationWeapon() for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::fireProjectileDetonationWeapon() for %s", DescribeObject(source).str())); privateFireWeapon( source, NULL, pos, true, false, extraBonusFlags, NULL, inflictDamage ); } @@ -2732,7 +2732,7 @@ void Weapon::fireProjectileDetonationWeapon(const Object *source, const Coord3D* //and immediately gain control of the weapon that was fired to give it special orders... Object* Weapon::forceFireWeapon( const Object *source, const Coord3D *pos) { - //CRCDEBUG_LOG(("Weapon::forceFireWeapon() for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::forceFireWeapon() for %s", DescribeObject(source).str())); //Force the ammo to load instantly. //loadAmmoNow( source ); //Fire the weapon at the position. Internally, it'll store the weapon projectile ID if so created. @@ -2756,7 +2756,7 @@ WeaponStatus Weapon::getStatus() const m_status = READY_TO_FIRE; else m_status = OUT_OF_AMMO; - //CRCDEBUG_LOG(("Weapon::getStatus() just set m_status to %d (ammo in clip is %d)\n", m_status, m_ammoInClip)); + //CRCDEBUG_LOG(("Weapon::getStatus() just set m_status to %d (ammo in clip is %d)", m_status, m_ammoInClip)); } return m_status; } @@ -2783,7 +2783,7 @@ Bool Weapon::isWithinTargetPitch(const Object *source, const Object *victim) con (minPitch <= m_template->getMinTargetPitch() && maxPitch >= m_template->getMaxTargetPitch())) return true; - //DEBUG_LOG(("pitch %f-%f is out of range\n",rad2deg(minPitch),rad2deg(maxPitch),rad2deg(m_template->getMinTargetPitch()),rad2deg(m_template->getMaxTargetPitch()))); + //DEBUG_LOG(("pitch %f-%f is out of range",rad2deg(minPitch),rad2deg(maxPitch),rad2deg(m_template->getMinTargetPitch()),rad2deg(m_template->getMaxTargetPitch()))); return false; } @@ -2947,16 +2947,16 @@ void Weapon::processRequestAssistance( const Object *requestingObject, Object *v Real turretPitch = 0.0f; const AIUpdateInterface* ai = launcher->getAIUpdateInterface(); WhichTurretType tur = ai ? ai->getWhichTurretForWeaponSlot(wslot, &turretAngle, &turretPitch) : TURRET_INVALID; - //CRCDEBUG_LOG(("calcProjectileLaunchPosition(): Turret %d, slot %d, barrel %d for %s\n", tur, wslot, specificBarrelToUse, DescribeObject(launcher).str())); + //CRCDEBUG_LOG(("calcProjectileLaunchPosition(): Turret %d, slot %d, barrel %d for %s", tur, wslot, specificBarrelToUse, DescribeObject(launcher).str())); Matrix3D attachTransform(true); Coord3D turretRotPos = {0.0f, 0.0f, 0.0f}; Coord3D turretPitchPos = {0.0f, 0.0f, 0.0f}; const Drawable* draw = launcher->getDrawable(); - //CRCDEBUG_LOG(("Do we have a drawable? %d\n", (draw != NULL))); + //CRCDEBUG_LOG(("Do we have a drawable? %d", (draw != NULL))); if (!draw || !draw->getProjectileLaunchOffset(wslot, specificBarrelToUse, &attachTransform, tur, &turretRotPos, &turretPitchPos)) { - //CRCDEBUG_LOG(("ProjectileLaunchPos %d %d not found!\n",wslot, specificBarrelToUse)); + //CRCDEBUG_LOG(("ProjectileLaunchPos %d %d not found!",wslot, specificBarrelToUse)); DEBUG_CRASH(("ProjectileLaunchPos %d %d not found!\n",wslot, specificBarrelToUse)); attachTransform.Make_Identity(); turretRotPos.zero(); @@ -3010,7 +3010,7 @@ void Weapon::processRequestAssistance( const Object *requestingObject, Object *v Int specificBarrelToUse ) { - //CRCDEBUG_LOG(("Weapon::positionProjectileForLaunch() for %s from %s\n", + //CRCDEBUG_LOG(("Weapon::positionProjectileForLaunch() for %s from %s", //DescribeObject(projectile).str(), DescribeObject(launcher).str())); // if our launch vehicle is gone, destroy ourselves @@ -3077,12 +3077,12 @@ Bool Weapon::isClearFiringLineOfSightTerrain(const Object* source, const Object* { Coord3D origin; origin = *source->getPosition(); - //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain(Object) for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain(Object) for %s", DescribeObject(source).str())); //DUMPCOORD3D(&origin); getFiringLineOfSightOrigin(source, origin); Coord3D victimPos; victim->getGeometryInfo().getCenterPosition( *victim->getPosition(), victimPos ); - //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain() - victimPos is (%g,%g,%g) (%X,%X,%X)\n", + //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain() - victimPos is (%g,%g,%g) (%X,%X,%X)", // victimPos.x, victimPos.y, victimPos.z, // AS_INT(victimPos.x),AS_INT(victimPos.y),AS_INT(victimPos.z))); return ThePartitionManager->isClearLineOfSightTerrain(NULL, origin, NULL, victimPos); @@ -3094,7 +3094,7 @@ Bool Weapon::isClearFiringLineOfSightTerrain(const Object* source, const Coord3D { Coord3D origin; origin = *source->getPosition(); - //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain(Coord3D) for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain(Coord3D) for %s", DescribeObject(source).str())); //DUMPCOORD3D(&origin); getFiringLineOfSightOrigin(source, origin); return ThePartitionManager->isClearLineOfSightTerrain(NULL, origin, NULL, victimPos); @@ -3106,7 +3106,7 @@ Bool Weapon::isClearFiringLineOfSightTerrain(const Object* source, const Coord3D Bool Weapon::isClearGoalFiringLineOfSightTerrain(const Object* source, const Coord3D& goalPos, const Object* victim) const { Coord3D origin=goalPos; - //CRCDEBUG_LOG(("Weapon::isClearGoalFiringLineOfSightTerrain(Object) for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::isClearGoalFiringLineOfSightTerrain(Object) for %s", DescribeObject(source).str())); //DUMPCOORD3D(&origin); getFiringLineOfSightOrigin(source, origin); Coord3D victimPos; @@ -3120,10 +3120,10 @@ Bool Weapon::isClearGoalFiringLineOfSightTerrain(const Object* source, const Coo Bool Weapon::isClearGoalFiringLineOfSightTerrain(const Object* source, const Coord3D& goalPos, const Coord3D& victimPos) const { Coord3D origin=goalPos; - //CRCDEBUG_LOG(("Weapon::isClearGoalFiringLineOfSightTerrain(Coord3D) for %s\n", DescribeObject(source).str())); + //CRCDEBUG_LOG(("Weapon::isClearGoalFiringLineOfSightTerrain(Coord3D) for %s", DescribeObject(source).str())); //DUMPCOORD3D(&origin); getFiringLineOfSightOrigin(source, origin); - //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain() - victimPos is (%g,%g,%g) (%X,%X,%X)\n", + //CRCDEBUG_LOG(("Weapon::isClearFiringLineOfSightTerrain() - victimPos is (%g,%g,%g) (%X,%X,%X)", // victimPos.x, victimPos.y, victimPos.z, // AS_INT(victimPos.x),AS_INT(victimPos.y),AS_INT(victimPos.z))); return ThePartitionManager->isClearLineOfSightTerrain(NULL, origin, NULL, victimPos); @@ -3337,7 +3337,7 @@ void Weapon::crc( Xfer *xfer ) #ifdef DEBUG_CRC if (doLogging) { - CRCDEBUG_LOG(("%s\n", logString.str())); + CRCDEBUG_LOG(("%s", logString.str())); } #endif // DEBUG_CRC diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp index 8d3c7d16de..b9aa4dee46 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp @@ -336,7 +336,7 @@ void WeaponSet::updateWeaponSet(const Object* obj) } } m_curWeaponTemplateSet = set; - //DEBUG_LOG(("WeaponSet::updateWeaponSet -- changed curweapon to %s\n",getCurWeapon()->getName().str())); + //DEBUG_LOG(("WeaponSet::updateWeaponSet -- changed curweapon to %s",getCurWeapon()->getName().str())); } } @@ -962,7 +962,7 @@ Bool WeaponSet::chooseBestWeaponForTarget(const Object* obj, const Object* victi m_curWeapon = PRIMARY_WEAPON; } - //DEBUG_LOG(("WeaponSet::chooseBestWeaponForTarget -- changed curweapon to %s\n",getCurWeapon()->getName().str())); + //DEBUG_LOG(("WeaponSet::chooseBestWeaponForTarget -- changed curweapon to %s",getCurWeapon()->getName().str())); return found; } @@ -1068,13 +1068,13 @@ Bool WeaponSet::setWeaponLock( WeaponSlotType weaponSlot, WeaponLockType lockTyp { m_curWeapon = weaponSlot; m_curWeaponLockedStatus = lockType; - //DEBUG_LOG(("WeaponSet::setWeaponLock permanently -- changed curweapon to %s\n",getCurWeapon()->getName().str())); + //DEBUG_LOG(("WeaponSet::setWeaponLock permanently -- changed curweapon to %s",getCurWeapon()->getName().str())); } else if( lockType == LOCKED_TEMPORARILY && m_curWeaponLockedStatus != LOCKED_PERMANENTLY ) { m_curWeapon = weaponSlot; m_curWeaponLockedStatus = lockType; - //DEBUG_LOG(("WeaponSet::setWeaponLock temporarily -- changed curweapon to %s\n",getCurWeapon()->getName().str())); + //DEBUG_LOG(("WeaponSet::setWeaponLock temporarily -- changed curweapon to %s",getCurWeapon()->getName().str())); } return true; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp index e32db66969..b933f10753 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp @@ -426,7 +426,7 @@ void ScriptActions::doMoveToWaypoint(const AsciiString& team, const AsciiString& Waypoint *way = TheTerrainLogic->getWaypointByName(waypoint); if (way) { Coord3D destination = *way->getLocation(); - //DEBUG_LOG(("Moving team to waypoint %f, %f, %f\n", destination.x, destination.y, destination.z)); + //DEBUG_LOG(("Moving team to waypoint %f, %f, %f", destination.x, destination.y, destination.z)); theGroup->groupMoveToPosition( &destination, false, CMD_FROM_SCRIPT ); } } @@ -515,7 +515,7 @@ void ScriptActions::doCreateReinforcements(const AsciiString& team, const AsciiS destination = *way->getLocation(); if (!theTeamProto) { - DEBUG_LOG(("***WARNING - Team %s not found.\n", team.str())); + DEBUG_LOG(("***WARNING - Team %s not found.", team.str())); return; } const TeamTemplateInfo *pInfo = theTeamProto->getTemplateInfo(); @@ -1002,7 +1002,7 @@ void ScriptActions::doCreateObject(const AsciiString& objectName, const AsciiStr if (!theTeam) { TheScriptEngine->AppendDebugMessage("***WARNING - Team not found:***", false); TheScriptEngine->AppendDebugMessage(teamName, true); - DEBUG_LOG(("WARNING - Team %s not found.\n", teamName.str())); + DEBUG_LOG(("WARNING - Team %s not found.", teamName.str())); return; } const ThingTemplate *thingTemplate; @@ -1034,7 +1034,7 @@ void ScriptActions::doCreateObject(const AsciiString& objectName, const AsciiStr } // end if } else { - DEBUG_LOG(("WARNING - ThingTemplate '%s' not found.\n", thingName.str())); + DEBUG_LOG(("WARNING - ThingTemplate '%s' not found.", thingName.str())); } } @@ -1193,7 +1193,7 @@ void ScriptActions::createUnitOnTeamAt(const AsciiString& unitName, const AsciiS if (!theTeam) { TheScriptEngine->AppendDebugMessage("***WARNING - Team not found:***", false); TheScriptEngine->AppendDebugMessage(teamName, true); - DEBUG_LOG(("WARNING - Team %s not found.\n", teamName.str())); + DEBUG_LOG(("WARNING - Team %s not found.", teamName.str())); return; } const ThingTemplate *thingTemplate; @@ -1221,7 +1221,7 @@ void ScriptActions::createUnitOnTeamAt(const AsciiString& unitName, const AsciiS } } // end if } else { - DEBUG_LOG(("WARNING - ThingTemplate '%s' not found.\n", objType.str())); + DEBUG_LOG(("WARNING - ThingTemplate '%s' not found.", objType.str())); } } @@ -3057,7 +3057,7 @@ static PlayerMaskType getHumanPlayerMask( void ) mask &= player->getPlayerMask(); } - //DEBUG_LOG(("getHumanPlayerMask(): mask was %4.4X\n", mask)); + //DEBUG_LOG(("getHumanPlayerMask(): mask was %4.4X", mask)); return mask; } @@ -3116,22 +3116,22 @@ void ScriptActions::doShroudMapAtWaypoint(const AsciiString& waypointName, Real //------------------------------------------------------------------------------------------------- void ScriptActions::doRevealMapEntire(const AsciiString& playerName) { - DEBUG_LOG(("ScriptActions::doRevealMapEntire() for player named '%s'\n", playerName.str())); + DEBUG_LOG(("ScriptActions::doRevealMapEntire() for player named '%s'", playerName.str())); Player* player = TheScriptEngine->getPlayerFromAsciiString(playerName); if (player && playerName.isNotEmpty()) { - DEBUG_LOG(("ScriptActions::doRevealMapEntire() for player named '%ls' in position %d\n", player->getPlayerDisplayName().str(), player->getPlayerIndex())); + DEBUG_LOG(("ScriptActions::doRevealMapEntire() for player named '%ls' in position %d", player->getPlayerDisplayName().str(), player->getPlayerIndex())); ThePartitionManager->revealMapForPlayer( player->getPlayerIndex() ); } else { - DEBUG_LOG(("ScriptActions::doRevealMapEntire() - no player, so doing all human players\n")); + DEBUG_LOG(("ScriptActions::doRevealMapEntire() - no player, so doing all human players")); for (Int i=0; igetPlayerCount(); ++i) { Player *player = ThePlayerList->getNthPlayer(i); if (player->getPlayerType() == PLAYER_HUMAN) { - DEBUG_LOG(("ScriptActions::doRevealMapEntire() for player %d\n", i)); + DEBUG_LOG(("ScriptActions::doRevealMapEntire() for player %d", i)); ThePartitionManager->revealMapForPlayer( i ); } } @@ -3155,7 +3155,7 @@ void ScriptActions::doRevealMapEntirePermanently( Bool reveal, const AsciiString Player *player = ThePlayerList->getNthPlayer(i); if (player->getPlayerType() == PLAYER_HUMAN) { - DEBUG_LOG(("ScriptActions::doRevealMapEntirePermanently() for player %d\n", i)); + DEBUG_LOG(("ScriptActions::doRevealMapEntirePermanently() for player %d", i)); if( reveal ) ThePartitionManager->revealMapForPlayerPermanently( i ); else @@ -3182,7 +3182,7 @@ void ScriptActions::doShroudMapEntire(const AsciiString& playerName) Player *player = ThePlayerList->getNthPlayer(i); if (player->getPlayerType() == PLAYER_HUMAN) { - DEBUG_LOG(("ScriptActions::doShroudMapEntire() for player %d\n", i)); + DEBUG_LOG(("ScriptActions::doShroudMapEntire() for player %d", i)); ThePartitionManager->shroudMapForPlayer( i ); } } @@ -3307,7 +3307,7 @@ void ScriptActions::doIdleAllPlayerUnits(const AsciiString& playerName) Player *player = ThePlayerList->getNthPlayer(i); if (player->getPlayerType() == PLAYER_HUMAN) { - DEBUG_LOG(("ScriptActions::doIdleAllPlayerUnits() for player %d\n", i)); + DEBUG_LOG(("ScriptActions::doIdleAllPlayerUnits() for player %d", i)); player->setUnitsShouldIdleOrResume(true); } } @@ -3331,7 +3331,7 @@ void ScriptActions::doResumeSupplyTruckingForIdleUnits(const AsciiString& player Player *player = ThePlayerList->getNthPlayer(i); if (player->getPlayerType() == PLAYER_HUMAN) { - DEBUG_LOG(("ScriptActions::doResumeSupplyTruckingForIdleUnits() for player %d\n", i)); + DEBUG_LOG(("ScriptActions::doResumeSupplyTruckingForIdleUnits() for player %d", i)); player->setUnitsShouldIdleOrResume(false); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp index b6b79a32f5..8b8719c28c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp @@ -195,13 +195,13 @@ Int AttackPriorityInfo::getPriority(const ThingTemplate *tThing) const void AttackPriorityInfo::dumpPriorityInfo(void) { #ifdef DEBUG_LOGGING - DEBUG_LOG(("Attack priority '%s', default %d\n", m_name.str(), m_defaultPriority)); + DEBUG_LOG(("Attack priority '%s', default %d", m_name.str(), m_defaultPriority)); if (m_priorityMap==NULL) return; for (AttackPriorityMap::const_iterator it = m_priorityMap->begin(); it != m_priorityMap->end(); ++it) { const ThingTemplate *tThing = (*it).first; Int priority = (*it).second; - DEBUG_LOG((" Thing '%s' priority %d\n",tThing->getName().str(), priority)); + DEBUG_LOG((" Thing '%s' priority %d",tThing->getName().str(), priority)); } #endif } @@ -397,7 +397,7 @@ void ScriptEngine::addActionTemplateInfo( Template *actionTemplate) return; } } - DEBUG_LOG(("Couldn't find script action named %s\n", actionTemplate->m_internalName.str())); + DEBUG_LOG(("Couldn't find script action named %s", actionTemplate->m_internalName.str())); } //------------------------------------------------------------------------------------------------- @@ -508,12 +508,12 @@ ScriptEngine::~ScriptEngine() #ifdef COUNT_SCRIPT_USAGE Int i; for (i=0; i 1) { - DEBUG_LOG(("\n***SCRIPT ENGINE STATS %.0f frames:\n", m_numFrames)); - DEBUG_LOG(("Avg time to update %.3f milisec\n", 1000*m_totalUpdateTime/m_numFrames)); - DEBUG_LOG((" Max time to update %.3f miliseconds.\n", m_maxUpdateTime*1000)); + DEBUG_LOG(("\n***SCRIPT ENGINE STATS %.0f frames:", m_numFrames)); + DEBUG_LOG(("Avg time to update %.3f milisec", 1000*m_totalUpdateTime/m_numFrames)); + DEBUG_LOG((" Max time to update %.3f miliseconds.", m_maxUpdateTime*1000)); } m_numFrames=0; m_totalUpdateTime=0; @@ -5359,14 +5359,14 @@ void ScriptEngine::reset( void ) } } if (maxScript) { - DEBUG_LOG((" SCRIPT %s total time %f seconds,\n evaluated %d times, avg execution %2.3f msec (Goal less than 0.05)\n", + DEBUG_LOG((" SCRIPT %s total time %f seconds,\n evaluated %d times, avg execution %2.3f msec (Goal less than 0.05)", maxScript->getName().str(), maxScript->getConditionTime(), maxScript->getConditionCount(), 1000*maxScript->getConditionTime()/maxScript->getConditionCount()) ); maxScript->addToConditionTime(-2*maxTime); // reset to negative. } } - DEBUG_LOG(("***\n")); + DEBUG_LOG(("***")); } #endif #endif @@ -5510,9 +5510,9 @@ void ScriptEngine::update( void ) AsciiString name = it->first; Object * obj = it->second; if (obj && obj->getAIUpdateInterface()) - DEBUG_LOG(("%s=%x('%s'), isDead%d\n", name.str(), obj, obj->getName().str(), obj->getAIUpdateInterface()->isDead())); + DEBUG_LOG(("%s=%x('%s'), isDead%d", name.str(), obj, obj->getName().str(), obj->getAIUpdateInterface()->isDead())); } - DEBUG_LOG(("\n\n")); + DEBUG_LOG(("\n")); */ #endif #endif @@ -6053,7 +6053,7 @@ void ScriptEngine::runScript(const AsciiString& scriptName, Team *pThisTeam) } else { AppendDebugMessage("***Attempting to call script that is not a subroutine:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.\n", scriptName.str())); + DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.", scriptName.str())); } } else { pScript = findScript(scriptName); @@ -6063,12 +6063,12 @@ void ScriptEngine::runScript(const AsciiString& scriptName, Team *pThisTeam) } else { AppendDebugMessage("***Attempting to call script that is not a subroutine:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.\n", scriptName.str())); + DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.", scriptName.str())); } } else { AppendDebugMessage("***Script not defined:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("WARNING: Script '%s' not defined.\n", scriptName.str())); + DEBUG_LOG(("WARNING: Script '%s' not defined.", scriptName.str())); } } // m_callingTeam is restored automatically via LatchRestore @@ -6100,7 +6100,7 @@ void ScriptEngine::runObjectScript(const AsciiString& scriptName, Object *pThisO } else { AppendDebugMessage("***Attempting to call script that is not a subroutine:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.\n", scriptName.str())); + DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.", scriptName.str())); } } else { pScript = findScript(scriptName); @@ -6110,12 +6110,12 @@ void ScriptEngine::runObjectScript(const AsciiString& scriptName, Object *pThisO } else { AppendDebugMessage("***Attempting to call script that is not a subroutine:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.\n", scriptName.str())); + DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.", scriptName.str())); } } else { AppendDebugMessage("***Script not defined:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("WARNING: Script '%s' not defined.\n", scriptName.str())); + DEBUG_LOG(("WARNING: Script '%s' not defined.", scriptName.str())); } } m_callingObject = pSavCallingObject; @@ -6859,7 +6859,7 @@ void ScriptEngine::callSubroutine( ScriptAction *pAction ) } else { AppendDebugMessage("***Attempting to call script that is not a subroutine:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.\n", scriptName.str())); + DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.", scriptName.str())); } } else { pScript = findScript(scriptName); @@ -6869,12 +6869,12 @@ void ScriptEngine::callSubroutine( ScriptAction *pAction ) } else { AppendDebugMessage("***Attempting to call script that is not a subroutine:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.\n", scriptName.str())); + DEBUG_LOG(("Attempting to call script '%s' that is not a subroutine.", scriptName.str())); } } else { AppendDebugMessage("***Script not defined:***", false); AppendDebugMessage(scriptName, false); - DEBUG_LOG(("WARNING: Script '%s' not defined.\n", scriptName.str())); + DEBUG_LOG(("WARNING: Script '%s' not defined.", scriptName.str())); } } } @@ -6921,7 +6921,7 @@ void ScriptEngine::checkConditionsForTeamNames(Script *pScript) AppendDebugMessage(scriptName, false); AppendDebugMessage(multiTeamName, false); AppendDebugMessage(teamName, false); - DEBUG_LOG(("WARNING: Script '%s' contains multiple non-singleton team conditions: %s & %s.\n", scriptName.str(), + DEBUG_LOG(("WARNING: Script '%s' contains multiple non-singleton team conditions: %s & %s.", scriptName.str(), multiTeamName.str(), teamName.str())); } } @@ -7893,7 +7893,7 @@ void ScriptEngine::evaluateAndProgressAllSequentialScripts( void ) if (spinCount > MAX_SPIN_COUNT) { SequentialScript *seqScript = (*it); if (seqScript) { - DEBUG_LOG(("Sequential script %s appears to be in an infinite loop.\n", + DEBUG_LOG(("Sequential script %s appears to be in an infinite loop.", seqScript->m_scriptToExecuteSequentially->getName().str())); } ++it; @@ -8495,7 +8495,7 @@ void ScriptEngine::forceUnfreezeTime(void) void ScriptEngine::AppendDebugMessage(const AsciiString& strToAdd, Bool forcePause) { #ifdef INTENSE_DEBUG - DEBUG_LOG(("-SCRIPT- %d %s\n", TheGameLogic->getFrame(), strToAdd.str())); + DEBUG_LOG(("-SCRIPT- %d %s", TheGameLogic->getFrame(), strToAdd.str())); #endif typedef void (*funcptr)(const char*); if (!st_DebugDLL) { @@ -8823,7 +8823,7 @@ static void xferListAsciiStringCoord3D( Xfer *xfer, ListAsciiStringCoord3D *list // ------------------------------------------------------------------------------------------------ void ScriptEngine::setGlobalDifficulty( GameDifficulty difficulty ) { - DEBUG_LOG(("ScriptEngine::setGlobalDifficulty(%d)\n", ((Int)difficulty))); + DEBUG_LOG(("ScriptEngine::setGlobalDifficulty(%d)", ((Int)difficulty))); m_gameDifficulty = difficulty; } @@ -9371,7 +9371,7 @@ void _appendMessage(const AsciiString& str, Bool isTrueMessage, Bool shouldPause msg.concat(str); #ifdef INTENSE_DEBUG - DEBUG_LOG(("-SCRIPT- %s\n", msg.str())); + DEBUG_LOG(("-SCRIPT- %s", msg.str())); #endif if (!st_DebugDLL) { return; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp index 37fc1ce7bb..3e4e3a51bb 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp @@ -1699,7 +1699,7 @@ Bool Condition::ParseConditionDataChunk(DataChunkInput &file, DataChunkInfo *inf ct = TheScriptEngine->getConditionTemplate(i); if (key == ct->m_internalNameKey) { match = true; - DEBUG_LOG(("Rematching script condition %s\n", KEYNAME(key).str())); + DEBUG_LOG(("Rematching script condition %s", KEYNAME(key).str())); pCondition->m_conditionType = (enum ConditionType)i; break; } @@ -2163,7 +2163,7 @@ Parameter *Parameter::ReadParameter(DataChunkInput &file) strcpy(newName, "GLA"); strcat(newName, oldName+strlen("Fundamentalist")); pParm->m_string.set(newName); - DEBUG_LOG(("Changing Script Ref from %s to %s\n", oldName, newName)); + DEBUG_LOG(("Changing Script Ref from %s to %s", oldName, newName)); } } @@ -2461,7 +2461,7 @@ ScriptAction *ScriptAction::ParseAction(DataChunkInput &file, DataChunkInfo *inf at = TheScriptEngine->getActionTemplate(i); if (key == at->m_internalNameKey) { match = true; - DEBUG_LOG(("Rematching script action %s\n", KEYNAME(key).str())); + DEBUG_LOG(("Rematching script action %s", KEYNAME(key).str())); pScriptAction->m_actionType = (enum ScriptActionType)i; break; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/VictoryConditions.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/VictoryConditions.cpp index 0a30299e9f..54a46d3c58 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/VictoryConditions.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/VictoryConditions.cpp @@ -205,7 +205,7 @@ void VictoryConditions::update( void ) GameSlot *slot = (TheGameInfo)?TheGameInfo->getSlot(idx):NULL; if (slot && slot->isAI()) { - DEBUG_LOG(("Marking AI player %s as defeated\n", pName.str())); + DEBUG_LOG(("Marking AI player %s as defeated", pName.str())); slot->setLastFrameInGame(TheGameLogic->getFrame()); } } @@ -310,10 +310,10 @@ void VictoryConditions::cachePlayerPtrs( void ) for (Int i=0; igetNthPlayer(i); - DEBUG_LOG(("Checking whether to cache player %d - [%ls], house [%ls]\n", i, player?player->getPlayerDisplayName().str():L"", (player&&player->getPlayerTemplate())?player->getPlayerTemplate()->getDisplayName().str():L"")); + DEBUG_LOG(("Checking whether to cache player %d - [%ls], house [%ls]", i, player?player->getPlayerDisplayName().str():L"", (player&&player->getPlayerTemplate())?player->getPlayerTemplate()->getDisplayName().str():L"")); if (player && player != ThePlayerList->getNeutralPlayer() && player->getPlayerTemplate() && player->getPlayerTemplate() != civTemplate && !player->isPlayerObserver()) { - DEBUG_LOG(("Caching player\n")); + DEBUG_LOG(("Caching player")); m_players[playerCount] = player; if (m_players[playerCount]->isLocalPlayer()) m_localSlotNum = playerCount; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index ac4d4d6cfd..e0df08d644 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -526,8 +526,8 @@ static Object * placeObjectAtPosition(Int slotNum, AsciiString objectTemplateNam obj->setOrientation(obj->getTemplate()->getPlacementViewAngle()); obj->setPosition( &pos ); - //DEBUG_LOG(("Placed a starting building for %s at waypoint %s\n", playerName.str(), waypointName.str())); - CRCDEBUG_LOG(("Placed an object for %ls at pos (%g,%g,%g)\n", pPlayer->getPlayerDisplayName().str(), + //DEBUG_LOG(("Placed a starting building for %s at waypoint %s", playerName.str(), waypointName.str())); + CRCDEBUG_LOG(("Placed an object for %ls at pos (%g,%g,%g)", pPlayer->getPlayerDisplayName().str(), pos.x, pos.y, pos.z)); DUMPCOORD3D(&pos); @@ -548,7 +548,7 @@ static Object * placeObjectAtPosition(Int slotNum, AsciiString objectTemplateNam team->setActive(); TheAI->pathfinder()->addObjectToPathfindMap(obj); if (obj->getAIUpdateInterface() && !obj->isKindOf(KINDOF_IMMOBILE)) { - CRCDEBUG_LOG(("Not immobile - adjusting dest\n")); + CRCDEBUG_LOG(("Not immobile - adjusting dest")); if (TheAI->pathfinder()->adjustDestination(obj, obj->getAIUpdateInterface()->getLocomotorSet(), &pos)) { DUMPCOORD3D(&pos); TheAI->pathfinder()->updateGoal(obj, &pos, LAYER_GROUND); // Units always start on the ground for now. jba. @@ -585,7 +585,7 @@ static void placeNetworkBuildingsForPlayer(Int slotNum, const GameSlot *pSlot, P if (buildingTemplateName.isEmpty()) return; - DEBUG_LOG(("Placing starting building at waypoint %s\n", waypointName.str())); + DEBUG_LOG(("Placing starting building at waypoint %s", waypointName.str())); Object *conYard = placeObjectAtPosition(slotNum, buildingTemplateName, pos, pPlayer, pTemplate); if (!conYard) @@ -613,7 +613,7 @@ static void placeNetworkBuildingsForPlayer(Int slotNum, const GameSlot *pSlot, P FindPositionOptions options; options.minRadius = conYard->getGeometryInfo().getBoundingSphereRadius() * 0.7f; options.maxRadius = conYard->getGeometryInfo().getBoundingSphereRadius() * 1.3f; - DEBUG_LOG(("Placing starting object %d (%s)\n", i, objName.str())); + DEBUG_LOG(("Placing starting object %d (%s)", i, objName.str())); ThePartitionManager->update(); Bool foundPos = ThePartitionManager->findPositionAround(&pos, &options, &objPos); if (foundPos) @@ -625,7 +625,7 @@ static void placeNetworkBuildingsForPlayer(Int slotNum, const GameSlot *pSlot, P } else { - DEBUG_LOG(("Could not find position\n")); + DEBUG_LOG(("Could not find position")); } } } @@ -723,7 +723,7 @@ static void checkForDuplicateColors( GameInfo *game ) } else if (colorIdx >= 0) { - DEBUG_LOG(("Clearing color %d for player %d\n", colorIdx, i)); + DEBUG_LOG(("Clearing color %d for player %d", colorIdx, i)); } } } @@ -773,7 +773,7 @@ static void populateRandomSideAndColor( GameInfo *game ) // clean up random factions Int playerTemplateIdx = slot->getPlayerTemplate(); - DEBUG_LOG(("Player %d has playerTemplate index %d\n", i, playerTemplateIdx)); + DEBUG_LOG(("Player %d has playerTemplate index %d", i, playerTemplateIdx)); while (playerTemplateIdx != PLAYERTEMPLATE_OBSERVER && (playerTemplateIdx < 0 || playerTemplateIdx >= ThePlayerTemplateStore->getPlayerTemplateCount())) { DEBUG_ASSERTCRASH(playerTemplateIdx == PLAYERTEMPLATE_RANDOM, ("Non-random bad playerTemplate %d in slot %d\n", playerTemplateIdx, i)); @@ -801,7 +801,7 @@ static void populateRandomSideAndColor( GameInfo *game ) } else { - DEBUG_LOG(("Setting playerTemplateIdx %d to %d\n", i, playerTemplateIdx)); + DEBUG_LOG(("Setting playerTemplateIdx %d to %d", i, playerTemplateIdx)); slot->setPlayerTemplate(playerTemplateIdx); } } @@ -816,7 +816,7 @@ static void populateRandomSideAndColor( GameInfo *game ) if (game->isColorTaken(colorIdx)) colorIdx = -1; } - DEBUG_LOG(("Setting color %d to %d\n", i, colorIdx)); + DEBUG_LOG(("Setting color %d to %d", i, colorIdx)); slot->setColor(colorIdx); } } @@ -957,7 +957,7 @@ static void populateRandomStartPosition( GameInfo *game ) if (game->isStartPositionTaken(posIdx)) posIdx = -1; } - DEBUG_LOG(("Setting start position %d to %d (random choice)\n", i, posIdx)); + DEBUG_LOG(("Setting start position %d to %d (random choice)", i, posIdx)); slot->setStartPos(posIdx); taken[posIdx] = TRUE; hasStartSpotBeenPicked = TRUE; @@ -992,7 +992,7 @@ static void populateRandomStartPosition( GameInfo *game ) if (game->isStartPositionTaken(posIdx)) posIdx = -1; } - DEBUG_LOG(("Setting start position %d to %d (random choice)\n", i, posIdx)); + DEBUG_LOG(("Setting start position %d to %d (random choice)", i, posIdx)); hasStartSpotBeenPicked = TRUE; slot->setStartPos(posIdx); taken[posIdx] = TRUE; @@ -1089,7 +1089,7 @@ static void populateRandomStartPosition( GameInfo *game ) if (!game->isStartPositionTaken(posIdx)) posIdx = -1; } - DEBUG_LOG(("Setting observer start position %d to %d\n", i, posIdx)); + DEBUG_LOG(("Setting observer start position %d to %d", i, posIdx)); slot->setStartPos(posIdx); } } @@ -1214,12 +1214,12 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) { if (TheLAN) { - DEBUG_LOG(("Starting network game\n")); + DEBUG_LOG(("Starting network game")); TheGameInfo = game = TheLAN->GetMyGame(); } else { - DEBUG_LOG(("Starting gamespy game\n")); + DEBUG_LOG(("Starting gamespy game")); TheGameInfo = game = TheGameSpyGame; /// @todo: MDC add back in after demo } } @@ -1333,7 +1333,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) GetPrecisionTimer(&endTime64); char Buf[256]; sprintf(Buf,"After terrainlogic->loadmap=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); - //DEBUG_LOG(("Placed a starting building for %s at waypoint %s\n", playerName.str(), waypointName.str())); + //DEBUG_LOG(("Placed a starting building for %s at waypoint %s", playerName.str(), waypointName.str())); DEBUG_LOG(("%s", Buf)); #endif @@ -1347,7 +1347,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) TheSidesList->prepareForMP_or_Skirmish(); } - //DEBUG_LOG(("Starting LAN game with %d players\n", game->getNumPlayers())); + //DEBUG_LOG(("Starting LAN game with %d players", game->getNumPlayers())); Dict d; for (int i=0; igetTeamNumber(); - DEBUG_LOG(("Looking for allies of player %d, team %d\n", i, team)); + DEBUG_LOG(("Looking for allies of player %d, team %d", i, team)); for(int j=0; j < MAX_SLOTS; ++j) { GameSlot *teamSlot = game->getSlot(j); @@ -1394,7 +1394,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) if(i == j || !teamSlot->isOccupied()) continue; - DEBUG_LOG(("Player %d is team %d\n", j, teamSlot->getTeamNumber())); + DEBUG_LOG(("Player %d is team %d", j, teamSlot->getTeamNumber())); AsciiString teamPlayerName; teamPlayerName.format("player%d", j); @@ -1402,7 +1402,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) // then their our enemy Bool isEnemy = FALSE; if(team == -1 || teamSlot->getTeamNumber() != team ) isEnemy = TRUE; - DEBUG_LOG(("Player %d is %s\n", j, (isEnemy)?"enemy":"ally")); + DEBUG_LOG(("Player %d is %s", j, (isEnemy)?"enemy":"ally")); if (isEnemy) { @@ -1420,7 +1420,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) } d.setAsciiString(TheKey_playerAllies, alliesString); d.setAsciiString(TheKey_playerEnemies, enemiesString); - DEBUG_LOG(("Player %d's teams are: allies=%s, enemies=%s\n", i,alliesString.str(),enemiesString.str())); + DEBUG_LOG(("Player %d's teams are: allies=%s, enemies=%s", i,alliesString.str(),enemiesString.str())); /* Int colorIdx = slot->getColor(); @@ -1433,7 +1433,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) if (game->isColorTaken(colorIdx)) colorIdx = -1; } - DEBUG_LOG(("Setting color %d to %d\n", i, colorIdx)); + DEBUG_LOG(("Setting color %d to %d", i, colorIdx)); slot->setColor(colorIdx); } */ @@ -1449,7 +1449,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) if (slot->getIP() == game->getLocalIP()) { localSlot = i; - DEBUG_LOG(("GameLogic::StartNewGame - local slot is %d\n", localSlot)); + DEBUG_LOG(("GameLogic::StartNewGame - local slot is %d", localSlot)); } */ @@ -1481,7 +1481,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) d.setBool(TheKey_teamIsSingleton, true); TheSidesList->addTeam(&d); - DEBUG_LOG(("Added side %d\n", i)); + DEBUG_LOG(("Added side %d", i)); updateLoadProgress(progressCount + i); } } @@ -1563,7 +1563,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) DataChunkInput file( pStrm ); file.registerParser( AsciiString("PlayerScriptsList"), AsciiString::TheEmptyString, ScriptList::ParseScriptsDataChunk ); if (!file.parse(NULL)) { - DEBUG_LOG(("ERROR - Unable to read in multiplayer scripts.\n")); + DEBUG_LOG(("ERROR - Unable to read in multiplayer scripts.")); return; } ScriptList *scripts[MAX_PLAYER_COUNT]; @@ -1760,7 +1760,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) // reveal the map for the permanent observer ThePartitionManager->revealMapForPlayerPermanently( ThePlayerList->findPlayerWithNameKey(TheNameKeyGenerator->nameToKey("ReplayObserver"))->getPlayerIndex() ); - DEBUG_LOG(("Reveal shroud for %ls whose index is %d\n", ThePlayerList->findPlayerWithNameKey(TheNameKeyGenerator->nameToKey("ReplayObserver"))->getPlayerDisplayName().str(),ThePlayerList->findPlayerWithNameKey(TheNameKeyGenerator->nameToKey("ReplayObserver"))->getPlayerIndex())); + DEBUG_LOG(("Reveal shroud for %ls whose index is %d", ThePlayerList->findPlayerWithNameKey(TheNameKeyGenerator->nameToKey("ReplayObserver"))->getPlayerDisplayName().str(),ThePlayerList->findPlayerWithNameKey(TheNameKeyGenerator->nameToKey("ReplayObserver"))->getPlayerIndex())); if (game) { @@ -1777,7 +1777,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) if (slot->getPlayerTemplate() == PLAYERTEMPLATE_OBSERVER) { - DEBUG_LOG(("Clearing shroud for observer %s in playerList slot %d\n", playerName.str(), player->getPlayerIndex())); + DEBUG_LOG(("Clearing shroud for observer %s in playerList slot %d", playerName.str(), player->getPlayerIndex())); ThePartitionManager->revealMapForPlayerPermanently( player->getPlayerIndex() ); } else @@ -1996,7 +1996,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) } } } - DEBUG_LOG(("Setting observer's playerTemplate to %d in slot %d\n", slot->getPlayerTemplate(), i)); + DEBUG_LOG(("Setting observer's playerTemplate to %d in slot %d", slot->getPlayerTemplate(), i)); } else { @@ -2083,7 +2083,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) { Int startPos = slot->getStartPos(); startingCamName.format("Player_%d_Start", startPos+1); // start pos waypoints are 1-based - DEBUG_LOG(("Using %s as the multiplayer initial camera position\n", startingCamName.str())); + DEBUG_LOG(("Using %s as the multiplayer initial camera position", startingCamName.str())); } } @@ -2105,7 +2105,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) pos.y = 50; pos.z = 0; TheTacticalView->lookAt( &pos ); - DEBUG_LOG(("Failed to find initial camera position waypoint %s\n", startingCamName.str())); + DEBUG_LOG(("Failed to find initial camera position waypoint %s", startingCamName.str())); } // Set up the camera height based on the map height & globalData. @@ -2193,7 +2193,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) if (pPlayer) { pPlayer->addSkillPoints(m_rankPointsToAddAtGameStart); - DEBUG_LOG(("GameLogic::startNewGame() - adding m_rankPointsToAddAtGameStart==%d to player %d(%ls)\n", + DEBUG_LOG(("GameLogic::startNewGame() - adding m_rankPointsToAddAtGameStart==%d to player %d(%ls)", m_rankPointsToAddAtGameStart, i, pPlayer->getPlayerDisplayName().str())); } } @@ -2291,7 +2291,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) TheRadar->forceOn(TRUE); ThePartitionManager->refreshShroudForLocalPlayer(); TheControlBar->setControlBarSchemeByPlayer( ThePlayerList->getLocalPlayer()); - DEBUG_LOG(("Start of a replay game %ls, %d\n",ThePlayerList->getLocalPlayer()->getPlayerDisplayName().str(), ThePlayerList->getLocalPlayer()->getPlayerIndex())); + DEBUG_LOG(("Start of a replay game %ls, %d",ThePlayerList->getLocalPlayer()->getPlayerDisplayName().str(), ThePlayerList->getLocalPlayer()->getPlayerIndex())); } else TheControlBar->setControlBarSchemeByPlayer(ThePlayerList->getLocalPlayer()); @@ -2469,14 +2469,14 @@ void GameLogic::loadMapINI( AsciiString mapName ) sprintf(fullFledgeFilename, "%s\\map.ini", filename); if (TheFileSystem->doesFileExist(fullFledgeFilename)) { - DEBUG_LOG(("Loading map.ini\n")); + DEBUG_LOG(("Loading map.ini")); INI ini; ini.load( AsciiString(fullFledgeFilename), INI_LOAD_CREATE_OVERRIDES, NULL ); } sprintf(fullFledgeFilename, "%s\\solo.ini", filename); if (TheFileSystem->doesFileExist(fullFledgeFilename)) { - DEBUG_LOG(("Loading solo.ini\n")); + DEBUG_LOG(("Loading solo.ini")); INI ini; ini.load( AsciiString(fullFledgeFilename), INI_LOAD_CREATE_OVERRIDES, NULL ); } @@ -2614,14 +2614,14 @@ void GameLogic::processCommandList( CommandList *list ) } else { - //DEBUG_LOG(("Comparing %d CRCs on frame %d\n", m_cachedCRCs.size(), m_frame)); + //DEBUG_LOG(("Comparing %d CRCs on frame %d", m_cachedCRCs.size(), m_frame)); std::map::const_iterator crcIt = m_cachedCRCs.begin(); Int validatorCRC = crcIt->second; - //DEBUG_LOG(("Validator CRC from player %d is %8.8X\n", crcIt->first, validatorCRC)); + //DEBUG_LOG(("Validator CRC from player %d is %8.8X", crcIt->first, validatorCRC)); while (++crcIt != m_cachedCRCs.end()) { Int validatedCRC = crcIt->second; - //DEBUG_LOG(("CRC to validate is from player %d: %8.8X\n", crcIt->first, validatedCRC)); + //DEBUG_LOG(("CRC to validate is from player %d: %8.8X", crcIt->first, validatedCRC)); if (validatorCRC != validatedCRC) { DEBUG_CRASH(("CRC mismatch!")); @@ -2634,11 +2634,11 @@ void GameLogic::processCommandList( CommandList *list ) if (sawCRCMismatch) { #ifdef DEBUG_LOGGING - DEBUG_LOG(("CRC Mismatch - saw %d CRCs from %d players\n", m_cachedCRCs.size(), numPlayers)); + DEBUG_LOG(("CRC Mismatch - saw %d CRCs from %d players", m_cachedCRCs.size(), numPlayers)); for (std::map::const_iterator crcIt = m_cachedCRCs.begin(); crcIt != m_cachedCRCs.end(); ++crcIt) { Player *player = ThePlayerList->getNthPlayer(crcIt->first); - DEBUG_LOG(("CRC from player %d (%ls) = %X\n", crcIt->first, + DEBUG_LOG(("CRC from player %d (%ls) = %X", crcIt->first, player?player->getPlayerDisplayName().str():L"", crcIt->second)); } #endif // DEBUG_LOGGING @@ -2667,7 +2667,7 @@ void GameLogic::selectObject(Object *obj, Bool createNewSelection, PlayerMaskTyp if (!obj->isMassSelectable() && !createNewSelection) { - DEBUG_LOG(("GameLogic::selectObject() - Object attempted to be added to selection, but isn't mass-selectable.\n")); + DEBUG_LOG(("GameLogic::selectObject() - Object attempted to be added to selection, but isn't mass-selectable.")); return; } @@ -2782,10 +2782,10 @@ inline void GameLogic::validateSleepyUpdate() const return; int i; - //DEBUG_LOG(("\n\n")); + //DEBUG_LOG(("\n")); //for (i = 0; i < sz; ++i) //{ - // DEBUG_LOG(("u %04d: %08lx %08lx\n",i,m_sleepyUpdates[i],m_sleepyUpdates[i]->friend_getNextCallFrame())); + // DEBUG_LOG(("u %04d: %08lx %08lx",i,m_sleepyUpdates[i],m_sleepyUpdates[i]->friend_getNextCallFrame())); //} for (i = 0; i < sz; ++i) { @@ -3117,10 +3117,10 @@ void drawGraph( const char* style, Real scale, double value ) { DEBUG_LOG((style)); if ( t%200 == 199 ) - DEBUG_LOG(("...\n")); + DEBUG_LOG(("...")); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } @@ -3241,7 +3241,7 @@ static void unitTimings(void) settleFrames = SETTLE_FRAMES; if (TheParticleSystemManager->getParticleCount()>1) { TheParticleSystemManager->reset(); - DEBUG_LOG(("Starting noParticles - \n")); + DEBUG_LOG(("Starting noParticles - ")); } return; } @@ -3260,7 +3260,7 @@ static void unitTimings(void) obj = obj->getNextObject(); } if (gotSpawn) { - DEBUG_LOG(("Starting noSpawn - \n")); + DEBUG_LOG(("Starting noSpawn - ")); settleFrames = SETTLE_FRAMES; return; } @@ -3534,11 +3534,11 @@ static void unitTimings(void) #ifdef SINGLE_UNIT if (btt->getName()!=SINGLE_UNIT) { - DEBUG_LOG(("Skipping %s\n", btt->getName().str())); + DEBUG_LOG(("Skipping %s", btt->getName().str())); continue; } #endif - DEBUG_LOG(("\n===Doing thing %s ===\n", btt->getName().str())); + DEBUG_LOG(("\n===Doing thing %s ===", btt->getName().str())); #define dont_DO_ATTACK @@ -3731,7 +3731,7 @@ void GameLogic::update( void ) messageList = TheCommandList; messageList->appendMessage(msg); - DEBUG_LOG(("Appended %sCRC on frame %d: %8.8X\n", isPlayback ? "Playback " : "", m_frame, m_CRC)); + DEBUG_LOG(("Appended %sCRC on frame %d: %8.8X", isPlayback ? "Playback " : "", m_frame, m_CRC)); } // collect stats @@ -4409,10 +4409,10 @@ void GameLogic::processProgressComplete(Int playerId) } if(m_progressComplete[playerId] == TRUE) { - DEBUG_LOG(("GameLogic::processProgressComplete, playerId %d is marked TRUE already yet we're trying to mark him as true again\n", playerId)); + DEBUG_LOG(("GameLogic::processProgressComplete, playerId %d is marked TRUE already yet we're trying to mark him as true again", playerId)); return; } - DEBUG_LOG(("Progress Complete for Player %d\n", playerId)); + DEBUG_LOG(("Progress Complete for Player %d", playerId)); m_progressComplete[playerId] = TRUE; lastHeardFrom(playerId); } @@ -4470,7 +4470,7 @@ void GameLogic::testTimeOut( void ) // ------------------------------------------------------------------------------------------------ void GameLogic::timeOutGameStart( void ) { - DEBUG_LOG(("We got the Force TimeOut Start Message\n")); + DEBUG_LOG(("We got the Force TimeOut Start Message")); m_forceGameStartByTimeOut = TRUE; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp index 7c51aba5b2..530bfc8b0e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp @@ -330,7 +330,7 @@ void GameLogic::prepareNewGame( Int gameMode, GameDifficulty diff, Int rankPoint } m_rankPointsToAddAtGameStart = rankPoints; - DEBUG_LOG(("GameLogic::prepareNewGame() - m_rankPointsToAddAtGameStart = %d\n", m_rankPointsToAddAtGameStart)); + DEBUG_LOG(("GameLogic::prepareNewGame() - m_rankPointsToAddAtGameStart = %d", m_rankPointsToAddAtGameStart)); // If we're about to start a game, hide the shell. if(!TheGameLogic->isInShellGame()) @@ -408,7 +408,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) #if 0 if (commandName.isNotEmpty() /*&& msg->getType() != GameMessage::MSG_FRAME_TICK*/) { - DEBUG_LOG(("Frame %d: GameLogic::logicMessageDispatcher() saw a %s from player %d (%ls)\n", getFrame(), commandName.str(), + DEBUG_LOG(("Frame %d: GameLogic::logicMessageDispatcher() saw a %s from player %d (%ls)", getFrame(), commandName.str(), msg->getPlayerIndex(), thisPlayer->getPlayerDisplayName().str())); } #endif @@ -435,7 +435,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) Int maxFPS = msg->getArgument( 3 )->integer; if (maxFPS < 1 || maxFPS > 1000) maxFPS = TheGlobalData->m_framesPerSecondLimit; - DEBUG_LOG(("Setting max FPS limit to %d FPS\n", maxFPS)); + DEBUG_LOG(("Setting max FPS limit to %d FPS", maxFPS)); TheGameEngine->setFramesPerSecondLimit(maxFPS); TheWritableGlobalData->m_useFpsLimit = true; } @@ -476,7 +476,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) //--------------------------------------------------------------------------------------------- case GameMessage::MSG_META_BEGIN_PATH_BUILD: { - DEBUG_LOG(("META: begin path build\n")); + DEBUG_LOG(("META: begin path build")); DEBUG_ASSERTCRASH(!theBuildPlan, ("mismatched theBuildPlan")); if (theBuildPlan == false) @@ -491,7 +491,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) //--------------------------------------------------------------------------------------------- case GameMessage::MSG_META_END_PATH_BUILD: { - DEBUG_LOG(("META: end path build\n")); + DEBUG_LOG(("META: end path build")); DEBUG_ASSERTCRASH(theBuildPlan, ("mismatched theBuildPlan")); // tell everyone who participated in the plan to move @@ -827,7 +827,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) if( currentlySelectedGroup ) { - //DEBUG_LOG(("GameLogicDispatch - got a MSG_DO_MOVETO command\n")); + //DEBUG_LOG(("GameLogicDispatch - got a MSG_DO_MOVETO command")); currentlySelectedGroup->releaseWeaponLockForGroup(LOCKED_TEMPORARILY); // release any temporary locks. currentlySelectedGroup->groupMoveToPosition( &dest, false, CMD_FROM_PLAYER ); } @@ -842,7 +842,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) if( currentlySelectedGroup ) { - //DEBUG_LOG(("GameLogicDispatch - got a MSG_DO_MOVETO command\n")); + //DEBUG_LOG(("GameLogicDispatch - got a MSG_DO_MOVETO command")); currentlySelectedGroup->releaseWeaponLockForGroup(LOCKED_TEMPORARILY); // release any temporary locks. currentlySelectedGroup->groupMoveToPosition( &dest, true, CMD_FROM_PLAYER ); } @@ -1669,7 +1669,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) // how many does this player have active? Int count; thisPlayer->countObjectsByThingTemplate( 1, &thing, false, &count ); - DEBUG_LOG(("Player already has %d beacons active\n", count)); + DEBUG_LOG(("Player already has %d beacons active", count)); if (count >= TheMultiplayerSettings->getMaxBeaconsPerPlayer()) { if (thisPlayer == ThePlayerList->getLocalPlayer()) @@ -2015,14 +2015,14 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) //UnsignedInt oldCRC = m_cachedCRCs[msg->getPlayerIndex()]; UnsignedInt newCRC = msg->getArgument(0)->integer; - //DEBUG_LOG(("Recieved CRC of %8.8X from %ls on frame %d\n", newCRC, + //DEBUG_LOG(("Recieved CRC of %8.8X from %ls on frame %d", newCRC, //thisPlayer->getPlayerDisplayName().str(), m_frame)); m_cachedCRCs[msg->getPlayerIndex()] = newCRC; // to mask problem: = (oldCRC < newCRC)?newCRC:oldCRC; } else if (TheRecorder && TheRecorder->isPlaybackMode()) { UnsignedInt newCRC = msg->getArgument(0)->integer; - //DEBUG_LOG(("Saw CRC of %X from player %d. Our CRC is %X. Arg count is %d\n", + //DEBUG_LOG(("Saw CRC of %X from player %d. Our CRC is %X. Arg count is %d", //newCRC, thisPlayer->getPlayerIndex(), getCRC(), msg->getArgumentCount())); TheRecorder->handleCRCMessage(newCRC, thisPlayer->getPlayerIndex(), (msg->getArgument(1)->boolean)); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/Connection.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/Connection.cpp index aa32354aff..18eae738b9 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/Connection.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/Connection.cpp @@ -208,10 +208,10 @@ void Connection::sendNetCommandMsg(NetCommandMsg *msg, UnsignedByte relay) { /* #if defined(RTS_DEBUG) if (msg->getNetCommandType() == NETCOMMANDTYPE_GAMECOMMAND) { - DEBUG_LOG(("Connection::sendNetCommandMsg - added game command %d to net command list for frame %d.\n", + DEBUG_LOG(("Connection::sendNetCommandMsg - added game command %d to net command list for frame %d.", msg->getID(), msg->getExecutionFrame())); } else if (msg->getNetCommandType() == NETCOMMANDTYPE_FRAMEINFO) { - DEBUG_LOG(("Connection::sendNetCommandMsg - added frame info for frame %d\n", msg->getExecutionFrame())); + DEBUG_LOG(("Connection::sendNetCommandMsg - added frame info for frame %d", msg->getExecutionFrame())); } #endif // RTS_DEBUG */ @@ -229,7 +229,7 @@ void Connection::clearCommandsExceptFrom( Int playerIndex ) NetCommandMsg *msg = tmp->getCommand(); if (msg->getPlayerID() != playerIndex) { - DEBUG_LOG(("Connection::clearCommandsExceptFrom(%d) - clearing a command from %d for frame %d\n", + DEBUG_LOG(("Connection::clearCommandsExceptFrom(%d) - clearing a command from %d for frame %d", playerIndex, tmp->getCommand()->getPlayerID(), tmp->getCommand()->getExecutionFrame())); m_netCommandList->removeMessage(tmp); NetCommandRef *toDelete = tmp; @@ -252,7 +252,7 @@ void Connection::setQuitting( void ) { m_isQuitting = TRUE; m_quitTime = timeGetTime(); - DEBUG_LOG(("Connection::setQuitting() at time %d\n", m_quitTime)); + DEBUG_LOG(("Connection::setQuitting() at time %d", m_quitTime)); } /** @@ -267,13 +267,13 @@ UnsignedInt Connection::doSend() { // Do this check first, since it's an important fail-safe if (m_isQuitting && curtime > m_quitTime + MaxQuitFlushTime) { - DEBUG_LOG(("Timed out a quitting connection. Deleting all %d messages\n", m_netCommandList->length())); + DEBUG_LOG(("Timed out a quitting connection. Deleting all %d messages", m_netCommandList->length())); m_netCommandList->reset(); return 0; } if ((curtime - m_lastTimeSent) < m_frameGrouping) { -// DEBUG_LOG(("not sending packet, time = %d, m_lastFrameSent = %d, m_frameGrouping = %d\n", curtime, m_lastTimeSent, m_frameGrouping)); +// DEBUG_LOG(("not sending packet, time = %d, m_lastFrameSent = %d, m_frameGrouping = %d", curtime, m_lastTimeSent, m_frameGrouping)); return 0; } @@ -313,7 +313,7 @@ UnsignedInt Connection::doSend() { } if (msg != NULL) { - DEBUG_LOG(("didn't finish sending all commands in connection\n")); + DEBUG_LOG(("didn't finish sending all commands in connection")); } ++numpackets; @@ -386,7 +386,7 @@ NetCommandRef * Connection::processAck(UnsignedShort commandID, UnsignedByte ori #if defined(RTS_DEBUG) if (doDebug == TRUE) { - DEBUG_LOG(("Connection::processAck - disconnect frame command %d found, removing from command list.\n", commandID)); + DEBUG_LOG(("Connection::processAck - disconnect frame command %d found, removing from command list.", commandID)); } #endif m_netCommandList->removeMessage(temp); @@ -405,7 +405,7 @@ void Connection::doRetryMetrics() { if ((curTime - m_retryMetricsTime) > 10000) { m_retryMetricsTime = curTime; ++numSeconds; -// DEBUG_LOG(("Retries in the last 10 seconds = %d, average latency = %fms\n", m_numRetries, m_averageLatency)); +// DEBUG_LOG(("Retries in the last 10 seconds = %d, average latency = %fms", m_numRetries, m_averageLatency)); m_numRetries = 0; // m_retryTime = m_averageLatency * 1.5; } @@ -415,7 +415,7 @@ void Connection::doRetryMetrics() { void Connection::debugPrintCommands() { NetCommandRef *ref = m_netCommandList->getFirstMessage(); while (ref != NULL) { - DEBUG_LOG(("Connection::debugPrintCommands - ID: %d\tType: %s\tRelay: 0x%X for frame %d\n", + DEBUG_LOG(("Connection::debugPrintCommands - ID: %d\tType: %s\tRelay: 0x%X for frame %d", ref->getCommand()->getID(), GetAsciiNetCommandType(ref->getCommand()->getNetCommandType()).str(), ref->getRelay(), ref->getCommand()->getExecutionFrame())); ref = ref->getNext(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp index a6a2282daa..2754f1f3ac 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp @@ -315,7 +315,7 @@ void ConnectionManager::attachTransport(Transport *transport) { void ConnectionManager::zeroFrames(UnsignedInt startingFrame, UnsignedInt numFrames) { for (Int i = 0; i < MAX_SLOTS; ++i) { if (m_frameData[i] != NULL) { -// DEBUG_LOG(("Calling zeroFrames on player %d, starting frame %d, numFrames %d\n", i, startingFrame, numFrames)); +// DEBUG_LOG(("Calling zeroFrames on player %d, starting frame %d, numFrames %d", i, startingFrame, numFrames)); m_frameData[i]->zeroFrames(startingFrame, numFrames); } } @@ -354,7 +354,7 @@ void ConnectionManager::doRelay() { // make a NetPacket out of this data so it can be broken up into individual commands. packet = newInstance(NetPacket)(&(m_transport->m_inBuffer[i])); - //DEBUG_LOG(("ConnectionManager::doRelay() - got a packet with %d commands\n", packet->getNumCommands())); + //DEBUG_LOG(("ConnectionManager::doRelay() - got a packet with %d commands", packet->getNumCommands())); //LOGBUFFER( packet->getData(), packet->getLength() ); // Get the command list from the packet. @@ -363,7 +363,7 @@ void ConnectionManager::doRelay() { // Iterate through the commands in this packet and send them to the proper connections. while (cmd != NULL) { - //DEBUG_LOG(("ConnectionManager::doRelay() - Looking at a command of type %s\n", + //DEBUG_LOG(("ConnectionManager::doRelay() - Looking at a command of type %s", //GetAsciiNetCommandType(cmd->getCommand()->getNetCommandType()).str())); if (CommandRequiresAck(cmd->getCommand())) { ackCommand(cmd, m_localSlot); @@ -468,7 +468,7 @@ Bool ConnectionManager::processNetCommand(NetCommandRef *ref) { if (msg->getNetCommandType() == NETCOMMANDTYPE_PROGRESS) { - //DEBUG_LOG(("ConnectionManager::processNetCommand - got a progress net command from player %d\n", msg->getPlayerID())); + //DEBUG_LOG(("ConnectionManager::processNetCommand - got a progress net command from player %d", msg->getPlayerID())); processProgress((NetProgressCommandMsg *) msg); // need to set the relay so we don't send it to ourselves. @@ -480,7 +480,7 @@ Bool ConnectionManager::processNetCommand(NetCommandRef *ref) { if (msg->getNetCommandType() == NETCOMMANDTYPE_TIMEOUTSTART) { - DEBUG_LOG(("ConnectionManager::processNetCommand - got a TimeOut GameStart net command from player %d\n", msg->getPlayerID())); + DEBUG_LOG(("ConnectionManager::processNetCommand - got a TimeOut GameStart net command from player %d", msg->getPlayerID())); processTimeOutGameStart(msg); return FALSE; } @@ -505,7 +505,7 @@ Bool ConnectionManager::processNetCommand(NetCommandRef *ref) { if (msg->getNetCommandType() == NETCOMMANDTYPE_LOADCOMPLETE) { - DEBUG_LOG(("ConnectionManager::processNetCommand - got a Load Complete net command from player %d\n", msg->getPlayerID())); + DEBUG_LOG(("ConnectionManager::processNetCommand - got a Load Complete net command from player %d", msg->getPlayerID())); processLoadComplete(msg); return FALSE; } @@ -560,7 +560,7 @@ void ConnectionManager::processWrapper(NetCommandRef *ref) { NetWrapperCommandMsg *wrapperMsg = (NetWrapperCommandMsg *)(ref->getCommand()); UnsignedShort commandID = wrapperMsg->getWrappedCommandID(); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - wrapped commandID is %d, commandID is %d\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - wrapped commandID is %d, commandID is %d", commandID, wrapperMsg->getID())); Int origProgress = 0; FileCommandMap::iterator fcIt = s_fileCommandMap.find(commandID); @@ -568,7 +568,7 @@ void ConnectionManager::processWrapper(NetCommandRef *ref) { origProgress = s_fileProgressMap[m_localSlot][commandID]; } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - origProgress[%d] == %d for command %d\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - origProgress[%d] == %d for command %d", m_localSlot, origProgress, commandID)); m_netCommandWrapperList->processWrapper(ref); @@ -576,11 +576,11 @@ void ConnectionManager::processWrapper(NetCommandRef *ref) if (fcIt != s_fileCommandMap.end()) { Int newProgress = m_netCommandWrapperList->getPercentComplete(commandID); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - newProgress[%d] == %d for command %d\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - newProgress[%d] == %d for command %d", m_localSlot, newProgress, commandID)); if (newProgress > origProgress && newProgress < 100) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - sending a NetFileProgressCommandMsg\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processWrapper() - sending a NetFileProgressCommandMsg")); s_fileProgressMap[m_localSlot][commandID] = newProgress; Int progressMask = 0xff ^ (1 << m_localSlot); @@ -609,7 +609,7 @@ void ConnectionManager::processRunAheadMetrics(NetRunAheadMetricsCommandMsg *msg if ((player >= 0) && (player < MAX_SLOTS) && (isPlayerConnected(player))) { m_latencyAverages[player] = msg->getAverageLatency(); m_fpsAverages[player] = msg->getAverageFps(); - //DEBUG_LOG(("ConnectionManager::processRunAheadMetrics - player %d, fps = %d, latency = %f\n", player, msg->getAverageFps(), msg->getAverageLatency())); + //DEBUG_LOG(("ConnectionManager::processRunAheadMetrics - player %d, fps = %d, latency = %f", player, msg->getAverageFps(), msg->getAverageLatency())); if (m_fpsAverages[player] > 100) { // limit the reported frame rate average to 100. This is done because if a // user alt-tab's out of the game their frame rate climbs to in the neighborhood of @@ -630,7 +630,7 @@ void ConnectionManager::processDisconnectChat(NetDisconnectChatCommandMsg *msg) name = m_connections[playerID]->getUser()->GetName(); } unitext.format(L"[%ls] %ls", name.str(), msg->getText().str()); -// DEBUG_LOG(("ConnectionManager::processDisconnectChat - got message from player %d, message is %ls\n", playerID, unitext.str())); +// DEBUG_LOG(("ConnectionManager::processDisconnectChat - got message from player %d, message is %ls", playerID, unitext.str())); TheDisconnectMenu->showChat(unitext); // <-- need to implement this } @@ -639,16 +639,16 @@ void ConnectionManager::processChat(NetChatCommandMsg *msg) UnicodeString unitext; UnicodeString name; UnsignedByte playerID = msg->getPlayerID(); - //DEBUG_LOG(("processChat(): playerID = %d\n", playerID)); + //DEBUG_LOG(("processChat(): playerID = %d", playerID)); if (playerID == m_localSlot) { name = m_localUser->GetName(); - //DEBUG_LOG(("connection is NULL, using %ls\n", name.str())); + //DEBUG_LOG(("connection is NULL, using %ls", name.str())); } else if (((m_connections[playerID] != NULL) && (m_connections[playerID]->isQuitting() == FALSE))) { name = m_connections[playerID]->getUser()->GetName(); - //DEBUG_LOG(("connection is non-NULL, using %ls\n", name.str())); + //DEBUG_LOG(("connection is non-NULL, using %ls", name.str())); } unitext.format(L"[%ls] %ls", name.str(), msg->getText().str()); -// DEBUG_LOG(("ConnectionManager::processChat - got message from player %d (mask %8.8X), message is %ls\n", playerID, msg->getPlayerMask(), unitext.str())); +// DEBUG_LOG(("ConnectionManager::processChat - got message from player %d (mask %8.8X), message is %ls", playerID, msg->getPlayerMask(), unitext.str())); AsciiString playerName; playerName.format("player%d", msg->getPlayerID()); @@ -680,7 +680,7 @@ void ConnectionManager::processFile(NetFileCommandMsg *msg) #ifdef DEBUG_LOGGING UnicodeString log; log.format(L"Saw file transfer: '%hs' of %d bytes from %d", msg->getPortableFilename().str(), msg->getFileLength(), msg->getPlayerID()); - DEBUG_LOG(("%ls\n", log.str())); + DEBUG_LOG(("%ls", log.str())); #endif AsciiString realFileName = msg->getRealFilename(); @@ -689,13 +689,13 @@ void ConnectionManager::processFile(NetFileCommandMsg *msg) // TheSuperHackers @security slurmlord 18/06/2025 As the file name/path from the NetFileCommandMsg failed to normalize, // in other words is bogus and points outside of the approved target directory, avoid an arbitrary file overwrite vulnerability // by simply returning and let the transfer time out. - DEBUG_LOG(("Got a file name transferred that failed to normalize: '%s'!\n", msg->getPortableFilename().str())); + DEBUG_LOG(("Got a file name transferred that failed to normalize: '%s'!", msg->getPortableFilename().str())); return; } if (TheFileSystem->doesFileExist(realFileName.str())) { - DEBUG_LOG(("File exists already!\n")); + DEBUG_LOG(("File exists already!")); //return; } @@ -712,14 +712,14 @@ void ConnectionManager::processFile(NetFileCommandMsg *msg) Int actualLen = CompressionManager::decompressData(buf, len, uncompBuffer, uncompLen); if (actualLen == uncompLen) { - DEBUG_LOG(("Uncompressed Targa after map transfer\n")); + DEBUG_LOG(("Uncompressed Targa after map transfer")); deleteBuf = TRUE; buf = uncompBuffer; len = uncompLen; } else { - DEBUG_LOG(("Failed to uncompress Targa after map transfer\n")); + DEBUG_LOG(("Failed to uncompress Targa after map transfer")); delete[] uncompBuffer; // failed to decompress, so just use the source } } @@ -731,15 +731,15 @@ void ConnectionManager::processFile(NetFileCommandMsg *msg) fp->write(buf, len); fp->close(); fp = NULL; - DEBUG_LOG(("Wrote %d bytes to file %s!\n", len, realFileName.str())); + DEBUG_LOG(("Wrote %d bytes to file %s!", len, realFileName.str())); } else { - DEBUG_LOG(("Cannot open file!\n")); + DEBUG_LOG(("Cannot open file!")); } - DEBUG_LOG(("ConnectionManager::processFile() - sending a NetFileProgressCommandMsg\n")); + DEBUG_LOG(("ConnectionManager::processFile() - sending a NetFileProgressCommandMsg")); Int commandID = msg->getID(); Int newProgress = 100; @@ -771,7 +771,7 @@ void ConnectionManager::processFile(NetFileCommandMsg *msg) void ConnectionManager::processFileAnnounce(NetFileAnnounceCommandMsg *msg) { - DEBUG_LOG(("ConnectionManager::processFileAnnounce() - expecting '%s' (%s) in command %d\n", msg->getPortableFilename().str(), msg->getRealFilename().str(), msg->getFileID())); + DEBUG_LOG(("ConnectionManager::processFileAnnounce() - expecting '%s' (%s) in command %d", msg->getPortableFilename().str(), msg->getRealFilename().str(), msg->getFileID())); s_fileCommandMap[msg->getFileID()] = msg->getRealFilename(); s_fileRecipientMaskMap[msg->getFileID()] = msg->getPlayerMask(); for (Int i=0; igetFileID(), msg->getProgress())); Int oldProgress = s_fileProgressMap[msg->getPlayerID()][msg->getFileID()]; @@ -821,7 +821,7 @@ void ConnectionManager::processFrameInfo(NetFrameCommandMsg *msg) { if ((playerID >= 0) && (playerID < MAX_SLOTS)) { if (m_frameData[playerID] != NULL) { -// DEBUG_LOG(("ConnectionManager::processFrameInfo - player %d, frame %d, command count %d, received on frame %d\n", playerID, msg->getExecutionFrame(), msg->getCommandCount(), TheGameLogic->getFrame())); +// DEBUG_LOG(("ConnectionManager::processFrameInfo - player %d, frame %d, command count %d, received on frame %d", playerID, msg->getExecutionFrame(), msg->getCommandCount(), TheGameLogic->getFrame())); m_frameData[playerID]->setFrameCommandCount(msg->getExecutionFrame(), msg->getCommandCount()); } } @@ -841,7 +841,7 @@ void ConnectionManager::processAckStage1(NetCommandMsg *msg) { #if defined(RTS_DEBUG) if (doDebug == TRUE) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processAck - processing ack for command %d from player %d\n", ((NetAckStage1CommandMsg *)msg)->getCommandID(), playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processAck - processing ack for command %d from player %d", ((NetAckStage1CommandMsg *)msg)->getCommandID(), playerID)); } #endif @@ -882,24 +882,24 @@ void ConnectionManager::processAckStage2(NetCommandMsg *msg) { NetCommandRef *ref = m_pendingCommands->findMessage(commandID, playerID); if (ref != NULL) { - //DEBUG_LOG(("ConnectionManager::processAckStage2 - removing command %d from the pending commands list.\n", commandID)); + //DEBUG_LOG(("ConnectionManager::processAckStage2 - removing command %d from the pending commands list.", commandID)); DEBUG_ASSERTCRASH((m_localSlot == playerID), ("Found a command in the pending commands list that wasn't originated by the local player")); m_pendingCommands->removeMessage(ref); deleteInstance(ref); ref = NULL; } else { - //DEBUG_LOG(("ConnectionManager::processAckStage2 - Couldn't find command %d from player %d in the pending commands list.\n", commandID, playerID)); + //DEBUG_LOG(("ConnectionManager::processAckStage2 - Couldn't find command %d from player %d in the pending commands list.", commandID, playerID)); } ref = m_relayedCommands->findMessage(commandID, playerID); if (ref != NULL) { - //DEBUG_LOG(("ConnectionManager::processAckStage2 - found command ID %d from player %d in the relayed commands list.\n", commandID, playerID)); + //DEBUG_LOG(("ConnectionManager::processAckStage2 - found command ID %d from player %d in the relayed commands list.", commandID, playerID)); UnsignedByte relay = ref->getRelay(); //DEBUG_LOG(("ConnectionManager::processAckStage2 - relay was %d and is now ", relay)); relay = relay & ~(1 << msg->getPlayerID()); - //DEBUG_LOG(("%d\n", relay)); + //DEBUG_LOG(("%d", relay)); if (relay == 0) { - //DEBUG_LOG(("ConnectionManager::processAckStage2 - relay is 0, removing command from the relayed commands list.\n")); + //DEBUG_LOG(("ConnectionManager::processAckStage2 - relay is 0, removing command from the relayed commands list.")); m_relayedCommands->removeMessage(ref); NetAckStage2CommandMsg *ackmsg = newInstance(NetAckStage2CommandMsg)(ref->getCommand()); sendLocalCommand(ackmsg, 1 << ackmsg->getOriginalPlayerID()); @@ -939,12 +939,12 @@ void ConnectionManager::processAck(NetCommandMsg *msg) { PlayerLeaveCode ConnectionManager::processPlayerLeave(NetPlayerLeaveCommandMsg *msg) { UnsignedByte playerID = msg->getLeavingPlayerID(); if ((playerID != m_localSlot) && (m_connections[playerID] != NULL)) { - DEBUG_LOG(("ConnectionManager::processPlayerLeave() - setQuitting() on player %d on frame %d\n", playerID, TheGameLogic->getFrame())); + DEBUG_LOG(("ConnectionManager::processPlayerLeave() - setQuitting() on player %d on frame %d", playerID, TheGameLogic->getFrame())); m_connections[playerID]->setQuitting(); } DEBUG_ASSERTCRASH(m_frameData[playerID]->getIsQuitting() == FALSE, ("Player %d is already quitting", playerID)); if ((playerID != m_localSlot) && (m_frameData[playerID] != NULL) && (m_frameData[playerID]->getIsQuitting() == FALSE)) { - DEBUG_LOG(("ConnectionManager::processPlayerLeave - setQuitFrame on player %d for frame %d\n", playerID, TheGameLogic->getFrame()+1)); + DEBUG_LOG(("ConnectionManager::processPlayerLeave - setQuitFrame on player %d for frame %d", playerID, TheGameLogic->getFrame()+1)); m_frameData[playerID]->setQuitFrame(TheGameLogic->getFrame() + FRAMES_TO_KEEP + 1); } @@ -962,7 +962,7 @@ PlayerLeaveCode ConnectionManager::processPlayerLeave(NetPlayerLeaveCommandMsg * } PlayerLeaveCode code = disconnectPlayer(playerID); - DEBUG_LOG(("ConnectionManager::processPlayerLeave() - just disconnected player %d with ret code %d\n", playerID, code)); + DEBUG_LOG(("ConnectionManager::processPlayerLeave() - just disconnected player %d with ret code %d", playerID, code)); if (code == PLAYERLEAVECODE_PACKETROUTER) resendPendingCommands(); @@ -986,7 +986,7 @@ Bool ConnectionManager::areAllQueuesEmpty(void) { for (Int i = 0; (i < MAX_SLOTS) && retval; ++i) { if (m_connections[i] != NULL) { if (m_connections[i]->isQueueEmpty() == FALSE) { - //DEBUG_LOG(("ConnectionManager::areAllQueuesEmpty() - m_connections[%d] is not empty\n", i)); + //DEBUG_LOG(("ConnectionManager::areAllQueuesEmpty() - m_connections[%d] is not empty", i)); //m_connections[i]->debugPrintCommands(); retval = FALSE; } @@ -1014,7 +1014,7 @@ void ConnectionManager::handleLocalPlayerLeaving(UnsignedInt frame) { } msg->setPlayerID(m_localSlot); - DEBUG_LOG(("ConnectionManager::handleLocalPlayerLeaving - Local player leaving on frame %d\n", frame)); + DEBUG_LOG(("ConnectionManager::handleLocalPlayerLeaving - Local player leaving on frame %d", frame)); DEBUG_ASSERTCRASH(m_packetRouterSlot >= 0, ("ConnectionManager::handleLocalPlayerLeaving, packet router is %d, illegal value.", m_packetRouterSlot)); sendLocalCommand(msg); @@ -1052,7 +1052,7 @@ void ConnectionManager::ackCommand(NetCommandRef *ref, UnsignedInt localSlot) { originalPlayerID = bothmsg->getOriginalPlayerID(); #if defined(RTS_DEBUG) if (doDebug) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::ackCommand - doing ack both for command %d from player %d\n", bothmsg->getCommandID(), bothmsg->getOriginalPlayerID())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::ackCommand - doing ack both for command %d from player %d", bothmsg->getCommandID(), bothmsg->getOriginalPlayerID())); } #endif } else { @@ -1062,7 +1062,7 @@ void ConnectionManager::ackCommand(NetCommandRef *ref, UnsignedInt localSlot) { originalPlayerID = stage1msg->getOriginalPlayerID(); #if defined(RTS_DEBUG) if (doDebug) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::ackCommand - doing ack stage 1 for command %d from player %d\n", stage1msg->getCommandID(), stage1msg->getOriginalPlayerID())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::ackCommand - doing ack stage 1 for command %d from player %d", stage1msg->getCommandID(), stage1msg->getOriginalPlayerID())); } #endif } @@ -1080,13 +1080,13 @@ void ConnectionManager::ackCommand(NetCommandRef *ref, UnsignedInt localSlot) { // The local connection may be the packet router, in that case, the connection would be NULL. So do something about it! if ((m_packetRouterSlot >= 0) && (m_packetRouterSlot < MAX_SLOTS)) { if (m_connections[m_packetRouterSlot] != NULL) { -// DEBUG_LOG(("ConnectionManager::ackCommand - acking command %d from player %d to packet router.\n", commandID, m_packetRouterSlot)); +// DEBUG_LOG(("ConnectionManager::ackCommand - acking command %d from player %d to packet router.", commandID, m_packetRouterSlot)); m_connections[m_packetRouterSlot]->sendNetCommandMsg(ackmsg, 1 << m_packetRouterSlot); } else if (m_localSlot == m_packetRouterSlot) { // we are the packet router, send the ack to the player that sent the command. if ((msg->getPlayerID() >= 0) && (msg->getPlayerID() < MAX_SLOTS)) { if (m_connections[msg->getPlayerID()] != NULL) { -// DEBUG_LOG(("ConnectionManager::ackCommand - acking command %d from player %d directly to player.\n", commandID, msg->getPlayerID())); +// DEBUG_LOG(("ConnectionManager::ackCommand - acking command %d from player %d directly to player.", commandID, msg->getPlayerID())); m_connections[msg->getPlayerID()]->sendNetCommandMsg(ackmsg, 1 << msg->getPlayerID()); } else { // DEBUG_ASSERTCRASH(m_connections[msg->getPlayerID()] != NULL, ("Connection to player is NULL")); @@ -1115,20 +1115,20 @@ void ConnectionManager::sendRemoteCommand(NetCommandRef *msg) { return; } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - sending net command %d of type %s from player %d, relay is 0x%x\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - sending net command %d of type %s from player %d, relay is 0x%x", msg->getCommand()->getID(), GetAsciiNetCommandType(msg->getCommand()->getNetCommandType()).str(), msg->getCommand()->getPlayerID(), msg->getRelay())); UnsignedByte relay = msg->getRelay(); if ((relay & (1 << m_localSlot)) && (m_frameData[msg->getCommand()->getPlayerID()] != NULL)) { if (IsCommandSynchronized(msg->getCommand()->getNetCommandType())) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - adding net command of type %s to player %d for frame %d\n", GetAsciiNetCommandType(msg->getCommand()->getNetCommandType()).str(), msg->getCommand()->getPlayerID(), msg->getCommand()->getExecutionFrame())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - adding net command of type %s to player %d for frame %d", GetAsciiNetCommandType(msg->getCommand()->getNetCommandType()).str(), msg->getCommand()->getPlayerID(), msg->getCommand()->getExecutionFrame())); m_frameData[msg->getCommand()->getPlayerID()]->addNetCommandMsg(msg->getCommand()); } } for (Int i = 0; i < MAX_SLOTS; ++i) { if ((relay & (1 << i)) && ((m_connections[i] != NULL) && (m_connections[i]->isQuitting() == FALSE))) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - relaying command %d to player %d\n", msg->getCommand()->getID(), i)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendRemoteCommand - relaying command %d to player %d", msg->getCommand()->getID(), i)); m_connections[i]->sendNetCommandMsg(msg->getCommand(), 1 << i); actualRelay = actualRelay | (1 << i); } @@ -1138,20 +1138,20 @@ void ConnectionManager::sendRemoteCommand(NetCommandRef *msg) { NetCommandRef *ref = m_relayedCommands->addMessage(msg->getCommand()); if (ref != NULL) { ref->setRelay(actualRelay); - //DEBUG_LOG(("ConnectionManager::sendRemoteCommand - command %d added to relayed commands with relay %d\n", msg->getCommand()->getID(), ref->getRelay())); + //DEBUG_LOG(("ConnectionManager::sendRemoteCommand - command %d added to relayed commands with relay %d", msg->getCommand()->getID(), ref->getRelay())); } } // Do some metrics to find the minimum packet arrival cushion. if (IsCommandSynchronized(msg->getCommand()->getNetCommandType())) { -// DEBUG_LOG(("ConnectionManager::sendRemoteCommand - about to call allCommandsReady\n")); +// DEBUG_LOG(("ConnectionManager::sendRemoteCommand - about to call allCommandsReady")); if (allCommandsReady(msg->getCommand()->getExecutionFrame(), TRUE)) { UnsignedInt cushion = msg->getCommand()->getExecutionFrame() - TheGameLogic->getFrame(); if ((cushion < m_smallestPacketArrivalCushion) || (m_smallestPacketArrivalCushion == -1)) { m_smallestPacketArrivalCushion = cushion; } m_frameMetrics.addCushion(cushion); -// DEBUG_LOG(("Adding %d to cushion for frame %d\n", cushion, msg->getCommand()->getExecutionFrame())); +// DEBUG_LOG(("Adding %d to cushion for frame %d", cushion, msg->getCommand()->getExecutionFrame())); } } } @@ -1192,7 +1192,7 @@ void ConnectionManager::update(Bool isInGame) { if (m_connections[i] != NULL) { /* if (m_connections[i]->isQueueEmpty() == FALSE) { -// DEBUG_LOG(("ConnectionManager::update - calling doSend on connection %d\n", i)); +// DEBUG_LOG(("ConnectionManager::update - calling doSend on connection %d", i)); } */ @@ -1200,7 +1200,7 @@ void ConnectionManager::update(Bool isInGame) { if (m_connections[i]->isQuitting() && m_connections[i]->isQueueEmpty()) { - DEBUG_LOG(("ConnectionManager::update - deleting connection for slot %d\n", i)); + DEBUG_LOG(("ConnectionManager::update - deleting connection for slot %d", i)); deleteInstance(m_connections[i]); m_connections[i] = NULL; } @@ -1208,7 +1208,7 @@ void ConnectionManager::update(Bool isInGame) { if ((m_frameData[i] != NULL) && (m_frameData[i]->getIsQuitting() == TRUE)) { if (m_frameData[i]->getQuitFrame() == TheGameLogic->getFrame()) { - DEBUG_LOG(("ConnectionManager::update - deleting frame data for slot %d on quitting frame %d\n", i, m_frameData[i]->getQuitFrame())); + DEBUG_LOG(("ConnectionManager::update - deleting frame data for slot %d on quitting frame %d", i, m_frameData[i]->getQuitFrame())); deleteInstance(m_frameData[i]); m_frameData[i] = NULL; } @@ -1235,14 +1235,14 @@ void ConnectionManager::updateRunAhead(Int oldRunAhead, Int frameRate, Bool didS m_fpsAverages[m_localSlot] = m_frameMetrics.getAverageFPS(); // } if (didSelfSlug) { - //DEBUG_LOG(("ConnectionManager::updateRunAhead - local player run ahead metrics, fps = %d, actual fps = %d, latency = %f, didSelfSlug = true\n", m_fpsAverages[m_localSlot], m_frameMetrics.getAverageFPS(), m_latencyAverages[m_localSlot])); + //DEBUG_LOG(("ConnectionManager::updateRunAhead - local player run ahead metrics, fps = %d, actual fps = %d, latency = %f, didSelfSlug = true", m_fpsAverages[m_localSlot], m_frameMetrics.getAverageFPS(), m_latencyAverages[m_localSlot])); } else { - //DEBUG_LOG(("ConnectionManager::updateRunAhead - local player run ahead metrics, fps = %d, latency = %f, didSelfSlug = false\n", m_fpsAverages[m_localSlot], m_latencyAverages[m_localSlot])); + //DEBUG_LOG(("ConnectionManager::updateRunAhead - local player run ahead metrics, fps = %d, latency = %f, didSelfSlug = false", m_fpsAverages[m_localSlot], m_latencyAverages[m_localSlot])); } Int minFps; Int minFpsPlayer; getMinimumFps(minFps, minFpsPlayer); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::updateRunAhead - max latency = %f, min fps = %d, min fps player = %d old FPS = %d\n", getMaximumLatency(), minFps, minFpsPlayer, frameRate)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::updateRunAhead - max latency = %f, min fps = %d, min fps player = %d old FPS = %d", getMaximumLatency(), minFps, minFpsPlayer, frameRate)); if ((minFps >= ((frameRate * 9) / 10)) && (minFps < frameRate)) { // if the minimum fps is within 10% of the desired framerate, then keep the current minimum fps. minFps = frameRate; @@ -1253,7 +1253,7 @@ void ConnectionManager::updateRunAhead(Int oldRunAhead, Int frameRate, Bool didS if (minFps > TheGlobalData->m_framesPerSecondLimit) { minFps = TheGlobalData->m_framesPerSecondLimit; // Cap to 30 FPS. } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::updateRunAhead - minFps after adjustment is %d\n", minFps)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::updateRunAhead - minFps after adjustment is %d", minFps)); Int newRunAhead = (Int)((getMaximumLatency() / 2.0) * (Real)minFps); newRunAhead += (newRunAhead * TheGlobalData->m_networkRunAheadSlack) / 100; // Add in 10% of slack to the run ahead in case of network hiccups. if (newRunAhead < MIN_RUNAHEAD) { @@ -1288,7 +1288,7 @@ void ConnectionManager::updateRunAhead(Int oldRunAhead, Int frameRate, Bool didS msg->setRunAhead(newRunAhead); msg->setFrameRate(minFps); - //DEBUG_LOG(("ConnectionManager::updateRunAhead - new run ahead = %d, new frame rate = %d, execution frame %d\n", newRunAhead, minFps, msg->getExecutionFrame())); + //DEBUG_LOG(("ConnectionManager::updateRunAhead - new run ahead = %d, new frame rate = %d, execution frame %d", newRunAhead, minFps, msg->getExecutionFrame())); sendLocalCommand(msg, 0xff ^ (1 << minFpsPlayer)); // Send the packet to everyone but the lowest FPS player. NetRunAheadCommandMsg *msg2 = newInstance(NetRunAheadCommandMsg); @@ -1350,9 +1350,9 @@ void ConnectionManager::updateRunAhead(Int oldRunAhead, Int frameRate, Bool didS msg->setAverageFps(m_frameMetrics.getAverageFPS()); // } if (didSelfSlug) { - //DEBUG_LOG(("ConnectionManager::updateRunAhead - average latency = %f, average fps = %d, actual fps = %d, didSelfSlug = true\n", m_frameMetrics.getAverageLatency(), m_frameMetrics.getAverageFPS(), m_frameMetrics.getAverageFPS())); + //DEBUG_LOG(("ConnectionManager::updateRunAhead - average latency = %f, average fps = %d, actual fps = %d, didSelfSlug = true", m_frameMetrics.getAverageLatency(), m_frameMetrics.getAverageFPS(), m_frameMetrics.getAverageFPS())); } else { - //DEBUG_LOG(("ConnectionManager::updateRunAhead - average latency = %f, average fps = %d, didSelfSlug = false\n", m_frameMetrics.getAverageLatency(), m_frameMetrics.getAverageFPS())); + //DEBUG_LOG(("ConnectionManager::updateRunAhead - average latency = %f, average fps = %d, didSelfSlug = false", m_frameMetrics.getAverageLatency(), m_frameMetrics.getAverageFPS())); } m_connections[m_packetRouterSlot]->sendNetCommandMsg(msg, 1 << m_packetRouterSlot); msg->detach(); @@ -1397,7 +1397,7 @@ void ConnectionManager::getMinimumFps(Int &minFps, Int &minFpsPlayer) { } } } -// DEBUG_LOG(("\n")); +// DEBUG_LOG(("")); } UnsignedInt ConnectionManager::getMinimumCushion() { @@ -1423,7 +1423,7 @@ void ConnectionManager::processFrameTick(UnsignedInt frame) { m_frameMetrics.doPerFrameMetrics(frame); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processFrameTick - sending frame info for frame %d, ID %d, command count %d\n", frame, msg->getID(), commandCount)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::processFrameTick - sending frame info for frame %d, ID %d, command count %d", frame, msg->getID(), commandCount)); sendLocalCommand(msg, 0xff & ~(1 << m_localSlot)); @@ -1434,7 +1434,7 @@ void ConnectionManager::processFrameTick(UnsignedInt frame) { * Set the local address. */ void ConnectionManager::setLocalAddress(UnsignedInt ip, UnsignedInt port) { - DEBUG_LOG(("ConnectionManager::setLocalAddress() - local address is %X:%d\n", ip, port)); + DEBUG_LOG(("ConnectionManager::setLocalAddress() - local address is %X:%d", ip, port)); m_localAddr = ip; m_localPort = port; } @@ -1444,7 +1444,7 @@ void ConnectionManager::setLocalAddress(UnsignedInt ip, UnsignedInt port) { */ void ConnectionManager::initTransport() { DEBUG_ASSERTCRASH((m_transport == NULL), ("m_transport already exists when trying to init it.")); - DEBUG_LOG(("ConnectionManager::initTransport - Initializing Transport\n")); + DEBUG_LOG(("ConnectionManager::initTransport - Initializing Transport")); if (m_transport != NULL) { delete m_transport; m_transport = NULL; @@ -1486,11 +1486,11 @@ void ConnectionManager::sendLocalCommand(NetCommandMsg *msg, UnsignedByte relay } msg->attach(); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommand - sending net command %d of type %s\n", msg->getID(), + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommand - sending net command %d of type %s", msg->getID(), GetAsciiNetCommandType(msg->getNetCommandType()).str())); if (relay & (1 << m_localSlot)) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommand - adding net command of type %s to player %d for frame %d\n", GetAsciiNetCommandType(msg->getNetCommandType()).str(), msg->getPlayerID(), msg->getExecutionFrame())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommand - adding net command of type %s to player %d for frame %d", GetAsciiNetCommandType(msg->getNetCommandType()).str(), msg->getPlayerID(), msg->getExecutionFrame())); m_frameData[m_localSlot]->addNetCommandMsg(msg); } @@ -1515,7 +1515,7 @@ void ConnectionManager::sendLocalCommand(NetCommandMsg *msg, UnsignedByte relay if (CommandRequiresAck(msg)) { NetCommandRef *ref = m_pendingCommands->addMessage(msg); - //DEBUG_LOG(("ConnectionManager::sendLocalCommand - added command %d to pending commands list.\n", msg->getID())); + //DEBUG_LOG(("ConnectionManager::sendLocalCommand - added command %d to pending commands list.", msg->getID())); if (ref != NULL) { ref->setRelay(temprelay); } @@ -1534,7 +1534,7 @@ void ConnectionManager::sendLocalCommandDirect(NetCommandMsg *msg, UnsignedByte if (((relay & (1 << m_localSlot)) != 0) && (m_frameData[m_localSlot] != NULL)) { if (IsCommandSynchronized(msg->getNetCommandType()) == TRUE) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommandDirect - adding net command of type %s to player %d for frame %d\n", GetAsciiNetCommandType(msg->getNetCommandType()).str(), msg->getPlayerID(), msg->getExecutionFrame())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommandDirect - adding net command of type %s to player %d for frame %d", GetAsciiNetCommandType(msg->getNetCommandType()).str(), msg->getPlayerID(), msg->getExecutionFrame())); m_frameData[m_localSlot]->addNetCommandMsg(msg); } } @@ -1544,7 +1544,7 @@ void ConnectionManager::sendLocalCommandDirect(NetCommandMsg *msg, UnsignedByte if ((m_connections[i] != NULL) && (m_connections[i]->isQuitting() == FALSE)) { UnsignedByte temprelay = 1 << i; m_connections[i]->sendNetCommandMsg(msg, temprelay); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommandDirect - Sending direct command %d of type %s to player %d\n", msg->getID(), GetAsciiNetCommandType(msg->getNetCommandType()).str(), i)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendLocalCommandDirect - Sending direct command %d of type %s to player %d", msg->getID(), GetAsciiNetCommandType(msg->getNetCommandType()).str(), i)); } } } @@ -1567,12 +1567,12 @@ Bool ConnectionManager::allCommandsReady(UnsignedInt frame, Bool justTesting /* /* if (!(m_frameData[i]->allCommandsReady(frame, (frame != commandsReadyDebugSpewage) && (justTesting == FALSE)))) { if ((frame != commandsReadyDebugSpewage) && (justTesting == FALSE)) { - DEBUG_LOG(("ConnectionManager::allCommandsReady, frame %d player %d not ready.\n", frame, i)); + DEBUG_LOG(("ConnectionManager::allCommandsReady, frame %d player %d not ready.", frame, i)); commandsReadyDebugSpewage = frame; } retval = FALSE; } else { -// DEBUG_LOG(("ConnectionManager::allCommandsReady, frame %d player %d is ready.\n", frame, i)); +// DEBUG_LOG(("ConnectionManager::allCommandsReady, frame %d player %d is ready.", frame, i)); } */ @@ -1631,7 +1631,7 @@ NetCommandList *ConnectionManager::getFrameCommandList(UnsignedInt frame) m_frameData[i]->resetFrame(frame - FRAMES_TO_KEEP); // After getting the commands for that frame from this // FrameDataManager object, we need to tell it that we're // done with the messages for that frame. - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("getFrameCommandList - called reset frame on player %d for frame %d\n", i, frame - FRAMES_TO_KEEP)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("getFrameCommandList - called reset frame on player %d for frame %d", i, frame - FRAMES_TO_KEEP)); } } } @@ -1684,14 +1684,14 @@ void ConnectionManager::doKeepAlive() { time_t numSeconds = (curTime - startTime) / 1000; while ((nextIndex <= numSeconds) && (nextIndex < MAX_SLOTS)) { -// DEBUG_LOG(("ConnectionManager::doKeepAlive - trying to send keep alive message to player %d\n", nextIndex)); +// DEBUG_LOG(("ConnectionManager::doKeepAlive - trying to send keep alive message to player %d", nextIndex)); if (m_connections[nextIndex] != NULL) { NetKeepAliveCommandMsg *msg = newInstance(NetKeepAliveCommandMsg); msg->setPlayerID(m_localSlot); if (DoesCommandRequireACommandID(msg->getNetCommandType()) == TRUE) { msg->setID(GenerateNextCommandID()); } -// DEBUG_LOG(("ConnectionManager::doKeepAlive - sending keep alive message to player %d\n", nextIndex)); +// DEBUG_LOG(("ConnectionManager::doKeepAlive - sending keep alive message to player %d", nextIndex)); sendLocalCommandDirect(msg, 1 << nextIndex); msg->detach(); } @@ -1706,7 +1706,7 @@ void ConnectionManager::doKeepAlive() { PlayerLeaveCode ConnectionManager::disconnectPlayer(Int slot) { // Need to do the deletion of the slot's connection and frame data here. PlayerLeaveCode retval = PLAYERLEAVECODE_CLIENT; - DEBUG_LOG(("ConnectionManager::disconnectPlayer - disconnecting slot %d on frame %d\n", slot, TheGameLogic->getFrame())); + DEBUG_LOG(("ConnectionManager::disconnectPlayer - disconnecting slot %d on frame %d", slot, TheGameLogic->getFrame())); if ((slot < 0) || (slot >= MAX_SLOTS)) { return PLAYERLEAVECODE_UNKNOWN; @@ -1717,7 +1717,7 @@ PlayerLeaveCode ConnectionManager::disconnectPlayer(Int slot) { GameSlot *gSlot = TheGameInfo->getSlot( slot ); if (gSlot && !gSlot->lastFrameInGame()) { - DEBUG_LOG(("ConnectionManager::disconnectPlayer(%d) - slot is last in the game on frame %d\n", + DEBUG_LOG(("ConnectionManager::disconnectPlayer(%d) - slot is last in the game on frame %d", slot, TheGameLogic->getFrame())); gSlot->setLastFrameInGame(TheGameLogic->getFrame()); } @@ -1734,13 +1734,13 @@ PlayerLeaveCode ConnectionManager::disconnectPlayer(Int slot) { } if ((m_frameData[slot] != NULL) && (m_frameData[slot]->getIsQuitting() == FALSE)) { - DEBUG_LOG(("ConnectionManager::disconnectPlayer - deleting player %d frame data\n", slot)); + DEBUG_LOG(("ConnectionManager::disconnectPlayer - deleting player %d frame data", slot)); deleteInstance(m_frameData[slot]); m_frameData[slot] = NULL; } if (m_connections[slot] != NULL && !m_connections[slot]->isQuitting()) { - DEBUG_LOG(("ConnectionManager::disconnectPlayer - deleting player %d connection\n", slot)); + DEBUG_LOG(("ConnectionManager::disconnectPlayer - deleting player %d connection", slot)); deleteInstance(m_connections[slot]); m_connections[slot] = NULL; } @@ -1756,11 +1756,11 @@ PlayerLeaveCode ConnectionManager::disconnectPlayer(Int slot) { } ++index; m_packetRouterSlot = m_packetRouterFallback[index]; - DEBUG_LOG(("Packet router left. New packet router is slot %d\n", m_packetRouterSlot)); + DEBUG_LOG(("Packet router left. New packet router is slot %d", m_packetRouterSlot)); retval = PLAYERLEAVECODE_PACKETROUTER; } if (m_localSlot == slot) { - DEBUG_LOG(("Disconnecting self\n")); + DEBUG_LOG(("Disconnecting self")); retval = PLAYERLEAVECODE_LOCAL; } @@ -1786,12 +1786,12 @@ void ConnectionManager::quitGame() { if (DoesCommandRequireACommandID(disconnectMsg->getNetCommandType())) { disconnectMsg->setID(GenerateNextCommandID()); } - //DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer - about to send disconnect command\n")); + //DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer - about to send disconnect command")); sendLocalCommandDirect(disconnectMsg, 0xff ^ (1 << m_localSlot)); - //DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer - about to flush connections\n")); + //DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer - about to flush connections")); flushConnections(); // need to do this so our packet actually gets sent before the connections are deleted. - //DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer - done flushing connections\n")); + //DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer - done flushing connections")); disconnectMsg->detach(); @@ -1800,7 +1800,7 @@ void ConnectionManager::quitGame() { void ConnectionManager::disconnectLocalPlayer() { // kill the frame data and the connections for all the other players. - DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer()\n")); + DEBUG_LOG(("ConnectionManager::disconnectLocalPlayer()")); for (Int i = 0; i < MAX_SLOTS; ++i) { if (i != m_localSlot) { disconnectPlayer(i); @@ -1814,10 +1814,10 @@ void ConnectionManager::disconnectLocalPlayer() { void ConnectionManager::flushConnections() { for (Int i = 0; i < MAX_SLOTS; ++i) { if (m_connections[i] != NULL) { -// DEBUG_LOG(("ConnectionManager::flushConnections - flushing connection to player %d\n", i)); +// DEBUG_LOG(("ConnectionManager::flushConnections - flushing connection to player %d", i)); /* if (m_connections[i]->isQueueEmpty()) { -// DEBUG_LOG(("ConnectionManager::flushConnections - connection queue empty\n")); +// DEBUG_LOG(("ConnectionManager::flushConnections - connection queue empty")); } */ m_connections[i]->doSend(); @@ -1830,14 +1830,14 @@ void ConnectionManager::flushConnections() { } void ConnectionManager::resendPendingCommands() { - //DEBUG_LOG(("ConnectionManager::resendPendingCommands()\n")); + //DEBUG_LOG(("ConnectionManager::resendPendingCommands()")); if (m_pendingCommands == NULL) { return; } NetCommandRef *ref = m_pendingCommands->getFirstMessage(); while (ref != NULL) { - //DEBUG_LOG(("ConnectionManager::resendPendingCommands - resending command %d\n", ref->getCommand()->getID())); + //DEBUG_LOG(("ConnectionManager::resendPendingCommands - resending command %d", ref->getCommand()->getID())); sendLocalCommand(ref->getCommand(), ref->getRelay()); ref = ref->getNext(); } @@ -1869,7 +1869,7 @@ void ConnectionManager::parseUserList(const GameInfo *game) Int i; Int numUsers = 0; m_localSlot = -1; - DEBUG_LOG(("Local slot is %d\n", game->getLocalSlotNum())); + DEBUG_LOG(("Local slot is %d", game->getLocalSlotNum())); for (i=0; igetConstSlot(i); // badness, but since we cast right back to const, we should be ok @@ -1890,11 +1890,11 @@ void ConnectionManager::parseUserList(const GameInfo *game) UnsignedShort port = slot->getPort(); m_connections[i]->setUser(newInstance(User)(slot->getName(), slot->getIP(), port)); m_frameData[i] = newInstance(FrameDataManager)(FALSE); - DEBUG_LOG(("Remote user is at %X:%d\n", slot->getIP(), slot->getPort())); + DEBUG_LOG(("Remote user is at %X:%d", slot->getIP(), slot->getPort())); } else { - DEBUG_LOG(("Local user is %d (%X:%d)\n", m_localSlot, slot->getIP(), slot->getPort())); + DEBUG_LOG(("Local user is %d (%X:%d)", m_localSlot, slot->getIP(), slot->getPort())); m_frameData[i] = newInstance(FrameDataManager)(TRUE); } m_frameData[i]->init(); @@ -1936,7 +1936,7 @@ void ConnectionManager::parseUserList(const GameInfo *game) char *listPos; - DEBUG_LOG(("ConnectionManager::parseUserList - looking for local user at %d.%d.%d.%d:%d\n", + DEBUG_LOG(("ConnectionManager::parseUserList - looking for local user at %d.%d.%d.%d:%d", PRINTF_IP_AS_4_INTS(m_localAddr), m_localPort)); @@ -1952,7 +1952,7 @@ void ConnectionManager::parseUserList(const GameInfo *game) if (!portStr || numUsers >= MAX_SLOTS) { - DEBUG_LOG(("ConnectionManager::parseUserList - (numUsers = %d) FAILED parseUserList with list [%s]\n", numUsers, buf)); + DEBUG_LOG(("ConnectionManager::parseUserList - (numUsers = %d) FAILED parseUserList with list [%s]", numUsers, buf)); return; } @@ -1969,13 +1969,13 @@ void ConnectionManager::parseUserList(const GameInfo *game) m_frameData[numUsers] = newInstance(FrameDataManager)(FALSE); - DEBUG_LOG(("ConnectionManager::parseUserList - User %d is %s\n", numUsers, nameStr)); + DEBUG_LOG(("ConnectionManager::parseUserList - User %d is %s", numUsers, nameStr)); } else { m_localSlot = numUsers; m_localUser.setName(nameStr); - DEBUG_LOG(("ConnectionManager::parseUserList - User %d is %s\n", numUsers, nameStr)); - DEBUG_LOG(("Local user is %d\n", m_localSlot)); + DEBUG_LOG(("ConnectionManager::parseUserList - User %d is %s", numUsers, nameStr)); + DEBUG_LOG(("Local user is %d", m_localSlot)); m_frameData[numUsers] = newInstance(FrameDataManager)(TRUE); } @@ -1989,7 +1989,7 @@ void ConnectionManager::parseUserList(const GameInfo *game) if (numUsers < 2 || m_localSlot == -1) { - DEBUG_LOG(("ConnectionManager::parseUserList - FAILED (local user = %d, num players = %d) with list [%s]\n", m_localSlot, numUsers, buf)); + DEBUG_LOG(("ConnectionManager::parseUserList - FAILED (local user = %d, num players = %d) with list [%s]", m_localSlot, numUsers, buf)); return; } @@ -2088,7 +2088,7 @@ void ConnectionManager::sendChat(UnicodeString text, Int playerMask, UnsignedInt { msg->setID(GenerateNextCommandID()); } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Chat message has ID of %d, mask of %8.8X, text of %ls\n", msg->getID(), msg->getPlayerMask(), msg->getText().str())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Chat message has ID of %d, mask of %8.8X, text of %ls", msg->getID(), msg->getPlayerMask(), msg->getText().str())); sendLocalCommand(msg, 0xff ^ (1 << m_localSlot)); processChat(msg); @@ -2115,7 +2115,7 @@ UnsignedShort ConnectionManager::sendFileAnnounce(AsciiString path, UnsignedByte { UnicodeString log; log.format(L"Not sending file '%hs' to %X\n", path.str(), playerMask); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%ls\n", log.str())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%ls", log.str())); if (TheLAN) TheLAN->OnChat(UnicodeString(L"sendFile"), 0, log, LANAPI::LANCHAT_SYSTEM); return 0; @@ -2133,13 +2133,13 @@ UnsignedShort ConnectionManager::sendFileAnnounce(AsciiString path, UnsignedByte announceMsg->setPlayerMask(playerMask); UnsignedShort fileID = GenerateNextCommandID(); announceMsg->setFileID(fileID); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFileAnnounce() - creating announce message with ID of %d from %d to mask %X for '%s' going to %X as command %d\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFileAnnounce() - creating announce message with ID of %d from %d to mask %X for '%s' going to %X as command %d", announceMsg->getID(), announceMsg->getPlayerID(), announceMask, announceMsg->getRealFilename().str(), announceMsg->getPlayerMask(), announceMsg->getFileID())); processFileAnnounce(announceMsg); // set up things for the host - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Sending file announce to %X\n", announceMask)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Sending file announce to %X", announceMask)); sendLocalCommand(announceMsg, announceMask); announceMsg->detach(); @@ -2153,7 +2153,7 @@ void ConnectionManager::sendFile(AsciiString path, UnsignedByte playerMask, Unsi { UnicodeString log; log.format(L"Not sending file '%hs' to %X\n", path.str(), playerMask); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%ls\n", log.str())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%ls", log.str())); if (TheLAN) TheLAN->OnChat(UnicodeString(L"sendFile"), 0, log, LANAPI::LANCHAT_SYSTEM); return; @@ -2185,7 +2185,7 @@ void ConnectionManager::sendFile(AsciiString path, UnsignedByte playerMask, Unsi #ifdef COMPRESS_TARGAS if (compressedBuf) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Compressed '%s' from %d to %d (%g%%) before transfer\n", path.str(), len, compressedSize, + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Compressed '%s' from %d to %d (%g%%) before transfer", path.str(), len, compressedSize, (Real)compressedSize/(Real)len*100.0f)); fileMsg->setFileData((unsigned char *)compressedBuf, compressedSize); } @@ -2195,7 +2195,7 @@ void ConnectionManager::sendFile(AsciiString path, UnsignedByte playerMask, Unsi fileMsg->setFileData((unsigned char *)buf, len); } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFile() - creating file message with ID of %d for '%s' going to %X from %d, size of %d\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFile() - creating file message with ID of %d for '%s' going to %X from %d, size of %d", fileMsg->getID(), fileMsg->getRealFilename().str(), playerMask, fileMsg->getPlayerID(), fileMsg->getFileLength())); delete[] buf; @@ -2208,7 +2208,7 @@ void ConnectionManager::sendFile(AsciiString path, UnsignedByte playerMask, Unsi } #endif // COMPRESS_TARGAS - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Sending file: '%s', len %d, to %X\n", path.str(), len, playerMask)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Sending file: '%s', len %d, to %X", path.str(), len, playerMask)); sendLocalCommand(fileMsg, playerMask); @@ -2220,7 +2220,7 @@ Int ConnectionManager::getFileTransferProgress(Int playerID, AsciiString path) FileCommandMap::iterator commandIt = s_fileCommandMap.begin(); while (commandIt != s_fileCommandMap.end()) { - //DEBUG_LOG(("ConnectionManager::getFileTransferProgress(%s): looking at existing transfer of '%s'\n", + //DEBUG_LOG(("ConnectionManager::getFileTransferProgress(%s): looking at existing transfer of '%s'", // path.str(), commandIt->second.str())); if (commandIt->second == path) { @@ -2228,8 +2228,8 @@ Int ConnectionManager::getFileTransferProgress(Int playerID, AsciiString path) } ++commandIt; } - //DEBUG_LOG(("Falling back to 0, since we couldn't find the map\n")); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::getFileTransferProgress: path %s not found\n",path.str())); + //DEBUG_LOG(("Falling back to 0, since we couldn't find the map")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::getFileTransferProgress: path %s not found",path.str())); return 0; } @@ -2319,14 +2319,14 @@ Int ConnectionManager::getSlotAverageFPS(Int slot) { #if defined(RTS_DEBUG) void ConnectionManager::debugPrintConnectionCommands() { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::debugPrintConnectionCommands - begin commands\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::debugPrintConnectionCommands - begin commands")); for (Int i = 0; i < MAX_SLOTS; ++i) { if (m_connections[i] != NULL) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::debugPrintConnectionCommands - commands for connection %d\n", i)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::debugPrintConnectionCommands - commands for connection %d", i)); m_connections[i]->debugPrintCommands(); } } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::debugPrintConnectionCommands - end commands\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::debugPrintConnectionCommands - end commands")); } #endif @@ -2339,7 +2339,7 @@ void ConnectionManager::notifyOthersOfCurrentFrame(Int frame) { msg->setID(GenerateNextCommandID()); } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::notifyOthersOfCurrentFrame - sending disconnect frame of %d, command ID = %d\n", frame, msg->getID())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::notifyOthersOfCurrentFrame - sending disconnect frame of %d, command ID = %d", frame, msg->getID())); sendLocalCommandDirect(msg, 0xff ^ (1 << m_localSlot)); NetCommandRef *ref = NEW_NETCOMMANDREF(msg); ref->setRelay(1 << m_localSlot); @@ -2348,7 +2348,7 @@ void ConnectionManager::notifyOthersOfCurrentFrame(Int frame) { msg->detach(); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::notifyOthersOfCurrentFrame - start screen on debug stuff\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::notifyOthersOfCurrentFrame - start screen on debug stuff")); #if defined(RTS_DEBUG) debugPrintConnectionCommands(); #endif @@ -2373,29 +2373,29 @@ void ConnectionManager::notifyOthersOfNewFrame(UnsignedInt frame) { } void ConnectionManager::sendFrameDataToPlayer(UnsignedInt playerID, UnsignedInt startingFrame) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending frame data to player %d starting with frame %d\n", playerID, startingFrame)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending frame data to player %d starting with frame %d", playerID, startingFrame)); for (UnsignedInt frame = startingFrame; frame < TheGameLogic->getFrame(); ++frame) { sendSingleFrameToPlayer(playerID, frame); } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - done sending commands to player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - done sending commands to player %d", playerID)); } void ConnectionManager::sendSingleFrameToPlayer(UnsignedInt playerID, UnsignedInt frame) { if ((TheGameLogic->getFrame() - FRAMES_TO_KEEP) > frame) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendSingleFrameToPlayer - player %d requested frame %d when we are on frame %d, this is too far in the past.\n", playerID, frame, TheGameLogic->getFrame())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendSingleFrameToPlayer - player %d requested frame %d when we are on frame %d, this is too far in the past.", playerID, frame, TheGameLogic->getFrame())); return; } UnsignedByte relay = 1 << playerID; - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending data for frame %d\n", frame)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending data for frame %d", frame)); for (Int i = 0; i < MAX_SLOTS; ++i) { if ((m_frameData[i] != NULL) && (i != playerID)) { // no need to send his own commands to him. NetCommandList *list = m_frameData[i]->getFrameCommandList(frame); if (list != NULL) { NetCommandRef *ref = list->getFirstMessage(); while (ref != NULL) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending command %d from player %d to player %d using relay 0x%x\n", ref->getCommand()->getID(), i, playerID, relay)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending command %d from player %d to player %d using relay 0x%x", ref->getCommand()->getID(), i, playerID, relay)); sendLocalCommandDirect(ref->getCommand(), relay); ref = ref->getNext(); } @@ -2408,7 +2408,7 @@ void ConnectionManager::sendSingleFrameToPlayer(UnsignedInt playerID, UnsignedIn msg->setID(GenerateNextCommandID()); } msg->setPlayerID(i); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending frame info from player %d to player %d for frame %d with command count %d and ID %d and relay %d\n", i, playerID, msg->getExecutionFrame(), msg->getCommandCount(), msg->getID(), relay)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("ConnectionManager::sendFrameDataToPlayer - sending frame info from player %d to player %d for frame %d with command count %d and ID %d and relay %d", i, playerID, msg->getExecutionFrame(), msg->getCommandCount(), msg->getID(), relay)); sendLocalCommandDirect(msg, relay); msg->detach(); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/DisconnectManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/DisconnectManager.cpp index fa2c23f05e..0779fac99a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/DisconnectManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/DisconnectManager.cpp @@ -150,7 +150,7 @@ void DisconnectManager::update(ConnectionManager *conMgr) { req.timeout = 2000; m_pingsSent = req.repetitions; ThePinger->addRequest(req); - DEBUG_LOG(("DisconnectManager::update() - requesting %d pings of %d from %s\n", + DEBUG_LOG(("DisconnectManager::update() - requesting %d pings of %d from %s", req.repetitions, req.timeout, req.hostname.c_str())); } } @@ -165,13 +165,13 @@ void DisconnectManager::update(ConnectionManager *conMgr) { if (m_pingFrame != TheGameLogic->getFrame()) { // wrong frame - we're not pinging yet - DEBUG_LOG(("DisconnectManager::update() - discarding ping of %d from %s (%d reps)\n", + DEBUG_LOG(("DisconnectManager::update() - discarding ping of %d from %s (%d reps)", resp.avgPing, resp.hostname.c_str(), resp.repetitions)); } else { // right frame - DEBUG_LOG(("DisconnectManager::update() - keeping ping of %d from %s (%d reps)\n", + DEBUG_LOG(("DisconnectManager::update() - keeping ping of %d from %s (%d reps)", resp.avgPing, resp.hostname.c_str(), resp.repetitions)); if (resp.avgPing < 2000) { @@ -216,7 +216,7 @@ void DisconnectManager::updateDisconnectStatus(ConnectionManager *conMgr) { m_haveNotifiedOtherPlayersOfCurrentFrame = TRUE; } - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - curTime = %d, m_timeOfDisconnectScreenOn = %d, curTime - m_timeOfDisconnectScreenOn = %d\n", curTime, m_timeOfDisconnectScreenOn, curTime - m_timeOfDisconnectScreenOn)); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - curTime = %d, m_timeOfDisconnectScreenOn = %d, curTime - m_timeOfDisconnectScreenOn = %d", curTime, m_timeOfDisconnectScreenOn, curTime - m_timeOfDisconnectScreenOn)); if (m_timeOfDisconnectScreenOn != 0) { if ((curTime - m_timeOfDisconnectScreenOn) > TheGlobalData->m_networkDisconnectScreenNotifyTime) { @@ -228,20 +228,20 @@ void DisconnectManager::updateDisconnectStatus(ConnectionManager *conMgr) { if ((newTime < 0) || (isPlayerVotedOut(slot, conMgr) == TRUE)) { newTime = 0; - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - player %d(translated slot %d) has been voted out or timed out\n", i, slot)); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - player %d(translated slot %d) has been voted out or timed out", i, slot)); if (allOnSameFrame(conMgr) == TRUE) { - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - all on same frame\n")); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - all on same frame")); if (isLocalPlayerNextPacketRouter(conMgr) == TRUE) { - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - local player is next packet router\n")); - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - about to do the disconnect procedure for player %d\n", i)); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - local player is next packet router")); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - about to do the disconnect procedure for player %d", i)); sendDisconnectCommand(i, conMgr); disconnectPlayer(i, conMgr); sendPlayerDestruct(i, conMgr); } else { - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - local player is not the next packet router\n")); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - local player is not the next packet router")); } } else { - DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - not all on same frame\n")); + DEBUG_LOG(("DisconnectManager::updateDisconnectStatus - not all on same frame")); } } TheDisconnectMenu->setPlayerTimeoutTime(slot, newTime); @@ -259,7 +259,7 @@ void DisconnectManager::updateWaitForPacketRouter(ConnectionManager *conMgr) { // The guy that we were hoping would be the new packet router isn't. We're screwed, get out of the game. - DEBUG_LOG(("DisconnectManager::updateWaitForPacketRouter - timed out waiting for new packet router, quitting game\n")); + DEBUG_LOG(("DisconnectManager::updateWaitForPacketRouter - timed out waiting for new packet router, quitting game")); TheNetwork->quitGame(); } TheDisconnectMenu->setPacketRouterTimeoutTime(newTime); @@ -295,14 +295,14 @@ void DisconnectManager::processDisconnectKeepAlive(NetCommandMsg *msg, Connectio void DisconnectManager::processDisconnectPlayer(NetCommandMsg *msg, ConnectionManager *conMgr) { NetDisconnectPlayerCommandMsg *cmdMsg = (NetDisconnectPlayerCommandMsg *)msg; - DEBUG_LOG(("DisconnectManager::processDisconnectPlayer - Got disconnect player command from player %d. Disconnecting player %d on frame %d\n", msg->getPlayerID(), cmdMsg->getDisconnectSlot(), cmdMsg->getDisconnectFrame())); + DEBUG_LOG(("DisconnectManager::processDisconnectPlayer - Got disconnect player command from player %d. Disconnecting player %d on frame %d", msg->getPlayerID(), cmdMsg->getDisconnectSlot(), cmdMsg->getDisconnectFrame())); DEBUG_ASSERTCRASH(TheGameLogic->getFrame() == cmdMsg->getDisconnectFrame(), ("disconnecting player on the wrong frame!!!")); disconnectPlayer(cmdMsg->getDisconnectSlot(), conMgr); } void DisconnectManager::processPacketRouterQuery(NetCommandMsg *msg, ConnectionManager *conMgr) { NetPacketRouterQueryCommandMsg *cmdMsg = (NetPacketRouterQueryCommandMsg *)msg; - DEBUG_LOG(("DisconnectManager::processPacketRouterQuery - got a packet router query command from player %d\n", msg->getPlayerID())); + DEBUG_LOG(("DisconnectManager::processPacketRouterQuery - got a packet router query command from player %d", msg->getPlayerID())); if (conMgr->getPacketRouterSlot() == conMgr->getLocalPlayerID()) { NetPacketRouterAckCommandMsg *ackmsg = newInstance(NetPacketRouterAckCommandMsg); @@ -310,20 +310,20 @@ void DisconnectManager::processPacketRouterQuery(NetCommandMsg *msg, ConnectionM if (DoesCommandRequireACommandID(ackmsg->getNetCommandType()) == TRUE) { ackmsg->setID(GenerateNextCommandID()); } - DEBUG_LOG(("DisconnectManager::processPacketRouterQuery - We are the new packet router, responding with an packet router ack. Local player is %d\n", ackmsg->getPlayerID())); + DEBUG_LOG(("DisconnectManager::processPacketRouterQuery - We are the new packet router, responding with an packet router ack. Local player is %d", ackmsg->getPlayerID())); conMgr->sendLocalCommandDirect(ackmsg, 1 << cmdMsg->getPlayerID()); ackmsg->detach(); } else { - DEBUG_LOG(("DisconnectManager::processPacketRouterQuery - We are NOT the new packet router, these are not the droids you're looking for.\n")); + DEBUG_LOG(("DisconnectManager::processPacketRouterQuery - We are NOT the new packet router, these are not the droids you're looking for.")); } } void DisconnectManager::processPacketRouterAck(NetCommandMsg *msg, ConnectionManager *conMgr) { NetPacketRouterAckCommandMsg *cmdMsg = (NetPacketRouterAckCommandMsg *)msg; - DEBUG_LOG(("DisconnectManager::processPacketRouterAck - got packet router ack command from player %d\n", msg->getPlayerID())); + DEBUG_LOG(("DisconnectManager::processPacketRouterAck - got packet router ack command from player %d", msg->getPlayerID())); if (conMgr->getPacketRouterSlot() == cmdMsg->getPlayerID()) { - DEBUG_LOG(("DisconnectManager::processPacketRouterAck - packet router command is from who it should be.\n")); + DEBUG_LOG(("DisconnectManager::processPacketRouterAck - packet router command is from who it should be.")); resetPacketRouterTimeout(); Int currentPacketRouterSlot = conMgr->getPacketRouterSlot(); Int currentPacketRouterIndex = 0; @@ -332,17 +332,17 @@ void DisconnectManager::processPacketRouterAck(NetCommandMsg *msg, ConnectionMan } DEBUG_ASSERTCRASH((currentPacketRouterIndex < MAX_SLOTS), ("Invalid packet router index")); - DEBUG_LOG(("DisconnectManager::processPacketRouterAck - New packet router confirmed, resending pending commands\n")); + DEBUG_LOG(("DisconnectManager::processPacketRouterAck - New packet router confirmed, resending pending commands")); conMgr->resendPendingCommands(); m_currentPacketRouterIndex = currentPacketRouterIndex; - DEBUG_LOG(("DisconnectManager::processPacketRouterAck - Setting disconnect state to screen on.\n")); + DEBUG_LOG(("DisconnectManager::processPacketRouterAck - Setting disconnect state to screen on.")); m_disconnectState = DISCONNECTSTATETYPE_SCREENON; ///< set it to screen on so that the next call to AllCommandsReady can set up everything for the next frame properly. } } void DisconnectManager::processDisconnectVote(NetCommandMsg *msg, ConnectionManager *conMgr) { NetDisconnectVoteCommandMsg *cmdMsg = (NetDisconnectVoteCommandMsg *)msg; - DEBUG_LOG(("DisconnectManager::processDisconnectVote - Got a disconnect vote for player %d command from player %d\n", cmdMsg->getSlot(), cmdMsg->getPlayerID())); + DEBUG_LOG(("DisconnectManager::processDisconnectVote - Got a disconnect vote for player %d command from player %d", cmdMsg->getSlot(), cmdMsg->getPlayerID())); Int transSlot = translatedSlotPosition(msg->getPlayerID(), conMgr->getLocalPlayerID()); if (isPlayerInGame(transSlot, conMgr) == FALSE) { @@ -362,18 +362,18 @@ void DisconnectManager::processDisconnectFrame(NetCommandMsg *msg, ConnectionMan } if (m_disconnectFramesReceived[playerID] == TRUE) { - DEBUG_LOG(("DisconnectManager::processDisconnectFrame - Got two disconnect frames without an intervening disconnect screen off command from player %d. Frames are %d and %d\n", playerID, m_disconnectFrames[playerID], cmdMsg->getDisconnectFrame())); + DEBUG_LOG(("DisconnectManager::processDisconnectFrame - Got two disconnect frames without an intervening disconnect screen off command from player %d. Frames are %d and %d", playerID, m_disconnectFrames[playerID], cmdMsg->getDisconnectFrame())); } - DEBUG_LOG(("DisconnectManager::processDisconnectFrame - about to call resetPlayersVotes for player %d\n", playerID)); + DEBUG_LOG(("DisconnectManager::processDisconnectFrame - about to call resetPlayersVotes for player %d", playerID)); resetPlayersVotes(playerID, cmdMsg->getDisconnectFrame()-1, conMgr); m_disconnectFrames[playerID] = cmdMsg->getDisconnectFrame(); m_disconnectFramesReceived[playerID] = TRUE; - DEBUG_LOG(("DisconnectManager::processDisconnectFrame - Got a disconnect frame for player %d, frame = %d, local player is %d, local disconnect frame = %d, command id = %d\n", cmdMsg->getPlayerID(), cmdMsg->getDisconnectFrame(), conMgr->getLocalPlayerID(), m_disconnectFrames[conMgr->getLocalPlayerID()], cmdMsg->getID())); + DEBUG_LOG(("DisconnectManager::processDisconnectFrame - Got a disconnect frame for player %d, frame = %d, local player is %d, local disconnect frame = %d, command id = %d", cmdMsg->getPlayerID(), cmdMsg->getDisconnectFrame(), conMgr->getLocalPlayerID(), m_disconnectFrames[conMgr->getLocalPlayerID()], cmdMsg->getID())); if (playerID == conMgr->getLocalPlayerID()) { - DEBUG_LOG(("DisconnectManager::processDisconnectFrame - player %d is the local player\n", playerID)); + DEBUG_LOG(("DisconnectManager::processDisconnectFrame - player %d is the local player", playerID)); // we just got the message from the local player, check to see if we need to send // commands to anyone we already have heard from. for (Int i = 0; i < MAX_SLOTS; ++i) { @@ -381,14 +381,14 @@ void DisconnectManager::processDisconnectFrame(NetCommandMsg *msg, ConnectionMan Int transSlot = translatedSlotPosition(i, conMgr->getLocalPlayerID()); if (isPlayerInGame(transSlot, conMgr) == TRUE) { if ((m_disconnectFrames[i] < m_disconnectFrames[playerID]) && (m_disconnectFramesReceived[i] == TRUE)) { - DEBUG_LOG(("DisconnectManager::processDisconnectFrame - I have more frames than player %d, my frame = %d, their frame = %d\n", i, m_disconnectFrames[conMgr->getLocalPlayerID()], m_disconnectFrames[i])); + DEBUG_LOG(("DisconnectManager::processDisconnectFrame - I have more frames than player %d, my frame = %d, their frame = %d", i, m_disconnectFrames[conMgr->getLocalPlayerID()], m_disconnectFrames[i])); conMgr->sendFrameDataToPlayer(i, m_disconnectFrames[i]); } } } } } else if ((m_disconnectFrames[playerID] < m_disconnectFrames[conMgr->getLocalPlayerID()]) && (m_disconnectFramesReceived[playerID] == TRUE)) { - DEBUG_LOG(("DisconnectManager::processDisconnectFrame - I have more frames than player %d, my frame = %d, their frame = %d\n", playerID, m_disconnectFrames[conMgr->getLocalPlayerID()], m_disconnectFrames[playerID])); + DEBUG_LOG(("DisconnectManager::processDisconnectFrame - I have more frames than player %d, my frame = %d, their frame = %d", playerID, m_disconnectFrames[conMgr->getLocalPlayerID()], m_disconnectFrames[playerID])); conMgr->sendFrameDataToPlayer(playerID, m_disconnectFrames[playerID]); } } @@ -397,7 +397,7 @@ void DisconnectManager::processDisconnectScreenOff(NetCommandMsg *msg, Connectio NetDisconnectScreenOffCommandMsg *cmdMsg = (NetDisconnectScreenOffCommandMsg *)msg; UnsignedInt playerID = cmdMsg->getPlayerID(); - DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - got a screen off command from player %d for frame %d\n", cmdMsg->getPlayerID(), cmdMsg->getNewFrame())); + DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - got a screen off command from player %d for frame %d", cmdMsg->getPlayerID(), cmdMsg->getNewFrame())); if ((playerID < 0) || (playerID >= MAX_SLOTS)) { return; @@ -405,11 +405,11 @@ void DisconnectManager::processDisconnectScreenOff(NetCommandMsg *msg, Connectio UnsignedInt newFrame = cmdMsg->getNewFrame(); if (newFrame >= m_disconnectFrames[playerID]) { - DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - resetting the disconnect screen status for player %d\n", playerID)); + DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - resetting the disconnect screen status for player %d", playerID)); m_disconnectFramesReceived[playerID] = FALSE; m_disconnectFrames[playerID] = newFrame; // just in case we get packets out of order and the disconnect screen off message gets here before the disconnect frame message. - DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - about to call resetPlayersVotes for player %d\n", playerID)); + DEBUG_LOG(("DisconnectManager::processDisconnectScreenOff - about to call resetPlayersVotes for player %d", playerID)); resetPlayersVotes(playerID, cmdMsg->getNewFrame(), conMgr); } } @@ -418,7 +418,7 @@ void DisconnectManager::applyDisconnectVote(Int slot, UnsignedInt frame, Int fro m_playerVotes[slot][fromSlot].vote = TRUE; m_playerVotes[slot][fromSlot].frame = frame; Int numVotes = countVotesForPlayer(slot); - DEBUG_LOG(("DisconnectManager::applyDisconnectVote - added a vote to disconnect slot %d, from slot %d, for frame %d, current votes are %d\n", slot, fromSlot, frame, numVotes)); + DEBUG_LOG(("DisconnectManager::applyDisconnectVote - added a vote to disconnect slot %d, from slot %d, for frame %d, current votes are %d", slot, fromSlot, frame, numVotes)); Int transSlot = translatedSlotPosition(slot, conMgr->getLocalPlayerID()); if (transSlot != -1) { TheDisconnectMenu->updateVotes(transSlot, numVotes); @@ -433,7 +433,7 @@ void DisconnectManager::nextFrame(UnsignedInt frame, ConnectionManager *conMgr) void DisconnectManager::allCommandsReady(UnsignedInt frame, ConnectionManager *conMgr, Bool waitForPacketRouter) { if (m_disconnectState != DISCONNECTSTATETYPE_SCREENOFF) { - DEBUG_LOG(("DisconnectManager::allCommandsReady - setting screen state to off.\n")); + DEBUG_LOG(("DisconnectManager::allCommandsReady - setting screen state to off.")); TheDisconnectMenu->hideScreen(); m_disconnectState = DISCONNECTSTATETYPE_SCREENOFF; @@ -444,7 +444,7 @@ void DisconnectManager::allCommandsReady(UnsignedInt frame, ConnectionManager *c m_playerVotes[i][conMgr->getLocalPlayerID()].vote = FALSE; } - DEBUG_LOG(("DisconnectManager::allCommandsReady - resetting m_timeOfDisconnectScreenOn\n")); + DEBUG_LOG(("DisconnectManager::allCommandsReady - resetting m_timeOfDisconnectScreenOn")); m_timeOfDisconnectScreenOn = 0; } } @@ -529,7 +529,7 @@ void DisconnectManager::resetPacketRouterTimeout() { void DisconnectManager::turnOnScreen(ConnectionManager *conMgr) { TheDisconnectMenu->showScreen(); - DEBUG_LOG(("DisconnectManager::turnOnScreen - turning on screen on frame %d\n", TheGameLogic->getFrame())); + DEBUG_LOG(("DisconnectManager::turnOnScreen - turning on screen on frame %d", TheGameLogic->getFrame())); m_disconnectState = DISCONNECTSTATETYPE_SCREENON; m_lastKeepAliveSendTime = -1; populateDisconnectScreen(conMgr); @@ -539,11 +539,11 @@ void DisconnectManager::turnOnScreen(ConnectionManager *conMgr) { m_haveNotifiedOtherPlayersOfCurrentFrame = FALSE; m_timeOfDisconnectScreenOn = timeGetTime(); - DEBUG_LOG(("DisconnectManager::turnOnScreen - turned on screen at time %d\n", m_timeOfDisconnectScreenOn)); + DEBUG_LOG(("DisconnectManager::turnOnScreen - turned on screen at time %d", m_timeOfDisconnectScreenOn)); } void DisconnectManager::disconnectPlayer(Int slot, ConnectionManager *conMgr) { - DEBUG_LOG(("DisconnectManager::disconnectPlayer - Disconnecting slot number %d on frame %d\n", slot, TheGameLogic->getFrame())); + DEBUG_LOG(("DisconnectManager::disconnectPlayer - Disconnecting slot number %d on frame %d", slot, TheGameLogic->getFrame())); DEBUG_ASSERTCRASH((slot >= 0) && (slot < MAX_SLOTS), ("Attempting to disconnect an invalid slot number")); if ((slot < 0) || (slot >= (MAX_SLOTS))) { return; @@ -572,7 +572,7 @@ void DisconnectManager::disconnectPlayer(Int slot, ConnectionManager *conMgr) { DEBUG_ASSERTCRASH((retcode != PLAYERLEAVECODE_UNKNOWN), ("Invalid player leave code")); if (retcode == PLAYERLEAVECODE_PACKETROUTER) { - DEBUG_LOG(("DisconnectManager::disconnectPlayer - disconnecting player was packet router.\n")); + DEBUG_LOG(("DisconnectManager::disconnectPlayer - disconnecting player was packet router.")); conMgr->resendPendingCommands(); } @@ -580,7 +580,7 @@ void DisconnectManager::disconnectPlayer(Int slot, ConnectionManager *conMgr) { } void DisconnectManager::sendDisconnectCommand(Int slot, ConnectionManager *conMgr) { - DEBUG_LOG(("DisconnectManager::sendDisconnectCommand - Sending disconnect command for slot number %d\n", slot)); + DEBUG_LOG(("DisconnectManager::sendDisconnectCommand - Sending disconnect command for slot number %d", slot)); DEBUG_ASSERTCRASH((slot >= 0) && (slot < MAX_SLOTS), ("Attempting to send a disconnect command for an invalid slot number")); if ((slot < 0) || (slot >= (MAX_SLOTS))) { return; @@ -599,7 +599,7 @@ void DisconnectManager::sendDisconnectCommand(Int slot, ConnectionManager *conMg conMgr->sendLocalCommand(msg); - DEBUG_LOG(("DisconnectManager::sendDisconnectCommand - Sending disconnect command for slot number %d for frame %d\n", slot, disconnectFrame)); + DEBUG_LOG(("DisconnectManager::sendDisconnectCommand - Sending disconnect command for slot number %d for frame %d", slot, disconnectFrame)); msg->detach(); } @@ -709,7 +709,7 @@ void DisconnectManager::sendPlayerDestruct(Int slot, ConnectionManager *conMgr) currentID = GenerateNextCommandID(); } - DEBUG_LOG(("Queueing DestroyPlayer %d for frame %d on frame %d as command %d\n", + DEBUG_LOG(("Queueing DestroyPlayer %d for frame %d on frame %d as command %d", slot, TheNetwork->getExecutionFrame()+1, TheGameLogic->getFrame(), currentID)); NetDestroyPlayerCommandMsg *netmsg = newInstance(NetDestroyPlayerCommandMsg); @@ -789,18 +789,18 @@ Int DisconnectManager::countVotesForPlayer(Int slot) { } void DisconnectManager::resetPlayersVotes(Int playerID, UnsignedInt frame, ConnectionManager *conMgr) { - DEBUG_LOG(("DisconnectManager::resetPlayersVotes - resetting player %d's votes on frame %d\n", playerID, frame)); + DEBUG_LOG(("DisconnectManager::resetPlayersVotes - resetting player %d's votes on frame %d", playerID, frame)); // we need to reset this player's votes that happened before or on the given frame. for(Int i = 0; i < MAX_SLOTS; ++i) { if (m_playerVotes[i][playerID].frame <= frame) { - DEBUG_LOG(("DisconnectManager::resetPlayersVotes - resetting player %d's vote for player %d from frame %d on frame %d\n", playerID, i, m_playerVotes[i][playerID].frame, frame)); + DEBUG_LOG(("DisconnectManager::resetPlayersVotes - resetting player %d's vote for player %d from frame %d on frame %d", playerID, i, m_playerVotes[i][playerID].frame, frame)); m_playerVotes[i][playerID].vote = FALSE; } } Int numVotes = countVotesForPlayer(playerID); - DEBUG_LOG(("DisconnectManager::resetPlayersVotes - after adjusting votes, player %d has %d votes\n", playerID, numVotes)); + DEBUG_LOG(("DisconnectManager::resetPlayersVotes - after adjusting votes, player %d has %d votes", playerID, numVotes)); Int transSlot = translatedSlotPosition(playerID, conMgr->getLocalPlayerID()); if (transSlot != -1) { TheDisconnectMenu->updateVotes(transSlot, numVotes); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/DownloadManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/DownloadManager.cpp index a04c80475e..51170a01c7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/DownloadManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/DownloadManager.cpp @@ -164,27 +164,27 @@ HRESULT DownloadManager::OnError( Int error ) break; } m_errorString = TheGameText->fetch(s); - DEBUG_LOG(("DownloadManager::OnError(): %s(%d)\n", s.str(), error)); + DEBUG_LOG(("DownloadManager::OnError(): %s(%d)", s.str(), error)); return S_OK; } HRESULT DownloadManager::OnEnd() { m_sawEnd = true; - DEBUG_LOG(("DownloadManager::OnEnd()\n")); + DEBUG_LOG(("DownloadManager::OnEnd()")); return S_OK; } HRESULT DownloadManager::OnQueryResume() { - DEBUG_LOG(("DownloadManager::OnQueryResume()\n")); + DEBUG_LOG(("DownloadManager::OnQueryResume()")); //return DOWNLOADEVENT_DONOTRESUME; return DOWNLOADEVENT_RESUME; } HRESULT DownloadManager::OnProgressUpdate( Int bytesread, Int totalsize, Int timetaken, Int timeleft ) { - DEBUG_LOG(("DownloadManager::OnProgressUpdate(): %d/%d %d/%d\n", bytesread, totalsize, timetaken, timeleft)); + DEBUG_LOG(("DownloadManager::OnProgressUpdate(): %d/%d %d/%d", bytesread, totalsize, timetaken, timeleft)); return S_OK; } @@ -219,6 +219,6 @@ HRESULT DownloadManager::OnStatusUpdate( Int status ) break; } m_statusString = TheGameText->fetch(s); - DEBUG_LOG(("DownloadManager::OnStatusUpdate(): %s(%d)\n", s.str(), status)); + DEBUG_LOG(("DownloadManager::OnStatusUpdate(): %s(%d)", s.str(), status)); return S_OK; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/FileTransfer.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/FileTransfer.cpp index 025f3a7e37..8eeb684c70 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/FileTransfer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/FileTransfer.cpp @@ -67,7 +67,7 @@ static Bool doFileTransfer( AsciiString filename, MapTransferLoadScreen *ls, Int sentFile = TRUE; } - DEBUG_LOG(("Starting file transfer loop\n")); + DEBUG_LOG(("Starting file transfer loop")); while (!fileTransferDone) { @@ -105,14 +105,14 @@ static Bool doFileTransfer( AsciiString filename, MapTransferLoadScreen *ls, Int } else { - DEBUG_LOG(("File transfer is 100%%!\n")); + DEBUG_LOG(("File transfer is 100%%!")); ls->processProgress(0, fileTransferPercent, "MapTransfer:Done"); } Int now = timeGetTime(); if (now > startTime + timeoutPeriod) // bail if we don't finish in a reasonable amount of time { - DEBUG_LOG(("Timing out file transfer\n")); + DEBUG_LOG(("Timing out file transfer")); break; } else @@ -250,7 +250,7 @@ Bool DoAnyMapTransfers(GameInfo *game) { if (TheGameInfo->getConstSlot(i)->isHuman() && !TheGameInfo->getConstSlot(i)->hasMap()) { - DEBUG_LOG(("Adding player %d to transfer mask\n", i)); + DEBUG_LOG(("Adding player %d to transfer mask", i)); mask |= (1<m_firewallBehavior, TheWritableGlobalData->m_firewallPortAllocationDelta)); + DEBUG_LOG(("FirewallHelperClass::detectFirewall - firewall behavior already specified as %d, port allocation delta is %d, skipping detection.", TheWritableGlobalData->m_firewallBehavior, TheWritableGlobalData->m_firewallPortAllocationDelta)); } return TRUE; @@ -291,7 +291,7 @@ UnsignedShort FirewallHelperClass::getNextTemporarySourcePort(Int skip) closeSpareSocket(return_port); return(return_port); } else { - DEBUG_LOG(("FirewallHelperClass::getNextTemporarySourcePort - failed to open socket on port %d\n")); + DEBUG_LOG(("FirewallHelperClass::getNextTemporarySourcePort - failed to open socket on port %d")); } } @@ -320,7 +320,7 @@ UnsignedShort FirewallHelperClass::getNextTemporarySourcePort(Int skip) *=============================================================================================*/ Bool FirewallHelperClass::sendToManglerFromPort(UnsignedInt address, UnsignedShort port, UnsignedShort packetID, Bool blitzme) { - DEBUG_LOG(("sizeof(ManglerMessage) == %d, sizeof(ManglerData) == %d\n", + DEBUG_LOG(("sizeof(ManglerMessage) == %d, sizeof(ManglerData) == %d", sizeof(ManglerMessage), sizeof(ManglerData))); /* @@ -342,7 +342,7 @@ Bool FirewallHelperClass::sendToManglerFromPort(UnsignedInt address, UnsignedSho for (Int i = 0; i < sizeof(ManglerData); ++i) { DEBUG_LOG(("%02x", *(((unsigned char *)(&(packet.data))) + i))); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); */ byteAdjust(&(packet.data)); /* @@ -350,7 +350,7 @@ Bool FirewallHelperClass::sendToManglerFromPort(UnsignedInt address, UnsignedSho for (i = 0; i < sizeof(ManglerData); ++i) { DEBUG_LOG(("%02x", *(((unsigned char *)(&(packet.data))) + i))); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); */ CRC crc; crc.computeCRC((unsigned char *)(&(packet.data.magic)), sizeof(ManglerData) - sizeof(unsigned int)); @@ -358,22 +358,22 @@ Bool FirewallHelperClass::sendToManglerFromPort(UnsignedInt address, UnsignedSho packet.length = sizeof(ManglerData); - DEBUG_LOG(("FirewallHelperClass::sendToManglerFromPort - Sending from port %d to %d.%d.%d.%d:%d\n", (UnsignedInt)port, + DEBUG_LOG(("FirewallHelperClass::sendToManglerFromPort - Sending from port %d to %d.%d.%d.%d:%d", (UnsignedInt)port, PRINTF_IP_AS_4_INTS(address), MANGLER_PORT)); /* DEBUG_LOG(("Buffer = ")); for (i = 0; i < sizeof(ManglerData); ++i) { DEBUG_LOG(("%02x", *(((unsigned char *)(&(packet.data))) + i))); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); */ SpareSocketStruct *spareSocket = findSpareSocketByPort(port); -// DEBUG_LOG(("PacketID = %u\n", packetID)); -// DEBUG_LOG(("OriginalPortNumber = %u\n", port)); +// DEBUG_LOG(("PacketID = %u", packetID)); +// DEBUG_LOG(("OriginalPortNumber = %u", port)); if (spareSocket == NULL) { DEBUG_ASSERTCRASH(spareSocket != NULL, ("Could not find spare socket for send.")); - DEBUG_LOG(("FirewallHelperClass::sendToManglerFromPort - failed to find the spare socket for port %d\n", port)); + DEBUG_LOG(("FirewallHelperClass::sendToManglerFromPort - failed to find the spare socket for port %d", port)); return FALSE; } @@ -384,15 +384,15 @@ Bool FirewallHelperClass::sendToManglerFromPort(UnsignedInt address, UnsignedSho SpareSocketStruct * FirewallHelperClass::findSpareSocketByPort(UnsignedShort port) { - DEBUG_LOG(("FirewallHelperClass::findSpareSocketByPort - trying to find spare socket with port %d\n", port)); + DEBUG_LOG(("FirewallHelperClass::findSpareSocketByPort - trying to find spare socket with port %d", port)); for (Int i = 0; i < MAX_SPARE_SOCKETS; ++i) { if (m_spareSockets[i].port == port) { - DEBUG_LOG(("FirewallHelperClass::findSpareSocketByPort - found it!\n")); + DEBUG_LOG(("FirewallHelperClass::findSpareSocketByPort - found it!")); return &(m_spareSockets[i]); } } - DEBUG_LOG(("FirewallHelperClass::findSpareSocketByPort - didn't find it\n")); + DEBUG_LOG(("FirewallHelperClass::findSpareSocketByPort - didn't find it")); return NULL; } @@ -451,20 +451,20 @@ UnsignedShort FirewallHelperClass::getManglerResponse(UnsignedShort packetID, In CRC crc; crc.computeCRC((unsigned char *)(&(message->data.magic)), sizeof(ManglerData) - sizeof(unsigned int)); if (crc.get() != htonl(message->data.CRC)) { - DEBUG_LOG(("FirewallHelperClass::getManglerResponse - Saw message, CRC mismatch. Expected CRC %u, computed CRC %u\n", message->data.CRC, crc.get())); + DEBUG_LOG(("FirewallHelperClass::getManglerResponse - Saw message, CRC mismatch. Expected CRC %u, computed CRC %u", message->data.CRC, crc.get())); continue; } byteAdjust(&(message->data)); message->length = retval; - DEBUG_LOG(("FirewallHelperClass::getManglerResponse - Saw message of %d bytes from mangler %d on port %u\n", retval, i, m_spareSockets[i].port)); - DEBUG_LOG(("FirewallHelperClass::getManglerResponse - Message has packet ID %d 0x%08X, looking for packet id %d 0x%08X\n", message->data.PacketID, message->data.PacketID, packetID, packetID)); + DEBUG_LOG(("FirewallHelperClass::getManglerResponse - Saw message of %d bytes from mangler %d on port %u", retval, i, m_spareSockets[i].port)); + DEBUG_LOG(("FirewallHelperClass::getManglerResponse - Message has packet ID %d 0x%08X, looking for packet id %d 0x%08X", message->data.PacketID, message->data.PacketID, packetID, packetID)); if (message->data.PacketID == packetID) { - DEBUG_LOG(("FirewallHelperClass::getManglerResponse - packet ID's match, returning message\n")); + DEBUG_LOG(("FirewallHelperClass::getManglerResponse - packet ID's match, returning message")); msg = message; message->length = 0; } if (ntohs(message->data.PacketID) == packetID) { - DEBUG_LOG(("FirewallHelperClass::getManglerResponse - NETWORK BYTE ORDER packet ID's match, returning message\n")); + DEBUG_LOG(("FirewallHelperClass::getManglerResponse - NETWORK BYTE ORDER packet ID's match, returning message")); msg = message; message->length = 0; } @@ -487,7 +487,7 @@ UnsignedShort FirewallHelperClass::getManglerResponse(UnsignedShort packetID, In } UnsignedShort mangled_port = msg->data.MyMangledPortNumber; - DEBUG_LOG(("Mangler is seeing packets from port %d as coming from port %d\n", (UnsignedInt)msg->data.OriginalPortNumber, (UnsignedInt)mangled_port)); + DEBUG_LOG(("Mangler is seeing packets from port %d as coming from port %d", (UnsignedInt)msg->data.OriginalPortNumber, (UnsignedInt)mangled_port)); return mangled_port; } @@ -635,13 +635,13 @@ Bool FirewallHelperClass::detectionBeginUpdate() { */ if (TheWritableGlobalData->m_firewallPortOverride != 0) { m_behavior = FIREWALL_TYPE_SIMPLE; - DEBUG_LOG(("Source port %d specified by user\n", TheGlobalData->m_firewallPortOverride)); + DEBUG_LOG(("Source port %d specified by user", TheGlobalData->m_firewallPortOverride)); if (TheGlobalData->m_firewallSendDelay) { UnsignedInt addbehavior = FIREWALL_TYPE_NETGEAR_BUG; addbehavior |= (UnsignedInt)m_behavior; m_behavior = (FirewallBehaviorType) addbehavior; - DEBUG_LOG(("Netgear bug specified by command line or SendDelay flag\n")); + DEBUG_LOG(("Netgear bug specified by command line or SendDelay flag")); } m_currentState = DETECTIONSTATE_DONE; return TRUE; @@ -651,7 +651,7 @@ Bool FirewallHelperClass::detectionBeginUpdate() { m_timeoutStart = timeGetTime(); m_timeoutLength = 5000; - DEBUG_LOG(("About to call gethostbyname for the mangler address\n")); + DEBUG_LOG(("About to call gethostbyname for the mangler address")); int namenum = 0; do { @@ -668,7 +668,7 @@ Bool FirewallHelperClass::detectionBeginUpdate() { // mangler_name_ptr = &ManglerServerAddress[namenum][0]; // mangler_port = ManglerServerPort[namenum]; //current_mangler = CurrentManglerServer; -// DEBUG_LOG(("Using mangler from servserv\n")); +// DEBUG_LOG(("Using mangler from servserv")); // } namenum++; @@ -684,7 +684,7 @@ Bool FirewallHelperClass::detectionBeginUpdate() { struct hostent *host_info = gethostbyname(temp_name); if (!host_info) { - DEBUG_LOG(("gethostbyname failed! Error code %d\n", WSAGetLastError())); + DEBUG_LOG(("gethostbyname failed! Error code %d", WSAGetLastError())); break; } @@ -705,7 +705,7 @@ Bool FirewallHelperClass::detectionBeginUpdate() { Int m = m_numManglers++; memcpy(&mangler_addresses[m][0], &host_info->h_addr_list[0][0], 4); ntohl((UnsignedInt)mangler_addresses[m]); - DEBUG_LOG(("Found mangler address at %d.%d.%d.%d\n", mangler_addresses[m][0], mangler_addresses[m][1], mangler_addresses[m][2], mangler_addresses[m][3])); + DEBUG_LOG(("Found mangler address at %d.%d.%d.%d", mangler_addresses[m][0], mangler_addresses[m][1], mangler_addresses[m][2], mangler_addresses[m][3])); } } while ((m_numManglers < MAX_NUM_MANGLERS) && ((timeGetTime() - m_timeoutStart) < m_timeoutLength)); @@ -727,7 +727,7 @@ Bool FirewallHelperClass::detectionBeginUpdate() { // memcpy(&(m_manglers[i]), &mangler_addresses[i][0], 4); } - DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Testing for Netgear bug\n")); + DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Testing for Netgear bug")); /* ** See if the user specified a netgear firewall - that will save us the trouble. @@ -736,9 +736,9 @@ Bool FirewallHelperClass::detectionBeginUpdate() { UnsignedInt addbehavior = FIREWALL_TYPE_NETGEAR_BUG; addbehavior |= (UnsignedInt)m_behavior; m_behavior = (FirewallBehaviorType) addbehavior; - DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Netgear bug specified by command line or SendDelay flag\n")); + DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Netgear bug specified by command line or SendDelay flag")); } else { - DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Netgear bug not specified\n")); + DEBUG_LOG(("FirewallHelperClass::detectionBeginUpdate - Netgear bug not specified")); } /* @@ -750,7 +750,7 @@ Bool FirewallHelperClass::detectionBeginUpdate() { ** */ - DEBUG_LOG(("About to start mangler test 1\n")); + DEBUG_LOG(("About to start mangler test 1")); /* ** Get a spare port number and create a new socket to bind it to. */ @@ -782,16 +782,16 @@ Bool FirewallHelperClass::detectionTest1Update() { if (m_mangledPorts[0] == 0 || m_mangledPorts[0] == m_sparePorts[0]) { if (m_mangledPorts[0] == m_sparePorts[0]) { m_sourcePortAllocationDelta = 0; - DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - Non-mangled response from mangler, quitting test.\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - Non-mangled response from mangler, quitting test.")); } if ((m_mangledPorts[0] == 0) && ((timeGetTime() - m_timeoutStart) < m_timeoutLength)) { // we are still waiting for a response and haven't timed out yet. - DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - waiting for response from mangler.\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - waiting for response from mangler.")); return FALSE; } if ((m_mangledPorts[0] == 0) && ((timeGetTime() - m_timeoutStart) >= m_timeoutLength)) { // we are still waiting for a response and we timed out. - DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - timed out waiting for response from mangler.\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - timed out waiting for response from mangler.")); } // either we have received a non-mangled response or we timed out waiting for a response. closeSpareSocket(m_sparePorts[0]); @@ -800,7 +800,7 @@ Bool FirewallHelperClass::detectionTest1Update() { return TRUE; } - DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - test 1 complete\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest1Update - test 1 complete")); /* ** Test one completed, time to start up the second test. ** @@ -830,7 +830,7 @@ Bool FirewallHelperClass::detectionTest2Update() { if ((timeGetTime() - m_timeoutStart) <= m_timeoutLength) { return FALSE; } - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - timed out waiting for mangler response\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - timed out waiting for mangler response")); m_currentState = DETECTIONSTATE_DONE; return TRUE; } @@ -850,21 +850,21 @@ Bool FirewallHelperClass::detectionTest2Update() { m_behavior = (FirewallBehaviorType)addBehavior; if (m_mangledPorts[1] == 0) { - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - got no response from mangler\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - got no response from mangler")); } else { - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - got a mangler response, no port mangling\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - got a mangler response, no port mangling")); } - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - Setting behavior to SIMPLE, done testing\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - Setting behavior to SIMPLE, done testing")); return TRUE; } if (m_mangledPorts[0] == m_mangledPorts[1]) { - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - port mangling doesn't depend on destination IP, setting to DUMB_MANGLING\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - port mangling doesn't depend on destination IP, setting to DUMB_MANGLING")); UnsignedInt addBehavior = (UnsignedInt)FIREWALL_TYPE_DUMB_MANGLING; addBehavior |= (UnsignedInt)m_behavior; m_behavior = (FirewallBehaviorType)addBehavior; } else { - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - port mangling depends on destination IP, setting to SMART_MANGLING\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - port mangling depends on destination IP, setting to SMART_MANGLING")); UnsignedInt addBehavior = (UnsignedInt)FIREWALL_TYPE_SMART_MANGLING; addBehavior |= (UnsignedInt)m_behavior; m_behavior = (FirewallBehaviorType)addBehavior; @@ -884,7 +884,7 @@ Bool FirewallHelperClass::detectionTest2Update() { m_currentTry = 0; m_packetID = m_packetID + 10; - DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - moving on to 3rd test\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest2Update - moving on to 3rd test")); m_currentState = DETECTIONSTATE_TEST3; return FALSE; @@ -916,7 +916,7 @@ Bool FirewallHelperClass::detectionTest3Update() { closeSpareSocket(m_sparePorts[j]); } } - DEBUG_LOG(("FirewallHelperClass::detectionTest3Update - Failed to open all the spare sockets, bailing test\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3Update - Failed to open all the spare sockets, bailing test")); m_currentState = DETECTIONSTATE_DONE; return TRUE; } @@ -931,7 +931,7 @@ Bool FirewallHelperClass::detectionTest3Update() { m_timeoutStart = timeGetTime(); m_timeoutLength = 12000; - DEBUG_LOG(("FirewallHelperClass::detectionTest3Update - Sending to %d manglers\n", NUM_TEST_PORTS)); + DEBUG_LOG(("FirewallHelperClass::detectionTest3Update - Sending to %d manglers", NUM_TEST_PORTS)); for (i=0 ; i (Int)FIREWALL_TYPE_SIMPLE) { /* ** If the delta we got last time we played looks good then use that. */ - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForResponsesUpdate - using the port allocation delta we have from before which is %d\n", m_lastSourcePortAllocationDelta)); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForResponsesUpdate - using the port allocation delta we have from before which is %d", m_lastSourcePortAllocationDelta)); m_sourcePortAllocationDelta = m_lastSourcePortAllocationDelta; } ++m_currentTry; @@ -1040,7 +1040,7 @@ Bool FirewallHelperClass::detectionTest3WaitForResponsesUpdate() { return FALSE; } - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - starting 4th test\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - starting 4th test")); /* ** Fourth test. ** @@ -1050,7 +1050,7 @@ Bool FirewallHelperClass::detectionTest3WaitForResponsesUpdate() { if ((m_behavior & FIREWALL_TYPE_SIMPLE_PORT_ALLOCATION) != 0) { - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - simple port allocation, Testing to see if the NAT mangles differently per destination port at the same IP\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - simple port allocation, Testing to see if the NAT mangles differently per destination port at the same IP")); /* ** We need 2 source ports for this. @@ -1058,7 +1058,7 @@ Bool FirewallHelperClass::detectionTest3WaitForResponsesUpdate() { m_sparePorts[0] = getNextTemporarySourcePort(0); if (!openSpareSocket(m_sparePorts[0])) { m_currentState = DETECTIONSTATE_DONE; - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - Failed to open first spare port, bailing\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - Failed to open first spare port, bailing")); return TRUE; } @@ -1066,7 +1066,7 @@ Bool FirewallHelperClass::detectionTest3WaitForResponsesUpdate() { if (!openSpareSocket(m_sparePorts[1])) { closeSpareSocket(m_sparePorts[0]); m_currentState = DETECTIONSTATE_DONE; - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - Failed to open second spare port, bailing\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - Failed to open second spare port, bailing")); return TRUE; } @@ -1089,18 +1089,18 @@ Bool FirewallHelperClass::detectionTest3WaitForResponsesUpdate() { /* ** NAT32 uses different mangled source ports for different destination ports. */ - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - relative port allocation, NAT32 right?\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - relative port allocation, NAT32 right?")); UnsignedInt addbehavior = 0; addbehavior = (UnsignedInt)FIREWALL_TYPE_DESTINATION_PORT_DELTA; - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - adding DESTINATION PORT DELTA to behavior\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - adding DESTINATION PORT DELTA to behavior")); addbehavior |= (UnsignedInt)m_behavior; m_behavior = (FirewallBehaviorType) addbehavior; } } else { - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForResponsesUpdate - We don't have smart mangling, skipping test 4, entering test 5\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForResponsesUpdate - We don't have smart mangling, skipping test 4, entering test 5")); } - DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - entering test 5\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest3WaitForRepsonsesUpdate - entering test 5")); m_currentState = DETECTIONSTATE_TEST5; return FALSE; @@ -1116,7 +1116,7 @@ Bool FirewallHelperClass::detectionTest4Stage1Update() { closeSpareSocket(m_sparePorts[0]); closeSpareSocket(m_sparePorts[1]); m_currentState = DETECTIONSTATE_DONE; - DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage1Update - timed out waiting for mangler response, quitting\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage1Update - timed out waiting for mangler response, quitting")); return TRUE; } return FALSE; @@ -1155,14 +1155,14 @@ Bool FirewallHelperClass::detectionTest4Stage2Update() { closeSpareSocket(m_sparePorts[0]); closeSpareSocket(m_sparePorts[1]); m_currentState = DETECTIONSTATE_DONE; - DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - timed out waiting for the second mangler response, quitting\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - timed out waiting for the second mangler response, quitting")); return TRUE; } return FALSE; } if (m_mangledPorts[1] != m_mangledPorts[0] + m_sourcePortAllocationDelta) { - DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - NAT uses different source ports for different destination ports\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - NAT uses different source ports for different destination ports")); UnsignedInt addbehavior = 0; addbehavior = (UnsignedInt)FIREWALL_TYPE_DESTINATION_PORT_DELTA; @@ -1171,9 +1171,9 @@ Bool FirewallHelperClass::detectionTest4Stage2Update() { } else { DEBUG_ASSERTCRASH(m_mangledPorts[1] == m_mangledPorts[0] + m_sourcePortAllocationDelta, ("Problem getting the source port deltas.")); if (m_mangledPorts[1] == m_mangledPorts[0] + m_sourcePortAllocationDelta) { - DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - NAT uses the same source port for different destination ports\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - NAT uses the same source port for different destination ports")); } else { - DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - Unable to complete destination port mangling test\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - Unable to complete destination port mangling test")); DEBUG_CRASH(("Unable to complete destination port mangling test\n")); } } @@ -1194,7 +1194,7 @@ Bool FirewallHelperClass::detectionTest5Update() { // for testing purposes and never get this far because it has behavior that doesn't require // all the tests to be performed. // BGC 10/1/02 - DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Testing for Netgear bug\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Testing for Netgear bug")); /* ** See if the user specified a netgear firewall - that will save us the trouble. @@ -1203,9 +1203,9 @@ Bool FirewallHelperClass::detectionTest5Update() { UnsignedInt addbehavior = FIREWALL_TYPE_NETGEAR_BUG; addbehavior |= (UnsignedInt)m_behavior; m_behavior = (FirewallBehaviorType) addbehavior; - DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Netgear bug specified by command line or SendDelay flag\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Netgear bug specified by command line or SendDelay flag")); } else { - DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Netgear bug not specified\n")); + DEBUG_LOG(("FirewallHelperClass::detectionTest5Update - Netgear bug not specified")); } #endif // #if (0) @@ -1233,7 +1233,7 @@ Bool FirewallHelperClass::detectionTest5Update() { DEBUG_LOG((" FIREWALL_TYPE_DESTINATION_PORT_DELTA ")); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); m_currentState = DETECTIONSTATE_DONE; return TRUE; @@ -1262,7 +1262,7 @@ Int FirewallHelperClass::getNATPortAllocationScheme(Int numPorts, UnsignedShort { DEBUG_ASSERTCRASH(numPorts > 3, ("numPorts too small")); - DEBUG_LOG(("Looking for port allocation pattern in originalPorts %d, %d, %d, %d\n", originalPorts[0], originalPorts[1], originalPorts[2], originalPorts[3])); + DEBUG_LOG(("Looking for port allocation pattern in originalPorts %d, %d, %d, %d", originalPorts[0], originalPorts[1], originalPorts[2], originalPorts[3])); /* ** Sort the mangled ports into order - should be easier to detect patterns. @@ -1296,7 +1296,7 @@ Int FirewallHelperClass::getNATPortAllocationScheme(Int numPorts, UnsignedShort if (mangledPorts[1] - mangledPorts[0] == 1) { if (mangledPorts[2] - mangledPorts[1] == 1) { if (mangledPorts[3] - mangledPorts[2] == 1) { - DEBUG_LOG(("Incremental port allocation detected\n")); + DEBUG_LOG(("Incremental port allocation detected")); relativeDelta = FALSE; looksGood = TRUE; return(1); @@ -1310,7 +1310,7 @@ Int FirewallHelperClass::getNATPortAllocationScheme(Int numPorts, UnsignedShort if (mangledPorts[1] - mangledPorts[0] == 2) { if (mangledPorts[2] - mangledPorts[1] == 2) { if (mangledPorts[3] - mangledPorts[2] == 2) { - DEBUG_LOG(("Semi-incremental port allocation detected\n")); + DEBUG_LOG(("Semi-incremental port allocation detected")); relativeDelta = FALSE; looksGood = TRUE; return(2); @@ -1327,21 +1327,21 @@ Int FirewallHelperClass::getNATPortAllocationScheme(Int numPorts, UnsignedShort ** 3. Check for absolute scheme skipping 'n' ports. */ if (diff1 == diff2 && diff2 == diff3) { - DEBUG_LOG(("Looks good for absolute allocation sequence delta of %d\n", diff1)); + DEBUG_LOG(("Looks good for absolute allocation sequence delta of %d", diff1)); relativeDelta = FALSE; looksGood = TRUE; return(diff1); } if (diff1 == diff2) { - DEBUG_LOG(("Probable absolute allocation sequence delta of %d\n", diff1)); + DEBUG_LOG(("Probable absolute allocation sequence delta of %d", diff1)); relativeDelta = FALSE; looksGood = FALSE; return(diff1); } if (diff2 == diff3) { - DEBUG_LOG(("Probable absolute allocation sequence delta of %d\n", diff2)); + DEBUG_LOG(("Probable absolute allocation sequence delta of %d", diff2)); relativeDelta = FALSE; looksGood = FALSE; return(diff2); @@ -1375,7 +1375,7 @@ Int FirewallHelperClass::getNATPortAllocationScheme(Int numPorts, UnsignedShort /* ** Return a -ve result to indicate that port mangling is relative. */ - DEBUG_LOG(("Looks good for a relative port range delta of %d\n", diff1)); + DEBUG_LOG(("Looks good for a relative port range delta of %d", diff1)); relativeDelta = TRUE; looksGood = TRUE; return(diff1); @@ -1385,14 +1385,14 @@ Int FirewallHelperClass::getNATPortAllocationScheme(Int numPorts, UnsignedShort ** Look for a broken pattern. Maybe the NAT skipped a whole range. */ if (diff1 == diff2 || diff1 == diff3) { - DEBUG_LOG(("Detected probable broken relative port range delta of %d\n", diff1)); + DEBUG_LOG(("Detected probable broken relative port range delta of %d", diff1)); relativeDelta = TRUE; looksGood = FALSE; return(diff1); } if (diff2 == diff3) { - DEBUG_LOG(("Detected probable broken relative port range delta of %d\n", diff2)); + DEBUG_LOG(("Detected probable broken relative port range delta of %d", diff2)); relativeDelta = TRUE; looksGood = FALSE; return(diff2); @@ -1536,7 +1536,7 @@ Bool FirewallHelperClass::openSpareSocket(UnsignedShort port) { m_spareSockets[i].udp = NEW UDP(); if (m_spareSockets[i].udp == NULL) { - DEBUG_LOG(("FirewallHelperClass::openSpareSocket - failed to create UDP object\n")); + DEBUG_LOG(("FirewallHelperClass::openSpareSocket - failed to create UDP object")); return FALSE; } @@ -1546,7 +1546,7 @@ Bool FirewallHelperClass::openSpareSocket(UnsignedShort port) { } m_spareSockets[i].port = port; - DEBUG_LOG(("FirewallHelperClass::openSpareSocket - port %d is open for send\n", port)); + DEBUG_LOG(("FirewallHelperClass::openSpareSocket - port %d is open for send", port)); return TRUE; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/FrameData.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/FrameData.cpp index 3df2510fac..5424023d35 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/FrameData.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/FrameData.cpp @@ -68,7 +68,7 @@ void FrameData::init() m_commandList->reset(); m_frameCommandCount = -1; - //DEBUG_LOG(("FrameData::init\n")); + //DEBUG_LOG(("FrameData::init")); m_commandCount = 0; m_lastFailedCC = -2; m_lastFailedFrameCC = -2; @@ -113,23 +113,23 @@ FrameDataReturnType FrameData::allCommandsReady(Bool debugSpewage) { if (debugSpewage) { if ((m_lastFailedFrameCC != m_frameCommandCount) || (m_lastFailedCC != m_commandCount)) { - DEBUG_LOG(("FrameData::allCommandsReady - failed, frame command count = %d, command count = %d\n", m_frameCommandCount, m_commandCount)); + DEBUG_LOG(("FrameData::allCommandsReady - failed, frame command count = %d, command count = %d", m_frameCommandCount, m_commandCount)); m_lastFailedFrameCC = m_frameCommandCount; m_lastFailedCC = m_commandCount; } } if (m_commandCount > m_frameCommandCount) { - DEBUG_LOG(("FrameData::allCommandsReady - There are more commands than there should be (%d, should be %d). Commands in command list are...\n", m_commandCount, m_frameCommandCount)); + DEBUG_LOG(("FrameData::allCommandsReady - There are more commands than there should be (%d, should be %d). Commands in command list are...", m_commandCount, m_frameCommandCount)); NetCommandRef *ref = m_commandList->getFirstMessage(); while (ref != NULL) { - DEBUG_LOG(("%s, frame = %d, id = %d\n", GetAsciiNetCommandType(ref->getCommand()->getNetCommandType()).str(), ref->getCommand()->getExecutionFrame(), ref->getCommand()->getID())); + DEBUG_LOG(("%s, frame = %d, id = %d", GetAsciiNetCommandType(ref->getCommand()->getNetCommandType()).str(), ref->getCommand()->getExecutionFrame(), ref->getCommand()->getID())); ref = ref->getNext(); } - DEBUG_LOG(("FrameData::allCommandsReady - End of command list.\n")); - DEBUG_LOG(("FrameData::allCommandsReady - about to clear the command list\n")); + DEBUG_LOG(("FrameData::allCommandsReady - End of command list.")); + DEBUG_LOG(("FrameData::allCommandsReady - about to clear the command list")); reset(); - DEBUG_LOG(("FrameData::allCommandsReady - command list cleared. command list length = %d, command count = %d, frame command count = %d\n", m_commandList->length(), m_commandCount, m_frameCommandCount)); + DEBUG_LOG(("FrameData::allCommandsReady - command list cleared. command list length = %d, command count = %d, frame command count = %d", m_commandList->length(), m_commandCount, m_frameCommandCount)); return FRAMEDATA_RESEND; } return FRAMEDATA_NOTREADY; @@ -139,7 +139,7 @@ FrameDataReturnType FrameData::allCommandsReady(Bool debugSpewage) { * Set the command count for this frame */ void FrameData::setFrameCommandCount(UnsignedInt frameCommandCount) { - //DEBUG_LOG(("setFrameCommandCount to %d for frame %d\n", frameCommandCount, m_frame)); + //DEBUG_LOG(("setFrameCommandCount to %d for frame %d", frameCommandCount, m_frame)); m_frameCommandCount = frameCommandCount; } @@ -174,7 +174,7 @@ void FrameData::addCommand(NetCommandMsg *msg) { m_commandList->addMessage(msg); ++m_commandCount; - //DEBUG_LOG(("added command %d, type = %d(%s), command count = %d, frame command count = %d\n", msg->getID(), msg->getNetCommandType(), GetAsciiNetCommandType(msg->getNetCommandType()).str(), m_commandCount, m_frameCommandCount)); + //DEBUG_LOG(("added command %d, type = %d(%s), command count = %d, frame command count = %d", msg->getID(), msg->getNetCommandType(), GetAsciiNetCommandType(msg->getNetCommandType()).str(), m_commandCount, m_frameCommandCount)); } /** diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/FrameDataManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/FrameDataManager.cpp index ed0831ef06..ffc1141a3e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/FrameDataManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/FrameDataManager.cpp @@ -90,7 +90,7 @@ void FrameDataManager::update() { void FrameDataManager::addNetCommandMsg(NetCommandMsg *msg) { UnsignedInt frame = msg->getExecutionFrame(); UnsignedInt frameindex = frame % FRAME_DATA_LENGTH; - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("FrameDataManager::addNetCommandMsg - about to add a command of type %s for frame %d, frame index %d\n", GetAsciiNetCommandType(msg->getNetCommandType()).str(), frame, frameindex)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("FrameDataManager::addNetCommandMsg - about to add a command of type %s for frame %d, frame index %d", GetAsciiNetCommandType(msg->getNetCommandType()).str(), frame, frameindex)); m_frameData[frameindex].addCommand(msg); if (m_isLocal) { @@ -168,7 +168,7 @@ UnsignedInt FrameDataManager::getFrameCommandCount(UnsignedInt frame) { void FrameDataManager::zeroFrames(UnsignedInt startingFrame, UnsignedInt numFrames) { UnsignedInt frameIndex = startingFrame % FRAME_DATA_LENGTH; for (UnsignedInt i = 0; i < numFrames; ++i) { - //DEBUG_LOG(("Calling zeroFrame for frame index %d\n", frameIndex)); + //DEBUG_LOG(("Calling zeroFrame for frame index %d", frameIndex)); m_frameData[frameIndex].zeroFrame(); ++frameIndex; frameIndex = frameIndex % FRAME_DATA_LENGTH; diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/FrameMetrics.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/FrameMetrics.cpp index 69749e5003..5815f9a2bf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/FrameMetrics.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/FrameMetrics.cpp @@ -98,7 +98,7 @@ void FrameMetrics::doPerFrameMetrics(UnsignedInt frame) { m_fpsList[m_fpsListIndex] = TheDisplay->getAverageFPS(); // m_fpsList[m_fpsListIndex] = TheGameClient->getFrame() - m_fpsStartingFrame; m_averageFps += ((Real)(m_fpsList[m_fpsListIndex])) / TheGlobalData->m_networkFPSHistoryLength; // add the new value to the average. -// DEBUG_LOG(("average after: %f\n", m_averageFps)); +// DEBUG_LOG(("average after: %f", m_averageFps)); ++m_fpsListIndex; m_fpsListIndex %= TheGlobalData->m_networkFPSHistoryLength; m_lastFpsTimeThing = curTime; @@ -120,7 +120,7 @@ void FrameMetrics::processLatencyResponse(UnsignedInt frame) { m_averageLatency += m_latencyList[latencyListIndex] / TheGlobalData->m_networkLatencyHistoryLength; if (frame % 16 == 0) { -// DEBUG_LOG(("ConnectionManager::processFrameInfoAck - average latency = %f\n", m_averageLatency)); +// DEBUG_LOG(("ConnectionManager::processFrameInfoAck - average latency = %f", m_averageLatency)); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp index 89f3397f26..3478b9e28e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp @@ -77,12 +77,12 @@ void GameSlot::reset() void GameSlot::saveOffOriginalInfo( void ) { - DEBUG_LOG(("GameSlot::saveOffOriginalInfo() - orig was color=%d, pos=%d, house=%d\n", + DEBUG_LOG(("GameSlot::saveOffOriginalInfo() - orig was color=%d, pos=%d, house=%d", m_origColor, m_origStartPos, m_origPlayerTemplate)); m_origPlayerTemplate = m_playerTemplate; m_origStartPos = m_startPos; m_origColor = m_color; - DEBUG_LOG(("GameSlot::saveOffOriginalInfo() - color=%d, pos=%d, house=%d\n", + DEBUG_LOG(("GameSlot::saveOffOriginalInfo() - color=%d, pos=%d, house=%d", m_color, m_startPos, m_playerTemplate)); } @@ -133,7 +133,7 @@ UnicodeString GameSlot::getApparentPlayerTemplateDisplayName( void ) const { return TheGameText->fetch("GUI:Observer"); } - DEBUG_LOG(("Fetching player template display name for player template %d (orig is %d)\n", + DEBUG_LOG(("Fetching player template display name for player template %d (orig is %d)", m_playerTemplate, m_origPlayerTemplate)); if (m_playerTemplate < 0) { @@ -439,7 +439,7 @@ void GameInfo::setSlot( Int slotNum, GameSlot slotInfo ) UnsignedInt ip = slotInfo.getIP(); #endif - DEBUG_LOG(("GameInfo::setSlot - setting slot %d to be player %ls with IP %d.%d.%d.%d\n", slotNum, slotInfo.getName().str(), + DEBUG_LOG(("GameInfo::setSlot - setting slot %d to be player %ls with IP %d.%d.%d.%d", slotNum, slotInfo.getName().str(), PRINTF_IP_AS_4_INTS(ip))); } @@ -521,7 +521,7 @@ void GameInfo::setMap( AsciiString mapName ) path.removeLastChar(); path.removeLastChar(); path.concat("tga"); - DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'\n", path.str())); + DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'", path.str())); File *fp = TheFileSystem->openFile(path.str()); if (fp) { @@ -551,7 +551,7 @@ void GameInfo::setMap( AsciiString mapName ) } } newMapName.concat("/map.ini"); - DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'\n", newMapName.str())); + DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'", newMapName.str())); fp = TheFileSystem->openFile(newMapName.str()); if (fp) { @@ -561,7 +561,7 @@ void GameInfo::setMap( AsciiString mapName ) } path = GetStrFileFromMap(m_mapName); - DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'\n", path.str())); + DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'", path.str())); fp = TheFileSystem->openFile(path.str()); if (fp) { @@ -571,7 +571,7 @@ void GameInfo::setMap( AsciiString mapName ) } path = GetSoloINIFromMap(m_mapName); - DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'\n", path.str())); + DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'", path.str())); fp = TheFileSystem->openFile(path.str()); if (fp) { @@ -581,7 +581,7 @@ void GameInfo::setMap( AsciiString mapName ) } path = GetAssetUsageFromMap(m_mapName); - DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'\n", path.str())); + DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'", path.str())); fp = TheFileSystem->openFile(path.str()); if (fp) { @@ -591,7 +591,7 @@ void GameInfo::setMap( AsciiString mapName ) } path = GetReadmeFromMap(m_mapName); - DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'\n", path.str())); + DEBUG_LOG(("GameInfo::setMap() - Looking for '%s'", path.str())); fp = TheFileSystem->openFile(path.str()); if (fp) { @@ -624,16 +624,16 @@ void GameInfo::setMapCRC( UnsignedInt mapCRC ) //TheMapCache->updateCache(); AsciiString lowerMap = m_mapName; lowerMap.toLower(); - //DEBUG_LOG(("GameInfo::setMapCRC - looking for map file \"%s\" in the map cache\n", lowerMap.str())); + //DEBUG_LOG(("GameInfo::setMapCRC - looking for map file \"%s\" in the map cache", lowerMap.str())); std::map::iterator it = TheMapCache->find(lowerMap); if (it == TheMapCache->end()) { /* - DEBUG_LOG(("GameInfo::setMapCRC - could not find map file.\n")); + DEBUG_LOG(("GameInfo::setMapCRC - could not find map file.")); it = TheMapCache->begin(); while (it != TheMapCache->end()) { - DEBUG_LOG(("\t\"%s\"\n", it->first.str())); + DEBUG_LOG(("\t\"%s\"", it->first.str())); ++it; } */ @@ -641,12 +641,12 @@ void GameInfo::setMapCRC( UnsignedInt mapCRC ) } else if (m_mapCRC != it->second.m_CRC) { - DEBUG_LOG(("GameInfo::setMapCRC - map CRC's do not match (%X/%X).\n", m_mapCRC, it->second.m_CRC)); + DEBUG_LOG(("GameInfo::setMapCRC - map CRC's do not match (%X/%X).", m_mapCRC, it->second.m_CRC)); getSlot(getLocalSlotNum())->setMapAvailability(false); } else { - //DEBUG_LOG(("GameInfo::setMapCRC - map CRC's match.\n")); + //DEBUG_LOG(("GameInfo::setMapCRC - map CRC's match.")); getSlot(getLocalSlotNum())->setMapAvailability(true); } } @@ -667,17 +667,17 @@ void GameInfo::setMapSize( UnsignedInt mapSize ) std::map::iterator it = TheMapCache->find(lowerMap); if (it == TheMapCache->end()) { - DEBUG_LOG(("GameInfo::setMapSize - could not find map file.\n")); + DEBUG_LOG(("GameInfo::setMapSize - could not find map file.")); getSlot(getLocalSlotNum())->setMapAvailability(false); } else if (m_mapCRC != it->second.m_CRC) { - DEBUG_LOG(("GameInfo::setMapSize - map CRC's do not match.\n")); + DEBUG_LOG(("GameInfo::setMapSize - map CRC's do not match.")); getSlot(getLocalSlotNum())->setMapAvailability(false); } else { - //DEBUG_LOG(("GameInfo::setMapSize - map CRC's match.\n")); + //DEBUG_LOG(("GameInfo::setMapSize - map CRC's match.")); getSlot(getLocalSlotNum())->setMapAvailability(true); } } @@ -920,7 +920,7 @@ AsciiString GameInfoToAsciiString( const GameInfo *game ) newMapName.concat(token); mapName.nextToken(&token, "\\/"); } - DEBUG_LOG(("Map name is %s\n", mapName.str())); + DEBUG_LOG(("Map name is %s", mapName.str())); } AsciiString optionsString; @@ -1023,8 +1023,8 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) Bool sawMap, sawMapCRC, sawMapSize, sawSeed, sawSlotlist, sawUseStats, sawSuperweaponRestriction, sawStartingCash, sawOldFactions; sawMap = sawMapCRC = sawMapSize = sawSeed = sawSlotlist = sawUseStats = sawSuperweaponRestriction = sawStartingCash = sawOldFactions = FALSE; - //DEBUG_LOG(("Saw options of %s\n", options.str())); - DEBUG_LOG(("ParseAsciiStringToGameInfo - parsing [%s]\n", options.str())); + //DEBUG_LOG(("Saw options of %s", options.str())); + DEBUG_LOG(("ParseAsciiStringToGameInfo - parsing [%s]", options.str())); while ( (keyValPair = strtok_r(bufPtr, ";", &strPos)) != NULL ) @@ -1044,7 +1044,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) if (val.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - saw empty value, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - saw empty value, quitting")); break; } @@ -1059,7 +1059,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) if (val.getLength() < 3) { optionsOk = FALSE; - DEBUG_LOG(("ParseAsciiStringToGameInfo - saw bogus map; quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - saw bogus map; quitting")); break; } mapContentsMask = grabHexInt(val.str()); @@ -1085,12 +1085,12 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) // in other words is bogus and points outside of the approved target directory for maps, avoid an arbitrary file overwrite vulnerability // if the save or network game embeds a custom map to store at the location, by flagging the options as not OK and rejecting the game. optionsOk = FALSE; - DEBUG_LOG(("ParseAsciiStringToGameInfo - saw bogus map name ('%s'); quitting\n", mapName.str())); + DEBUG_LOG(("ParseAsciiStringToGameInfo - saw bogus map name ('%s'); quitting", mapName.str())); break; } mapName = realMapName; sawMap = true; - DEBUG_LOG(("ParseAsciiStringToGameInfo - map name is %s\n", mapName.str())); + DEBUG_LOG(("ParseAsciiStringToGameInfo - map name is %s", mapName.str())); } else if (key.compare("MC") == 0) { @@ -1107,7 +1107,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) { seed = atoi(val.str()); sawSeed = true; -// DEBUG_LOG(("ParseAsciiStringToGameInfo - random seed is %d\n", seed)); +// DEBUG_LOG(("ParseAsciiStringToGameInfo - random seed is %d", seed)); } else if (key.compare("C") == 0) { @@ -1140,7 +1140,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) AsciiString rawSlot; // Bool slotsOk = true; //flag that lets us know whether or not the slot list is good. -// DEBUG_LOG(("ParseAsciiStringToGameInfo - Parsing slot list\n")); +// DEBUG_LOG(("ParseAsciiStringToGameInfo - Parsing slot list")); for (int i=0; i= TheMultiplayerSettings->getNumColors()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - player color was invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - player color was invalid, quitting")); break; } newSlot[i].setColor(color); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - player color set to %d\n", color)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - player color set to %d", color)); //Read playerTemplate index slotValue = strtok_r(NULL,",",&slotPos); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue player template is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue player template is empty, quitting")); break; } Int playerTemplate = atoi(slotValue.str()); if (playerTemplate < PLAYERTEMPLATE_MIN || playerTemplate >= ThePlayerTemplateStore->getPlayerTemplateCount()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - player template value is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - player template value is invalid, quitting")); break; } newSlot[i].setPlayerTemplate(playerTemplate); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - player template is %d\n", playerTemplate)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - player template is %d", playerTemplate)); //Read start position index slotValue = strtok_r(NULL,",",&slotPos); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue start position is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue start position is empty, quitting")); break; } Int startPos = atoi(slotValue.str()); if (startPos < -1 || startPos >= MAX_SLOTS) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - player start position is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - player start position is invalid, quitting")); break; } newSlot[i].setStartPos(startPos); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - player start position is %d\n", startPos)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - player start position is %d", startPos)); //Read team index slotValue = strtok_r(NULL,",",&slotPos); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue team number is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue team number is empty, quitting")); break; } Int team = atoi(slotValue.str()); if (team < -1 || team >= MAX_SLOTS/2) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is invalid, quitting")); break; } newSlot[i].setTeamNumber(team); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is %d\n", team)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is %d", team)); // Read the NAT behavior slotValue = strtok_r(NULL, ",",&slotPos); if (slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - NAT behavior is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - NAT behavior is empty, quitting")); break; } FirewallHelperClass::FirewallBehaviorType NATType = (FirewallHelperClass::FirewallBehaviorType)atoi(slotValue.str()); if ((NATType < FirewallHelperClass::FIREWALL_MIN) || (NATType > FirewallHelperClass::FIREWALL_MAX)) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - NAT behavior is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - NAT behavior is invalid, quitting")); break; } newSlot[i].setNATBehavior(NATType); - DEBUG_LOG(("ParseAsciiStringToGameInfo - NAT behavior is %X\n", NATType)); + DEBUG_LOG(("ParseAsciiStringToGameInfo - NAT behavior is %X", NATType)); }// case 'H': break; case 'C': { - DEBUG_LOG(("ParseAsciiStringToGameInfo - AI player\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - AI player")); char *slotPos = NULL; //Parse out the Name AsciiString slotValue(strtok_r((char *)rawSlot.str(),",",&slotPos)); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue AI Type is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue AI Type is empty, quitting")); break; } @@ -1328,25 +1328,25 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) case 'E': { newSlot[i].setState(SLOT_EASY_AI); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - Easy AI\n")); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - Easy AI")); } break; case 'M': { newSlot[i].setState(SLOT_MED_AI); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - Medium AI\n")); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - Medium AI")); } break; case 'H': { newSlot[i].setState(SLOT_BRUTAL_AI); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - Brutal AI\n")); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - Brutal AI")); } break; default: { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - Unknown AI, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - Unknown AI, quitting")); } break; }//switch(*rawSlot.str()+1) @@ -1356,43 +1356,43 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue color is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue color is empty, quitting")); break; } Int color = atoi(slotValue.str()); if (color < -1 || color >= TheMultiplayerSettings->getNumColors()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - player color was invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - player color was invalid, quitting")); break; } newSlot[i].setColor(color); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - player color set to %d\n", color)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - player color set to %d", color)); //Read playerTemplate index slotValue = strtok_r(NULL,",",&slotPos); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue player template is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue player template is empty, quitting")); break; } Int playerTemplate = atoi(slotValue.str()); if (playerTemplate < PLAYERTEMPLATE_MIN || playerTemplate >= ThePlayerTemplateStore->getPlayerTemplateCount()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - player template value is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - player template value is invalid, quitting")); break; } newSlot[i].setPlayerTemplate(playerTemplate); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - player template is %d\n", playerTemplate)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - player template is %d", playerTemplate)); //Read start pos slotValue = strtok_r(NULL,",",&slotPos); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue start pos is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue start pos is empty, quitting")); break; } Int startPos = atoi(slotValue.str()); @@ -1411,48 +1411,48 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) if (isStartPosBad) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - start pos is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - start pos is invalid, quitting")); break; } newSlot[i].setStartPos(startPos); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - start spot is %d\n", startPos)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - start spot is %d", startPos)); //Read team index slotValue = strtok_r(NULL,",",&slotPos); if(slotValue.isEmpty()) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue team number is empty, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - slotValue team number is empty, quitting")); break; } Int team = atoi(slotValue.str()); if (team < -1 || team >= MAX_SLOTS/2) { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is invalid, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is invalid, quitting")); break; } newSlot[i].setTeamNumber(team); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is %d\n", team)); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - team number is %d", team)); }//case 'C': break; case 'O': { newSlot[i].setState( SLOT_OPEN ); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - Slot is open\n")); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - Slot is open")); }// case 'O': break; case 'X': { newSlot[i].setState( SLOT_CLOSED ); - //DEBUG_LOG(("ParseAsciiStringToGameInfo - Slot is closed\n")); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - Slot is closed")); }// case 'X': break; default: { optionsOk = false; - DEBUG_LOG(("ParseAsciiStringToGameInfo - unrecognized slot entry, quitting\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - unrecognized slot entry, quitting")); } break; } @@ -1469,7 +1469,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) if( buf ) free(buf); - //DEBUG_LOG(("Options were ok == %d\n", optionsOk)); + //DEBUG_LOG(("Options were ok == %d", optionsOk)); if (optionsOk && sawMap && sawMapCRC && sawMapSize && sawSeed && sawSlotlist && sawCRC && sawUseStats && sawSuperweaponRestriction && sawStartingCash && sawOldFactions ) { // We were setting the Global Data directly here, but Instead, I'm now @@ -1478,7 +1478,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) if (!game) return true; - //DEBUG_LOG(("ParseAsciiStringToGameInfo - game options all good, setting info\n")); + //DEBUG_LOG(("ParseAsciiStringToGameInfo - game options all good, setting info")); for(Int i = 0; isetSlot(i,newSlot[i]); @@ -1497,7 +1497,7 @@ Bool ParseAsciiStringToGameInfo(GameInfo *game, AsciiString options) return true; } - DEBUG_LOG(("ParseAsciiStringToGameInfo - game options messed up\n")); + DEBUG_LOG(("ParseAsciiStringToGameInfo - game options messed up")); return false; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/GSConfig.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/GSConfig.cpp index ffcba31b8d..58a19cd947 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/GSConfig.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/GSConfig.cpp @@ -403,12 +403,12 @@ m_qmChannel(0) } else { - DEBUG_LOG(("Unknown key '%s' = '%s' in NAT block of GameSpy Config\n", key.str(), val.str())); + DEBUG_LOG(("Unknown key '%s' = '%s' in NAT block of GameSpy Config", key.str(), val.str())); } } else { - DEBUG_LOG(("Key '%s' missing val in NAT block of GameSpy Config\n", key.str())); + DEBUG_LOG(("Key '%s' missing val in NAT block of GameSpy Config", key.str())); } } else if (inCustom) @@ -423,12 +423,12 @@ m_qmChannel(0) } else { - DEBUG_LOG(("Unknown key '%s' = '%s' in Custom block of GameSpy Config\n", key.str(), val.str())); + DEBUG_LOG(("Unknown key '%s' = '%s' in Custom block of GameSpy Config", key.str(), val.str())); } } else { - DEBUG_LOG(("Key '%s' missing val in Custom block of GameSpy Config\n", key.str())); + DEBUG_LOG(("Key '%s' missing val in Custom block of GameSpy Config", key.str())); } } else diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LadderDefs.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LadderDefs.cpp index 8759be5564..f2bfbbfeca 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LadderDefs.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LadderDefs.cpp @@ -58,7 +58,7 @@ LadderInfo::LadderInfo() static LadderInfo *parseLadder(AsciiString raw) { - DEBUG_LOG(("Looking at ladder:\n%s\n", raw.str())); + DEBUG_LOG(("Looking at ladder:\n%s", raw.str())); LadderInfo *lad = NULL; AsciiString line; while (raw.nextToken(&line, "\n")) @@ -158,7 +158,7 @@ static LadderInfo *parseLadder(AsciiString raw) } else if ( lad && line.compare("") == 0 ) { - DEBUG_LOG(("Saw a ladder: name=%ls, addr=%s:%d, players=%dv%d, pass=%s, replay=%d, homepage=%s\n", + DEBUG_LOG(("Saw a ladder: name=%ls, addr=%s:%d, players=%dv%d, pass=%s, replay=%d, homepage=%s", lad->name.str(), lad->address.str(), lad->port, lad->playersPerTeam, lad->playersPerTeam, lad->cryptedPassword.str(), lad->submitReplay, lad->homepageURL.str())); // end of a ladder @@ -166,7 +166,7 @@ static LadderInfo *parseLadder(AsciiString raw) { if (lad->validFactions.size() == 0) { - DEBUG_LOG(("No factions specified. Using all.\n")); + DEBUG_LOG(("No factions specified. Using all.")); lad->validFactions.clear(); Int numTemplates = ThePlayerTemplateStore->getPlayerTemplateCount(); for ( Int i = 0; i < numTemplates; ++i ) @@ -187,13 +187,13 @@ static LadderInfo *parseLadder(AsciiString raw) AsciiString faction = *it; AsciiString marker; marker.format("INI:Faction%s", faction.str()); - DEBUG_LOG(("Faction %s has marker %s corresponding to str %ls\n", faction.str(), marker.str(), TheGameText->fetch(marker).str())); + DEBUG_LOG(("Faction %s has marker %s corresponding to str %ls", faction.str(), marker.str(), TheGameText->fetch(marker).str())); } } if (lad->validMaps.size() == 0) { - DEBUG_LOG(("No maps specified. Using all.\n")); + DEBUG_LOG(("No maps specified. Using all.")); std::list qmMaps = TheGameSpyConfig->getQMMaps(); for (std::list::const_iterator it = qmMaps.begin(); it != qmMaps.end(); ++it) { @@ -313,12 +313,12 @@ LadderList::LadderList() lad->index = index++; if (inLadders) { - DEBUG_LOG(("Adding to standard ladders\n")); + DEBUG_LOG(("Adding to standard ladders")); m_standardLadders.push_back(lad); } else { - DEBUG_LOG(("Adding to special ladders\n")); + DEBUG_LOG(("Adding to special ladders")); m_specialLadders.push_back(lad); } } @@ -335,7 +335,7 @@ LadderList::LadderList() // look for local ladders loadLocalLadders(); - DEBUG_LOG(("After looking for ladders, we have %d local, %d special && %d normal\n", m_localLadders.size(), m_specialLadders.size(), m_standardLadders.size())); + DEBUG_LOG(("After looking for ladders, we have %d local, %d special && %d normal", m_localLadders.size(), m_specialLadders.size(), m_standardLadders.size())); } LadderList::~LadderList() @@ -457,7 +457,7 @@ void LadderList::loadLocalLadders( void ) while (it != filenameList.end()) { AsciiString filename = *it; - DEBUG_LOG(("Looking at possible ladder info file '%s'\n", filename.str())); + DEBUG_LOG(("Looking at possible ladder info file '%s'", filename.str())); filename.toLower(); checkLadder( filename, index-- ); ++it; @@ -483,7 +483,7 @@ void LadderList::checkLadder( AsciiString fname, Int index ) fp = NULL; } - DEBUG_LOG(("Read %d bytes from '%s'\n", rawData.getLength(), fname.str())); + DEBUG_LOG(("Read %d bytes from '%s'", rawData.getLength(), fname.str())); if (rawData.isEmpty()) return; @@ -496,21 +496,21 @@ void LadderList::checkLadder( AsciiString fname, Int index ) // sanity check if (li->address.isEmpty()) { - DEBUG_LOG(("Bailing because of li->address.isEmpty()\n")); + DEBUG_LOG(("Bailing because of li->address.isEmpty()")); delete li; return; } if (!li->port) { - DEBUG_LOG(("Bailing because of !li->port\n")); + DEBUG_LOG(("Bailing because of !li->port")); delete li; return; } if (li->validMaps.size() == 0) { - DEBUG_LOG(("Bailing because of li->validMaps.size() == 0\n")); + DEBUG_LOG(("Bailing because of li->validMaps.size() == 0")); delete li; return; } @@ -525,6 +525,6 @@ void LadderList::checkLadder( AsciiString fname, Int index ) // fname.removeLastChar(); // remove .lad //li->name = UnicodeString(MultiByteToWideCharSingleLine(fname.reverseFind('\\')+1).c_str()); - DEBUG_LOG(("Adding local ladder %ls\n", li->name.str())); + DEBUG_LOG(("Adding local ladder %ls", li->name.str())); m_localLadders.push_back(li); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp index e97398ce9e..1d8dba2a8f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp @@ -282,7 +282,7 @@ static void queuePatch(Bool mandatory, AsciiString downloadURL) AsciiString fileName = "patches\\"; fileName.concat(fileStr); - DEBUG_LOG(("download URL split: %d [%s] [%s] [%s] [%s] [%s] [%s]\n", + DEBUG_LOG(("download URL split: %d [%s] [%s] [%s] [%s] [%s] [%s]", success, connectionType.str(), server.str(), user.str(), pass.str(), filePath.str(), fileName.str())); @@ -338,9 +338,9 @@ static GHTTPBool motdCallback( GHTTPRequest request, GHTTPResult result, onlineCancelWindow = NULL; } - DEBUG_LOG(("------- Got MOTD before going online -------\n")); - DEBUG_LOG(("%s\n", (MOTDBuffer)?MOTDBuffer:"")); - DEBUG_LOG(("--------------------------------------------\n")); + DEBUG_LOG(("------- Got MOTD before going online -------")); + DEBUG_LOG(("%s", (MOTDBuffer)?MOTDBuffer:"")); + DEBUG_LOG(("--------------------------------------------")); if (!checksLeftBeforeOnline) startOnline(); @@ -405,7 +405,7 @@ static GHTTPBool configCallback( GHTTPRequest request, GHTTPResult result, onlineCancelWindow = NULL; } - DEBUG_LOG(("Got Config before going online\n")); + DEBUG_LOG(("Got Config before going online")); if (!checksLeftBeforeOnline) startOnline(); @@ -425,11 +425,11 @@ static GHTTPBool configHeadCallback( GHTTPRequest request, GHTTPResult result, return GHTTPTrue; } - DEBUG_LOG(("HTTP head resp: res=%d, len=%d, buf=[%s]\n", result, bufferLen, buffer)); + DEBUG_LOG(("HTTP head resp: res=%d, len=%d, buf=[%s]", result, bufferLen, buffer)); if (result == GHTTPSuccess) { - DEBUG_LOG(("Headers are [%s]\n", ghttpGetHeaders( request ))); + DEBUG_LOG(("Headers are [%s]", ghttpGetHeaders( request ))); AsciiString headers(ghttpGetHeaders( request )); AsciiString line; @@ -480,7 +480,7 @@ static GHTTPBool configHeadCallback( GHTTPRequest request, GHTTPResult result, configBuffer[fileLen-1] = 0; fclose(fp); - DEBUG_LOG(("Got Config before going online\n")); + DEBUG_LOG(("Got Config before going online")); if (!checksLeftBeforeOnline) startOnline(); @@ -515,7 +515,7 @@ static GHTTPBool gamePatchCheckCallback( GHTTPRequest request, GHTTPResult resul --checksLeftBeforeOnline; DEBUG_ASSERTCRASH(checksLeftBeforeOnline>=0, ("Too many callbacks")); - DEBUG_LOG(("Result=%d, buffer=[%s], len=%d\n", result, buffer, bufferLen)); + DEBUG_LOG(("Result=%d, buffer=[%s], len=%d", result, buffer, bufferLen)); if (result != GHTTPSuccess) { if (!checkingForPatchBeforeGameSpy) @@ -539,7 +539,7 @@ static GHTTPBool gamePatchCheckCallback( GHTTPRequest request, GHTTPResult resul ok &= line.nextToken(&url, " "); if (ok && type == "patch") { - DEBUG_LOG(("Saw a patch: %d/[%s]\n", atoi(req.str()), url.str())); + DEBUG_LOG(("Saw a patch: %d/[%s]", atoi(req.str()), url.str())); queuePatch( atoi(req.str()), url ); if (atoi(req.str())) { @@ -595,7 +595,7 @@ void CancelPatchCheckCallback( void ) static GHTTPBool overallStatsCallback( GHTTPRequest request, GHTTPResult result, char * buffer, GHTTPByteCount bufferLen, void * param ) { - DEBUG_LOG(("overallStatsCallback() - Result=%d, len=%d\n", result, bufferLen)); + DEBUG_LOG(("overallStatsCallback() - Result=%d, len=%d", result, bufferLen)); if (result != GHTTPSuccess) { return GHTTPTrue; @@ -609,7 +609,7 @@ static GHTTPBool overallStatsCallback( GHTTPRequest request, GHTTPResult result, static GHTTPBool numPlayersOnlineCallback( GHTTPRequest request, GHTTPResult result, char * buffer, GHTTPByteCount bufferLen, void * param ) { - DEBUG_LOG(("numPlayersOnlineCallback() - Result=%d, buffer=[%s], len=%d\n", result, buffer, bufferLen)); + DEBUG_LOG(("numPlayersOnlineCallback() - Result=%d, buffer=[%s], len=%d", result, buffer, bufferLen)); if (result != GHTTPSuccess) { return GHTTPTrue; @@ -626,7 +626,7 @@ static GHTTPBool numPlayersOnlineCallback( GHTTPRequest request, GHTTPResult res if (*s == '\\') ++s; - DEBUG_LOG(("Message was '%s', trimmed to '%s'=%d\n", buffer, s, atoi(s))); + DEBUG_LOG(("Message was '%s', trimmed to '%s'=%d", buffer, s, atoi(s))); HandleNumPlayersOnline(atoi(s)); return GHTTPTrue; @@ -805,10 +805,10 @@ static void reallyStartPatchCheck( void ) } // check for a patch first - DEBUG_LOG(("Game patch check: [%s]\n", gameURL.c_str())); - DEBUG_LOG(("Map patch check: [%s]\n", mapURL.c_str())); - DEBUG_LOG(("Config: [%s]\n", configURL.c_str())); - DEBUG_LOG(("MOTD: [%s]\n", motdURL.c_str())); + DEBUG_LOG(("Game patch check: [%s]", gameURL.c_str())); + DEBUG_LOG(("Map patch check: [%s]", mapURL.c_str())); + DEBUG_LOG(("Config: [%s]", configURL.c_str())); + DEBUG_LOG(("MOTD: [%s]", motdURL.c_str())); ghttpGet(gameURL.c_str(), GHTTPFalse, gamePatchCheckCallback, (void *)timeThroughOnline); ghttpGet(mapURL.c_str(), GHTTPFalse, gamePatchCheckCallback, (void *)timeThroughOnline); ghttpHead(configURL.c_str(), GHTTPFalse, configHeadCallback, (void *)timeThroughOnline); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/PeerDefs.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/PeerDefs.cpp index 65ecd212c4..aba48de404 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/PeerDefs.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/PeerDefs.cpp @@ -132,12 +132,12 @@ void GameSpyInfo::setLocalIPs(UnsignedInt internalIP, UnsignedInt externalIP) void GameSpyInfo::readAdditionalDisconnects( void ) { m_additionalDisconnects = GetAdditionalDisconnectsFromUserFile(m_localProfileID); - DEBUG_LOG(("GameSpyInfo::readAdditionalDisconnects() found %d disconnects.\n", m_additionalDisconnects)); + DEBUG_LOG(("GameSpyInfo::readAdditionalDisconnects() found %d disconnects.", m_additionalDisconnects)); } Int GameSpyInfo::getAdditionalDisconnects( void ) { - DEBUG_LOG(("GameSpyInfo::getAdditionalDisconnects() would have returned %d. Returning 0 instead.\n", m_additionalDisconnects)); + DEBUG_LOG(("GameSpyInfo::getAdditionalDisconnects() would have returned %d. Returning 0 instead.", m_additionalDisconnects)); return 0; } @@ -343,14 +343,14 @@ void GameSpyInfo::addGroupRoom( GameSpyGroupRoom room ) } else { - DEBUG_LOG(("Adding group room %d (%s)\n", room.m_groupID, room.m_name.str())); + DEBUG_LOG(("Adding group room %d (%s)", room.m_groupID, room.m_name.str())); AsciiString groupLabel; groupLabel.format("GUI:%s", room.m_name.str()); room.m_translatedName = TheGameText->fetch(groupLabel); m_groupRooms[room.m_groupID] = room; if ( !stricmp("quickmatch", room.m_name.str()) ) { - DEBUG_LOG(("Group room %d (%s) is the QuickMatch room\n", room.m_groupID, room.m_name.str())); + DEBUG_LOG(("Group room %d (%s) is the QuickMatch room", room.m_groupID, room.m_name.str())); TheGameSpyConfig->setQMChannel(room.m_groupID); } } @@ -381,7 +381,7 @@ void GameSpyInfo::joinBestGroupRoom( void ) { if (m_currentGroupRoomID) { - DEBUG_LOG(("Bailing from GameSpyInfo::joinBestGroupRoom() - we were already in a room\n")); + DEBUG_LOG(("Bailing from GameSpyInfo::joinBestGroupRoom() - we were already in a room")); m_currentGroupRoomID = 0; return; } @@ -394,7 +394,7 @@ void GameSpyInfo::joinBestGroupRoom( void ) while (iter != m_groupRooms.end()) { GameSpyGroupRoom room = iter->second; - DEBUG_LOG(("Group room %d: %s (%d, %d, %d, %d)\n", room.m_groupID, room.m_name.str(), room.m_numWaiting, room.m_maxWaiting, + DEBUG_LOG(("Group room %d: %s (%d, %d, %d, %d)", room.m_groupID, room.m_name.str(), room.m_numWaiting, room.m_maxWaiting, room.m_numGames, room.m_numPlaying)); if (TheGameSpyConfig->getQMChannel() != room.m_groupID && minPlayers > 25 && room.m_numWaiting < minPlayers) @@ -579,7 +579,7 @@ void GameSpyInfo::markAsStagingRoomJoiner( Int game ) m_localStagingRoom.setAllowObservers(info->getAllowObservers()); m_localStagingRoom.setHasPassword(info->getHasPassword()); m_localStagingRoom.setGameName(info->getGameName()); - DEBUG_LOG(("Joining game: host is %ls\n", m_localStagingRoom.getConstSlot(0)->getName().str())); + DEBUG_LOG(("Joining game: host is %ls", m_localStagingRoom.getConstSlot(0)->getName().str())); } } @@ -877,11 +877,11 @@ void GameSpyInfo::updateAdditionalGameSpyDisconnections(Int count) Int ptIdx; const PlayerTemplate *myTemplate = player->getPlayerTemplate(); - DEBUG_LOG(("myTemplate = %X(%s)\n", myTemplate, myTemplate->getName().str())); + DEBUG_LOG(("myTemplate = %X(%s)", myTemplate, myTemplate->getName().str())); for (ptIdx = 0; ptIdx < ThePlayerTemplateStore->getPlayerTemplateCount(); ++ptIdx) { const PlayerTemplate *nthTemplate = ThePlayerTemplateStore->getNthPlayerTemplate(ptIdx); - DEBUG_LOG(("nthTemplate = %X(%s)\n", nthTemplate, nthTemplate->getName().str())); + DEBUG_LOG(("nthTemplate = %X(%s)", nthTemplate, nthTemplate->getName().str())); if (nthTemplate == myTemplate) { break; @@ -906,7 +906,7 @@ void GameSpyInfo::updateAdditionalGameSpyDisconnections(Int count) Int disCons=stats.discons[ptIdx]; disCons += count; if (disCons < 0) - { DEBUG_LOG(("updateAdditionalGameSpyDisconnections() - disconnection count below zero\n")); + { DEBUG_LOG(("updateAdditionalGameSpyDisconnections() - disconnection count below zero")); return; //something is wrong here } stats.discons[ptIdx] = disCons; //add an additional disconnection to their stats. diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp index 9e2ed1253e..45614aec52 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp @@ -165,18 +165,18 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP "DELETE_TCB" }; - DEBUG_LOG(("Finding local address used to talk to the chat server\n")); - DEBUG_LOG(("Current chat server name is %s\n", serverName.str())); - DEBUG_LOG(("Chat server port is %d\n", serverPort)); + DEBUG_LOG(("Finding local address used to talk to the chat server")); + DEBUG_LOG(("Current chat server name is %s", serverName.str())); + DEBUG_LOG(("Chat server port is %d", serverPort)); /* ** Get the address of the chat server. */ - DEBUG_LOG( ("About to call gethostbyname\n")); + DEBUG_LOG( ("About to call gethostbyname")); struct hostent *host_info = gethostbyname(serverName.str()); if (!host_info) { - DEBUG_LOG( ("gethostbyname failed! Error code %d\n", WSAGetLastError())); + DEBUG_LOG( ("gethostbyname failed! Error code %d", WSAGetLastError())); return(false); } @@ -185,24 +185,24 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP temp = ntohl(temp); *((unsigned long*)(&serverAddress[0])) = temp; - DEBUG_LOG(("Host address is %d.%d.%d.%d\n", serverAddress[3], serverAddress[2], serverAddress[1], serverAddress[0])); + DEBUG_LOG(("Host address is %d.%d.%d.%d", serverAddress[3], serverAddress[2], serverAddress[1], serverAddress[0])); /* ** Load the MIB-II SNMP DLL. */ - DEBUG_LOG(("About to load INETMIB1.DLL\n")); + DEBUG_LOG(("About to load INETMIB1.DLL")); HINSTANCE mib_ii_dll = LoadLibrary("inetmib1.dll"); if (mib_ii_dll == NULL) { - DEBUG_LOG(("Failed to load INETMIB1.DLL\n")); + DEBUG_LOG(("Failed to load INETMIB1.DLL")); return(false); } - DEBUG_LOG(("About to load SNMPAPI.DLL\n")); + DEBUG_LOG(("About to load SNMPAPI.DLL")); HINSTANCE snmpapi_dll = LoadLibrary("snmpapi.dll"); if (snmpapi_dll == NULL) { - DEBUG_LOG(("Failed to load SNMPAPI.DLL\n")); + DEBUG_LOG(("Failed to load SNMPAPI.DLL")); FreeLibrary(mib_ii_dll); return(false); } @@ -215,7 +215,7 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP SnmpUtilMemAllocPtr = (void *(__stdcall *)(unsigned long)) GetProcAddress(snmpapi_dll, "SnmpUtilMemAlloc"); SnmpUtilMemFreePtr = (void (__stdcall *)(void *)) GetProcAddress(snmpapi_dll, "SnmpUtilMemFree"); if (SnmpExtensionInitPtr == NULL || SnmpExtensionQueryPtr == NULL || SnmpUtilMemAllocPtr == NULL || SnmpUtilMemFreePtr == NULL) { - DEBUG_LOG(("Failed to get proc addresses for linked functions\n")); + DEBUG_LOG(("Failed to get proc addresses for linked functions")); FreeLibrary(snmpapi_dll); FreeLibrary(mib_ii_dll); return(false); @@ -228,14 +228,14 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP /* ** OK, here we go. Try to initialise the .dll */ - DEBUG_LOG(("About to init INETMIB1.DLL\n")); + DEBUG_LOG(("About to init INETMIB1.DLL")); int ok = SnmpExtensionInitPtr(GetCurrentTime(), &trap_handle, &first_supported_region); if (!ok) { /* ** Aw crap. */ - DEBUG_LOG(("Failed to init the .dll\n")); + DEBUG_LOG(("Failed to init the .dll")); SnmpUtilMemFreePtr(bind_list_ptr); SnmpUtilMemFreePtr(bind_ptr); FreeLibrary(snmpapi_dll); @@ -284,7 +284,7 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP if (!SnmpExtensionQueryPtr(SNMP_PDU_GETNEXT, bind_list_ptr, &error_status, &error_index)) { //if (!SnmpExtensionQueryPtr(ASN_RFC1157_GETNEXTREQUEST, bind_list_ptr, &error_status, &error_index)) { - DEBUG_LOG(("SnmpExtensionQuery returned false\n")); + DEBUG_LOG(("SnmpExtensionQuery returned false")); SnmpUtilMemFreePtr(bind_list_ptr); SnmpUtilMemFreePtr(bind_ptr); FreeLibrary(snmpapi_dll); @@ -388,7 +388,7 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP SnmpUtilMemFreePtr(bind_ptr); SnmpUtilMemFreePtr(mib_ii_name_ptr); - DEBUG_LOG(("Got %d connections in list, parsing...\n", connectionVector.size())); + DEBUG_LOG(("Got %d connections in list, parsing...", connectionVector.size())); /* ** Right, we got the lot. Lets see if any of them have the same address as the chat @@ -405,29 +405,29 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP ** See if this connection has the same address as our server. */ if (!found && memcmp(remoteAddress, serverAddress, 4) == 0) { - DEBUG_LOG(("Found connection with same remote address as server\n")); + DEBUG_LOG(("Found connection with same remote address as server")); if (serverPort == 0 || serverPort == (unsigned int)connection.RemotePort) { - DEBUG_LOG(("Connection has same port\n")); + DEBUG_LOG(("Connection has same port")); /* ** Make sure the connection is current. */ if (connection.State == ESTABLISHED) { - DEBUG_LOG(("Connection is ESTABLISHED\n")); + DEBUG_LOG(("Connection is ESTABLISHED")); localIP = connection.LocalIP; found = true; } else { - DEBUG_LOG(("Connection is not ESTABLISHED - skipping\n")); + DEBUG_LOG(("Connection is not ESTABLISHED - skipping")); } } else { - DEBUG_LOG(("Connection has different port. Port is %d, looking for %d\n", connection.RemotePort, serverPort)); + DEBUG_LOG(("Connection has different port. Port is %d, looking for %d", connection.RemotePort, serverPort)); } } } if (found) { - DEBUG_LOG(("Using address 0x%8.8X to talk to chat server\n", localIP)); + DEBUG_LOG(("Using address 0x%8.8X to talk to chat server", localIP)); } FreeLibrary(snmpapi_dll); @@ -500,7 +500,7 @@ void GameSpyStagingRoom::resetAccepted( void ) /* peerStateChanged(TheGameSpyChat->getPeer()); m_hasBeenQueried = false; - DEBUG_LOG(("resetAccepted() called peerStateChange()\n")); + DEBUG_LOG(("resetAccepted() called peerStateChange()")); */ } } @@ -528,7 +528,7 @@ Int GameSpyStagingRoom::getLocalSlotNum( void ) const void GameSpyStagingRoom::startGame(Int gameID) { DEBUG_ASSERTCRASH(m_inGame, ("Starting a game while not in game")); - DEBUG_LOG(("GameSpyStagingRoom::startGame - game id = %d\n", gameID)); + DEBUG_LOG(("GameSpyStagingRoom::startGame - game id = %d", gameID)); DEBUG_ASSERTCRASH(m_transport == NULL, ("m_transport is not NULL when it should be")); DEBUG_ASSERTCRASH(TheNAT == NULL, ("TheNAT is not NULL when it should be")); @@ -829,7 +829,7 @@ void GameSpyStagingRoom::launchGame( void ) TheMapCache->updateCache(); if (!filesOk || TheMapCache->findMap(getMap()) == NULL) { - DEBUG_LOG(("After transfer, we didn't really have the map. Bailing...\n")); + DEBUG_LOG(("After transfer, we didn't really have the map. Bailing...")); if (TheNetwork != NULL) { delete TheNetwork; TheNetwork = NULL; @@ -855,7 +855,7 @@ void GameSpyStagingRoom::launchGame( void ) // Set the random seed InitGameLogicRandom( getSeed() ); - DEBUG_LOG(("InitGameLogicRandom( %d )\n", getSeed())); + DEBUG_LOG(("InitGameLogicRandom( %d )", getSeed())); // mark us as "Loading" in the buddy list BuddyRequest req; @@ -879,7 +879,7 @@ void GameSpyStagingRoom::reset(void) WindowLayout *theLayout = TheShell->findScreenByFilename("Menus/GameSpyGameOptionsMenu.wnd"); if (theLayout) { - DEBUG_LOG(("Resetting TheGameSpyGame on the game options menu!\n")); + DEBUG_LOG(("Resetting TheGameSpyGame on the game options menu!")); } } #endif diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp index 03bd73e388..a36a23c5f1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp @@ -313,7 +313,7 @@ void BuddyThreadClass::Thread_Function() case BuddyRequest::BUDDYREQUEST_MESSAGE: { std::string s = WideCharStringToMultiByte( incomingRequest.arg.message.text ); - DEBUG_LOG(("Sending a buddy message to %d [%s]\n", incomingRequest.arg.message.recipient, s.c_str())); + DEBUG_LOG(("Sending a buddy message to %d [%s]", incomingRequest.arg.message.recipient, s.c_str())); gpSendBuddyMessage( con, incomingRequest.arg.message.recipient, s.c_str() ); } break; @@ -362,7 +362,7 @@ void BuddyThreadClass::Thread_Function() if (lastStatus == GP_PLAYING && lastStatusString == "Loading" && incomingRequest.arg.status.status == GP_ONLINE) break; - DEBUG_LOG(("BUDDYREQUEST_SETSTATUS: status is now %d:%s/%s\n", + DEBUG_LOG(("BUDDYREQUEST_SETSTATUS: status is now %d:%s/%s", incomingRequest.arg.status.status, incomingRequest.arg.status.statusString, incomingRequest.arg.status.locationString)); gpSetStatus( con, incomingRequest.arg.status.status, incomingRequest.arg.status.statusString, incomingRequest.arg.status.locationString ); @@ -393,7 +393,7 @@ void BuddyThreadClass::Thread_Function() void BuddyThreadClass::errorCallback( GPConnection *con, GPErrorArg *arg ) { // log the error - DEBUG_LOG(("GPErrorCallback\n")); + DEBUG_LOG(("GPErrorCallback")); m_lastErrorCode = arg->errorCode; char errorCodeString[256]; @@ -467,19 +467,19 @@ void BuddyThreadClass::errorCallback( GPConnection *con, GPErrorArg *arg ) if(arg->fatal) { - DEBUG_LOG(( "-----------\n")); - DEBUG_LOG(( "GP FATAL ERROR\n")); - DEBUG_LOG(( "-----------\n")); + DEBUG_LOG(( "-----------")); + DEBUG_LOG(( "GP FATAL ERROR")); + DEBUG_LOG(( "-----------")); } else { - DEBUG_LOG(( "-----\n")); - DEBUG_LOG(( "GP ERROR\n")); - DEBUG_LOG(( "-----\n")); + DEBUG_LOG(( "-----")); + DEBUG_LOG(( "GP ERROR")); + DEBUG_LOG(( "-----")); } - DEBUG_LOG(( "RESULT: %s (%d)\n", resultString, arg->result)); - DEBUG_LOG(( "ERROR CODE: %s (0x%X)\n", errorCodeString, arg->errorCode)); - DEBUG_LOG(( "ERROR STRING: %s\n", arg->errorString)); + DEBUG_LOG(( "RESULT: %s (%d)", resultString, arg->result)); + DEBUG_LOG(( "ERROR CODE: %s (0x%X)", errorCodeString, arg->errorCode)); + DEBUG_LOG(( "ERROR STRING: %s", arg->errorString)); if (arg->fatal == GP_FATAL) { @@ -521,7 +521,7 @@ void BuddyThreadClass::messageCallback( GPConnection *con, GPRecvBuddyMessageArg wcsncpy(messageResponse.arg.message.text, s.c_str(), MAX_BUDDY_CHAT_LEN); messageResponse.arg.message.text[MAX_BUDDY_CHAT_LEN-1] = 0; messageResponse.arg.message.date = arg->date; - DEBUG_LOG(("Got a buddy message from %d [%ls]\n", arg->profile, s.c_str())); + DEBUG_LOG(("Got a buddy message from %d [%ls]", arg->profile, s.c_str())); TheGameSpyBuddyMessageQueue->addResponse( messageResponse ); } @@ -538,7 +538,7 @@ void BuddyThreadClass::connectCallback( GPConnection *con, GPConnectResponseArg if (!TheGameSpyPeerMessageQueue->isConnected() && !TheGameSpyPeerMessageQueue->isConnecting()) { - DEBUG_LOG(("Buddy connect: trying chat connect\n")); + DEBUG_LOG(("Buddy connect: trying chat connect")); PeerRequest req; req.peerRequestType = PeerRequest::PEERREQUEST_LOGIN; req.nick = m_nick; @@ -556,7 +556,7 @@ void BuddyThreadClass::connectCallback( GPConnection *con, GPConnectResponseArg { m_isNewAccount = FALSE; // they just hit 'create account' instead of 'log in'. Fix them. - DEBUG_LOG(("User Error: Create Account instead of Login. Fixing them...\n")); + DEBUG_LOG(("User Error: Create Account instead of Login. Fixing them...")); BuddyRequest req; req.buddyRequestType = BuddyRequest::BUDDYREQUEST_LOGIN; strcpy(req.arg.login.nick, m_nick.c_str()); @@ -566,7 +566,7 @@ void BuddyThreadClass::connectCallback( GPConnection *con, GPConnectResponseArg TheGameSpyBuddyMessageQueue->addRequest( req ); return; } - DEBUG_LOG(("Buddy connect failed (%d/%d): posting a failed chat connect\n", arg->result, m_lastErrorCode)); + DEBUG_LOG(("Buddy connect failed (%d/%d): posting a failed chat connect", arg->result, m_lastErrorCode)); PeerResponse resp; resp.peerResponseType = PeerResponse::PEERRESPONSE_DISCONNECT; resp.discon.reason = DISCONNECT_COULDNOTCONNECT; @@ -666,7 +666,7 @@ void BuddyThreadClass::statusCallback( GPConnection *con, GPRecvBuddyStatusArg * strcpy(response.arg.status.location, status.locationString); strcpy(response.arg.status.statusString, status.statusString); response.arg.status.status = status.status; - DEBUG_LOG(("Got buddy status for %d(%s) - status %d\n", status.profile, response.arg.status.nick, status.status)); + DEBUG_LOG(("Got buddy status for %d(%s) - status %d", status.profile, response.arg.status.nick, status.status)); // relay to UI TheGameSpyBuddyMessageQueue->addResponse( response ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp index 5894a14bcf..afde8dea42 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp @@ -232,7 +232,7 @@ void GameResultsThreadClass::Thread_Function() IP = inet_addr(hostnameBuffer); in_addr hostNode; hostNode.s_addr = IP; - DEBUG_LOG(("sending game results to %s - IP = %s\n", hostnameBuffer, inet_ntoa(hostNode) )); + DEBUG_LOG(("sending game results to %s - IP = %s", hostnameBuffer, inet_ntoa(hostNode) )); } else { @@ -241,7 +241,7 @@ void GameResultsThreadClass::Thread_Function() hostStruct = gethostbyname(hostnameBuffer); if (hostStruct == NULL) { - DEBUG_LOG(("sending game results to %s - host lookup failed\n", hostnameBuffer)); + DEBUG_LOG(("sending game results to %s - host lookup failed", hostnameBuffer)); // Even though this failed to resolve IP, still need to send a // callback. @@ -251,7 +251,7 @@ void GameResultsThreadClass::Thread_Function() { hostNode = (in_addr *) hostStruct->h_addr; IP = hostNode->s_addr; - DEBUG_LOG(("sending game results to %s IP = %s\n", hostnameBuffer, inet_ntoa(*hostNode) )); + DEBUG_LOG(("sending game results to %s IP = %s", hostnameBuffer, inet_ntoa(*hostNode) )); } } @@ -352,7 +352,7 @@ Int GameResultsThreadClass::sendGameResults( UnsignedInt IP, UnsignedShort port, Int sock = socket( AF_INET, SOCK_STREAM, 0 ); if (sock < 0) { - DEBUG_LOG(("GameResultsThreadClass::sendGameResults() - socket() returned %d(%s)\n", sock, getWSAErrorString(sock))); + DEBUG_LOG(("GameResultsThreadClass::sendGameResults() - socket() returned %d(%s)", sock, getWSAErrorString(sock))); return sock; } @@ -367,7 +367,7 @@ Int GameResultsThreadClass::sendGameResults( UnsignedInt IP, UnsignedShort port, if( connect( sock, (struct sockaddr *)&sockAddr, sizeof( sockAddr ) ) == -1 ) { error = WSAGetLastError(); - DEBUG_LOG(("GameResultsThreadClass::sendGameResults() - connect() returned %d(%s)\n", error, getWSAErrorString(error))); + DEBUG_LOG(("GameResultsThreadClass::sendGameResults() - connect() returned %d(%s)", error, getWSAErrorString(error))); if( ( error == WSAEWOULDBLOCK ) || ( error == WSAEINVAL ) || ( error == WSAEALREADY ) ) { return( -1 ); @@ -383,7 +383,7 @@ Int GameResultsThreadClass::sendGameResults( UnsignedInt IP, UnsignedShort port, if (send( sock, results.c_str(), results.length(), 0 ) == SOCKET_ERROR) { error = WSAGetLastError(); - DEBUG_LOG(("GameResultsThreadClass::sendGameResults() - send() returned %d(%s)\n", error, getWSAErrorString(error))); + DEBUG_LOG(("GameResultsThreadClass::sendGameResults() - send() returned %d(%s)", error, getWSAErrorString(error))); closesocket(sock); return WSAGetLastError(); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp index 8a61f65d09..fe8bb0d156 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp @@ -395,7 +395,7 @@ void PeerThreadClass::clearPlayerStats(RoomType roomType) void PeerThreadClass::pushStatsToRoom(PEER peer) { - DEBUG_LOG(("PeerThreadClass::pushStatsToRoom(): stats are %s=%s,%s=%s,%s=%s,%s=%s,%s=%s,%s=%s\n", + DEBUG_LOG(("PeerThreadClass::pushStatsToRoom(): stats are %s=%s,%s=%s,%s=%s,%s=%s,%s=%s,%s=%s", s_keys[0], s_values[0], s_keys[1], s_values[1], s_keys[2], s_values[2], @@ -516,7 +516,7 @@ enum CallbackType void connectCallbackWrapper( PEER peer, PEERBool success, int failureReason, void *param ) { #ifdef SERVER_DEBUGGING - DEBUG_LOG(("In connectCallbackWrapper()\n")); + DEBUG_LOG(("In connectCallbackWrapper()")); CheckServers(peer); #endif // SERVER_DEBUGGING if (param != NULL) @@ -702,7 +702,7 @@ static void updateBuddyStatus( GameSpyBuddyStatus status, Int groupRoom = 0, std strcpy(req.arg.status.locationString, ""); break; } - DEBUG_LOG(("updateBuddyStatus %d:%s\n", req.arg.status.status, req.arg.status.statusString)); + DEBUG_LOG(("updateBuddyStatus %d:%s", req.arg.status.status, req.arg.status.statusString)); TheGameSpyBuddyMessageQueue->addRequest(req); } @@ -755,11 +755,11 @@ static void QRServerKeyCallback void * param ) { - //DEBUG_LOG(("QR_SERVER_KEY | %d (%s)\n", key, qr2_registered_key_list[key])); + //DEBUG_LOG(("QR_SERVER_KEY | %d (%s)", key, qr2_registered_key_list[key])); PeerThreadClass *t = (PeerThreadClass *)param; if (!t) { - DEBUG_LOG(("QRServerKeyCallback: bailing because of no thread info\n")); + DEBUG_LOG(("QRServerKeyCallback: bailing because of no thread info")); return; } @@ -829,11 +829,11 @@ static void QRServerKeyCallback break; default: ADD(""); - //DEBUG_LOG(("QR_SERVER_KEY | %d (%s)\n", key, qr2_registered_key_list[key])); + //DEBUG_LOG(("QR_SERVER_KEY | %d (%s)", key, qr2_registered_key_list[key])); break; } - DEBUG_LOG(("QR_SERVER_KEY | %d (%s) = [%s]\n", key, qr2_registered_key_list[key], val.str())); + DEBUG_LOG(("QR_SERVER_KEY | %d (%s) = [%s]", key, qr2_registered_key_list[key], val.str())); } static void QRPlayerKeyCallback @@ -845,11 +845,11 @@ static void QRPlayerKeyCallback void * param ) { - //DEBUG_LOG(("QR_PLAYER_KEY | %d | %d (%s)\n", key, index, qr2_registered_key_list[key])); + //DEBUG_LOG(("QR_PLAYER_KEY | %d | %d (%s)", key, index, qr2_registered_key_list[key])); PeerThreadClass *t = (PeerThreadClass *)param; if (!t) { - DEBUG_LOG(("QRPlayerKeyCallback: bailing because of no thread info\n")); + DEBUG_LOG(("QRPlayerKeyCallback: bailing because of no thread info")); return; } @@ -889,11 +889,11 @@ static void QRPlayerKeyCallback break; default: ADD(""); - //DEBUG_LOG(("QR_PLAYER_KEY | %d | %d (%s)\n", key, index, qr2_registered_key_list[key])); + //DEBUG_LOG(("QR_PLAYER_KEY | %d | %d (%s)", key, index, qr2_registered_key_list[key])); break; } - DEBUG_LOG(("QR_PLAYER_KEY | %d | %d (%s) = [%s]\n", key, index, qr2_registered_key_list[key], val.str())); + DEBUG_LOG(("QR_PLAYER_KEY | %d | %d (%s) = [%s]", key, index, qr2_registered_key_list[key], val.str())); } static void QRTeamKeyCallback @@ -905,12 +905,12 @@ static void QRTeamKeyCallback void * param ) { - //DEBUG_LOG(("QR_TEAM_KEY | %d | %d\n", key, index)); + //DEBUG_LOG(("QR_TEAM_KEY | %d | %d", key, index)); PeerThreadClass *t = (PeerThreadClass *)param; if (!t) { - DEBUG_LOG(("QRTeamKeyCallback: bailing because of no thread info\n")); + DEBUG_LOG(("QRTeamKeyCallback: bailing because of no thread info")); return; } if (!t->isHosting()) @@ -928,13 +928,13 @@ static void QRKeyListCallback void * param ) { - DEBUG_LOG(("QR_KEY_LIST | %s\n", KeyTypeToString(type))); + DEBUG_LOG(("QR_KEY_LIST | %s", KeyTypeToString(type))); /* PeerThreadClass *t = (PeerThreadClass *)param; if (!t) { - DEBUG_LOG(("QRKeyListCallback: bailing because of no thread info\n")); + DEBUG_LOG(("QRKeyListCallback: bailing because of no thread info")); return; } if (!t->isHosting()) @@ -985,7 +985,7 @@ static int QRCountCallback PeerThreadClass *t = (PeerThreadClass *)param; if (!t) { - DEBUG_LOG(("QRCountCallback: bailing because of no thread info\n")); + DEBUG_LOG(("QRCountCallback: bailing because of no thread info")); return 0; } if (!t->isHosting()) @@ -993,16 +993,16 @@ static int QRCountCallback if(type == key_player) { - DEBUG_LOG(("QR_COUNT | %s = %d\n", KeyTypeToString(type), t->getNumPlayers() + t->getNumObservers())); + DEBUG_LOG(("QR_COUNT | %s = %d", KeyTypeToString(type), t->getNumPlayers() + t->getNumObservers())); return t->getNumPlayers() + t->getNumObservers(); } else if(type == key_team) { - DEBUG_LOG(("QR_COUNT | %s = %d\n", KeyTypeToString(type), 0)); + DEBUG_LOG(("QR_COUNT | %s = %d", KeyTypeToString(type), 0)); return 0; } - DEBUG_LOG(("QR_COUNT | %s = %d\n", KeyTypeToString(type), 0)); + DEBUG_LOG(("QR_COUNT | %s = %d", KeyTypeToString(type), 0)); return 0; } @@ -1027,7 +1027,7 @@ static void QRAddErrorCallback void * param ) { - DEBUG_LOG(("QR_ADD_ERROR | %s | %s\n", ErrorTypeToString(error), errorString)); + DEBUG_LOG(("QR_ADD_ERROR | %s | %s", ErrorTypeToString(error), errorString)); PeerResponse resp; resp.peerResponseType = PeerResponse::PEERRESPONSE_FAILEDTOHOST; TheGameSpyPeerMessageQueue->addResponse(resp); @@ -1040,7 +1040,7 @@ static void QRNatNegotiateCallback void * param ) { - DEBUG_LOG(("QR_NAT_NEGOTIATE | 0x%08X\n", cookie)); + DEBUG_LOG(("QR_NAT_NEGOTIATE | 0x%08X", cookie)); } static void KickedCallback @@ -1052,7 +1052,7 @@ static void KickedCallback void * param ) { - DEBUG_LOG(("Kicked from %d by %s: \"%s\"\n", roomType, nick, reason)); + DEBUG_LOG(("Kicked from %d by %s: \"%s\"", roomType, nick, reason)); } static void NewPlayerListCallback @@ -1062,7 +1062,7 @@ static void NewPlayerListCallback void * param ) { - DEBUG_LOG(("NewPlayerListCallback\n")); + DEBUG_LOG(("NewPlayerListCallback")); } static void AuthenticateCDKeyCallback @@ -1073,7 +1073,7 @@ static void AuthenticateCDKeyCallback void * param ) { - DEBUG_LOG(("CD Key Result: %s (%d) %X\n", message, result, param)); + DEBUG_LOG(("CD Key Result: %s (%d) %X", message, result, param)); #ifdef SERVER_DEBUGGING CheckServers(peer); #endif // SERVER_DEBUGGING @@ -1104,12 +1104,12 @@ static SerialAuthResult doCDKeyAuthentication( PEER peer ) if (GetStringFromRegistry("\\ergc", "", s) && s.isNotEmpty()) { #ifdef SERVER_DEBUGGING - DEBUG_LOG(("Before peerAuthenticateCDKey()\n")); + DEBUG_LOG(("Before peerAuthenticateCDKey()")); CheckServers(peer); #endif // SERVER_DEBUGGING peerAuthenticateCDKey(peer, s.str(), AuthenticateCDKeyCallback, &retval, PEERTrue); #ifdef SERVER_DEBUGGING - DEBUG_LOG(("After peerAuthenticateCDKey()\n")); + DEBUG_LOG(("After peerAuthenticateCDKey()")); CheckServers(peer); #endif // SERVER_DEBUGGING } @@ -1311,16 +1311,16 @@ void PeerThreadClass::Thread_Function() OptionPreferences pref; UnsignedInt preferredIP = INADDR_ANY; UnsignedInt selectedIP = pref.getOnlineIPAddress(); - DEBUG_LOG(("Looking for IP %X\n", selectedIP)); + DEBUG_LOG(("Looking for IP %X", selectedIP)); IPEnumeration IPs; EnumeratedIP *IPlist = IPs.getAddresses(); while (IPlist) { - DEBUG_LOG(("Looking at IP %s\n", IPlist->getIPstring().str())); + DEBUG_LOG(("Looking at IP %s", IPlist->getIPstring().str())); if (selectedIP == IPlist->getIP()) { preferredIP = IPlist->getIP(); - DEBUG_LOG(("Connecting to GameSpy chat server via IP address %8.8X\n", preferredIP)); + DEBUG_LOG(("Connecting to GameSpy chat server via IP address %8.8X", preferredIP)); break; } IPlist = IPlist->getNext(); @@ -1340,7 +1340,7 @@ void PeerThreadClass::Thread_Function() // deal with requests if (TheGameSpyPeerMessageQueue->getRequest(incomingRequest)) { - DEBUG_LOG(("TheGameSpyPeerMessageQueue->getRequest() got request of type %d\n", incomingRequest.peerRequestType)); + DEBUG_LOG(("TheGameSpyPeerMessageQueue->getRequest() got request of type %d", incomingRequest.peerRequestType)); switch (incomingRequest.peerRequestType) { case PeerRequest::PEERREQUEST_LOGIN: @@ -1353,7 +1353,7 @@ void PeerThreadClass::Thread_Function() m_email = incomingRequest.email; peerConnect( peer, incomingRequest.nick.c_str(), incomingRequest.login.profileID, nickErrorCallbackWrapper, connectCallbackWrapper, this, PEERTrue ); #ifdef SERVER_DEBUGGING - DEBUG_LOG(("After peerConnect()\n")); + DEBUG_LOG(("After peerConnect()")); CheckServers(peer); #endif // SERVER_DEBUGGING if (m_isConnected) @@ -1397,7 +1397,7 @@ void PeerThreadClass::Thread_Function() } m_isHosting = false; m_localRoomID = m_groupRoomID; - DEBUG_LOG(("Requesting to join room %d in thread %X\n", m_localRoomID, this)); + DEBUG_LOG(("Requesting to join room %d in thread %X", m_localRoomID, this)); peerJoinGroupRoom( peer, incomingRequest.groupRoom.id, joinRoomCallback, (void *)this, PEERTrue ); break; @@ -1416,9 +1416,9 @@ void PeerThreadClass::Thread_Function() peerLeaveRoom( peer, StagingRoom, NULL ); m_isHosting = false; SBServer server = findServerByID(incomingRequest.stagingRoom.id); m_localStagingServerName = incomingRequest.text; - DEBUG_LOG(("Setting m_localStagingServerName to [%ls]\n", m_localStagingServerName.c_str())); + DEBUG_LOG(("Setting m_localStagingServerName to [%ls]", m_localStagingServerName.c_str())); m_localRoomID = incomingRequest.stagingRoom.id; - DEBUG_LOG(("Requesting to join room %d\n", m_localRoomID)); + DEBUG_LOG(("Requesting to join room %d", m_localRoomID)); if (server) { peerJoinStagingRoom( peer, server, incomingRequest.password.c_str(), joinRoomCallback, (void *)this, PEERTrue ); @@ -1471,7 +1471,7 @@ void PeerThreadClass::Thread_Function() case PeerRequest::PEERREQUEST_PUSHSTATS: { - DEBUG_LOG(("PEERREQUEST_PUSHSTATS: stats are %d,%d,%d,%d,%d,%d\n", + DEBUG_LOG(("PEERREQUEST_PUSHSTATS: stats are %d,%d,%d,%d,%d,%d", incomingRequest.statsToPush.locale, incomingRequest.statsToPush.wins, incomingRequest.statsToPush.losses, incomingRequest.statsToPush.rankPoints, incomingRequest.statsToPush.side, incomingRequest.statsToPush.preorder)); // Testing alternate way to push stats @@ -1509,7 +1509,7 @@ void PeerThreadClass::Thread_Function() m_numPlayers = incomingRequest.gameOptions.numPlayers; m_numObservers = incomingRequest.gameOptions.numObservers; m_maxPlayers = incomingRequest.gameOptions.maxPlayers; - DEBUG_LOG(("peerStateChanged(): Marking game options state as changed - %d players, %d observers\n", m_numPlayers, m_numObservers)); + DEBUG_LOG(("peerStateChanged(): Marking game options state as changed - %d players, %d observers", m_numPlayers, m_numObservers)); for (Int i=0; isawMatchbot(nick); @@ -1944,7 +1944,7 @@ void PeerThreadClass::doQuickMatch( PEER peer ) peerLeaveRoom( peer, StagingRoom, NULL ); m_isHosting = false; m_localRoomID = m_groupRoomID; m_roomJoined = false; - DEBUG_LOG(("Requesting to join room %d in thread %X\n", m_localRoomID, this)); + DEBUG_LOG(("Requesting to join room %d in thread %X", m_localRoomID, this)); peerJoinGroupRoom( peer, m_localRoomID, joinRoomCallback, (void *)this, PEERTrue ); if (m_roomJoined) { @@ -2016,7 +2016,7 @@ void PeerThreadClass::doQuickMatch( PEER peer ) else msg.append("0"); } - DEBUG_LOG(("Sending QM options of [%s] to %s\n", msg.c_str(), m_matchbotName.c_str())); + DEBUG_LOG(("Sending QM options of [%s] to %s", msg.c_str(), m_matchbotName.c_str())); peerMessagePlayer( peer, m_matchbotName.c_str(), msg.c_str(), NormalMessage ); m_qmStatus = QM_WORKING; PeerResponse resp; @@ -2091,7 +2091,7 @@ static void getPlayerProfileIDCallback(PEER peer, PEERBool success, const char static void stagingRoomPlayerEnum( PEER peer, PEERBool success, RoomType roomType, int index, const char * nick, int flags, void * param ) { - DEBUG_LOG(("Enum: success=%d, index=%d, nick=%s, flags=%d\n", success, index, nick, flags)); + DEBUG_LOG(("Enum: success=%d, index=%d, nick=%s, flags=%d", success, index, nick, flags)); if (!nick || !success) return; @@ -2120,13 +2120,13 @@ static void stagingRoomPlayerEnum( PEER peer, PEERBool success, RoomType roomTyp static void joinRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, RoomType roomType, void *param) { - DEBUG_LOG(("JoinRoomCallback: success==%d, result==%d\n", success, result)); + DEBUG_LOG(("JoinRoomCallback: success==%d, result==%d", success, result)); PeerThreadClass *t = (PeerThreadClass *)param; if (!t) return; - DEBUG_LOG(("Room id was %d from thread %X\n", t->getLocalRoomID(), t)); - DEBUG_LOG(("Current staging server name is [%ls]\n", t->getLocalStagingServerName().c_str())); - DEBUG_LOG(("Room type is %d (GroupRoom=%d, StagingRoom=%d, TitleRoom=%d)\n", roomType, GroupRoom, StagingRoom, TitleRoom)); + DEBUG_LOG(("Room id was %d from thread %X", t->getLocalRoomID(), t)); + DEBUG_LOG(("Current staging server name is [%ls]", t->getLocalStagingServerName().c_str())); + DEBUG_LOG(("Room type is %d (GroupRoom=%d, StagingRoom=%d, TitleRoom=%d)", roomType, GroupRoom, StagingRoom, TitleRoom)); #ifdef USE_BROADCAST_KEYS if (success) @@ -2149,10 +2149,10 @@ static void joinRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, resp.joinGroupRoom.ok = success; TheGameSpyPeerMessageQueue->addResponse(resp); t->roomJoined(success == PEERTrue); - DEBUG_LOG(("Entered group room %d, qm is %d\n", t->getLocalRoomID(), t->getQMGroupRoom())); + DEBUG_LOG(("Entered group room %d, qm is %d", t->getLocalRoomID(), t->getQMGroupRoom())); if ((!t->getQMGroupRoom()) || (t->getQMGroupRoom() != t->getLocalRoomID())) { - DEBUG_LOG(("Updating buddy status\n")); + DEBUG_LOG(("Updating buddy status")); updateBuddyStatus( BUDDY_LOBBY, t->getLocalRoomID() ); } } @@ -2169,14 +2169,14 @@ static void joinRoomCallback(PEER peer, PEERBool success, PEERJoinResult result, resp.joinStagingRoom.result = result; if (success) { - DEBUG_LOG(("joinRoomCallback() - game name is now '%ls'\n", t->getLocalStagingServerName().c_str())); + DEBUG_LOG(("joinRoomCallback() - game name is now '%ls'", t->getLocalStagingServerName().c_str())); updateBuddyStatus( BUDDY_STAGING, 0, WideCharStringToMultiByte(t->getLocalStagingServerName().c_str()) ); } resp.joinStagingRoom.isHostPresent = FALSE; - DEBUG_LOG(("Enum of staging room players\n")); + DEBUG_LOG(("Enum of staging room players")); peerEnumPlayers(peer, StagingRoom, stagingRoomPlayerEnum, &resp); - DEBUG_LOG(("Host %s present\n", (resp.joinStagingRoom.isHostPresent)?"is":"is not")); + DEBUG_LOG(("Host %s present", (resp.joinStagingRoom.isHostPresent)?"is":"is not")); TheGameSpyPeerMessageQueue->addResponse(resp); } @@ -2194,20 +2194,20 @@ static void listGroupRoomsCallback(PEER peer, PEERBool success, int maxWaiting, int numGames, int numPlaying, void * param) { - DEBUG_LOG(("listGroupRoomsCallback, success=%d, server=%X, groupID=%d\n", success, server, groupID)); + DEBUG_LOG(("listGroupRoomsCallback, success=%d, server=%X, groupID=%d", success, server, groupID)); #ifdef SERVER_DEBUGGING CheckServers(peer); #endif // SERVER_DEBUGGING PeerThreadClass *t = (PeerThreadClass *)param; if (!t) { - DEBUG_LOG(("No thread! Bailing!\n")); + DEBUG_LOG(("No thread! Bailing!")); return; } if (success) { - DEBUG_LOG(("Saw group room of %d (%s) at address %X %X\n", groupID, name, server, (server)?server->keyvals:0)); + DEBUG_LOG(("Saw group room of %d (%s) at address %X %X", groupID, name, server, (server)?server->keyvals:0)); PeerResponse resp; resp.peerResponseType = PeerResponse::PEERRESPONSE_GROUPROOM; resp.groupRoom.id = groupID; @@ -2223,12 +2223,12 @@ static void listGroupRoomsCallback(PEER peer, PEERBool success, TheGameSpyPeerMessageQueue->addResponse(resp); #ifdef SERVER_DEBUGGING CheckServers(peer); - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); #endif // SERVER_DEBUGGING } else { - DEBUG_LOG(("Failure!\n")); + DEBUG_LOG(("Failure!")); } } @@ -2247,7 +2247,7 @@ void PeerThreadClass::connectCallback( PEER peer, PEERBool success ) updateBuddyStatus( BUDDY_ONLINE ); m_isConnected = true; - DEBUG_LOG(("Connected as profile %d (%s)\n", m_profileID, m_loginName.c_str())); + DEBUG_LOG(("Connected as profile %d (%s)", m_profileID, m_loginName.c_str())); resp.peerResponseType = PeerResponse::PEERRESPONSE_LOGIN; resp.player.profileID = m_profileID; resp.nick = m_loginName; @@ -2266,12 +2266,12 @@ void PeerThreadClass::connectCallback( PEER peer, PEERBool success ) TheGameSpyPSMessageQueue->addRequest(psReq); #ifdef SERVER_DEBUGGING - DEBUG_LOG(("Before peerListGroupRooms()\n")); + DEBUG_LOG(("Before peerListGroupRooms()")); CheckServers(peer); #endif // SERVER_DEBUGGING peerListGroupRooms( peer, NULL, listGroupRoomsCallback, this, PEERTrue ); #ifdef SERVER_DEBUGGING - DEBUG_LOG(("After peerListGroupRooms()\n")); + DEBUG_LOG(("After peerListGroupRooms()")); CheckServers(peer); #endif // SERVER_DEBUGGING } @@ -2289,7 +2289,7 @@ void PeerThreadClass::nickErrorCallback( PEER peer, Int type, const char *nick ) nickStr.erase(len-3, 3); } - DEBUG_LOG(("Nickname taken: was %s, new val = %d, new nick = %s\n", nick, newVal, nickStr.c_str())); + DEBUG_LOG(("Nickname taken: was %s, new val = %d, new nick = %s", nick, newVal, nickStr.c_str())); if (newVal < 10) { @@ -2328,7 +2328,7 @@ void PeerThreadClass::nickErrorCallback( PEER peer, Int type, const char *nick ) void disconnectedCallback(PEER peer, const char * reason, void * param) { - DEBUG_LOG(("disconnectedCallback(): reason was '%s'\n", reason)); + DEBUG_LOG(("disconnectedCallback(): reason was '%s'", reason)); PeerThreadClass *t = (PeerThreadClass *)param; DEBUG_ASSERTCRASH(t, ("No Peer thread!")); if (t) @@ -2362,7 +2362,7 @@ void roomMessageCallback(PEER peer, RoomType roomType, const char * nick, const resp.message.isPrivate = FALSE; resp.message.isAction = (messageType == ActionMessage); TheGameSpyPeerMessageQueue->addResponse(resp); - DEBUG_LOG(("Saw text [%hs] (%ls) %d chars Orig was %s (%d chars)\n", nick, resp.text.c_str(), resp.text.length(), message, strlen(message))); + DEBUG_LOG(("Saw text [%hs] (%ls) %d chars Orig was %s (%d chars)", nick, resp.text.c_str(), resp.text.length(), message, strlen(message))); UnsignedInt IP; peerGetPlayerInfoNoWait(peer, nick, &IP, &resp.message.profileID); @@ -2469,7 +2469,7 @@ void playerMessageCallback(PEER peer, const char * nick, const char * message, M if (numPlayers > 1) { // woohoo! got everything needed for a match! - DEBUG_LOG(("Saw %d-player QM match: map index = %s, seed = %s\n", numPlayers, mapNumStr, seedStr)); + DEBUG_LOG(("Saw %d-player QM match: map index = %s, seed = %s", numPlayers, mapNumStr, seedStr)); t->handleQMMatch(peer, atoi(mapNumStr), atoi(seedStr), playerStr, playerIPStr, playerSideStr, playerColorStr, playerNATStr); } } @@ -2498,7 +2498,7 @@ void playerMessageCallback(PEER peer, const char * nick, const char * message, M void roomUTMCallback(PEER peer, RoomType roomType, const char * nick, const char * command, const char * parameters, PEERBool authenticated, void * param) { - DEBUG_LOG(("roomUTMCallback: %s says %s = [%s]\n", nick, command, parameters)); + DEBUG_LOG(("roomUTMCallback: %s says %s = [%s]", nick, command, parameters)); if (roomType != StagingRoom) return; PeerResponse resp; @@ -2511,7 +2511,7 @@ void roomUTMCallback(PEER peer, RoomType roomType, const char * nick, const char void playerUTMCallback(PEER peer, const char * nick, const char * command, const char * parameters, PEERBool authenticated, void * param) { - DEBUG_LOG(("playerUTMCallback: %s says %s = [%s]\n", nick, command, parameters)); + DEBUG_LOG(("playerUTMCallback: %s says %s = [%s]", nick, command, parameters)); PeerResponse resp; resp.peerResponseType = PeerResponse::PEERRESPONSE_PLAYERUTM; resp.nick = nick; @@ -2556,7 +2556,7 @@ static void getPlayerInfo(PeerThreadClass *t, PEER peer, const char *nick, Int& #endif // USE_BROADCAST_KEYS flags = 0; peerGetPlayerFlags(peer, nick, roomType, &flags); - DEBUG_LOG(("getPlayerInfo(%d) - %s has locale %s, wins:%d, losses:%d, rankPoints:%d, side:%d, preorder:%d\n", + DEBUG_LOG(("getPlayerInfo(%d) - %s has locale %s, wins:%d, losses:%d, rankPoints:%d, side:%d, preorder:%d", id, nick, locale.c_str(), wins, losses, rankPoints, side, preorder)); } @@ -2574,7 +2574,7 @@ static void roomKeyChangedCallback(PEER peer, RoomType roomType, const char *nic #ifdef DEBUG_LOGGING if (strcmp(key, "username") && strcmp(key, "b_flags")) { - DEBUG_LOG(("roomKeyChangedCallback() - %s set %s=%s\n", nick, key, val)); + DEBUG_LOG(("roomKeyChangedCallback() - %s set %s=%s", nick, key, val)); } #endif @@ -2742,7 +2742,7 @@ static void playerInfoCallback(PEER peer, RoomType roomType, const char * nick, resp.locale, resp.player.wins, resp.player.losses, resp.player.rankPoints, resp.player.side, resp.player.preorder, roomType, resp.player.flags); -DEBUG_LOG(("**GS playerInfoCallback name=%s, local=%s\n", nick, resp.locale.c_str() )); +DEBUG_LOG(("**GS playerInfoCallback name=%s, local=%s", nick, resp.locale.c_str() )); TheGameSpyPeerMessageQueue->addResponse(resp); } @@ -2771,7 +2771,7 @@ static void playerFlagsChangedCallback(PEER peer, RoomType roomType, const char /* static void enumFunc(char *key, char *val, void *param) { - DEBUG_LOG((" [%s] = [%s]\n", key, val)); + DEBUG_LOG((" [%s] = [%s]", key, val)); } */ #endif @@ -2802,14 +2802,14 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, cmdStr = "PEER_COMPLETE"; break; } - DEBUG_LOG(("listingGamesCallback() - doing command %s on server %X\n", cmdStr.str(), server)); + DEBUG_LOG(("listingGamesCallback() - doing command %s on server %X", cmdStr.str(), server)); #endif // DEBUG_LOGGING // PeerThreadClass *t = (PeerThreadClass *)param; DEBUG_ASSERTCRASH(name || msg==PEER_CLEAR || msg==PEER_COMPLETE, ("Game has no name!\n")); if (!t || !success || (!name && (msg == PEER_ADD || msg == PEER_UPDATE))) { - DEBUG_LOG(("Bailing from listingGamesCallback() - success=%d, name=%X, server=%X, msg=%X\n", success, name, server, msg)); + DEBUG_LOG(("Bailing from listingGamesCallback() - success=%d, name=%X, server=%X, msg=%X", success, name, server, msg)); return; } if (!name) @@ -2826,14 +2826,14 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, if (server && success && (msg == PEER_ADD || msg == PEER_UPDATE)) { - DEBUG_LOG(("Game name is '%s'\n", name)); + DEBUG_LOG(("Game name is '%s'", name)); const char *newname = SBServerGetStringValue(server, "gamename", (char *)name); if (strcmp(newname, "ccgenzh")) name = newname; - DEBUG_LOG(("Game name is now '%s'\n", name)); + DEBUG_LOG(("Game name is now '%s'", name)); } - DEBUG_LOG(("listingGamesCallback - got percent complete %d\n", percentListed)); + DEBUG_LOG(("listingGamesCallback - got percent complete %d", percentListed)); if (percentListed == 100) { if (!t->getSawCompleteGameList()) @@ -2854,7 +2854,7 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, { gameName.set(firstSpace + 1); //gameName.trim(); - DEBUG_LOG(("Hostname/Gamename split leaves '%s' hosting '%s'\n", hostName.str(), gameName.str())); + DEBUG_LOG(("Hostname/Gamename split leaves '%s' hosting '%s'", hostName.str(), gameName.str())); } PeerResponse resp; resp.peerResponseType = PeerResponse::PEERRESPONSE_STAGINGROOM; @@ -2900,7 +2900,7 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, #ifdef DEBUG_LOGGING if (resp.stagingRoomPlayerNames[i].length()) { - DEBUG_LOG(("Player %d raw stuff: [%s] [%d] [%d] [%d]\n", i, resp.stagingRoomPlayerNames[i].c_str(), resp.stagingRoom.wins[i], resp.stagingRoom.losses[i], resp.stagingRoom.profileID[i])); + DEBUG_LOG(("Player %d raw stuff: [%s] [%d] [%d] [%d]", i, resp.stagingRoomPlayerNames[i].c_str(), resp.stagingRoom.wins[i], resp.stagingRoom.losses[i], resp.stagingRoom.profileID[i])); } #endif } @@ -2909,9 +2909,9 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, resp.stagingRoomPlayerNames[0] = hostName.str(); } DEBUG_ASSERTCRASH(resp.stagingRoomPlayerNames[0].empty() == false, ("No host!")); - DEBUG_LOG(("Raw stuff: [%s] [%s] [%s] [%d] [%d] [%d]\n", verStr, exeStr, iniStr, hasPassword, allowObservers, usesStats)); - DEBUG_LOG(("Raw stuff: [%s] [%s] [%d]\n", pingStr, ladIPStr, ladPort)); - DEBUG_LOG(("Saw game with stuff %s %d %X %X %X %s\n", resp.stagingRoomMapName.c_str(), hasPassword, verVal, exeVal, iniVal, SBServerGetStringValue(server, "password", "missing"))); + DEBUG_LOG(("Raw stuff: [%s] [%s] [%s] [%d] [%d] [%d]", verStr, exeStr, iniStr, hasPassword, allowObservers, usesStats)); + DEBUG_LOG(("Raw stuff: [%s] [%s] [%d]", pingStr, ladIPStr, ladPort)); + DEBUG_LOG(("Saw game with stuff %s %d %X %X %X %s", resp.stagingRoomMapName.c_str(), hasPassword, verVal, exeVal, iniVal, SBServerGetStringValue(server, "password", "missing"))); #ifdef PING_TEST PING_LOG(("%s\n", pingStr)); #endif @@ -2923,19 +2923,19 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, { if (SBServerHasBasicKeys(server)) { - DEBUG_LOG(("Server %x does not have basic keys\n", server)); + DEBUG_LOG(("Server %x does not have basic keys", server)); return; } else { - DEBUG_LOG(("Server %x has basic keys, yet has no info\n", server)); + DEBUG_LOG(("Server %x has basic keys, yet has no info", server)); } if (msg == PEER_UPDATE) { PeerRequest req; req.peerRequestType = PeerRequest::PEERREQUEST_GETEXTENDEDSTAGINGROOMINFO; req.stagingRoom.id = t->findServer( server ); - DEBUG_LOG(("Add/update a 0/0 server %X (%d, %s) - requesting full update to see if that helps.\n", + DEBUG_LOG(("Add/update a 0/0 server %X (%d, %s) - requesting full update to see if that helps.", server, resp.stagingRoom.id, gameName.str())); TheGameSpyPeerMessageQueue->addRequest(req); } @@ -2951,15 +2951,15 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, case PEER_ADD: case PEER_UPDATE: resp.stagingRoom.id = t->findServer( server ); - DEBUG_LOG(("Add/update on server %X (%d, %s)\n", server, resp.stagingRoom.id, gameName.str())); + DEBUG_LOG(("Add/update on server %X (%d, %s)", server, resp.stagingRoom.id, gameName.str())); resp.stagingServerName = MultiByteToWideCharSingleLine( gameName.str() ); - DEBUG_LOG(("Server had basic=%d, full=%d\n", SBServerHasBasicKeys(server), SBServerHasFullKeys(server))); + DEBUG_LOG(("Server had basic=%d, full=%d", SBServerHasBasicKeys(server), SBServerHasFullKeys(server))); #ifdef DEBUG_LOGGING //SBServerEnumKeys(server, enumFunc, NULL); #endif break; case PEER_REMOVE: - DEBUG_LOG(("Removing server %X (%d)\n", server, resp.stagingRoom.id)); + DEBUG_LOG(("Removing server %X (%d)", server, resp.stagingRoom.id)); resp.stagingRoom.id = t->removeServerFromMap( server ); break; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp index 9150712f73..484eacaef5 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp @@ -59,14 +59,14 @@ PSRequest::PSRequest() { \ if (it->second > 0) \ { \ - DEBUG_LOG(("%s(%d): %d\n", #x, it->first, it->second)); \ + DEBUG_LOG(("%s(%d): %d", #x, it->first, it->second)); \ } \ } static void debugDumpPlayerStats( const PSPlayerStats& stats ) { - DEBUG_LOG(("-----------------------------------------\n")); - DEBUG_LOG(("Tracking player stats for player %d:\n", stats.id)); + DEBUG_LOG(("-----------------------------------------")); + DEBUG_LOG(("Tracking player stats for player %d:", stats.id)); PerGeneralMap::const_iterator it; DEBUG_MAP(wins); DEBUG_MAP(losses); @@ -95,99 +95,99 @@ static void debugDumpPlayerStats( const PSPlayerStats& stats ) if (stats.locale > 0) { - DEBUG_LOG(("Locale: %d\n", stats.locale)); + DEBUG_LOG(("Locale: %d", stats.locale)); } if (stats.gamesAsRandom > 0) { - DEBUG_LOG(("gamesAsRandom: %d\n", stats.gamesAsRandom)); + DEBUG_LOG(("gamesAsRandom: %d", stats.gamesAsRandom)); } if (stats.options.length()) { - DEBUG_LOG(("Options: %s\n", stats.options.c_str())); + DEBUG_LOG(("Options: %s", stats.options.c_str())); } if (stats.systemSpec.length()) { - DEBUG_LOG(("systemSpec: %s\n", stats.systemSpec.c_str())); + DEBUG_LOG(("systemSpec: %s", stats.systemSpec.c_str())); } if (stats.lastFPS > 0.0f) { - DEBUG_LOG(("lastFPS: %g\n", stats.lastFPS)); + DEBUG_LOG(("lastFPS: %g", stats.lastFPS)); } if (stats.battleHonors > 0) { - DEBUG_LOG(("battleHonors: %x\n", stats.battleHonors)); + DEBUG_LOG(("battleHonors: %x", stats.battleHonors)); } if (stats.challengeMedals > 0) { - DEBUG_LOG(("challengeMedals: %x\n", stats.challengeMedals)); + DEBUG_LOG(("challengeMedals: %x", stats.challengeMedals)); } if (stats.lastGeneral >= 0) { - DEBUG_LOG(("lastGeneral: %d\n", stats.lastGeneral)); + DEBUG_LOG(("lastGeneral: %d", stats.lastGeneral)); } if (stats.gamesInRowWithLastGeneral >= 0) { - DEBUG_LOG(("gamesInRowWithLastGeneral: %d\n", stats.gamesInRowWithLastGeneral)); + DEBUG_LOG(("gamesInRowWithLastGeneral: %d", stats.gamesInRowWithLastGeneral)); } if (stats.builtSCUD >= 0) { - DEBUG_LOG(("builtSCUD: %d\n", stats.builtSCUD)); + DEBUG_LOG(("builtSCUD: %d", stats.builtSCUD)); } if (stats.builtNuke >= 0) { - DEBUG_LOG(("builtNuke: %d\n", stats.builtNuke)); + DEBUG_LOG(("builtNuke: %d", stats.builtNuke)); } if (stats.builtParticleCannon >= 0) { - DEBUG_LOG(("builtParticleCannon: %d\n", stats.builtParticleCannon)); + DEBUG_LOG(("builtParticleCannon: %d", stats.builtParticleCannon)); } if (stats.winsInARow >= 0) { - DEBUG_LOG(("winsInARow: %d\n", stats.winsInARow)); + DEBUG_LOG(("winsInARow: %d", stats.winsInARow)); } if (stats.maxWinsInARow >= 0) { - DEBUG_LOG(("maxWinsInARow: %d\n", stats.maxWinsInARow)); + DEBUG_LOG(("maxWinsInARow: %d", stats.maxWinsInARow)); } if (stats.disconsInARow >= 0) { - DEBUG_LOG(("disconsInARow: %d\n", stats.disconsInARow)); + DEBUG_LOG(("disconsInARow: %d", stats.disconsInARow)); } if (stats.maxDisconsInARow >= 0) { - DEBUG_LOG(("maxDisconsInARow: %d\n", stats.maxDisconsInARow)); + DEBUG_LOG(("maxDisconsInARow: %d", stats.maxDisconsInARow)); } if (stats.lossesInARow >= 0) { - DEBUG_LOG(("lossesInARow: %d\n", stats.lossesInARow)); + DEBUG_LOG(("lossesInARow: %d", stats.lossesInARow)); } if (stats.maxLossesInARow >= 0) { - DEBUG_LOG(("maxLossesInARow: %d\n", stats.maxLossesInARow)); + DEBUG_LOG(("maxLossesInARow: %d", stats.maxLossesInARow)); } if (stats.desyncsInARow >= 0) { - DEBUG_LOG(("desyncsInARow: %d\n", stats.desyncsInARow)); + DEBUG_LOG(("desyncsInARow: %d", stats.desyncsInARow)); } if (stats.maxDesyncsInARow >= 0) { - DEBUG_LOG(("maxDesyncsInARow: %d\n", stats.maxDesyncsInARow)); + DEBUG_LOG(("maxDesyncsInARow: %d", stats.maxDesyncsInARow)); } if (stats.lastLadderPort >= 0) { - DEBUG_LOG(("lastLadderPort: %d\n", stats.lastLadderPort)); + DEBUG_LOG(("lastLadderPort: %d", stats.lastLadderPort)); } if (stats.lastLadderHost.length()) { - DEBUG_LOG(("lastLadderHost: %s\n", stats.lastLadderHost.c_str())); + DEBUG_LOG(("lastLadderHost: %s", stats.lastLadderHost.c_str())); } @@ -580,11 +580,11 @@ Bool PSThreadClass::tryConnect( void ) { Int result; - DEBUG_LOG(("m_opCount = %d - opening connection\n", m_opCount)); + DEBUG_LOG(("m_opCount = %d - opening connection", m_opCount)); if (IsStatsConnected()) { - DEBUG_LOG(("connection already open!\n")); + DEBUG_LOG(("connection already open!")); return true; } @@ -593,7 +593,7 @@ Bool PSThreadClass::tryConnect( void ) if (result != GE_NOERROR) { - DEBUG_LOG(("InitStatsConnection() returned %d\n", result)); + DEBUG_LOG(("InitStatsConnection() returned %d", result)); return false; } @@ -603,7 +603,7 @@ Bool PSThreadClass::tryConnect( void ) static void persAuthCallback(int localid, int profileid, int authenticated, char *errmsg, void *instance) { PSThreadClass *t = (PSThreadClass *)instance; - DEBUG_LOG(("Auth callback: localid: %d profileid: %d auth: %d err: %s\n",localid, profileid, authenticated, errmsg)); + DEBUG_LOG(("Auth callback: localid: %d profileid: %d auth: %d err: %s",localid, profileid, authenticated, errmsg)); if (t) t->persAuthCallback(authenticated != 0); } @@ -611,7 +611,7 @@ static void persAuthCallback(int localid, int profileid, int authenticated, char Bool PSThreadClass::tryLogin( Int id, std::string nick, std::string password, std::string email ) { char validate[33]; - DEBUG_LOG(("PSThreadClass::tryLogin id = %d, nick = %s, password = %s, email = %s\n", id, nick.c_str(), password.c_str(), email.c_str())); + DEBUG_LOG(("PSThreadClass::tryLogin id = %d, nick = %s, password = %s, email = %s", id, nick.c_str(), password.c_str(), email.c_str())); /*********** We'll go ahead and start the authentication, using a Presence & Messaging SDK profileid / password. To generate the new validation token, we'll need to pass @@ -637,13 +637,13 @@ Bool PSThreadClass::tryLogin( Int id, std::string nick, std::string password, st PreAuthenticatePlayerPM(id, id, validate, ::persAuthCallback, this); while (!m_doneTryingToLogin && IsStatsConnected()) PersistThink(); - DEBUG_LOG(("Persistant Storage Login success %d\n", m_loginOK)); + DEBUG_LOG(("Persistant Storage Login success %d", m_loginOK)); return m_loginOK; } static void getPersistentDataCallback(int localid, int profileid, persisttype_t type, int index, int success, time_t modified, char *data, int len, void *instance) { - DEBUG_LOG(("Data get callback: localid: %d profileid: %d success: %d len: %d data: %s\n",localid, profileid, success, len, data)); + DEBUG_LOG(("Data get callback: localid: %d profileid: %d success: %d len: %d data: %s",localid, profileid, success, len, data)); PSThreadClass *t = (PSThreadClass *)instance; if (!t) return; @@ -671,46 +671,46 @@ static void getPersistentDataCallback(int localid, int profileid, persisttype_t if (profileid == MESSAGE_QUEUE->getLocalPlayerID() && TheGameSpyGame && TheGameSpyGame->getUseStats()) { t->gotLocalPlayerData(); - DEBUG_LOG(("getPersistentDataCallback() - got local player info\n")); + DEBUG_LOG(("getPersistentDataCallback() - got local player info")); // check if we have discons we should update on the server UserPreferences pref; AsciiString userPrefFilename; userPrefFilename.format("GeneralsOnline\\MiscPref%d.ini", MESSAGE_QUEUE->getLocalPlayerID()); - DEBUG_LOG(("using the file %s\n", userPrefFilename.str())); + DEBUG_LOG(("using the file %s", userPrefFilename.str())); pref.load(userPrefFilename); Int addedInDesyncs2 = pref.getInt("0", 0); - DEBUG_LOG(("addedInDesyncs2 = %d\n", addedInDesyncs2)); + DEBUG_LOG(("addedInDesyncs2 = %d", addedInDesyncs2)); if (addedInDesyncs2 < 0) addedInDesyncs2 = 10; Int addedInDesyncs3 = pref.getInt("1", 0); - DEBUG_LOG(("addedInDesyncs3 = %d\n", addedInDesyncs3)); + DEBUG_LOG(("addedInDesyncs3 = %d", addedInDesyncs3)); if (addedInDesyncs3 < 0) addedInDesyncs3 = 10; Int addedInDesyncs4 = pref.getInt("2", 0); - DEBUG_LOG(("addedInDesyncs4 = %d\n", addedInDesyncs4)); + DEBUG_LOG(("addedInDesyncs4 = %d", addedInDesyncs4)); if (addedInDesyncs4 < 0) addedInDesyncs4 = 10; Int addedInDiscons2 = pref.getInt("3", 0); - DEBUG_LOG(("addedInDiscons2 = %d\n", addedInDiscons2)); + DEBUG_LOG(("addedInDiscons2 = %d", addedInDiscons2)); if (addedInDiscons2 < 0) addedInDiscons2 = 10; Int addedInDiscons3 = pref.getInt("4", 0); - DEBUG_LOG(("addedInDiscons3 = %d\n", addedInDiscons3)); + DEBUG_LOG(("addedInDiscons3 = %d", addedInDiscons3)); if (addedInDiscons3 < 0) addedInDiscons3 = 10; Int addedInDiscons4 = pref.getInt("5", 0); - DEBUG_LOG(("addedInDiscons4 = %d\n", addedInDiscons4)); + DEBUG_LOG(("addedInDiscons4 = %d", addedInDiscons4)); if (addedInDiscons4 < 0) addedInDiscons4 = 10; - DEBUG_LOG(("addedInDesync=%d,%d,%d, addedInDiscon=%d,%d,%d\n", + DEBUG_LOG(("addedInDesync=%d,%d,%d, addedInDiscon=%d,%d,%d", addedInDesyncs2, addedInDesyncs3, addedInDesyncs4, addedInDiscons2, addedInDiscons3, addedInDiscons4)); if (addedInDesyncs2 || addedInDesyncs3 || addedInDesyncs4 || addedInDiscons2 || addedInDiscons3 || addedInDiscons4) { - DEBUG_LOG(("We have a previous discon we can attempt to update! Bummer...\n")); + DEBUG_LOG(("We have a previous discon we can attempt to update! Bummer...")); PSRequest req; req.requestType = PSRequest::PSREQUEST_UPDATEPLAYERSTATS; @@ -735,7 +735,7 @@ static void getPersistentDataCallback(int localid, int profileid, persisttype_t static void setPersistentDataLocaleCallback(int localid, int profileid, persisttype_t type, int index, int success, time_t modified, void *instance) { - DEBUG_LOG(("Data save callback: localid: %d profileid: %d success: %d\n", localid, profileid, success)); + DEBUG_LOG(("Data save callback: localid: %d profileid: %d success: %d", localid, profileid, success)); PSThreadClass *t = (PSThreadClass *)instance; if (!t) @@ -746,7 +746,7 @@ static void setPersistentDataLocaleCallback(int localid, int profileid, persistt static void setPersistentDataCallback(int localid, int profileid, persisttype_t type, int index, int success, time_t modified, void *instance) { - DEBUG_LOG(("Data save callback: localid: %d profileid: %d success: %d\n", localid, profileid, success)); + DEBUG_LOG(("Data save callback: localid: %d profileid: %d success: %d", localid, profileid, success)); PSThreadClass *t = (PSThreadClass *)instance; if (!t) @@ -757,7 +757,7 @@ static void setPersistentDataCallback(int localid, int profileid, persisttype_t UserPreferences pref; AsciiString userPrefFilename; userPrefFilename.format("GeneralsOnline\\MiscPref%d.ini", profileid); - DEBUG_LOG(("setPersistentDataCallback - writing stats to file %s\n", userPrefFilename.str())); + DEBUG_LOG(("setPersistentDataCallback - writing stats to file %s", userPrefFilename.str())); pref.load(userPrefFilename); pref.clear(); pref.write(); @@ -774,7 +774,7 @@ struct CDAuthInfo void preAuthCDCallback(int localid, int profileid, int authenticated, char *errmsg, void *instance) { - DEBUG_LOG(("preAuthCDCallback(): profileid: %d auth: %d err: %s\n", profileid, authenticated, errmsg)); + DEBUG_LOG(("preAuthCDCallback(): profileid: %d auth: %d err: %s", profileid, authenticated, errmsg)); CDAuthInfo *authInfo = (CDAuthInfo *)instance; authInfo->success = authenticated; @@ -794,13 +794,13 @@ static void getPreorderCallback(int localid, int profileid, persisttype_t type, if (!success) { - DEBUG_LOG(("Failed getPreorderCallback()\n")); + DEBUG_LOG(("Failed getPreorderCallback()")); return; } resp.responseType = PSResponse::PSRESPONSE_PREORDER; resp.preorder = (data && strcmp(data, "\\preorder\\1") == 0); - DEBUG_LOG(("getPreorderCallback() - data was '%s'\n", data)); + DEBUG_LOG(("getPreorderCallback() - data was '%s'", data)); TheGameSpyPSMessageQueue->addResponse(resp); } @@ -851,7 +851,7 @@ void PSThreadClass::Thread_Function() Int res = #endif // DEBUG_LOGGING SendGameSnapShot(NULL, req.results.c_str(), SNAP_FINAL); - DEBUG_LOG(("Just sent game results - res was %d\n", res)); + DEBUG_LOG(("Just sent game results - res was %d", res)); FreeGame(NULL); } } @@ -864,9 +864,9 @@ void PSThreadClass::Thread_Function() MESSAGE_QUEUE->setEmail(req.email); MESSAGE_QUEUE->setNick(req.nick); MESSAGE_QUEUE->setPassword(req.password); - DEBUG_LOG(("Setting email/nick/password = %s/%s/%s\n", req.email.c_str(), req.nick.c_str(), req.password.c_str())); + DEBUG_LOG(("Setting email/nick/password = %s/%s/%s", req.email.c_str(), req.nick.c_str(), req.password.c_str())); } - DEBUG_LOG(("Processing PSRequest::PSREQUEST_READPLAYERSTATS\n")); + DEBUG_LOG(("Processing PSRequest::PSREQUEST_READPLAYERSTATS")); if (tryConnect()) { incrOpCount(); @@ -877,7 +877,7 @@ void PSThreadClass::Thread_Function() break; case PSRequest::PSREQUEST_UPDATEPLAYERLOCALE: { - DEBUG_LOG(("Processing PSRequest::PSREQUEST_UPDATEPLAYERLOCALE\n")); + DEBUG_LOG(("Processing PSRequest::PSREQUEST_UPDATEPLAYERLOCALE")); if (tryConnect() && tryLogin(req.player.id, req.nick, req.password, req.email)) { char kvbuf[256]; @@ -892,38 +892,38 @@ void PSThreadClass::Thread_Function() /* ** NOTE THAT THIS IS HIGHLY DEPENDENT ON INI ORDERING FOR THE PLAYERTEMPLATES!!! */ - DEBUG_LOG(("Processing PSRequest::PSREQUEST_UPDATEPLAYERSTATS\n")); + DEBUG_LOG(("Processing PSRequest::PSREQUEST_UPDATEPLAYERSTATS")); UserPreferences pref; AsciiString userPrefFilename; userPrefFilename.format("GeneralsOnline\\MiscPref%d.ini", MESSAGE_QUEUE->getLocalPlayerID()); - DEBUG_LOG(("using the file %s\n", userPrefFilename.str())); + DEBUG_LOG(("using the file %s", userPrefFilename.str())); pref.load(userPrefFilename); Int addedInDesyncs2 = pref.getInt("0", 0); - DEBUG_LOG(("addedInDesyncs2 = %d\n", addedInDesyncs2)); + DEBUG_LOG(("addedInDesyncs2 = %d", addedInDesyncs2)); if (addedInDesyncs2 < 0) addedInDesyncs2 = 10; Int addedInDesyncs3 = pref.getInt("1", 0); - DEBUG_LOG(("addedInDesyncs3 = %d\n", addedInDesyncs3)); + DEBUG_LOG(("addedInDesyncs3 = %d", addedInDesyncs3)); if (addedInDesyncs3 < 0) addedInDesyncs3 = 10; Int addedInDesyncs4 = pref.getInt("2", 0); - DEBUG_LOG(("addedInDesyncs4 = %d\n", addedInDesyncs4)); + DEBUG_LOG(("addedInDesyncs4 = %d", addedInDesyncs4)); if (addedInDesyncs4 < 0) addedInDesyncs4 = 10; Int addedInDiscons2 = pref.getInt("3", 0); - DEBUG_LOG(("addedInDiscons2 = %d\n", addedInDiscons2)); + DEBUG_LOG(("addedInDiscons2 = %d", addedInDiscons2)); if (addedInDiscons2 < 0) addedInDiscons2 = 10; Int addedInDiscons3 = pref.getInt("4", 0); - DEBUG_LOG(("addedInDiscons3 = %d\n", addedInDiscons3)); + DEBUG_LOG(("addedInDiscons3 = %d", addedInDiscons3)); if (addedInDiscons3 < 0) addedInDiscons3 = 10; Int addedInDiscons4 = pref.getInt("5", 0); - DEBUG_LOG(("addedInDiscons4 = %d\n", addedInDiscons4)); + DEBUG_LOG(("addedInDiscons4 = %d", addedInDiscons4)); if (addedInDiscons4 < 0) addedInDiscons4 = 10; - DEBUG_LOG(("req.addDesync=%d, req.addDiscon=%d, addedInDesync=%d,%d,%d, addedInDiscon=%d,%d,%d\n", + DEBUG_LOG(("req.addDesync=%d, req.addDiscon=%d, addedInDesync=%d,%d,%d, addedInDiscon=%d,%d,%d", req.addDesync, req.addDiscon, addedInDesyncs2, addedInDesyncs3, addedInDesyncs4, addedInDiscons2, addedInDiscons3, addedInDiscons4)); @@ -936,7 +936,7 @@ void PSThreadClass::Thread_Function() pref["0"] = val; val.format("%d", addedInDiscons2 + req.addDiscon); pref["3"] = val; - DEBUG_LOG(("house 2 req.addDesync || req.addDiscon: %d %d\n", + DEBUG_LOG(("house 2 req.addDesync || req.addDiscon: %d %d", addedInDesyncs2 + req.addDesync, addedInDiscons2 + req.addDiscon)); } else if (req.lastHouse == 3) @@ -945,7 +945,7 @@ void PSThreadClass::Thread_Function() pref["1"] = val; val.format("%d", addedInDiscons3 + req.addDiscon); pref["4"] = val; - DEBUG_LOG(("house 3 req.addDesync || req.addDiscon: %d %d\n", + DEBUG_LOG(("house 3 req.addDesync || req.addDiscon: %d %d", addedInDesyncs3 + req.addDesync, addedInDiscons3 + req.addDiscon)); } else @@ -954,7 +954,7 @@ void PSThreadClass::Thread_Function() pref["2"] = val; val.format("%d", addedInDiscons4 + req.addDiscon); pref["5"] = val; - DEBUG_LOG(("house 4 req.addDesync || req.addDiscon: %d %d\n", + DEBUG_LOG(("house 4 req.addDesync || req.addDiscon: %d %d", addedInDesyncs4 + req.addDesync, addedInDiscons4 + req.addDiscon)); } pref.write(); @@ -963,7 +963,7 @@ void PSThreadClass::Thread_Function() } if (!req.player.id) { - DEBUG_LOG(("Bailing because ID is NULL!\n")); + DEBUG_LOG(("Bailing because ID is NULL!")); return; } req.player.desyncs[2] += addedInDesyncs2; @@ -978,26 +978,26 @@ void PSThreadClass::Thread_Function() req.player.games[4] += addedInDesyncs4; req.player.discons[4] += addedInDiscons4; req.player.games[4] += addedInDiscons4; - DEBUG_LOG(("House2: %d/%d/%d, House3: %d/%d/%d, House4: %d/%d/%d\n", + DEBUG_LOG(("House2: %d/%d/%d, House3: %d/%d/%d, House4: %d/%d/%d", req.player.desyncs[2], req.player.discons[2], req.player.games[2], req.player.desyncs[3], req.player.discons[3], req.player.games[3], req.player.desyncs[4], req.player.discons[4], req.player.games[4] )); if (tryConnect() && tryLogin(req.player.id, req.nick, req.password, req.email)) { - DEBUG_LOG(("Logged in!\n")); + DEBUG_LOG(("Logged in!")); if (TheGameSpyPSMessageQueue) TheGameSpyPSMessageQueue->trackPlayerStats(req.player); char *munkeeHack = strdup(GameSpyPSMessageQueueInterface::formatPlayerKVPairs(req.player).c_str()); // GS takes a char* for some reason incrOpCount(); - DEBUG_LOG(("Setting values %s\n", munkeeHack)); + DEBUG_LOG(("Setting values %s", munkeeHack)); SetPersistDataValues(0, req.player.id, pd_public_rw, 0, munkeeHack, setPersistentDataCallback, this); free(munkeeHack); } else { - DEBUG_LOG(("Cannot connect!\n")); + DEBUG_LOG(("Cannot connect!")); //if (IsStatsConnected()) //CloseStatsConnection(); } @@ -1005,7 +1005,7 @@ void PSThreadClass::Thread_Function() break; case PSRequest::PSREQUEST_READCDKEYSTATS: { - DEBUG_LOG(("Processing PSRequest::PSREQUEST_READCDKEYSTATS\n")); + DEBUG_LOG(("Processing PSRequest::PSREQUEST_READCDKEYSTATS")); if (tryConnect()) { incrOpCount(); @@ -1027,7 +1027,7 @@ void PSThreadClass::Thread_Function() while (running && IsStatsConnected() && !cdAuthInfo.done) PersistThink(); - DEBUG_LOG(("Looking for preorder status for %d (success=%d, done=%d) from CDKey %s with hash %s\n", + DEBUG_LOG(("Looking for preorder status for %d (success=%d, done=%d) from CDKey %s with hash %s", cdAuthInfo.id, cdAuthInfo.success, cdAuthInfo.done, req.cdkey.c_str(), cdkeyHash)); if (cdAuthInfo.done && cdAuthInfo.success) { @@ -1049,7 +1049,7 @@ void PSThreadClass::Thread_Function() if (m_opCount <= 0) { DEBUG_ASSERTCRASH(m_opCount == 0, ("Negative operations pending!!!")); - DEBUG_LOG(("m_opCount = %d - closing connection\n", m_opCount)); + DEBUG_LOG(("m_opCount = %d - closing connection", m_opCount)); CloseStatsConnection(); m_opCount = 0; } @@ -1135,7 +1135,7 @@ PSPlayerStats GameSpyPSMessageQueueInterface::parsePlayerKVPairs( std::string kv generalMarker = atoi(g.c_str()); } v = kvPairs.substr(secondMarker + 1, thirdMarker - secondMarker - 1); - //DEBUG_LOG(("%d [%s] [%s]\n", generalMarker, k.c_str(), v.c_str())); + //DEBUG_LOG(("%d [%s] [%s]", generalMarker, k.c_str(), v.c_str())); offset = thirdMarker - 1; CHECK(wins); @@ -1468,7 +1468,7 @@ std::string GameSpyPSMessageQueueInterface::formatPlayerKVPairs( PSPlayerStats s s.append(kvbuf); } - DEBUG_LOG(("Formatted persistent values as '%s'\n", s.c_str())); + DEBUG_LOG(("Formatted persistent values as '%s'", s.c_str())); return s; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp index bdca703772..02b9d6a05b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp @@ -270,7 +270,7 @@ void PingThreadClass::Thread_Function() IP = inet_addr(hostnameBuffer); in_addr hostNode; hostNode.s_addr = IP; - DEBUG_LOG(("pinging %s - IP = %s\n", hostnameBuffer, inet_ntoa(hostNode) )); + DEBUG_LOG(("pinging %s - IP = %s", hostnameBuffer, inet_ntoa(hostNode) )); } else { @@ -279,7 +279,7 @@ void PingThreadClass::Thread_Function() hostStruct = gethostbyname(hostnameBuffer); if (hostStruct == NULL) { - DEBUG_LOG(("pinging %s - host lookup failed\n", hostnameBuffer)); + DEBUG_LOG(("pinging %s - host lookup failed", hostnameBuffer)); // Even though this failed to resolve IP, still need to send a // callback. @@ -289,7 +289,7 @@ void PingThreadClass::Thread_Function() { hostNode = (in_addr *) hostStruct->h_addr; IP = hostNode->s_addr; - DEBUG_LOG(("pinging %s IP = %s\n", hostnameBuffer, inet_ntoa(*hostNode) )); + DEBUG_LOG(("pinging %s IP = %s", hostnameBuffer, inet_ntoa(*hostNode) )); } } @@ -459,7 +459,7 @@ Int PingThreadClass::doPing(UnsignedInt IP, Int timeout) hICMP_DLL = LoadLibrary("ICMP.DLL"); if (hICMP_DLL == 0) { - DEBUG_LOG(("LoadLibrary() failed: Unable to locate ICMP.DLL!\n")); + DEBUG_LOG(("LoadLibrary() failed: Unable to locate ICMP.DLL!")); goto cleanup; } @@ -475,7 +475,7 @@ Int PingThreadClass::doPing(UnsignedInt IP, Int timeout) (!lpfnIcmpCloseHandle) || (!lpfnIcmpSendEcho)) { - DEBUG_LOG(("GetProcAddr() failed for at least one function.\n")); + DEBUG_LOG(("GetProcAddr() failed for at least one function.")); goto cleanup; } @@ -541,13 +541,13 @@ Int PingThreadClass::doPing(UnsignedInt IP, Int timeout) dwStatus = *(DWORD *) & (achRepData[4]); if (dwStatus != IP_SUCCESS) { - DEBUG_LOG(("ICMPERR: %d\n", dwStatus)); + DEBUG_LOG(("ICMPERR: %d", dwStatus)); } } else { - DEBUG_LOG(("IcmpSendEcho() failed: %d\n", dwReplyCount)); + DEBUG_LOG(("IcmpSendEcho() failed: %d", dwReplyCount)); // Ok we didn't get a packet, just say everything's OK // and the time was -1 pingTime = -1; @@ -561,7 +561,7 @@ Int PingThreadClass::doPing(UnsignedInt IP, Int timeout) fRet = lpfnIcmpCloseHandle(hICMP); if (fRet == FALSE) { - DEBUG_LOG(("Error closing ICMP handle\n")); + DEBUG_LOG(("Error closing ICMP handle")); } // Say what you will about goto's but it's handy for stuff like this diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyChat.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyChat.cpp index 9ef3bff860..bd68fde173 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyChat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyChat.cpp @@ -375,7 +375,7 @@ void RoomMessageCallback(PEER peer, RoomType roomType, const char * nick, const char * message, MessageType messageType, void * param) { - DEBUG_LOG(("RoomMessageCallback\n")); + DEBUG_LOG(("RoomMessageCallback")); handleUnicodeMessage(nick, QuotedPrintableToUnicodeString(message), true, (messageType == ActionMessage)); } @@ -383,7 +383,7 @@ void PlayerMessageCallback(PEER peer, const char * nick, const char * message, MessageType messageType, void * param) { - DEBUG_LOG(("PlayerMessageCallback\n")); + DEBUG_LOG(("PlayerMessageCallback")); handleUnicodeMessage(nick, QuotedPrintableToUnicodeString(message), false, (messageType == ActionMessage)); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyGP.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyGP.cpp index a81eef1ac3..9086dcfa59 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyGP.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyGP.cpp @@ -40,7 +40,7 @@ char GameSpyProfilePassword[64]; void GPRecvBuddyMessageCallback(GPConnection * pconnection, GPRecvBuddyMessageArg * arg, void * param) { - DEBUG_LOG(("GPRecvBuddyMessageCallback: message from %d is %s\n", arg->profile, arg->message)); + DEBUG_LOG(("GPRecvBuddyMessageCallback: message from %d is %s", arg->profile, arg->message)); //gpGetInfo(pconn, arg->profile, GP_DONT_CHECK_CACHE, GP_BLOCKING, (GPCallback)Whois, NULL); //printf("MESSAGE (%d): %s: %s\n", msgCount,whois, arg->message); @@ -53,7 +53,7 @@ static void buddyTryReconnect( void ) void GPErrorCallback(GPConnection * pconnection, GPErrorArg * arg, void * param) { - DEBUG_LOG(("GPErrorCallback\n")); + DEBUG_LOG(("GPErrorCallback")); AsciiString errorCodeString; AsciiString resultString; @@ -126,9 +126,9 @@ void GPErrorCallback(GPConnection * pconnection, GPErrorArg * arg, void * param) if(arg->fatal) { - DEBUG_LOG(( "-----------\n")); - DEBUG_LOG(( "GP FATAL ERROR\n")); - DEBUG_LOG(( "-----------\n")); + DEBUG_LOG(( "-----------")); + DEBUG_LOG(( "GP FATAL ERROR")); + DEBUG_LOG(( "-----------")); // if we're still connected to the chat server, tell the user. He can always hit the buddy // button to try reconnecting. Oh yes, also hide the buddy popup. @@ -140,23 +140,23 @@ void GPErrorCallback(GPConnection * pconnection, GPErrorArg * arg, void * param) } else { - DEBUG_LOG(( "-----\n")); - DEBUG_LOG(( "GP ERROR\n")); - DEBUG_LOG(( "-----\n")); + DEBUG_LOG(( "-----")); + DEBUG_LOG(( "GP ERROR")); + DEBUG_LOG(( "-----")); } - DEBUG_LOG(( "RESULT: %s (%d)\n", resultString.str(), arg->result)); - DEBUG_LOG(( "ERROR CODE: %s (0x%X)\n", errorCodeString.str(), arg->errorCode)); - DEBUG_LOG(( "ERROR STRING: %s\n", arg->errorString)); + DEBUG_LOG(( "RESULT: %s (%d)", resultString.str(), arg->result)); + DEBUG_LOG(( "ERROR CODE: %s (0x%X)", errorCodeString.str(), arg->errorCode)); + DEBUG_LOG(( "ERROR STRING: %s", arg->errorString)); } void GPRecvBuddyStatusCallback(GPConnection * connection, GPRecvBuddyStatusArg * arg, void * param) { - DEBUG_LOG(("GPRecvBuddyStatusCallback: info on %d is in %d\n", arg->profile, arg->index)); + DEBUG_LOG(("GPRecvBuddyStatusCallback: info on %d is in %d", arg->profile, arg->index)); //GameSpyUpdateBuddyOverlay(); } void GPRecvBuddyRequestCallback(GPConnection * connection, GPRecvBuddyRequestArg * arg, void * param) { - DEBUG_LOG(("GPRecvBuddyRequestCallback: %d wants to be our buddy because '%s'\n", arg->profile, arg->reason)); + DEBUG_LOG(("GPRecvBuddyRequestCallback: %d wants to be our buddy because '%s'", arg->profile, arg->reason)); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyGameInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyGameInfo.cpp index ad2257f9eb..5350969958 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyGameInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyGameInfo.cpp @@ -159,18 +159,18 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP "DELETE_TCB" }; - DEBUG_LOG(("Finding local address used to talk to the chat server\n")); - DEBUG_LOG(("Current chat server name is %s\n", serverName.str())); - DEBUG_LOG(("Chat server port is %d\n", serverPort)); + DEBUG_LOG(("Finding local address used to talk to the chat server")); + DEBUG_LOG(("Current chat server name is %s", serverName.str())); + DEBUG_LOG(("Chat server port is %d", serverPort)); /* ** Get the address of the chat server. */ - DEBUG_LOG( ("About to call gethostbyname\n")); + DEBUG_LOG( ("About to call gethostbyname")); struct hostent *host_info = gethostbyname(serverName.str()); if (!host_info) { - DEBUG_LOG( ("gethostbyname failed! Error code %d\n", WSAGetLastError())); + DEBUG_LOG( ("gethostbyname failed! Error code %d", WSAGetLastError())); return(false); } @@ -179,24 +179,24 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP temp = ntohl(temp); *((unsigned long*)(&serverAddress[0])) = temp; - DEBUG_LOG(("Host address is %d.%d.%d.%d\n", serverAddress[3], serverAddress[2], serverAddress[1], serverAddress[0])); + DEBUG_LOG(("Host address is %d.%d.%d.%d", serverAddress[3], serverAddress[2], serverAddress[1], serverAddress[0])); /* ** Load the MIB-II SNMP DLL. */ - DEBUG_LOG(("About to load INETMIB1.DLL\n")); + DEBUG_LOG(("About to load INETMIB1.DLL")); HINSTANCE mib_ii_dll = LoadLibrary("inetmib1.dll"); if (mib_ii_dll == NULL) { - DEBUG_LOG(("Failed to load INETMIB1.DLL\n")); + DEBUG_LOG(("Failed to load INETMIB1.DLL")); return(false); } - DEBUG_LOG(("About to load SNMPAPI.DLL\n")); + DEBUG_LOG(("About to load SNMPAPI.DLL")); HINSTANCE snmpapi_dll = LoadLibrary("snmpapi.dll"); if (snmpapi_dll == NULL) { - DEBUG_LOG(("Failed to load SNMPAPI.DLL\n")); + DEBUG_LOG(("Failed to load SNMPAPI.DLL")); FreeLibrary(mib_ii_dll); return(false); } @@ -209,7 +209,7 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP SnmpUtilMemAllocPtr = (void *(__stdcall *)(unsigned long)) GetProcAddress(snmpapi_dll, "SnmpUtilMemAlloc"); SnmpUtilMemFreePtr = (void (__stdcall *)(void *)) GetProcAddress(snmpapi_dll, "SnmpUtilMemFree"); if (SnmpExtensionInitPtr == NULL || SnmpExtensionQueryPtr == NULL || SnmpUtilMemAllocPtr == NULL || SnmpUtilMemFreePtr == NULL) { - DEBUG_LOG(("Failed to get proc addresses for linked functions\n")); + DEBUG_LOG(("Failed to get proc addresses for linked functions")); FreeLibrary(snmpapi_dll); FreeLibrary(mib_ii_dll); return(false); @@ -222,14 +222,14 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP /* ** OK, here we go. Try to initialise the .dll */ - DEBUG_LOG(("About to init INETMIB1.DLL\n")); + DEBUG_LOG(("About to init INETMIB1.DLL")); int ok = SnmpExtensionInitPtr(GetCurrentTime(), &trap_handle, &first_supported_region); if (!ok) { /* ** Aw crap. */ - DEBUG_LOG(("Failed to init the .dll\n")); + DEBUG_LOG(("Failed to init the .dll")); SnmpUtilMemFreePtr(bind_list_ptr); SnmpUtilMemFreePtr(bind_ptr); FreeLibrary(snmpapi_dll); @@ -278,7 +278,7 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP if (!SnmpExtensionQueryPtr(SNMP_PDU_GETNEXT, bind_list_ptr, &error_status, &error_index)) { //if (!SnmpExtensionQueryPtr(ASN_RFC1157_GETNEXTREQUEST, bind_list_ptr, &error_status, &error_index)) { - DEBUG_LOG(("SnmpExtensionQuery returned false\n")); + DEBUG_LOG(("SnmpExtensionQuery returned false")); SnmpUtilMemFreePtr(bind_list_ptr); SnmpUtilMemFreePtr(bind_ptr); FreeLibrary(snmpapi_dll); @@ -382,7 +382,7 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP SnmpUtilMemFreePtr(bind_ptr); SnmpUtilMemFreePtr(mib_ii_name_ptr); - DEBUG_LOG(("Got %d connections in list, parsing...\n", connectionVector.size())); + DEBUG_LOG(("Got %d connections in list, parsing...", connectionVector.size())); /* ** Right, we got the lot. Lets see if any of them have the same address as the chat @@ -399,29 +399,29 @@ Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverP ** See if this connection has the same address as our server. */ if (!found && memcmp(remoteAddress, serverAddress, 4) == 0) { - DEBUG_LOG(("Found connection with same remote address as server\n")); + DEBUG_LOG(("Found connection with same remote address as server")); if (serverPort == 0 || serverPort == (unsigned int)connection.RemotePort) { - DEBUG_LOG(("Connection has same port\n")); + DEBUG_LOG(("Connection has same port")); /* ** Make sure the connection is current. */ if (connection.State == ESTABLISHED) { - DEBUG_LOG(("Connection is ESTABLISHED\n")); + DEBUG_LOG(("Connection is ESTABLISHED")); localIP = connection.LocalIP; found = true; } else { - DEBUG_LOG(("Connection is not ESTABLISHED - skipping\n")); + DEBUG_LOG(("Connection is not ESTABLISHED - skipping")); } } else { - DEBUG_LOG(("Connection has different port. Port is %d, looking for %d\n", connection.RemotePort, serverPort)); + DEBUG_LOG(("Connection has different port. Port is %d, looking for %d", connection.RemotePort, serverPort)); } } } if (found) { - DEBUG_LOG(("Using address 0x%8.8X to talk to chat server\n", localIP)); + DEBUG_LOG(("Using address 0x%8.8X to talk to chat server", localIP)); } FreeLibrary(snmpapi_dll); @@ -564,7 +564,7 @@ void GameSpyLaunchGame( void ) // Set the random seed InitGameLogicRandom( TheGameSpyGame->getSeed() ); - DEBUG_LOG(("InitGameLogicRandom( %d )\n", TheGameSpyGame->getSeed())); + DEBUG_LOG(("InitGameLogicRandom( %d )", TheGameSpyGame->getSeed())); if (TheNAT != NULL) { delete TheNAT; @@ -588,7 +588,7 @@ void GameSpyGameInfo::resetAccepted( void ) { // ANCIENTMUNKEE peerStateChanged(TheGameSpyChat->getPeer()); m_hasBeenQueried = false; - DEBUG_LOG(("resetAccepted() called peerStateChange()\n")); + DEBUG_LOG(("resetAccepted() called peerStateChange()")); } } @@ -614,13 +614,13 @@ Int GameSpyGameInfo::getLocalSlotNum( void ) const void GameSpyGameInfo::gotGOACall( void ) { - DEBUG_LOG(("gotGOACall()\n")); + DEBUG_LOG(("gotGOACall()")); m_hasBeenQueried = true; } void GameSpyGameInfo::startGame(Int gameID) { - DEBUG_LOG(("GameSpyGameInfo::startGame - game id = %d\n", gameID)); + DEBUG_LOG(("GameSpyGameInfo::startGame - game id = %d", gameID)); DEBUG_ASSERTCRASH(m_transport == NULL, ("m_transport is not NULL when it should be")); DEBUG_ASSERTCRASH(TheNAT == NULL, ("TheNAT is not NULL when it should be")); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyOverlay.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyOverlay.cpp index 8541395ca8..0f10676bde 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyOverlay.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyOverlay.cpp @@ -235,28 +235,28 @@ void GameSpyCloseOverlay( GSOverlayType overlay ) switch(overlay) { case GSOVERLAY_PLAYERINFO: - DEBUG_LOG(("Closing overlay GSOVERLAY_PLAYERINFO\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_PLAYERINFO")); break; case GSOVERLAY_MAPSELECT: - DEBUG_LOG(("Closing overlay GSOVERLAY_MAPSELECT\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_MAPSELECT")); break; case GSOVERLAY_BUDDY: - DEBUG_LOG(("Closing overlay GSOVERLAY_BUDDY\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_BUDDY")); break; case GSOVERLAY_PAGE: - DEBUG_LOG(("Closing overlay GSOVERLAY_PAGE\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_PAGE")); break; case GSOVERLAY_GAMEOPTIONS: - DEBUG_LOG(("Closing overlay GSOVERLAY_GAMEOPTIONS\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_GAMEOPTIONS")); break; case GSOVERLAY_GAMEPASSWORD: - DEBUG_LOG(("Closing overlay GSOVERLAY_GAMEPASSWORD\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_GAMEPASSWORD")); break; case GSOVERLAY_LADDERSELECT: - DEBUG_LOG(("Closing overlay GSOVERLAY_LADDERSELECT\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_LADDERSELECT")); break; case GSOVERLAY_OPTIONS: - DEBUG_LOG(("Closing overlay GSOVERLAY_OPTIONS\n")); + DEBUG_LOG(("Closing overlay GSOVERLAY_OPTIONS")); if( overlayLayouts[overlay] ) { SignalUIInteraction(SHELL_SCRIPT_HOOK_OPTIONS_CLOSED); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/IPEnumeration.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/IPEnumeration.cpp index 0d0a43018f..082316b319 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/IPEnumeration.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/IPEnumeration.cpp @@ -77,23 +77,23 @@ EnumeratedIP * IPEnumeration::getAddresses( void ) char hostname[256]; if (gethostname(hostname, sizeof(hostname))) { - DEBUG_LOG(("Failed call to gethostname; WSAGetLastError returned %d\n", WSAGetLastError())); + DEBUG_LOG(("Failed call to gethostname; WSAGetLastError returned %d", WSAGetLastError())); return NULL; } - DEBUG_LOG(("Hostname is '%s'\n", hostname)); + DEBUG_LOG(("Hostname is '%s'", hostname)); // get host information from the host name HOSTENT* hostEnt = gethostbyname(hostname); if (hostEnt == NULL) { - DEBUG_LOG(("Failed call to gethostbyname; WSAGetLastError returned %d\n", WSAGetLastError())); + DEBUG_LOG(("Failed call to gethostbyname; WSAGetLastError returned %d", WSAGetLastError())); return NULL; } // sanity-check the length of the IP adress if (hostEnt->h_length != 4) { - DEBUG_LOG(("gethostbyname returns oddly-sized IP addresses!\n")); + DEBUG_LOG(("gethostbyname returns oddly-sized IP addresses!")); return NULL; } @@ -135,7 +135,7 @@ void IPEnumeration::addNewIP( UnsignedByte a, UnsignedByte b, UnsignedByte c, Un newIP->setIPstring(str); newIP->setIP(ip); - DEBUG_LOG(("IP: 0x%8.8X (%s)\n", ip, str.str())); + DEBUG_LOG(("IP: 0x%8.8X (%s)", ip, str.str())); // Add the IP to the list in ascending order if (!m_IPlist) @@ -186,7 +186,7 @@ AsciiString IPEnumeration::getMachineName( void ) char hostname[256]; if (gethostname(hostname, sizeof(hostname))) { - DEBUG_LOG(("Failed call to gethostname; WSAGetLastError returned %d\n", WSAGetLastError())); + DEBUG_LOG(("Failed call to gethostname; WSAGetLastError returned %d", WSAGetLastError())); return NULL; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPI.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPI.cpp index 60830041de..06ca0d3749 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPI.cpp @@ -67,7 +67,7 @@ LANGame::LANGame( void ) LANAPI::LANAPI( void ) : m_transport(NULL) { - DEBUG_LOG(("LANAPI::LANAPI() - max game option size is %d, sizeof(LANMessage)=%d, MAX_PACKET_SIZE=%d\n", + DEBUG_LOG(("LANAPI::LANAPI() - max game option size is %d, sizeof(LANMessage)=%d, MAX_PACKET_SIZE=%d", m_lanMaxOptionsLength, sizeof(LANMessage), MAX_PACKET_SIZE)); m_lastResendTime = 0; @@ -348,49 +348,49 @@ void LANAPI::update( void ) } LANMessage *msg = (LANMessage *)(m_transport->m_inBuffer[i].data); - //DEBUG_LOG(("LAN message type %s from %ls (%s@%s)\n", GetMessageTypeString(msg->LANMessageType).str(), + //DEBUG_LOG(("LAN message type %s from %ls (%s@%s)", GetMessageTypeString(msg->LANMessageType).str(), // msg->name, msg->userName, msg->hostName)); switch (msg->LANMessageType) { // Location specification case LANMessage::MSG_REQUEST_LOCATIONS: // Hey, where is everybody? - DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_LOCATIONS from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_LOCATIONS from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleRequestLocations( msg, senderIP ); break; case LANMessage::MSG_GAME_ANNOUNCE: // Here someone is, and here's his game info! - DEBUG_LOG(("LANAPI::update - got a MSG_GAME_ANNOUNCE from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_GAME_ANNOUNCE from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleGameAnnounce( msg, senderIP ); break; case LANMessage::MSG_LOBBY_ANNOUNCE: // Hey, I'm in the lobby! - DEBUG_LOG(("LANAPI::update - got a MSG_LOBBY_ANNOUNCE from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_LOBBY_ANNOUNCE from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleLobbyAnnounce( msg, senderIP ); break; case LANMessage::MSG_REQUEST_GAME_INFO: - DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_GAME_INFO from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_GAME_INFO from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleRequestGameInfo( msg, senderIP ); break; // Joining games case LANMessage::MSG_REQUEST_JOIN: // Let me in! Let me in! - DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_JOIN from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_JOIN from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleRequestJoin( msg, senderIP ); break; case LANMessage::MSG_JOIN_ACCEPT: // Okay, you can join. - DEBUG_LOG(("LANAPI::update - got a MSG_JOIN_ACCEPT from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_JOIN_ACCEPT from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleJoinAccept( msg, senderIP ); break; case LANMessage::MSG_JOIN_DENY: // Go away! We don't want any! - DEBUG_LOG(("LANAPI::update - got a MSG_JOIN_DENY from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_JOIN_DENY from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleJoinDeny( msg, senderIP ); break; // Leaving games, lobby case LANMessage::MSG_REQUEST_GAME_LEAVE: // I'm outa here! - DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_GAME_LEAVE from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_GAME_LEAVE from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleRequestGameLeave( msg, senderIP ); break; case LANMessage::MSG_REQUEST_LOBBY_LEAVE: // I'm outa here! - DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_LOBBY_LEAVE from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_REQUEST_LOBBY_LEAVE from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleRequestLobbyLeave( msg, senderIP ); break; @@ -411,7 +411,7 @@ void LANAPI::update( void ) handleGameStartTimer( msg, senderIP ); break; case LANMessage::MSG_GAME_OPTIONS: // Here's some info about the game. - DEBUG_LOG(("LANAPI::update - got a MSG_GAME_OPTIONS from %d.%d.%d.%d\n", PRINTF_IP_AS_4_INTS(senderIP))); + DEBUG_LOG(("LANAPI::update - got a MSG_GAME_OPTIONS from %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(senderIP))); handleGameOptions( msg, senderIP ); break; case LANMessage::MSG_INACTIVE: // someone is telling us that we're inactive. @@ -419,7 +419,7 @@ void LANAPI::update( void ) break; default: - DEBUG_LOG(("Unknown LAN message type %d\n", msg->LANMessageType)); + DEBUG_LOG(("Unknown LAN message type %d", msg->LANMessageType)); } // Mark it as read @@ -586,7 +586,7 @@ void LANAPI::update( void ) } else if (m_gameStartTime && m_gameStartTime <= now) { -// DEBUG_LOG(("m_gameStartTime=%d, now=%d, m_gameStartSeconds=%d\n", m_gameStartTime, now, m_gameStartSeconds)); +// DEBUG_LOG(("m_gameStartTime=%d, now=%d, m_gameStartSeconds=%d", m_gameStartTime, now, m_gameStartSeconds)); ResetGameStartTimer(); RequestGameStart(); } @@ -897,7 +897,7 @@ void LANAPI::RequestGameCreate( UnicodeString gameName, Bool isDirectConnect ) while (s.getLength() > g_lanGameNameLength) s.removeLastChar(); - DEBUG_LOG(("Setting local game name to '%ls'\n", s.str())); + DEBUG_LOG(("Setting local game name to '%ls'", s.str())); myGame->setName(s); @@ -1276,16 +1276,16 @@ Bool LANAPI::AmIHost( void ) } void LANAPI::setIsActive(Bool isActive) { - DEBUG_LOG(("LANAPI::setIsActive - entering\n")); + DEBUG_LOG(("LANAPI::setIsActive - entering")); if (isActive != m_isActive) { - DEBUG_LOG(("LANAPI::setIsActive - m_isActive changed to %s\n", isActive ? "TRUE" : "FALSE")); + DEBUG_LOG(("LANAPI::setIsActive - m_isActive changed to %s", isActive ? "TRUE" : "FALSE")); if (isActive == FALSE) { if ((m_inLobby == FALSE) && (m_currentGame != NULL)) { LANMessage msg; fillInLANMessage( &msg ); msg.LANMessageType = LANMessage::MSG_INACTIVE; sendMessage(&msg); - DEBUG_LOG(("LANAPI::setIsActive - sent an IsActive message\n")); + DEBUG_LOG(("LANAPI::setIsActive - sent an IsActive message")); } } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp index 6bb80f1dd6..1485d173ee 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp @@ -184,8 +184,8 @@ void LANAPI::OnGameStartTimer( Int seconds ) void LANAPI::OnGameStart( void ) { - //DEBUG_LOG(("Map is '%s', preview is '%s'\n", m_currentGame->getMap().str(), GetPreviewFromMap(m_currentGame->getMap()).str())); - //DEBUG_LOG(("Map is '%s', INI is '%s'\n", m_currentGame->getMap().str(), GetINIFromMap(m_currentGame->getMap()).str())); + //DEBUG_LOG(("Map is '%s', preview is '%s'", m_currentGame->getMap().str(), GetPreviewFromMap(m_currentGame->getMap()).str())); + //DEBUG_LOG(("Map is '%s', INI is '%s'", m_currentGame->getMap().str(), GetINIFromMap(m_currentGame->getMap()).str())); if (m_currentGame) { @@ -232,7 +232,7 @@ void LANAPI::OnGameStart( void ) TheMapCache->updateCache(); if (!filesOk || TheMapCache->findMap(m_currentGame->getMap()) == NULL) { - DEBUG_LOG(("After transfer, we didn't really have the map. Bailing...\n")); + DEBUG_LOG(("After transfer, we didn't really have the map. Bailing...")); OnPlayerLeave(m_name); removeGame(m_currentGame); m_currentGame = NULL; @@ -260,7 +260,7 @@ void LANAPI::OnGameStart( void ) // Set the random seed InitGameLogicRandom( m_currentGame->getSeed() ); - DEBUG_LOG(("InitGameLogicRandom( %d )\n", m_currentGame->getSeed())); + DEBUG_LOG(("InitGameLogicRandom( %d )", m_currentGame->getSeed())); } } @@ -309,7 +309,7 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op AsciiString key; AsciiString munkee = options; munkee.nextToken(&key, "="); - //DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d\n", key.str(), munkee.str(), playerSlot)); + //DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d", key.str(), munkee.str(), playerSlot)); LANGameSlot *slot = m_currentGame->getLANSlot(playerSlot); if (!slot) @@ -342,7 +342,7 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op AsciiString key; options.nextToken(&key, "="); Int val = atoi(options.str()+1); - DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d\n", key.str(), options.str(), playerSlot)); + DEBUG_LOG(("GameOpt request: key=%s, val=%s from player %d", key.str(), options.str(), playerSlot)); LANGameSlot *slot = m_currentGame->getLANSlot(playerSlot); if (!slot) @@ -371,7 +371,7 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op } else { - DEBUG_LOG(("Rejecting invalid color %d\n", val)); + DEBUG_LOG(("Rejecting invalid color %d", val)); } } else if (key == "PlayerTemplate") @@ -390,7 +390,7 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op } else { - DEBUG_LOG(("Rejecting invalid PlayerTemplate %d\n", val)); + DEBUG_LOG(("Rejecting invalid PlayerTemplate %d", val)); } } else if (key == "StartPos" && slot->getPlayerTemplate() != PLAYERTEMPLATE_OBSERVER) @@ -416,7 +416,7 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op } else { - DEBUG_LOG(("Rejecting invalid startPos %d\n", val)); + DEBUG_LOG(("Rejecting invalid startPos %d", val)); } } else if (key == "Team") @@ -429,7 +429,7 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op } else { - DEBUG_LOG(("Rejecting invalid team %d\n", val)); + DEBUG_LOG(("Rejecting invalid team %d", val)); } } else if (key == "NAT") @@ -438,12 +438,12 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op (val <= FirewallHelperClass::FIREWALL_TYPE_DESTINATION_PORT_DELTA)) { slot->setNATBehavior((FirewallHelperClass::FirewallBehaviorType)val); - DEBUG_LOG(("NAT behavior set to %d for player %d\n", val, playerSlot)); + DEBUG_LOG(("NAT behavior set to %d for player %d", val, playerSlot)); change = true; } else { - DEBUG_LOG(("Rejecting invalid NAT behavior %d\n", (Int)val)); + DEBUG_LOG(("Rejecting invalid NAT behavior %d", (Int)val)); } } @@ -453,9 +453,9 @@ void LANAPI::OnGameOptions( UnsignedInt playerIP, Int playerSlot, AsciiString op m_currentGame->resetAccepted(); RequestGameOptions(GenerateGameOptionsString(), true); lanUpdateSlotList(); - DEBUG_LOG(("Slot value is color=%d, PlayerTemplate=%d, startPos=%d, team=%d\n", + DEBUG_LOG(("Slot value is color=%d, PlayerTemplate=%d, startPos=%d, team=%d", slot->getColor(), slot->getPlayerTemplate(), slot->getStartPos(), slot->getTeamNumber())); - DEBUG_LOG(("Slot list updated to %s\n", GenerateGameOptionsString().str())); + DEBUG_LOG(("Slot list updated to %s", GenerateGameOptionsString().str())); } } } @@ -540,7 +540,7 @@ void LANAPI::OnHostLeave( void ) if (m_inLobby || !m_currentGame) return; LANbuttonPushed = true; - DEBUG_LOG(("Host left - popping to lobby\n")); + DEBUG_LOG(("Host left - popping to lobby")); TheShell->pop(); } @@ -567,7 +567,7 @@ void LANAPI::OnPlayerLeave( UnicodeString player ) pref.write(); } LANbuttonPushed = true; - DEBUG_LOG(("OnPlayerLeave says we're leaving! pop away!\n")); + DEBUG_LOG(("OnPlayerLeave says we're leaving! pop away!")); TheShell->pop(); } else diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp index 10fe65b78e..28481085db 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp @@ -224,7 +224,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) reply.GameNotJoined.reason = LANAPIInterface::RET_GAME_STARTED; reply.GameNotJoined.gameIP = m_localIP; reply.GameNotJoined.playerIP = senderIP; - DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because game already started.\n")); + DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because game already started.")); } else { @@ -238,7 +238,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) /* if (msg->GameToJoin.iniCRC != TheGlobalData->m_iniCRC || msg->GameToJoin.exeCRC != TheGlobalData->m_exeCRC) { - DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because of CRC mismatch. CRCs are them/us INI:%X/%X exe:%X/%X\n", + DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because of CRC mismatch. CRCs are them/us INI:%X/%X exe:%X/%X", msg->GameToJoin.iniCRC, TheGlobalData->m_iniCRC, msg->GameToJoin.exeCRC, TheGlobalData->m_exeCRC)); reply.LANMessageType = LANMessage::MSG_JOIN_DENY; @@ -273,7 +273,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) if (s.isNotEmpty()) { - DEBUG_LOG(("Checking serial '%s' in slot %d\n", s.str(), player)); + DEBUG_LOG(("Checking serial '%s' in slot %d", s.str(), player)); if (!strncmp(s.str(), msg->GameToJoin.serial, g_maxSerialLength)) { @@ -284,7 +284,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) reply.GameNotJoined.playerIP = senderIP; canJoin = false; - DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because of duplicate serial # (%s).\n", s.str())); + DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because of duplicate serial # (%s).", s.str())); break; } } @@ -304,7 +304,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) reply.GameNotJoined.playerIP = senderIP; canJoin = false; - DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because of duplicate names.\n")); + DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because of duplicate names.")); break; } } @@ -349,7 +349,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) newSlot.setLastHeard(timeGetTime()); newSlot.setSerial(msg->GameToJoin.serial); m_currentGame->setSlot(player,newSlot); - DEBUG_LOG(("LANAPI::handleRequestJoin - added player %ls at ip 0x%08x to the game\n", msg->name, senderIP)); + DEBUG_LOG(("LANAPI::handleRequestJoin - added player %ls at ip 0x%08x to the game", msg->name, senderIP)); OnPlayerJoin(player, UnicodeString(msg->name)); responseIP = 0; @@ -366,7 +366,7 @@ void LANAPI::handleRequestJoin( LANMessage *msg, UnsignedInt senderIP ) reply.GameNotJoined.reason = LANAPIInterface::RET_GAME_FULL; reply.GameNotJoined.gameIP = m_localIP; reply.GameNotJoined.playerIP = senderIP; - DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because game is full.\n")); + DEBUG_LOG(("LANAPI::handleRequestJoin - join denied because game is full.")); } } } @@ -590,10 +590,10 @@ void LANAPI::handleChat( LANMessage *msg, UnsignedInt senderIP ) { if (LookupGame(UnicodeString(msg->Chat.gameName)) != m_currentGame) { - DEBUG_LOG(("Game '%ls' is not my game\n", msg->Chat.gameName)); + DEBUG_LOG(("Game '%ls' is not my game", msg->Chat.gameName)); if (m_currentGame) { - DEBUG_LOG(("Current game is '%ls'\n", m_currentGame->getName().str())); + DEBUG_LOG(("Current game is '%ls'", m_currentGame->getName().str())); } return; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp index e29851a459..0627437eca 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp @@ -270,7 +270,7 @@ Bool ParseGameOptionsString(LANGameInfo *game, AsciiString options) LANGameSlot *slot = game->getLANSlot(i); if (slot && slot->isHuman()) { - //DEBUG_LOG(("Saving off %ls@%ls for %ls\n", slot->getUser()->getLogin().str(), slot->getUser()->getHost().str(), slot->getName().str())); + //DEBUG_LOG(("Saving off %ls@%ls for %ls", slot->getUser()->getLogin().str(), slot->getUser()->getHost().str(), slot->getName().str())); oldLogins[slot->getName()] = slot->getUser()->getLogin(); oldMachines[slot->getName()] = slot->getUser()->getHost(); } @@ -284,7 +284,7 @@ Bool ParseGameOptionsString(LANGameInfo *game, AsciiString options) { // Int hasMap = game->getSlot(newLocalSlotNum)->hasMap(); newMapCRC = game->getMapCRC(); - //DEBUG_LOG(("wasInGame:%d isInGame:%d hadMap:%d hasMap:%d oldMap:%s newMap:%s\n", wasInGame, isInGame, hadMap, hasMap, oldMap.str(), game->getMap().str())); + //DEBUG_LOG(("wasInGame:%d isInGame:%d hadMap:%d hasMap:%d oldMap:%s newMap:%s", wasInGame, isInGame, hadMap, hasMap, oldMap.str(), game->getMap().str())); if ( (oldMapCRC ^ newMapCRC)/*(hasMap ^ hadMap)*/ || (!wasInGame && isInGame) ) { // it changed. send it @@ -308,7 +308,7 @@ Bool ParseGameOptionsString(LANGameInfo *game, AsciiString options) mapIt = oldMachines.find(slot->getName()); if (mapIt != oldMachines.end()) slot->setHost(mapIt->second); - //DEBUG_LOG(("Restored %ls@%ls for %ls\n", slot->getUser()->getLogin().str(), slot->getUser()->getHost().str(), slot->getName().str())); + //DEBUG_LOG(("Restored %ls@%ls for %ls", slot->getUser()->getLogin().str(), slot->getUser()->getHost().str(), slot->getName().str())); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NAT.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NAT.cpp index e7a41405b6..2a3e01a152 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NAT.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NAT.cpp @@ -198,7 +198,7 @@ NATStateType NAT::update() { if (stats.id == 0) { gotAllStats = FALSE; - //DEBUG_LOG(("Failed to find stats for %ls(%d)\n", slot->getName().str(), slot->getProfileID())); + //DEBUG_LOG(("Failed to find stats for %ls(%d)", slot->getName().str(), slot->getProfileID())); } } } @@ -207,7 +207,7 @@ NATStateType NAT::update() { UnsignedInt now = timeGetTime(); if (now > s_startStatWaitTime + MS_TO_WAIT_FOR_STATS) { - DEBUG_LOG(("Timed out waiting for stats. Let's just start the dang game.\n")); + DEBUG_LOG(("Timed out waiting for stats. Let's just start the dang game.")); timedOut = TRUE; } if (gotAllStats || timedOut) @@ -225,7 +225,7 @@ NATStateType NAT::update() { ++m_connectionRound; // m_roundTimeout = timeGetTime() + TheGameSpyConfig->getRoundTimeout(); m_roundTimeout = timeGetTime() + m_timeForRoundTimeout; - DEBUG_LOG(("NAT::update - done with connection round, moving on to round %d\n", m_connectionRound)); + DEBUG_LOG(("NAT::update - done with connection round, moving on to round %d", m_connectionRound)); // we finished that round, now check to see if we're done, or if there are more rounds to go. if (allConnectionsDone() == TRUE) { @@ -237,7 +237,7 @@ NATStateType NAT::update() { TheFirewallHelper->flagNeedToRefresh(FALSE); s_startStatWaitTime = timeGetTime(); - DEBUG_LOG(("NAT::update - done with all connections, woohoo!!\n")); + DEBUG_LOG(("NAT::update - done with all connections, woohoo!!")); /* m_NATState = NATSTATE_DONE; TheEstablishConnectionsMenu->endMenu(); @@ -253,7 +253,7 @@ NATStateType NAT::update() { NATConnectionState state = connectionUpdate(); if (timeGetTime() > m_roundTimeout) { - DEBUG_LOG(("NAT::update - round timeout expired\n")); + DEBUG_LOG(("NAT::update - round timeout expired")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); notifyUsersOfConnectionFailed(m_localNodeNumber); } @@ -320,7 +320,7 @@ NATConnectionState NAT::connectionUpdate() { DEBUG_ASSERTCRASH(slot != NULL, ("Trying to send keepalive to a NULL slot")); if (slot != NULL) { UnsignedInt ip = slot->getIP(); - DEBUG_LOG(("NAT::connectionUpdate - sending keep alive to node %d at %d.%d.%d.%d:%d\n", node, + DEBUG_LOG(("NAT::connectionUpdate - sending keep alive to node %d at %d.%d.%d.%d:%d", node, PRINTF_IP_AS_4_INTS(ip), slot->getPort())); m_transport->queueSend(ip, slot->getPort(), (const unsigned char *)"KEEPALIVE", strlen("KEEPALIVE") + 1); } @@ -338,15 +338,15 @@ NATConnectionState NAT::connectionUpdate() { #ifdef DEBUG_LOGGING UnsignedInt ip = m_transport->m_inBuffer[i].addr; #endif - DEBUG_LOG(("NAT::connectionUpdate - got a packet from %d.%d.%d.%d:%d, length = %d\n", + DEBUG_LOG(("NAT::connectionUpdate - got a packet from %d.%d.%d.%d:%d, length = %d", PRINTF_IP_AS_4_INTS(ip), m_transport->m_inBuffer[i].port, m_transport->m_inBuffer[i].length)); UnsignedByte *data = m_transport->m_inBuffer[i].data; if (memcmp(data, "PROBE", strlen("PROBE")) == 0) { Int fromNode = atoi((char *)data + strlen("PROBE")); - DEBUG_LOG(("NAT::connectionUpdate - we've been probed by node %d.\n", fromNode)); + DEBUG_LOG(("NAT::connectionUpdate - we've been probed by node %d.", fromNode)); if (fromNode == m_targetNodeNumber) { - DEBUG_LOG(("NAT::connectionUpdate - probe was sent by our target, setting connection state %d to done.\n", m_targetNodeNumber)); + DEBUG_LOG(("NAT::connectionUpdate - probe was sent by our target, setting connection state %d to done.", m_targetNodeNumber)); setConnectionState(m_targetNodeNumber, NATCONNECTIONSTATE_DONE); if (m_transport->m_inBuffer[i].addr != targetSlot->getIP()) { @@ -354,13 +354,13 @@ NATConnectionState NAT::connectionUpdate() { #ifdef DEBUG_LOGGING UnsignedInt slotIP = targetSlot->getIP(); #endif - DEBUG_LOG(("NAT::connectionUpdate - incomming packet has different from address than we expected, incoming: %d.%d.%d.%d expected: %d.%d.%d.%d\n", + DEBUG_LOG(("NAT::connectionUpdate - incomming packet has different from address than we expected, incoming: %d.%d.%d.%d expected: %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(fromIP), PRINTF_IP_AS_4_INTS(slotIP))); targetSlot->setIP(fromIP); } if (m_transport->m_inBuffer[i].port != targetSlot->getPort()) { - DEBUG_LOG(("NAT::connectionUpdate - incoming packet came from a different port than we expected, incoming: %d expected: %d\n", + DEBUG_LOG(("NAT::connectionUpdate - incoming packet came from a different port than we expected, incoming: %d expected: %d", m_transport->m_inBuffer[i].port, targetSlot->getPort())); targetSlot->setPort(m_transport->m_inBuffer[i].port); m_sourcePorts[m_targetNodeNumber] = m_transport->m_inBuffer[i].port; @@ -372,7 +372,7 @@ NATConnectionState NAT::connectionUpdate() { } if (memcmp(data, "KEEPALIVE", strlen("KEEPALIVE")) == 0) { // keep alive packet, just toss it. - DEBUG_LOG(("NAT::connectionUpdate - got keepalive from %d.%d.%d.%d:%d\n", + DEBUG_LOG(("NAT::connectionUpdate - got keepalive from %d.%d.%d.%d:%d", PRINTF_IP_AS_4_INTS(ip), m_transport->m_inBuffer[i].port)); m_transport->m_inBuffer[i].length = 0; } @@ -384,12 +384,12 @@ NATConnectionState NAT::connectionUpdate() { // check to see if it's time to probe our target. if ((m_timeTillNextSend != -1) && (m_timeTillNextSend <= timeGetTime())) { if (m_numRetries > m_maxNumRetriesAllowed) { - DEBUG_LOG(("NAT::connectionUpdate - too many retries, connection failed.\n")); + DEBUG_LOG(("NAT::connectionUpdate - too many retries, connection failed.")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); notifyUsersOfConnectionFailed(m_localNodeNumber); } else { - DEBUG_LOG(("NAT::connectionUpdate - trying to send another probe (#%d) to our target\n", m_numRetries+1)); + DEBUG_LOG(("NAT::connectionUpdate - trying to send another probe (#%d) to our target", m_numRetries+1)); // Send a probe. sendAProbe(targetSlot->getIP(), targetSlot->getPort(), m_localNodeNumber); // m_timeTillNextSend = timeGetTime() + TheGameSpyConfig->getRetryInterval(); @@ -423,13 +423,13 @@ NATConnectionState NAT::connectionUpdate() { if (m_manglerRetries > m_maxAllowedManglerRetries) { // we couldn't communicate with the mangler, just use our non-mangled // port number and hope that works. - DEBUG_LOG(("NAT::connectionUpdate - couldn't talk with the mangler using default port number\n")); + DEBUG_LOG(("NAT::connectionUpdate - couldn't talk with the mangler using default port number")); sendMangledPortNumberToTarget(getSlotPort(m_connectionNodes[m_localNodeNumber].m_slotIndex), targetSlot); m_sourcePorts[m_targetNodeNumber] = getSlotPort(m_connectionNodes[m_localNodeNumber].m_slotIndex); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORRESPONSE); } else { if (TheFirewallHelper != NULL) { - DEBUG_LOG(("NAT::connectionUpdate - trying to send to the mangler again. mangler address: %d.%d.%d.%d, from port: %d, packet ID:%d\n", + DEBUG_LOG(("NAT::connectionUpdate - trying to send to the mangler again. mangler address: %d.%d.%d.%d, from port: %d, packet ID:%d", PRINTF_IP_AS_4_INTS(m_manglerAddress), m_spareSocketPort, m_packetID)); TheFirewallHelper->sendToManglerFromPort(m_manglerAddress, m_spareSocketPort, m_packetID); } @@ -442,7 +442,7 @@ NATConnectionState NAT::connectionUpdate() { if (m_connectionStates[m_localNodeNumber] == NATCONNECTIONSTATE_WAITINGFORMANGLEDPORT) { if (timeGetTime() > m_timeoutTime) { - DEBUG_LOG(("NAT::connectionUpdate - waiting too long to get the other player's port number, failed.\n")); + DEBUG_LOG(("NAT::connectionUpdate - waiting too long to get the other player's port number, failed.")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); notifyUsersOfConnectionFailed(m_localNodeNumber); @@ -456,9 +456,9 @@ NATConnectionState NAT::connectionUpdate() { // after calling this, you should call the update function untill it returns // NATSTATE_DONE. void NAT::establishConnectionPaths() { - DEBUG_LOG(("NAT::establishConnectionPaths - entering\n")); + DEBUG_LOG(("NAT::establishConnectionPaths - entering")); m_NATState = NATSTATE_DOCONNECTIONPATHS; - DEBUG_LOG(("NAT::establishConnectionPaths - using %d as our starting port number\n", m_startingPortNumber)); + DEBUG_LOG(("NAT::establishConnectionPaths - using %d as our starting port number", m_startingPortNumber)); if (TheEstablishConnectionsMenu == NULL) { TheEstablishConnectionsMenu = NEW EstablishConnectionsMenu; } @@ -479,12 +479,12 @@ void NAT::establishConnectionPaths() { for (; i < MAX_SLOTS; ++i) { if (m_slotList[i] != NULL) { if (m_slotList[i]->isHuman()) { - DEBUG_LOG(("NAT::establishConnectionPaths - slot %d is %ls\n", i, m_slotList[i]->getName().str())); + DEBUG_LOG(("NAT::establishConnectionPaths - slot %d is %ls", i, m_slotList[i]->getName().str())); ++m_numNodes; } } } - DEBUG_LOG(("NAT::establishConnectionPaths - number of nodes: %d\n", m_numNodes)); + DEBUG_LOG(("NAT::establishConnectionPaths - number of nodes: %d", m_numNodes)); if (m_numNodes < 2) { @@ -513,8 +513,8 @@ void NAT::establishConnectionPaths() { // the NAT table from being reset for connections to other nodes. This also happens // to be the reason why I call them "nodes" rather than "slots" or "players" as the // ordering has to be messed with to get the netgears to make love, not war. - DEBUG_LOG(("NAT::establishConnectionPaths - about to set up the node list\n")); - DEBUG_LOG(("NAT::establishConnectionPaths - doing the netgear stuff\n")); + DEBUG_LOG(("NAT::establishConnectionPaths - about to set up the node list")); + DEBUG_LOG(("NAT::establishConnectionPaths - doing the netgear stuff")); UnsignedInt otherNetgearNum = -1; for (i = 0; i < MAX_SLOTS; ++i) { if ((m_slotList != NULL) && (m_slotList[i] != NULL)) { @@ -529,7 +529,7 @@ void NAT::establishConnectionPaths() { m_connectionNodes[nodeindex].m_behavior = m_slotList[i]->getNATBehavior(); connectionAssigned[i] = TRUE; otherNetgearNum = nodeindex; - DEBUG_LOG(("NAT::establishConnectionPaths - first netgear in pair. assigning node %d to slot %d (%ls)\n", nodeindex, i, m_slotList[i]->getName().str())); + DEBUG_LOG(("NAT::establishConnectionPaths - first netgear in pair. assigning node %d to slot %d (%ls)", nodeindex, i, m_slotList[i]->getName().str())); } else { // this is the second in the pair of netgears, pair this up with the other one // for the first round. @@ -541,14 +541,14 @@ void NAT::establishConnectionPaths() { m_connectionNodes[nodeindex].m_behavior = m_slotList[i]->getNATBehavior(); connectionAssigned[i] = TRUE; otherNetgearNum = -1; - DEBUG_LOG(("NAT::establishConnectionPaths - second netgear in pair. assigning node %d to slot %d (%ls)\n", nodeindex, i, m_slotList[i]->getName().str())); + DEBUG_LOG(("NAT::establishConnectionPaths - second netgear in pair. assigning node %d to slot %d (%ls)", nodeindex, i, m_slotList[i]->getName().str())); } } } } // fill in the rest of the nodes with the remaining slots. - DEBUG_LOG(("NAT::establishConnectionPaths - doing the non-Netgear nodes\n")); + DEBUG_LOG(("NAT::establishConnectionPaths - doing the non-Netgear nodes")); for (i = 0; i < MAX_SLOTS; ++i) { if (connectionAssigned[i] == TRUE) { continue; @@ -564,7 +564,7 @@ void NAT::establishConnectionPaths() { while (m_connectionNodes[nodeindex].m_slotIndex != -1) { ++nodeindex; } - DEBUG_LOG(("NAT::establishConnectionPaths - assigning node %d to slot %d (%ls)\n", nodeindex, i, m_slotList[i]->getName().str())); + DEBUG_LOG(("NAT::establishConnectionPaths - assigning node %d to slot %d (%ls)", nodeindex, i, m_slotList[i]->getName().str())); m_connectionNodes[nodeindex].m_slotIndex = i; m_connectionNodes[nodeindex].m_behavior = m_slotList[i]->getNATBehavior(); connectionAssigned[i] = TRUE; @@ -581,7 +581,7 @@ void NAT::establishConnectionPaths() { for (i = 0; i < m_numNodes; ++i) { if (m_connectionNodes[i].m_slotIndex == TheGameSpyGame->getLocalSlotNum()) { m_localNodeNumber = i; - DEBUG_LOG(("NAT::establishConnectionPaths - local node is %d\n", m_localNodeNumber)); + DEBUG_LOG(("NAT::establishConnectionPaths - local node is %d", m_localNodeNumber)); break; } } @@ -614,11 +614,11 @@ void NAT::attachSlotList(GameSlot *slotList[], Int localSlot, UnsignedInt localI m_slotList = slotList; m_localIP = localIP; m_transport = new Transport; - DEBUG_LOG(("NAT::attachSlotList - initting the transport socket with address %d.%d.%d.%d:%d\n", + DEBUG_LOG(("NAT::attachSlotList - initting the transport socket with address %d.%d.%d.%d:%d", PRINTF_IP_AS_4_INTS(m_localIP), getSlotPort(localSlot))); m_startingPortNumber = NETWORK_BASE_PORT_NUMBER + ((timeGetTime() / 1000) % 20000); - DEBUG_LOG(("NAT::attachSlotList - using %d as the starting port number\n", m_startingPortNumber)); + DEBUG_LOG(("NAT::attachSlotList - using %d as the starting port number", m_startingPortNumber)); generatePortNumbers(slotList, localSlot); m_transport->init(m_localIP, getSlotPort(localSlot)); } @@ -651,7 +651,7 @@ Transport * NAT::getTransport() { // send the port number to our target for this round. // init the m_connectionStates for all players. void NAT::doThisConnectionRound() { - DEBUG_LOG(("NAT::doThisConnectionRound - starting process for connection round %d\n", m_connectionRound)); + DEBUG_LOG(("NAT::doThisConnectionRound - starting process for connection round %d", m_connectionRound)); // clear out the states from the last round. m_targetNodeNumber = -1; @@ -665,26 +665,26 @@ void NAT::doThisConnectionRound() { for (i = 0; i < m_numNodes; ++i) { Int targetNodeNumber = m_connectionPairs[m_connectionPairIndex][m_connectionRound][i]; - DEBUG_LOG(("NAT::doThisConnectionRound - node %d needs to connect to node %d\n", i, targetNodeNumber)); + DEBUG_LOG(("NAT::doThisConnectionRound - node %d needs to connect to node %d", i, targetNodeNumber)); if (targetNodeNumber != -1) { if (i == m_localNodeNumber) { m_targetNodeNumber = targetNodeNumber; - DEBUG_LOG(("NAT::doThisConnectionRound - Local node is connecting to node %d\n", m_targetNodeNumber)); + DEBUG_LOG(("NAT::doThisConnectionRound - Local node is connecting to node %d", m_targetNodeNumber)); UnsignedInt targetSlotIndex = m_connectionNodes[(m_connectionPairs[m_connectionPairIndex][m_connectionRound][i])].m_slotIndex; GameSlot *targetSlot = m_slotList[targetSlotIndex]; GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(localSlot != NULL, ("local slot is NULL")); DEBUG_ASSERTCRASH(targetSlot != NULL, ("trying to negotiate with a NULL target slot, slot is %d", m_connectionPairs[m_connectionPairIndex][m_connectionRound][i])); - DEBUG_LOG(("NAT::doThisConnectionRound - Target slot index = %d (%ls)\n", targetSlotIndex, m_slotList[targetSlotIndex]->getName().str())); - DEBUG_LOG(("NAT::doThisConnectionRound - Target slot has NAT behavior 0x%8X, local slot has NAT behavior 0x%8X\n", targetSlot->getNATBehavior(), localSlot->getNATBehavior())); + DEBUG_LOG(("NAT::doThisConnectionRound - Target slot index = %d (%ls)", targetSlotIndex, m_slotList[targetSlotIndex]->getName().str())); + DEBUG_LOG(("NAT::doThisConnectionRound - Target slot has NAT behavior 0x%8X, local slot has NAT behavior 0x%8X", targetSlot->getNATBehavior(), localSlot->getNATBehavior())); #if defined(DEBUG_LOGGING) UnsignedInt targetIP = targetSlot->getIP(); UnsignedInt localIP = localSlot->getIP(); #endif - DEBUG_LOG(("NAT::doThisConnectionRound - Target slot has IP %d.%d.%d.%d Local slot has IP %d.%d.%d.%d\n", + DEBUG_LOG(("NAT::doThisConnectionRound - Target slot has IP %d.%d.%d.%d Local slot has IP %d.%d.%d.%d", PRINTF_IP_AS_4_INTS(targetIP), PRINTF_IP_AS_4_INTS(localIP))); @@ -694,14 +694,14 @@ void NAT::doThisConnectionRound() { // we have a netgear bug type behavior and the target does not, so we need them to send to us // first to avoid having our NAT table reset. - DEBUG_LOG(("NAT::doThisConnectionRound - Local node has a netgear and the target node does not, need to delay our probe.\n")); + DEBUG_LOG(("NAT::doThisConnectionRound - Local node has a netgear and the target node does not, need to delay our probe.")); m_timeTillNextSend = -1; } // figure out which port number I'm using for this connection // this merely starts to talk to the mangler server, we have to keep calling // the update function till we get a response. - DEBUG_LOG(("NAT::doThisConnectionRound - About to attempt to get the next mangled source port\n")); + DEBUG_LOG(("NAT::doThisConnectionRound - About to attempt to get the next mangled source port")); sendMangledSourcePort(); // m_nextPortSendTime = timeGetTime() + TheGameSpyConfig->getRetryInterval(); m_nextPortSendTime = timeGetTime() + m_timeBetweenRetries; @@ -714,14 +714,14 @@ void NAT::doThisConnectionRound() { } } else { // no one to connect to, so this one is done. - DEBUG_LOG(("NAT::doThisConnectionRound - node %d has no one to connect to, so they're done\n", i)); + DEBUG_LOG(("NAT::doThisConnectionRound - node %d has no one to connect to, so they're done", i)); setConnectionState(i, NATCONNECTIONSTATE_DONE); } } } void NAT::sendAProbe(UnsignedInt ip, UnsignedShort port, Int fromNode) { - DEBUG_LOG(("NAT::sendAProbe - sending a probe from port %d to %d.%d.%d.%d:%d\n", getSlotPort(m_connectionNodes[m_localNodeNumber].m_slotIndex), + DEBUG_LOG(("NAT::sendAProbe - sending a probe from port %d to %d.%d.%d.%d:%d", getSlotPort(m_connectionNodes[m_localNodeNumber].m_slotIndex), PRINTF_IP_AS_4_INTS(ip), port)); AsciiString str; str.format("PROBE%d", fromNode); @@ -739,7 +739,7 @@ void NAT::sendMangledSourcePort() { GameSlot *targetSlot = m_slotList[m_connectionNodes[m_targetNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(targetSlot != NULL, ("NAT::sendMangledSourcePort - targetSlot is NULL")); if (targetSlot == NULL) { - DEBUG_LOG(("NAT::sendMangledSourcePort - targetSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::sendMangledSourcePort - targetSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } @@ -747,7 +747,7 @@ void NAT::sendMangledSourcePort() { GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(localSlot != NULL, ("NAT::sendMangledSourcePort - localSlot is NULL, WTF?")); if (localSlot == NULL) { - DEBUG_LOG(("NAT::sendMangledSourcePort - localSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::sendMangledSourcePort - localSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } @@ -758,8 +758,8 @@ void NAT::sendMangledSourcePort() { UnsignedInt localip = localSlot->getIP(); UnsignedInt targetip = targetSlot->getIP(); #endif - DEBUG_LOG(("NAT::sendMangledSourcePort - target and I are behind the same NAT, no mangling\n")); - DEBUG_LOG(("NAT::sendMangledSourcePort - I am %ls, target is %ls, my IP is %d.%d.%d.%d, target IP is %d.%d.%d.%d\n", localSlot->getName().str(), targetSlot->getName().str(), + DEBUG_LOG(("NAT::sendMangledSourcePort - target and I are behind the same NAT, no mangling")); + DEBUG_LOG(("NAT::sendMangledSourcePort - I am %ls, target is %ls, my IP is %d.%d.%d.%d, target IP is %d.%d.%d.%d", localSlot->getName().str(), targetSlot->getName().str(), PRINTF_IP_AS_4_INTS(localip), PRINTF_IP_AS_4_INTS(targetip))); @@ -776,7 +776,7 @@ void NAT::sendMangledSourcePort() { // check to see if we are NAT'd at all. if ((fwType == 0) || (fwType == FirewallHelperClass::FIREWALL_TYPE_SIMPLE)) { // no mangling, just return the source port - DEBUG_LOG(("NAT::sendMangledSourcePort - no mangling, just using the source port\n")); + DEBUG_LOG(("NAT::sendMangledSourcePort - no mangling, just using the source port")); sendMangledPortNumberToTarget(sourcePort, targetSlot); m_previousSourcePort = sourcePort; m_sourcePorts[m_targetNodeNumber] = sourcePort; @@ -789,15 +789,15 @@ void NAT::sendMangledSourcePort() { // then we don't have to figure it out again. if (((fwType & FirewallHelperClass::FIREWALL_TYPE_DESTINATION_PORT_DELTA) == 0) && ((fwType & FirewallHelperClass::FIREWALL_TYPE_SMART_MANGLING) == 0)) { - DEBUG_LOG(("NAT::sendMangledSourcePort - our firewall doesn't NAT based on destination address, checking for old connections from this address\n")); + DEBUG_LOG(("NAT::sendMangledSourcePort - our firewall doesn't NAT based on destination address, checking for old connections from this address")); if (m_previousSourcePort != 0) { - DEBUG_LOG(("NAT::sendMangledSourcePort - Previous source port was %d, using that one\n", m_previousSourcePort)); + DEBUG_LOG(("NAT::sendMangledSourcePort - Previous source port was %d, using that one", m_previousSourcePort)); sendMangledPortNumberToTarget(m_previousSourcePort, targetSlot); m_sourcePorts[m_targetNodeNumber] = m_previousSourcePort; setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORMANGLEDPORT); return; } else { - DEBUG_LOG(("NAT::sendMangledSourcePort - Previous source port not found\n")); + DEBUG_LOG(("NAT::sendMangledSourcePort - Previous source port not found")); } } @@ -808,11 +808,11 @@ void NAT::sendMangledSourcePort() { // get the address of the mangler we need to talk to. Char manglerName[256]; FirewallHelperClass::getManglerName(1, manglerName); - DEBUG_LOG(("NAT::sendMangledSourcePort - about to call gethostbyname for mangler at %s\n", manglerName)); + DEBUG_LOG(("NAT::sendMangledSourcePort - about to call gethostbyname for mangler at %s", manglerName)); struct hostent *hostInfo = gethostbyname(manglerName); if (hostInfo == NULL) { - DEBUG_LOG(("NAT::sendMangledSourcePort - gethostbyname failed for mangler address %s\n", manglerName)); + DEBUG_LOG(("NAT::sendMangledSourcePort - gethostbyname failed for mangler address %s", manglerName)); // can't find the mangler, we're screwed so just send the source port. sendMangledPortNumberToTarget(sourcePort, targetSlot); m_sourcePorts[m_targetNodeNumber] = sourcePort; @@ -822,10 +822,10 @@ void NAT::sendMangledSourcePort() { memcpy(&m_manglerAddress, &(hostInfo->h_addr_list[0][0]), 4); m_manglerAddress = ntohl(m_manglerAddress); - DEBUG_LOG(("NAT::sendMangledSourcePort - mangler %s address is %d.%d.%d.%d\n", manglerName, + DEBUG_LOG(("NAT::sendMangledSourcePort - mangler %s address is %d.%d.%d.%d", manglerName, PRINTF_IP_AS_4_INTS(m_manglerAddress))); - DEBUG_LOG(("NAT::sendMangledSourcePort - NAT behavior = 0x%08x\n", fwType)); + DEBUG_LOG(("NAT::sendMangledSourcePort - NAT behavior = 0x%08x", fwType)); // m_manglerRetryTime = TheGameSpyConfig->getRetryInterval() + timeGetTime(); m_manglerRetryTime = m_manglerRetryTimeInterval + timeGetTime(); @@ -843,12 +843,12 @@ void NAT::sendMangledSourcePort() { } void NAT::processManglerResponse(UnsignedShort mangledPort) { - DEBUG_LOG(("NAT::processManglerResponse - Work out what my NAT'd port will be\n")); + DEBUG_LOG(("NAT::processManglerResponse - Work out what my NAT'd port will be")); GameSlot *targetSlot = m_slotList[m_connectionNodes[m_targetNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(targetSlot != NULL, ("NAT::processManglerResponse - targetSlot is NULL")); if (targetSlot == NULL) { - DEBUG_LOG(("NAT::processManglerResponse - targetSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::processManglerResponse - targetSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } @@ -893,7 +893,7 @@ void NAT::processManglerResponse(UnsignedShort mangledPort) { returnPort += 1024; } - DEBUG_LOG(("NAT::processManglerResponse - mangled port is %d\n", returnPort)); + DEBUG_LOG(("NAT::processManglerResponse - mangled port is %d", returnPort)); m_previousSourcePort = returnPort; sendMangledPortNumberToTarget(returnPort, targetSlot); @@ -966,29 +966,29 @@ void NAT::probed(Int nodeNumber) { GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(localSlot != NULL, ("NAT::probed - localSlot is NULL, WTF?")); if (localSlot == NULL) { - DEBUG_LOG(("NAT::probed - localSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::probed - localSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } if (m_beenProbed == FALSE) { m_beenProbed = TRUE; - DEBUG_LOG(("NAT::probed - just got probed for the first time.\n")); + DEBUG_LOG(("NAT::probed - just got probed for the first time.")); if ((localSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) != 0) { - DEBUG_LOG(("NAT::probed - we have a NETGEAR and we were just probed for the first time\n")); + DEBUG_LOG(("NAT::probed - we have a NETGEAR and we were just probed for the first time")); GameSlot *targetSlot = m_slotList[m_connectionNodes[m_targetNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(targetSlot != NULL, ("NAT::probed - targetSlot is NULL")); if (targetSlot == NULL) { - DEBUG_LOG(("NAT::probed - targetSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::probed - targetSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } if (targetSlot->getPort() == 0) { setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORMANGLEDPORT); - DEBUG_LOG(("NAT::probed - still waiting for mangled port\n")); + DEBUG_LOG(("NAT::probed - still waiting for mangled port")); } else { - DEBUG_LOG(("NAT::probed - sending a probe to %ls\n", targetSlot->getName().str())); + DEBUG_LOG(("NAT::probed - sending a probe to %ls", targetSlot->getName().str())); sendAProbe(targetSlot->getIP(), targetSlot->getPort(), m_localNodeNumber); notifyTargetOfProbe(targetSlot); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORRESPONSE); @@ -1002,14 +1002,14 @@ void NAT::gotMangledPort(Int nodeNumber, UnsignedShort mangledPort) { // if we've already finished the connection, then we don't need to process this. if (m_connectionStates[m_localNodeNumber] == NATCONNECTIONSTATE_DONE) { - DEBUG_LOG(("NAT::gotMangledPort - got a mangled port, but we've already finished this connection, ignoring.\n")); + DEBUG_LOG(("NAT::gotMangledPort - got a mangled port, but we've already finished this connection, ignoring.")); return; } GameSlot *targetSlot = m_slotList[m_connectionNodes[m_targetNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(targetSlot != NULL, ("NAT::gotMangledPort - targetSlot is NULL")); if (targetSlot == NULL) { - DEBUG_LOG(("NAT::gotMangledPort - targetSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::gotMangledPort - targetSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } @@ -1017,31 +1017,31 @@ void NAT::gotMangledPort(Int nodeNumber, UnsignedShort mangledPort) { GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(localSlot != NULL, ("NAT::gotMangledPort - localSlot is NULL, WTF?")); if (localSlot == NULL) { - DEBUG_LOG(("NAT::gotMangledPort - localSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::gotMangledPort - localSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } if (nodeNumber != m_targetNodeNumber) { - DEBUG_LOG(("NAT::gotMangledPort - got a mangled port number for someone that isn't my target. node = %d, target node = %d\n", nodeNumber, m_targetNodeNumber)); + DEBUG_LOG(("NAT::gotMangledPort - got a mangled port number for someone that isn't my target. node = %d, target node = %d", nodeNumber, m_targetNodeNumber)); return; } targetSlot->setPort(mangledPort); - DEBUG_LOG(("NAT::gotMangledPort - got mangled port number %d from our target node (%ls)\n", mangledPort, targetSlot->getName().str())); + DEBUG_LOG(("NAT::gotMangledPort - got mangled port number %d from our target node (%ls)", mangledPort, targetSlot->getName().str())); if (((localSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) == 0) || (m_beenProbed == TRUE) || (((localSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) != 0) && ((targetSlot->getNATBehavior() & FirewallHelperClass::FIREWALL_TYPE_NETGEAR_BUG) != 0))) { #ifdef DEBUG_LOGGING UnsignedInt ip = targetSlot->getIP(); #endif - DEBUG_LOG(("NAT::gotMangledPort - don't have a netgear or we have already been probed, or both my target and I have a netgear, send a PROBE. Sending to %d.%d.%d.%d:%d\n", + DEBUG_LOG(("NAT::gotMangledPort - don't have a netgear or we have already been probed, or both my target and I have a netgear, send a PROBE. Sending to %d.%d.%d.%d:%d", PRINTF_IP_AS_4_INTS(ip), targetSlot->getPort())); sendAProbe(targetSlot->getIP(), targetSlot->getPort(), m_localNodeNumber); notifyTargetOfProbe(targetSlot); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_WAITINGFORRESPONSE); } else { - DEBUG_LOG(("NAT::gotMangledPort - we are a netgear, not sending a PROBE yet.\n")); + DEBUG_LOG(("NAT::gotMangledPort - we are a netgear, not sending a PROBE yet.")); } } @@ -1059,14 +1059,14 @@ void NAT::gotInternalAddress(Int nodeNumber, UnsignedInt address) { } if (nodeNumber != m_targetNodeNumber) { - DEBUG_LOG(("NAT::gotInternalAddress - got a internal address for someone that isn't my target. node = %d, target node = %d\n", nodeNumber, m_targetNodeNumber)); + DEBUG_LOG(("NAT::gotInternalAddress - got a internal address for someone that isn't my target. node = %d, target node = %d", nodeNumber, m_targetNodeNumber)); return; } if (localSlot->getIP() == targetSlot->getIP()) { // we have the same IP address, i.e. we are behind the same NAT. // I need to talk directly to his internal address. - DEBUG_LOG(("NAT::gotInternalAddress - target and local players have same external address, using internal address.\n")); + DEBUG_LOG(("NAT::gotInternalAddress - target and local players have same external address, using internal address.")); targetSlot->setIP(address); // use the slot's internal address from now on } } @@ -1083,14 +1083,14 @@ void NAT::notifyTargetOfProbe(GameSlot *targetSlot) { req.nick = hostName.str(); req.options = options.str(); TheGameSpyPeerMessageQueue->addRequest(req); - DEBUG_LOG(("NAT::notifyTargetOfProbe - notifying %ls that we have probed them.\n", targetSlot->getName().str())); + DEBUG_LOG(("NAT::notifyTargetOfProbe - notifying %ls that we have probed them.", targetSlot->getName().str())); } void NAT::notifyUsersOfConnectionDone(Int nodeIndex) { GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(localSlot != NULL, ("NAT::notifyUsersOfConnectionDone - localSlot is NULL, WTF?")); if (localSlot == NULL) { - DEBUG_LOG(("NAT::notifyUsersOfConnectionDone - localSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::notifyUsersOfConnectionDone - localSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } @@ -1124,7 +1124,7 @@ void NAT::notifyUsersOfConnectionDone(Int nodeIndex) { req.nick = names.str(); req.options = options.str(); - DEBUG_LOG(("NAT::notifyUsersOfConnectionDone - sending %s to %s\n", options.str(), names.str())); + DEBUG_LOG(("NAT::notifyUsersOfConnectionDone - sending %s to %s", options.str(), names.str())); TheGameSpyPeerMessageQueue->addRequest(req); } @@ -1132,7 +1132,7 @@ void NAT::notifyUsersOfConnectionFailed(Int nodeIndex) { GameSlot *localSlot = m_slotList[m_connectionNodes[m_localNodeNumber].m_slotIndex]; DEBUG_ASSERTCRASH(localSlot != NULL, ("NAT::notifyUsersOfConnectionFailed - localSlot is NULL, WTF?")); if (localSlot == NULL) { - DEBUG_LOG(("NAT::notifyUsersOfConnectionFailed - localSlot is NULL, failed this connection\n")); + DEBUG_LOG(("NAT::notifyUsersOfConnectionFailed - localSlot is NULL, failed this connection")); setConnectionState(m_localNodeNumber, NATCONNECTIONSTATE_FAILED); return; } @@ -1146,7 +1146,7 @@ void NAT::notifyUsersOfConnectionFailed(Int nodeIndex) { req.id = "NAT/"; req.options = options.str(); - DEBUG_LOG(("NAT::notifyUsersOfConnectionFailed - sending %s to room\n", options.str())); + DEBUG_LOG(("NAT::notifyUsersOfConnectionFailed - sending %s to room", options.str())); */ req.peerRequestType = PeerRequest::PEERREQUEST_UTMPLAYER; @@ -1174,7 +1174,7 @@ void NAT::notifyUsersOfConnectionFailed(Int nodeIndex) { req.nick = names.str(); req.options = options.str(); - DEBUG_LOG(("NAT::notifyUsersOfConnectionFailed - sending %s to %s\n", options.str(), names.str())); + DEBUG_LOG(("NAT::notifyUsersOfConnectionFailed - sending %s to %s", options.str(), names.str())); TheGameSpyPeerMessageQueue->addRequest(req); } @@ -1191,7 +1191,7 @@ void NAT::sendMangledPortNumberToTarget(UnsignedShort mangledPort, GameSlot *tar hostName.translate(targetSlot->getName()); req.nick = hostName.str(); req.options = options.str(); - DEBUG_LOG(("NAT::sendMangledPortNumberToTarget - sending \"%s\" to %s\n", options.str(), hostName.str())); + DEBUG_LOG(("NAT::sendMangledPortNumberToTarget - sending \"%s\" to %s", options.str(), hostName.str())); TheGameSpyPeerMessageQueue->addRequest(req); } @@ -1201,7 +1201,7 @@ void NAT::processGlobalMessage(Int slotNum, const char *options) { while (isspace(*ptr)) { ++ptr; } - DEBUG_LOG(("NAT::processGlobalMessage - got message from slot %d, message is \"%s\"\n", slotNum, ptr)); + DEBUG_LOG(("NAT::processGlobalMessage - got message from slot %d, message is \"%s\"", slotNum, ptr)); if (!strncmp(ptr, "PROBED", strlen("PROBED"))) { // format: PROBED // a probe has been sent at us, if we are waiting because of a netgear or something, we @@ -1211,7 +1211,7 @@ void NAT::processGlobalMessage(Int slotNum, const char *options) { // make sure we're being probed by who we're supposed to be probed by. probed(node); } else { - DEBUG_LOG(("NAT::processGlobalMessage - probed by node %d, not our target\n", node)); + DEBUG_LOG(("NAT::processGlobalMessage - probed by node %d, not our target", node)); } } else if (!strncmp(ptr, "CONNDONE", strlen("CONNDONE"))) { // format: CONNDONE @@ -1230,13 +1230,13 @@ void NAT::processGlobalMessage(Int slotNum, const char *options) { if (m_connectionPairs[m_connectionPairIndex][m_connectionRound][node] == sendingNode) { // Int node = atoi(ptr + strlen("CONNDONE")); - DEBUG_LOG(("NAT::processGlobalMessage - got a CONNDONE message for node %d\n", node)); + DEBUG_LOG(("NAT::processGlobalMessage - got a CONNDONE message for node %d", node)); if ((node >= 0) && (node <= m_numNodes)) { - DEBUG_LOG(("NAT::processGlobalMessage - node %d's connection is complete, setting connection state to done\n", node)); + DEBUG_LOG(("NAT::processGlobalMessage - node %d's connection is complete, setting connection state to done", node)); setConnectionState(node, NATCONNECTIONSTATE_DONE); } } else { - DEBUG_LOG(("NAT::processGlobalMessage - got a connection done message that isn't from this round. node: %d sending node: %d\n", node, sendingNode)); + DEBUG_LOG(("NAT::processGlobalMessage - got a connection done message that isn't from this round. node: %d sending node: %d", node, sendingNode)); } } else if (!strncmp(ptr, "CONNFAILED", strlen("CONNFAILED"))) { // format: CONNFAILED @@ -1244,7 +1244,7 @@ void NAT::processGlobalMessage(Int slotNum, const char *options) { // and mark that down as part of the connectionStates. Int node = atoi(ptr + strlen("CONNFAILED")); if ((node >= 0) && (node < m_numNodes)) { - DEBUG_LOG(("NAT::processGlobalMessage - node %d's connection failed, setting connection state to failed\n", node)); + DEBUG_LOG(("NAT::processGlobalMessage - node %d's connection failed, setting connection state to failed", node)); setConnectionState(node, NATCONNECTIONSTATE_FAILED); } } else if (!strncmp(ptr, "PORT", strlen("PORT"))) { @@ -1265,7 +1265,7 @@ void NAT::processGlobalMessage(Int slotNum, const char *options) { sscanf(c, "%d %X", &intport, &addr); UnsignedShort port = (UnsignedShort)intport; - DEBUG_LOG(("NAT::processGlobalMessage - got port message from node %d, port: %d, internal address: %d.%d.%d.%d\n", node, port, + DEBUG_LOG(("NAT::processGlobalMessage - got port message from node %d, port: %d, internal address: %d.%d.%d.%d", node, port, PRINTF_IP_AS_4_INTS(addr))); if ((node >= 0) && (node < m_numNodes)) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetCommandRef.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetCommandRef.cpp index 0044d0d442..efff9f13a8 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetCommandRef.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetCommandRef.cpp @@ -48,7 +48,7 @@ NetCommandRef::NetCommandRef(NetCommandMsg *msg) #ifdef DEBUG_NETCOMMANDREF m_id = ++refNum; - DEBUG_LOG(("NetCommandRef %d allocated in file %s line %d\n", m_id, filename, line)); + DEBUG_LOG(("NetCommandRef %d allocated in file %s line %d", m_id, filename, line)); #endif } @@ -65,7 +65,7 @@ NetCommandRef::~NetCommandRef() DEBUG_ASSERTCRASH(m_prev == NULL, ("NetCommandRef::~NetCommandRef - m_prev != NULL")); #ifdef DEBUG_NETCOMMANDREF - DEBUG_LOG(("NetCommandRef %d deleted\n", m_id)); + DEBUG_LOG(("NetCommandRef %d deleted", m_id)); #endif } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp index 7557337e80..851815edca 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp @@ -98,7 +98,7 @@ void NetCommandWrapperListNode::copyChunkData(NetWrapperCommandMsg *msg) { if (msg->getChunkNumber() >= m_numChunks) return; - DEBUG_LOG(("NetCommandWrapperListNode::copyChunkData() - copying chunk %d\n", + DEBUG_LOG(("NetCommandWrapperListNode::copyChunkData() - copying chunk %d", msg->getChunkNumber())); if (m_chunksPresent[msg->getChunkNumber()] == TRUE) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetMessageStream.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetMessageStream.cpp index 63745860de..7cf572cbbb 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetMessageStream.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetMessageStream.cpp @@ -71,7 +71,7 @@ static Bool AddToNetCommandList(GameMessage *msg, UnsignedInt timestamp, Command CommandMsg *cmdMsg = NEW CommandMsg(timestamp, msg); if (!cmdMsg) { - DEBUG_LOG(("Alloc failed!\n")); + DEBUG_LOG(("Alloc failed!")); return false; } @@ -98,7 +98,7 @@ Bool AddToNetCommandList(Int playerNum, GameMessage *msg, UnsignedInt timestamp) if (playerNum < 0 || playerNum >= MAX_SLOTS) return false; - DEBUG_LOG(("Adding msg to NetCommandList %d\n", playerNum)); + DEBUG_LOG(("Adding msg to NetCommandList %d", playerNum)); return AddToNetCommandList(msg, timestamp, CommandHead[playerNum], CommandTail[playerNum]); } @@ -113,7 +113,7 @@ static GameMessage * GetCommandMsg(UnsignedInt timestamp, CommandMsg *& CommandH if (CommandHead->GetTimestamp() < timestamp) { - DEBUG_LOG(("Time is %d, yet message timestamp is %d!\n", timestamp, CommandHead->GetTimestamp())); + DEBUG_LOG(("Time is %d, yet message timestamp is %d!", timestamp, CommandHead->GetTimestamp())); return NULL; } @@ -145,7 +145,7 @@ GameMessage * GetCommandMsg(UnsignedInt timestamp, Int playerNum) if (playerNum < 0 || playerNum >= MAX_SLOTS) return NULL; - //DEBUG_LOG(("Adding msg to NetCommandList %d\n", playerNum)); + //DEBUG_LOG(("Adding msg to NetCommandList %d", playerNum)); return GetCommandMsg(timestamp, CommandHead[playerNum], CommandTail[playerNum]); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetPacket.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetPacket.cpp index 2171ee66e5..dd35220d6a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetPacket.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetPacket.cpp @@ -206,7 +206,7 @@ NetPacketList NetPacket::ConstructBigCommandPacketList(NetCommandRef *ref) { ref->setRelay(ref->getRelay()); if (packet->addCommand(ref) == FALSE) { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::BeginBigCommandPacketList - failed to add a wrapper command to the packet\n")); // I still have a drinking problem. + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::BeginBigCommandPacketList - failed to add a wrapper command to the packet")); // I still have a drinking problem. } packetList.push_back(packet); @@ -822,7 +822,7 @@ void NetPacket::FillBufferWithGameCommand(UnsignedByte *buffer, NetCommandRef *m // get the game message from the NetCommandMsg GameMessage *gmsg = cmdMsg->constructGameMessage(); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::FillBufferWithGameCommand for command ID %d\n", cmdMsg->getID())); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::FillBufferWithGameCommand for command ID %d", cmdMsg->getID())); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -929,7 +929,7 @@ void NetPacket::FillBufferWithGameCommand(UnsignedByte *buffer, NetCommandRef *m deleteInstance(parser); parser = NULL; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addGameMessage - added game message, frame %d, player %d, command ID %d\n", m_lastFrame, m_lastPlayerID, m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addGameMessage - added game message, frame %d, player %d, command ID %d", m_lastFrame, m_lastPlayerID, m_lastCommandID)); if (gmsg) deleteInstance(gmsg); @@ -937,7 +937,7 @@ void NetPacket::FillBufferWithGameCommand(UnsignedByte *buffer, NetCommandRef *m } void NetPacket::FillBufferWithAckCommand(UnsignedByte *buffer, NetCommandRef *msg) { -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::FillBufferWithAckCommand - adding ack for command %d for player %d\n", cmdMsg->getCommandID(), msg->getCommand()->getPlayerID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::FillBufferWithAckCommand - adding ack for command %d for player %d", cmdMsg->getCommandID(), msg->getCommand()->getPlayerID())); NetCommandMsg *cmdMsg = msg->getCommand(); UnsignedShort offset = 0; @@ -977,13 +977,13 @@ void NetPacket::FillBufferWithAckCommand(UnsignedByte *buffer, NetCommandRef *ms memcpy(buffer + offset, &originalPlayerID, sizeof(UnsignedByte)); offset += sizeof(UnsignedByte); - // DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added ACK, original player %d, command id %d\n", origPlayerID, cmdID)); + // DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added ACK, original player %d, command id %d", origPlayerID, cmdID)); } void NetPacket::FillBufferWithFrameCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetFrameCommandMsg *cmdMsg = (NetFrameCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; - // DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addFrameCommand - adding frame command for frame %d, command count = %d, command id = %d\n", cmdMsg->getExecutionFrame(), cmdMsg->getCommandCount(), cmdMsg->getID())); + // DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addFrameCommand - adding frame command for frame %d, command count = %d, command id = %d", cmdMsg->getExecutionFrame(), cmdMsg->getCommandCount(), cmdMsg->getID())); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1021,7 +1021,7 @@ void NetPacket::FillBufferWithFrameCommand(UnsignedByte *buffer, NetCommandRef * memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1030,13 +1030,13 @@ void NetPacket::FillBufferWithFrameCommand(UnsignedByte *buffer, NetCommandRef * offset += sizeof(UnsignedShort); // frameinfodebug -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added frame %d, player %d, command count = %d, command id = %d\n", cmdMsg->getExecutionFrame(), cmdMsg->getPlayerID(), cmdMsg->getCommandCount(), cmdMsg->getID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added frame %d, player %d, command count = %d, command id = %d", cmdMsg->getExecutionFrame(), cmdMsg->getPlayerID(), cmdMsg->getCommandCount(), cmdMsg->getID())); } void NetPacket::FillBufferWithPlayerLeaveCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetPlayerLeaveCommandMsg *cmdMsg = (NetPlayerLeaveCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPlayerLeaveCommand - adding player leave command for player %d\n", cmdMsg->getLeavingPlayerID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPlayerLeaveCommand - adding player leave command for player %d", cmdMsg->getLeavingPlayerID())); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1074,7 +1074,7 @@ void NetPacket::FillBufferWithPlayerLeaveCommand(UnsignedByte *buffer, NetComman memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1086,7 +1086,7 @@ void NetPacket::FillBufferWithPlayerLeaveCommand(UnsignedByte *buffer, NetComman void NetPacket::FillBufferWithRunAheadMetricsCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetRunAheadMetricsCommandMsg *cmdMsg = (NetRunAheadMetricsCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadMetricsCommand - adding run ahead metrics for player %d, fps = %d, latency = %f\n", cmdMsg->getPlayerID(), cmdMsg->getAverageFps(), cmdMsg->getAverageLatency())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadMetricsCommand - adding run ahead metrics for player %d, fps = %d, latency = %f", cmdMsg->getPlayerID(), cmdMsg->getAverageFps(), cmdMsg->getAverageLatency())); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1117,7 +1117,7 @@ void NetPacket::FillBufferWithRunAheadMetricsCommand(UnsignedByte *buffer, NetCo memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1134,7 +1134,7 @@ void NetPacket::FillBufferWithRunAheadMetricsCommand(UnsignedByte *buffer, NetCo void NetPacket::FillBufferWithRunAheadCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetRunAheadCommandMsg *cmdMsg = (NetRunAheadCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::FillBufferWithRunAheadCommand - adding run ahead command\n")); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::FillBufferWithRunAheadCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1172,7 +1172,7 @@ void NetPacket::FillBufferWithRunAheadCommand(UnsignedByte *buffer, NetCommandRe memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1184,13 +1184,13 @@ void NetPacket::FillBufferWithRunAheadCommand(UnsignedByte *buffer, NetCommandRe memcpy(buffer + offset, &newFrameRate, sizeof(UnsignedByte)); offset += sizeof(UnsignedByte); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added run ahead command, frame %d, player id %d command id %d\n", m_lastFrame, m_lastPlayerID, m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added run ahead command, frame %d, player id %d command id %d", m_lastFrame, m_lastPlayerID, m_lastCommandID)); } void NetPacket::FillBufferWithDestroyPlayerCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetDestroyPlayerCommandMsg *cmdMsg = (NetDestroyPlayerCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1228,7 +1228,7 @@ void NetPacket::FillBufferWithDestroyPlayerCommand(UnsignedByte *buffer, NetComm memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1293,7 +1293,7 @@ void NetPacket::FillBufferWithDisconnectKeepAliveCommand(UnsignedByte *buffer, N void NetPacket::FillBufferWithDisconnectPlayerCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetDisconnectPlayerCommandMsg *cmdMsg = (NetDisconnectPlayerCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1324,7 +1324,7 @@ void NetPacket::FillBufferWithDisconnectPlayerCommand(UnsignedByte *buffer, NetC memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); - // DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); + // DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1340,7 +1340,7 @@ void NetPacket::FillBufferWithDisconnectPlayerCommand(UnsignedByte *buffer, NetC void NetPacket::FillBufferWithPacketRouterQueryCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetPacketRouterQueryCommandMsg *cmdMsg = (NetPacketRouterQueryCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterQueryCommand - adding packet router query command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterQueryCommand - adding packet router query command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1370,7 +1370,7 @@ void NetPacket::FillBufferWithPacketRouterQueryCommand(UnsignedByte *buffer, Net void NetPacket::FillBufferWithPacketRouterAckCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetPacketRouterAckCommandMsg *cmdMsg = (NetPacketRouterAckCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterAckCommand - adding packet router query command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterAckCommand - adding packet router query command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1401,7 +1401,7 @@ void NetPacket::FillBufferWithPacketRouterAckCommand(UnsignedByte *buffer, NetCo void NetPacket::FillBufferWithDisconnectChatCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetDisconnectChatCommandMsg *cmdMsg = (NetDisconnectChatCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1439,7 +1439,7 @@ void NetPacket::FillBufferWithDisconnectChatCommand(UnsignedByte *buffer, NetCom void NetPacket::FillBufferWithDisconnectVoteCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetDisconnectVoteCommandMsg *cmdMsg = (NetDisconnectVoteCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1470,7 +1470,7 @@ void NetPacket::FillBufferWithDisconnectVoteCommand(UnsignedByte *buffer, NetCom memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -1486,7 +1486,7 @@ void NetPacket::FillBufferWithDisconnectVoteCommand(UnsignedByte *buffer, NetCom void NetPacket::FillBufferWithChatCommand(UnsignedByte *buffer, NetCommandRef *msg) { NetChatCommandMsg *cmdMsg = (NetChatCommandMsg *)(msg->getCommand()); UnsignedShort offset = 0; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. buffer[offset] = 'T'; @@ -1524,7 +1524,7 @@ void NetPacket::FillBufferWithChatCommand(UnsignedByte *buffer, NetCommandRef *m memcpy(buffer + offset, &newID, sizeof(UnsignedShort)); offset += sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); buffer[offset] = 'D'; ++offset; @@ -2107,7 +2107,7 @@ Bool NetPacket::addFrameResendRequestCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &frameToResend, sizeof(frameToResend)); m_packetLen += sizeof(frameToResend); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addFrameResendRequest - added frame resend request command from player %d for frame %d, command id = %d\n", m_lastPlayerID, frameToResend, m_lastCommandID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addFrameResendRequest - added frame resend request command from player %d for frame %d, command id = %d", m_lastPlayerID, frameToResend, m_lastCommandID)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -2218,7 +2218,7 @@ Bool NetPacket::addDisconnectScreenOffCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &newFrame, sizeof(newFrame)); m_packetLen += sizeof(newFrame); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectScreenOff - added disconnect screen off command from player %d for frame %d, command id = %d\n", m_lastPlayerID, newFrame, m_lastCommandID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectScreenOff - added disconnect screen off command from player %d for frame %d, command id = %d", m_lastPlayerID, newFrame, m_lastCommandID)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -2337,7 +2337,7 @@ Bool NetPacket::addDisconnectFrameCommand(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectFrame - added disconnect frame command from player %d for frame %d, command id = %d\n", m_lastPlayerID, disconnectFrame, m_lastCommandID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectFrame - added disconnect frame command from player %d for frame %d, command id = %d", m_lastPlayerID, disconnectFrame, m_lastCommandID)); return TRUE; } @@ -2550,11 +2550,11 @@ Bool NetPacket::addFileAnnounceCommand(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Adding file announce message for fileID %d, ID %d to packet\n", + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Adding file announce message for fileID %d, ID %d to packet", cmdMsg->getFileID(), cmdMsg->getID())); return TRUE; } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("No room to add file announce message to packet\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("No room to add file announce message to packet")); return FALSE; } @@ -2886,7 +2886,7 @@ Bool NetPacket::addTimeOutGameStartMessage(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.")); return TRUE; } @@ -2980,7 +2980,7 @@ Bool NetPacket::addLoadCompleteMessage(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.")); return TRUE; } @@ -3066,7 +3066,7 @@ Bool NetPacket::addProgressMessage(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.")); return TRUE; } @@ -3104,11 +3104,11 @@ Bool NetPacket::isRoomForProgressMessage(NetCommandRef *msg) { Bool NetPacket::addDisconnectVoteCommand(NetCommandRef *msg) { Bool needNewCommandID = FALSE; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - entering...\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - entering...")); // need type, player id, relay, command id, slot number if (isRoomForDisconnectVoteMessage(msg)) { NetDisconnectVoteCommandMsg *cmdMsg = (NetDisconnectVoteCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3155,7 +3155,7 @@ Bool NetPacket::addDisconnectVoteCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -3167,7 +3167,7 @@ Bool NetPacket::addDisconnectVoteCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &voteFrame, sizeof(voteFrame)); m_packetLen += sizeof(voteFrame); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - added disconnect vote command, player id %d command id %d, voted slot %d\n", m_lastPlayerID, m_lastCommandID, slot)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectVoteCommand - added disconnect vote command, player id %d command id %d, voted slot %d", m_lastPlayerID, m_lastCommandID, slot)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -3217,10 +3217,10 @@ Bool NetPacket::isRoomForDisconnectVoteMessage(NetCommandRef *msg) { Bool NetPacket::addDisconnectChatCommand(NetCommandRef *msg) { // type, player, id, relay, data // data format: 1 byte string length, string (two bytes per character) -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - Entering...\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - Entering...")); if (isRoomForDisconnectChatMessage(msg)) { NetDisconnectChatCommandMsg *cmdMsg = (NetDisconnectChatCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3266,7 +3266,7 @@ Bool NetPacket::addDisconnectChatCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, unitext.str(), length * sizeof(UnsignedShort)); m_packetLen += length * sizeof(UnsignedShort); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added disconnect chat command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added disconnect chat command")); ++m_numCommands; if (m_lastCommand != NULL) { @@ -3309,7 +3309,7 @@ Bool NetPacket::addChatCommand(NetCommandRef *msg) { Bool needNewCommandID = FALSE; if (isRoomForChatMessage(msg)) { NetChatCommandMsg *cmdMsg = (NetChatCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectChatCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3367,7 +3367,7 @@ Bool NetPacket::addChatCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -3383,7 +3383,7 @@ Bool NetPacket::addChatCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &playerMask, sizeof(Int)); m_packetLen += sizeof(Int); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added chat command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added chat command")); ++m_numCommands; if (m_lastCommand != NULL) { @@ -3435,7 +3435,7 @@ Bool NetPacket::addPacketRouterAckCommand(NetCommandRef *msg) { // need type, player id, relay, command id, slot number if (isRoomForPacketRouterAckMessage(msg)) { NetPacketRouterAckCommandMsg *cmdMsg = (NetPacketRouterAckCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterAckCommand - adding packet router query command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterAckCommand - adding packet router query command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3474,7 +3474,7 @@ Bool NetPacket::addPacketRouterAckCommand(NetCommandRef *msg) { m_packet[m_packetLen] = 'D'; ++m_packetLen; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added packet router ack command, player id %d\n", m_lastPlayerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added packet router ack command, player id %d", m_lastPlayerID)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -3517,7 +3517,7 @@ Bool NetPacket::addPacketRouterQueryCommand(NetCommandRef *msg) { // need type, player id, relay, command id, slot number if (isRoomForPacketRouterQueryMessage(msg)) { NetPacketRouterQueryCommandMsg *cmdMsg = (NetPacketRouterQueryCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterQueryCommand - adding packet router query command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPacketRouterQueryCommand - adding packet router query command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3556,7 +3556,7 @@ Bool NetPacket::addPacketRouterQueryCommand(NetCommandRef *msg) { m_packet[m_packetLen] = 'D'; ++m_packetLen; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added packet router query command, player id %d\n", m_lastPlayerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added packet router query command, player id %d", m_lastPlayerID)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -3598,11 +3598,11 @@ Bool NetPacket::isRoomForPacketRouterQueryMessage(NetCommandRef *msg) { Bool NetPacket::addDisconnectPlayerCommand(NetCommandRef *msg) { Bool needNewCommandID = FALSE; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - entering...\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - entering...")); // need type, player id, relay, command id, slot number if (isRoomForDisconnectPlayerMessage(msg)) { NetDisconnectPlayerCommandMsg *cmdMsg = (NetDisconnectPlayerCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - adding run ahead command\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3649,7 +3649,7 @@ Bool NetPacket::addDisconnectPlayerCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -3661,7 +3661,7 @@ Bool NetPacket::addDisconnectPlayerCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &disconnectFrame, sizeof(disconnectFrame)); m_packetLen += sizeof(disconnectFrame); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - added disconnect player command, player id %d command id %d, disconnecting slot %d\n", m_lastPlayerID, m_lastCommandID, slot)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addDisconnectPlayerCommand - added disconnect player command, player id %d command id %d, disconnecting slot %d", m_lastPlayerID, m_lastCommandID, slot)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -3756,7 +3756,7 @@ Bool NetPacket::addDisconnectKeepAliveCommand(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.")); return TRUE; } @@ -3836,7 +3836,7 @@ Bool NetPacket::addKeepAliveCommand(NetCommandRef *msg) { m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Added keep alive command to packet.")); return TRUE; } @@ -3875,7 +3875,7 @@ Bool NetPacket::addRunAheadCommand(NetCommandRef *msg) { Bool needNewCommandID = FALSE; if (isRoomForRunAheadMessage(msg)) { NetRunAheadCommandMsg *cmdMsg = (NetRunAheadCommandMsg *)(msg->getCommand()); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadCommand - adding run ahead command\n")); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadCommand - adding run ahead command")); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -3933,7 +3933,7 @@ Bool NetPacket::addRunAheadCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -3945,7 +3945,7 @@ Bool NetPacket::addRunAheadCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &newFrameRate, sizeof(UnsignedByte)); m_packetLen += sizeof(UnsignedByte); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added run ahead command, frame %d, player id %d command id %d\n", m_lastFrame, m_lastPlayerID, m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added run ahead command, frame %d, player id %d command id %d", m_lastFrame, m_lastPlayerID, m_lastCommandID)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -4058,7 +4058,7 @@ Bool NetPacket::addDestroyPlayerCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -4066,7 +4066,7 @@ Bool NetPacket::addDestroyPlayerCommand(NetCommandRef *msg) { memcpy(m_packet + m_packetLen, &newVal, sizeof(UnsignedInt)); m_packetLen += sizeof(UnsignedInt); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added CRC:0x%8.8X info command, frame %d, player id %d command id %d\n", newCRC, m_lastFrame, m_lastPlayerID, m_lastCommandID)); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket - added CRC:0x%8.8X info command, frame %d, player id %d command id %d", newCRC, m_lastFrame, m_lastPlayerID, m_lastCommandID)); ++m_numCommands; if (m_lastCommand != NULL) { @@ -4121,7 +4121,7 @@ Bool NetPacket::addRunAheadMetricsCommand(NetCommandRef *msg) { Bool needNewCommandID = FALSE; if (isRoomForRunAheadMetricsMessage(msg)) { NetRunAheadMetricsCommandMsg *cmdMsg = (NetRunAheadMetricsCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadMetricsCommand - adding run ahead metrics for player %d, fps = %d, latency = %f\n", cmdMsg->getPlayerID(), cmdMsg->getAverageFps(), cmdMsg->getAverageLatency())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addRunAheadMetricsCommand - adding run ahead metrics for player %d, fps = %d, latency = %f", cmdMsg->getPlayerID(), cmdMsg->getAverageFps(), cmdMsg->getAverageLatency())); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -4168,7 +4168,7 @@ Bool NetPacket::addRunAheadMetricsCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -4234,7 +4234,7 @@ Bool NetPacket::addPlayerLeaveCommand(NetCommandRef *msg) { Bool needNewCommandID = FALSE; if (isRoomForPlayerLeaveMessage(msg)) { NetPlayerLeaveCommandMsg *cmdMsg = (NetPlayerLeaveCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPlayerLeaveCommand - adding player leave command for player %d\n", cmdMsg->getLeavingPlayerID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addPlayerLeaveCommand - adding player leave command for player %d", cmdMsg->getLeavingPlayerID())); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -4292,7 +4292,7 @@ Bool NetPacket::addPlayerLeaveCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -4365,12 +4365,12 @@ Bool NetPacket::addFrameCommand(NetCommandRef *msg) { ++m_lastFrame; // need this cause we're actually advancing to the next frame by adding this command. ++m_numCommands; // frameinfodebug -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added frame %d, player %d, command count = %d, command id = %d, repeat\n", m_lastFrame, m_lastPlayerID, 0, m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added frame %d, player %d, command count = %d, command id = %d, repeat", m_lastFrame, m_lastPlayerID, 0, m_lastCommandID)); return TRUE; } if (isRoomForFrameMessage(msg)) { NetFrameCommandMsg *cmdMsg = (NetFrameCommandMsg *)(msg->getCommand()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addFrameCommand - adding frame command for frame %d, command count = %d, command id = %d\n", cmdMsg->getExecutionFrame(), cmdMsg->getCommandCount(), cmdMsg->getID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addFrameCommand - adding frame command for frame %d, command count = %d, command id = %d", cmdMsg->getExecutionFrame(), cmdMsg->getCommandCount(), cmdMsg->getID())); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { @@ -4428,7 +4428,7 @@ Bool NetPacket::addFrameCommand(NetCommandRef *msg) { } m_lastCommandID = cmdMsg->getID(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d\n", m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command id = %d", m_lastCommandID)); m_packet[m_packetLen] = 'D'; ++m_packetLen; @@ -4437,7 +4437,7 @@ Bool NetPacket::addFrameCommand(NetCommandRef *msg) { m_packetLen += sizeof(UnsignedShort); // frameinfodebug -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added frame %d, player %d, command count = %d, command id = %d\n", cmdMsg->getExecutionFrame(), cmdMsg->getPlayerID(), cmdMsg->getCommandCount(), cmdMsg->getID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added frame %d, player %d, command count = %d, command id = %d", cmdMsg->getExecutionFrame(), cmdMsg->getPlayerID(), cmdMsg->getCommandCount(), cmdMsg->getID())); if (m_lastCommand != NULL) { deleteInstance(m_lastCommand); @@ -4554,7 +4554,7 @@ Bool NetPacket::addAckCommand(NetCommandRef *msg, UnsignedShort commandID, Unsig } if (isRoomForAckMessage(msg)) { NetCommandMsg *cmdMsg = msg->getCommand(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addAckCommand - adding ack for command %d for player %d\n", cmdMsg->getCommandID(), msg->getCommand()->getPlayerID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addAckCommand - adding ack for command %d for player %d", cmdMsg->getCommandID(), msg->getCommand()->getPlayerID())); // If necessary, put the NetCommandType into the packet. if (m_lastCommandType != cmdMsg->getNetCommandType()) { m_packet[m_packetLen] = 'T'; @@ -4589,7 +4589,7 @@ Bool NetPacket::addAckCommand(NetCommandRef *msg, UnsignedShort commandID, Unsig m_lastCommand = NEW_NETCOMMANDREF(msg->getCommand()); m_lastCommand->setRelay(msg->getRelay()); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added ACK, original player %d, command id %d\n", origPlayerID, cmdID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("outgoing - added ACK, original player %d, command id %d", origPlayerID, cmdID)); ++m_numCommands; return TRUE; } @@ -4693,7 +4693,7 @@ Bool NetPacket::addGameCommand(NetCommandRef *msg) { // get the game message from the NetCommandMsg GameMessage *gmsg = cmdMsg->constructGameMessage(); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addGameCommand for command ID %d\n", cmdMsg->getID())); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addGameCommand for command ID %d", cmdMsg->getID())); if (isRoomForGameMessage(msg, gmsg)) { // Now we know there is enough room, put the new game message into the packet. @@ -4791,7 +4791,7 @@ Bool NetPacket::addGameCommand(NetCommandRef *msg) { deleteInstance(parser); parser = NULL; -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addGameMessage - added game message, frame %d, player %d, command ID %d\n", m_lastFrame, m_lastPlayerID, m_lastCommandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::addGameMessage - added game message, frame %d, player %d, command ID %d", m_lastFrame, m_lastPlayerID, m_lastCommandID)); ++m_numCommands; @@ -4929,7 +4929,7 @@ Bool NetPacket::isRoomForGameMessage(NetCommandRef *msg, GameMessage *gmsg) { */ NetCommandList * NetPacket::getCommandList() { NetCommandList *retval = newInstance(NetCommandList); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList, packet length = %d\n", m_packetLen)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList, packet length = %d", m_packetLen)); retval->init(); // These need to be the same as the default values for m_lastPlayerID, m_lastFrame, etc. @@ -4967,13 +4967,13 @@ NetCommandList * NetPacket::getCommandList() { NetCommandMsg *msg = NULL; - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList() - command of type %d(%s)\n", commandType, GetAsciiNetCommandType((NetCommandType)commandType).str())); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList() - command of type %d(%s)", commandType, GetAsciiNetCommandType((NetCommandType)commandType).str())); switch((NetCommandType)commandType) { case NETCOMMANDTYPE_GAMECOMMAND: msg = readGameMessage(m_packet, i); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read game command from player %d for frame %d\n", playerID, frame)); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read game command from player %d for frame %d", playerID, frame)); break; case NETCOMMANDTYPE_ACKBOTH: msg = readAckBothMessage(m_packet, i); @@ -4987,95 +4987,95 @@ NetCommandList * NetPacket::getCommandList() { case NETCOMMANDTYPE_FRAMEINFO: msg = readFrameMessage(m_packet, i); // frameinfodebug - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read frame %d from player %d, command count = %d, relay = 0x%X\n", frame, playerID, ((NetFrameCommandMsg *)msg)->getCommandCount(), relay)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read frame %d from player %d, command count = %d, relay = 0x%X", frame, playerID, ((NetFrameCommandMsg *)msg)->getCommandCount(), relay)); break; case NETCOMMANDTYPE_PLAYERLEAVE: msg = readPlayerLeaveMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read player leave message from player %d for execution on frame %d\n", playerID, frame)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read player leave message from player %d for execution on frame %d", playerID, frame)); break; case NETCOMMANDTYPE_RUNAHEADMETRICS: msg = readRunAheadMetricsMessage(m_packet, i); break; case NETCOMMANDTYPE_RUNAHEAD: msg = readRunAheadMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read run ahead message from player %d for execution on frame %d\n", playerID, frame)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read run ahead message from player %d for execution on frame %d", playerID, frame)); break; case NETCOMMANDTYPE_DESTROYPLAYER: msg = readDestroyPlayerMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read CRC info message from player %d for execution on frame %d\n", playerID, frame)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read CRC info message from player %d for execution on frame %d", playerID, frame)); break; case NETCOMMANDTYPE_KEEPALIVE: msg = readKeepAliveMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read keep alive message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read keep alive message from player %d", playerID)); break; case NETCOMMANDTYPE_DISCONNECTKEEPALIVE: msg = readDisconnectKeepAliveMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read keep alive message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read keep alive message from player %d", playerID)); break; case NETCOMMANDTYPE_DISCONNECTPLAYER: msg = readDisconnectPlayerMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect player message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect player message from player %d", playerID)); break; case NETCOMMANDTYPE_PACKETROUTERQUERY: msg = readPacketRouterQueryMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read packet router query message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read packet router query message from player %d", playerID)); break; case NETCOMMANDTYPE_PACKETROUTERACK: msg = readPacketRouterAckMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read packet router ack message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read packet router ack message from player %d", playerID)); break; case NETCOMMANDTYPE_DISCONNECTCHAT: msg = readDisconnectChatMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect chat message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect chat message from player %d", playerID)); break; case NETCOMMANDTYPE_DISCONNECTVOTE: msg = readDisconnectVoteMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect vote message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect vote message from player %d", playerID)); break; case NETCOMMANDTYPE_CHAT: msg = readChatMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read chat message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read chat message from player %d", playerID)); break; case NETCOMMANDTYPE_PROGRESS: msg = readProgressMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read Progress message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read Progress message from player %d", playerID)); break; case NETCOMMANDTYPE_LOADCOMPLETE: msg = readLoadCompleteMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read LoadComplete message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read LoadComplete message from player %d", playerID)); break; case NETCOMMANDTYPE_TIMEOUTSTART: msg = readTimeOutGameStartMessage(m_packet, i); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read TimeOutGameStart message from player %d\n", playerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read TimeOutGameStart message from player %d", playerID)); break; case NETCOMMANDTYPE_WRAPPER: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read Wrapper message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read Wrapper message from player %d", playerID)); msg = readWrapperMessage(m_packet, i); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Done reading Wrapper message from player %d - wrapped command was %d\n", playerID, + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Done reading Wrapper message from player %d - wrapped command was %d", playerID, ((NetWrapperCommandMsg *)msg)->getWrappedCommandID())); break; case NETCOMMANDTYPE_FILE: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read file message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read file message from player %d", playerID)); msg = readFileMessage(m_packet, i); break; case NETCOMMANDTYPE_FILEANNOUNCE: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read file announce message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read file announce message from player %d", playerID)); msg = readFileAnnounceMessage(m_packet, i); break; case NETCOMMANDTYPE_FILEPROGRESS: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read file progress message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read file progress message from player %d", playerID)); msg = readFileProgressMessage(m_packet, i); break; case NETCOMMANDTYPE_DISCONNECTFRAME: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect frame message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect frame message from player %d", playerID)); msg = readDisconnectFrameMessage(m_packet, i); break; case NETCOMMANDTYPE_DISCONNECTSCREENOFF: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect screen off message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read disconnect screen off message from player %d", playerID)); msg = readDisconnectScreenOffMessage(m_packet, i); break; case NETCOMMANDTYPE_FRAMERESENDREQUEST: - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read frame resend request message from player %d\n", playerID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("read frame resend request message from player %d", playerID)); msg = readFrameResendRequestMessage(m_packet, i); break; } @@ -5091,7 +5091,7 @@ NetCommandList * NetPacket::getCommandList() { msg->setNetCommandType((NetCommandType)commandType); msg->setID(commandID); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("frame = %d, player = %d, command type = %d, id = %d\n", frame, playerID, commandType, commandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("frame = %d, player = %d, command type = %d, id = %d", frame, playerID, commandType, commandID)); // increment to the next command ID. if (DoesCommandRequireACommandID((NetCommandType)commandType)) { @@ -5103,7 +5103,7 @@ NetCommandList * NetPacket::getCommandList() { if (ref != NULL) { ref->setRelay(relay); } else { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList - failed to set relay for message %d\n", msg->getID())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList - failed to set relay for message %d", msg->getID())); } if (lastCommand != NULL) { @@ -5142,7 +5142,7 @@ NetCommandList * NetPacket::getCommandList() { msg = newInstance(NetFrameCommandMsg)(); ++frame; // this is set below. ((NetFrameCommandMsg *)msg)->setCommandCount(0); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Read a repeated frame command, frame = %d, player = %d, commandID = %d\n", frame, playerID, commandID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Read a repeated frame command, frame = %d, player = %d, commandID = %d", frame, playerID, commandID)); } else { DEBUG_CRASH(("Trying to repeat a command that shouldn't be repeated.")); continue; @@ -5153,7 +5153,7 @@ NetCommandList * NetPacket::getCommandList() { msg->setNetCommandType((NetCommandType)commandType); msg->setID(commandID); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("frame = %d, player = %d, command type = %d, id = %d\n", frame, playerID, commandType, commandID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("frame = %d, player = %d, command type = %d, id = %d", frame, playerID, commandType, commandID)); // increment to the next command ID. if (DoesCommandRequireACommandID((NetCommandType)commandType)) { @@ -5178,7 +5178,7 @@ NetCommandList * NetPacket::getCommandList() { } else { // we don't recognize this command, but we have to increment i so we don't fall into an infinite loop. DEBUG_CRASH(("Unrecognized packet entry, ignoring.")); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList - Unrecognized packet entry at index %d\n", i)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::getCommandList - Unrecognized packet entry at index %d", i)); dumpPacketToLog(); ++i; } @@ -5198,7 +5198,7 @@ NetCommandMsg * NetPacket::readGameMessage(UnsignedByte *data, Int &i) { NetGameCommandMsg *msg = newInstance(NetGameCommandMsg); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readGameMessage\n")); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readGameMessage")); // Get the GameMessage command type. GameMessage::Type newType; @@ -5359,7 +5359,7 @@ NetCommandMsg * NetPacket::readAckBothMessage(UnsignedByte *data, Int &i) { memcpy(&origPlayerID, data + i, sizeof(UnsignedByte)); i += sizeof(UnsignedByte); msg->setOriginalPlayerID(origPlayerID); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("original player id = %d\n", origPlayerID)); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("original player id = %d", origPlayerID)); return msg; } @@ -5382,7 +5382,7 @@ NetCommandMsg * NetPacket::readAckStage1Message(UnsignedByte *data, Int &i) { memcpy(&origPlayerID, data + i, sizeof(UnsignedByte)); i += sizeof(UnsignedByte); msg->setOriginalPlayerID(origPlayerID); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("original player id = %d\n", origPlayerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("original player id = %d", origPlayerID)); return msg; } @@ -5405,7 +5405,7 @@ NetCommandMsg * NetPacket::readAckStage2Message(UnsignedByte *data, Int &i) { memcpy(&origPlayerID, data + i, sizeof(UnsignedByte)); i += sizeof(UnsignedByte); msg->setOriginalPlayerID(origPlayerID); -// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("original player id = %d\n", origPlayerID)); +// DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("original player id = %d", origPlayerID)); return msg; } @@ -5490,7 +5490,7 @@ NetCommandMsg * NetPacket::readDestroyPlayerMessage(UnsignedByte *data, Int &i) memcpy(&newVal, data + i, sizeof(UnsignedInt)); i += sizeof(UnsignedInt); msg->setPlayerIndex(newVal); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Saw CRC of 0x%8.8X\n", newCRC)); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("Saw CRC of 0x%8.8X", newCRC)); return msg; } @@ -5567,7 +5567,7 @@ NetCommandMsg * NetPacket::readDisconnectChatMessage(UnsignedByte *data, Int &i) UnicodeString unitext; unitext.set(text); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readDisconnectChatMessage - read message, message is %ls\n", unitext.str())); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readDisconnectChatMessage - read message, message is %ls", unitext.str())); msg->setText(unitext); return msg; @@ -5594,7 +5594,7 @@ NetCommandMsg * NetPacket::readChatMessage(UnsignedByte *data, Int &i) { UnicodeString unitext; unitext.set(text); - //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readChatMessage - read message, message is %ls\n", unitext.str())); + //DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readChatMessage - read message, message is %ls", unitext.str())); msg->setText(unitext); msg->setPlayerMask(playerMask); @@ -5652,40 +5652,40 @@ NetCommandMsg * NetPacket::readWrapperMessage(UnsignedByte *data, Int &i) { memcpy(&wrappedCommandID, data + i, sizeof(wrappedCommandID)); msg->setWrappedCommandID(wrappedCommandID); i += sizeof(wrappedCommandID); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - wrapped command ID == %d\n", wrappedCommandID)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - wrapped command ID == %d", wrappedCommandID)); // get the chunk number. UnsignedInt chunkNumber = 0; memcpy(&chunkNumber, data + i, sizeof(chunkNumber)); msg->setChunkNumber(chunkNumber); i += sizeof(chunkNumber); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - chunk number = %d\n", chunkNumber)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - chunk number = %d", chunkNumber)); // get the number of chunks UnsignedInt numChunks = 0; memcpy(&numChunks, data + i, sizeof(numChunks)); msg->setNumChunks(numChunks); i += sizeof(numChunks); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - number of chunks = %d\n", numChunks)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - number of chunks = %d", numChunks)); // get the total data length UnsignedInt totalDataLength = 0; memcpy(&totalDataLength, data + i, sizeof(totalDataLength)); msg->setTotalDataLength(totalDataLength); i += sizeof(totalDataLength); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - total data length = %d\n", totalDataLength)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - total data length = %d", totalDataLength)); // get the data length for this chunk UnsignedInt dataLength = 0; memcpy(&dataLength, data + i, sizeof(dataLength)); i += sizeof(dataLength); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - data length = %d\n", dataLength)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - data length = %d", dataLength)); UnsignedInt dataOffset = 0; memcpy(&dataOffset, data + i, sizeof(dataOffset)); msg->setDataOffset(dataOffset); i += sizeof(dataOffset); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - data offset = %d\n", dataOffset)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readWrapperMessage - data offset = %d", dataOffset)); msg->setData(data + i, dataLength); i += dataLength; @@ -5771,7 +5771,7 @@ NetCommandMsg * NetPacket::readDisconnectFrameMessage(UnsignedByte *data, Int &i i += sizeof(disconnectFrame); msg->setDisconnectFrame(disconnectFrame); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readDisconnectFrameMessage - read disconnect frame for frame %d\n", disconnectFrame)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::readDisconnectFrameMessage - read disconnect frame for frame %d", disconnectFrame)); return msg; } @@ -5837,7 +5837,7 @@ Int NetPacket::getLength() { * Dumps the packet to the debug log file */ void NetPacket::dumpPacketToLog() { - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::dumpPacketToLog() - packet is %d bytes\n", m_packetLen)); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("NetPacket::dumpPacketToLog() - packet is %d bytes", m_packetLen)); Int numLines = m_packetLen / 8; if ((m_packetLen % 8) != 0) { ++numLines; @@ -5847,7 +5847,7 @@ void NetPacket::dumpPacketToLog() { for (Int dumpindex2 = 0; (dumpindex2 < 8) && ((dumpindex*8 + dumpindex2) < m_packetLen); ++dumpindex2) { DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%02x '%c' ", m_packet[dumpindex*8 + dumpindex2], m_packet[dumpindex*8 + dumpindex2])); } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("")); } - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("End of packet dump\n")); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("End of packet dump")); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/Network.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/Network.cpp index b24f5e7c46..957b84b952 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/Network.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/Network.cpp @@ -320,7 +320,7 @@ void Network::init() { if (!deinit()) { - DEBUG_LOG(("Could not deinit network prior to init!\n")); + DEBUG_LOG(("Could not deinit network prior to init!")); return; } @@ -342,19 +342,19 @@ void Network::init() m_sawCRCMismatch = FALSE; m_checkCRCsThisFrame = FALSE; - DEBUG_LOG(("Network timing values:\n")); - DEBUG_LOG(("NetworkFPSHistoryLength: %d\n", TheGlobalData->m_networkFPSHistoryLength)); - DEBUG_LOG(("NetworkLatencyHistoryLength: %d\n", TheGlobalData->m_networkLatencyHistoryLength)); - DEBUG_LOG(("NetworkRunAheadMetricsTime: %d\n", TheGlobalData->m_networkRunAheadMetricsTime)); - DEBUG_LOG(("NetworkCushionHistoryLength: %d\n", TheGlobalData->m_networkCushionHistoryLength)); - DEBUG_LOG(("NetworkRunAheadSlack: %d\n", TheGlobalData->m_networkRunAheadSlack)); - DEBUG_LOG(("NetworkKeepAliveDelay: %d\n", TheGlobalData->m_networkKeepAliveDelay)); - DEBUG_LOG(("NetworkDisconnectTime: %d\n", TheGlobalData->m_networkDisconnectTime)); - DEBUG_LOG(("NetworkPlayerTimeoutTime: %d\n", TheGlobalData->m_networkPlayerTimeoutTime)); - DEBUG_LOG(("NetworkDisconnectScreenNotifyTime: %d\n", TheGlobalData->m_networkDisconnectScreenNotifyTime)); - DEBUG_LOG(("Other network stuff:\n")); - DEBUG_LOG(("FRAME_DATA_LENGTH = %d\n", FRAME_DATA_LENGTH)); - DEBUG_LOG(("FRAMES_TO_KEEP = %d\n", FRAMES_TO_KEEP)); + DEBUG_LOG(("Network timing values:")); + DEBUG_LOG(("NetworkFPSHistoryLength: %d", TheGlobalData->m_networkFPSHistoryLength)); + DEBUG_LOG(("NetworkLatencyHistoryLength: %d", TheGlobalData->m_networkLatencyHistoryLength)); + DEBUG_LOG(("NetworkRunAheadMetricsTime: %d", TheGlobalData->m_networkRunAheadMetricsTime)); + DEBUG_LOG(("NetworkCushionHistoryLength: %d", TheGlobalData->m_networkCushionHistoryLength)); + DEBUG_LOG(("NetworkRunAheadSlack: %d", TheGlobalData->m_networkRunAheadSlack)); + DEBUG_LOG(("NetworkKeepAliveDelay: %d", TheGlobalData->m_networkKeepAliveDelay)); + DEBUG_LOG(("NetworkDisconnectTime: %d", TheGlobalData->m_networkDisconnectTime)); + DEBUG_LOG(("NetworkPlayerTimeoutTime: %d", TheGlobalData->m_networkPlayerTimeoutTime)); + DEBUG_LOG(("NetworkDisconnectScreenNotifyTime: %d", TheGlobalData->m_networkDisconnectScreenNotifyTime)); + DEBUG_LOG(("Other network stuff:")); + DEBUG_LOG(("FRAME_DATA_LENGTH = %d", FRAME_DATA_LENGTH)); + DEBUG_LOG(("FRAMES_TO_KEEP = %d", FRAMES_TO_KEEP)); #if defined(RTS_DEBUG) @@ -375,24 +375,24 @@ void Network::setSawCRCMismatch( void ) TheRecorder->logCRCMismatch(); // dump GameLogic random seed - DEBUG_LOG(("Latest frame for mismatch = %d GameLogic frame = %d\n", + DEBUG_LOG(("Latest frame for mismatch = %d GameLogic frame = %d", TheGameLogic->getFrame()-m_runAhead-1, TheGameLogic->getFrame())); - DEBUG_LOG(("GetGameLogicRandomSeedCRC() = %d\n", GetGameLogicRandomSeedCRC())); + DEBUG_LOG(("GetGameLogicRandomSeedCRC() = %d", GetGameLogicRandomSeedCRC())); // dump CRCs { - DEBUG_LOG(("--- GameState Dump ---\n")); + DEBUG_LOG(("--- GameState Dump ---")); #ifdef DEBUG_CRC outputCRCDumpLines(); #endif - DEBUG_LOG(("------ End Dump ------\n")); + DEBUG_LOG(("------ End Dump ------")); } { - DEBUG_LOG(("--- DebugInfo Dump ---\n")); + DEBUG_LOG(("--- DebugInfo Dump ---")); #ifdef DEBUG_CRC outputCRCDebugLines(); #endif - DEBUG_LOG(("------ End Dump ------\n")); + DEBUG_LOG(("------ End Dump ------")); } } @@ -403,7 +403,7 @@ void Network::parseUserList( const GameInfo *game ) { if (!game) { - DEBUG_LOG(("FAILED parseUserList with a NULL game\n")); + DEBUG_LOG(("FAILED parseUserList with a NULL game")); return; } @@ -524,12 +524,12 @@ Bool Network::processCommand(GameMessage *msg) // Send command counts for all the frames we can. for (Int i = m_lastFrameCompleted + 1; i < executionFrame; ++i) { m_conMgr->processFrameTick(i); - //DEBUG_LOG(("Network::processCommand - calling processFrameTick for frame %d\n", i)); + //DEBUG_LOG(("Network::processCommand - calling processFrameTick for frame %d", i)); m_lastFrameCompleted = i; } } - //DEBUG_LOG(("Next Execution Frame - %d, last frame completed - %d\n", getExecutionFrame(), m_lastFrameCompleted)); + //DEBUG_LOG(("Next Execution Frame - %d, last frame completed - %d", getExecutionFrame(), m_lastFrameCompleted)); m_lastFrame = TheGameLogic->getFrame(); } @@ -539,7 +539,7 @@ Bool Network::processCommand(GameMessage *msg) // frame where everyone else is going to see that we left. if ((msg->getType() == GameMessage::MSG_CLEAR_GAME_DATA) && (m_localStatus == NETLOCALSTATUS_INGAME)) { Int executionFrame = getExecutionFrame(); - DEBUG_LOG(("Network::processCommand - local player leaving, executionFrame = %d, player leaving on frame %d\n", executionFrame, executionFrame+1)); + DEBUG_LOG(("Network::processCommand - local player leaving, executionFrame = %d, player leaving on frame %d", executionFrame, executionFrame+1)); m_conMgr->handleLocalPlayerLeaving(executionFrame+1); m_conMgr->processFrameTick(executionFrame); // This is the last command we will execute, so send the command count. @@ -548,7 +548,7 @@ Bool Network::processCommand(GameMessage *msg) // worry about messing up the other players. m_conMgr->processFrameTick(executionFrame+1); // since we send it for executionFrame+1, we need to process both ticks m_lastFrameCompleted = executionFrame; - DEBUG_LOG(("Network::processCommand - player leaving on frame %d\n", executionFrame)); + DEBUG_LOG(("Network::processCommand - player leaving on frame %d", executionFrame)); m_localStatus = NETLOCALSTATUS_LEAVING; return TRUE; } @@ -588,7 +588,7 @@ void Network::RelayCommandsToCommandList(UnsignedInt frame) { while (msg != NULL) { NetCommandType cmdType = msg->getCommand()->getNetCommandType(); if (cmdType == NETCOMMANDTYPE_GAMECOMMAND) { - //DEBUG_LOG(("Network::RelayCommandsToCommandList - appending command %d of type %s to command list on frame %d\n", msg->getCommand()->getID(), ((NetGameCommandMsg *)msg->getCommand())->constructGameMessage()->getCommandAsAsciiString().str(), TheGameLogic->getFrame())); + //DEBUG_LOG(("Network::RelayCommandsToCommandList - appending command %d of type %s to command list on frame %d", msg->getCommand()->getID(), ((NetGameCommandMsg *)msg->getCommand())->constructGameMessage()->getCommandAsAsciiString().str(), TheGameLogic->getFrame())); TheCommandList->appendMessage(((NetGameCommandMsg *)msg->getCommand())->constructGameMessage()); } else { processFrameSynchronizedNetCommand(msg); @@ -617,23 +617,23 @@ void Network::processFrameSynchronizedNetCommand(NetCommandRef *msg) { if (cmdMsg->getNetCommandType() == NETCOMMANDTYPE_PLAYERLEAVE) { PlayerLeaveCode retval = m_conMgr->processPlayerLeave((NetPlayerLeaveCommandMsg *)cmdMsg); if (retval == PLAYERLEAVECODE_LOCAL) { - DEBUG_LOG(("Network::processFrameSynchronizedNetCommand - Local player left the game on frame %d.\n", TheGameLogic->getFrame())); + DEBUG_LOG(("Network::processFrameSynchronizedNetCommand - Local player left the game on frame %d.", TheGameLogic->getFrame())); m_localStatus = NETLOCALSTATUS_LEFT; } else if (retval == PLAYERLEAVECODE_PACKETROUTER) { - DEBUG_LOG(("Network::processFrameSynchronizedNetCommand - Packet router left the game on frame %d\n", TheGameLogic->getFrame())); + DEBUG_LOG(("Network::processFrameSynchronizedNetCommand - Packet router left the game on frame %d", TheGameLogic->getFrame())); } else { - DEBUG_LOG(("Network::processFrameSynchronizedNetCommand - Client left the game on frame %d\n", TheGameLogic->getFrame())); + DEBUG_LOG(("Network::processFrameSynchronizedNetCommand - Client left the game on frame %d", TheGameLogic->getFrame())); } } else if (cmdMsg->getNetCommandType() == NETCOMMANDTYPE_RUNAHEAD) { NetRunAheadCommandMsg *netmsg = (NetRunAheadCommandMsg *)cmdMsg; processRunAheadCommand(netmsg); - DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command to set run ahead to %d and frame rate to %d on frame %d actually executed on frame %d\n", netmsg->getRunAhead(), netmsg->getFrameRate(), netmsg->getExecutionFrame(), TheGameLogic->getFrame())); + DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("command to set run ahead to %d and frame rate to %d on frame %d actually executed on frame %d", netmsg->getRunAhead(), netmsg->getFrameRate(), netmsg->getExecutionFrame(), TheGameLogic->getFrame())); } else if (cmdMsg->getNetCommandType() == NETCOMMANDTYPE_DESTROYPLAYER) { NetDestroyPlayerCommandMsg *netmsg = (NetDestroyPlayerCommandMsg *)cmdMsg; processDestroyPlayerCommand(netmsg); - //DEBUG_LOG(("CRC command (%8.8X) on frame %d actually executed on frame %d\n", netmsg->getCRC(), netmsg->getExecutionFrame(), TheGameLogic->getFrame())); + //DEBUG_LOG(("CRC command (%8.8X) on frame %d actually executed on frame %d", netmsg->getCRC(), netmsg->getExecutionFrame(), TheGameLogic->getFrame())); } } @@ -642,7 +642,7 @@ void Network::processRunAheadCommand(NetRunAheadCommandMsg *msg) { m_frameRate = msg->getFrameRate(); time_t frameGrouping = (1000 * m_runAhead) / m_frameRate; // number of miliseconds between packet sends frameGrouping = frameGrouping / 2; // since we only want the latency for one way to be a factor. -// DEBUG_LOG(("Network::processRunAheadCommand - trying to set frame grouping to %d. run ahead = %d, m_frameRate = %d\n", frameGrouping, m_runAhead, m_frameRate)); +// DEBUG_LOG(("Network::processRunAheadCommand - trying to set frame grouping to %d. run ahead = %d, m_frameRate = %d", frameGrouping, m_runAhead, m_frameRate)); if (frameGrouping < 1) { frameGrouping = 1; // Having a value less than 1 doesn't make sense. } @@ -670,7 +670,7 @@ void Network::processDestroyPlayerCommand(NetDestroyPlayerCommandMsg *msg) TheCommandList->appendMessage(msg); } - DEBUG_LOG(("Saw DestroyPlayer from %d about %d for frame %d on frame %d\n", msg->getPlayerID(), msg->getPlayerIndex(), + DEBUG_LOG(("Saw DestroyPlayer from %d about %d for frame %d on frame %d", msg->getPlayerID(), msg->getPlayerIndex(), msg->getExecutionFrame(), TheGameLogic->getFrame())); } @@ -711,7 +711,7 @@ void Network::update( void ) if (AllCommandsReady(TheGameLogic->getFrame())) { // If all the commands are ready for the next frame... m_conMgr->handleAllCommandsReady(); -// DEBUG_LOG(("Network::update - frame %d is ready\n", TheGameLogic->getFrame())); +// DEBUG_LOG(("Network::update - frame %d is ready", TheGameLogic->getFrame())); if (timeForNewFrame()) { // This needs to come after any other pre-frame execution checks as this changes the timing variables. RelayCommandsToCommandList(TheGameLogic->getFrame()); // Put the commands for the next frame on TheCommandList. m_frameDataReady = TRUE; // Tell the GameEngine to run the commands for the new frame. @@ -743,7 +743,7 @@ void Network::endOfGameCheck() { TheMessageStream->appendMessage(GameMessage::MSG_CLEAR_GAME_DATA); m_localStatus = NETLOCALSTATUS_POSTGAME; - DEBUG_LOG(("Network::endOfGameCheck - about to show the shell\n")); + DEBUG_LOG(("Network::endOfGameCheck - about to show the shell")); } #if defined(RTS_DEBUG) else { @@ -769,31 +769,31 @@ Bool Network::timeForNewFrame() { if (cushion < runAheadPercentage) { // DEBUG_LOG(("Average cushion = %f, run ahead percentage = %f. Adjusting frameDelay from %I64d to ", cushion, runAheadPercentage, frameDelay)); frameDelay += frameDelay / 10; // temporarily decrease the frame rate by 20%. -// DEBUG_LOG(("%I64d\n", frameDelay)); +// DEBUG_LOG(("%I64d", frameDelay)); m_didSelfSlug = TRUE; // } else { -// DEBUG_LOG(("Average cushion = %f, run ahead percentage = %f\n", cushion, runAheadPercentage)); +// DEBUG_LOG(("Average cushion = %f, run ahead percentage = %f", cushion, runAheadPercentage)); } } // Check to see if we can run another frame. if (curTime >= m_nextFrameTime) { -// DEBUG_LOG(("Allowing a new frame, frameDelay = %I64d, curTime - m_nextFrameTime = %I64d\n", frameDelay, curTime - m_nextFrameTime)); +// DEBUG_LOG(("Allowing a new frame, frameDelay = %I64d, curTime - m_nextFrameTime = %I64d", frameDelay, curTime - m_nextFrameTime)); // if (m_nextFrameTime + frameDelay < curTime) { if ((m_nextFrameTime + (2 * frameDelay)) < curTime) { // If we get too far behind on our framerate we need to reset the nextFrameTime thing. m_nextFrameTime = curTime; -// DEBUG_LOG(("Initializing m_nextFrameTime to %I64d\n", m_nextFrameTime)); +// DEBUG_LOG(("Initializing m_nextFrameTime to %I64d", m_nextFrameTime)); } else { // Set the soonest possible starting time for the next frame. m_nextFrameTime += frameDelay; -// DEBUG_LOG(("m_nextFrameTime = %I64d\n", m_nextFrameTime)); +// DEBUG_LOG(("m_nextFrameTime = %I64d", m_nextFrameTime)); } return TRUE; } -// DEBUG_LOG(("Slowing down frame rate. frame rate = %d, frame delay = %I64d, curTime - m_nextFrameTime = %I64d\n", m_frameRate, frameDelay, curTime - m_nextFrameTime)); +// DEBUG_LOG(("Slowing down frame rate. frame rate = %d, frame delay = %I64d, curTime - m_nextFrameTime = %I64d", m_frameRate, frameDelay, curTime - m_nextFrameTime)); return FALSE; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetworkUtil.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetworkUtil.cpp index a856f34963..0af7b5a901 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetworkUtil.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetworkUtil.cpp @@ -36,8 +36,8 @@ Int FRAMES_TO_KEEP = (MAX_FRAMES_AHEAD/2) + 1; void dumpBufferToLog(const void *vBuf, Int len, const char *fname, Int line) { - DEBUG_LOG(("======= dumpBufferToLog() %d bytes =======\n", len)); - DEBUG_LOG(("Source: %s:%d\n", fname, line)); + DEBUG_LOG(("======= dumpBufferToLog() %d bytes =======", len)); + DEBUG_LOG(("Source: %s:%d", fname, line)); const char *buf = (const char *)vBuf; Int numLines = len / 8; if ((len % 8) != 0) @@ -65,9 +65,9 @@ void dumpBufferToLog(const void *vBuf, Int len, const char *fname, Int line) char c = buf[offset + dumpindex2]; DEBUG_LOG(("%c", (isprint(c)?c:'.'))); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } - DEBUG_LOG(("End of packet dump\n")); + DEBUG_LOG(("End of packet dump")); } #endif // DEBUG_LOGGING @@ -83,7 +83,7 @@ UnsignedInt ResolveIP(AsciiString host) if (host.getLength() == 0) { - DEBUG_LOG(("ResolveIP(): Can't resolve NULL\n")); + DEBUG_LOG(("ResolveIP(): Can't resolve NULL")); return 0; } @@ -97,7 +97,7 @@ UnsignedInt ResolveIP(AsciiString host) hostStruct = gethostbyname(host.str()); if (hostStruct == NULL) { - DEBUG_LOG(("ResolveIP(): Can't resolve %s\n", host.str())); + DEBUG_LOG(("ResolveIP(): Can't resolve %s", host.str())); return 0; } hostNode = (struct in_addr *) hostStruct->h_addr; diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp index baf8e3aa06..131857399e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp @@ -119,7 +119,7 @@ Bool Transport::init( UnsignedInt ip, UnsignedShort port ) if (retval != 0) { DEBUG_CRASH(("Could not bind to 0x%8.8X:%d\n", ip, port)); - DEBUG_LOG(("Transport::init - Failure to bind socket with error code %x\n", retval)); + DEBUG_LOG(("Transport::init - Failure to bind socket with error code %x", retval)); delete m_udpsock; m_udpsock = NULL; return false; @@ -194,7 +194,7 @@ Bool Transport::update( void ) Bool Transport::doSend() { if (!m_udpsock) { - DEBUG_LOG(("Transport::doSend() - m_udpSock is NULL!\n")); + DEBUG_LOG(("Transport::doSend() - m_udpSock is NULL!")); return FALSE; } @@ -225,22 +225,22 @@ Bool Transport::doSend() { // Send this message if ((bytesSent = m_udpsock->Write((unsigned char *)(&m_outBuffer[i]), bytesToSend, m_outBuffer[i].addr, m_outBuffer[i].port)) > 0) { - //DEBUG_LOG(("Sending %d bytes to %d.%d.%d.%d:%d\n", bytesToSend, PRINTF_IP_AS_4_INTS(m_outBuffer[i].addr), m_outBuffer[i].port)); + //DEBUG_LOG(("Sending %d bytes to %d.%d.%d.%d:%d", bytesToSend, PRINTF_IP_AS_4_INTS(m_outBuffer[i].addr), m_outBuffer[i].port)); m_outgoingPackets[m_statisticsSlot]++; m_outgoingBytes[m_statisticsSlot] += m_outBuffer[i].length + sizeof(TransportMessageHeader); m_outBuffer[i].length = 0; // Remove from queue if (bytesSent != bytesToSend) { - DEBUG_LOG(("Transport::doSend - wanted to send %d bytes, only sent %d bytes to %d.%d.%d.%d:%d\n", + DEBUG_LOG(("Transport::doSend - wanted to send %d bytes, only sent %d bytes to %d.%d.%d.%d:%d", bytesToSend, bytesSent, PRINTF_IP_AS_4_INTS(m_outBuffer[i].addr), m_outBuffer[i].port)); } } else { - //DEBUG_LOG(("Could not write to socket!!! Not discarding message!\n")); + //DEBUG_LOG(("Could not write to socket!!! Not discarding message!")); retval = FALSE; - //DEBUG_LOG(("Transport::doSend returning FALSE\n")); + //DEBUG_LOG(("Transport::doSend returning FALSE")); } } } // for (i=0; iRead(buf, MAX_MESSAGE_LEN, &from)) > 0 ) { #if defined(RTS_DEBUG) @@ -303,27 +303,27 @@ Bool Transport::doRecv() } #endif -// DEBUG_LOG(("Transport::doRecv - Got something! len = %d\n", len)); +// DEBUG_LOG(("Transport::doRecv - Got something! len = %d", len)); // Decrypt the packet // DEBUG_LOG(("buffer = ")); // for (Int munkee = 0; munkee < len; ++munkee) { // DEBUG_LOG(("%02x", *(buf + munkee))); // } -// DEBUG_LOG(("\n")); +// DEBUG_LOG(("")); decryptBuf(buf, len); incomingMessage.length = len - sizeof(TransportMessageHeader); if (len <= sizeof(TransportMessageHeader) || !isGeneralsPacket( &incomingMessage )) { - DEBUG_LOG(("Transport::doRecv - unknownPacket! len = %d\n", len)); + DEBUG_LOG(("Transport::doRecv - unknownPacket! len = %d", len)); m_unknownPackets[m_statisticsSlot]++; m_unknownBytes[m_statisticsSlot] += len; continue; } // Something there; stick it somewhere -// DEBUG_LOG(("Saw %d bytes from %d:%d\n", len, ntohl(from.sin_addr.S_un.S_addr), ntohs(from.sin_port))); +// DEBUG_LOG(("Saw %d bytes from %d:%d", len, ntohl(from.sin_addr.S_un.S_addr), ntohs(from.sin_port))); m_incomingPackets[m_statisticsSlot]++; m_incomingBytes[m_statisticsSlot] += len; @@ -368,7 +368,7 @@ Bool Transport::doRecv() if (len == -1) { // there was a socket error trying to perform a read. - //DEBUG_LOG(("Transport::doRecv returning FALSE\n")); + //DEBUG_LOG(("Transport::doRecv returning FALSE")); retval = FALSE; } @@ -382,7 +382,7 @@ Bool Transport::queueSend(UnsignedInt addr, UnsignedShort port, const UnsignedBy if (len < 1 || len > MAX_PACKET_SIZE) { - DEBUG_LOG(("Transport::queueSend - Invalid Packet size\n")); + DEBUG_LOG(("Transport::queueSend - Invalid Packet size")); return false; } @@ -401,18 +401,18 @@ Bool Transport::queueSend(UnsignedInt addr, UnsignedShort port, const UnsignedBy CRC crc; crc.computeCRC( (unsigned char *)(&(m_outBuffer[i].header.magic)), m_outBuffer[i].length + sizeof(TransportMessageHeader) - sizeof(UnsignedInt) ); -// DEBUG_LOG(("About to assign the CRC for the packet\n")); +// DEBUG_LOG(("About to assign the CRC for the packet")); m_outBuffer[i].header.crc = crc.get(); // Encrypt packet // DEBUG_LOG(("buffer: ")); encryptBuf((unsigned char *)&m_outBuffer[i], len + sizeof(TransportMessageHeader)); -// DEBUG_LOG(("\n")); +// DEBUG_LOG(("")); return true; } } - DEBUG_LOG(("Send Queue is getting full, dropping packets\n")); + DEBUG_LOG(("Send Queue is getting full, dropping packets")); return false; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/WOLBrowser/WebBrowser.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/WOLBrowser/WebBrowser.cpp index cd98e9bbd5..d1220611d1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/WOLBrowser/WebBrowser.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/WOLBrowser/WebBrowser.cpp @@ -89,7 +89,7 @@ CComObject * TheWebBrowser = NULL; WebBrowser::WebBrowser() : mRefCount(1) { - DEBUG_LOG(("Instantiating embedded WebBrowser\n")); + DEBUG_LOG(("Instantiating embedded WebBrowser")); m_urlList = NULL; } @@ -112,9 +112,9 @@ WebBrowser::WebBrowser() : WebBrowser::~WebBrowser() { - DEBUG_LOG(("Destructing embedded WebBrowser\n")); + DEBUG_LOG(("Destructing embedded WebBrowser")); if (this == TheWebBrowser) { - DEBUG_LOG(("WebBrowser::~WebBrowser - setting TheWebBrowser to NULL\n")); + DEBUG_LOG(("WebBrowser::~WebBrowser - setting TheWebBrowser to NULL")); TheWebBrowser = NULL; } WebBrowserURL *url = m_urlList; @@ -292,7 +292,7 @@ ULONG STDMETHODCALLTYPE WebBrowser::Release(void) IUNKNOWN_NOEXCEPT if (mRefCount == 0) { - DEBUG_LOG(("WebBrowser::Release - all references released, deleting the object.\n")); + DEBUG_LOG(("WebBrowser::Release - all references released, deleting the object.")); if (this == TheWebBrowser) { TheWebBrowser = NULL; } @@ -305,6 +305,6 @@ ULONG STDMETHODCALLTYPE WebBrowser::Release(void) IUNKNOWN_NOEXCEPT STDMETHODIMP WebBrowser::TestMethod(Int num1) { - DEBUG_LOG(("WebBrowser::TestMethod - num1 = %d\n", num1)); + DEBUG_LOG(("WebBrowser::TestMethod - num1 = %d", num1)); return S_OK; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp index 7818d11f7e..b96d1250bc 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp @@ -441,7 +441,7 @@ void MilesAudioManager::init() { AudioManager::init(); #ifdef INTENSE_DEBUG - DEBUG_LOG(("Sound has temporarily been disabled in debug builds only. jkmcd\n")); + DEBUG_LOG(("Sound has temporarily been disabled in debug builds only. jkmcd")); // for now, RTS_DEBUG builds only should have no sound. ask jkmcd or srj about this. return; #endif @@ -677,7 +677,7 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event ) case AT_Streaming: { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("- Stream\n")); + DEBUG_LOG(("- Stream")); #endif if ((info->m_soundType == AT_Streaming) && event->getUninterruptable()) { @@ -803,14 +803,14 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event ) { m_playing3DSounds.pop_back(); #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" Killed (no handles available)\n")); + DEBUG_LOG((" Killed (no handles available)")); #endif } else { audio = NULL; #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" Playing.\n")); + DEBUG_LOG((" Playing.")); #endif } } @@ -872,7 +872,7 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event ) if (!audio->m_file) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" Killed (no handles available)\n")); + DEBUG_LOG((" Killed (no handles available)")); #endif m_playingSounds.pop_back(); } else { @@ -880,7 +880,7 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event ) } #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" Playing.\n")); + DEBUG_LOG((" Playing.")); #endif } break; @@ -898,7 +898,7 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event ) void MilesAudioManager::stopAudioEvent( AudioHandle handle ) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG(("MILES (%d) - Processing stop request: %d\n", TheGameLogic->getFrame(), handle)); + DEBUG_LOG(("MILES (%d) - Processing stop request: %d", TheGameLogic->getFrame(), handle)); #endif std::list::iterator it; @@ -961,7 +961,7 @@ void MilesAudioManager::stopAudioEvent( AudioHandle handle ) if (audio->m_audioEventRTS->getPlayingHandle() == handle) { #ifdef INTENSIVE_AUDIO_DEBUG - DEBUG_LOG((" (%s)\n", audio->m_audioEventRTS->getEventName())); + DEBUG_LOG((" (%s)", audio->m_audioEventRTS->getEventName())); #endif audio->m_requestStop = true; break; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/StdDevice/Common/StdBIGFileSystem.cpp b/GeneralsMD/Code/GameEngineDevice/Source/StdDevice/Common/StdBIGFileSystem.cpp index 9afc8d3189..dde8abd519 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/StdDevice/Common/StdBIGFileSystem.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/StdDevice/Common/StdBIGFileSystem.cpp @@ -82,7 +82,7 @@ ArchiveFile * StdBIGFileSystem::openArchiveFile(const Char *filename) { ArchiveFile *archiveFile = NEW StdBIGFile; - DEBUG_LOG(("StdBIGFileSystem::openArchiveFile - opening BIG file %s\n", filename)); + DEBUG_LOG(("StdBIGFileSystem::openArchiveFile - opening BIG file %s", filename)); if (fp == NULL) { DEBUG_CRASH(("Could not open archive file %s for parsing", filename)); @@ -103,7 +103,7 @@ ArchiveFile * StdBIGFileSystem::openArchiveFile(const Char *filename) { // read in the file size. fp->read(&archiveFileSize, 4); - DEBUG_LOG(("StdBIGFileSystem::openArchiveFile - size of archive file is %d bytes\n", archiveFileSize)); + DEBUG_LOG(("StdBIGFileSystem::openArchiveFile - size of archive file is %d bytes", archiveFileSize)); // char t; @@ -112,7 +112,7 @@ ArchiveFile * StdBIGFileSystem::openArchiveFile(const Char *filename) { fp->read(&numLittleFiles, 4); numLittleFiles = betoh(numLittleFiles); - DEBUG_LOG(("StdBIGFileSystem::openArchiveFile - %d are contained in archive\n", numLittleFiles)); + DEBUG_LOG(("StdBIGFileSystem::openArchiveFile - %d are contained in archive", numLittleFiles)); // for (Int i = 0; i < 2; ++i) { // t = buffer[i]; // buffer[i] = buffer[(4-i)-1]; @@ -159,7 +159,7 @@ ArchiveFile * StdBIGFileSystem::openArchiveFile(const Char *filename) { AsciiString debugpath; debugpath = path; debugpath.concat(fileInfo->m_filename); -// DEBUG_LOG(("StdBIGFileSystem::openArchiveFile - adding file %s to archive file %s, file number %d\n", debugpath.str(), fileInfo->m_archiveFilename.str(), i)); +// DEBUG_LOG(("StdBIGFileSystem::openArchiveFile - adding file %s to archive file %s, file number %d", debugpath.str(), fileInfo->m_archiveFilename.str(), i)); archiveFile->addFile(path, fileInfo); } @@ -212,10 +212,10 @@ Bool StdBIGFileSystem::loadBigFilesFromDirectory(AsciiString dir, AsciiString fi ArchiveFile *archiveFile = openArchiveFile((*it).str()); if (archiveFile != NULL) { - DEBUG_LOG(("StdBIGFileSystem::loadBigFilesFromDirectory - loading %s into the directory tree.\n", (*it).str())); + DEBUG_LOG(("StdBIGFileSystem::loadBigFilesFromDirectory - loading %s into the directory tree.", (*it).str())); loadIntoDirectoryTree(archiveFile, *it, overwrite); m_archiveFileMap[(*it)] = archiveFile; - DEBUG_LOG(("StdBIGFileSystem::loadBigFilesFromDirectory - %s inserted into the archive file map.\n", (*it).str())); + DEBUG_LOG(("StdBIGFileSystem::loadBigFilesFromDirectory - %s inserted into the archive file map.", (*it).str())); actuallyAdded = TRUE; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/StdDevice/Common/StdLocalFileSystem.cpp b/GeneralsMD/Code/GameEngineDevice/Source/StdDevice/Common/StdLocalFileSystem.cpp index 62d2ba45e1..9d44686bd8 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/StdDevice/Common/StdLocalFileSystem.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/StdDevice/Common/StdLocalFileSystem.cpp @@ -104,8 +104,8 @@ static std::filesystem::path fixFilenameFromWindowsPath(const Char *filename, In // Required to allow creation of new files if (!(access & File::WRITE)) { - DEBUG_LOG(("StdLocalFileSystem::fixFilenameFromWindowsPath - Error finding file %s\n", filename.string().c_str())); - DEBUG_LOG(("StdLocalFileSystem::fixFilenameFromWindowsPath - Got so far %s\n", pathCurrent.string().c_str())); + DEBUG_LOG(("StdLocalFileSystem::fixFilenameFromWindowsPath - Error finding file %s", filename.string().c_str())); + DEBUG_LOG(("StdLocalFileSystem::fixFilenameFromWindowsPath - Got so far %s", pathCurrent.string().c_str())); return std::filesystem::path(); } @@ -147,7 +147,7 @@ File * StdLocalFileSystem::openFile(const Char *filename, Int access /* = 0 */) std::error_code ec; if (!std::filesystem::exists(dir, ec) || ec) { if(!std::filesystem::create_directories(dir, ec) || ec) { - DEBUG_LOG(("StdLocalFileSystem::openFile - Error creating directory %s\n", dir.string().c_str())); + DEBUG_LOG(("StdLocalFileSystem::openFile - Error creating directory %s", dir.string().c_str())); return NULL; } } @@ -238,7 +238,7 @@ void StdLocalFileSystem::getFileListInDirectory(const AsciiString& currentDirect done = iter == std::filesystem::directory_iterator(); if (ec) { - DEBUG_LOG(("StdLocalFileSystem::getFileListInDirectory - Error opening directory %s\n", search)); + DEBUG_LOG(("StdLocalFileSystem::getFileListInDirectory - Error opening directory %s", search)); return; } @@ -262,7 +262,7 @@ void StdLocalFileSystem::getFileListInDirectory(const AsciiString& currentDirect auto iter = std::filesystem::directory_iterator(fixedDirectory, ec); if (ec) { - DEBUG_LOG(("StdLocalFileSystem::getFileListInDirectory - Error opening subdirectory %s\n", fixedDirectory.c_str())); + DEBUG_LOG(("StdLocalFileSystem::getFileListInDirectory - Error opening subdirectory %s", fixedDirectory.c_str())); return; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp index dde2736450..d8db8eee18 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp @@ -205,10 +205,10 @@ VideoStreamInterface* BinkVideoPlayer::createStream( HBINK handle ) // never let volume go to 0, as Bink will interpret that as "play at full volume". Int mod = (Int) ((TheAudio->getVolume(AudioAffect_Speech) * 0.8f) * 100) + 1; Int volume = (32768*mod)/100; - DEBUG_LOG(("BinkVideoPlayer::createStream() - About to set volume (%g -> %d -> %d\n", + DEBUG_LOG(("BinkVideoPlayer::createStream() - About to set volume (%g -> %d -> %d", TheAudio->getVolume(AudioAffect_Speech), mod, volume)); BinkSetVolume( stream->m_handle,0, volume); - DEBUG_LOG(("BinkVideoPlayer::createStream() - set volume\n")); + DEBUG_LOG(("BinkVideoPlayer::createStream() - set volume")); } return stream; @@ -224,7 +224,7 @@ VideoStreamInterface* BinkVideoPlayer::open( AsciiString movieTitle ) const Video* pVideo = getVideo(movieTitle); if (pVideo) { - DEBUG_LOG(("BinkVideoPlayer::createStream() - About to open bink file\n")); + DEBUG_LOG(("BinkVideoPlayer::createStream() - About to open bink file")); if (TheGlobalData->m_modDir.isNotEmpty()) { @@ -250,7 +250,7 @@ VideoStreamInterface* BinkVideoPlayer::open( AsciiString movieTitle ) DEBUG_ASSERTLOG(!handle, ("opened bink file %s\n", localizedFilePath)); } - DEBUG_LOG(("BinkVideoPlayer::createStream() - About to create stream\n")); + DEBUG_LOG(("BinkVideoPlayer::createStream() - About to create stream")); stream = createStream( handle ); } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp index 345ce39d73..ce2d57b9dd 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp @@ -211,10 +211,10 @@ VideoStreamInterface* FFmpegVideoPlayer::createStream( File* file ) // never let volume go to 0, as Bink will interpret that as "play at full volume". Int mod = (Int) ((TheAudio->getVolume(AudioAffect_Speech) * 0.8f) * 100) + 1; [[maybe_unused]] Int volume = (32768 * mod) / 100; - DEBUG_LOG(("FFmpegVideoPlayer::createStream() - About to set volume (%g -> %d -> %d\n", + DEBUG_LOG(("FFmpegVideoPlayer::createStream() - About to set volume (%g -> %d -> %d", TheAudio->getVolume(AudioAffect_Speech), mod, volume)); //BinkSetVolume( stream->m_handle,0, volume); - DEBUG_LOG(("FFmpegVideoPlayer::createStream() - set volume\n")); + DEBUG_LOG(("FFmpegVideoPlayer::createStream() - set volume")); } return stream; @@ -230,7 +230,7 @@ VideoStreamInterface* FFmpegVideoPlayer::open( AsciiString movieTitle ) const Video* pVideo = getVideo(movieTitle); if (pVideo) { - DEBUG_LOG(("FFmpegVideoPlayer::createStream() - About to open bink file\n")); + DEBUG_LOG(("FFmpegVideoPlayer::createStream() - About to open bink file")); if (TheGlobalData->m_modDir.isNotEmpty()) { @@ -256,7 +256,7 @@ VideoStreamInterface* FFmpegVideoPlayer::open( AsciiString movieTitle ) DEBUG_ASSERTLOG(!file, ("opened bink file %s\n", filePath)); } - DEBUG_LOG(("FFmpegVideoPlayer::createStream() - About to create stream\n")); + DEBUG_LOG(("FFmpegVideoPlayer::createStream() - About to create stream")); stream = createStream( file ); } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDependencyModelDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDependencyModelDraw.cpp index 37483cf8c3..57aea7a60e 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDependencyModelDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDependencyModelDraw.cpp @@ -145,7 +145,7 @@ void W3DDependencyModelDraw::adjustTransformMtx(Matrix3D& mtx) const else { mtx = *theirDrawable->getTransformMatrix();//TransformMatrix(); - DEBUG_LOG(("m_attachToDrawableBoneInContainer %s not found\n",getW3DDependencyModelDrawModuleData()->m_attachToDrawableBoneInContainer.str())); + DEBUG_LOG(("m_attachToDrawableBoneInContainer %s not found",getW3DDependencyModelDrawModuleData()->m_attachToDrawableBoneInContainer.str())); } } } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 98823dd76c..79d7f1bb31 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -505,7 +505,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, if (findSingleBone(robj, boneNameTmp, info.mtx, info.boneIndex)) { -//DEBUG_LOG(("added bone %s\n",boneNameTmp.str())); +//DEBUG_LOG(("added bone %s",boneNameTmp.str())); BONEPOS_LOG(("Caching bone %s (index %d)\n", boneNameTmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); @@ -518,7 +518,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, tmp.format("%s%02d", boneNameTmp.str(), i); if (findSingleBone(robj, tmp, info.mtx, info.boneIndex)) { -//DEBUG_LOG(("added bone %s\n",tmp.str())); +//DEBUG_LOG(("added bone %s",tmp.str())); BONEPOS_LOG(("Caching bone %s (index %d)\n", tmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(tmp)] = info; @@ -534,7 +534,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, { if (findSingleSubObj(robj, boneNameTmp, info.mtx, info.boneIndex)) { -//DEBUG_LOG(("added subobj %s\n",boneNameTmp.str())); +//DEBUG_LOG(("added subobj %s",boneNameTmp.str())); BONEPOS_LOG(("Caching bone from subobject %s (index %d)\n", boneNameTmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(boneNameTmp)] = info; @@ -546,7 +546,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, tmp.format("%s%02d", boneNameTmp.str(), i); if (findSingleSubObj(robj, tmp, info.mtx, info.boneIndex)) { -//DEBUG_LOG(("added subobj %s\n",tmp.str())); +//DEBUG_LOG(("added subobj %s",tmp.str())); BONEPOS_LOG(("Caching bone from subobject %s (index %d)\n", tmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(tmp)] = info; @@ -679,7 +679,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c } //else //{ - // DEBUG_LOG(("global bone %s (or variations thereof) found in model %s\n",it->str(),m_modelName.str())); + // DEBUG_LOG(("global bone %s (or variations thereof) found in model %s",it->str(),m_modelName.str())); //} } } @@ -692,7 +692,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c } //else //{ - // DEBUG_LOG(("extra bone %s (or variations thereof) found in model %s\n",it->str(),m_modelName.str())); + // DEBUG_LOG(("extra bone %s (or variations thereof) found in model %s",it->str(),m_modelName.str())); //} } @@ -793,7 +793,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const if (info.m_fxBone == 0 && info.m_recoilBone == 0 && info.m_muzzleFlashBone == 0 && plbBoneIndex == 0) break; - CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s wslot %d\n", m_modelName.str(), wslot)); + CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s wslot %d", m_modelName.str(), wslot)); DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s wslot %d\n", m_modelName.str(), wslot)); BONEPOS_DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); @@ -831,7 +831,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const if (info.m_fxBone != 0 || info.m_recoilBone != 0 || info.m_muzzleFlashBone != 0 || plbMtx != NULL) { - CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) wslot %d\n", m_modelName.str(), wslot)); + CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) wslot %d", m_modelName.str(), wslot)); DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) wslot %d\n", m_modelName.str(), wslot)); BONEPOS_DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); @@ -841,7 +841,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const } else { - CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) found nothing\n", m_modelName.str())); + CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) found nothing", m_modelName.str())); BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) found nothing\n", m_modelName.str())); } } // if empty @@ -1469,7 +1469,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void // note, this is size(), not size()-1, since we haven't actually modified the list yet self->m_defaultState = self->m_conditionStates.size(); - //DEBUG_LOG(("set default state to %d\n",self->m_defaultState)); + //DEBUG_LOG(("set default state to %d",self->m_defaultState)); // add an empty conditionstateflag set ModelConditionFlags blankConditions; @@ -1768,7 +1768,7 @@ W3DModelDraw::W3DModelDraw(Thing *thing, const ModuleData* moduleData) : DrawMod if ( ! getW3DModelDrawModuleData()->m_receivesDynamicLights) { draw->setReceivesDynamicLights( FALSE ); - DEBUG_LOG(("setReceivesDynamicLights = FALSE: %s\n", draw->getTemplate()->getName().str())); + DEBUG_LOG(("setReceivesDynamicLights = FALSE: %s", draw->getTemplate()->getName().str())); } } @@ -2014,7 +2014,7 @@ void W3DModelDraw::adjustTransformMtx(Matrix3D& mtx) const } else { - DEBUG_LOG(("m_attachToDrawableBone %s not found\n",getW3DModelDrawModuleData()->m_attachToDrawableBone.str())); + DEBUG_LOG(("m_attachToDrawableBone %s not found",getW3DModelDrawModuleData()->m_attachToDrawableBone.str())); } } #endif @@ -2055,7 +2055,7 @@ void W3DModelDraw::doDrawModule(const Matrix3D* transformMtx) { if (m_curState != NULL && m_nextState != NULL) { - //DEBUG_LOG(("transition %s is complete\n",m_curState->m_description.str())); + //DEBUG_LOG(("transition %s is complete",m_curState->m_description.str())); const ModelConditionInfo* nextState = m_nextState; UnsignedInt nextDuration = m_nextStateAnimLoopDuration; m_nextState = NULL; @@ -2063,7 +2063,7 @@ void W3DModelDraw::doDrawModule(const Matrix3D* transformMtx) setModelState(nextState); if (nextDuration != NO_NEXT_DURATION) { - //DEBUG_LOG(("restoring pending duration of %d frames\n",nextDuration)); + //DEBUG_LOG(("restoring pending duration of %d frames",nextDuration)); setAnimationLoopDuration(nextDuration); } } @@ -2074,7 +2074,7 @@ void W3DModelDraw::doDrawModule(const Matrix3D* transformMtx) { if (m_curState->m_animations[m_whichAnimInCurState].isIdleAnim()) { - //DEBUG_LOG(("randomly switching to new idle state!\n")); + //DEBUG_LOG(("randomly switching to new idle state!")); // state hasn't changed, if it's been awhile, switch the idle anim // (yes, that's right: pass curState for prevState) @@ -2511,7 +2511,7 @@ void W3DModelDraw::handleClientRecoil() if (barrels[i].m_muzzleFlashBone != 0) { Bool hidden = recoils[i].m_state != WeaponRecoilInfo::RECOIL_START; - //DEBUG_LOG(("adjust muzzleflash %08lx for Draw %08lx state %s to %d at frame %d\n",subObjToHide,this,m_curState->m_description.str(),hidden?1:0,TheGameLogic->getFrame())); + //DEBUG_LOG(("adjust muzzleflash %08lx for Draw %08lx state %s to %d at frame %d",subObjToHide,this,m_curState->m_description.str(),hidden?1:0,TheGameLogic->getFrame())); barrels[i].setMuzzleFlashHidden(m_renderObject, hidden); } @@ -2563,7 +2563,7 @@ void W3DModelDraw::handleClientRecoil() else { recoils[i].m_state = WeaponRecoilInfo::IDLE; - //DEBUG_LOG(("reset Draw %08lx state %08lx\n",this,m_curState)); + //DEBUG_LOG(("reset Draw %08lx state %08lx",this,m_curState)); } } } @@ -2914,7 +2914,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) #ifdef DEBUG_OBJECT_ID_EXISTS if (getDrawable() && getDrawable()->getObject() && getDrawable()->getObject()->getID() == TheObjectIDToDebug) { - DEBUG_LOG(("REQUEST switching to state %s for obj %s %d\n",newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); + DEBUG_LOG(("REQUEST switching to state %s for obj %s %d",newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); } #endif const ModelConditionInfo* nextState = NULL; @@ -2945,7 +2945,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) #ifdef DEBUG_OBJECT_ID_EXISTS if (getDrawable() && getDrawable()->getObject() && getDrawable()->getObject()->getID() == TheObjectIDToDebug) { - DEBUG_LOG(("IGNORE duplicate state %s for obj %s %d\n",newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); + DEBUG_LOG(("IGNORE duplicate state %s for obj %s %d",newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); } #endif // I don't think he'll be interested... @@ -2962,7 +2962,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) #ifdef DEBUG_OBJECT_ID_EXISTS if (getDrawable() && getDrawable()->getObject() && getDrawable()->getObject()->getID() == TheObjectIDToDebug) { - DEBUG_LOG(("ALLOW_TO_FINISH state %s for obj %s %d\n",newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); + DEBUG_LOG(("ALLOW_TO_FINISH state %s for obj %s %d",newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); } #endif m_nextState = newState; @@ -2981,7 +2981,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) #ifdef DEBUG_OBJECT_ID_EXISTS if (getDrawable() && getDrawable()->getObject() && getDrawable()->getObject()->getID() == TheObjectIDToDebug) { - DEBUG_LOG(("using TRANSITION state %s before requested state %s for obj %s %d\n",transState->m_description.str(),newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); + DEBUG_LOG(("using TRANSITION state %s before requested state %s for obj %s %d",transState->m_description.str(),newState->m_description.str(),getDrawable()->getObject()->getTemplate()->getName().str(),getDrawable()->getObject()->getID())); } #endif nextState = newState; @@ -3269,12 +3269,12 @@ Bool W3DModelDraw::getProjectileLaunchOffset( const ModelConditionInfo* stateToUse = findBestInfo(condition); if (!stateToUse) { - CRCDEBUG_LOG(("can't find best info\n")); + CRCDEBUG_LOG(("can't find best info")); //BONEPOS_LOG(("can't find best info\n")); return false; } #if defined(RTS_DEBUG) - CRCDEBUG_LOG(("W3DModelDraw::getProjectileLaunchOffset() for %s\n", + CRCDEBUG_LOG(("W3DModelDraw::getProjectileLaunchOffset() for %s", stateToUse->getDescription().str())); #endif @@ -3292,7 +3292,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( #endif // INTENSE_DEBUG const W3DModelDrawModuleData* d = getW3DModelDrawModuleData(); - //CRCDEBUG_LOG(("validateStuffs() from within W3DModelDraw::getProjectileLaunchOffset()\n")); + //CRCDEBUG_LOG(("validateStuffs() from within W3DModelDraw::getProjectileLaunchOffset()")); //DUMPREAL(getDrawable()->getScale()); //BONEPOS_LOG(("validateStuffs() from within W3DModelDraw::getProjectileLaunchOffset()\n")); //BONEPOS_DUMPREAL(getDrawable()->getScale()); @@ -3319,12 +3319,12 @@ Bool W3DModelDraw::getProjectileLaunchOffset( } #endif - CRCDEBUG_LOG(("wslot = %d\n", wslot)); + CRCDEBUG_LOG(("wslot = %d", wslot)); const ModelConditionInfo::WeaponBarrelInfoVec& wbvec = stateToUse->m_weaponBarrelInfoVec[wslot]; if( wbvec.empty() ) { // Can't find the launch pos, but they might still want the other info they asked for - CRCDEBUG_LOG(("empty wbvec\n")); + CRCDEBUG_LOG(("empty wbvec")); //BONEPOS_LOG(("empty wbvec\n")); launchPos = NULL; } @@ -3335,7 +3335,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( if (launchPos) { - CRCDEBUG_LOG(("specificBarrelToUse = %d\n", specificBarrelToUse)); + CRCDEBUG_LOG(("specificBarrelToUse = %d", specificBarrelToUse)); *launchPos = wbvec[specificBarrelToUse].m_projectileOffsetMtx; if (tur != TURRET_INVALID) @@ -3421,9 +3421,9 @@ Int W3DModelDraw::getPristineBonePositionsForConditionState( // if (isValidTimeToCalcLogicStuff()) // { -// CRCDEBUG_LOG(("W3DModelDraw::getPristineBonePositionsForConditionState() - state = '%s'\n", +// CRCDEBUG_LOG(("W3DModelDraw::getPristineBonePositionsForConditionState() - state = '%s'", // stateToUse->getDescription().str())); -// //CRCDEBUG_LOG(("renderObject == NULL: %d\n", (stateToUse==m_curState)?(m_renderObject == NULL):1)); +// //CRCDEBUG_LOG(("renderObject == NULL: %d", (stateToUse==m_curState)?(m_renderObject == NULL):1)); // } //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::getPristineBonePositionsForConditionState()\n")); @@ -3504,7 +3504,7 @@ Int W3DModelDraw::getPristineBonePositionsForConditionState( // if (isValidTimeToCalcLogicStuff()) // { -// CRCDEBUG_LOG(("end of W3DModelDraw::getPristineBonePositionsForConditionState()\n")); +// CRCDEBUG_LOG(("end of W3DModelDraw::getPristineBonePositionsForConditionState()")); // } return posCount; @@ -3753,13 +3753,13 @@ Bool W3DModelDraw::handleWeaponFireFX(WeaponSlotType wslot, Int specificBarrelTo } else { - DEBUG_LOG(("*** no FXBone found for a non-null FXL\n")); + DEBUG_LOG(("*** no FXBone found for a non-null FXL")); } } if (info.m_recoilBone || info.m_muzzleFlashBone) { - //DEBUG_LOG(("START muzzleflash %08lx for Draw %08lx state %s at frame %d\n",info.m_muzzleFlashBone,this,m_curState->m_description.str(),TheGameLogic->getFrame())); + //DEBUG_LOG(("START muzzleflash %08lx for Draw %08lx state %s at frame %d",info.m_muzzleFlashBone,this,m_curState->m_description.str(),TheGameLogic->getFrame())); WeaponRecoilInfo& recoil = m_weaponRecoilInfoVec[wslot][specificBarrelToUse]; recoil.m_state = WeaponRecoilInfo::RECOIL_START; recoil.m_recoilRate = getW3DModelDrawModuleData()->m_initialRecoil; @@ -3778,7 +3778,7 @@ void W3DModelDraw::setAnimationLoopDuration(UnsignedInt numFrames) if (m_curState != NULL && m_curState->m_transition != NO_TRANSITION && m_nextState != NULL && m_nextState->m_transition == NO_TRANSITION) { - DEBUG_LOG(("deferring pending duration of %d frames\n",numFrames)); + DEBUG_LOG(("deferring pending duration of %d frames",numFrames)); m_nextStateAnimLoopDuration = numFrames; return; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp index 37e4763c69..65aa42b7da 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp @@ -244,7 +244,7 @@ void W3DTankTruckDraw::createEmitters( void ) m_dustEffect->setSaveable(FALSE); } else { if (!getW3DTankTruckDrawModuleData()->m_dustEffectName.isEmpty()) { - DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'\n", + DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'", getW3DTankTruckDrawModuleData()->m_dustEffectName.str(), getDrawable()->getObject()->getTemplate()->getName().str())); } } @@ -260,7 +260,7 @@ void W3DTankTruckDraw::createEmitters( void ) m_dirtEffect->setSaveable(FALSE); } else { if (!getW3DTankTruckDrawModuleData()->m_dirtEffectName.isEmpty()) { - DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'\n", + DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'", getW3DTankTruckDrawModuleData()->m_dirtEffectName.str(), getDrawable()->getObject()->getTemplate()->getName().str())); } } @@ -275,7 +275,7 @@ void W3DTankTruckDraw::createEmitters( void ) m_powerslideEffect->setSaveable(FALSE); } else { if (!getW3DTankTruckDrawModuleData()->m_powerslideEffectName.isEmpty()) { - DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'\n", + DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'", getW3DTankTruckDrawModuleData()->m_powerslideEffectName.str(), getDrawable()->getObject()->getTemplate()->getName().str())); } } @@ -488,7 +488,7 @@ void W3DTankTruckDraw::updateTreadObjects(void) //------------------------------------------------------------------------------------------------- void W3DTankTruckDraw::onRenderObjRecreated(void) { - //DEBUG_LOG(("Old obj %x, newObj %x, new bones %d, old bones %d\n", + //DEBUG_LOG(("Old obj %x, newObj %x, new bones %d, old bones %d", // m_prevRenderObj, getRenderObject(), getRenderObject()->Get_Num_Bones(), // m_prevNumBones)); m_prevRenderObj = NULL; @@ -623,7 +623,7 @@ void W3DTankTruckDraw::doDrawModule(const Matrix3D* transformMtx) Coord3D accel = *physics->getAcceleration(); accel.z = 0; // ignore gravitational force. Bool accelerating = accel.length()>ACCEL_THRESHOLD; - //DEBUG_LOG(("Accel %f, speed %f\n", accel.length(), speed)); + //DEBUG_LOG(("Accel %f, speed %f", accel.length(), speed)); if (accelerating) { Real dot = accel.x*vel->x + accel.y*vel->y; if (dot<0) { diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp index d88ba220d0..61e41bc451 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp @@ -185,7 +185,7 @@ void W3DTruckDraw::createEmitters( void ) m_dustEffect->setSaveable(FALSE); } else { if (!getW3DTruckDrawModuleData()->m_dustEffectName.isEmpty()) { - DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'\n", + DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'", getW3DTruckDrawModuleData()->m_dustEffectName.str(), getDrawable()->getObject()->getTemplate()->getName().str())); } } @@ -201,7 +201,7 @@ void W3DTruckDraw::createEmitters( void ) m_dirtEffect->setSaveable(FALSE); } else { if (!getW3DTruckDrawModuleData()->m_dirtEffectName.isEmpty()) { - DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'\n", + DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'", getW3DTruckDrawModuleData()->m_dirtEffectName.str(), getDrawable()->getObject()->getTemplate()->getName().str())); } } @@ -216,7 +216,7 @@ void W3DTruckDraw::createEmitters( void ) m_powerslideEffect->setSaveable(FALSE); } else { if (!getW3DTruckDrawModuleData()->m_powerslideEffectName.isEmpty()) { - DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'\n", + DEBUG_LOG(("*** ERROR - Missing particle system '%s' in thing '%s'", getW3DTruckDrawModuleData()->m_powerslideEffectName.str(), getDrawable()->getObject()->getTemplate()->getName().str())); } } @@ -361,7 +361,7 @@ void W3DTruckDraw::setHidden(Bool h) //------------------------------------------------------------------------------------------------- void W3DTruckDraw::onRenderObjRecreated(void) { - //DEBUG_LOG(("Old obj %x, newObj %x, new bones %d, old bones %d\n", + //DEBUG_LOG(("Old obj %x, newObj %x, new bones %d, old bones %d", // m_prevRenderObj, getRenderObject(), getRenderObject()->Get_Num_Bones(), // m_prevNumBones)); m_prevRenderObj = NULL; @@ -405,7 +405,7 @@ void W3DTruckDraw::doDrawModule(const Matrix3D* transformMtx) if (getRenderObject()==NULL) return; if (getRenderObject() != m_prevRenderObj) { - DEBUG_LOG(("W3DTruckDraw::doDrawModule - shouldn't update bones. jba\n")); + DEBUG_LOG(("W3DTruckDraw::doDrawModule - shouldn't update bones. jba")); updateBones(); } @@ -577,7 +577,7 @@ void W3DTruckDraw::doDrawModule(const Matrix3D* transformMtx) Coord3D accel = *physics->getAcceleration(); accel.z = 0; // ignore gravitational force. Bool accelerating = accel.length()>ACCEL_THRESHOLD; - //DEBUG_LOG(("Accel %f, speed %f\n", accel.length(), speed)); + //DEBUG_LOG(("Accel %f, speed %f", accel.length(), speed)); if (accelerating) { Real dot = accel.x*vel->x + accel.y*vel->y; if (dot<0) { diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp index c067a7da63..370608462d 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp @@ -439,7 +439,7 @@ void FlatHeightMapRenderObjClass::updateCenter(CameraClass *camera , RefRenderOb } } if (culled!=prevCulled || t4X!=prevT4X || t2X!=prevT2X) { - DEBUG_LOG(("%d of %d culled, %d 4X, %d 2X.\n", culled, m_numTiles, t4X, t2X)); + DEBUG_LOG(("%d of %d culled, %d 4X, %d 2X.", culled, m_numTiles, t4X, t2X)); prevCulled = culled; prevT2X = t2X; prevT4X = t4X; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp index 62c95f7e8c..2423d44210 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/W3DGameFont.cpp @@ -91,7 +91,7 @@ Bool W3DFontLibrary::loadFontData( GameFont *font ) if( fontChar == NULL ) { - DEBUG_LOG(( "W3D load font: unable to find font '%s' from asset manager\n", + DEBUG_LOG(( "W3D load font: unable to find font '%s' from asset manager", font->nameString.str() )); DEBUG_ASSERTCRASH(fontChar, ("Missing or Corrupted Font. Pleas see log for details")); return FALSE; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp index faf970f978..7445bc7286 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp @@ -1075,7 +1075,7 @@ void W3DShadowGeometryMesh::buildPolygonNeighbors( void ) // pv[0] /= 3.0f; //find center of polygon // sprintf(errorText,"%s: Shadow Polygon with too many neighbors at %f,%f,%f",m_parentGeometry->Get_Name(),pv[0].X,pv[0].Y,pv[0].Z); -// DEBUG_LOG(("****%s Shadow Polygon with too many neighbors at %f,%f,%f\n",m_parentGeometry->Get_Name(),pv[0].X,pv[0].Y,pv[0].Z)); +// DEBUG_LOG(("****%s Shadow Polygon with too many neighbors at %f,%f,%f",m_parentGeometry->Get_Name(),pv[0].X,pv[0].Y,pv[0].Z)); // DEBUG_ASSERTCRASH(a != MAX_POLYGON_NEIGHBORS,(errorText)); } @@ -4032,7 +4032,7 @@ int W3DShadowGeometryManager::Load_Geom(RenderObjClass *robj, const char *name) if (res != TRUE) { // load failed! newgeom->Release_Ref(); - //DEBUG_LOG(("****Shadow Volume Creation Failed on %s\n",name)); + //DEBUG_LOG(("****Shadow Volume Creation Failed on %s",name)); goto Error; } else if (Peek_Geom(newgeom->Get_Name()) != NULL) { // duplicate exists! diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp index cd164307ce..74946e5cd8 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp @@ -1153,7 +1153,7 @@ void W3DAssetManager::Report_Used_Prototypes(void) PrototypeClass * proto = Prototypes[count]; if (proto->Get_Class_ID() == RenderObjClass::CLASSID_HLOD || proto->Get_Class_ID() == RenderObjClass::CLASSID_MESH) { - DEBUG_LOG(("**Unfreed Prototype On Map Reset: %s\n",proto->Get_Name())); + DEBUG_LOG(("**Unfreed Prototype On Map Reset: %s",proto->Get_Name())); } } } @@ -1183,7 +1183,7 @@ void W3DAssetManager::Report_Used_FontChars(void) { if (FontCharsList[count]->Num_Refs() >= 1) { - DEBUG_LOG(("**Unfreed FontChar On Map Reset: %s\n",FontCharsList[count]->Get_Name())); + DEBUG_LOG(("**Unfreed FontChar On Map Reset: %s",FontCharsList[count]->Get_Name())); //FontCharsList[count]->Release_Ref(); //FontCharsList.Delete(count); } @@ -1219,7 +1219,7 @@ void W3DAssetManager::Report_Used_Textures(void) } else { - DEBUG_LOG(("**Texture \"%s\" referenced %d times on map reset\n",tex->Get_Texture_Name().str(),tex->Num_Refs()-1)); + DEBUG_LOG(("**Texture \"%s\" referenced %d times on map reset",tex->Get_Texture_Name().str(),tex->Num_Refs()-1)); } } /* for (unsigned i=0;iName)); + DEBUG_LOG(("**Unfreed Font3DDatas On Map Reset: %s",font->Name)); } } } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp index 2b9b7ee4f8..3da85db871 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp @@ -267,7 +267,7 @@ Bool W3DBridge::load(BodyDamageType curDamageState) strcpy(right, pSub->Get_Name()); } REF_PTR_RELEASE(pSub); - //DEBUG_LOG(("Sub obj name %s\n", pSub->Get_Name())); + //DEBUG_LOG(("Sub obj name %s", pSub->Get_Name())); } REF_PTR_RELEASE(pObj); @@ -814,7 +814,7 @@ void W3DBridgeBuffer::loadBridges(W3DTerrainLogic *pTerrainLogic, Bool saveGame) if (pMapObj->getFlag(FLAG_BRIDGE_POINT1)) { pMapObj2 = pMapObj->getNext(); if ( !pMapObj2 || !pMapObj2->getFlag(FLAG_BRIDGE_POINT2)) { - DEBUG_LOG(("Missing second bridge point. Ignoring first.\n")); + DEBUG_LOG(("Missing second bridge point. Ignoring first.")); } if (pMapObj2==NULL) break; if (!pMapObj2->getFlag(FLAG_BRIDGE_POINT2)) continue; @@ -987,7 +987,7 @@ void W3DBridgeBuffer::worldBuilderUpdateBridgeTowers( W3DAssetManager *assetMana pMapObj2 = pMapObj->getNext(); if( !pMapObj2 || !pMapObj2->getFlag( FLAG_BRIDGE_POINT2 ) ) - DEBUG_LOG(("Missing second bridge point. Ignoring first.\n")); + DEBUG_LOG(("Missing second bridge point. Ignoring first.")); if( pMapObj2 == NULL ) break; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDebugIcons.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDebugIcons.cpp index 23680a4e25..68a965704d 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDebugIcons.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDebugIcons.cpp @@ -187,7 +187,7 @@ void W3DDebugIcons::addIcon(const Coord3D *pos, Real width, Int numFramesDuratio { if (pos==NULL) { if (m_numDebugIcons > maxIcons) { - DEBUG_LOG(("Max icons %d\n", m_numDebugIcons)); + DEBUG_LOG(("Max icons %d", m_numDebugIcons)); maxIcons = m_numDebugIcons; } m_numDebugIcons = 0; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp index d94b461dea..df10f776a2 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp @@ -2008,7 +2008,7 @@ void W3DDisplay::draw( void ) if (couldRender) { couldRender = false; - DEBUG_LOG(("Could not do WW3D::Begin_Render()! Are we ALT-Tabbed out?\n")); + DEBUG_LOG(("Could not do WW3D::Begin_Render()! Are we ALT-Tabbed out?")); } } } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp index af7c938293..fc5a706a02 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp @@ -116,7 +116,7 @@ DisplayString *W3DDisplayStringManager::newDisplayString( void ) if( newString == NULL ) { - DEBUG_LOG(( "newDisplayString: Could not allcoate new W3D display string\n" )); + DEBUG_LOG(( "newDisplayString: Could not allcoate new W3D display string" )); assert( 0 ); return NULL; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp index ff1faaa025..1ca606d719 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp @@ -1366,7 +1366,7 @@ void W3DRoadBuffer::moveRoadSegTo(Int fromNdx, Int toNdx) { if (fromNdx<0 || fromNdx>=m_numRoads || toNdx<0 || toNdx>=m_numRoads) { #ifdef RTS_DEBUG - DEBUG_LOG(("bad moveRoadSegTo\n")); + DEBUG_LOG(("bad moveRoadSegTo")); #endif return; } @@ -1494,7 +1494,7 @@ void W3DRoadBuffer::checkLinkAfter(Int ndx) } static Bool warnSegments = true; -#define CHECK_SEGMENTS {if (m_numRoads >= m_maxRoadSegments) { if (warnSegments) DEBUG_LOG(("****** Too many road segments. Need to increase ini values. See john a.\n")); warnSegments = false; return;}} +#define CHECK_SEGMENTS {if (m_numRoads >= m_maxRoadSegments) { if (warnSegments) DEBUG_LOG(("****** Too many road segments. Need to increase ini values. See john a.")); warnSegments = false; return;}} //============================================================================= // W3DRoadBuffer::addMapObject @@ -3358,7 +3358,7 @@ void W3DRoadBuffer::drawRoads(CameraClass * camera, TextureClass *cloudTexture, } #ifdef LOG_STATS if (loadBuffers) { - DEBUG_LOG(("Road poly count %d\n", polys)); + DEBUG_LOG(("Road poly count %d", polys)); } #endif diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp index 28e7098ede..00d73fc29b 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp @@ -2669,7 +2669,7 @@ void W3DShaderManager::init(void) } } - DEBUG_LOG(("ShaderManager ChipsetID %d\n", res)); + DEBUG_LOG(("ShaderManager ChipsetID %d", res)); } // W3DShaderManager::shutdown ======================================================= diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index 3b8f3ab842..a95383ff32 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -400,7 +400,7 @@ void W3DView::buildCameraTransform( Matrix3D *transform ) } //m_3DCamera->Set_View_Plane(DEG_TO_RADF(50.0f)); - //DEBUG_LOG(("zoom %f, SourceZ %f, posZ %f, groundLevel %f CamOffZ %f\n", + //DEBUG_LOG(("zoom %f, SourceZ %f, posZ %f, groundLevel %f CamOffZ %f", // zoom, sourcePos.Z, pos.z, groundLevel,m_cameraOffset.z)); // build new camera transform @@ -416,7 +416,7 @@ void W3DView::buildCameraTransform( Matrix3D *transform ) //if (m_shakerAngles.X >= 0.0f) //{ - // DEBUG_LOG(("m_shakerAngles %f, %f, %f\n", m_shakerAngles.X, m_shakerAngles.Y, m_shakerAngles.Z)); + // DEBUG_LOG(("m_shakerAngles %f, %f, %f", m_shakerAngles.X, m_shakerAngles.Y, m_shakerAngles.Z)); //} // (gth) check if the camera is being controlled by an animation @@ -448,7 +448,7 @@ void W3DView::buildCameraTransform( Matrix3D *transform ) m_pos.z = position.Z; - //DEBUG_LOG(("mpos x%f, y%f, z%f\n", m_pos.x, m_pos.y, m_pos.z )); + //DEBUG_LOG(("mpos x%f, y%f, z%f", m_pos.x, m_pos.y, m_pos.z )); break; } @@ -469,7 +469,7 @@ void W3DView::calcCameraConstraints() { // const Matrix3D& cameraTransform = m_3DCamera->Get_Transform(); -// DEBUG_LOG(("*** rebuilding cam constraints\n")); +// DEBUG_LOG(("*** rebuilding cam constraints")); // ok, now check to ensure that we can't see outside the map region, // and twiddle the camera if needed @@ -1336,7 +1336,7 @@ void W3DView::update(void) { // if we are in a scripted camera movement, take its height above ground as our desired height. m_heightAboveGround = m_currentHeightAboveGround; - //DEBUG_LOG(("Frame %d: height above ground: %g %g %g %g\n", TheGameLogic->getFrame(), m_heightAboveGround, + //DEBUG_LOG(("Frame %d: height above ground: %g %g %g %g", TheGameLogic->getFrame(), m_heightAboveGround, // m_cameraOffset.z, m_zoom, m_terrainHeightUnderCamera)); } if (TheInGameUI->isScrolling()) @@ -1359,7 +1359,7 @@ void W3DView::update(void) Real zoomAdjAbs = fabs(zoomAdj); if (zoomAdjAbs >= 0.0001 && !didScriptedMovement) { - //DEBUG_LOG(("W3DView::update() - m_zoom=%g, desiredHeight=%g\n", m_zoom, desiredZoom)); + //DEBUG_LOG(("W3DView::update() - m_zoom=%g, desiredHeight=%g", m_zoom, desiredZoom)); m_zoom -= zoomAdj; recalcCamera = true; } @@ -1829,7 +1829,7 @@ void W3DView::scrollBy( Coord2D *delta ) Coord3D pos = *getPosition(); pos.x += world.X; pos.y += world.Y; - //DEBUG_LOG(("Delta %.2f, %.2f\n", world.X, world.Z)); + //DEBUG_LOG(("Delta %.2f, %.2f", world.X, world.Z)); // no change to z setPosition(&pos); @@ -1981,7 +1981,7 @@ void W3DView::setZoomToDefault( void ) Real desiredHeight = (terrainHeightMax + m_maxHeightAboveGround); Real desiredZoom = desiredHeight / m_cameraOffset.z; - //DEBUG_LOG(("W3DView::setZoomToDefault() Current zoom: %g Desired zoom: %g\n", m_zoom, desiredZoom)); + //DEBUG_LOG(("W3DView::setZoomToDefault() Current zoom: %g Desired zoom: %g", m_zoom, desiredZoom)); m_zoom = desiredZoom; m_heightAboveGround = m_maxHeightAboveGround; @@ -2801,7 +2801,7 @@ void W3DView::resetCamera(const Coord3D *location, Int milliseconds, Real easeIn pitchCamera( 1.0, milliseconds, easeIn, easeOut ); // pitchCamera( m_defaultPitchAngle, milliseconds, easeIn, easeOut ); - //DEBUG_LOG(("W3DView::resetCamera() Current zoom: %g Desired zoom: %g Current pitch: %g Desired pitch: %g\n", + //DEBUG_LOG(("W3DView::resetCamera() Current zoom: %g Desired zoom: %g Current pitch: %g Desired pitch: %g", // m_zoom, desiredZoom, m_pitchAngle, m_defaultPitchAngle)); } @@ -2900,7 +2900,7 @@ void W3DView::setupWaypointPath(Bool orient) angle -= PI/2; normAngle(angle); } - //DEBUG_LOG(("Original Index %d, angle %.2f\n", i, angle*180/PI)); + //DEBUG_LOG(("Original Index %d, angle %.2f", i, angle*180/PI)); m_mcwpInfo.cameraAngle[i] = angle; } m_mcwpInfo.cameraAngle[1] = getAngle(); @@ -2925,7 +2925,7 @@ void W3DView::setupWaypointPath(Bool orient) m_mcwpInfo.timeMultiplier[i] = m_timeMultiplier; m_mcwpInfo.groundHeight[i] = m_groundLevel*factor1 + newGround*factor2; curDistance += m_mcwpInfo.waySegLength[i]; - //DEBUG_LOG(("New Index %d, angle %.2f\n", i, m_mcwpInfo.cameraAngle[i]*180/PI)); + //DEBUG_LOG(("New Index %d, angle %.2f", i, m_mcwpInfo.cameraAngle[i]*180/PI)); } // Pad the end. @@ -3062,7 +3062,7 @@ void W3DView::zoomCameraOneFrame(void) m_zoom = m_zcInfo.endZoom; } - //DEBUG_LOG(("W3DView::zoomCameraOneFrame() - m_zoom = %g\n", m_zoom)); + //DEBUG_LOG(("W3DView::zoomCameraOneFrame() - m_zoom = %g", m_zoom)); } // ------------------------------------------------------------------------------------------------ @@ -3169,7 +3169,7 @@ void W3DView::moveAlongWaypointPath(Int milliseconds) Real deltaAngle = angle-m_angle; normAngle(deltaAngle); if (fabs(deltaAngle) > PI/10) { - DEBUG_LOG(("Huh.\n")); + DEBUG_LOG(("Huh.")); } m_angle += avgFactor*(deltaAngle); normAngle(m_angle); @@ -3221,7 +3221,7 @@ void W3DView::moveAlongWaypointPath(Int milliseconds) result.z = 0; /* static Real prevGround = 0; - DEBUG_LOG(("Dx %.2f, dy %.2f, DeltaANgle = %.2f, %.2f DeltaGround %.2f\n", m_pos.x-result.x, m_pos.y-result.y, deltaAngle, m_groundLevel, m_groundLevel-prevGround)); + DEBUG_LOG(("Dx %.2f, dy %.2f, DeltaANgle = %.2f, %.2f DeltaGround %.2f", m_pos.x-result.x, m_pos.y-result.y, deltaAngle, m_groundLevel, m_groundLevel-prevGround)); prevGround = m_groundLevel; */ setPosition(&result); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DWebBrowser.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DWebBrowser.cpp index c25b70847e..887419654b 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DWebBrowser.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DWebBrowser.cpp @@ -53,7 +53,7 @@ Bool W3DWebBrowser::createBrowserWindow(const char *tag, GameWindow *win) WebBrowserURL *url = findURL( AsciiString(tag) ); if (url == NULL) { - DEBUG_LOG(("W3DWebBrowser::createBrowserWindow - couldn't find URL for page %s\n", tag)); + DEBUG_LOG(("W3DWebBrowser::createBrowserWindow - couldn't find URL for page %s", tag)); return FALSE; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp index 5338612534..85c6b39648 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp @@ -1269,7 +1269,7 @@ Bool WorldHeightMap::ParseObjectData(DataChunkInput &file, DataChunkInfo *info, } if (loc.zmaxZ) { - DEBUG_LOG(("Removing object at z height %f\n", loc.z)); + DEBUG_LOG(("Removing object at z height %f", loc.z)); return true; } @@ -1279,7 +1279,7 @@ Bool WorldHeightMap::ParseObjectData(DataChunkInput &file, DataChunkInfo *info, pThisOne = newInstance( MapObject )( loc, name, angle, flags, &d, TheThingFactory->findTemplate( name, FALSE ) ); -//DEBUG_LOG(("obj %s owner %s\n",name.str(),d.getAsciiString(TheKey_originalOwner).str())); +//DEBUG_LOG(("obj %s owner %s",name.str(),d.getAsciiString(TheKey_originalOwner).str())); if (pThisOne->getProperties()->getType(TheKey_waypointID) == Dict::DICT_INT) pThisOne->setIsWaypoint(); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp index 2d7a6f2e8c..b6e9e0a73d 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32BIGFileSystem.cpp @@ -81,7 +81,7 @@ ArchiveFile * Win32BIGFileSystem::openArchiveFile(const Char *filename) { Int archiveFileSize = 0; Int numLittleFiles = 0; - DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - opening BIG file %s\n", filename)); + DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - opening BIG file %s", filename)); if (fp == NULL) { DEBUG_CRASH(("Could not open archive file %s for parsing", filename)); @@ -102,7 +102,7 @@ ArchiveFile * Win32BIGFileSystem::openArchiveFile(const Char *filename) { // read in the file size. fp->read(&archiveFileSize, 4); - DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - size of archive file is %d bytes\n", archiveFileSize)); + DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - size of archive file is %d bytes", archiveFileSize)); // char t; @@ -111,7 +111,7 @@ ArchiveFile * Win32BIGFileSystem::openArchiveFile(const Char *filename) { fp->read(&numLittleFiles, 4); numLittleFiles = betoh(numLittleFiles); - DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - %d are contained in archive\n", numLittleFiles)); + DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - %d are contained in archive", numLittleFiles)); // for (Int i = 0; i < 2; ++i) { // t = buffer[i]; // buffer[i] = buffer[(4-i)-1]; @@ -160,7 +160,7 @@ ArchiveFile * Win32BIGFileSystem::openArchiveFile(const Char *filename) { AsciiString debugpath; debugpath = path; debugpath.concat(fileInfo->m_filename); -// DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - adding file %s to archive file %s, file number %d\n", debugpath.str(), fileInfo->m_archiveFilename.str(), i)); +// DEBUG_LOG(("Win32BIGFileSystem::openArchiveFile - adding file %s to archive file %s, file number %d", debugpath.str(), fileInfo->m_archiveFilename.str(), i)); archiveFile->addFile(path, fileInfo); } @@ -213,10 +213,10 @@ Bool Win32BIGFileSystem::loadBigFilesFromDirectory(AsciiString dir, AsciiString ArchiveFile *archiveFile = openArchiveFile((*it).str()); if (archiveFile != NULL) { - DEBUG_LOG(("Win32BIGFileSystem::loadBigFilesFromDirectory - loading %s into the directory tree.\n", (*it).str())); + DEBUG_LOG(("Win32BIGFileSystem::loadBigFilesFromDirectory - loading %s into the directory tree.", (*it).str())); loadIntoDirectoryTree(archiveFile, *it, overwrite); m_archiveFileMap[(*it)] = archiveFile; - DEBUG_LOG(("Win32BIGFileSystem::loadBigFilesFromDirectory - %s inserted into the archive file map.\n", (*it).str())); + DEBUG_LOG(("Win32BIGFileSystem::loadBigFilesFromDirectory - %s inserted into the archive file map.", (*it).str())); actuallyAdded = TRUE; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32LocalFileSystem.cpp b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32LocalFileSystem.cpp index 5595d53827..cd1ea54b1a 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32LocalFileSystem.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/Common/Win32LocalFileSystem.cpp @@ -220,7 +220,7 @@ AsciiString Win32LocalFileSystem::normalizePath(const AsciiString& filePath) con DWORD retval = GetFullPathNameA(filePath.str(), 0, NULL, NULL); if (retval == 0) { - DEBUG_LOG(("Unable to determine buffer size for normalized file path. Error=(%u).\n", GetLastError())); + DEBUG_LOG(("Unable to determine buffer size for normalized file path. Error=(%u).", GetLastError())); return AsciiString::TheEmptyString; } @@ -228,7 +228,7 @@ AsciiString Win32LocalFileSystem::normalizePath(const AsciiString& filePath) con retval = GetFullPathNameA(filePath.str(), retval, normalizedFilePath.getBufferForRead(retval - 1), NULL); if (retval == 0) { - DEBUG_LOG(("Unable to normalize file path '%s'. Error=(%u).\n", filePath.str(), GetLastError())); + DEBUG_LOG(("Unable to normalize file path '%s'. Error=(%u).", filePath.str(), GetLastError())); return AsciiString::TheEmptyString; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp index 6611376deb..5b45e119cf 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIKeyboard.cpp @@ -100,7 +100,7 @@ static void printReturnCode( char *label, HRESULT hr ) if( error->error == hr ) { - DEBUG_LOG(( "%s: '%s' - '0x%08x'\n", label, error->string, hr )); + DEBUG_LOG(( "%s: '%s' - '0x%08x'", label, error->string, hr )); break; } error++; @@ -125,7 +125,7 @@ void DirectInputKeyboard::openKeyboard( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openKeyboard: DirectInputCreate failed\r\n" )); + DEBUG_LOG(( "ERROR - openKeyboard: DirectInputCreate failed" )); assert( 0 ); closeKeyboard(); return; @@ -139,7 +139,7 @@ void DirectInputKeyboard::openKeyboard( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openKeyboard: Unabled to create keyboard device\n" )); + DEBUG_LOG(( "ERROR - openKeyboard: Unabled to create keyboard device" )); assert( 0 ); closeKeyboard(); return; @@ -151,7 +151,7 @@ void DirectInputKeyboard::openKeyboard( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openKeyboard: Unabled to set data format for keyboard\n" )); + DEBUG_LOG(( "ERROR - openKeyboard: Unabled to set data format for keyboard" )); assert( 0 ); closeKeyboard(); return; @@ -169,7 +169,7 @@ void DirectInputKeyboard::openKeyboard( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openKeyboard: Unabled to set cooperative level\n" )); + DEBUG_LOG(( "ERROR - openKeyboard: Unabled to set cooperative level" )); assert( 0 ); closeKeyboard(); return; @@ -187,7 +187,7 @@ void DirectInputKeyboard::openKeyboard( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openKeyboard: Unable to set keyboard buffer size property\n" )); + DEBUG_LOG(( "ERROR - openKeyboard: Unable to set keyboard buffer size property" )); assert( 0 ); closeKeyboard(); return; @@ -199,7 +199,7 @@ void DirectInputKeyboard::openKeyboard( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openKeyboard: Unable to acquire keyboard device\n" )); + DEBUG_LOG(( "ERROR - openKeyboard: Unable to acquire keyboard device" )); // Note - This can happen in windowed mode, and we can re-acquire later. So don't // close the keyboard. jba. // closeKeyboard(); @@ -207,7 +207,7 @@ void DirectInputKeyboard::openKeyboard( void ) } // end if - DEBUG_LOG(( "OK - Keyboard initialized successfully.\n" )); + DEBUG_LOG(( "OK - Keyboard initialized successfully." )); } // end openKeyboard @@ -223,7 +223,7 @@ void DirectInputKeyboard::closeKeyboard( void ) m_pKeyboardDevice->Unacquire(); m_pKeyboardDevice->Release(); m_pKeyboardDevice = NULL; - DEBUG_LOG(( "OK - Keyboard deviced closed\n" )); + DEBUG_LOG(( "OK - Keyboard deviced closed" )); } // end if if( m_pDirectInput ) @@ -231,11 +231,11 @@ void DirectInputKeyboard::closeKeyboard( void ) m_pDirectInput->Release(); m_pDirectInput = NULL; - DEBUG_LOG(( "OK - Keyboard direct input interface closed\n" )); + DEBUG_LOG(( "OK - Keyboard direct input interface closed" )); } // end if - DEBUG_LOG(( "OK - Keyboard shutdown complete\n" )); + DEBUG_LOG(( "OK - Keyboard shutdown complete" )); } // end closeKeyboard diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp index 204c8599e5..aebd15cdaf 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32DIMouse.cpp @@ -54,7 +54,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openMouse: Unabled to create direct input interface\n" )); + DEBUG_LOG(( "ERROR - openMouse: Unabled to create direct input interface" )); assert( 0 ); closeMouse(); return; @@ -68,7 +68,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openMouse: Unable to create mouse device\n" )); + DEBUG_LOG(( "ERROR - openMouse: Unable to create mouse device" )); assert( 0 ); closeMouse(); return; @@ -80,7 +80,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openMouse: Unabled to set mouse data format\n" )); + DEBUG_LOG(( "ERROR - openMouse: Unabled to set mouse data format" )); assert( 0 ); closeMouse(); return; @@ -94,7 +94,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openMouse: Unabled to set coop level\n" )); + DEBUG_LOG(( "ERROR - openMouse: Unabled to set coop level" )); assert( 0 ); closeMouse(); return; @@ -112,7 +112,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openMouse: Unabled to set buffer property\n" )); + DEBUG_LOG(( "ERROR - openMouse: Unabled to set buffer property" )); assert( 0 ); closeMouse(); return; @@ -124,7 +124,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "ERROR - openMouse: Unabled to acquire mouse\n" )); + DEBUG_LOG(( "ERROR - openMouse: Unabled to acquire mouse" )); assert( 0 ); closeMouse(); return; @@ -139,7 +139,7 @@ void DirectInputMouse::openMouse( void ) if( FAILED( hr ) ) { - DEBUG_LOG(( "WARNING - openMouse: Cann't get capabilities of mouse for button setup\n" )); + DEBUG_LOG(( "WARNING - openMouse: Cann't get capabilities of mouse for button setup" )); } // end if else @@ -150,12 +150,12 @@ void DirectInputMouse::openMouse( void ) m_numAxes = (UnsignedByte)diDevCaps.dwAxes; m_forceFeedback = BitIsSet( diDevCaps.dwFlags, DIDC_FORCEFEEDBACK ); - DEBUG_LOG(( "OK - Mouse info: Buttons = '%d', Force Feedback = '%s', Axes = '%d'\n", + DEBUG_LOG(( "OK - Mouse info: Buttons = '%d', Force Feedback = '%s', Axes = '%d'", m_numButtons, m_forceFeedback ? "Yes" : "No", m_numAxes )); } // end else - DEBUG_LOG(( "OK - Mouse initialized successfully\n" )); + DEBUG_LOG(( "OK - Mouse initialized successfully" )); } // end openMouse @@ -172,7 +172,7 @@ void DirectInputMouse::closeMouse( void ) m_pMouseDevice->Unacquire(); m_pMouseDevice->Release(); m_pMouseDevice = NULL; - DEBUG_LOG(( "OK - Mouse device closed\n" )); + DEBUG_LOG(( "OK - Mouse device closed" )); } // end if @@ -182,11 +182,11 @@ void DirectInputMouse::closeMouse( void ) m_pDirectInput->Release(); m_pDirectInput = NULL; - DEBUG_LOG(( "OK - Mouse direct input interface closed\n" )); + DEBUG_LOG(( "OK - Mouse direct input interface closed" )); } // end if - DEBUG_LOG(( "OK - Mouse shutdown complete\n" )); + DEBUG_LOG(( "OK - Mouse shutdown complete" )); } // end closeMouse diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp index f23902ecfa..5b36fd44aa 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp @@ -938,7 +938,7 @@ void DX8Wrapper::Resize_And_Position_Window() { ::SetWindowPos(_Hwnd, HWND_TOPMOST, 0, 0, width, height, SWP_NOSIZE | SWP_NOMOVE); - DEBUG_LOG(("Window resized to w:%d h:%d\n", width, height)); + DEBUG_LOG(("Window resized to w:%d h:%d", width, height)); } else { @@ -961,7 +961,7 @@ void DX8Wrapper::Resize_And_Position_Window() ::SetWindowPos (_Hwnd, NULL, left, top, width, height, SWP_NOZORDER); - DEBUG_LOG(("Window positioned to x:%d y:%d, resized to w:%d h:%d\n", left, top, width, height)); + DEBUG_LOG(("Window positioned to x:%d y:%d, resized to w:%d h:%d", left, top, width, height)); } } } diff --git a/GeneralsMD/Code/Main/WinMain.cpp b/GeneralsMD/Code/Main/WinMain.cpp index 4918c59923..bd6a195fc0 100644 --- a/GeneralsMD/Code/Main/WinMain.cpp +++ b/GeneralsMD/Code/Main/WinMain.cpp @@ -872,16 +872,16 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, ShowWindow(ccwindow, SW_RESTORE); } - DEBUG_LOG(("Generals is already running...Bail!\n")); + DEBUG_LOG(("Generals is already running...Bail!")); delete TheVersion; TheVersion = NULL; shutdownMemoryManager(); DEBUG_SHUTDOWN(); return exitcode; } - DEBUG_LOG(("Create Generals Mutex okay.\n")); + DEBUG_LOG(("Create Generals Mutex okay.")); - DEBUG_LOG(("CRC message is %d\n", GameMessage::MSG_LOGIC_CRC)); + DEBUG_LOG(("CRC message is %d", GameMessage::MSG_LOGIC_CRC)); // run the game main loop exitcode = GameMain(); diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/GUIEdit.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/GUIEdit.cpp index ce3112edd2..0b4d9e541a 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/GUIEdit.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/GUIEdit.cpp @@ -757,7 +757,7 @@ Bool GUIEdit::writeConfigFile( const char *filename ) if( fp == NULL ) { - DEBUG_LOG(( "writeConfigFile: Unable to open file '%s'\n", filename )); + DEBUG_LOG(( "writeConfigFile: Unable to open file '%s'", filename )); assert( 0 ); return FALSE; @@ -3389,7 +3389,7 @@ void GUIEdit::statusMessage( StatusPart part, const char *message ) if( part < 0 || part >= STATUS_NUM_PARTS ) { - DEBUG_LOG(( "Status message part out of range '%d', '%s'\n", part, message )); + DEBUG_LOG(( "Status message part out of range '%d', '%s'", part, message )); assert( 0 ); return; @@ -3890,7 +3890,7 @@ void GUIEdit::selectWindow( GameWindow *window ) if( entry == NULL ) { - DEBUG_LOG(( "Unable to allocate selection entry for window\n" )); + DEBUG_LOG(( "Unable to allocate selection entry for window" )); assert( 0 ); return; @@ -4029,7 +4029,7 @@ void GUIEdit::deleteSelected( void ) if( deleteList == NULL ) { - DEBUG_LOG(( "Cannot allocate delete list!\n" )); + DEBUG_LOG(( "Cannot allocate delete list!" )); assert( 0 ); return; @@ -4072,7 +4072,7 @@ void GUIEdit::bringSelectedToTop( void ) if( snapshot == NULL ) { - DEBUG_LOG(( "bringSelectedToTop: Unabled to allocate selectList\n" )); + DEBUG_LOG(( "bringSelectedToTop: Unabled to allocate selectList" )); assert( 0 ); return; diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp index a25e7d1ce4..3215e7eb36 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp @@ -705,7 +705,7 @@ void HierarchyView::addWindowToTree( GameWindow *window, if( newItem == NULL ) { - DEBUG_LOG(( "Error adding window to tree\n" )); + DEBUG_LOG(( "Error adding window to tree" )); assert( 0 ); return; @@ -986,7 +986,7 @@ void HierarchyView::bringWindowToTop( GameWindow *window ) if( item == NULL ) { - DEBUG_LOG(( "Cannot bring window to top, no entry in tree!\n" )); + DEBUG_LOG(( "Cannot bring window to top, no entry in tree!" )); assert( 0 ); return; @@ -1019,7 +1019,7 @@ void HierarchyView::updateWindowName( GameWindow *window ) if( item == NULL ) { - DEBUG_LOG(( "updateWindowName: No hierarchy entry for window!\n" )); + DEBUG_LOG(( "updateWindowName: No hierarchy entry for window!" )); assert( 0 ); return; @@ -1123,7 +1123,7 @@ void HierarchyView::moveWindowAheadOf( GameWindow *window, if( aheadOfItem == NULL ) { - DEBUG_LOG(( "moveWindowAheadOf: aheadOf has no hierarchy entry!\n" )); + DEBUG_LOG(( "moveWindowAheadOf: aheadOf has no hierarchy entry!" )); assert( 0 ); return; @@ -1159,7 +1159,7 @@ void HierarchyView::moveWindowAheadOf( GameWindow *window, if( newItem == NULL ) { - DEBUG_LOG(( "moveWindowAheadOf: Error adding window to tree\n" )); + DEBUG_LOG(( "moveWindowAheadOf: Error adding window to tree" )); assert( 0 ); return; @@ -1207,7 +1207,7 @@ void HierarchyView::moveWindowChildOf( GameWindow *window, GameWindow *parent ) if( parentItem == NULL ) { - DEBUG_LOG(( "moveWindowChildOf: No parent entry\n" )); + DEBUG_LOG(( "moveWindowChildOf: No parent entry" )); assert( 0 ); return; diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/LayoutScheme.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/LayoutScheme.cpp index ecd0a9eed1..8924ae9bba 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/LayoutScheme.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/LayoutScheme.cpp @@ -2178,7 +2178,7 @@ ImageAndColorInfo *LayoutScheme::findEntry( StateIdentifier id ) if( id < 0 || id >= NUM_STATE_IDENTIFIERS ) { - DEBUG_LOG(( "Illegal state to to layout 'findEntry' '%d'\n", id )); + DEBUG_LOG(( "Illegal state to to layout 'findEntry' '%d'", id )); assert( 0 ); return NULL; @@ -2207,7 +2207,7 @@ ImageAndColorInfo *LayoutScheme::getImageAndColor( StateIdentifier id ) if( id < 0 || id >= NUM_STATE_IDENTIFIERS ) { - DEBUG_LOG(( "getImageAndColor: Illegal state '%d'\n", id )); + DEBUG_LOG(( "getImageAndColor: Illegal state '%d'", id )); assert( 0 ); return NULL; @@ -2229,7 +2229,7 @@ void LayoutScheme::storeImageAndColor( StateIdentifier id, const Image *image, if( id < 0 || id >= NUM_STATE_IDENTIFIERS ) { - DEBUG_LOG(( "Illegal state identifier in layout scheme store image and color '%d'\n", id )); + DEBUG_LOG(( "Illegal state identifier in layout scheme store image and color '%d'", id )); assert( 0 ); return; @@ -2262,7 +2262,7 @@ Bool LayoutScheme::saveScheme( char *filename ) if( fp == NULL ) { - DEBUG_LOG(( "saveScheme: Unable to open file '%s'\n", filename )); + DEBUG_LOG(( "saveScheme: Unable to open file '%s'", filename )); MessageBox( TheEditor->getWindowHandle(), "Unable to open scheme for for saving. Read only?", "Save Error", MB_OK ); return FALSE; @@ -2354,7 +2354,7 @@ Bool LayoutScheme::loadScheme( char *filename ) if( version != SCHEME_VERSION ) { - DEBUG_LOG(( "loadScheme: Old layout file version '%d'\n", version )); + DEBUG_LOG(( "loadScheme: Old layout file version '%d'", version )); MessageBox( TheEditor->getWindowHandle(), "Old layout version, cannot open.", "Old File", MB_OK ); return FALSE; diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/Properties.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/Properties.cpp index be97de5bc6..f31c5947ef 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/Properties.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/Properties.cpp @@ -432,7 +432,7 @@ void InitPropertiesDialog( GameWindow *window, Int x, Int y ) if( dialog == NULL ) { - DEBUG_LOG(( "Error creating properties dialog\n" )); + DEBUG_LOG(( "Error creating properties dialog" )); MessageBox( TheEditor->getWindowHandle(), "Error creating property dialog!", "Error", MB_OK ); assert( 0 ); return; @@ -983,7 +983,7 @@ static void adjustGadgetDrawMethods( Bool useImages, GameWindow *window ) else { - DEBUG_LOG(( "Unable to adjust draw method, undefined gadget\n" )); + DEBUG_LOG(( "Unable to adjust draw method, undefined gadget" )); assert( 0 ); return; @@ -1021,7 +1021,7 @@ static void adjustGadgetDrawMethods( Bool useImages, GameWindow *window ) else { - DEBUG_LOG(( "Unable to adjust draw method, undefined gadget\n" )); + DEBUG_LOG(( "Unable to adjust draw method, undefined gadget" )); assert( 0 ); return; @@ -1349,7 +1349,7 @@ void SwitchToState( StateIdentifier id, HWND dialog ) if( info == NULL ) { - DEBUG_LOG(( "Invalid state request\n" )); + DEBUG_LOG(( "Invalid state request" )); assert( 0 ); return; diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/Save.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/Save.cpp index 615ef68267..8f4370b339 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/Save.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/Save.cpp @@ -577,7 +577,7 @@ static Bool saveDrawData( const char *token, GameWindow *window, else { - DEBUG_LOG(( "Save draw data, unknown token '%s'\n", token )); + DEBUG_LOG(( "Save draw data, unknown token '%s'", token )); assert( 0 ); return FALSE; @@ -616,7 +616,7 @@ static Bool saveListboxData( GameWindow *window, FILE *fp, Int dataIndent ) if( listData == NULL ) { - DEBUG_LOG(( "No listbox data to save for window '%d'\n", + DEBUG_LOG(( "No listbox data to save for window '%d'", window->winGetWindowId() )); assert( 0 ); return FALSE; @@ -702,7 +702,7 @@ static Bool saveComboBoxData( GameWindow *window, FILE *fp, Int dataIndent ) if( comboData == NULL ) { - DEBUG_LOG(( "No comboData data to save for window '%d'\n", + DEBUG_LOG(( "No comboData data to save for window '%d'", window->winGetWindowId() )); assert( 0 ); return FALSE; @@ -802,7 +802,7 @@ static Bool saveRadioButtonData( GameWindow *window, FILE *fp, Int dataIndent ) { - DEBUG_LOG(( "No radio button data to save for window '%d'\n", + DEBUG_LOG(( "No radio button data to save for window '%d'", window->winGetWindowId() )); assert( 0 ); return FALSE; @@ -827,7 +827,7 @@ static Bool saveSliderData( GameWindow *window, FILE *fp, Int dataIndent ) if( sliderData == NULL ) { - DEBUG_LOG(( "No slider data in window to save for window %d\n", + DEBUG_LOG(( "No slider data in window to save for window %d", window->winGetWindowId() )); assert( 0 ); return FALSE; @@ -865,7 +865,7 @@ static Bool saveStaticTextData( GameWindow *window, FILE *fp, Int dataIndent ) if( textData == NULL ) { - DEBUG_LOG(( "No text data in window to save for window %d\n", + DEBUG_LOG(( "No text data in window to save for window %d", window->winGetWindowId() )); assert( 0 ); return FALSE; @@ -890,7 +890,7 @@ static Bool saveTextEntryData( GameWindow *window, FILE *fp, Int dataIndent ) if( entryData == NULL ) { - DEBUG_LOG(( "No text entry data in window to save for window %d\n", + DEBUG_LOG(( "No text entry data in window to save for window %d", window->winGetWindowId() )); assert( 0 ); return FALSE; @@ -923,7 +923,7 @@ static Bool saveTabControlData( GameWindow *window, FILE *fp, Int dataIndent ) if( tabControlData == NULL ) { - DEBUG_LOG(( "No text entry data in window to save for window %d\n", + DEBUG_LOG(( "No text entry data in window to save for window %d", window->winGetWindowId() )); assert( 0 ); return FALSE; diff --git a/GeneralsMD/Code/Tools/ParticleEditor/ParticleTypePanels.cpp b/GeneralsMD/Code/Tools/ParticleEditor/ParticleTypePanels.cpp index d4844c0530..5fa7533579 100644 --- a/GeneralsMD/Code/Tools/ParticleEditor/ParticleTypePanels.cpp +++ b/GeneralsMD/Code/Tools/ParticleEditor/ParticleTypePanels.cpp @@ -64,7 +64,7 @@ void ParticlePanelParticle::InitPanel( void ) findString = PATH; findString += PREFIX; findString += POSTFIX; -// DEBUG_LOG(("ParticlePanedParticle::InitPanel - looking for textures, search string is '%s'\n", findString.begin())); +// DEBUG_LOG(("ParticlePanedParticle::InitPanel - looking for textures, search string is '%s'", findString.begin())); BOOL bWorkin = finder.FindFile(findString.c_str()); while (bWorkin) { bWorkin = finder.FindNextFile(); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/BuildList.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/BuildList.cpp index a0aa98aa16..c24acc990d 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/BuildList.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/BuildList.cpp @@ -117,7 +117,7 @@ void BuildList::loadSides(void) { CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_SIDES_COMBO); if (!pCombo) { - DEBUG_LOG(("*** BuildList::loadSides Missing resource!!!\n")); + DEBUG_LOG(("*** BuildList::loadSides Missing resource!!!")); return; } pCombo->ResetContent(); @@ -144,7 +144,7 @@ void BuildList::updateCurSide(void) CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_SIDES_COMBO); if (!pCombo) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!!\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!!")); return; } if (m_curSide<0 || m_curSide >= TheSidesList->getNumSides()) { @@ -157,7 +157,7 @@ void BuildList::updateCurSide(void) CListBox *pList = (CListBox*)GetDlgItem(IDC_BUILD_LIST); if (!pList) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST")); return; } pList->ResetContent(); @@ -178,7 +178,7 @@ void BuildList::OnSelchangeSidesCombo() CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_SIDES_COMBO); if (!pCombo) { - DEBUG_LOG(("*** BuildList::OnSelchangeSidesCombo Missing resource!!!\n")); + DEBUG_LOG(("*** BuildList::OnSelchangeSidesCombo Missing resource!!!")); return; } @@ -198,7 +198,7 @@ void BuildList::OnMoveUp() { CListBox *pList = (CListBox*)GetDlgItem(IDC_BUILD_LIST); if (!pList) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST")); return; } m_curBuildList = pList->GetCurSel(); @@ -231,7 +231,7 @@ void BuildList::OnMoveDown() { CListBox *pList = (CListBox*)GetDlgItem(IDC_BUILD_LIST); if (!pList) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST")); return; } if (m_curBuildList < 0) return; @@ -330,7 +330,7 @@ void BuildList::OnSelchangeBuildList() CListBox *pList = (CListBox*)GetDlgItem(IDC_BUILD_LIST); if (!pList) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST")); return; } m_curBuildList = pList->GetCurSel(); @@ -419,7 +419,7 @@ void BuildList::OnSelchangeBuildList() { energyUsed = 1.0f; } - //DEBUG_LOG(("Energy: %d/%d - %g\n", energyConsumption, energyProduction, energyUsed)); + //DEBUG_LOG(("Energy: %d/%d - %g", energyConsumption, energyProduction, energyUsed)); CProgressCtrl *progressWnd = (CProgressCtrl *)GetDlgItem(IDC_POWER); if (progressWnd) { @@ -485,7 +485,7 @@ void BuildList::OnAlreadyBuild() { CListBox *pList = (CListBox*)GetDlgItem(IDC_BUILD_LIST); if (!pList) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST")); return; } SidesInfo *pSide = TheSidesList->getSideInfo(m_curSide); @@ -508,7 +508,7 @@ void BuildList::OnDeleteBuilding() { CListBox *pList = (CListBox*)GetDlgItem(IDC_BUILD_LIST); if (!pList) { - DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST\n")); + DEBUG_LOG(("*** BuildList::updateCurSide Missing resource!!! IDC_BUILD_LIST")); return; } m_curBuildList = pList->GetCurSel(); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/GlobalLightOptions.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/GlobalLightOptions.cpp index f3089c11f0..004a32d52c 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/GlobalLightOptions.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/GlobalLightOptions.cpp @@ -142,7 +142,7 @@ static void SpitLights() { #ifdef DEBUG_LOGGING CString lightstrings[100]; - DEBUG_LOG(("GlobalLighting\n\n")); + DEBUG_LOG(("GlobalLighting\n")); Int redA, greenA, blueA; Int redD, greenD, blueD; Real x, y, z; @@ -172,9 +172,9 @@ static void SpitLights() y = TheGlobalData->m_terrainLighting[time+TIME_OF_DAY_FIRST][light].lightPos.y; z = TheGlobalData->m_terrainLighting[time+TIME_OF_DAY_FIRST][light].lightPos.z; - DEBUG_LOG(("TerrainLighting%sAmbient%s = R:%d G:%d B:%d\n", times[time], lights[light], redA, greenA, blueA)); - DEBUG_LOG(("TerrainLighting%sDiffuse%s = R:%d G:%d B:%d\n", times[time], lights[light], redD, greenD, blueD)); - DEBUG_LOG(("TerrainLighting%sLightPos%s = X:%0.2f Y:%0.2f Z:%0.2f\n", times[time], lights[light], x, y, z)); + DEBUG_LOG(("TerrainLighting%sAmbient%s = R:%d G:%d B:%d", times[time], lights[light], redA, greenA, blueA)); + DEBUG_LOG(("TerrainLighting%sDiffuse%s = R:%d G:%d B:%d", times[time], lights[light], redD, greenD, blueD)); + DEBUG_LOG(("TerrainLighting%sLightPos%s = X:%0.2f Y:%0.2f Z:%0.2f", times[time], lights[light], x, y, z)); redA = TheGlobalData->m_terrainObjectsLighting[time+TIME_OF_DAY_FIRST][light].ambient.red*255; greenA = TheGlobalData->m_terrainObjectsLighting[time+TIME_OF_DAY_FIRST][light].ambient.green*255; @@ -188,50 +188,50 @@ static void SpitLights() y = TheGlobalData->m_terrainObjectsLighting[time+TIME_OF_DAY_FIRST][light].lightPos.y; z = TheGlobalData->m_terrainObjectsLighting[time+TIME_OF_DAY_FIRST][light].lightPos.z; - DEBUG_LOG(("TerrainObjectsLighting%sAmbient%s = R:%d G:%d B:%d\n", times[time], lights[light], redA, greenA, blueA)); - DEBUG_LOG(("TerrainObjectsLighting%sDiffuse%s = R:%d G:%d B:%d\n", times[time], lights[light], redD, greenD, blueD)); - DEBUG_LOG(("TerrainObjectsLighting%sLightPos%s = X:%0.2f Y:%0.2f Z:%0.2f\n", times[time], lights[light], x, y, z)); + DEBUG_LOG(("TerrainObjectsLighting%sAmbient%s = R:%d G:%d B:%d", times[time], lights[light], redA, greenA, blueA)); + DEBUG_LOG(("TerrainObjectsLighting%sDiffuse%s = R:%d G:%d B:%d", times[time], lights[light], redD, greenD, blueD)); + DEBUG_LOG(("TerrainObjectsLighting%sLightPos%s = X:%0.2f Y:%0.2f Z:%0.2f", times[time], lights[light], x, y, z)); - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } - DEBUG_LOG(("GlobalLighting Code\n\n")); + DEBUG_LOG(("GlobalLighting Code\n")); for (time=0; time<4; time++) { for (Int light=0; light<3; light++) { Int theTime = time+TIME_OF_DAY_FIRST; GlobalData::TerrainLighting tl = TheGlobalData->m_terrainLighting[theTime][light]; - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].ambient.red = %0.4ff;\n", theTime, light, tl.ambient.red)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].ambient.green = %0.4ff;\n", theTime, light, tl.ambient.green)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].ambient.blue = %0.4ff;\n", theTime, light, tl.ambient.blue)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].ambient.red = %0.4ff;", theTime, light, tl.ambient.red)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].ambient.green = %0.4ff;", theTime, light, tl.ambient.green)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].ambient.blue = %0.4ff;", theTime, light, tl.ambient.blue)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].diffuse.red = %0.4ff;\n", theTime, light, tl.diffuse.red)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].diffuse.green = %0.4ff;\n", theTime, light, tl.diffuse.green)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].diffuse.blue = %0.4ff;\n", theTime, light, tl.diffuse.blue)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].diffuse.red = %0.4ff;", theTime, light, tl.diffuse.red)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].diffuse.green = %0.4ff;", theTime, light, tl.diffuse.green)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].diffuse.blue = %0.4ff;", theTime, light, tl.diffuse.blue)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].lightPos.x = %0.4ff;\n", theTime, light, tl.lightPos.x)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].lightPos.y = %0.4ff;\n", theTime, light, tl.lightPos.y)); - DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].lightPos.z = %0.4ff;\n", theTime, light, tl.lightPos.z)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].lightPos.x = %0.4ff;", theTime, light, tl.lightPos.x)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].lightPos.y = %0.4ff;", theTime, light, tl.lightPos.y)); + DEBUG_LOG(("TheGlobalData->m_terrainLighting[%d][%d].lightPos.z = %0.4ff;", theTime, light, tl.lightPos.z)); tl = TheGlobalData->m_terrainObjectsLighting[theTime][light]; - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].ambient.red = %0.4ff;\n", theTime, light, tl.ambient.red)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].ambient.green = %0.4ff;\n", theTime, light, tl.ambient.green)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].ambient.blue = %0.4ff;\n", theTime, light, tl.ambient.blue)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].ambient.red = %0.4ff;", theTime, light, tl.ambient.red)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].ambient.green = %0.4ff;", theTime, light, tl.ambient.green)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].ambient.blue = %0.4ff;", theTime, light, tl.ambient.blue)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].diffuse.red = %0.4ff;\n", theTime, light, tl.diffuse.red)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].diffuse.green = %0.4ff;\n", theTime, light, tl.diffuse.green)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].diffuse.blue = %0.4ff;\n", theTime, light, tl.diffuse.blue)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].diffuse.red = %0.4ff;", theTime, light, tl.diffuse.red)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].diffuse.green = %0.4ff;", theTime, light, tl.diffuse.green)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].diffuse.blue = %0.4ff;", theTime, light, tl.diffuse.blue)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].lightPos.x = %0.4ff;\n", theTime, light, tl.lightPos.x)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].lightPos.y = %0.4ff;\n", theTime, light, tl.lightPos.y)); - DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].lightPos.z = %0.4ff;\n", theTime, light, tl.lightPos.z)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].lightPos.x = %0.4ff;", theTime, light, tl.lightPos.x)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].lightPos.y = %0.4ff;", theTime, light, tl.lightPos.y)); + DEBUG_LOG(("TheGlobalData->m_terrainObjectsLighting[%d][%d].lightPos.z = %0.4ff;", theTime, light, tl.lightPos.z)); - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } - DEBUG_LOG(("\n")); + DEBUG_LOG(("")); } #endif } diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/MapPreview.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/MapPreview.cpp index d357df86ff..aa73c1490b 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/MapPreview.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/MapPreview.cpp @@ -82,17 +82,17 @@ void MapPreview::save( CString mapName ) chunkWriter.openDataChunk("MapPreview", K_MAPPREVIEW_VERSION_1); chunkWriter.writeInt(MAP_PREVIEW_WIDTH); chunkWriter.writeInt(MAP_PREVIEW_HEIGHT); - DEBUG_LOG(("BeginMapPreviewInfo\n")); + DEBUG_LOG(("BeginMapPreviewInfo")); for(Int i = 0; i < MAP_PREVIEW_HEIGHT; ++i) { for(Int j = 0; j < MAP_PREVIEW_WIDTH; ++j) { chunkWriter.writeInt(m_pixelBuffer[i][j]); - DEBUG_LOG(("x:%d, y:%d, %X\n", j, i, m_pixelBuffer[i][j])); + DEBUG_LOG(("x:%d, y:%d, %X", j, i, m_pixelBuffer[i][j])); } } chunkWriter.closeDataChunk(); - DEBUG_LOG(("EndMapPreviewInfo\n")); + DEBUG_LOG(("EndMapPreviewInfo")); */ } diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/ScriptDialog.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/ScriptDialog.cpp index b086ebfab9..bc0eec358b 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/ScriptDialog.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/ScriptDialog.cpp @@ -1693,7 +1693,7 @@ Bool ScriptDialog::ParseObjectDataChunk(DataChunkInput &file, DataChunkInfo *inf if (pThis->m_maxWaypoint < pThisOne->getWaypointID()) pThis->m_maxWaypoint = pThisOne->getWaypointID(); } - DEBUG_LOG(("Adding object %s (%s)\n", name.str(), pThisOne->getProperties()->getAsciiString(TheKey_originalOwner).str())); + DEBUG_LOG(("Adding object %s (%s)", name.str(), pThisOne->getProperties()->getAsciiString(TheKey_originalOwner).str())); // Check for duplicates. MapObject *pObj; @@ -1773,7 +1773,7 @@ Bool ScriptDialog::ParseTeamsDataChunk(DataChunkInput &file, DataChunkInfo *info if (pThis->m_sides.findTeamInfo(teamName)) { continue; } - DEBUG_LOG(("Adding team %s\n", teamName.str())); + DEBUG_LOG(("Adding team %s", teamName.str())); AsciiString player = teamDict.getAsciiString(TheKey_teamOwner); if (pThis->m_sides.findSideInfo(player)) { // player exists, so just add it. diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/ShadowOptions.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/ShadowOptions.cpp index 087b3f4cbc..e48b2184c3 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/ShadowOptions.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/ShadowOptions.cpp @@ -82,7 +82,7 @@ void ShadowOptions::setShadowColor(void) if (b<0) b = 0; UnsignedInt clr = (255<<24) + (r<<16) + (g<<8) + b; - DEBUG_LOG(("Setting shadows to %x\n", clr)); + DEBUG_LOG(("Setting shadows to %x", clr)); TheW3DShadowManager->setShadowColor(clr); } diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp index c26e75f0bf..3ec2aabef9 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp @@ -2180,7 +2180,7 @@ Bool WorldHeightMapEdit::selectInvalidTeam(void) if (anySelected) { - DEBUG_LOG(("%s\n", report.str())); + DEBUG_LOG(("%s", report.str())); MessageBox(NULL, report.str(), "Missing team report", MB_OK); } @@ -2444,7 +2444,7 @@ Bool WorldHeightMapEdit::doCliffAdjustment(Int xIndex, Int yIndex) ndx = (j*m_width)+i; if (pProcessed[ndx]) continue; CProcessNode *pNewNode = new CProcessNode(i,j); - DEBUG_LOG(("Adding node %d, %d\n", i, j)); + DEBUG_LOG(("Adding node %d, %d", i, j)); pNodes[k++] = pNewNode; Real dx, dy; if (im_x) { @@ -3245,7 +3245,7 @@ void WorldHeightMapEdit::updateFlatCellForAdjacentCliffs(Int xIndex, Int yIndex, } if (!gotXVec && !gotYVec) { - DEBUG_LOG(("Unexpected. jba\n")); + DEBUG_LOG(("Unexpected. jba")); return; } if (gotXVec && !gotYVec) { diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WaterTool.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WaterTool.cpp index 66f5641185..e7546270f6 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WaterTool.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WaterTool.cpp @@ -260,13 +260,13 @@ void WaterTool::fillTheArea(TTrackingMode m, CPoint viewPt, WbView* pView, CWorl intMapHeight = pMap->getHeight(i, j); #ifdef INTENSE_DEBUG if (bottom) { - DEBUG_LOG(("Bottom %d,%d\n", i, j)); + DEBUG_LOG(("Bottom %d,%d", i, j)); } else if (left) { - DEBUG_LOG(("Left %d,%d\n", i, j)); + DEBUG_LOG(("Left %d,%d", i, j)); } else if (right) { - DEBUG_LOG(("Right %d,%d\n", i, j)); + DEBUG_LOG(("Right %d,%d", i, j)); } else if (top) { - DEBUG_LOG(("Top %d,%d\n", i, j)); + DEBUG_LOG(("Top %d,%d", i, j)); } #endif if (bottom) { diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp index 1436f264c4..e7ae4b61d3 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp @@ -288,10 +288,10 @@ BOOL CWorldBuilderApp::InitInstance() DebugSetFlags(DebugGetFlags() | DEBUG_FLAG_LOG_TO_CONSOLE); #endif - DEBUG_LOG(("starting Worldbuilder.\n")); + DEBUG_LOG(("starting Worldbuilder.")); #ifdef RTS_DEBUG - DEBUG_LOG(("RTS_DEBUG defined.\n")); + DEBUG_LOG(("RTS_DEBUG defined.")); #endif initMemoryManager(); #ifdef MEMORYPOOL_CHECKPOINTING @@ -352,7 +352,7 @@ BOOL CWorldBuilderApp::InitInstance() TheWritableGlobalData->m_debugIgnoreAsserts = false; #endif - DEBUG_LOG(("TheWritableGlobalData %x\n", TheWritableGlobalData)); + DEBUG_LOG(("TheWritableGlobalData %x", TheWritableGlobalData)); #if 1 // srj sez: put INI into our user data folder, not the ap dir free((void*)m_pszProfileName); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp index 8b714b110a..1c5f61ceda 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp @@ -191,7 +191,7 @@ class CachedMFCFileOutputStream : public OutputStream c.pData = tmp; c.size = numBytes; m_cachedChunks.push_back(c); - DEBUG_LOG(("Caching %d bytes in chunk %d\n", numBytes, m_cachedChunks.size())); + DEBUG_LOG(("Caching %d bytes in chunk %d", numBytes, m_cachedChunks.size())); m_totalBytes += numBytes; return(numBytes); }; @@ -201,7 +201,7 @@ class CachedMFCFileOutputStream : public OutputStream CachedChunk c = m_cachedChunks.front(); m_cachedChunks.pop_front(); try { - DEBUG_LOG(("Flushing %d bytes\n", c.size)); + DEBUG_LOG(("Flushing %d bytes", c.size)); m_file->Write(c.pData, c.size); } catch(...) {} delete[] c.pData; @@ -225,7 +225,7 @@ class CompressedCachedMFCFileOutputStream : public OutputStream c.pData = tmp; c.size = numBytes; m_cachedChunks.push_back(c); - //DEBUG_LOG(("Caching %d bytes in chunk %d\n", numBytes, m_cachedChunks.size())); + //DEBUG_LOG(("Caching %d bytes in chunk %d", numBytes, m_cachedChunks.size())); m_totalBytes += numBytes; return(numBytes); }; @@ -239,7 +239,7 @@ class CompressedCachedMFCFileOutputStream : public OutputStream CachedChunk c = m_cachedChunks.front(); m_cachedChunks.pop_front(); try { - //DEBUG_LOG(("Flushing %d bytes\n", c.size)); + //DEBUG_LOG(("Flushing %d bytes", c.size)); memcpy(insertPos, c.pData, c.size); insertPos += c.size; } catch(...) {} @@ -258,7 +258,7 @@ class CompressedCachedMFCFileOutputStream : public OutputStream Int compressedLen = CompressionManager::getMaxCompressedSize( m_totalBytes, compressionToUse ); UnsignedByte *destBuffer = NEW UnsignedByte[compressedLen]; compressedLen = CompressionManager::compressData( compressionToUse, srcBuffer, m_totalBytes, destBuffer, compressedLen ); - DEBUG_LOG(("Compressed %d bytes to %d bytes - compression of %g%%\n", m_totalBytes, compressedLen, + DEBUG_LOG(("Compressed %d bytes to %d bytes - compression of %g%%", m_totalBytes, compressedLen, compressedLen/(Real)m_totalBytes*100.0f)); DEBUG_ASSERTCRASH(compressedLen, ("Failed to compress!\n")); if (compressedLen) @@ -485,7 +485,7 @@ AsciiString ConvertFaction(AsciiString name) void CWorldBuilderDoc::validate(void) { - DEBUG_LOG(("Validating\n")); + DEBUG_LOG(("Validating")); Dict swapDict; Bool changed = false; @@ -504,11 +504,11 @@ void CWorldBuilderDoc::validate(void) } const PlayerTemplate* pt = ThePlayerTemplateStore->findPlayerTemplate(NAMEKEY(tmplname)); if (!pt) { - DEBUG_LOG(("Player '%s' Faction '%s' could not be found in sides list!\n", playername.str(), tmplname.str())); + DEBUG_LOG(("Player '%s' Faction '%s' could not be found in sides list!", playername.str(), tmplname.str())); if (tmplname.startsWith("FactionFundamentalist")) { swapName = ConvertFaction(tmplname); if (swapName != AsciiString::TheEmptyString) { - DEBUG_LOG(("Changing Faction from %s to %s\n", tmplname.str(), swapName.str())); + DEBUG_LOG(("Changing Faction from %s to %s", tmplname.str(), swapName.str())); pSide->getDict()->setAsciiString(TheKey_playerFaction, swapName); } } @@ -520,7 +520,7 @@ void CWorldBuilderDoc::validate(void) if (name.startsWith("Fundamentalist")) { swapName = ConvertName(name); if (swapName != AsciiString::TheEmptyString) { - DEBUG_LOG(("Changing BuildList from %s to %s\n", name.str(), swapName.str())); + DEBUG_LOG(("Changing BuildList from %s to %s", name.str(), swapName.str())); pBuild->setTemplateName(swapName); } } @@ -535,7 +535,7 @@ void CWorldBuilderDoc::validate(void) if (type.startsWith("Fundamentalist")) { \ swapName = ConvertName(type); \ if (swapName != AsciiString::TheEmptyString) { \ - DEBUG_LOG(("Changing Team Ref from %s to %s\n", type.str(), swapName.str())); \ + DEBUG_LOG(("Changing Team Ref from %s to %s", type.str(), swapName.str())); \ teamDict->setAsciiString(key, swapName); \ } \ } \ @@ -619,7 +619,7 @@ void CWorldBuilderDoc::validate(void) changed = true; pMapObj->setName(swapName); pMapObj->setThingTemplate(tt); - DEBUG_LOG(("Changing Map Object from %s to %s\n", name.str(), swapName.str())); + DEBUG_LOG(("Changing Map Object from %s to %s", name.str(), swapName.str())); } } } @@ -642,26 +642,26 @@ void CWorldBuilderDoc::validate(void) } const PlayerTemplate* pt = ThePlayerTemplateStore->findPlayerTemplate(NAMEKEY(tmplname)); if (!pt) { - DEBUG_LOG(("Player '%s' Faction '%s' could not be found in sides list!\n", playername.str(), tmplname.str())); + DEBUG_LOG(("Player '%s' Faction '%s' could not be found in sides list!", playername.str(), tmplname.str())); if (tmplname.startsWith("FactionFundamentalist")) { swapName = ConvertFaction(tmplname); if (swapName != AsciiString::TheEmptyString) { - DEBUG_LOG(("Changing Faction from %s to %s\n", tmplname.str(), swapName.str())); + DEBUG_LOG(("Changing Faction from %s to %s", tmplname.str(), swapName.str())); pSide->getDict()->setAsciiString(TheKey_playerFaction, swapName); } } } } else { needToFixTeams = true; - DEBUG_LOG(("Side '%s' could not be found in sides list!\n", teamOwner.str())); + DEBUG_LOG(("Side '%s' could not be found in sides list!", teamOwner.str())); } } else { needToFixTeams = true; - DEBUG_LOG(("Team '%s' could not be found in sides list!\n", teamName.str())); + DEBUG_LOG(("Team '%s' could not be found in sides list!", teamName.str())); } } else { needToFixTeams = true; - DEBUG_LOG(("Object '%s' does not have a team at all!\n", name.str())); + DEBUG_LOG(("Object '%s' does not have a team at all!", name.str())); } } if (needToFixTeams) { @@ -674,7 +674,7 @@ void CWorldBuilderDoc::OnJumpToGame() try { DoFileSave(); CString filename; - DEBUG_LOG(("strTitle=%s strPathName=%s\n", m_strTitle, m_strPathName)); + DEBUG_LOG(("strTitle=%s strPathName=%s", m_strTitle, m_strPathName)); if (strstr(m_strPathName, TheGlobalData->getPath_UserData().str()) != NULL) filename.Format("%sMaps\\%s", TheGlobalData->getPath_UserData().str(), static_cast(m_strTitle)); else @@ -843,7 +843,7 @@ Bool CWorldBuilderDoc::ParseWaypointData(DataChunkInput &file, DataChunkInfo *in for (i=0; im_waypointLinks[i].waypoint1 = file.readInt(); this->m_waypointLinks[i].waypoint2 = file.readInt(); - //DEBUG_LOG(("Waypoint link from %d to %d\n", m_waypointLinks[i].waypoint1, m_waypointLinks[i].waypoint2)); + //DEBUG_LOG(("Waypoint link from %d to %d", m_waypointLinks[i].waypoint1, m_waypointLinks[i].waypoint2)); } DEBUG_ASSERTCRASH(file.atEndOfChunk(), ("Unexpected data left over.")); return true; @@ -1408,7 +1408,7 @@ BOOL CWorldBuilderDoc::OnOpenDocument(LPCTSTR lpszPathName) while (s.getLength() && s.getCharAt(s.getLength()-1) != '\\') s.removeLastChar(); s.concat("map.str"); - DEBUG_LOG(("Looking for map-specific text in [%s]\n", s.str())); + DEBUG_LOG(("Looking for map-specific text in [%s]", s.str())); TheGameText->initMapStringFile(s); WbApp()->setCurrentDirectory(AsciiString(buf)); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/playerlistdlg.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/playerlistdlg.cpp index 500791de6c..1b6e87d1c4 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/playerlistdlg.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/playerlistdlg.cpp @@ -53,7 +53,7 @@ static void fixDefaultTeamName(SidesList& sides, AsciiString oldpname, AsciiStri { tname.set("team"); tname.concat(newpname); - DEBUG_LOG(("rename team %s -> %s\n",ti->getDict()->getAsciiString(TheKey_teamName).str(),tname.str())); + DEBUG_LOG(("rename team %s -> %s",ti->getDict()->getAsciiString(TheKey_teamName).str(),tname.str())); ti->getDict()->setAsciiString(TheKey_teamName, tname); ti->getDict()->setAsciiString(TheKey_teamOwner, newpname); } @@ -159,7 +159,7 @@ static AsciiString extractFromAlliesList(CListBox *alliesList, SidesList& sides) allies.concat(UIToInternal(sides, nm)); } } -//DEBUG_LOG(("a/e is (%s)\n",allies.str())); +//DEBUG_LOG(("a/e is (%s)",allies.str())); return allies; } diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/wbview.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/wbview.cpp index 02401e8692..163a547721 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/wbview.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/wbview.cpp @@ -195,7 +195,7 @@ void WbView::mouseMove(TTrackingMode m, CPoint viewPt) while (::PeekMessage(&msg, m_hWnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE)) { viewPt.x = (short)LOWORD(msg.lParam); // horizontal position of cursor viewPt.y = (short)HIWORD(msg.lParam); // vertical position of cursor - DEBUG_LOG(("Peek mouse %d, %d\n", viewPt.x, viewPt.y)); + DEBUG_LOG(("Peek mouse %d, %d", viewPt.x, viewPt.y)); } if (m_trackingMode == TRACK_NONE) { @@ -1002,7 +1002,7 @@ void WbView::OnValidationFixTeams() SidesInfo* pSide = TheSidesList->findSideInfo(teamOwner); if (!pSide) { teamExists = false; - DEBUG_LOG(("Side '%s' could not be found in sides list!\n", teamOwner.str())); + DEBUG_LOG(("Side '%s' could not be found in sides list!", teamOwner.str())); } } else { // Couldn't find team. [8/8/2003] diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp index 055ed7af09..af8d194789 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp @@ -635,7 +635,7 @@ void WbView3d::setupCamera() Real zAbs = zOffset + zPos; if (zAbs<0) zAbs = -zAbs; if (zAbs<0.01) zAbs = 0.01f; - //DEBUG_LOG(("zOffset = %.2f, zAbs = %.2f, zPos = %.2f\n", zOffset, zAbs, zPos)); + //DEBUG_LOG(("zOffset = %.2f, zAbs = %.2f, zPos = %.2f", zOffset, zAbs, zPos)); if (zOffset > 0) { zOffset *= zAbs; } else if (zOffset < -0.3f) { @@ -644,7 +644,7 @@ void WbView3d::setupCamera() if (zOffset < -0.6f) { zOffset = -0.3f + zOffset/2.0f; } - //DEBUG_LOG(("zOffset = %.2f\n", zOffset)); + //DEBUG_LOG(("zOffset = %.2f", zOffset)); zoom = zAbs; } @@ -714,7 +714,7 @@ void WbView3d::setupCamera() m_cameraSource = sourcePos; m_cameraTarget = targetPos; /* - DEBUG_LOG(("Camera: pos=(%g,%g) height=%g pitch=%g FXPitch=%g yaw=%g groundLevel=%g\n", + DEBUG_LOG(("Camera: pos=(%g,%g) height=%g pitch=%g FXPitch=%g yaw=%g groundLevel=%g", targetPos.X, targetPos.Y, m_actualHeightAboveGround, pitch, @@ -2782,7 +2782,7 @@ Real WbView3d::getCurrentZoom(void) Real zAbs = zOffset + zPos; if (zAbs<0) zAbs = -zAbs; if (zAbs<0.01) zAbs = 0.01f; - //DEBUG_LOG(("zOffset = %.2f, zAbs = %.2f, zPos = %.2f\n", zOffset, zAbs, zPos)); + //DEBUG_LOG(("zOffset = %.2f, zAbs = %.2f, zPos = %.2f", zOffset, zAbs, zPos)); if (zOffset > 0) { zOffset *= zAbs; } else if (zOffset < -0.3f) { @@ -2791,7 +2791,7 @@ Real WbView3d::getCurrentZoom(void) if (zOffset < -0.6f) { zOffset = -0.3f + zOffset/2.0f; } - //DEBUG_LOG(("zOffset = %.2f\n", zOffset)); + //DEBUG_LOG(("zOffset = %.2f", zOffset)); zoom = zAbs; } return zoom; From 003cf4038657c0eef756ddcf45b3c5346c1d1761 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Mon, 7 Jul 2025 19:16:49 +0200 Subject: [PATCH 03/13] [GEN][ZH] Remove trailing LF from DEBUG_CRASH strings with script (#1232) --- Core/GameEngine/Source/Common/System/Xfer.cpp | 28 ++++++------- .../Source/Common/System/XferCRC.cpp | 14 +++---- .../Source/Common/System/XferLoad.cpp | 14 +++---- .../Source/Common/System/XferSave.cpp | 26 ++++++------ .../Source/Compression/CompressionManager.cpp | 2 +- .../GameEngine/Include/Common/BitFlagsIO.h | 2 +- .../Include/Common/SparseMatchFinder.h | 2 +- .../Include/Common/StreamingArchiveFile.h | 8 ++-- .../GameEngine/Include/Common/ThingTemplate.h | 2 +- .../Source/Common/Audio/GameAudio.cpp | 10 ++--- .../GameEngine/Source/Common/CommandLine.cpp | 2 +- .../Code/GameEngine/Source/Common/Dict.cpp | 12 +++--- .../Code/GameEngine/Source/Common/GameLOD.cpp | 12 +++--- .../Code/GameEngine/Source/Common/INI/INI.cpp | 18 ++++---- .../Source/Common/INI/INIAnimation.cpp | 2 +- .../Source/Common/NameKeyGenerator.cpp | 4 +- .../GameEngine/Source/Common/PerfTimer.cpp | 2 +- .../GameEngine/Source/Common/RTS/Player.cpp | 22 +++++----- .../Source/Common/RTS/PlayerList.cpp | 10 ++--- .../GameEngine/Source/Common/RTS/Science.cpp | 2 +- .../Source/Common/RTS/ScoreKeeper.cpp | 6 +-- .../GameEngine/Source/Common/RTS/Team.cpp | 10 ++--- .../Source/Common/RTS/TunnelTracker.cpp | 4 +- .../GameEngine/Source/Common/RandomValue.cpp | 4 +- .../Source/Common/System/DataChunk.cpp | 4 +- .../Source/Common/System/FileSystem.cpp | 4 +- .../Source/Common/System/GameMemory.cpp | 10 ++--- .../Source/Common/System/MemoryInit.cpp | 2 +- .../Source/Common/System/RAMFile.cpp | 2 +- .../GameEngine/Source/Common/System/Radar.cpp | 12 +++--- .../Common/System/SaveGame/GameState.cpp | 20 ++++----- .../Common/System/SaveGame/GameStateMap.cpp | 20 ++++----- .../Common/System/StreamingArchiveFile.cpp | 2 +- .../GameEngine/Source/Common/Thing/Module.cpp | 4 +- .../Source/Common/Thing/ModuleFactory.cpp | 4 +- .../Source/Common/Thing/ThingFactory.cpp | 6 +-- .../Source/Common/Thing/ThingTemplate.cpp | 22 +++++----- .../GameEngine/Source/GameClient/Drawable.cpp | 12 +++--- .../GameClient/GUI/ControlBar/ControlBar.cpp | 2 +- .../GUI/ControlBar/ControlBarCommand.cpp | 2 +- .../GUI/GUICallbacks/Menus/ScoreScreen.cpp | 2 +- .../GUICallbacks/Menus/WOLBuddyOverlay.cpp | 4 +- .../GUI/Gadget/GadgetPushButton.cpp | 2 +- .../Source/GameClient/GUI/GameFont.cpp | 6 +-- .../Source/GameClient/GUI/Shell/Shell.cpp | 2 +- .../Source/GameClient/GameClient.cpp | 14 +++---- .../GameEngine/Source/GameClient/InGameUI.cpp | 6 +-- .../Source/GameClient/Input/Keyboard.cpp | 2 +- .../Source/GameClient/Input/Mouse.cpp | 2 +- .../GameEngine/Source/GameClient/MapUtil.cpp | 10 ++--- .../GameClient/MessageStream/MetaEvent.cpp | 2 +- .../Source/GameClient/RadiusDecal.cpp | 4 +- .../Source/GameClient/System/Anim2D.cpp | 16 +++---- .../Source/GameClient/System/ParticleSys.cpp | 16 +++---- .../GameClient/Terrain/TerrainRoads.cpp | 8 ++-- .../Source/GameLogic/AI/AIPlayer.cpp | 8 ++-- .../Source/GameLogic/AI/AIStates.cpp | 4 +- .../GameEngine/Source/GameLogic/AI/Squad.cpp | 2 +- .../Source/GameLogic/AI/TurretAI.cpp | 2 +- .../Source/GameLogic/Map/SidesList.cpp | 6 +-- .../Source/GameLogic/Map/TerrainLogic.cpp | 14 +++---- .../Object/Behavior/BridgeBehavior.cpp | 26 ++++++------ .../Behavior/DumbProjectileBehavior.cpp | 2 +- .../Behavior/GenerateMinefieldBehavior.cpp | 2 +- .../Object/Behavior/MinefieldBehavior.cpp | 2 +- .../Object/Behavior/ParkingPlaceBehavior.cpp | 2 +- .../Object/Behavior/PrisonBehavior.cpp | 2 +- .../Behavior/PropagandaTowerBehavior.cpp | 4 +- .../Object/Behavior/RebuildHoleBehavior.cpp | 4 +- .../Object/Behavior/SlowDeathBehavior.cpp | 2 +- .../Object/Behavior/SpawnBehavior.cpp | 2 +- .../GameLogic/Object/Body/ActiveBody.cpp | 2 +- .../GameLogic/Object/Contain/CaveContain.cpp | 2 +- .../Object/Contain/GarrisonContain.cpp | 14 +++---- .../GameLogic/Object/Contain/OpenContain.cpp | 8 ++-- .../Object/Contain/ParachuteContain.cpp | 4 +- .../Source/GameLogic/Object/GhostObject.cpp | 2 +- .../Source/GameLogic/Object/Locomotor.cpp | 8 ++-- .../Source/GameLogic/Object/Object.cpp | 10 ++--- .../Source/GameLogic/Object/ObjectTypes.cpp | 2 +- .../GameLogic/Object/PartitionManager.cpp | 6 +-- .../SpecialPower/SpecialPowerModule.cpp | 4 +- .../GameLogic/Object/Update/AIUpdate.cpp | 4 +- .../Update/AIUpdate/ChinookAIUpdate.cpp | 2 +- .../Object/Update/AIUpdate/DozerAIUpdate.cpp | 6 +-- .../Update/AIUpdate/POWTruckAIUpdate.cpp | 4 +- .../Object/Update/AIUpdate/WorkerAIUpdate.cpp | 4 +- .../GameLogic/Object/Update/BoneFXUpdate.cpp | 2 +- .../GameLogic/Object/Update/HordeUpdate.cpp | 2 +- .../Update/NeutronMissileSlowDeathUpdate.cpp | 2 +- .../Object/Update/NeutronMissileUpdate.cpp | 4 +- .../Update/ParticleUplinkCannonUpdate.cpp | 2 +- .../Object/Update/ProductionUpdate.cpp | 8 ++-- .../GameLogic/Object/Update/StealthUpdate.cpp | 2 +- .../Object/Update/WaveGuideUpdate.cpp | 4 +- .../Source/GameLogic/Object/Weapon.cpp | 6 +-- .../Source/GameLogic/Object/WeaponSet.cpp | 6 +-- .../GameLogic/ScriptEngine/ScriptActions.cpp | 2 +- .../ScriptEngine/ScriptConditions.cpp | 4 +- .../GameLogic/ScriptEngine/ScriptEngine.cpp | 38 ++++++++--------- .../Source/GameLogic/ScriptEngine/Scripts.cpp | 4 +- .../Source/GameLogic/System/CaveSystem.cpp | 2 +- .../Source/GameLogic/System/GameLogic.cpp | 18 ++++---- .../Source/GameNetwork/ConnectionManager.cpp | 2 +- .../Source/GameNetwork/FirewallHelper.cpp | 2 +- .../GameEngine/Source/GameNetwork/GUIUtil.cpp | 2 +- .../Source/GameNetwork/GameInfo.cpp | 2 +- .../Source/GameNetwork/GameSpy/LobbyUtils.cpp | 2 +- .../Source/GameNetwork/Transport.cpp | 2 +- .../MilesAudioDevice/MilesAudioManager.cpp | 6 +-- .../W3DDevice/Common/System/W3DRadar.cpp | 2 +- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 42 +++++++++---------- .../GameClient/W3DDisplayStringManager.cpp | 2 +- .../W3DDevice/GameClient/W3DTerrainVisual.cpp | 6 +-- .../W3DDevice/GameClient/Water/W3DWater.cpp | 4 +- .../W3DDevice/GameLogic/W3DGhostObject.cpp | 4 +- .../Win32Device/GameClient/Win32Mouse.cpp | 2 +- .../Source/WWVegas/WW3D2/dx8renderer.cpp | 2 +- .../Code/Tools/WorldBuilder/src/MainFrm.cpp | 2 +- .../Tools/WorldBuilder/src/ObjectOptions.cpp | 4 +- .../Tools/WorldBuilder/src/WBFrameWnd.cpp | 2 +- .../GameEngine/Include/Common/BitFlagsIO.h | 2 +- .../Include/Common/SparseMatchFinder.h | 2 +- .../Include/Common/StreamingArchiveFile.h | 8 ++-- .../GameEngine/Include/Common/ThingTemplate.h | 2 +- .../Source/Common/Audio/GameAudio.cpp | 10 ++--- .../GameEngine/Source/Common/CommandLine.cpp | 2 +- .../Code/GameEngine/Source/Common/Dict.cpp | 12 +++--- .../Code/GameEngine/Source/Common/GameLOD.cpp | 12 +++--- .../Code/GameEngine/Source/Common/INI/INI.cpp | 20 ++++----- .../Source/Common/INI/INIAnimation.cpp | 2 +- .../Source/Common/NameKeyGenerator.cpp | 4 +- .../GameEngine/Source/Common/PerfTimer.cpp | 2 +- .../GameEngine/Source/Common/RTS/Player.cpp | 22 +++++----- .../Source/Common/RTS/PlayerList.cpp | 10 ++--- .../GameEngine/Source/Common/RTS/Science.cpp | 2 +- .../Source/Common/RTS/ScoreKeeper.cpp | 6 +-- .../GameEngine/Source/Common/RTS/Team.cpp | 10 ++--- .../Source/Common/RTS/TunnelTracker.cpp | 4 +- .../GameEngine/Source/Common/RandomValue.cpp | 4 +- .../Source/Common/System/DataChunk.cpp | 4 +- .../Source/Common/System/FileSystem.cpp | 4 +- .../Source/Common/System/GameMemory.cpp | 10 ++--- .../Source/Common/System/MemoryInit.cpp | 2 +- .../Source/Common/System/RAMFile.cpp | 2 +- .../GameEngine/Source/Common/System/Radar.cpp | 12 +++--- .../Common/System/SaveGame/GameState.cpp | 20 ++++----- .../Common/System/SaveGame/GameStateMap.cpp | 20 ++++----- .../Common/System/StreamingArchiveFile.cpp | 2 +- .../GameEngine/Source/Common/Thing/Module.cpp | 4 +- .../Source/Common/Thing/ModuleFactory.cpp | 4 +- .../Source/Common/Thing/ThingFactory.cpp | 6 +-- .../Source/Common/Thing/ThingTemplate.cpp | 22 +++++----- .../GameEngine/Source/GameClient/Drawable.cpp | 12 +++--- .../GameClient/GUI/ControlBar/ControlBar.cpp | 2 +- .../GUI/ControlBar/ControlBarCommand.cpp | 2 +- .../GUI/GUICallbacks/Menus/ScoreScreen.cpp | 2 +- .../GUICallbacks/Menus/WOLBuddyOverlay.cpp | 4 +- .../GUI/Gadget/GadgetPushButton.cpp | 2 +- .../Source/GameClient/GUI/GameFont.cpp | 6 +-- .../Source/GameClient/GUI/Shell/Shell.cpp | 2 +- .../Source/GameClient/GameClient.cpp | 14 +++---- .../GameEngine/Source/GameClient/InGameUI.cpp | 6 +-- .../Source/GameClient/Input/Keyboard.cpp | 2 +- .../Source/GameClient/Input/Mouse.cpp | 2 +- .../GameEngine/Source/GameClient/MapUtil.cpp | 10 ++--- .../GameClient/MessageStream/MetaEvent.cpp | 2 +- .../Source/GameClient/ParabolicEase.cpp | 8 ++-- .../Source/GameClient/RadiusDecal.cpp | 4 +- .../Source/GameClient/System/Anim2D.cpp | 16 +++---- .../Source/GameClient/System/ParticleSys.cpp | 14 +++---- .../GameClient/Terrain/TerrainRoads.cpp | 8 ++-- .../Source/GameLogic/AI/AIPlayer.cpp | 8 ++-- .../Source/GameLogic/AI/AIStates.cpp | 6 +-- .../GameEngine/Source/GameLogic/AI/Squad.cpp | 2 +- .../Source/GameLogic/AI/TurretAI.cpp | 2 +- .../Source/GameLogic/Map/SidesList.cpp | 6 +-- .../Source/GameLogic/Map/TerrainLogic.cpp | 14 +++---- .../Object/Behavior/BridgeBehavior.cpp | 26 ++++++------ .../Behavior/DumbProjectileBehavior.cpp | 2 +- .../Object/Behavior/FlightDeckBehavior.cpp | 2 +- .../Behavior/GenerateMinefieldBehavior.cpp | 2 +- .../Object/Behavior/MinefieldBehavior.cpp | 2 +- .../Object/Behavior/ParkingPlaceBehavior.cpp | 2 +- .../Object/Behavior/PrisonBehavior.cpp | 2 +- .../Behavior/PropagandaTowerBehavior.cpp | 4 +- .../Object/Behavior/RebuildHoleBehavior.cpp | 4 +- .../Object/Behavior/SlowDeathBehavior.cpp | 2 +- .../Object/Behavior/SpawnBehavior.cpp | 2 +- .../GameLogic/Object/Body/ActiveBody.cpp | 2 +- .../GameLogic/Object/Contain/CaveContain.cpp | 2 +- .../Object/Contain/GarrisonContain.cpp | 14 +++---- .../GameLogic/Object/Contain/OpenContain.cpp | 8 ++-- .../Object/Contain/ParachuteContain.cpp | 4 +- .../Source/GameLogic/Object/GhostObject.cpp | 2 +- .../Source/GameLogic/Object/Locomotor.cpp | 8 ++-- .../Source/GameLogic/Object/Object.cpp | 10 ++--- .../Source/GameLogic/Object/ObjectTypes.cpp | 2 +- .../GameLogic/Object/PartitionManager.cpp | 6 +-- .../SpecialPower/SpecialPowerModule.cpp | 4 +- .../GameLogic/Object/Update/AIUpdate.cpp | 4 +- .../Update/AIUpdate/ChinookAIUpdate.cpp | 2 +- .../Object/Update/AIUpdate/DozerAIUpdate.cpp | 6 +-- .../Update/AIUpdate/POWTruckAIUpdate.cpp | 4 +- .../Object/Update/AIUpdate/WorkerAIUpdate.cpp | 4 +- .../GameLogic/Object/Update/BoneFXUpdate.cpp | 2 +- .../GameLogic/Object/Update/HordeUpdate.cpp | 2 +- .../Update/NeutronMissileSlowDeathUpdate.cpp | 2 +- .../Object/Update/NeutronMissileUpdate.cpp | 4 +- .../Update/ParticleUplinkCannonUpdate.cpp | 2 +- .../Object/Update/ProductionUpdate.cpp | 8 ++-- .../GameLogic/Object/Update/StealthUpdate.cpp | 2 +- .../Object/Update/WaveGuideUpdate.cpp | 4 +- .../Source/GameLogic/Object/Weapon.cpp | 6 +-- .../Source/GameLogic/Object/WeaponSet.cpp | 6 +-- .../GameLogic/ScriptEngine/ScriptActions.cpp | 2 +- .../ScriptEngine/ScriptConditions.cpp | 4 +- .../GameLogic/ScriptEngine/ScriptEngine.cpp | 38 ++++++++--------- .../Source/GameLogic/ScriptEngine/Scripts.cpp | 4 +- .../Source/GameLogic/System/CaveSystem.cpp | 2 +- .../Source/GameLogic/System/GameLogic.cpp | 18 ++++---- .../Source/GameNetwork/ConnectionManager.cpp | 2 +- .../Source/GameNetwork/FirewallHelper.cpp | 2 +- .../GameEngine/Source/GameNetwork/GUIUtil.cpp | 2 +- .../Source/GameNetwork/GameInfo.cpp | 2 +- .../Source/GameNetwork/GameSpy/LobbyUtils.cpp | 2 +- .../Source/GameNetwork/Transport.cpp | 2 +- .../MilesAudioDevice/MilesAudioManager.cpp | 6 +-- .../W3DDevice/Common/System/W3DRadar.cpp | 2 +- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 42 +++++++++---------- .../GameClient/W3DDisplayStringManager.cpp | 2 +- .../W3DDevice/GameClient/W3DPropBuffer.cpp | 2 +- .../W3DDevice/GameClient/W3DTerrainVisual.cpp | 6 +-- .../W3DDevice/GameClient/W3DTreeBuffer.cpp | 6 +-- .../W3DDevice/GameClient/Water/W3DWater.cpp | 4 +- .../W3DDevice/GameLogic/W3DGhostObject.cpp | 4 +- .../Win32Device/GameClient/Win32Mouse.cpp | 2 +- .../Source/WWVegas/WW3D2/dx8renderer.cpp | 2 +- .../Code/Tools/WorldBuilder/src/MainFrm.cpp | 2 +- .../Tools/WorldBuilder/src/ObjectOptions.cpp | 4 +- .../Tools/WorldBuilder/src/WBFrameWnd.cpp | 2 +- 241 files changed, 772 insertions(+), 772 deletions(-) diff --git a/Core/GameEngine/Source/Common/System/Xfer.cpp b/Core/GameEngine/Source/Common/System/Xfer.cpp index bd01b38f2d..3485dcfb7a 100644 --- a/Core/GameEngine/Source/Common/System/Xfer.cpp +++ b/Core/GameEngine/Source/Common/System/Xfer.cpp @@ -85,7 +85,7 @@ void Xfer::xferVersion( XferVersion *versionData, XferVersion currentVersion ) if( *versionData > currentVersion ) { - DEBUG_CRASH(( "XferVersion - Unknown version '%d' should be no higher than '%d'\n", + DEBUG_CRASH(( "XferVersion - Unknown version '%d' should be no higher than '%d'", *versionData, currentVersion )); throw XFER_INVALID_VERSION; @@ -398,7 +398,7 @@ void Xfer::xferSTLObjectIDVector( std::vector *objectIDVectorData ) if( objectIDVectorData->size() != 0 ) { - DEBUG_CRASH(( "Xfer::xferSTLObjectIDList - object vector should be empty before loading\n" )); + DEBUG_CRASH(( "Xfer::xferSTLObjectIDList - object vector should be empty before loading" )); throw XFER_LIST_NOT_EMPTY; } // end if @@ -416,7 +416,7 @@ void Xfer::xferSTLObjectIDVector( std::vector *objectIDVectorData ) else { - DEBUG_CRASH(( "xferSTLObjectIDList - Unknown xfer mode '%d'\n", getXferMode() )); + DEBUG_CRASH(( "xferSTLObjectIDList - Unknown xfer mode '%d'", getXferMode() )); throw XFER_MODE_UNKNOWN; } // end else @@ -465,7 +465,7 @@ void Xfer::xferSTLObjectIDList( std::list< ObjectID > *objectIDListData ) if( objectIDListData->size() != 0 ) { - DEBUG_CRASH(( "Xfer::xferSTLObjectIDList - object list should be empty before loading\n" )); + DEBUG_CRASH(( "Xfer::xferSTLObjectIDList - object list should be empty before loading" )); throw XFER_LIST_NOT_EMPTY; } // end if @@ -483,7 +483,7 @@ void Xfer::xferSTLObjectIDList( std::list< ObjectID > *objectIDListData ) else { - DEBUG_CRASH(( "xferSTLObjectIDList - Unknown xfer mode '%d'\n", getXferMode() )); + DEBUG_CRASH(( "xferSTLObjectIDList - Unknown xfer mode '%d'", getXferMode() )); throw XFER_MODE_UNKNOWN; } // end else @@ -531,7 +531,7 @@ void Xfer::xferSTLIntList( std::list< Int > *intListData ) if( intListData->size() != 0 ) { - DEBUG_CRASH(( "Xfer::xferSTLIntList - int list should be empty before loading\n" )); + DEBUG_CRASH(( "Xfer::xferSTLIntList - int list should be empty before loading" )); throw XFER_LIST_NOT_EMPTY; } // end if @@ -549,7 +549,7 @@ void Xfer::xferSTLIntList( std::list< Int > *intListData ) else { - DEBUG_CRASH(( "xferSTLIntList - Unknown xfer mode '%d'\n", getXferMode() )); + DEBUG_CRASH(( "xferSTLIntList - Unknown xfer mode '%d'", getXferMode() )); throw XFER_MODE_UNKNOWN; } // end else @@ -584,7 +584,7 @@ void Xfer::xferScienceType( ScienceType *science ) if( *science == SCIENCE_INVALID ) { - DEBUG_CRASH(( "xferScienceType - Unknown science '%s'\n", scienceName.str() )); + DEBUG_CRASH(( "xferScienceType - Unknown science '%s'", scienceName.str() )); throw XFER_UNKNOWN_STRING; } // end if @@ -598,7 +598,7 @@ void Xfer::xferScienceType( ScienceType *science ) else { - DEBUG_CRASH(( "xferScienceType - Unknown xfer mode '%d'\n", getXferMode() )); + DEBUG_CRASH(( "xferScienceType - Unknown xfer mode '%d'", getXferMode() )); throw XFER_MODE_UNKNOWN; } // end else @@ -639,7 +639,7 @@ void Xfer::xferScienceVec( ScienceVec *scienceVec ) scienceVec->clear(); // Homework for today. Write 2000 words reconciling "Your code must never crash" with "Intentionally putting crashes in the code". Fucktard. -// DEBUG_CRASH(( "xferScienceVec - vector is not empty, but should be\n" )); +// DEBUG_CRASH(( "xferScienceVec - vector is not empty, but should be" )); // throw XFER_LIST_NOT_EMPTY; } @@ -662,7 +662,7 @@ void Xfer::xferScienceVec( ScienceVec *scienceVec ) else { - DEBUG_CRASH(( "xferScienceVec - Unknown xfer mode '%d'\n", getXferMode() )); + DEBUG_CRASH(( "xferScienceVec - Unknown xfer mode '%d'", getXferMode() )); throw XFER_MODE_UNKNOWN; } // end else @@ -715,7 +715,7 @@ void Xfer::xferKindOf( KindOfType *kindOfData ) else { - DEBUG_CRASH(( "xferKindOf - Unknown xfer mode '%d'\n", getXferMode() )); + DEBUG_CRASH(( "xferKindOf - Unknown xfer mode '%d'", getXferMode() )); throw XFER_MODE_UNKNOWN; } // end else @@ -795,7 +795,7 @@ void Xfer::xferUpgradeMask( UpgradeMaskType *upgradeMaskData ) if( upgradeTemplate == NULL ) { - DEBUG_CRASH(( "Xfer::xferUpgradeMask - Unknown upgrade '%s'\n", upgradeName.str() )); + DEBUG_CRASH(( "Xfer::xferUpgradeMask - Unknown upgrade '%s'", upgradeName.str() )); throw XFER_UNKNOWN_STRING; } // end if @@ -816,7 +816,7 @@ void Xfer::xferUpgradeMask( UpgradeMaskType *upgradeMaskData ) else { - DEBUG_CRASH(( "xferUpgradeMask - Unknown xfer mode '%d'\n", getXferMode() )); + DEBUG_CRASH(( "xferUpgradeMask - Unknown xfer mode '%d'", getXferMode() )); throw XFER_MODE_UNKNOWN; } // end else diff --git a/Core/GameEngine/Source/Common/System/XferCRC.cpp b/Core/GameEngine/Source/Common/System/XferCRC.cpp index b90e643386..e51a88b05c 100644 --- a/Core/GameEngine/Source/Common/System/XferCRC.cpp +++ b/Core/GameEngine/Source/Common/System/XferCRC.cpp @@ -203,7 +203,7 @@ XferDeepCRC::~XferDeepCRC( void ) if( m_fileFP != NULL ) { - DEBUG_CRASH(( "Warning: Xfer file '%s' was left open\n", m_identifier.str() )); + DEBUG_CRASH(( "Warning: Xfer file '%s' was left open", m_identifier.str() )); close(); } // end if @@ -222,7 +222,7 @@ void XferDeepCRC::open( AsciiString identifier ) if( m_fileFP != NULL ) { - DEBUG_CRASH(( "Cannot open file '%s' cause we've already got '%s' open\n", + DEBUG_CRASH(( "Cannot open file '%s' cause we've already got '%s' open", identifier.str(), m_identifier.str() )); throw XFER_FILE_ALREADY_OPEN; @@ -236,7 +236,7 @@ void XferDeepCRC::open( AsciiString identifier ) if( m_fileFP == NULL ) { - DEBUG_CRASH(( "File '%s' not found\n", identifier.str() )); + DEBUG_CRASH(( "File '%s' not found", identifier.str() )); throw XFER_FILE_NOT_FOUND; } // end if @@ -256,7 +256,7 @@ void XferDeepCRC::close( void ) if( m_fileFP == NULL ) { - DEBUG_CRASH(( "Xfer close called, but no file was open\n" )); + DEBUG_CRASH(( "Xfer close called, but no file was open" )); throw XFER_FILE_NOT_OPEN; } // end if @@ -289,7 +289,7 @@ void XferDeepCRC::xferImplementation( void *data, Int dataSize ) if( fwrite( data, dataSize, 1, m_fileFP ) != 1 ) { - DEBUG_CRASH(( "XferSave - Error writing to file '%s'\n", m_identifier.str() )); + DEBUG_CRASH(( "XferSave - Error writing to file '%s'", m_identifier.str() )); throw XFER_WRITE_ERROR; } // end if @@ -316,7 +316,7 @@ void XferDeepCRC::xferAsciiString( AsciiString *asciiStringData ) if( asciiStringData->getLength() > 16385 ) { - DEBUG_CRASH(( "XferSave cannot save this ascii string because it's too long. Change the size of the length header (but be sure to preserve save file compatability\n" )); + DEBUG_CRASH(( "XferSave cannot save this ascii string because it's too long. Change the size of the length header (but be sure to preserve save file compatability" )); throw XFER_STRING_ERROR; } // end if @@ -341,7 +341,7 @@ void XferDeepCRC::xferUnicodeString( UnicodeString *unicodeStringData ) if( unicodeStringData->getLength() > 255 ) { - DEBUG_CRASH(( "XferSave cannot save this unicode string because it's too long. Change the size of the length header (but be sure to preserve save file compatability\n" )); + DEBUG_CRASH(( "XferSave cannot save this unicode string because it's too long. Change the size of the length header (but be sure to preserve save file compatability" )); throw XFER_STRING_ERROR; } // end if diff --git a/Core/GameEngine/Source/Common/System/XferLoad.cpp b/Core/GameEngine/Source/Common/System/XferLoad.cpp index c188c6e1c6..2c6bfb4ad3 100644 --- a/Core/GameEngine/Source/Common/System/XferLoad.cpp +++ b/Core/GameEngine/Source/Common/System/XferLoad.cpp @@ -53,7 +53,7 @@ XferLoad::~XferLoad( void ) if( m_fileFP != NULL ) { - DEBUG_CRASH(( "Warning: Xfer file '%s' was left open\n", m_identifier.str() )); + DEBUG_CRASH(( "Warning: Xfer file '%s' was left open", m_identifier.str() )); close(); } // end if @@ -70,7 +70,7 @@ void XferLoad::open( AsciiString identifier ) if( m_fileFP != NULL ) { - DEBUG_CRASH(( "Cannot open file '%s' cause we've already got '%s' open\n", + DEBUG_CRASH(( "Cannot open file '%s' cause we've already got '%s' open", identifier.str(), m_identifier.str() )); throw XFER_FILE_ALREADY_OPEN; @@ -84,7 +84,7 @@ void XferLoad::open( AsciiString identifier ) if( m_fileFP == NULL ) { - DEBUG_CRASH(( "File '%s' not found\n", identifier.str() )); + DEBUG_CRASH(( "File '%s' not found", identifier.str() )); throw XFER_FILE_NOT_FOUND; } // end if @@ -101,7 +101,7 @@ void XferLoad::close( void ) if( m_fileFP == NULL ) { - DEBUG_CRASH(( "Xfer close called, but no file was open\n" )); + DEBUG_CRASH(( "Xfer close called, but no file was open" )); throw XFER_FILE_NOT_OPEN; } // end if @@ -130,7 +130,7 @@ Int XferLoad::beginBlock( void ) if( fread( &blockSize, sizeof( XferBlockSize ), 1, m_fileFP ) != 1 ) { - DEBUG_CRASH(( "Xfer - Error reading block size for '%s'\n", m_identifier.str() )); + DEBUG_CRASH(( "Xfer - Error reading block size for '%s'", m_identifier.str() )); return 0; } // end if @@ -177,7 +177,7 @@ void XferLoad::xferSnapshot( Snapshot *snapshot ) if( snapshot == NULL ) { - DEBUG_CRASH(( "XferLoad::xferSnapshot - Invalid parameters\n" )); + DEBUG_CRASH(( "XferLoad::xferSnapshot - Invalid parameters" )); throw XFER_INVALID_PARAMETERS; } // end if @@ -251,7 +251,7 @@ void XferLoad::xferImplementation( void *data, Int dataSize ) if( fread( data, dataSize, 1, m_fileFP ) != 1 ) { - DEBUG_CRASH(( "XferLoad - Error reading from file '%s'\n", m_identifier.str() )); + DEBUG_CRASH(( "XferLoad - Error reading from file '%s'", m_identifier.str() )); throw XFER_READ_ERROR; } // end if diff --git a/Core/GameEngine/Source/Common/System/XferSave.cpp b/Core/GameEngine/Source/Common/System/XferSave.cpp index c436677b8f..6be40bbd3c 100644 --- a/Core/GameEngine/Source/Common/System/XferSave.cpp +++ b/Core/GameEngine/Source/Common/System/XferSave.cpp @@ -70,7 +70,7 @@ XferSave::~XferSave( void ) if( m_fileFP != NULL ) { - DEBUG_CRASH(( "Warning: Xfer file '%s' was left open\n", m_identifier.str() )); + DEBUG_CRASH(( "Warning: Xfer file '%s' was left open", m_identifier.str() )); close(); } // end if @@ -83,7 +83,7 @@ XferSave::~XferSave( void ) { // tell the user there is an error - DEBUG_CRASH(( "Warning: XferSave::~XferSave - m_blockStack was not NULL!\n" )); + DEBUG_CRASH(( "Warning: XferSave::~XferSave - m_blockStack was not NULL!" )); // delete the block stack XferBlockData *next; @@ -110,7 +110,7 @@ void XferSave::open( AsciiString identifier ) if( m_fileFP != NULL ) { - DEBUG_CRASH(( "Cannot open file '%s' cause we've already got '%s' open\n", + DEBUG_CRASH(( "Cannot open file '%s' cause we've already got '%s' open", identifier.str(), m_identifier.str() )); throw XFER_FILE_ALREADY_OPEN; @@ -124,7 +124,7 @@ void XferSave::open( AsciiString identifier ) if( m_fileFP == NULL ) { - DEBUG_CRASH(( "File '%s' not found\n", identifier.str() )); + DEBUG_CRASH(( "File '%s' not found", identifier.str() )); throw XFER_FILE_NOT_FOUND; } // end if @@ -141,7 +141,7 @@ void XferSave::close( void ) if( m_fileFP == NULL ) { - DEBUG_CRASH(( "Xfer close called, but no file was open\n" )); + DEBUG_CRASH(( "Xfer close called, but no file was open" )); throw XFER_FILE_NOT_OPEN; } // end if @@ -177,7 +177,7 @@ Int XferSave::beginBlock( void ) if( fwrite( &blockSize, sizeof( XferBlockSize ), 1, m_fileFP ) != 1 ) { - DEBUG_CRASH(( "XferSave::beginBlock - Error writing block size in '%s'\n", + DEBUG_CRASH(( "XferSave::beginBlock - Error writing block size in '%s'", m_identifier.str() )); return XFER_WRITE_ERROR; @@ -189,7 +189,7 @@ Int XferSave::beginBlock( void ) // if( top == NULL ) // { // -// DEBUG_CRASH(( "XferSave - Begin block, out of memory - can't save block stack data\n" )); +// DEBUG_CRASH(( "XferSave - Begin block, out of memory - can't save block stack data" )); // return XFER_OUT_OF_MEMORY; // // } // end if @@ -218,7 +218,7 @@ void XferSave::endBlock( void ) if( m_blockStack == NULL ) { - DEBUG_CRASH(( "Xfer end block called, but no matching begin block was found\n" )); + DEBUG_CRASH(( "Xfer end block called, but no matching begin block was found" )); throw XFER_BEGIN_END_MISMATCH; } // end if @@ -238,7 +238,7 @@ void XferSave::endBlock( void ) if( fwrite( &blockSize, sizeof( XferBlockSize ), 1, m_fileFP ) != 1 ) { - DEBUG_CRASH(( "Error writing block size to file '%s'\n", m_identifier.str() )); + DEBUG_CRASH(( "Error writing block size to file '%s'", m_identifier.str() )); throw XFER_WRITE_ERROR; } // end if @@ -276,7 +276,7 @@ void XferSave::xferSnapshot( Snapshot *snapshot ) if( snapshot == NULL ) { - DEBUG_CRASH(( "XferSave::xferSnapshot - Invalid parameters\n" )); + DEBUG_CRASH(( "XferSave::xferSnapshot - Invalid parameters" )); throw XFER_INVALID_PARAMETERS; } // end if @@ -296,7 +296,7 @@ void XferSave::xferAsciiString( AsciiString *asciiStringData ) if( asciiStringData->getLength() > 255 ) { - DEBUG_CRASH(( "XferSave cannot save this unicode string because it's too long. Change the size of the length header (but be sure to preserve save file compatability\n" )); + DEBUG_CRASH(( "XferSave cannot save this unicode string because it's too long. Change the size of the length header (but be sure to preserve save file compatability" )); throw XFER_STRING_ERROR; } // end if @@ -321,7 +321,7 @@ void XferSave::xferUnicodeString( UnicodeString *unicodeStringData ) if( unicodeStringData->getLength() > 255 ) { - DEBUG_CRASH(( "XferSave cannot save this unicode string because it's too long. Change the size of the length header (but be sure to preserve save file compatability\n" )); + DEBUG_CRASH(( "XferSave cannot save this unicode string because it's too long. Change the size of the length header (but be sure to preserve save file compatability" )); throw XFER_STRING_ERROR; } // end if @@ -350,7 +350,7 @@ void XferSave::xferImplementation( void *data, Int dataSize ) if( fwrite( data, dataSize, 1, m_fileFP ) != 1 ) { - DEBUG_CRASH(( "XferSave - Error writing to file '%s'\n", m_identifier.str() )); + DEBUG_CRASH(( "XferSave - Error writing to file '%s'", m_identifier.str() )); throw XFER_WRITE_ERROR; } // end if diff --git a/Core/Libraries/Source/Compression/CompressionManager.cpp b/Core/Libraries/Source/Compression/CompressionManager.cpp index af955cdbe6..73acbb0515 100644 --- a/Core/Libraries/Source/Compression/CompressionManager.cpp +++ b/Core/Libraries/Source/Compression/CompressionManager.cpp @@ -430,7 +430,7 @@ void DoCompressTest( void ) Int ret = memcmp(buf, uncompressedBuf, origSize); if (ret != 0) { - DEBUG_CRASH(("orig buffer does not match compressed+uncompressed output - ret was %d\n", ret)); + DEBUG_CRASH(("orig buffer does not match compressed+uncompressed output - ret was %d", ret)); } } diff --git a/Generals/Code/GameEngine/Include/Common/BitFlagsIO.h b/Generals/Code/GameEngine/Include/Common/BitFlagsIO.h index 5911362b0a..f7a1ad3ba2 100644 --- a/Generals/Code/GameEngine/Include/Common/BitFlagsIO.h +++ b/Generals/Code/GameEngine/Include/Common/BitFlagsIO.h @@ -223,7 +223,7 @@ void BitFlags::xfer(Xfer* xfer) else { - DEBUG_CRASH(( "BitFlagsXfer - Unknown xfer mode '%d'\n", xfer->getXferMode() )); + DEBUG_CRASH(( "BitFlagsXfer - Unknown xfer mode '%d'", xfer->getXferMode() )); throw XFER_MODE_UNKNOWN; } // end else diff --git a/Generals/Code/GameEngine/Include/Common/SparseMatchFinder.h b/Generals/Code/GameEngine/Include/Common/SparseMatchFinder.h index a2eda17c68..d866fd8014 100644 --- a/Generals/Code/GameEngine/Include/Common/SparseMatchFinder.h +++ b/Generals/Code/GameEngine/Include/Common/SparseMatchFinder.h @@ -172,7 +172,7 @@ class SparseMatchFinder { AsciiString curConditionStr; bits.buildDescription(&curConditionStr); - DEBUG_CRASH(("ambiguous model match in findBestInfoSlow \n\nbetween \n(%s)\n\n(%s)\n\n(%d extra matches found)\n\ncurrent bits are (\n%s)\n", + DEBUG_CRASH(("ambiguous model match in findBestInfoSlow \n\nbetween \n(%s)\n\n(%s)\n\n(%d extra matches found)\n\ncurrent bits are (\n%s)", curBestMatchStr.str(), dupMatchStr.str(), numDupMatches, diff --git a/Generals/Code/GameEngine/Include/Common/StreamingArchiveFile.h b/Generals/Code/GameEngine/Include/Common/StreamingArchiveFile.h index f255e07d30..20aa536ab4 100644 --- a/Generals/Code/GameEngine/Include/Common/StreamingArchiveFile.h +++ b/Generals/Code/GameEngine/Include/Common/StreamingArchiveFile.h @@ -95,10 +95,10 @@ class StreamingArchiveFile : public RAMFile virtual Int seek( Int new_pos, seekMode mode = CURRENT ); ///< Set file position: See File::seek // Ini's should not be parsed with streaming files, that's just dumb. - virtual void nextLine(Char *buf = NULL, Int bufSize = 0) { DEBUG_CRASH(("Should not call nextLine on a streaming file.\n")); } - virtual Bool scanInt(Int &newInt) { DEBUG_CRASH(("Should not call scanInt on a streaming file.\n")); return FALSE; } - virtual Bool scanReal(Real &newReal) { DEBUG_CRASH(("Should not call scanReal on a streaming file.\n")); return FALSE; } - virtual Bool scanString(AsciiString &newString) { DEBUG_CRASH(("Should not call scanString on a streaming file.\n")); return FALSE; } + virtual void nextLine(Char *buf = NULL, Int bufSize = 0) { DEBUG_CRASH(("Should not call nextLine on a streaming file.")); } + virtual Bool scanInt(Int &newInt) { DEBUG_CRASH(("Should not call scanInt on a streaming file.")); return FALSE; } + virtual Bool scanReal(Real &newReal) { DEBUG_CRASH(("Should not call scanReal on a streaming file.")); return FALSE; } + virtual Bool scanString(AsciiString &newString) { DEBUG_CRASH(("Should not call scanString on a streaming file.")); return FALSE; } virtual Bool open( File *file ); ///< Open file for fast RAM access virtual Bool openFromArchive(File *archiveFile, const AsciiString& filename, Int offset, Int size); ///< copy file data from the given file at the given offset for the given size. diff --git a/Generals/Code/GameEngine/Include/Common/ThingTemplate.h b/Generals/Code/GameEngine/Include/Common/ThingTemplate.h index 4b123c6573..4a8cc08cd7 100644 --- a/Generals/Code/GameEngine/Include/Common/ThingTemplate.h +++ b/Generals/Code/GameEngine/Include/Common/ThingTemplate.h @@ -355,7 +355,7 @@ class ThingTemplate : public Overridable #if defined(_MSC_VER) && _MSC_VER < 1300 ThingTemplate(const ThingTemplate& that) : m_geometryInfo(that.m_geometryInfo) { - DEBUG_CRASH(("This should never be called\n")); + DEBUG_CRASH(("This should never be called")); } #else ThingTemplate(const ThingTemplate& that) = delete; diff --git a/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp b/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp index 78892d21ae..21bb273240 100644 --- a/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp +++ b/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp @@ -419,7 +419,7 @@ AudioHandle AudioManager::addAudioEvent(const AudioEventRTS *eventToAdd) if (!eventToAdd->getAudioEventInfo()) { getInfoForAudioEvent(eventToAdd); if (!eventToAdd->getAudioEventInfo()) { - DEBUG_CRASH(("No info for requested audio event '%s'\n", eventToAdd->getEventName().str())); + DEBUG_CRASH(("No info for requested audio event '%s'", eventToAdd->getEventName().str())); return AHSV_Error; } } @@ -840,7 +840,7 @@ AudioEventInfo *AudioManager::newAudioEventInfo( AsciiString audioName ) { AudioEventInfo *eventInfo = findAudioEventInfo(audioName); if (eventInfo) { - DEBUG_CRASH(("Requested add of '%s' multiple times. Is this intentional? - jkmcd\n", audioName.str())); + DEBUG_CRASH(("Requested add of '%s' multiple times. Is this intentional? - jkmcd", audioName.str())); return eventInfo; } @@ -856,7 +856,7 @@ void AudioManager::addAudioEventInfo( AudioEventInfo * newEvent ) AudioEventInfo *eventInfo = findAudioEventInfo( newEvent->m_audioName ); if (eventInfo) { - DEBUG_CRASH(("Requested add of '%s' multiple times. Is this intentional? - jkmcd\n", newEvent->m_audioName.str())); + DEBUG_CRASH(("Requested add of '%s' multiple times. Is this intentional? - jkmcd", newEvent->m_audioName.str())); *eventInfo = *newEvent; } else @@ -1031,7 +1031,7 @@ Bool AudioManager::shouldPlayLocally(const AudioEventRTS *audioEvent) } if (!BitIsSet(ei->m_type, (ST_PLAYER | ST_ALLIES | ST_ENEMIES | ST_EVERYONE))) { - DEBUG_CRASH(("No player restrictions specified for '%s'. Using Everyone.\n", ei->m_audioName.str())); + DEBUG_CRASH(("No player restrictions specified for '%s'. Using Everyone.", ei->m_audioName.str())); return TRUE; } @@ -1047,7 +1047,7 @@ Bool AudioManager::shouldPlayLocally(const AudioEventRTS *audioEvent) } if (owningPlayer == NULL) { - DEBUG_CRASH(("Sound '%s' expects an owning player, but the audio event that created it didn't specify one.\n", ei->m_audioName.str())); + DEBUG_CRASH(("Sound '%s' expects an owning player, but the audio event that created it didn't specify one.", ei->m_audioName.str())); return FALSE; } diff --git a/Generals/Code/GameEngine/Source/Common/CommandLine.cpp b/Generals/Code/GameEngine/Source/Common/CommandLine.cpp index 7460ee7eba..909a0f47f3 100644 --- a/Generals/Code/GameEngine/Source/Common/CommandLine.cpp +++ b/Generals/Code/GameEngine/Source/Common/CommandLine.cpp @@ -112,7 +112,7 @@ static void ConvertShortMapPathToLongMapPath(AsciiString &mapName) //============================================================================= Int parseNoLogOrCrash(char *args[], int) { - DEBUG_CRASH(("-NoLogOrCrash not supported in this build\n")); + DEBUG_CRASH(("-NoLogOrCrash not supported in this build")); return 1; } diff --git a/Generals/Code/GameEngine/Source/Common/Dict.cpp b/Generals/Code/GameEngine/Source/Common/Dict.cpp index c4bb7a2266..7594b2d4ae 100644 --- a/Generals/Code/GameEngine/Source/Common/Dict.cpp +++ b/Generals/Code/GameEngine/Source/Common/Dict.cpp @@ -350,7 +350,7 @@ Bool Dict::getNthBool(Int n) const if (pair && pair->getType() == DICT_BOOL) return *pair->asBool(); } - DEBUG_CRASH(("dict key missing, or of wrong type\n")); + DEBUG_CRASH(("dict key missing, or of wrong type")); return false; } @@ -365,7 +365,7 @@ Int Dict::getNthInt(Int n) const if (pair && pair->getType() == DICT_INT) return *pair->asInt(); } - DEBUG_CRASH(("dict key missing, or of wrong type\n")); + DEBUG_CRASH(("dict key missing, or of wrong type")); return 0; } @@ -380,7 +380,7 @@ Real Dict::getNthReal(Int n) const if (pair && pair->getType() == DICT_REAL) return *pair->asReal(); } - DEBUG_CRASH(("dict key missing, or of wrong type\n")); + DEBUG_CRASH(("dict key missing, or of wrong type")); return 0.0f; } @@ -395,7 +395,7 @@ AsciiString Dict::getNthAsciiString(Int n) const if (pair && pair->getType() == DICT_ASCIISTRING) return *pair->asAsciiString(); } - DEBUG_CRASH(("dict key missing, or of wrong type\n")); + DEBUG_CRASH(("dict key missing, or of wrong type")); return AsciiString::TheEmptyString; } @@ -410,7 +410,7 @@ UnicodeString Dict::getNthUnicodeString(Int n) const if (pair && pair->getType() == DICT_UNICODESTRING) return *pair->asUnicodeString(); } - DEBUG_CRASH(("dict key missing, or of wrong type\n")); + DEBUG_CRASH(("dict key missing, or of wrong type")); return UnicodeString::TheEmptyString; } @@ -525,7 +525,7 @@ Bool Dict::remove(NameKeyType key) validate(); return true; } - DEBUG_CRASH(("dict key missing in remove\n")); + DEBUG_CRASH(("dict key missing in remove")); return false; } diff --git a/Generals/Code/GameEngine/Source/Common/GameLOD.cpp b/Generals/Code/GameEngine/Source/Common/GameLOD.cpp index 607f1e854f..530015ab72 100644 --- a/Generals/Code/GameEngine/Source/Common/GameLOD.cpp +++ b/Generals/Code/GameEngine/Source/Common/GameLOD.cpp @@ -242,7 +242,7 @@ BenchProfile *GameLODManager::newBenchProfile(void) return &m_benchProfiles[m_numBenchProfiles-1]; } - DEBUG_CRASH(( "GameLODManager::newBenchProfile - Too many profiles defined\n")); + DEBUG_CRASH(( "GameLODManager::newBenchProfile - Too many profiles defined")); return NULL; } @@ -256,7 +256,7 @@ LODPresetInfo *GameLODManager::newLODPreset(StaticGameLODLevel index) return &m_lodPresets[index][m_numLevelPresets[index]-1]; } - DEBUG_CRASH(( "GameLODManager::newLODPreset - Too many presets defined for '%s'\n", TheGameLODManager->getStaticGameLODLevelName(index))); + DEBUG_CRASH(( "GameLODManager::newLODPreset - Too many presets defined for '%s'", TheGameLODManager->getStaticGameLODLevelName(index))); } return NULL; @@ -389,7 +389,7 @@ Int GameLODManager::getStaticGameLODIndex(AsciiString name) return i; } - DEBUG_CRASH(( "GameLODManager::getGameLODIndex - Invalid LOD name '%s'\n", name.str() )); + DEBUG_CRASH(( "GameLODManager::getGameLODIndex - Invalid LOD name '%s'", name.str() )); return STATIC_GAME_LOD_UNKNOWN; } @@ -426,7 +426,7 @@ void INI::parseStaticGameLODLevel( INI* ini, void * , void *store, const void*) return; } - DEBUG_CRASH(("invalid GameLODLevel token %s -- expected LOW/MEDIUM/HIGH\n",tok)); + DEBUG_CRASH(("invalid GameLODLevel token %s -- expected LOW/MEDIUM/HIGH",tok)); throw INI_INVALID_DATA; } @@ -619,7 +619,7 @@ void INI::parseDynamicGameLODLevel( INI* ini, void * , void *store, const void*) return; } - DEBUG_CRASH(("invalid GameLODLevel token %s -- expected LOW/MEDIUM/HIGH\n",tok)); + DEBUG_CRASH(("invalid GameLODLevel token %s -- expected LOW/MEDIUM/HIGH",tok)); throw INI_INVALID_DATA; } @@ -632,7 +632,7 @@ Int GameLODManager::getDynamicGameLODIndex(AsciiString name) return i; } - DEBUG_CRASH(( "GameLODManager::getGameLODIndex - Invalid LOD name '%s'\n", name.str() )); + DEBUG_CRASH(( "GameLODManager::getGameLODIndex - Invalid LOD name '%s'", name.str() )); return STATIC_GAME_LOD_UNKNOWN; } diff --git a/Generals/Code/GameEngine/Source/Common/INI/INI.cpp b/Generals/Code/GameEngine/Source/Common/INI/INI.cpp index 8a1cb7352c..0406f9cec0 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INI.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INI.cpp @@ -257,7 +257,7 @@ void INI::prepFile( AsciiString filename, INILoadType loadType ) if( m_file != NULL ) { - DEBUG_CRASH(( "INI::load, cannot open file '%s', file already open\n", filename.str() )); + DEBUG_CRASH(( "INI::load, cannot open file '%s', file already open", filename.str() )); throw INI_FILE_ALREADY_OPEN; } // end if @@ -267,7 +267,7 @@ void INI::prepFile( AsciiString filename, INILoadType loadType ) if( m_file == NULL ) { - DEBUG_CRASH(( "INI::load, cannot open file '%s'\n", filename.str() )); + DEBUG_CRASH(( "INI::load, cannot open file '%s'", filename.str() )); throw INI_CANT_OPEN_FILE; } // end if @@ -370,7 +370,7 @@ void INI::load( AsciiString filename, INILoadType loadType, Xfer *pXfer ) (*parse)( this ); } catch (...) { - DEBUG_CRASH(("Error parsing block '%s' in INI file '%s'\n", token, m_filename.str()) ); + DEBUG_CRASH(("Error parsing block '%s' in INI file '%s'", token, m_filename.str()) ); char buff[1024]; sprintf(buff, "Error parsing INI file '%s' (Line: '%s')\n", m_filename.str(), currentLine.str()); @@ -575,7 +575,7 @@ void INI::parsePositiveNonZeroReal( INI* ini, void * /*instance*/, void *store, *(Real *)store = scanReal(token); if (*(Real *)store <= 0.0f) { - DEBUG_CRASH(("invalid Real value %f -- expected > 0\n",*(Real*)store)); + DEBUG_CRASH(("invalid Real value %f -- expected > 0",*(Real*)store)); throw INI_INVALID_DATA; } @@ -644,7 +644,7 @@ void INI::parseBitInInt32( INI *ini, void *instance, void *store, const void* us return FALSE; else { - DEBUG_CRASH(("invalid boolean token %s -- expected Yes or No\n",token)); + DEBUG_CRASH(("invalid boolean token %s -- expected Yes or No",token)); throw INI_INVALID_DATA; return false; // keep compiler happy } @@ -857,7 +857,7 @@ void INI::parseMappedImage( INI *ini, void * /*instance*/, void *store, const vo else { - DEBUG_CRASH(( "INI::parseAnim2DTemplate - TheAnim2DCollection is NULL\n" )); + DEBUG_CRASH(( "INI::parseAnim2DTemplate - TheAnim2DCollection is NULL" )); throw INI_UNKNOWN_ERROR; } // end else @@ -1509,7 +1509,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList (*parse)( this, what, (char *)what + offset + parseTableList.getNthExtraOffset(ptIdx), userData ); } catch (...) { - DEBUG_CRASH( ("[LINE: %d - FILE: '%s'] Error reading field '%s' of block '%s'\n", + DEBUG_CRASH( ("[LINE: %d - FILE: '%s'] Error reading field '%s' of block '%s'", INI::getLineNum(), INI::getFilename().str(), field, m_curBlockStart) ); @@ -1631,7 +1631,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList } } - DEBUG_CRASH(("token %s is not a valid member of the index list\n",token)); + DEBUG_CRASH(("token %s is not a valid member of the index list",token)); throw INI_INVALID_DATA; return 0; // never executed, but keeps compiler happy @@ -1657,7 +1657,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList } } - DEBUG_CRASH(("token %s is not a valid member of the lookup list\n",token)); + DEBUG_CRASH(("token %s is not a valid member of the lookup list",token)); throw INI_INVALID_DATA; return 0; // never executed, but keeps compiler happy diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIAnimation.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIAnimation.cpp index 5149356467..27962e0996 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INIAnimation.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INIAnimation.cpp @@ -73,7 +73,7 @@ void INI::parseAnim2DDefinition( INI* ini ) { // we're loading over an existing animation template ... something is probably wrong - DEBUG_CRASH(( "INI::parseAnim2DDefinition - Animation template '%s' already exists\n", + DEBUG_CRASH(( "INI::parseAnim2DDefinition - Animation template '%s' already exists", animTemplate->getName().str() )); return; diff --git a/Generals/Code/GameEngine/Source/Common/NameKeyGenerator.cpp b/Generals/Code/GameEngine/Source/Common/NameKeyGenerator.cpp index 917dd08491..dfcbe2004e 100644 --- a/Generals/Code/GameEngine/Source/Common/NameKeyGenerator.cpp +++ b/Generals/Code/GameEngine/Source/Common/NameKeyGenerator.cpp @@ -162,7 +162,7 @@ NameKeyType NameKeyGenerator::nameToKey(const char* nameString) // if more than a small percent of the sockets are getting deep, probably want to increase the socket count. if (numOverThresh > SOCKET_COUNT/20) { - DEBUG_CRASH(("hmm, might need to increase the number of bucket-sockets for NameKeyGenerator (numOverThresh %d = %f%%)\n",numOverThresh,(Real)numOverThresh/(Real)(SOCKET_COUNT/20))); + DEBUG_CRASH(("hmm, might need to increase the number of bucket-sockets for NameKeyGenerator (numOverThresh %d = %f%%)",numOverThresh,(Real)numOverThresh/(Real)(SOCKET_COUNT/20))); } #endif @@ -210,7 +210,7 @@ NameKeyType NameKeyGenerator::nameToLowercaseKey(const char* nameString) // if more than a small percent of the sockets are getting deep, probably want to increase the socket count. if (numOverThresh > SOCKET_COUNT/20) { - DEBUG_CRASH(("hmm, might need to increase the number of bucket-sockets for NameKeyGenerator (numOverThresh %d = %f%%)\n",numOverThresh,(Real)numOverThresh/(Real)(SOCKET_COUNT/20))); + DEBUG_CRASH(("hmm, might need to increase the number of bucket-sockets for NameKeyGenerator (numOverThresh %d = %f%%)",numOverThresh,(Real)numOverThresh/(Real)(SOCKET_COUNT/20))); } #endif diff --git a/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp b/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp index a5feec6542..45ed71a4a4 100644 --- a/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp +++ b/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp @@ -519,7 +519,7 @@ void PerfTimer::outputInfo( void ) #endif if (m_crashWithInfo) { - DEBUG_CRASH(("%s\n" + DEBUG_CRASH(("%s" "Average Time (per call): %.4f ms\n" "Average Time (per frame): %.4f ms\n" "Average calls per frame: %.2f\n" diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp index 895a14f5e5..fd22adddf9 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -2195,7 +2195,7 @@ Bool Player::attemptToPurchaseScience(ScienceType science) { if (!isCapableOfPurchasingScience(science)) { - DEBUG_CRASH(("isCapableOfPurchasingScience: need other prereqs/points to purchase, request is ignored!\n")); + DEBUG_CRASH(("isCapableOfPurchasingScience: need other prereqs/points to purchase, request is ignored!")); return false; } @@ -2210,7 +2210,7 @@ Bool Player::grantScience(ScienceType science) { if (!TheScienceStore->isScienceGrantable(science)) { - DEBUG_CRASH(("Cannot grant science %s, since it is marked as nonGrantable.\n",TheScienceStore->getInternalNameForScience(science).str())); + DEBUG_CRASH(("Cannot grant science %s, since it is marked as nonGrantable.",TheScienceStore->getInternalNameForScience(science).str())); return false; // it's not grantable, so tough, can't have it, even via this method. } @@ -3587,7 +3587,7 @@ void Player::xfer( Xfer *xfer ) if( upgradeTemplate == NULL ) { - DEBUG_CRASH(( "Player::xfer - Unable to find upgrade '%s'\n", upgradeName.str() )); + DEBUG_CRASH(( "Player::xfer - Unable to find upgrade '%s'", upgradeName.str() )); throw SC_INVALID_DATA; } // end if @@ -3659,7 +3659,7 @@ void Player::xfer( Xfer *xfer ) if( prototype == NULL ) { - DEBUG_CRASH(( "Player::xfer - Unable to find team prototype by id\n" )); + DEBUG_CRASH(( "Player::xfer - Unable to find team prototype by id" )); throw SC_INVALID_DATA; } // end if @@ -3731,7 +3731,7 @@ void Player::xfer( Xfer *xfer ) if( (aiPlayerPresent == TRUE && m_ai == NULL) || (aiPlayerPresent == FALSE && m_ai != NULL) ) { - DEBUG_CRASH(( "Player::xfer - m_ai present/missing mismatch\n" )); + DEBUG_CRASH(( "Player::xfer - m_ai present/missing mismatch" )); throw SC_INVALID_DATA;; } // end if @@ -3745,7 +3745,7 @@ void Player::xfer( Xfer *xfer ) (resourceGatheringManagerPresent == FALSE && m_resourceGatheringManager != NULL ) ) { - DEBUG_CRASH(( "Player::xfer - m_resourceGatheringManager present/missing mismatch\n" )); + DEBUG_CRASH(( "Player::xfer - m_resourceGatheringManager present/missing mismatch" )); throw SC_INVALID_DATA; } // end if @@ -3759,7 +3759,7 @@ void Player::xfer( Xfer *xfer ) (tunnelTrackerPresent == FALSE && m_tunnelSystem != NULL) ) { - DEBUG_CRASH(( "Player::xfer - m_tunnelSystem present/missing mismatch\n" )); + DEBUG_CRASH(( "Player::xfer - m_tunnelSystem present/missing mismatch" )); throw SC_INVALID_DATA; } // end if @@ -3922,7 +3922,7 @@ void Player::xfer( Xfer *xfer ) if( m_kindOfPercentProductionChangeList.size() != 0 ) { - DEBUG_CRASH(( "Player::xfer - m_kindOfPercentProductionChangeList should be empty but is not\n" )); + DEBUG_CRASH(( "Player::xfer - m_kindOfPercentProductionChangeList should be empty but is not" )); throw SC_INVALID_DATA; } // end if @@ -3974,7 +3974,7 @@ void Player::xfer( Xfer *xfer ) { if( m_specialPowerReadyTimerList.size() != 0 ) // sanity, list must be empty right now { - DEBUG_CRASH(( "Player::xfer - m_specialPowerReadyTimerList should be empty but is not\n" )); + DEBUG_CRASH(( "Player::xfer - m_specialPowerReadyTimerList should be empty but is not" )); throw SC_INVALID_DATA; } // end if @@ -4004,7 +4004,7 @@ void Player::xfer( Xfer *xfer ) if( squadCount != NUM_HOTKEY_SQUADS ) { - DEBUG_CRASH(( "Player::xfer - size of m_squadCount array has changed\n" )); + DEBUG_CRASH(( "Player::xfer - size of m_squadCount array has changed" )); throw SC_INVALID_DATA; } // end if @@ -4014,7 +4014,7 @@ void Player::xfer( Xfer *xfer ) if( m_squads[ i ] == NULL ) { - DEBUG_CRASH(( "Player::xfer - NULL squad at index '%d'\n", i )); + DEBUG_CRASH(( "Player::xfer - NULL squad at index '%d'", i )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp b/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp index 28ebc4ac35..9f8dfdbfc0 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp @@ -91,7 +91,7 @@ Player *PlayerList::getNthPlayer(Int i) { if( i < 0 || i >= MAX_PLAYER_COUNT ) { -// DEBUG_CRASH( ("Illegal player index\n") ); +// DEBUG_CRASH( ("Illegal player index") ); return NULL; } return m_players[i]; @@ -294,7 +294,7 @@ Team *PlayerList::validateTeam( AsciiString owner ) } else { - DEBUG_CRASH(("no team or player named %s could be found!\n", owner.str())); + DEBUG_CRASH(("no team or player named %s could be found!", owner.str())); t = getNeutralPlayer()->getDefaultTeam(); } return t; @@ -358,7 +358,7 @@ Player *PlayerList::getPlayerFromMask( PlayerMaskType mask ) } // end for i - DEBUG_CRASH( ("Player does not exist for mask\n") ); + DEBUG_CRASH( ("Player does not exist for mask") ); return NULL; // mask not found } // end getPlayerFromMask @@ -380,7 +380,7 @@ Player *PlayerList::getEachPlayerFromMask( PlayerMaskType& maskToAdjust ) } } // end for i - DEBUG_CRASH( ("No players found that contain any matching masks.\n") ); + DEBUG_CRASH( ("No players found that contain any matching masks.") ); maskToAdjust = 0; return NULL; // mask not found } @@ -465,7 +465,7 @@ void PlayerList::xfer( Xfer *xfer ) if( playerCount != m_playerCount ) { - DEBUG_CRASH(( "Invalid player count '%d', should be '%d'\n", playerCount, m_playerCount )); + DEBUG_CRASH(( "Invalid player count '%d', should be '%d'", playerCount, m_playerCount )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Science.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Science.cpp index 494f8fc801..6f6ee15bf8 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/Science.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/Science.cpp @@ -215,7 +215,7 @@ const ScienceInfo* ScienceStore::findScienceInfo(ScienceType st) const { if (info != NULL) { - DEBUG_CRASH(("duplicate science %s!\n",c)); + DEBUG_CRASH(("duplicate science %s!",c)); throw INI_INVALID_DATA; } info = newInstance(ScienceInfo); diff --git a/Generals/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp b/Generals/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp index 27c6824482..0545c69c2f 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp @@ -413,7 +413,7 @@ void ScoreKeeper::xferObjectCountMap( Xfer *xfer, ObjectCountMap *map ) if( map == NULL ) { - DEBUG_CRASH(( "xferObjectCountMap - Invalid map parameter\n" )); + DEBUG_CRASH(( "xferObjectCountMap - Invalid map parameter" )); throw SC_INVALID_DATA; } // end if @@ -464,7 +464,7 @@ void ScoreKeeper::xferObjectCountMap( Xfer *xfer, ObjectCountMap *map ) if( thingTemplate == NULL ) { - DEBUG_CRASH(( "xferObjectCountMap - Unknown thing template '%s'\n", thingTemplateName.str() )); + DEBUG_CRASH(( "xferObjectCountMap - Unknown thing template '%s'", thingTemplateName.str() )); throw SC_INVALID_DATA; } // end if @@ -539,7 +539,7 @@ void ScoreKeeper::xfer( Xfer *xfer ) if( destroyedArraySize != MAX_PLAYER_COUNT ) { - DEBUG_CRASH(( "ScoreKeeper::xfer - size of objects destroyed array has changed\n" )); + DEBUG_CRASH(( "ScoreKeeper::xfer - size of objects destroyed array has changed" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp index ee0c316bb0..f693d799d2 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp @@ -447,7 +447,7 @@ void TeamFactory::xfer( Xfer *xfer ) if( prototypeCount != m_prototypes.size() ) { - DEBUG_CRASH(( "TeamFactory::xfer - Prototype count mismatch '%d should be '%d'\n", + DEBUG_CRASH(( "TeamFactory::xfer - Prototype count mismatch '%d should be '%d'", prototypeCount, m_prototypes.size() )); throw SC_INVALID_DATA; @@ -495,7 +495,7 @@ void TeamFactory::xfer( Xfer *xfer ) if( teamPrototype == NULL ) { - DEBUG_CRASH(( "TeamFactory::xfer - Unable to find team prototype by id\n" )); + DEBUG_CRASH(( "TeamFactory::xfer - Unable to find team prototype by id" )); throw SC_INVALID_DATA; } // end if @@ -2571,7 +2571,7 @@ void Team::xfer( Xfer *xfer ) if( teamID != m_id ) { - DEBUG_CRASH(( "Team::xfer - TeamID mismatch. Xfered '%d' but should be '%d'\n", + DEBUG_CRASH(( "Team::xfer - TeamID mismatch. Xfered '%d' but should be '%d'", teamID, m_id )); throw SC_INVALID_DATA; @@ -2706,7 +2706,7 @@ void Team::loadPostProcess( void ) if( obj == NULL ) { - DEBUG_CRASH(( "Team::loadPostProcess - Unable to post process object to member list, object ID = '%d'\n", *it )); + DEBUG_CRASH(( "Team::loadPostProcess - Unable to post process object to member list, object ID = '%d'", *it )); throw SC_INVALID_DATA; } // end if @@ -2720,7 +2720,7 @@ void Team::loadPostProcess( void ) if( isInList_TeamMemberList( obj ) == FALSE ) { - DEBUG_CRASH(( "Team::loadPostProcess - Object '%s'(%d) should be in team list but is not\n", + DEBUG_CRASH(( "Team::loadPostProcess - Object '%s'(%d) should be in team list but is not", obj->getTemplate()->getName().str(), obj->getID() )); throw SC_INVALID_DATA; diff --git a/Generals/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp b/Generals/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp index c49dde9a72..9b5011e7d3 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp @@ -370,7 +370,7 @@ void TunnelTracker::loadPostProcess( void ) if( m_containList.size() != 0 ) { - DEBUG_CRASH(( "TunnelTracker::loadPostProcess - m_containList should be empty but is not\n" )); + DEBUG_CRASH(( "TunnelTracker::loadPostProcess - m_containList should be empty but is not" )); throw SC_INVALID_DATA; } // end if @@ -385,7 +385,7 @@ void TunnelTracker::loadPostProcess( void ) if( obj == NULL ) { - DEBUG_CRASH(( "TunnelTracker::loadPostProcess - Unable to find object ID '%d'\n", *it )); + DEBUG_CRASH(( "TunnelTracker::loadPostProcess - Unable to find object ID '%d'", *it )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/Common/RandomValue.cpp b/Generals/Code/GameEngine/Source/Common/RandomValue.cpp index 0b36e74761..068d6c1fcf 100644 --- a/Generals/Code/GameEngine/Source/Common/RandomValue.cpp +++ b/Generals/Code/GameEngine/Source/Common/RandomValue.cpp @@ -385,7 +385,7 @@ Real GameClientRandomVariable::getValue( void ) const default: /// @todo fill in support for nonuniform GameClientRandomVariables. - DEBUG_CRASH(("unsupported DistributionType in GameClientRandomVariable::getValue\n")); + DEBUG_CRASH(("unsupported DistributionType in GameClientRandomVariable::getValue")); return 0.0f; } } @@ -430,7 +430,7 @@ Real GameLogicRandomVariable::getValue( void ) const default: /// @todo fill in support for nonuniform GameLogicRandomVariables. - DEBUG_CRASH(("unsupported DistributionType in GameLogicRandomVariable::getValue\n")); + DEBUG_CRASH(("unsupported DistributionType in GameLogicRandomVariable::getValue")); return 0.0f; } } diff --git a/Generals/Code/GameEngine/Source/Common/System/DataChunk.cpp b/Generals/Code/GameEngine/Source/Common/System/DataChunk.cpp index cbb2b1e821..b242dc37e4 100644 --- a/Generals/Code/GameEngine/Source/Common/System/DataChunk.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/DataChunk.cpp @@ -461,7 +461,7 @@ UnsignedInt DataChunkTableOfContents::getID( const AsciiString& name ) if (m) return m->id; - DEBUG_CRASH(("name not found in DataChunkTableOfContents::getName for name %s\n",name.str())); + DEBUG_CRASH(("name not found in DataChunkTableOfContents::getName for name %s",name.str())); return 0; } @@ -474,7 +474,7 @@ AsciiString DataChunkTableOfContents::getName( UnsignedInt id ) if (m->id == id) return m->name; - DEBUG_CRASH(("name not found in DataChunkTableOfContents::getName for id %d\n",id)); + DEBUG_CRASH(("name not found in DataChunkTableOfContents::getName for id %d",id)); return AsciiString::TheEmptyString; } diff --git a/Generals/Code/GameEngine/Source/Common/System/FileSystem.cpp b/Generals/Code/GameEngine/Source/Common/System/FileSystem.cpp index 9e40133a6d..f13568ad78 100644 --- a/Generals/Code/GameEngine/Source/Common/System/FileSystem.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/FileSystem.cpp @@ -341,12 +341,12 @@ Bool FileSystem::isPathInDirectory(const AsciiString& testPath, const AsciiStrin if (basePathNormalized.isEmpty()) { - DEBUG_CRASH(("Unable to normalize base directory path '%s'.\n", basePath.str())); + DEBUG_CRASH(("Unable to normalize base directory path '%s'.", basePath.str())); return false; } else if (testPathNormalized.isEmpty()) { - DEBUG_CRASH(("Unable to normalize file path '%s'.\n", testPath.str())); + DEBUG_CRASH(("Unable to normalize file path '%s'.", testPath.str())); return false; } diff --git a/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp b/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp index 01f201ba1e..3258bfb89f 100644 --- a/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp @@ -1099,7 +1099,7 @@ Bool MemoryPoolSingleBlock::debugCheckUnderrun() { if (*p != m_wallPattern+i) { - DEBUG_CRASH(("memory underrun for block \"%s\" (expected %08x, got %08x)\n",m_debugLiteralTagString,m_wallPattern+i,*p)); + DEBUG_CRASH(("memory underrun for block \"%s\" (expected %08x, got %08x)",m_debugLiteralTagString,m_wallPattern+i,*p)); return true; } } @@ -1124,7 +1124,7 @@ Bool MemoryPoolSingleBlock::debugCheckOverrun() { if (*p != m_wallPattern-i) { - DEBUG_CRASH(("memory overrun for block \"%s\" (expected %08x, got %08x)\n",m_debugLiteralTagString,m_wallPattern+i,*p)); + DEBUG_CRASH(("memory overrun for block \"%s\" (expected %08x, got %08x)",m_debugLiteralTagString,m_wallPattern+i,*p)); return true; } } @@ -2161,7 +2161,7 @@ void DynamicMemoryAllocator::debugIgnoreLeaksForThisBlock(void* pBlockPtr) } else { - DEBUG_CRASH(("cannot currently ignore leaks for raw blocks (allocation too large)\n")); + DEBUG_CRASH(("cannot currently ignore leaks for raw blocks (allocation too large)")); } } #endif @@ -2665,7 +2665,7 @@ MemoryPool *MemoryPoolFactory::createMemoryPool(const char *poolName, Int alloca if (initialAllocationCount <= 0 || overflowAllocationCount < 0) { - DEBUG_CRASH(("illegal pool size: %d %d\n",initialAllocationCount,overflowAllocationCount)); + DEBUG_CRASH(("illegal pool size: %d %d",initialAllocationCount,overflowAllocationCount)); throw ERROR_OUT_OF_MEMORY; } @@ -3465,7 +3465,7 @@ void initMemoryManager() if (theLinkTester != 6) #endif { - DEBUG_CRASH(("Wrong operator new/delete linked in! Fix this...\n")); + DEBUG_CRASH(("Wrong operator new/delete linked in! Fix this...")); } theMainInitFlag = true; diff --git a/Generals/Code/GameEngine/Source/Common/System/MemoryInit.cpp b/Generals/Code/GameEngine/Source/Common/System/MemoryInit.cpp index bd72801b11..9c6fb92d96 100644 --- a/Generals/Code/GameEngine/Source/Common/System/MemoryInit.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/MemoryInit.cpp @@ -683,7 +683,7 @@ void userMemoryAdjustPoolSize(const char *poolName, Int& initialAllocationCount, } } - DEBUG_CRASH(("Initial size for pool %s not found -- you should add it to MemoryInit.cpp\n",poolName)); + DEBUG_CRASH(("Initial size for pool %s not found -- you should add it to MemoryInit.cpp",poolName)); } //----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Source/Common/System/RAMFile.cpp b/Generals/Code/GameEngine/Source/Common/System/RAMFile.cpp index 154e5495e2..a228708073 100644 --- a/Generals/Code/GameEngine/Source/Common/System/RAMFile.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/RAMFile.cpp @@ -495,7 +495,7 @@ char* RAMFile::readEntireAndClose() if (m_data == NULL) { - DEBUG_CRASH(("m_data is NULL in RAMFile::readEntireAndClose -- should not happen!\n")); + DEBUG_CRASH(("m_data is NULL in RAMFile::readEntireAndClose -- should not happen!")); return NEW char[1]; // just to avoid crashing... } diff --git a/Generals/Code/GameEngine/Source/Common/System/Radar.cpp b/Generals/Code/GameEngine/Source/Common/System/Radar.cpp index 52d040cc63..d18fd2ac98 100644 --- a/Generals/Code/GameEngine/Source/Common/System/Radar.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/Radar.cpp @@ -175,7 +175,7 @@ void RadarObject::xfer( Xfer *xfer ) if( m_object == NULL ) { - DEBUG_CRASH(( "RadarObject::xfer - Unable to find object for radar data\n" )); + DEBUG_CRASH(( "RadarObject::xfer - Unable to find object for radar data" )); throw SC_INVALID_DATA; } // end if @@ -863,7 +863,7 @@ Object *Radar::searchListForRadarLocationMatch( RadarObject *listHead, ICoord2D if( obj == NULL ) { - DEBUG_CRASH(( "Radar::searchListForRadarLocationMatch - NULL object encountered in list\n" )); + DEBUG_CRASH(( "Radar::searchListForRadarLocationMatch - NULL object encountered in list" )); continue; } // end if @@ -1039,7 +1039,7 @@ void Radar::createEvent( const Coord3D *world, RadarEventType type, Real seconds static RGBAColorInt color1 = { 255, 255, 255, 255 }; static RGBAColorInt color2 = { 255, 255, 255, 255 }; - DEBUG_CRASH(( "Radar::createEvent - Event not found in color table, using default colors\n" )); + DEBUG_CRASH(( "Radar::createEvent - Event not found in color table, using default colors" )); color[ 0 ] = color1; color[ 1 ] = color2; @@ -1423,12 +1423,12 @@ static void xferRadarObjectList( Xfer *xfer, RadarObject **head ) { if (!radarObject->friend_getObject()->isDestroyed()) { - DEBUG_CRASH(( "xferRadarObjectList - List head should be NULL, or contain only destroyed objects\n" )); + DEBUG_CRASH(( "xferRadarObjectList - List head should be NULL, or contain only destroyed objects" )); throw SC_INVALID_DATA; } } #else - DEBUG_CRASH(( "xferRadarObjectList - List head should be NULL, but isn't\n" )); + DEBUG_CRASH(( "xferRadarObjectList - List head should be NULL, but isn't" )); throw SC_INVALID_DATA; #endif } // end if @@ -1497,7 +1497,7 @@ void Radar::xfer( Xfer *xfer ) if( eventCount != eventCountVerify ) { - DEBUG_CRASH(( "Radar::xfer - size of MAX_RADAR_EVENTS has changed, you must version this xfer method to accomodate the new array size. Was '%d' and is now '%d'\n", + DEBUG_CRASH(( "Radar::xfer - size of MAX_RADAR_EVENTS has changed, you must version this xfer method to accomodate the new array size. Was '%d' and is now '%d'", eventCount, eventCountVerify )); throw SC_INVALID_DATA; diff --git a/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp b/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp index ae57d9add3..284d194a80 100644 --- a/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp @@ -379,7 +379,7 @@ void GameState::addSnapshotBlock( AsciiString blockName, Snapshot *snapshot, Sna if( blockName.isEmpty() || snapshot == NULL ) { - DEBUG_CRASH(( "addSnapshotBlock: Invalid parameters\n" )); + DEBUG_CRASH(( "addSnapshotBlock: Invalid parameters" )); return; } // end if @@ -519,7 +519,7 @@ AsciiString GameState::findNextSaveFilename( UnicodeString desc ) else { - DEBUG_CRASH(( "GameState::findNextSaveFilename - Unknown file search type '%d'\n", searchType )); + DEBUG_CRASH(( "GameState::findNextSaveFilename - Unknown file search type '%d'", searchType )); return AsciiString::TheEmptyString; } // end else @@ -544,7 +544,7 @@ SaveCode GameState::saveGame( AsciiString filename, UnicodeString desc, if( filename.isEmpty() ) { - DEBUG_CRASH(( "GameState::saveGame - Unable to find valid filename for save game\n" )); + DEBUG_CRASH(( "GameState::saveGame - Unable to find valid filename for save game" )); return SC_NO_FILE_AVAILABLE; } // end if @@ -986,7 +986,7 @@ void GameState::getSaveGameInfoFromFile( AsciiString filename, SaveGameInfo *sav if( filename.isEmpty() == TRUE || saveGameInfo == NULL ) { - DEBUG_CRASH(( "GameState::getSaveGameInfoFromFile - Illegal parameters\n" )); + DEBUG_CRASH(( "GameState::getSaveGameInfoFromFile - Illegal parameters" )); return; } // end if @@ -1013,7 +1013,7 @@ void GameState::getSaveGameInfoFromFile( AsciiString filename, SaveGameInfo *sav { // we should never get here, if we did, we didn't find block of data we needed - DEBUG_CRASH(( "GameState::getSaveGameInfoFromFile - Game info not found in file '%s'\n", filename.str() )); + DEBUG_CRASH(( "GameState::getSaveGameInfoFromFile - Game info not found in file '%s'", filename.str() )); done = TRUE; } // end if @@ -1044,7 +1044,7 @@ void GameState::getSaveGameInfoFromFile( AsciiString filename, SaveGameInfo *sav catch( ... ) { - DEBUG_CRASH(( "GameState::getSaveGameInfoFromFile - Error loading block '%s' in file '%s'\n", + DEBUG_CRASH(( "GameState::getSaveGameInfoFromFile - Error loading block '%s' in file '%s'", blockInfo->blockName.str(), filename.str() )); throw; @@ -1396,7 +1396,7 @@ void GameState::xferSaveData( Xfer *xfer, SnapshotType which ) catch( ... ) { - DEBUG_CRASH(( "Error saving block '%s' in file '%s'\n", + DEBUG_CRASH(( "Error saving block '%s' in file '%s'", blockName.str(), xfer->getIdentifier().str() )); throw; @@ -1473,7 +1473,7 @@ void GameState::xferSaveData( Xfer *xfer, SnapshotType which ) catch( ... ) { - DEBUG_CRASH(( "Error loading block '%s' in file '%s'\n", + DEBUG_CRASH(( "Error loading block '%s' in file '%s'", blockInfo->blockName.str(), xfer->getIdentifier().str() )); throw; @@ -1497,7 +1497,7 @@ void GameState::addPostProcessSnapshot( Snapshot *snapshot ) if( snapshot == NULL ) { - DEBUG_CRASH(( "GameState::addPostProcessSnapshot - invalid parameters\n" )); + DEBUG_CRASH(( "GameState::addPostProcessSnapshot - invalid parameters" )); return; } // end if @@ -1516,7 +1516,7 @@ void GameState::addPostProcessSnapshot( Snapshot *snapshot ) if( (*it) == snapshot ) { - DEBUG_CRASH(( "GameState::addPostProcessSnapshot - snapshot is already in list!\n" )); + DEBUG_CRASH(( "GameState::addPostProcessSnapshot - snapshot is already in list!" )); return; } // end if diff --git a/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp b/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp index 6eae82655b..e820d5a237 100644 --- a/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp @@ -77,7 +77,7 @@ static void embedPristineMap( AsciiString map, Xfer *xfer ) if( file == NULL ) { - DEBUG_CRASH(( "embedPristineMap - Error opening source file '%s'\n", map.str() )); + DEBUG_CRASH(( "embedPristineMap - Error opening source file '%s'", map.str() )); throw SC_INVALID_DATA; } // end if @@ -93,7 +93,7 @@ static void embedPristineMap( AsciiString map, Xfer *xfer ) if( buffer == NULL ) { - DEBUG_CRASH(( "embedPristineMap - Unable to allocate buffer for file '%s'\n", map.str() )); + DEBUG_CRASH(( "embedPristineMap - Unable to allocate buffer for file '%s'", map.str() )); throw SC_INVALID_DATA; } // end if @@ -102,7 +102,7 @@ static void embedPristineMap( AsciiString map, Xfer *xfer ) if( file->read( buffer, fileSize ) != fileSize ) { - DEBUG_CRASH(( "embeddPristineMap - Error reading from file '%s'\n", map.str() )); + DEBUG_CRASH(( "embeddPristineMap - Error reading from file '%s'", map.str() )); throw SC_INVALID_DATA; } // end if @@ -133,7 +133,7 @@ static void embedInUseMap( AsciiString map, Xfer *xfer ) if( fp == NULL ) { - DEBUG_CRASH(( "embedInUseMap - Unable to open file '%s'\n", map.str() )); + DEBUG_CRASH(( "embedInUseMap - Unable to open file '%s'", map.str() )); throw SC_INVALID_DATA; } // end if @@ -150,7 +150,7 @@ static void embedInUseMap( AsciiString map, Xfer *xfer ) if( buffer == NULL ) { - DEBUG_CRASH(( "embedInUseMap - Unable to allocate buffer for file '%s'\n", map.str() )); + DEBUG_CRASH(( "embedInUseMap - Unable to allocate buffer for file '%s'", map.str() )); throw SC_INVALID_DATA; } // end if @@ -159,7 +159,7 @@ static void embedInUseMap( AsciiString map, Xfer *xfer ) if( fread( buffer, 1, fileSize, fp ) != fileSize ) { - DEBUG_CRASH(( "embedInUseMap - Error reading from file '%s'\n", map.str() )); + DEBUG_CRASH(( "embedInUseMap - Error reading from file '%s'", map.str() )); throw SC_INVALID_DATA; } // end if @@ -189,7 +189,7 @@ static void extractAndSaveMap( AsciiString mapToSave, Xfer *xfer ) if( fp == NULL ) { - DEBUG_CRASH(( "extractAndSaveMap - Unable to open file '%s'\n", mapToSave.str() )); + DEBUG_CRASH(( "extractAndSaveMap - Unable to open file '%s'", mapToSave.str() )); throw SC_INVALID_DATA; } // en @@ -202,7 +202,7 @@ static void extractAndSaveMap( AsciiString mapToSave, Xfer *xfer ) if( buffer == NULL ) { - DEBUG_CRASH(( "extractAndSaveMap - Unable to allocate buffer for file '%s'\n", mapToSave.str() )); + DEBUG_CRASH(( "extractAndSaveMap - Unable to allocate buffer for file '%s'", mapToSave.str() )); throw SC_INVALID_DATA; } // end if @@ -214,7 +214,7 @@ static void extractAndSaveMap( AsciiString mapToSave, Xfer *xfer ) if( fwrite( buffer, 1, dataSize, fp ) != dataSize ) { - DEBUG_CRASH(( "extractAndSaveMap - Error writing to file '%s'\n", mapToSave.str() )); + DEBUG_CRASH(( "extractAndSaveMap - Error writing to file '%s'", mapToSave.str() )); throw SC_INVALID_DATA; } // end if @@ -321,7 +321,7 @@ void GameStateMap::xfer( Xfer *xfer ) if (!TheGameState->isInSaveDirectory(saveGameInfo->saveGameMapName)) { - DEBUG_CRASH(("GameState::xfer - The map filename read from the file '%s' is not in the SAVE directory, but should be\n", + DEBUG_CRASH(("GameState::xfer - The map filename read from the file '%s' is not in the SAVE directory, but should be", saveGameInfo->saveGameMapName.str()) ); throw SC_INVALID_DATA; } diff --git a/Generals/Code/GameEngine/Source/Common/System/StreamingArchiveFile.cpp b/Generals/Code/GameEngine/Source/Common/System/StreamingArchiveFile.cpp index 0a3938f5df..7047997691 100644 --- a/Generals/Code/GameEngine/Source/Common/System/StreamingArchiveFile.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/StreamingArchiveFile.cpp @@ -239,7 +239,7 @@ Int StreamingArchiveFile::read( void *buffer, Int bytes ) Int StreamingArchiveFile::write( const void *buffer, Int bytes ) { - DEBUG_CRASH(("Cannot write to streaming files.\n")); + DEBUG_CRASH(("Cannot write to streaming files.")); return -1; } diff --git a/Generals/Code/GameEngine/Source/Common/Thing/Module.cpp b/Generals/Code/GameEngine/Source/Common/Thing/Module.cpp index 0e4a71a404..1785a6e7db 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/Module.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/Module.cpp @@ -108,7 +108,7 @@ ObjectModule::ObjectModule( Thing *thing, const ModuleData* moduleData ) : Modul { if (!moduleData) { - DEBUG_CRASH(("module data may not be null\n")); + DEBUG_CRASH(("module data may not be null")); throw INI_INVALID_DATA; } @@ -171,7 +171,7 @@ DrawableModule::DrawableModule( Thing *thing, const ModuleData* moduleData ) : M { if (!moduleData) { - DEBUG_CRASH(("module data may not be null\n")); + DEBUG_CRASH(("module data may not be null")); throw INI_INVALID_DATA; } diff --git a/Generals/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp b/Generals/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp index 4c266598c4..5f63d77dc7 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp @@ -559,7 +559,7 @@ const ModuleFactory::ModuleTemplate* ModuleFactory::findModuleTemplate(const Asc ModuleTemplateMap::const_iterator it = m_moduleTemplateMap.find(namekey); if (it == m_moduleTemplateMap.end()) { - DEBUG_CRASH(( "Module name '%s' not found\n", name.str() )); + DEBUG_CRASH(( "Module name '%s' not found", name.str() )); return NULL; } else @@ -576,7 +576,7 @@ Module *ModuleFactory::newModule( Thing *thing, const AsciiString& name, const M // sanity if( name.isEmpty() ) { - DEBUG_CRASH(("attempting to create module with empty name\n")); + DEBUG_CRASH(("attempting to create module with empty name")); return NULL; } const ModuleTemplate* mt = findModuleTemplate(name, type); diff --git a/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp b/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp index 2e167a6fb7..e26a14d179 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp @@ -84,7 +84,7 @@ void ThingFactory::addTemplate( ThingTemplate *tmplate ) ThingTemplateHashMapIt tIt = m_templateHashMap.find(tmplate->getName()); if (tIt != m_templateHashMap.end()) { - DEBUG_CRASH(("Duplicate Thing Template name found: %s\n", tmplate->getName().str())); + DEBUG_CRASH(("Duplicate Thing Template name found: %s", tmplate->getName().str())); } // Link it to the list @@ -258,7 +258,7 @@ const ThingTemplate *ThingFactory::findByTemplateID( UnsignedShort id ) if (tmpl->getTemplateID() == id) return tmpl; } - DEBUG_CRASH(("template %d not found\n",(Int)id)); + DEBUG_CRASH(("template %d not found",(Int)id)); return NULL; } @@ -410,7 +410,7 @@ AsciiString TheThingTemplateBeingParsedName; } else { - DEBUG_CRASH(("ObjectReskin must come after the original Object (%s, %s).\n",reskinFrom.str(),name.str())); + DEBUG_CRASH(("ObjectReskin must come after the original Object (%s, %s).",reskinFrom.str(),name.str())); throw INI_INVALID_DATA; } } diff --git a/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp index c0cf6bdd5d..aaa2e682c0 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -443,7 +443,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const catch( ... ) { - DEBUG_CRASH(( "[LINE: %d - FILE: '%s'] Module tag not found for module '%s' on thing template '%s'. Module tags are required and must be unique for all modules within an object definition\n", + DEBUG_CRASH(( "[LINE: %d - FILE: '%s'] Module tag not found for module '%s' on thing template '%s'. Module tags are required and must be unique for all modules within an object definition", ini->getLineNum(), ini->getFilename().str(), tokenStr.str(), self->getName().str() )); throw; @@ -483,7 +483,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const } else { - DEBUG_CRASH(("[LINE: %d - FILE: '%s'] You must use AddModule to add modules in override INI files.\n", + DEBUG_CRASH(("[LINE: %d - FILE: '%s'] You must use AddModule to add modules in override INI files.", ini->getLineNum(), ini->getFilename().str(), self->getName().str())); throw INI_INVALID_DATA; } @@ -499,7 +499,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const && self->m_moduleBeingReplacedName.isNotEmpty() && self->m_moduleBeingReplacedName != tokenStr) { - DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule must replace modules with another module of the same type, but you are attempting to replace a %s with a %s for Object %s.\n", + DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule must replace modules with another module of the same type, but you are attempting to replace a %s with a %s for Object %s.", ini->getLineNum(), ini->getFilename().str(), self->m_moduleBeingReplacedName.str(), tokenStr.str(), self->getName().str())); throw INI_INVALID_DATA; } @@ -508,7 +508,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const && self->m_moduleBeingReplacedTag.isNotEmpty() && self->m_moduleBeingReplacedTag == moduleTagStr) { - DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule must specify a new, unique tag for the replaced module, but you are not doing so for %s (%s) for Object %s.\n", + DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule must specify a new, unique tag for the replaced module, but you are not doing so for %s (%s) for Object %s.", ini->getLineNum(), ini->getFilename().str(), moduleTagStr.str(), self->m_moduleBeingReplacedName.str(), self->getName().str())); throw INI_INVALID_DATA; } @@ -708,7 +708,7 @@ void ThingTemplate::parseReplaceModule(INI *ini, void *instance, void *store, co Bool removed = self->removeModuleInfo(modToRemove, removedModuleName); if (!removed) { - DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule %s was not found for %s; cannot continue.\n", + DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule %s was not found for %s; cannot continue.", ini->getLineNum(), ini->getFilename().str(), modToRemove, self->getName().str())); throw INI_INVALID_DATA; } @@ -804,7 +804,7 @@ void ThingTemplate::parseArmorTemplateSet( INI* ini, void *instance, void * /*st { if (it->getNthConditionsYes(0) == ws.getNthConditionsYes(0)) { - DEBUG_CRASH(("dup armorset condition in %s\n",self->getName().str())); + DEBUG_CRASH(("dup armorset condition in %s",self->getName().str())); } } } @@ -832,7 +832,7 @@ void ThingTemplate::parseWeaponTemplateSet( INI* ini, void *instance, void * /*s { if (it->getNthConditionsYes(0) == ws.getNthConditionsYes(0)) { - DEBUG_CRASH(("dup weaponset condition in %s\n",self->getName().str())); + DEBUG_CRASH(("dup weaponset condition in %s",self->getName().str())); } } } @@ -1044,25 +1044,25 @@ void ThingTemplate::validate() if (isKindOf(KINDOF_STRUCTURE) && !isImmobile) { - DEBUG_CRASH(("Structure %s is not marked immobile, but probably should be -- please fix it. (If we ever add mobile structures, this debug sniffer will need to be revised.)\n",getName().str())); + DEBUG_CRASH(("Structure %s is not marked immobile, but probably should be -- please fix it. (If we ever add mobile structures, this debug sniffer will need to be revised.)",getName().str())); } if (isKindOf(KINDOF_STICK_TO_TERRAIN_SLOPE) && !isImmobile) { - DEBUG_CRASH(("item %s is marked STICK_TO_TERRAIN_SLOPE but not IMMOBILE -- please fix it.\n",getName().str())); + DEBUG_CRASH(("item %s is marked STICK_TO_TERRAIN_SLOPE but not IMMOBILE -- please fix it.",getName().str())); } if (isKindOf(KINDOF_STRUCTURE)) { if (m_armorTemplateSets.empty() || (m_armorTemplateSets.size() == 1 && m_armorTemplateSets[0].getArmorTemplate() == NULL)) { - DEBUG_CRASH(("Structure %s has no armor, but probably should (StructureArmor) -- please fix it.)\n",getName().str())); + DEBUG_CRASH(("Structure %s has no armor, but probably should (StructureArmor) -- please fix it.)",getName().str())); } for (ArmorTemplateSetVector::const_iterator it = m_armorTemplateSets.begin(); it != m_armorTemplateSets.end(); ++it) { if (it->getDamageFX() == NULL) { - DEBUG_CRASH(("Structure %s has no ArmorDamageFX, and really should.\n",getName().str())); + DEBUG_CRASH(("Structure %s has no ArmorDamageFX, and really should.",getName().str())); } } } diff --git a/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp b/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp index 25de80331d..3e8e525ff8 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp @@ -2084,14 +2084,14 @@ void Drawable::validatePos() const const Coord3D* ourPos = getPosition(); if (_isnan(ourPos->x) || _isnan(ourPos->y) || _isnan(ourPos->z)) { - DEBUG_CRASH(("Drawable/Object position NAN! '%s'\n", getTemplate()->getName().str())); + DEBUG_CRASH(("Drawable/Object position NAN! '%s'", getTemplate()->getName().str())); } if (getObject()) { const Coord3D* objPos = getObject()->getPosition(); if (ourPos->x != objPos->x || ourPos->y != objPos->y || ourPos->z != objPos->z) { - DEBUG_CRASH(("Drawable/Object position mismatch! '%s'\n", getTemplate()->getName().str())); + DEBUG_CRASH(("Drawable/Object position mismatch! '%s'", getTemplate()->getName().str())); } } } @@ -4222,7 +4222,7 @@ void Drawable::xferDrawableModules( Xfer *xfer ) { // for testing purposes, this module better be found - DEBUG_CRASH(( "Drawable::xferDrawableModules - Module '%s' was indicated in file, but not found on Drawable %s %d\n", + DEBUG_CRASH(( "Drawable::xferDrawableModules - Module '%s' was indicated in file, but not found on Drawable %s %d", moduleIdentifier.str(), getTemplate()->getName().str(),getID() )); // skip this data in the file @@ -4380,7 +4380,7 @@ void Drawable::xfer( Xfer *xfer ) if( objectID != m_object->getID() ) { - DEBUG_CRASH(( "Drawable::xfer - Drawable '%s' is attached to wrong object '%s'\n", + DEBUG_CRASH(( "Drawable::xfer - Drawable '%s' is attached to wrong object '%s'", getTemplate()->getName().str(), m_object->getTemplate()->getName().str() )); throw SC_INVALID_DATA; @@ -4396,7 +4396,7 @@ void Drawable::xfer( Xfer *xfer ) #ifdef DEBUG_CRASHING Object *obj = TheGameLogic->findObjectByID( objectID ); - DEBUG_CRASH(( "Drawable::xfer - Drawable '%s' is not attached to an object but should be attached to object '%s' with id '%d'\n", + DEBUG_CRASH(( "Drawable::xfer - Drawable '%s' is not attached to an object but should be attached to object '%s' with id '%d'", getTemplate()->getName().str(), obj ? obj->getTemplate()->getName().str() : "Unknown", objectID )); @@ -4612,7 +4612,7 @@ void Drawable::xfer( Xfer *xfer ) if( animTemplate == NULL ) { - DEBUG_CRASH(( "Drawable::xfer - Unknown icon template '%s'\n", iconTemplateName.str() )); + DEBUG_CRASH(( "Drawable::xfer - Unknown icon template '%s'", iconTemplateName.str() )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index d56c91fefc..19e9d7063b 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -772,7 +772,7 @@ void CommandSet::parseCommandButton( INI* ini, void *instance, void *store, cons if( commandButton == NULL ) { - DEBUG_CRASH(( "[LINE: %d - FILE: '%s'] Unknown command '%s' found in command set\n", + DEBUG_CRASH(( "[LINE: %d - FILE: '%s'] Unknown command '%s' found in command set", ini->getLineNum(), ini->getFilename().str(), token )); throw INI_INVALID_DATA; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp index 5300623c60..43accaa85e 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp @@ -1273,7 +1273,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com { // sanity ... we must have a module for the special power, if we don't somebody probably // forgot to put it in the object - DEBUG_CRASH(( "Object does not contain special power module (%s) to execute. Did you forget to add it to the object INI?\n", + DEBUG_CRASH(( "Object does not contain special power module (%s) to execute. Did you forget to add it to the object INI?", command->getSpecialPowerTemplate()->getName().str() )); } else if( mod->isReady() == FALSE ) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index 5a2dd1236a..c84990f8ab 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -1591,7 +1591,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); req.lastHouse = ptIdx; TheGameSpyPSMessageQueue->addRequest(req); } - DEBUG_CRASH(("populatePlayerInfo() - not tracking stats - we haven't gotten the original stuff yet\n")); + DEBUG_CRASH(("populatePlayerInfo() - not tracking stats - we haven't gotten the original stuff yet")); return; } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp index ac41cdb72c..bd553e735e 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp @@ -514,7 +514,7 @@ void HandleBuddyResponses( void ) if (TheGameSpyInfo->isSavedIgnored(resp.profile)) { - //DEBUG_CRASH(("Player is ignored!\n")); + //DEBUG_CRASH(("Player is ignored!")); break; // no buddy messages from ignored people } @@ -637,7 +637,7 @@ void HandleBuddyResponses( void ) } else { - DEBUG_CRASH(("No buddy message queue!\n")); + DEBUG_CRASH(("No buddy message queue!")); } if(noticeLayout && timeGetTime() > noticeExpires) { diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp index 91bf31a858..0a84ed9af3 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp @@ -494,7 +494,7 @@ void GadgetCheckLikeButtonSetVisualCheck( GameWindow *g, Bool checked ) if( BitIsSet( g->winGetStatus(), WIN_STATUS_CHECK_LIKE ) == FALSE ) { - DEBUG_CRASH(( "GadgetCheckLikeButtonSetVisualCheck: Window is not 'CHECK-LIKE'\n" )); + DEBUG_CRASH(( "GadgetCheckLikeButtonSetVisualCheck: Window is not 'CHECK-LIKE'" )); return; } // end if diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp index 1cb94f79cb..5ca093574d 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp @@ -75,7 +75,7 @@ void FontLibrary::unlinkFont( GameFont *font ) if( other == NULL ) { - DEBUG_CRASH(( "Font '%s' not found in library\n", font->nameString.str() )); + DEBUG_CRASH(( "Font '%s' not found in library", font->nameString.str() )); return; } // end if @@ -197,7 +197,7 @@ GameFont *FontLibrary::getFont( AsciiString name, Int pointSize, Bool bold ) if( font == NULL ) { - DEBUG_CRASH(( "getFont: Unable to allocate new font list element\n" )); + DEBUG_CRASH(( "getFont: Unable to allocate new font list element" )); return NULL; } // end if @@ -213,7 +213,7 @@ GameFont *FontLibrary::getFont( AsciiString name, Int pointSize, Bool bold ) if( loadFontData( font ) == FALSE ) { - DEBUG_CRASH(( "getFont: Unable to load font data pointer '%s'\n", name.str() )); + DEBUG_CRASH(( "getFont: Unable to load font data pointer '%s'", name.str() )); deleteInstance(font); return NULL; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp index 3d04b61b62..9f8177aefe 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp @@ -626,7 +626,7 @@ void Shell::linkScreen( WindowLayout *screen ) if( m_screenCount == MAX_SHELL_STACK ) { - DEBUG_CRASH(( "No room in shell stack for screen\n" )); + DEBUG_CRASH(( "No room in shell stack for screen" )); return; } // end if diff --git a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp index 1f7a752611..3238ad797a 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -1224,7 +1224,7 @@ static Bool shouldSaveDrawable(const Drawable* draw) } else { - DEBUG_CRASH(("You should not ever set DRAWABLE_STATUS_NO_SAVE for a Drawable with an object. (%s)\n",draw->getTemplate()->getName().str())); + DEBUG_CRASH(("You should not ever set DRAWABLE_STATUS_NO_SAVE for a Drawable with an object. (%s)",draw->getTemplate()->getName().str())); } } return true; @@ -1377,7 +1377,7 @@ void GameClient::xfer( Xfer *xfer ) if( tocEntry == NULL ) { - DEBUG_CRASH(( "GameClient::xfer - Drawable TOC entry not found for '%s'\n", draw->getTemplate()->getName().str() )); + DEBUG_CRASH(( "GameClient::xfer - Drawable TOC entry not found for '%s'", draw->getTemplate()->getName().str() )); throw SC_INVALID_DATA; } // end if @@ -1419,7 +1419,7 @@ void GameClient::xfer( Xfer *xfer ) if( tocEntry == NULL ) { - DEBUG_CRASH(( "GameClient::xfer - No TOC entry match for id '%d'\n", tocID )); + DEBUG_CRASH(( "GameClient::xfer - No TOC entry match for id '%d'", tocID )); throw SC_INVALID_DATA; } // end if @@ -1432,7 +1432,7 @@ void GameClient::xfer( Xfer *xfer ) if( thingTemplate == NULL ) { - DEBUG_CRASH(( "GameClient::xfer - Unrecognized thing template '%s', skipping. ENGINEERS - Are you *sure* it's OK to be ignoring this object from the save file??? Think hard about it!\n", + DEBUG_CRASH(( "GameClient::xfer - Unrecognized thing template '%s', skipping. ENGINEERS - Are you *sure* it's OK to be ignoring this object from the save file??? Think hard about it!", tocEntry->name.str() )); xfer->skip( dataSize ); continue; @@ -1454,7 +1454,7 @@ void GameClient::xfer( Xfer *xfer ) if( object == NULL ) { - DEBUG_CRASH(( "GameClient::xfer - Cannot find object '%d' that is supposed to be attached to this drawable '%s'\n", + DEBUG_CRASH(( "GameClient::xfer - Cannot find object '%d' that is supposed to be attached to this drawable '%s'", objectID, thingTemplate->getName().str() )); throw SC_INVALID_DATA; @@ -1465,7 +1465,7 @@ void GameClient::xfer( Xfer *xfer ) if( draw == NULL ) { - DEBUG_CRASH(( "GameClient::xfer - There is no drawable attached to the object '%s' (%d) and there should be\n", + DEBUG_CRASH(( "GameClient::xfer - There is no drawable attached to the object '%s' (%d) and there should be", object->getTemplate()->getName().str(), object->getID() )); throw SC_INVALID_DATA; @@ -1500,7 +1500,7 @@ void GameClient::xfer( Xfer *xfer ) if( draw == NULL ) { - DEBUG_CRASH(( "GameClient::xfer - Unable to create drawable for '%s'\n", + DEBUG_CRASH(( "GameClient::xfer - Unable to create drawable for '%s'", thingTemplate->getName().str() )); throw SC_INVALID_DATA; diff --git a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp index 6109ef36c6..2c62e1f09c 100644 --- a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -442,7 +442,7 @@ void InGameUI::xfer( Xfer *xfer ) } else if (playerIndex < 0 || playerIndex >= MAX_PLAYER_COUNT) { - DEBUG_CRASH(("SWInfo bad plyrindex\n")); + DEBUG_CRASH(("SWInfo bad plyrindex")); throw INI_INVALID_DATA; } @@ -451,7 +451,7 @@ void InGameUI::xfer( Xfer *xfer ) const SpecialPowerTemplate* powerTemplate = TheSpecialPowerStore->findSpecialPowerTemplate(templateName); if (powerTemplate == NULL) { - DEBUG_CRASH(("power %s not found\n",templateName.str())); + DEBUG_CRASH(("power %s not found",templateName.str())); throw INI_INVALID_DATA; } @@ -1690,7 +1690,7 @@ void InGameUI::update( void ) { // if we've exceeded the allocated number of display strings, this will force us to essentially truncate the remaining text m_militarySubtitle->index = m_militarySubtitle->subtitle.getLength(); - DEBUG_CRASH(("You're Only Allowed to use %d lines of subtitle text\n",MAX_SUBTITLE_LINES)); + DEBUG_CRASH(("You're Only Allowed to use %d lines of subtitle text",MAX_SUBTITLE_LINES)); } } else diff --git a/Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp b/Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp index 26afdc7610..c9a46e9c5d 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp @@ -77,7 +77,7 @@ void Keyboard::createStreamMessages( void ) else { - DEBUG_CRASH(( "Unknown key state when creating msg stream\n" )); + DEBUG_CRASH(( "Unknown key state when creating msg stream" )); } // end else diff --git a/Generals/Code/GameEngine/Source/GameClient/Input/Mouse.cpp b/Generals/Code/GameEngine/Source/GameClient/Input/Mouse.cpp index a785db2d2c..eef752c840 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Input/Mouse.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Input/Mouse.cpp @@ -1147,7 +1147,7 @@ Int Mouse::getCursorIndex(const AsciiString& name) return i; } - DEBUG_CRASH(( "Mouse::getCursorIndex - Invalid cursor name '%s'\n", name.str() )); + DEBUG_CRASH(( "Mouse::getCursorIndex - Invalid cursor name '%s'", name.str() )); return INVALID_MOUSE_CURSOR; } diff --git a/Generals/Code/GameEngine/Source/GameClient/MapUtil.cpp b/Generals/Code/GameEngine/Source/GameClient/MapUtil.cpp index b83582cb90..cc8066db10 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MapUtil.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MapUtil.cpp @@ -104,7 +104,7 @@ static UnsignedInt calcCRC( AsciiString dirName, AsciiString fname ) fp = TheFileSystem->openFile(asciiFile.str(), File::READ); if( !fp ) { - DEBUG_CRASH(("Couldn't open '%s'\n", fname.str())); + DEBUG_CRASH(("Couldn't open '%s'", fname.str())); return 0; } @@ -1015,7 +1015,7 @@ static void copyFromBigToDir( const AsciiString& infile, const AsciiString& outf File *file = TheFileSystem->openFile( infile.str(), File::READ | File::BINARY ); if( file == NULL ) { - DEBUG_CRASH(( "copyFromBigToDir - Error opening source file '%s'\n", infile.str() )); + DEBUG_CRASH(( "copyFromBigToDir - Error opening source file '%s'", infile.str() )); throw SC_INVALID_DATA; } // end if @@ -1030,14 +1030,14 @@ static void copyFromBigToDir( const AsciiString& infile, const AsciiString& outf char *buffer = NEW char[ fileSize ]; if( buffer == NULL ) { - DEBUG_CRASH(( "copyFromBigToDir - Unable to allocate buffer for file '%s'\n", infile.str() )); + DEBUG_CRASH(( "copyFromBigToDir - Unable to allocate buffer for file '%s'", infile.str() )); throw SC_INVALID_DATA; } // end if // copy the file to the buffer if( file->read( buffer, fileSize ) < fileSize ) { - DEBUG_CRASH(( "copyFromBigToDir - Error reading from file '%s'\n", infile.str() )); + DEBUG_CRASH(( "copyFromBigToDir - Error reading from file '%s'", infile.str() )); throw SC_INVALID_DATA; } // end if // close the BIG file @@ -1047,7 +1047,7 @@ static void copyFromBigToDir( const AsciiString& infile, const AsciiString& outf if( !filenew || filenew->write(buffer, fileSize) < fileSize) { - DEBUG_CRASH(( "copyFromBigToDir - Error writing to file '%s'\n", outfile.str() )); + DEBUG_CRASH(( "copyFromBigToDir - Error writing to file '%s'", outfile.str() )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp index d89dc85ae8..1b2b837635 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp @@ -353,7 +353,7 @@ static const char * findGameMessageNameByType(GameMessage::Type type) if (metaNames->value == (Int)type) return metaNames->name; - DEBUG_CRASH(("MetaTypeName %d not found -- did you remember to add it to GameMessageMetaTypeNames[] ?\n")); + DEBUG_CRASH(("MetaTypeName %d not found -- did you remember to add it to GameMessageMetaTypeNames[] ?")); return "???"; } diff --git a/Generals/Code/GameEngine/Source/GameClient/RadiusDecal.cpp b/Generals/Code/GameEngine/Source/GameClient/RadiusDecal.cpp index 9a21688350..b3f9ca910f 100644 --- a/Generals/Code/GameEngine/Source/GameClient/RadiusDecal.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/RadiusDecal.cpp @@ -56,7 +56,7 @@ void RadiusDecalTemplate::createRadiusDecal(const Coord3D& pos, Real radius, con if (owningPlayer == NULL) { - DEBUG_CRASH(("You MUST specify a non-NULL owningPlayer to createRadiusDecal. (srj)\n")); + DEBUG_CRASH(("You MUST specify a non-NULL owningPlayer to createRadiusDecal. (srj)")); return; } @@ -87,7 +87,7 @@ void RadiusDecalTemplate::createRadiusDecal(const Coord3D& pos, Real radius, con } else { - DEBUG_CRASH(("Unable to add decal %s\n",decalInfo.m_ShadowName)); + DEBUG_CRASH(("Unable to add decal %s",decalInfo.m_ShadowName)); } } } diff --git a/Generals/Code/GameEngine/Source/GameClient/System/Anim2D.cpp b/Generals/Code/GameEngine/Source/GameClient/System/Anim2D.cpp index 114d7a5aa5..1b0148815e 100644 --- a/Generals/Code/GameEngine/Source/GameClient/System/Anim2D.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/System/Anim2D.cpp @@ -106,7 +106,7 @@ void Anim2DTemplate::parseNumImages( INI *ini, void *instance, void *store, cons if( numFrames < minimumFrames ) { - DEBUG_CRASH(( "Anim2DTemplate::parseNumImages - Invalid animation '%s', animations must have '%d' or more frames defined\n", + DEBUG_CRASH(( "Anim2DTemplate::parseNumImages - Invalid animation '%s', animations must have '%d' or more frames defined", animTemplate->getName().str(), minimumFrames )); throw INI_INVALID_DATA; @@ -150,7 +150,7 @@ void Anim2DTemplate::parseImage( INI *ini, void *instance, void *store, const vo { //We don't care if we're in the builder - //DEBUG_CRASH(( "Anim2DTemplate::parseImage - Image not found\n" )); + //DEBUG_CRASH(( "Anim2DTemplate::parseImage - Image not found" )); //throw INI_INVALID_DATA; } // end if @@ -189,7 +189,7 @@ void Anim2DTemplate::parseImage( INI *ini, void *instance, void *store, const vo if( animTemplate->getNumFrames() == NUM_FRAMES_INVALID ) { - DEBUG_CRASH(( "Anim2DTemplate::parseImageSequence - You must specify the number of animation frames for animation '%s' *BEFORE* specifying the image sequence name\n", + DEBUG_CRASH(( "Anim2DTemplate::parseImageSequence - You must specify the number of animation frames for animation '%s' *BEFORE* specifying the image sequence name", animTemplate->getName().str() )); throw INI_INVALID_DATA; @@ -215,7 +215,7 @@ void Anim2DTemplate::parseImage( INI *ini, void *instance, void *store, const vo if( image == NULL ) { - DEBUG_CRASH(( "Anim2DTemplate::parseImageSequence - Image '%s' not found for animation '%s'. Check the number of images specified in INI and also make sure all the actual images exist.\n", + DEBUG_CRASH(( "Anim2DTemplate::parseImageSequence - Image '%s' not found for animation '%s'. Check the number of images specified in INI and also make sure all the actual images exist.", imageName.str(), animTemplate->getName().str() )); throw INI_INVALID_DATA; @@ -253,7 +253,7 @@ void Anim2DTemplate::storeImage( const Image *image ) } // end for i // if we got here we tried to store an image in an array that was too small - DEBUG_CRASH(( "Anim2DTemplate::storeImage - Unable to store image '%s' into animation '%s' because the animation is setup to only support '%d' image frames\n", + DEBUG_CRASH(( "Anim2DTemplate::storeImage - Unable to store image '%s' into animation '%s' because the animation is setup to only support '%d' image frames", image->getName().str(), getName().str(), m_numFrames )); throw INI_INVALID_DATA; @@ -274,7 +274,7 @@ const Image* Anim2DTemplate::getFrame( UnsignedShort frameNumber ) const if( frameNumber < 0 || frameNumber >= m_numFrames ) { - DEBUG_CRASH(( "Anim2DTemplate::getFrame - Illegal frame number '%d' for animation '%s'\n", + DEBUG_CRASH(( "Anim2DTemplate::getFrame - Illegal frame number '%d' for animation '%s'", frameNumber, getName().str() )); return NULL; @@ -421,7 +421,7 @@ void Anim2D::reset( void ) // -------------------------------------------------------------------------------------------- default: - DEBUG_CRASH(( "Anim2D::reset - Unknown animation mode '%d' for '%s'\n", + DEBUG_CRASH(( "Anim2D::reset - Unknown animation mode '%d' for '%s'", m_template->getAnimMode(), m_template->getName().str() )); break; @@ -553,7 +553,7 @@ void Anim2D::tryNextFrame( void ) default: { - DEBUG_CRASH(( "Anim2D::tryNextFrame - Unknown animation mode '%d' for '%s'\n", + DEBUG_CRASH(( "Anim2D::tryNextFrame - Unknown animation mode '%d' for '%s'", m_template->getAnimMode(), m_template->getName().str() )); break; diff --git a/Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp b/Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp index 9c80905936..724f67656f 100644 --- a/Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp @@ -764,7 +764,7 @@ void Particle::xfer( Xfer *xfer ) if( m_drawable == NULL ) { - DEBUG_CRASH(( "Particle::xfer - Unable to find matching drawable id for particle\n" )); + DEBUG_CRASH(( "Particle::xfer - Unable to find matching drawable id for particle" )); throw SC_INVALID_DATA; } // end if @@ -805,7 +805,7 @@ void Particle::loadPostProcess( void ) if( m_systemUnderControlID == NULL ) { - DEBUG_CRASH(( "Particle::loadPostProcess - Unable to find system under control pointer\n" )); + DEBUG_CRASH(( "Particle::loadPostProcess - Unable to find system under control pointer" )); throw SC_INVALID_DATA; } // end if @@ -2640,7 +2640,7 @@ void ParticleSystem::loadPostProcess( void ) if( m_slaveSystem != NULL ) { - DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_slaveSystem is not NULL but should be\n" )); + DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_slaveSystem is not NULL but should be" )); throw SC_INVALID_DATA; } // end if @@ -2652,7 +2652,7 @@ void ParticleSystem::loadPostProcess( void ) if( m_slaveSystem == NULL || m_slaveSystem->isDestroyed() == TRUE ) { - DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_slaveSystem is NULL or destroyed\n" )); + DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_slaveSystem is NULL or destroyed" )); throw SC_INVALID_DATA; } // end if @@ -2667,7 +2667,7 @@ void ParticleSystem::loadPostProcess( void ) if( m_masterSystem != NULL ) { - DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_masterSystem is not NULL but should be\n" )); + DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_masterSystem is not NULL but should be" )); throw SC_INVALID_DATA; } // end if @@ -2679,7 +2679,7 @@ void ParticleSystem::loadPostProcess( void ) if( m_masterSystem == NULL || m_masterSystem->isDestroyed() == TRUE ) { - DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_masterSystem is NULL or destroyed\n" )); + DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_masterSystem is NULL or destroyed" )); throw SC_INVALID_DATA; } // end if @@ -3413,7 +3413,7 @@ void ParticleSystemManager::xfer( Xfer *xfer ) if( systemTemplate == NULL ) { - DEBUG_CRASH(( "ParticleSystemManager::xfer - Unknown particle system template '%s'\n", + DEBUG_CRASH(( "ParticleSystemManager::xfer - Unknown particle system template '%s'", systemName.str() )); throw SC_INVALID_DATA; @@ -3425,7 +3425,7 @@ void ParticleSystemManager::xfer( Xfer *xfer ) if( system == NULL ) { - DEBUG_CRASH(( "ParticleSystemManager::xfer - Unable to allocate particle system '%s'\n", + DEBUG_CRASH(( "ParticleSystemManager::xfer - Unable to allocate particle system '%s'", systemName.str() )); throw SC_INVALID_DATA; diff --git a/Generals/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp b/Generals/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp index acd9b727fe..51a699259e 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp @@ -112,7 +112,7 @@ const FieldParse TerrainRoadType::m_terrainBridgeFieldParseTable[] = else { - DEBUG_CRASH(( "Expected Damage/Repair transition keyword\n" )); + DEBUG_CRASH(( "Expected Damage/Repair transition keyword" )); throw INI_INVALID_DATA; } // end else @@ -132,7 +132,7 @@ const FieldParse TerrainRoadType::m_terrainBridgeFieldParseTable[] = if( effectNum < 0 || effectNum >= MAX_BRIDGE_BODY_FX ) { - DEBUG_CRASH(( "Effect number max on bridge transitions is '%d'\n", MAX_BRIDGE_BODY_FX )); + DEBUG_CRASH(( "Effect number max on bridge transitions is '%d'", MAX_BRIDGE_BODY_FX )); throw INI_INVALID_DATA; } // end if @@ -168,7 +168,7 @@ const FieldParse TerrainRoadType::m_terrainBridgeFieldParseTable[] = else { - DEBUG_CRASH(( "Expected Damage/Repair transition keyword\n" )); + DEBUG_CRASH(( "Expected Damage/Repair transition keyword" )); throw INI_INVALID_DATA; } // end else @@ -188,7 +188,7 @@ const FieldParse TerrainRoadType::m_terrainBridgeFieldParseTable[] = if( effectNum < 0 || effectNum >= MAX_BRIDGE_BODY_FX ) { - DEBUG_CRASH(( "Effect number max on bridge transitions is '%d'\n", MAX_BRIDGE_BODY_FX )); + DEBUG_CRASH(( "Effect number max on bridge transitions is '%d'", MAX_BRIDGE_BODY_FX )); throw INI_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp index 5e1699e859..6eac300172 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp @@ -3017,7 +3017,7 @@ void AIPlayer::xfer( Xfer *xfer ) if( getFirstItemIn_TeamBuildQueue() != NULL ) { - DEBUG_CRASH(( "AIPlayer::xfer - TeamBuildQueue head is not NULL, you should delete it or something before loading a new list\n" )); + DEBUG_CRASH(( "AIPlayer::xfer - TeamBuildQueue head is not NULL, you should delete it or something before loading a new list" )); throw SC_INVALID_DATA; } // end if @@ -3076,7 +3076,7 @@ void AIPlayer::xfer( Xfer *xfer ) if( getFirstItemIn_TeamReadyQueue() != NULL ) { - DEBUG_CRASH(( "AIPlayer::xfer - TeamReadyQueue head is not NULL, you should delete it or something before loading a new list\n" )); + DEBUG_CRASH(( "AIPlayer::xfer - TeamReadyQueue head is not NULL, you should delete it or something before loading a new list" )); throw SC_INVALID_DATA; } // end if @@ -3107,7 +3107,7 @@ void AIPlayer::xfer( Xfer *xfer ) if( playerIndex != m_player->getPlayerIndex() ) { - DEBUG_CRASH(( "AIPlayer::xfer - player index mismatch\n" )); + DEBUG_CRASH(( "AIPlayer::xfer - player index mismatch" )); throw SC_INVALID_DATA; } // end if @@ -3315,7 +3315,7 @@ void TeamInQueue::xfer( Xfer *xfer ) if( m_workOrders != NULL ) { - DEBUG_CRASH(( "TeamInQueue::xfer - m_workOrders should be NULL but isn't. Perhaps you should blow it away before loading\n" )); + DEBUG_CRASH(( "TeamInQueue::xfer - m_workOrders should be NULL but isn't. Perhaps you should blow it away before loading" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp index a942d7b390..470af781f0 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp @@ -6407,7 +6407,7 @@ StateReturnType AIGuardState::update() Object* owner = getMachineOwner(); if (owner->isOutOfAmmo() && !owner->isKindOf(KINDOF_PROJECTILE)) { - DEBUG_CRASH(("Hmm, this should probably never happen, since this case should be intercepted by JetAIUpdate\n")); + DEBUG_CRASH(("Hmm, this should probably never happen, since this case should be intercepted by JetAIUpdate")); return STATE_FAILURE; } @@ -6528,7 +6528,7 @@ StateReturnType AITunnelNetworkGuardState::update() Object* owner = getMachineOwner(); if (owner->isOutOfAmmo() && !owner->isKindOf(KINDOF_PROJECTILE)) { - DEBUG_CRASH(("Hmm, this should probably never happen, since this case should be intercepted by JetAIUpdate\n")); + DEBUG_CRASH(("Hmm, this should probably never happen, since this case should be intercepted by JetAIUpdate")); return STATE_FAILURE; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/Squad.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/Squad.cpp index 55f249939f..491a19dd3f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/Squad.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/Squad.cpp @@ -236,7 +236,7 @@ void Squad::xfer( Xfer *xfer ) if( m_objectsCached.size() != 0 ) { - DEBUG_CRASH(( "Squad::xfer - m_objectsCached should be emtpy, but is not\n" )); + DEBUG_CRASH(( "Squad::xfer - m_objectsCached should be emtpy, but is not" )); throw SC_INVALID_DATA; } // end of diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp index 05b1158977..085edb549e 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp @@ -1048,7 +1048,7 @@ StateReturnType TurretAIAimTurretState::update() Weapon *curWeapon = obj->getCurrentWeapon( &slot ); if (!curWeapon) { - DEBUG_CRASH(("TurretAIAimTurretState::update - curWeapon is NULL.\n")); + DEBUG_CRASH(("TurretAIAimTurretState::update - curWeapon is NULL.")); return STATE_FAILURE; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp b/Generals/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp index 6bf24cb8dd..b92721c042 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp @@ -799,7 +799,7 @@ Bool SidesList::validateSides() AsciiString tname = tdict->getAsciiString(TheKey_teamName); if (findSideInfo(tname)) { - DEBUG_CRASH(("name %s is duplicate between player and team, removing...\n",tname.str())); + DEBUG_CRASH(("name %s is duplicate between player and team, removing...",tname.str())); removeTeam(i); modified = true; goto validate_team_names; @@ -855,7 +855,7 @@ void SidesList::xfer( Xfer *xfer ) if( sideCount != getNumSides() ) { - DEBUG_CRASH(( "SidesList::xfer - The sides list size has changed, this was not supposed to happen, you must version this method and figure out how to translate between old and new versions now\n" )); + DEBUG_CRASH(( "SidesList::xfer - The sides list size has changed, this was not supposed to happen, you must version this method and figure out how to translate between old and new versions now" )); throw SC_INVALID_DATA; } // end if @@ -874,7 +874,7 @@ void SidesList::xfer( Xfer *xfer ) (scriptList != NULL && scriptListPresent == FALSE) ) { - DEBUG_CRASH(( "SidesList::xfer - script list missing/present mismatch\n" )); + DEBUG_CRASH(( "SidesList::xfer - script list missing/present mismatch" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index ecb206bcb0..fa8e4eedfc 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -131,7 +131,7 @@ Object *Bridge::createTower( Coord3D *worldPos, if( towerTemplate == NULL || bridge == NULL ) { - DEBUG_CRASH(( "Bridge::createTower(): Invalid params\n" )); + DEBUG_CRASH(( "Bridge::createTower(): Invalid params" )); return NULL; } // end if @@ -166,7 +166,7 @@ Object *Bridge::createTower( Coord3D *worldPos, // -------------------------------------------------------------------------------------------- default: - DEBUG_CRASH(( "Bridge::createTower - Unknown bridge tower type '%d'\n", towerType )); + DEBUG_CRASH(( "Bridge::createTower - Unknown bridge tower type '%d'", towerType )); return NULL; } // end switch @@ -1211,7 +1211,7 @@ void TerrainLogic::enableWaterGrid( Bool enable ) if( waterSettingIndex == -1 ) { - DEBUG_CRASH(( "!!!!!! Deformable water won't work because there was no group of vertex water data defined in GameData.INI for this map name '%s' !!!!!! (C. Day)\n", + DEBUG_CRASH(( "!!!!!! Deformable water won't work because there was no group of vertex water data defined in GameData.INI for this map name '%s' !!!!!! (C. Day)", TheGlobalData->m_mapName.str() )); return; @@ -2268,7 +2268,7 @@ Real TerrainLogic::getWaterHeight( const WaterHandle *water ) if( water == &m_gridWaterHandle ) { - DEBUG_CRASH(( "TerrainLogic::getWaterHeight( WaterHandle *water ) - water is a grid handle, cannot make this query\n" )); + DEBUG_CRASH(( "TerrainLogic::getWaterHeight( WaterHandle *water ) - water is a grid handle, cannot make this query" )); return 0.0f; } // end if @@ -2417,7 +2417,7 @@ void TerrainLogic::changeWaterHeightOverTime( const WaterHandle *water, if( m_numWaterToUpdate >= MAX_DYNAMIC_WATER ) { - DEBUG_CRASH(( "Only '%d' simultaneous water table changes are supported\n", MAX_DYNAMIC_WATER )); + DEBUG_CRASH(( "Only '%d' simultaneous water table changes are supported", MAX_DYNAMIC_WATER )); return; } // end if @@ -2909,7 +2909,7 @@ void TerrainLogic::xfer( Xfer *xfer ) if( poly == NULL ) { - DEBUG_CRASH(( "TerrainLogic::xfer - Unable to find polygon trigger for water table with trigger ID '%d'\n", + DEBUG_CRASH(( "TerrainLogic::xfer - Unable to find polygon trigger for water table with trigger ID '%d'", triggerID )); throw SC_INVALID_DATA; @@ -2922,7 +2922,7 @@ void TerrainLogic::xfer( Xfer *xfer ) if( m_waterToUpdate[ i ].waterTable == NULL ) { - DEBUG_CRASH(( "TerrainLogic::xfer - Polygon trigger to use for water handle has no water handle!\n" )); + DEBUG_CRASH(( "TerrainLogic::xfer - Polygon trigger to use for water handle has no water handle!" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp index 439ceb1f07..f9b74f272a 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp @@ -109,7 +109,7 @@ static void parseTimeAndLocationInfo( INI *ini, void *instance, if( stricmp( token, "Delay" ) != 0 ) { - DEBUG_CRASH(( "Expected 'Delay' token, found '%s'\n", token )); + DEBUG_CRASH(( "Expected 'Delay' token, found '%s'", token )); throw INI_INVALID_DATA; } // end if @@ -126,7 +126,7 @@ static void parseTimeAndLocationInfo( INI *ini, void *instance, if( stricmp( token, "Bone" ) != 0 ) { - DEBUG_CRASH(( "Expected 'Bone' token, found '%s'\n", token )); + DEBUG_CRASH(( "Expected 'Bone' token, found '%s'", token )); throw INI_INVALID_DATA; } // end if @@ -159,7 +159,7 @@ static void parseTimeAndLocationInfo( INI *ini, void *instance, if( stricmp( token, "FX" ) != 0 ) { - DEBUG_CRASH(( "Expected 'FX' token, found '%s'\n", token )); + DEBUG_CRASH(( "Expected 'FX' token, found '%s'", token )); throw INI_INVALID_DATA; } // end if @@ -200,7 +200,7 @@ static void parseTimeAndLocationInfo( INI *ini, void *instance, if( stricmp( token, "OCL" ) != 0 ) { - DEBUG_CRASH(( "Expected 'OCL' token, found '%s'\n", token )); + DEBUG_CRASH(( "Expected 'OCL' token, found '%s'", token )); throw INI_INVALID_DATA; } // end if @@ -352,22 +352,22 @@ void BridgeBehavior::resolveFX( void ) name = bridgeTemplate->getDamageToOCLString( (BodyDamageType)bodyState, i ); m_damageToOCL[ bodyState ][ i ] = TheObjectCreationListStore->findObjectCreationList( name.str() ); if( name.isEmpty() == FALSE && m_damageToOCL[ bodyState ][ i ] == NULL ) - DEBUG_CRASH(( "OCL list '%s' not found\n", name.str() )); + DEBUG_CRASH(( "OCL list '%s' not found", name.str() )); name = bridgeTemplate->getDamageToFXString( (BodyDamageType)bodyState, i ); m_damageToFX[ bodyState ][ i ] = TheFXListStore->findFXList( name.str() ); if( name.isEmpty() == FALSE && m_damageToFX[ bodyState ][ i ] == NULL ) - DEBUG_CRASH(( "FX list '%s' not found\n", name.str() )); + DEBUG_CRASH(( "FX list '%s' not found", name.str() )); name = bridgeTemplate->getRepairedToOCLString( (BodyDamageType)bodyState, i ); m_repairToOCL[ bodyState ][ i ] = TheObjectCreationListStore->findObjectCreationList( name.str() ); if( name.isEmpty() == FALSE && m_repairToOCL[ bodyState ][ i ] == NULL ) - DEBUG_CRASH(( "OCL list '%s' not found\n", name.str() )); + DEBUG_CRASH(( "OCL list '%s' not found", name.str() )); name = bridgeTemplate->getRepairedToFXString( (BodyDamageType)bodyState, i ); m_repairToFX[ bodyState ][ i ] = TheFXListStore->findFXList( name.str() );; if( name.isEmpty() == FALSE && m_repairToFX[ bodyState ][ i ] == NULL ) - DEBUG_CRASH(( "FX list '%s' not found\n", name.str() )); + DEBUG_CRASH(( "FX list '%s' not found", name.str() )); } // end for i @@ -396,7 +396,7 @@ void BridgeBehavior::setTower( BridgeTowerType towerType, Object *tower ) if( towerType < 0 || towerType >= BRIDGE_MAX_TOWERS ) { - DEBUG_CRASH(( "BridgeBehavior::setTower - Invalid tower type index '%d'\n", towerType )); + DEBUG_CRASH(( "BridgeBehavior::setTower - Invalid tower type index '%d'", towerType )); return; } // end if @@ -418,7 +418,7 @@ ObjectID BridgeBehavior::getTowerID( BridgeTowerType towerType ) if( towerType < 0 || towerType >= BRIDGE_MAX_TOWERS ) { - DEBUG_CRASH(( "BridgeBehavior::setTower - Invalid tower type index '%d'\n", towerType )); + DEBUG_CRASH(( "BridgeBehavior::setTower - Invalid tower type index '%d'", towerType )); return INVALID_ID; } // end if @@ -638,7 +638,7 @@ void BridgeBehavior::onBodyDamageStateChange( const DamageInfo* damageInfo, if( bridge == NULL ) { - DEBUG_CRASH(( "BridgeBehavior - Unable to find bridge\n" )); + DEBUG_CRASH(( "BridgeBehavior - Unable to find bridge" )); return; } // end if @@ -1044,7 +1044,7 @@ void BridgeBehavior::createScaffolding( void ) if( scaffoldTemplate == NULL ) { - DEBUG_CRASH(( "Unable to find bridge scaffold template\n" )); + DEBUG_CRASH(( "Unable to find bridge scaffold template" )); return; } // end if @@ -1055,7 +1055,7 @@ void BridgeBehavior::createScaffolding( void ) if( scaffoldSupportTemplate == NULL ) { - DEBUG_CRASH(( "Unable to find bridge support scaffold template\n" )); + DEBUG_CRASH(( "Unable to find bridge support scaffold template" )); return; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp index b9f885696d..daa5aa4057 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp @@ -740,7 +740,7 @@ void DumbProjectileBehavior::xfer( Xfer *xfer ) if( m_detonationWeaponTmpl == NULL ) { - DEBUG_CRASH(( "DumbProjectileBehavior::xfer - Unknown weapon template '%s'\n", + DEBUG_CRASH(( "DumbProjectileBehavior::xfer - Unknown weapon template '%s'", weaponTemplateName.str() )); throw SC_INVALID_DATA; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/GenerateMinefieldBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/GenerateMinefieldBehavior.cpp index ca2e756c8b..cf206ae8cc 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/GenerateMinefieldBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/GenerateMinefieldBehavior.cpp @@ -366,7 +366,7 @@ void GenerateMinefieldBehavior::placeMines() const ThingTemplate* mineTemplate = TheThingFactory->findTemplate(d->m_mineName); if (!mineTemplate) { - DEBUG_CRASH(("mine %s not found\n",d->m_mineName.str())); + DEBUG_CRASH(("mine %s not found",d->m_mineName.str())); return; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp index a6694f7b1c..bc5c57e45e 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp @@ -662,7 +662,7 @@ void MinefieldBehavior::xfer( Xfer *xfer ) if( maxImmunity != MAX_IMMUNITY ) { - DEBUG_CRASH(( "MinefieldBehavior::xfer - MAX_IMMUNITY has changed size, you must version this code and then you can remove this error message\n" )); + DEBUG_CRASH(( "MinefieldBehavior::xfer - MAX_IMMUNITY has changed size, you must version this code and then you can remove this error message" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp index aaac8901c5..e7593e80d1 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp @@ -778,7 +778,7 @@ void ParkingPlaceBehavior::unreserveDoorForExit( ExitDoorType exitDoor ) } } - DEBUG_CRASH(("ParkingPlaceBehavior::unreserveDoorForExit: door %d was not found\n",exitDoor)); + DEBUG_CRASH(("ParkingPlaceBehavior::unreserveDoorForExit: door %d was not found",exitDoor)); } } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PrisonBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PrisonBehavior.cpp index 8de5554d45..772dd9ace8 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PrisonBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PrisonBehavior.cpp @@ -437,7 +437,7 @@ void PrisonBehavior::xfer( Xfer *xfer ) if( m_visualList != NULL ) { - DEBUG_CRASH(( "PrisonBehavior::xfer - the visual list should be empty but is not\n" )); + DEBUG_CRASH(( "PrisonBehavior::xfer - the visual list should be empty but is not" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaTowerBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaTowerBehavior.cpp index 741ae02317..c6442e1ac1 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaTowerBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaTowerBehavior.cpp @@ -414,7 +414,7 @@ void PropagandaTowerBehavior::doScan( void ) default: { - DEBUG_CRASH(( "PropagandaTowerBehavior::doScan - Unknown upgrade type '%d'\n", + DEBUG_CRASH(( "PropagandaTowerBehavior::doScan - Unknown upgrade type '%d'", m_upgradeRequired->getUpgradeType() )); break; @@ -564,7 +564,7 @@ void PropagandaTowerBehavior::xfer( Xfer *xfer ) if( m_insideList != NULL ) { - DEBUG_CRASH(( "PropagandaTowerBehavior::xfer - m_insideList should be empty but is not\n" )); + DEBUG_CRASH(( "PropagandaTowerBehavior::xfer - m_insideList should be empty but is not" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/RebuildHoleBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/RebuildHoleBehavior.cpp index 20d6b0fd8a..ff1d7475ca 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/RebuildHoleBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/RebuildHoleBehavior.cpp @@ -431,7 +431,7 @@ void RebuildHoleBehavior::xfer( Xfer *xfer ) if( m_workerTemplate == NULL ) { - DEBUG_CRASH(( "RebuildHoleBehavior::xfer - Unable to find template '%s'\n", + DEBUG_CRASH(( "RebuildHoleBehavior::xfer - Unable to find template '%s'", workerName.str() )); throw SC_INVALID_DATA; @@ -456,7 +456,7 @@ void RebuildHoleBehavior::xfer( Xfer *xfer ) if( m_rebuildTemplate == NULL ) { - DEBUG_CRASH(( "RebuildHoleBehavior::xfer - Unable to find template '%s'\n", + DEBUG_CRASH(( "RebuildHoleBehavior::xfer - Unable to find template '%s'", rebuildName.str() )); throw SC_INVALID_DATA; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp index f6c862f4ab..5464d62b3f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp @@ -159,7 +159,7 @@ SlowDeathBehavior::SlowDeathBehavior( Thing *thing, const ModuleData* moduleData if (getSlowDeathBehaviorModuleData()->m_probabilityModifier < 1) { - DEBUG_CRASH(("ProbabilityModifer must be >= 1.\n")); + DEBUG_CRASH(("ProbabilityModifer must be >= 1.")); throw INI_INVALID_DATA; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp index f0e238f4b3..5b01eb6fed 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp @@ -1020,7 +1020,7 @@ void SpawnBehavior::xfer( Xfer *xfer ) if( m_spawnTemplate == NULL ) { - DEBUG_CRASH(( "SpawnBehavior::xfer - Unable to find template '%s'\n", name.str() )); + DEBUG_CRASH(( "SpawnBehavior::xfer - Unable to find template '%s'", name.str() )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp index 7b2509eb73..1e4f0fa5c3 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp @@ -1270,7 +1270,7 @@ void ActiveBody::xfer( Xfer *xfer ) if( m_particleSystems != NULL ) { - DEBUG_CRASH(( "ActiveBody::xfer - m_particleSystems should be empty, but is not\n" )); + DEBUG_CRASH(( "ActiveBody::xfer - m_particleSystems should be empty, but is not" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/CaveContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/CaveContain.cpp index 2efd4217e8..c587531013 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/CaveContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/CaveContain.cpp @@ -411,7 +411,7 @@ void CaveContain::xfer( Xfer *xfer ) if( m_originalTeam == NULL ) { - DEBUG_CRASH(( "CaveContain::xfer - Unable to find original team by id\n" )); + DEBUG_CRASH(( "CaveContain::xfer - Unable to find original team by id" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp index a65f0a5411..64b9ca17a5 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp @@ -160,7 +160,7 @@ void GarrisonContain::putObjectAtGarrisonPoint( Object *obj, conditionIndex < 0 || conditionIndex >= MAX_GARRISON_POINT_CONDITIONS ) { - DEBUG_CRASH(( "GarrisionContain::putObjectAtGarrisionPoint - Invalid arguments\n" )); + DEBUG_CRASH(( "GarrisionContain::putObjectAtGarrisionPoint - Invalid arguments" )); return; } // end if @@ -169,7 +169,7 @@ void GarrisonContain::putObjectAtGarrisonPoint( Object *obj, if( m_garrisonPointData[ pointIndex ].object != NULL ) { - DEBUG_CRASH(( "GarrisonContain::putObjectAtGarrisonPoint - Garrison Point '%d' is not empty\n", + DEBUG_CRASH(( "GarrisonContain::putObjectAtGarrisonPoint - Garrison Point '%d' is not empty", pointIndex )); return; @@ -261,7 +261,7 @@ Int GarrisonContain::findConditionIndex( void ) // -------------------------------------------------------------------------------------------- default: - DEBUG_CRASH(( "GarrisonContain::findConditionIndex - Unknown body damage type '%d'\n", + DEBUG_CRASH(( "GarrisonContain::findConditionIndex - Unknown body damage type '%d'", bodyDamage )); break; @@ -288,7 +288,7 @@ Bool GarrisonContain::calcBestGarrisonPosition( Coord3D *sourcePos, const Coord3 Int placeIndex = findClosestFreeGarrisonPointIndex( conditionIndex, targetPos ); if( placeIndex == GARRISON_INDEX_INVALID ) { - DEBUG_CRASH( ("GarrisonContain::calcBestGarrisonPosition - Unable to find suitable garrison point.\n") ); + DEBUG_CRASH( ("GarrisonContain::calcBestGarrisonPosition - Unable to find suitable garrison point.") ); return FALSE; } @@ -1490,7 +1490,7 @@ void GarrisonContain::xfer( Xfer *xfer ) if( m_originalTeam == NULL ) { - DEBUG_CRASH(( "GarrisonContain::xfer - Unable to find original team by id\n" )); + DEBUG_CRASH(( "GarrisonContain::xfer - Unable to find original team by id" )); throw SC_INVALID_DATA; } // end if @@ -1609,7 +1609,7 @@ void GarrisonContain::loadPostProcess( void ) if( m_garrisonPointData[ i ].object == NULL ) { - DEBUG_CRASH(( "GarrisonContain::loadPostProcess - Unable to find object for point data\n" )); + DEBUG_CRASH(( "GarrisonContain::loadPostProcess - Unable to find object for point data" )); throw SC_INVALID_DATA; } // end if @@ -1626,7 +1626,7 @@ void GarrisonContain::loadPostProcess( void ) if( m_garrisonPointData[ i ].effect == NULL ) { - DEBUG_CRASH(( "GarrisonContain::loadPostProcess - Unable to find effect for point data\n" )); + DEBUG_CRASH(( "GarrisonContain::loadPostProcess - Unable to find effect for point data" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp index 89c8ed80da..6d80140d56 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp @@ -1482,7 +1482,7 @@ void OpenContain::xfer( Xfer *xfer ) } m_containList.clear(); #else - DEBUG_CRASH(( "OpenContain::xfer - Contain list should be empty before load but is not\n" )); + DEBUG_CRASH(( "OpenContain::xfer - Contain list should be empty before load but is not" )); throw SC_INVALID_DATA; #endif @@ -1573,7 +1573,7 @@ void OpenContain::xfer( Xfer *xfer ) if( m_objectEnterExitInfo.empty() == FALSE ) { - DEBUG_CRASH(( "OpenContain::xfer - m_objectEnterExitInfo should be empty, but is not\n" )); + DEBUG_CRASH(( "OpenContain::xfer - m_objectEnterExitInfo should be empty, but is not" )); throw SC_INVALID_DATA; } // end if @@ -1614,7 +1614,7 @@ void OpenContain::loadPostProcess( void ) if( m_containList.empty() == FALSE ) { - DEBUG_CRASH(( "OpenContain::loadPostProcess - Contain list should be empty before load but is not\n" )); + DEBUG_CRASH(( "OpenContain::loadPostProcess - Contain list should be empty before load but is not" )); throw SC_INVALID_DATA; } // end if @@ -1632,7 +1632,7 @@ void OpenContain::loadPostProcess( void ) if( obj == NULL ) { - DEBUG_CRASH(( "OpenContain::loadPostProcess - Unable to find object to put on contain list\n" )); + DEBUG_CRASH(( "OpenContain::loadPostProcess - Unable to find object to put on contain list" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp index 67d71d2dd5..2dd5238943 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp @@ -162,13 +162,13 @@ void ParachuteContain::updateBonePositions() { if (parachuteDraw->getPristineBonePositions( "PARA_COG", 0, &m_paraSwayBone, NULL, 1) != 1) { - DEBUG_CRASH(("PARA_COG not found\n")); + DEBUG_CRASH(("PARA_COG not found")); m_paraSwayBone.zero(); } if (parachuteDraw->getPristineBonePositions( "PARA_ATTCH", 0, &m_paraAttachBone, NULL, 1 ) != 1) { - DEBUG_CRASH(("PARA_ATTCH not found\n")); + DEBUG_CRASH(("PARA_ATTCH not found")); m_paraAttachBone.zero(); } } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/GhostObject.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/GhostObject.cpp index 67f2aed1e6..de18bc1f85 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/GhostObject.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/GhostObject.cpp @@ -98,7 +98,7 @@ void GhostObject::xfer( Xfer *xfer ) if( parentObjectID != INVALID_ID && m_parentObject == NULL ) { - DEBUG_CRASH(( "GhostObject::xfer - Unable to connect m_parentObject\n" )); + DEBUG_CRASH(( "GhostObject::xfer - Unable to connect m_parentObject" )); throw INI_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp index 4c220a3da9..f6965ad887 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp @@ -393,7 +393,7 @@ void LocomotorTemplate::validate() m_lift != 0.0f || m_liftDamaged != 0.0f) { - DEBUG_CRASH(("THRUST locos may not use ZAxisBehavior or lift!\n")); + DEBUG_CRASH(("THRUST locos may not use ZAxisBehavior or lift!")); throw INI_INVALID_DATA; } if (m_maxSpeed <= 0.0f) @@ -2643,7 +2643,7 @@ void LocomotorSet::xfer( Xfer *xfer ) // vector should be empty at this point if (m_locomotors.empty() == FALSE) { - DEBUG_CRASH(( "LocomotorSet::xfer - vector is not empty, but should be\n" )); + DEBUG_CRASH(( "LocomotorSet::xfer - vector is not empty, but should be" )); throw XFER_LIST_NOT_EMPTY; } @@ -2655,7 +2655,7 @@ void LocomotorSet::xfer( Xfer *xfer ) const LocomotorTemplate* lt = TheLocomotorStore->findLocomotorTemplate(NAMEKEY(name)); if (lt == NULL) { - DEBUG_CRASH(( "LocomotorSet::xfer - template %s not found\n", name.str() )); + DEBUG_CRASH(( "LocomotorSet::xfer - template %s not found", name.str() )); throw XFER_UNKNOWN_STRING; } @@ -2710,7 +2710,7 @@ void LocomotorSet::xferSelfAndCurLocoPtr(Xfer *xfer, Locomotor** loco) } } - DEBUG_CRASH(( "LocomotorSet::xfer - template %s not found\n", name.str() )); + DEBUG_CRASH(( "LocomotorSet::xfer - template %s not found", name.str() )); throw XFER_UNKNOWN_STRING; } } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp index e9be58baad..8d2edc35ab 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -740,13 +740,13 @@ void Object::restoreOriginalTeam() Team* origTeam = TheTeamFactory->findTeam(m_originalTeamName); if (origTeam == NULL) { - DEBUG_CRASH(("Object original team (%s) could not be found or created! (srj)\n",m_originalTeamName.str())); + DEBUG_CRASH(("Object original team (%s) could not be found or created! (srj)",m_originalTeamName.str())); return; } if (m_team == origTeam) { - DEBUG_CRASH(("Object appears to still be on its original team, so why are we attempting to restore it? (srj)\n")); + DEBUG_CRASH(("Object appears to still be on its original team, so why are we attempting to restore it? (srj)")); return; } @@ -2581,7 +2581,7 @@ Module* Object::findModule(NameKeyType key) const } else { - DEBUG_CRASH(("Duplicate modules found for name %s!\n",TheNameKeyGenerator->keyToName(key).str())); + DEBUG_CRASH(("Duplicate modules found for name %s!",TheNameKeyGenerator->keyToName(key).str())); } #else m = *b; @@ -3579,7 +3579,7 @@ void Object::xfer( Xfer *xfer ) Team *team = TheTeamFactory->findTeamByID( teamID ); if( team == NULL ) { - DEBUG_CRASH(( "Object::xfer - Unable to load team\n" )); + DEBUG_CRASH(( "Object::xfer - Unable to load team" )); throw SC_INVALID_DATA; } const Bool restoring = true; @@ -3800,7 +3800,7 @@ void Object::xfer( Xfer *xfer ) { // for testing purposes, this module better be found - DEBUG_CRASH(( "Object::xfer - Module '%s' was indicated in file, but not found on object '%s'(%d)\n", + DEBUG_CRASH(( "Object::xfer - Module '%s' was indicated in file, but not found on object '%s'(%d)", moduleIdentifier.str(), getTemplate()->getName().str(), getID() )); // skip this data in the file diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/ObjectTypes.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/ObjectTypes.cpp index 9f5f34848b..ff1f6d8454 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/ObjectTypes.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/ObjectTypes.cpp @@ -179,7 +179,7 @@ void ObjectTypes::xfer(Xfer *xfer) if( m_objectTypes.empty() == FALSE ) { - DEBUG_CRASH(( "ObjectTypes::xfer - m_objectTypes vector should be emtpy but is not!\n" )); + DEBUG_CRASH(( "ObjectTypes::xfer - m_objectTypes vector should be emtpy but is not!" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index a2d060a2c6..46a0331f05 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -1883,7 +1883,7 @@ void PartitionData::doSmallFill( Real halfCellSize = ThePartitionManager->getCellSize() * 0.5f; if (radius > halfCellSize) { - DEBUG_CRASH(("object is too large to use a 'small' geometry, truncating size to cellsize\n")); + DEBUG_CRASH(("object is too large to use a 'small' geometry, truncating size to cellsize")); radius = halfCellSize; } @@ -4590,7 +4590,7 @@ void PartitionManager::xfer( Xfer *xfer ) if( cellSize != m_cellSize ) { - DEBUG_CRASH(( "Partition cell size has changed, this save game file is invalid\n" )); + DEBUG_CRASH(( "Partition cell size has changed, this save game file is invalid" )); throw SC_INVALID_DATA; } // end if @@ -4603,7 +4603,7 @@ void PartitionManager::xfer( Xfer *xfer ) if( totalCellCount != m_totalCellCount ) { - DEBUG_CRASH(( "Partition total cell count mismatch %d, should be %d\n", + DEBUG_CRASH(( "Partition total cell count mismatch %d, should be %d", totalCellCount, m_totalCellCount )); throw SC_INVALID_DATA; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp index afd2681925..a5d5c42ff6 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp @@ -410,8 +410,8 @@ Bool SpecialPowerModule::initiateIntentToDoSpecialPower( const Object *targetObj //appropriate update module! if( !valid && getSpecialPowerModuleData()->m_updateModuleStartsAttack ) { - DEBUG_CRASH( ("Object does not contain a special power module to execute. Did you forget to add it to the object INI?\n")); - //DEBUG_CRASH(( "Object does not contain special power module (%s) to execute. Did you forget to add it to the object INI?\n", + DEBUG_CRASH( ("Object does not contain a special power module to execute. Did you forget to add it to the object INI?")); + //DEBUG_CRASH(( "Object does not contain special power module (%s) to execute. Did you forget to add it to the object INI?", // command->m_specialPower->getName().str() )); } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index e77e36b21c..358bbe9df1 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -167,7 +167,7 @@ const LocomotorTemplateVector* AIUpdateModuleData::findLocomotorTemplateVector(L { if (ini->getLoadType() != INI_LOAD_CREATE_OVERRIDES) { - DEBUG_CRASH(("re-specifying a LocomotorSet is no longer allowed\n")); + DEBUG_CRASH(("re-specifying a LocomotorSet is no longer allowed")); throw INI_INVALID_DATA; } } @@ -182,7 +182,7 @@ const LocomotorTemplateVector* AIUpdateModuleData::findLocomotorTemplateVector(L const LocomotorTemplate* lt = TheLocomotorStore->findLocomotorTemplate(locoKey); if (!lt) { - DEBUG_CRASH(("Locomotor %s not found!\n",locoName)); + DEBUG_CRASH(("Locomotor %s not found!",locoName)); throw INI_INVALID_DATA; } self->m_locomotorTemplates[set].push_back(lt); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index 2c3ac3e79c..f1ad20eebb 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -431,7 +431,7 @@ class ChinookCombatDropState : public State { if (!m_ropes.empty()) { - DEBUG_CRASH(( "ChinookCombatDropState - ropes should be empty\n" )); + DEBUG_CRASH(( "ChinookCombatDropState - ropes should be empty" )); throw SC_INVALID_DATA; } m_ropes.resize(numRopes); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp index 39f8134db6..f0011d7bf6 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp @@ -748,7 +748,7 @@ StateReturnType DozerActionDoActionState::update( void ) default: { - DEBUG_CRASH(( "Unknown task for the dozer action do action state\n" )); + DEBUG_CRASH(( "Unknown task for the dozer action do action state" )); return STATE_FAILURE; } // end default @@ -1772,7 +1772,7 @@ Bool DozerAIUpdate::canAcceptNewRepair( Object *obj ) if( currentTowerInterface == NULL || newTowerInterface == NULL ) { - DEBUG_CRASH(( "Unable to find bridge tower interface on object\n" )); + DEBUG_CRASH(( "Unable to find bridge tower interface on object" )); return FALSE; } // end if @@ -2217,7 +2217,7 @@ void DozerAIUpdate::internalTaskCompleteOrCancelled( DozerTask task ) default: { - DEBUG_CRASH(( "internalTaskCompleteOrCancelled: Unknown Dozer task '%d'\n", task )); + DEBUG_CRASH(( "internalTaskCompleteOrCancelled: Unknown Dozer task '%d'", task )); break; } // end default diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp index 1f7ca41af9..0413542b42 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp @@ -198,7 +198,7 @@ UpdateSleepTime POWTruckAIUpdate::update( void ) updateReturnPrisoners(); break; default: - DEBUG_CRASH(( "POWTruckAIUpdate::update - Unknown current task '%d'\n", m_currentTask )); + DEBUG_CRASH(( "POWTruckAIUpdate::update - Unknown current task '%d'", m_currentTask )); break; } // end switch, current task @@ -223,7 +223,7 @@ void POWTruckAIUpdate::setTask( POWTruckTask task, Object *taskObject ) taskObject == NULL ) { - DEBUG_CRASH(( "POWTruckAIUpdate::setTask - Illegal arguments\n" )); + DEBUG_CRASH(( "POWTruckAIUpdate::setTask - Illegal arguments" )); setTask( POW_TRUCK_TASK_WAITING ); return; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp index d185f83ac9..8a631cd1ce 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp @@ -513,7 +513,7 @@ Bool WorkerAIUpdate::canAcceptNewRepair( Object *obj ) if( currentTowerInterface == NULL || newTowerInterface == NULL ) { - DEBUG_CRASH(( "Unable to find bridge tower interface on object\n" )); + DEBUG_CRASH(( "Unable to find bridge tower interface on object" )); return FALSE; } // end if @@ -867,7 +867,7 @@ void WorkerAIUpdate::internalTaskCompleteOrCancelled( DozerTask task ) default: { - DEBUG_CRASH(( "internalTaskCompleteOrCancelled: Unknown Dozer task '%d'\n", task )); + DEBUG_CRASH(( "internalTaskCompleteOrCancelled: Unknown Dozer task '%d'", task )); break; } // end default diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/BoneFXUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/BoneFXUpdate.cpp index b2112f89e8..286a4b2ebe 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/BoneFXUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/BoneFXUpdate.cpp @@ -598,7 +598,7 @@ void BoneFXUpdate::xfer( Xfer *xfer ) if( m_particleSystemIDs.empty() == FALSE ) { - DEBUG_CRASH(( "BoneFXUpdate::xfer - m_particleSystemIDs should be empty but is not\n" )); + DEBUG_CRASH(( "BoneFXUpdate::xfer - m_particleSystemIDs should be empty but is not" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HordeUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HordeUpdate.cpp index 2f758a3b38..c2122c7869 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HordeUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HordeUpdate.cpp @@ -202,7 +202,7 @@ void HordeUpdate::joinOrLeaveHorde(SimpleObjectIterator *iter, Bool join) if( ai ) ai->evaluateMoraleBonus(); else - DEBUG_CRASH(( "HordeUpdate::joinOrLeaveHorde - We (%s) must have an AI to benefit from horde\n", + DEBUG_CRASH(( "HordeUpdate::joinOrLeaveHorde - We (%s) must have an AI to benefit from horde", getObject()->getTemplate()->getName().str() )); } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp index aada4f5f55..268b1b4f6f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp @@ -497,7 +497,7 @@ void NeutronMissileSlowDeathBehavior::xfer( Xfer *xfer ) if( maxNeutronBlasts != MAX_NEUTRON_BLASTS ) { - DEBUG_CRASH(( "NeutronMissileSlowDeathBehavior::xfer - Size of MAX_NEUTRON_BLASTS has changed, you must version this xfer code and then you can remove this error message\n" )); + DEBUG_CRASH(( "NeutronMissileSlowDeathBehavior::xfer - Size of MAX_NEUTRON_BLASTS has changed, you must version this xfer code and then you can remove this error message" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp index a8903cfdbe..6a3f456158 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp @@ -215,7 +215,7 @@ void NeutronMissileUpdate::doLaunch( void ) if (!launcher->getDrawable() || !launcher->getDrawable()->getProjectileLaunchOffset(m_attach_wslot, m_attach_specificBarrelToUse, &attachTransform, TURRET_INVALID, NULL)) { - DEBUG_CRASH(("ProjectileLaunchPos %d %d not found!\n",m_attach_wslot, m_attach_specificBarrelToUse)); + DEBUG_CRASH(("ProjectileLaunchPos %d %d not found!",m_attach_wslot, m_attach_specificBarrelToUse)); attachTransform.Make_Identity(); } @@ -619,7 +619,7 @@ void NeutronMissileUpdate::xfer( Xfer *xfer ) if( m_exhaustSysTmpl == NULL ) { - DEBUG_CRASH(( "NeutronMissileUpdate::xfer - Unable to find particle system '%s'\n", name.str() )); + DEBUG_CRASH(( "NeutronMissileUpdate::xfer - Unable to find particle system '%s'", name.str() )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp index 388593c334..ae9b197437 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp @@ -1451,7 +1451,7 @@ void ParticleUplinkCannonUpdate::loadPostProcess( void ) } else { - DEBUG_CRASH(( "ParticleUplinkCannonUpdate::loadPostProcess - Unable to find drawable for m_orbitToTargetBeamID\n" )); + DEBUG_CRASH(( "ParticleUplinkCannonUpdate::loadPostProcess - Unable to find drawable for m_orbitToTargetBeamID" )); } } #endif diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp index e713c267ea..c10caabf72 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp @@ -1149,7 +1149,7 @@ void ProductionUpdate::cancelAndRefundAllProduction( void ) else { // unknown production type - DEBUG_CRASH(( "ProductionUpdate::cancelAndRefundAllProduction - Unknown production type '%d'\n", + DEBUG_CRASH(( "ProductionUpdate::cancelAndRefundAllProduction - Unknown production type '%d'", m_productionQueue->getProductionType() )); return; } // end else @@ -1283,7 +1283,7 @@ void ProductionUpdate::xfer( Xfer *xfer ) if( m_productionQueue != NULL ) { - DEBUG_CRASH(( "ProductionUpdate::xfer - m_productionQueue is not empty, but should be\n" )); + DEBUG_CRASH(( "ProductionUpdate::xfer - m_productionQueue is not empty, but should be" )); throw SC_INVALID_DATA; } // end if @@ -1323,7 +1323,7 @@ void ProductionUpdate::xfer( Xfer *xfer ) if( production->m_objectToProduce == NULL ) { - DEBUG_CRASH(( "ProductionUpdate::xfer - Cannot find template '%s'\n", name.str() )); + DEBUG_CRASH(( "ProductionUpdate::xfer - Cannot find template '%s'", name.str() )); throw SC_INVALID_DATA; } // end if @@ -1336,7 +1336,7 @@ void ProductionUpdate::xfer( Xfer *xfer ) if( production->m_upgradeToResearch == NULL ) { - DEBUG_CRASH(( "ProductionUpdate::xfer - Cannot find upgrade '%s'\n", name.str() )); + DEBUG_CRASH(( "ProductionUpdate::xfer - Cannot find upgrade '%s'", name.str() )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp index de9dfb67e4..6db905e6ca 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp @@ -878,7 +878,7 @@ void StealthUpdate::xfer( Xfer *xfer ) if( m_disguiseAsTemplate == NULL ) { - DEBUG_CRASH(( "StealthUpdate::xfer - Unknown template '%s'\n", name.str() )); + DEBUG_CRASH(( "StealthUpdate::xfer - Unknown template '%s'", name.str() )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/WaveGuideUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/WaveGuideUpdate.cpp index 88e4c10b52..86818e10c4 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/WaveGuideUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/WaveGuideUpdate.cpp @@ -179,7 +179,7 @@ Bool WaveGuideUpdate::startMoving( void ) if( verify->getNumLinks() > 1 ) { - DEBUG_CRASH(( "WaveGuideUpdate::startMoving - The waypoint path cannot have multiple link choices at any node\n" )); + DEBUG_CRASH(( "WaveGuideUpdate::startMoving - The waypoint path cannot have multiple link choices at any node" )); return FALSE; } // end if @@ -197,7 +197,7 @@ Bool WaveGuideUpdate::startMoving( void ) if( next == NULL ) { - DEBUG_CRASH(( "WaveGuideUpdate:startMoving - There must be a linked waypoint path to follow\n" )); + DEBUG_CRASH(( "WaveGuideUpdate:startMoving - There must be a linked waypoint path to follow" )); return FALSE; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 37e2df8080..6cb29e62d8 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -1080,7 +1080,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate } else { - //DEBUG_CRASH(("Projectiles should implement ProjectileUpdateInterface!\n")); + //DEBUG_CRASH(("Projectiles should implement ProjectileUpdateInterface!")); // actually, this is ok, for things like Firestorm.... (srj) projectile->setPosition(&projectileDestination); } @@ -1337,7 +1337,7 @@ void WeaponTemplate::dealDamageInternal(ObjectID sourceID, ObjectID victimID, co } else { - DEBUG_CRASH(("projectile weapons should never get dealDamage called directly\n")); + DEBUG_CRASH(("projectile weapons should never get dealDamage called directly")); } } @@ -2745,7 +2745,7 @@ void Weapon::processRequestAssistance( const Object *requestingObject, Object *v if (!draw || !draw->getProjectileLaunchOffset(wslot, specificBarrelToUse, &attachTransform, tur, &turretRotPos, &turretPitchPos)) { //CRCDEBUG_LOG(("ProjectileLaunchPos %d %d not found!",wslot, specificBarrelToUse)); - DEBUG_CRASH(("ProjectileLaunchPos %d %d not found!\n",wslot, specificBarrelToUse)); + DEBUG_CRASH(("ProjectileLaunchPos %d %d not found!",wslot, specificBarrelToUse)); attachTransform.Make_Identity(); turretRotPos.zero(); turretPitchPos.zero(); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp index 5b2ea6af60..4e1c78fd22 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp @@ -991,7 +991,7 @@ Bool WeaponSet::setWeaponLock( WeaponSlotType weaponSlot, WeaponLockType lockTyp { if (lockType == NOT_LOCKED) { - DEBUG_CRASH(("calling setWeaponLock with NOT_LOCKED, so I am doing nothing... did you mean to use releaseWeaponLock()?\n")); + DEBUG_CRASH(("calling setWeaponLock with NOT_LOCKED, so I am doing nothing... did you mean to use releaseWeaponLock()?")); return false; } @@ -1015,7 +1015,7 @@ Bool WeaponSet::setWeaponLock( WeaponSlotType weaponSlot, WeaponLockType lockTyp return true; } - DEBUG_CRASH(("setWeaponLock: weapon %d not found (missing an upgrade?)\n", (Int)weaponSlot)); + DEBUG_CRASH(("setWeaponLock: weapon %d not found (missing an upgrade?)", (Int)weaponSlot)); return false; } @@ -1040,7 +1040,7 @@ void WeaponSet::releaseWeaponLock(WeaponLockType lockType) } else { - DEBUG_CRASH(("calling releaseWeaponLock with NOT_LOCKED makes no sense. why did you do this?\n")); + DEBUG_CRASH(("calling releaseWeaponLock with NOT_LOCKED makes no sense. why did you do this?")); } } diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp index 0a7a12a956..3ce0e802fc 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp @@ -6352,7 +6352,7 @@ void ScriptActions::executeAction( ScriptAction *pAction ) { const char* MSG = "Your Script requested the following message be displayed:\n\n"; const char* MSG2 = "\n\nTHIS IS NOT A BUG. DO NOT REPORT IT."; - DEBUG_CRASH(("%s%s%s\n",MSG,pAction->getParameter(0)->getString().str(),MSG2)); + DEBUG_CRASH(("%s%s%s",MSG,pAction->getParameter(0)->getString().str(),MSG2)); } #endif return; diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp index cd98bce9c4..4ccd67644a 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp @@ -1030,7 +1030,7 @@ Bool ScriptConditions::evaluateEnemySighted(Parameter *pItemParm, Parameter *pAl relationDescriber = PartitionFilterRelationship::ALLOW_ENEMIES; break; default: - DEBUG_CRASH(("Unhandled case in ScriptConditions::evaluateEnemySighted()\n")); + DEBUG_CRASH(("Unhandled case in ScriptConditions::evaluateEnemySighted()")); relationDescriber = 0; break; } @@ -2760,7 +2760,7 @@ Bool ScriptConditions::evaluateCondition( Condition *pCondition ) return evaluateSciencePurchasePoints(pCondition->getParameter(0), pCondition->getParameter(1)); case Condition::DEFUNCT_PLAYER_SELECTED_GENERAL: case Condition::DEFUNCT_PLAYER_SELECTED_GENERAL_FROM_NAMED: - DEBUG_CRASH(("PLAYER_SELECTED_GENERAL script conditions are no longer in use\n")); + DEBUG_CRASH(("PLAYER_SELECTED_GENERAL script conditions are no longer in use")); return false; case Condition::PLAYER_BUILT_UPGRADE: return evaluateUpgradeFromUnitComplete(pCondition->getParameter(0), pCondition->getParameter(1), NULL); diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp index b0a3a8070e..7b292f4e6a 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp @@ -326,7 +326,7 @@ void AttackPriorityInfo::xfer( Xfer *xfer ) if( thingTemplate == NULL ) { - DEBUG_CRASH(( "AttackPriorityInfo::xfer - Unable to find thing template '%s'\n", + DEBUG_CRASH(( "AttackPriorityInfo::xfer - Unable to find thing template '%s'", thingTemplateName.str() )); throw SC_INVALID_DATA; @@ -5447,7 +5447,7 @@ void ScriptEngine::createNamedMapReveal(const AsciiString& revealName, const Asc // Will fail if there's already one in existence of the same name. for (it = m_namedReveals.begin(); it != m_namedReveals.end(); ++it) { if (it->m_revealName == revealName) { - DEBUG_CRASH(("ScriptEngine::createNamedMapReveal: Attempted to redefine named Reveal '%s', so I won't change it.\n", revealName.str())); + DEBUG_CRASH(("ScriptEngine::createNamedMapReveal: Attempted to redefine named Reveal '%s', so I won't change it.", revealName.str())); return; } } @@ -7450,7 +7450,7 @@ void SequentialScript::xfer( Xfer *xfer ) if( teamID != TEAM_ID_INVALID && m_teamToExecOn == NULL ) { - DEBUG_CRASH(( "SequentialScript::xfer - Unable to find team by ID (#%d) for m_teamToExecOn\n", + DEBUG_CRASH(( "SequentialScript::xfer - Unable to find team by ID (#%d) for m_teamToExecOn", teamID )); throw SC_INVALID_DATA; @@ -7850,7 +7850,7 @@ static void xferListAsciiString( Xfer *xfer, ListAsciiString *list ) if( list->empty() == FALSE ) { - DEBUG_CRASH(( "xferListAsciiString - list should be empty upon loading but is not\n" )); + DEBUG_CRASH(( "xferListAsciiString - list should be empty upon loading but is not" )); throw SC_INVALID_DATA; } // end if @@ -7920,7 +7920,7 @@ static void xferListAsciiStringUINT( Xfer *xfer, ListAsciiStringUINT *list ) if( list->empty() == FALSE ) { - DEBUG_CRASH(( "xferListAsciiStringUINT - list should be empty upon loading but is not\n" )); + DEBUG_CRASH(( "xferListAsciiStringUINT - list should be empty upon loading but is not" )); throw SC_INVALID_DATA; } // end if @@ -7995,7 +7995,7 @@ static void xferListAsciiStringObjectID( Xfer *xfer, ListAsciiStringObjectID *li if( list->empty() == FALSE ) { - DEBUG_CRASH(( "xferListAsciiStringObjectID - list should be empty upon loading but is not\n" )); + DEBUG_CRASH(( "xferListAsciiStringObjectID - list should be empty upon loading but is not" )); throw SC_INVALID_DATA; } // end if @@ -8070,7 +8070,7 @@ static void xferListAsciiStringCoord3D( Xfer *xfer, ListAsciiStringCoord3D *list if( list->empty() == FALSE ) { - DEBUG_CRASH(( "xferListAsciiStringCoord3D - list should be empty upon loading but is not\n" )); + DEBUG_CRASH(( "xferListAsciiStringCoord3D - list should be empty upon loading but is not" )); throw SC_INVALID_DATA; } // end if @@ -8151,7 +8151,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( m_sequentialScripts.size() != 0 ) { - DEBUG_CRASH(( "ScriptEngine::xfer - m_sequentialScripts should be empty but is not\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - m_sequentialScripts should be empty but is not" )); throw SC_INVALID_DATA; } // end if @@ -8179,7 +8179,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( countersSize > MAX_COUNTERS ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_COUNTERS has changed size, need to version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_COUNTERS has changed size, need to version this" )); throw SC_INVALID_DATA; } // end if @@ -8206,7 +8206,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( flagsSize > MAX_FLAGS ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_FLAGS has changed size, need to version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_FLAGS has changed size, need to version this" )); throw SC_INVALID_DATA; } // end if @@ -8230,7 +8230,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( attackPriorityInfoSize > MAX_ATTACK_PRIORITIES ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_ATTACK_PRIORITIES size has changed, need to version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_ATTACK_PRIORITIES size has changed, need to version this" )); throw SC_INVALID_DATA; } // end if @@ -8298,7 +8298,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( obj == NULL && objectID != INVALID_ID ) { - DEBUG_CRASH(( "ScriptEngine::xfer - Unable to find object by ID for m_namedObjects\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - Unable to find object by ID for m_namedObjects" )); throw SC_INVALID_DATA; } // end if @@ -8357,7 +8357,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( triggeredSpecialPowersSize != MAX_PLAYER_COUNT ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_triggeredSpecialPowers size is now different and we must version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_triggeredSpecialPowers size is now different and we must version this" )); throw SC_INVALID_DATA; } // end if @@ -8370,7 +8370,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( midwaySpecialPowersSize != MAX_PLAYER_COUNT ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_midwaySpecialPowers size is now different and we must version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_midwaySpecialPowers size is now different and we must version this" )); throw SC_INVALID_DATA; } // end if @@ -8383,7 +8383,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( finishedSpecialPowersSize != MAX_PLAYER_COUNT ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_finishedSpecialPowers size is now different and we must version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_finishedSpecialPowers size is now different and we must version this" )); throw SC_INVALID_DATA; } // end if @@ -8396,7 +8396,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( completedUpgradesSize != MAX_PLAYER_COUNT ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_completedUpgrades size is now different and we must version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_completedUpgrades size is now different and we must version this" )); throw SC_INVALID_DATA; } // end if @@ -8409,7 +8409,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( acquiredSciencesSize != MAX_PLAYER_COUNT ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_acquiredSciences size is now different and we must version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_acquiredSciences size is now different and we must version this" )); throw SC_INVALID_DATA; } // end if @@ -8474,7 +8474,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( m_namedReveals.empty() == FALSE ) { - DEBUG_CRASH(( "ScriptEngine::xfer - m_namedReveals should be empty but is not!\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - m_namedReveals should be empty but is not!" )); throw SC_INVALID_DATA; } // end if @@ -8533,7 +8533,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( m_allObjectTypeLists.empty() == FALSE ) { - DEBUG_CRASH(( "ScriptEngine::xfer - m_allObjectTypeLists should be empty but is not!\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - m_allObjectTypeLists should be empty but is not!" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp index 8f7672dbfd..e030c59df8 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp @@ -1910,7 +1910,7 @@ AsciiString Parameter::getUiText(void) const case RADAR_EVENT_TYPE: switch (m_int) { //case RADAR_EVENT_INVALID: ++m_int; // continue to the next case. - case RADAR_EVENT_INVALID: DEBUG_CRASH(("Invalid radar event\n")); uiText.format("Construction"); break; + case RADAR_EVENT_INVALID: DEBUG_CRASH(("Invalid radar event")); uiText.format("Construction"); break; case RADAR_EVENT_CONSTRUCTION: uiText.format("Construction"); break; case RADAR_EVENT_UPGRADE: uiText.format("Upgrade"); break; case RADAR_EVENT_UNDER_ATTACK: uiText.format("Under Attack"); break; @@ -2370,7 +2370,7 @@ Bool ScriptAction::ParseActionDataChunk(DataChunkInput &file, DataChunkInfo *inf #if defined(RTS_DEBUG) const ActionTemplate* at = TheScriptEngine->getActionTemplate(pScriptAction->m_actionType); if (at && (at->getName().isEmpty() || (at->getName().compareNoCase("(placeholder)") == 0))) { - DEBUG_CRASH(("Invalid Script Action found in script '%s'\n", pScript->getName().str())); + DEBUG_CRASH(("Invalid Script Action found in script '%s'", pScript->getName().str())); } #endif diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/CaveSystem.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/CaveSystem.cpp index a6c3a6ebd0..947b481554 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/CaveSystem.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/CaveSystem.cpp @@ -169,7 +169,7 @@ void CaveSystem::xfer( Xfer *xfer ) if( m_tunnelTrackerVector.empty() == FALSE ) { - DEBUG_CRASH(( "CaveSystem::xfer - m_tunnelTrackerVector should be empty but is not\n" )); + DEBUG_CRASH(( "CaveSystem::xfer - m_tunnelTrackerVector should be empty but is not" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 91470a20de..3e75fbf39f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -1020,7 +1020,7 @@ void GameLogic::startNewGame( Bool saveGame ) if (TheGameState->isInSaveDirectory(TheGlobalData->m_mapName)) { - DEBUG_CRASH(( "FATAL SAVE/LOAD ERROR! - Setting a pristine map name that refers to a map in the save directory. The pristine map should always refer to the ORIGINAL map in the Maps directory, if the pristine map string is corrupt then map.ini files will not load correctly.\n" )); + DEBUG_CRASH(( "FATAL SAVE/LOAD ERROR! - Setting a pristine map name that refers to a map in the save directory. The pristine map should always refer to the ORIGINAL map in the Maps directory, if the pristine map string is corrupt then map.ini files will not load correctly." )); } // end if @@ -2710,7 +2710,7 @@ void GameLogic::friend_awakenUpdateModule(Object* obj, UpdateModulePtr u, Unsign if (u == m_curUpdateModule) { - DEBUG_CRASH(("You should not call setWakeFrame() from inside your update(), because it will be ignored, in favor of the return code from update.\n")); + DEBUG_CRASH(("You should not call setWakeFrame() from inside your update(), because it will be ignored, in favor of the return code from update.")); return; } @@ -4294,7 +4294,7 @@ void GameLogic::xfer( Xfer *xfer ) if( tocEntry == NULL ) { - DEBUG_CRASH(( "GameLogic::xfer - Object TOC entry not found for '%s'\n", obj->getTemplate()->getName().str() )); + DEBUG_CRASH(( "GameLogic::xfer - Object TOC entry not found for '%s'", obj->getTemplate()->getName().str() )); throw SC_INVALID_DATA; } // end if @@ -4334,7 +4334,7 @@ void GameLogic::xfer( Xfer *xfer ) if( tocEntry == NULL ) { - DEBUG_CRASH(( "GameLogic::xfer - No TOC entry match for id '%d'\n", tocID )); + DEBUG_CRASH(( "GameLogic::xfer - No TOC entry match for id '%d'", tocID )); throw SC_INVALID_DATA; } // end if @@ -4347,7 +4347,7 @@ void GameLogic::xfer( Xfer *xfer ) if( thingTemplate == NULL ) { - DEBUG_CRASH(( "GameLogic::xfer - Unrecognized thing template name '%s', skipping. ENGINEERS - Are you *sure* it's OK to be ignoring this object from the save file??? Think hard about it!\n", + DEBUG_CRASH(( "GameLogic::xfer - Unrecognized thing template name '%s', skipping. ENGINEERS - Are you *sure* it's OK to be ignoring this object from the save file??? Think hard about it!", tocEntry->name.str() )); xfer->skip( objectDataSize ); continue; @@ -4404,7 +4404,7 @@ void GameLogic::xfer( Xfer *xfer ) if( sanityTriggerCount != triggerCount ) { - DEBUG_CRASH(( "GameLogic::xfer - Polygon trigger count mismatch. Save file has a count of '%d', but map had '%d' triggers\n", + DEBUG_CRASH(( "GameLogic::xfer - Polygon trigger count mismatch. Save file has a count of '%d', but map had '%d' triggers", sanityTriggerCount, triggerCount )); throw SC_INVALID_DATA; @@ -4446,7 +4446,7 @@ void GameLogic::xfer( Xfer *xfer ) if( poly == NULL ) { - DEBUG_CRASH(( "GameLogic::xfer - Unable to find polygon trigger with id '%d'\n", + DEBUG_CRASH(( "GameLogic::xfer - Unable to find polygon trigger with id '%d'", triggerID )); throw SC_INVALID_DATA; @@ -4497,7 +4497,7 @@ void GameLogic::xfer( Xfer *xfer ) { if (m_thingTemplateBuildableOverrides.empty() == false) { - DEBUG_CRASH(( "GameLogic::xfer - m_thingTemplateBuildableOverrides should be empty, but is not\n")); + DEBUG_CRASH(( "GameLogic::xfer - m_thingTemplateBuildableOverrides should be empty, but is not")); throw SC_INVALID_DATA; } @@ -4537,7 +4537,7 @@ void GameLogic::xfer( Xfer *xfer ) { if (m_controlBarOverrides.empty() == false) { - DEBUG_CRASH(( "GameLogic::xfer - m_controlBarOverrides should be empty, but is not\n")); + DEBUG_CRASH(( "GameLogic::xfer - m_controlBarOverrides should be empty, but is not")); throw SC_INVALID_DATA; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp b/Generals/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp index b610433cd0..99c6115c0f 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp @@ -1927,7 +1927,7 @@ void ConnectionManager::parseUserList(const GameInfo *game) /* if ( numUsers < 2 || m_localSlot == -1 ) { - DEBUG_CRASH(("FAILED parseUserList - network game won't work as expected\n")); + DEBUG_CRASH(("FAILED parseUserList - network game won't work as expected")); return; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/FirewallHelper.cpp b/Generals/Code/GameEngine/Source/GameNetwork/FirewallHelper.cpp index 5bd0527c24..47afcb4bd4 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/FirewallHelper.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/FirewallHelper.cpp @@ -1175,7 +1175,7 @@ Bool FirewallHelperClass::detectionTest4Stage2Update() { DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - NAT uses the same source port for different destination ports")); } else { DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - Unable to complete destination port mangling test")); - DEBUG_CRASH(("Unable to complete destination port mangling test\n")); + DEBUG_CRASH(("Unable to complete destination port mangling test")); } } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp index 707b567aa9..6b745ad14a 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp @@ -135,7 +135,7 @@ void ShowUnderlyingGUIElements( Bool show, const char *layoutFilename, const cha GameWindow *parent = TheWindowManager->winGetWindowFromId( NULL, parentID ); if (!parent) { - DEBUG_CRASH(("Window %s not found\n", parentNameStr.str())); + DEBUG_CRASH(("Window %s not found", parentNameStr.str())); return; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameInfo.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameInfo.cpp index 719988407e..95cc2fd0af 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameInfo.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameInfo.cpp @@ -203,7 +203,7 @@ void GameSlot::setState( SlotState state, UnicodeString name, UnsignedInt IP ) if (state == SLOT_OPEN && TheGameSpyGame && TheGameSpyGame->getConstSlot(0) == this) { - DEBUG_CRASH(("Game Is Hosed!\n")); + DEBUG_CRASH(("Game Is Hosed!")); } } if (state == SLOT_PLAYER) diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp index 708f03cb47..bad49a704e 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp @@ -294,7 +294,7 @@ static void gameTooltip(GameWindow *window, GameSpyGameSlot *slot = room->getGameSpySlot(i); if (i == 0 && (!slot || !slot->isHuman())) { - DEBUG_CRASH(("About to tooltip a non-hosted game!\n")); + DEBUG_CRASH(("About to tooltip a non-hosted game!")); } if (slot && slot->isHuman()) { diff --git a/Generals/Code/GameEngine/Source/GameNetwork/Transport.cpp b/Generals/Code/GameEngine/Source/GameNetwork/Transport.cpp index dcdf000244..3f89cb19a5 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/Transport.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/Transport.cpp @@ -118,7 +118,7 @@ Bool Transport::init( UnsignedInt ip, UnsignedShort port ) } if (retval != 0) { - DEBUG_CRASH(("Could not bind to 0x%8.8X:%d\n", ip, port)); + DEBUG_CRASH(("Could not bind to 0x%8.8X:%d", ip, port)); DEBUG_LOG(("Transport::init - Failure to bind socket with error code %x", retval)); delete m_udpsock; m_udpsock = NULL; diff --git a/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp b/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp index 9d6f97bda0..e1ec6538cf 100644 --- a/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp +++ b/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp @@ -2993,7 +2993,7 @@ void MilesAudioManager::friend_forcePlayAudioEventRTS(const AudioEventRTS* event if (!eventToPlay->getAudioEventInfo()) { getInfoForAudioEvent(eventToPlay); if (!eventToPlay->getAudioEventInfo()) { - DEBUG_CRASH(("No info for forced audio event '%s'\n", eventToPlay->getEventName().str())); + DEBUG_CRASH(("No info for forced audio event '%s'", eventToPlay->getEventName().str())); return; } } @@ -3106,7 +3106,7 @@ AudioFileCache::~AudioFileCache() OpenFilesHashIt it; for ( it = m_openFiles.begin(); it != m_openFiles.end(); ++it ) { if (it->second.m_openCount > 0) { - DEBUG_CRASH(("Sample '%s' is still playing, and we're trying to quit.\n", it->second.m_eventInfo->m_audioName.str())); + DEBUG_CRASH(("Sample '%s' is still playing, and we're trying to quit.", it->second.m_eventInfo->m_audioName.str())); } releaseOpenAudioFile(&it->second); @@ -3188,7 +3188,7 @@ void *AudioFileCache::openFile( AudioEventRTS *eventToOpenFrom ) openedAudioFile.m_soundInfo = soundInfo; openedAudioFile.m_openCount = 1; } else { - DEBUG_CRASH(("Unexpected compression type in '%s'\n", strToFind.str())); + DEBUG_CRASH(("Unexpected compression type in '%s'", strToFind.str())); // prevent leaks delete [] buffer; return NULL; diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp index 3dbdb1989e..f113abaa92 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp @@ -88,7 +88,7 @@ static WW3DFormat findFormat(const WW3DFormat formats[]) } // end if } // end for i - DEBUG_CRASH(("WW3DRadar: No appropriate texture format\n") ); + DEBUG_CRASH(("WW3DRadar: No appropriate texture format") ); return WW3D_FORMAT_UNKNOWN; } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 657f59b83b..34a232dba0 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -671,7 +671,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c if (!doSingleBoneName(robj, *it, m_pristineBones)) { // don't crash here, since these are catch-all global bones and won't be present in most models. - //DEBUG_CRASH(("public bone %s (and variations thereof) not found in model %s!\n",it->str(),m_modelName.str())); + //DEBUG_CRASH(("public bone %s (and variations thereof) not found in model %s!",it->str(),m_modelName.str())); } //else //{ @@ -684,7 +684,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c if (!doSingleBoneName(robj, *it, m_pristineBones)) { // DO crash here, since we specifically requested this bone for this model - DEBUG_CRASH(("*** ASSET ERROR: public bone '%s' (and variations thereof) not found in model %s!\n",it->str(),m_modelName.str())); + DEBUG_CRASH(("*** ASSET ERROR: public bone '%s' (and variations thereof) not found in model %s!",it->str(),m_modelName.str())); } //else //{ @@ -854,7 +854,7 @@ void ModelConditionInfo::validateTurretInfo() const { if (findPristineBone(tur.m_turretAngleNameKey, &tur.m_turretAngleBone) == NULL) { - DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found! (%s)\n",KEYNAME(tur.m_turretAngleNameKey).str(),m_modelName.str())); + DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found! (%s)",KEYNAME(tur.m_turretAngleNameKey).str(),m_modelName.str())); tur.m_turretAngleBone = 0; } } @@ -867,7 +867,7 @@ void ModelConditionInfo::validateTurretInfo() const { if (findPristineBone(tur.m_turretPitchNameKey, &tur.m_turretPitchBone) == NULL) { - DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found! (%s)\n",KEYNAME(tur.m_turretPitchNameKey).str(),m_modelName.str())); + DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found! (%s)",KEYNAME(tur.m_turretPitchNameKey).str(),m_modelName.str())); tur.m_turretPitchBone = 0; } } @@ -1423,19 +1423,19 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void { if (self->m_defaultState >= 0) { - DEBUG_CRASH(("*** ASSET ERROR: you may have only one default state!\n")); + DEBUG_CRASH(("*** ASSET ERROR: you may have only one default state!")); throw INI_INVALID_DATA; } else if (ini->getNextTokenOrNull()) { - DEBUG_CRASH(("*** ASSET ERROR: unknown keyword\n")); + DEBUG_CRASH(("*** ASSET ERROR: unknown keyword")); throw INI_INVALID_DATA; } else { if (!self->m_conditionStates.empty()) { - DEBUG_CRASH(("*** ASSET ERROR: when using DefaultConditionState, it must be the first state listed (%s)\n",TheThingTemplateBeingParsedName.str())); + DEBUG_CRASH(("*** ASSET ERROR: when using DefaultConditionState, it must be the first state listed (%s)",TheThingTemplateBeingParsedName.str())); throw INI_INVALID_DATA; } @@ -1466,7 +1466,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void if (firstKey == secondKey) { - DEBUG_CRASH(("*** ASSET ERROR: You may not declare a transition between two identical states\n")); + DEBUG_CRASH(("*** ASSET ERROR: You may not declare a transition between two identical states")); throw INI_INVALID_DATA; } @@ -1495,7 +1495,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void { if (self->m_conditionStates.empty()) { - DEBUG_CRASH(("*** ASSET ERROR: AliasConditionState must refer to the previous state!\n")); + DEBUG_CRASH(("*** ASSET ERROR: AliasConditionState must refer to the previous state!")); throw INI_INVALID_DATA; } @@ -1515,7 +1515,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void if (conditionsYes.anyIntersectionWith(self->m_ignoreConditionStates)) { - DEBUG_CRASH(("You should not specify bits in a state once they are used in IgnoreConditionStates (%s)\n", TheThingTemplateBeingParsedName.str())); + DEBUG_CRASH(("You should not specify bits in a state once they are used in IgnoreConditionStates (%s)", TheThingTemplateBeingParsedName.str())); throw INI_INVALID_DATA; } @@ -1550,7 +1550,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void // files too badly. maybe someday. // else // { - // DEBUG_CRASH(("*** ASSET ERROR: you must specify a default state\n")); + // DEBUG_CRASH(("*** ASSET ERROR: you must specify a default state")); // throw INI_INVALID_DATA; // } @@ -1569,14 +1569,14 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void if (conditionsYes.anyIntersectionWith(self->m_ignoreConditionStates)) { - DEBUG_CRASH(("You should not specify bits in a state once they are used in IgnoreConditionStates (%s)\n", TheThingTemplateBeingParsedName.str())); + DEBUG_CRASH(("You should not specify bits in a state once they are used in IgnoreConditionStates (%s)", TheThingTemplateBeingParsedName.str())); throw INI_INVALID_DATA; } if (self->m_defaultState < 0 && self->m_conditionStates.empty() && conditionsYes.any()) { // it doesn't actually NEED to be first, but it does need to be present, and this is the simplest way to enforce... - DEBUG_CRASH(("*** ASSET ERROR: when not using DefaultConditionState, the first ConditionState must be for NONE (%s)\n",TheThingTemplateBeingParsedName.str())); + DEBUG_CRASH(("*** ASSET ERROR: when not using DefaultConditionState, the first ConditionState must be for NONE (%s)",TheThingTemplateBeingParsedName.str())); throw INI_INVALID_DATA; } @@ -1619,7 +1619,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void if ((info.m_iniReadFlags & (1<subObjName.str(),getDrawable()->getTemplate()->getName().str())); + DEBUG_CRASH(("*** ASSET ERROR: SubObject %s not found (%s)!",it->subObjName.str(),getDrawable()->getTemplate()->getName().str())); } } } @@ -3309,7 +3309,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( if (turInfo.m_turretAngleNameKey != NAMEKEY_INVALID && !stateToUse->findPristineBonePos(turInfo.m_turretAngleNameKey, *turretRotPos)) { - DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found!\n",KEYNAME(turInfo.m_turretAngleNameKey).str())); + DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found!",KEYNAME(turInfo.m_turretAngleNameKey).str())); } #ifdef CACHE_ATTACH_BONE if (offset) @@ -3325,7 +3325,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( if (turInfo.m_turretPitchNameKey != NAMEKEY_INVALID && !stateToUse->findPristineBonePos(turInfo.m_turretPitchNameKey, *turretPitchPos)) { - DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found!\n",KEYNAME(turInfo.m_turretPitchNameKey).str())); + DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found!",KEYNAME(turInfo.m_turretPitchNameKey).str())); } #ifdef CACHE_ATTACH_BONE if (offset) @@ -3414,7 +3414,7 @@ Int W3DModelDraw::getPristineBonePositionsForConditionState( } else { - //DEBUG_CRASH(("*** ASSET ERROR: Bone %s not found!\n",buffer)); + //DEBUG_CRASH(("*** ASSET ERROR: Bone %s not found!",buffer)); const Object *obj = getDrawable()->getObject(); if (obj) transforms[posCount] = *obj->getTransformMatrix(); @@ -3892,7 +3892,7 @@ void W3DModelDraw::updateSubObjects() } else { - DEBUG_CRASH(("*** ASSET ERROR: SubObject %s not found (%s)!\n",it->subObjName.str(),getDrawable()->getTemplate()->getName().str())); + DEBUG_CRASH(("*** ASSET ERROR: SubObject %s not found (%s)!",it->subObjName.str(),getDrawable()->getTemplate()->getName().str())); } } } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp index 9dcf23c826..de175b53be 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp @@ -233,7 +233,7 @@ DisplayString *W3DDisplayStringManager::getGroupNumeralString( Int numeral ) { if (numeral < 0 || numeral > MAX_GROUPS - 1 ) { - DEBUG_CRASH(("Numeral '%d' out of range.\n", numeral)); + DEBUG_CRASH(("Numeral '%d' out of range.", numeral)); return m_groupNumeralStrings[0]; } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp index b89ca162d1..25c74b869b 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp @@ -752,7 +752,7 @@ void W3DTerrainVisual::xfer( Xfer *xfer ) if( gridEnabled != m_isWaterGridRenderingEnabled ) { - DEBUG_CRASH(( "W3DTerrainVisual::xfer - m_isWaterGridRenderingEnabled mismatch\n" )); + DEBUG_CRASH(( "W3DTerrainVisual::xfer - m_isWaterGridRenderingEnabled mismatch" )); throw SC_INVALID_DATA; } // end if @@ -772,7 +772,7 @@ void W3DTerrainVisual::xfer( Xfer *xfer ) if( width != getGridWidth() ) { - DEBUG_CRASH(( "W3DTerainVisual::xfer - grid width mismatch '%d' should be '%d'\n", + DEBUG_CRASH(( "W3DTerainVisual::xfer - grid width mismatch '%d' should be '%d'", width, getGridWidth() )); throw SC_INVALID_DATA; @@ -780,7 +780,7 @@ void W3DTerrainVisual::xfer( Xfer *xfer ) if( height != getGridHeight() ) { - DEBUG_CRASH(( "W3DTerainVisual::xfer - grid height mismatch '%d' should be '%d'\n", + DEBUG_CRASH(( "W3DTerainVisual::xfer - grid height mismatch '%d' should be '%d'", height, getGridHeight() )); throw SC_INVALID_DATA; diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp index 6192edd312..f1918165c2 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp @@ -3418,7 +3418,7 @@ void WaterRenderObjClass::xfer( Xfer *xfer ) if( cellsX != m_gridCellsX ) { - DEBUG_CRASH(( "WaterRenderObjClass::xfer - cells X mismatch\n" )); + DEBUG_CRASH(( "WaterRenderObjClass::xfer - cells X mismatch" )); throw SC_INVALID_DATA; } // end if @@ -3429,7 +3429,7 @@ void WaterRenderObjClass::xfer( Xfer *xfer ) if( cellsY != m_gridCellsY ) { - DEBUG_CRASH(( "WaterRenderObjClass::xfer - cells Y mismatch\n" )); + DEBUG_CRASH(( "WaterRenderObjClass::xfer - cells Y mismatch" )); throw SC_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp index 8d57fdd70c..22bd766165 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp @@ -632,7 +632,7 @@ void W3DGhostObject::xfer( Xfer *xfer ) // sanity if( drawableID != INVALID_DRAWABLE_ID && m_drawableInfo.m_drawable == NULL ) - DEBUG_CRASH(( "W3DGhostObject::xfer - Unable to find drawable for ghost object\n" )); + DEBUG_CRASH(( "W3DGhostObject::xfer - Unable to find drawable for ghost object" )); } // end if @@ -671,7 +671,7 @@ void W3DGhostObject::xfer( Xfer *xfer ) if( snapshotCount == 0 && m_parentSnapshots[ i ] != NULL ) { - DEBUG_CRASH(( "W3DGhostObject::xfer - m_parentShapshots[ %d ] has data present but the count from the xfer stream is empty\n" )); + DEBUG_CRASH(( "W3DGhostObject::xfer - m_parentShapshots[ %d ] has data present but the count from the xfer stream is empty" )); throw INI_INVALID_DATA; } // end if diff --git a/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp b/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp index ee712a4ea7..c11312d3b2 100644 --- a/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp +++ b/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp @@ -248,7 +248,7 @@ void Win32Mouse::translateEvent( UnsignedInt eventIndex, MouseIO *result ) default: { - DEBUG_CRASH(( "translateEvent: Unknown Win32 mouse event [%d,%d,%d]\n", + DEBUG_CRASH(( "translateEvent: Unknown Win32 mouse event [%d,%d,%d]", msg, wParam, lParam )); return; diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp index 337bbab564..4b8c03d26a 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp @@ -1408,7 +1408,7 @@ void DX8SkinFVFCategoryContainer::Add_Visible_Skin(MeshClass * mesh) { if (mesh->Peek_Next_Visible_Skin() != NULL || mesh == VisibleSkinTail) { - DEBUG_CRASH(("Mesh %s is already a visible skin, and we tried to add it again... please notify Mark W or Steven J immediately!\n",mesh->Get_Name())); + DEBUG_CRASH(("Mesh %s is already a visible skin, and we tried to add it again... please notify Mark W or Steven J immediately!",mesh->Get_Name())); return; } if (VisibleSkinHead == NULL) diff --git a/Generals/Code/Tools/WorldBuilder/src/MainFrm.cpp b/Generals/Code/Tools/WorldBuilder/src/MainFrm.cpp index 86450a5fc2..9d39b171f6 100644 --- a/Generals/Code/Tools/WorldBuilder/src/MainFrm.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/MainFrm.cpp @@ -125,7 +125,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { - DEBUG_CRASH(("Failed to create status bar\n")); + DEBUG_CRASH(("Failed to create status bar")); } if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP diff --git a/Generals/Code/Tools/WorldBuilder/src/ObjectOptions.cpp b/Generals/Code/Tools/WorldBuilder/src/ObjectOptions.cpp index ac78cee7a7..259b47b2b3 100644 --- a/Generals/Code/Tools/WorldBuilder/src/ObjectOptions.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/ObjectOptions.cpp @@ -101,7 +101,7 @@ static Int findSideListEntryWithPlayerOfSide(AsciiString side) } } - // DEBUG_CRASH(("no SideList entry found for %s!\n",side.str())); + // DEBUG_CRASH(("no SideList entry found for %s!",side.str())); return -1; } @@ -218,7 +218,7 @@ static const PlayerTemplate* findFirstPlayerTemplateOnSide(AsciiString side) } } - DEBUG_CRASH(("no player found for %s!\n",side.str())); + DEBUG_CRASH(("no player found for %s!",side.str())); return NULL; } #endif diff --git a/Generals/Code/Tools/WorldBuilder/src/WBFrameWnd.cpp b/Generals/Code/Tools/WorldBuilder/src/WBFrameWnd.cpp index 447dbd3225..862a8e6218 100644 --- a/Generals/Code/Tools/WorldBuilder/src/WBFrameWnd.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/WBFrameWnd.cpp @@ -55,7 +55,7 @@ BOOL CWBFrameWnd::LoadFrame(UINT nIDResource, SWP_NOZORDER|SWP_NOSIZE); if (!m_cellSizeToolBar.Create(this, IDD_CELL_SLIDER, CBRS_LEFT, IDD_CELL_SLIDER)) { - DEBUG_CRASH(("Failed to create toolbar\n")); + DEBUG_CRASH(("Failed to create toolbar")); } EnableDocking(CBRS_ALIGN_ANY); m_cellSizeToolBar.SetupSlider(); diff --git a/GeneralsMD/Code/GameEngine/Include/Common/BitFlagsIO.h b/GeneralsMD/Code/GameEngine/Include/Common/BitFlagsIO.h index 3557aab3e6..3433b764b9 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/BitFlagsIO.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/BitFlagsIO.h @@ -223,7 +223,7 @@ void BitFlags::xfer(Xfer* xfer) else { - DEBUG_CRASH(( "BitFlagsXfer - Unknown xfer mode '%d'\n", xfer->getXferMode() )); + DEBUG_CRASH(( "BitFlagsXfer - Unknown xfer mode '%d'", xfer->getXferMode() )); throw XFER_MODE_UNKNOWN; } // end else diff --git a/GeneralsMD/Code/GameEngine/Include/Common/SparseMatchFinder.h b/GeneralsMD/Code/GameEngine/Include/Common/SparseMatchFinder.h index ff1aeb557d..eaac259f39 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/SparseMatchFinder.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/SparseMatchFinder.h @@ -174,7 +174,7 @@ class SparseMatchFinder { AsciiString curConditionStr; bits.buildDescription(&curConditionStr); - DEBUG_CRASH(("ambiguous model match in findBestInfoSlow \n\nbetween \n(%s)\n\n(%s)\n\n(%d extra matches found)\n\ncurrent bits are (\n%s)\n", + DEBUG_CRASH(("ambiguous model match in findBestInfoSlow \n\nbetween \n(%s)\n\n(%s)\n\n(%d extra matches found)\n\ncurrent bits are (\n%s)", curBestMatchStr.str(), dupMatchStr.str(), numDupMatches, diff --git a/GeneralsMD/Code/GameEngine/Include/Common/StreamingArchiveFile.h b/GeneralsMD/Code/GameEngine/Include/Common/StreamingArchiveFile.h index 8afab6096c..1ba681e14e 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/StreamingArchiveFile.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/StreamingArchiveFile.h @@ -95,10 +95,10 @@ class StreamingArchiveFile : public RAMFile virtual Int seek( Int new_pos, seekMode mode = CURRENT ); ///< Set file position: See File::seek // Ini's should not be parsed with streaming files, that's just dumb. - virtual void nextLine(Char *buf = NULL, Int bufSize = 0) { DEBUG_CRASH(("Should not call nextLine on a streaming file.\n")); } - virtual Bool scanInt(Int &newInt) { DEBUG_CRASH(("Should not call scanInt on a streaming file.\n")); return FALSE; } - virtual Bool scanReal(Real &newReal) { DEBUG_CRASH(("Should not call scanReal on a streaming file.\n")); return FALSE; } - virtual Bool scanString(AsciiString &newString) { DEBUG_CRASH(("Should not call scanString on a streaming file.\n")); return FALSE; } + virtual void nextLine(Char *buf = NULL, Int bufSize = 0) { DEBUG_CRASH(("Should not call nextLine on a streaming file.")); } + virtual Bool scanInt(Int &newInt) { DEBUG_CRASH(("Should not call scanInt on a streaming file.")); return FALSE; } + virtual Bool scanReal(Real &newReal) { DEBUG_CRASH(("Should not call scanReal on a streaming file.")); return FALSE; } + virtual Bool scanString(AsciiString &newString) { DEBUG_CRASH(("Should not call scanString on a streaming file.")); return FALSE; } virtual Bool open( File *file ); ///< Open file for fast RAM access virtual Bool openFromArchive(File *archiveFile, const AsciiString& filename, Int offset, Int size); ///< copy file data from the given file at the given offset for the given size. diff --git a/GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h b/GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h index 76554e821b..0342a72383 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h @@ -355,7 +355,7 @@ class ThingTemplate : public Overridable #if defined(_MSC_VER) && _MSC_VER < 1300 ThingTemplate(const ThingTemplate& that) : m_geometryInfo(that.m_geometryInfo) { - DEBUG_CRASH(("This should never be called\n")); + DEBUG_CRASH(("This should never be called")); } #else ThingTemplate(const ThingTemplate& that) = delete; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp index 37c3781381..9acb3a2257 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp @@ -419,7 +419,7 @@ AudioHandle AudioManager::addAudioEvent(const AudioEventRTS *eventToAdd) if (!eventToAdd->getAudioEventInfo()) { getInfoForAudioEvent(eventToAdd); if (!eventToAdd->getAudioEventInfo()) { - DEBUG_CRASH(("No info for requested audio event '%s'\n", eventToAdd->getEventName().str())); + DEBUG_CRASH(("No info for requested audio event '%s'", eventToAdd->getEventName().str())); return AHSV_Error; } } @@ -840,7 +840,7 @@ AudioEventInfo *AudioManager::newAudioEventInfo( AsciiString audioName ) { AudioEventInfo *eventInfo = findAudioEventInfo(audioName); if (eventInfo) { - DEBUG_CRASH(("Requested add of '%s' multiple times. Is this intentional? - jkmcd\n", audioName.str())); + DEBUG_CRASH(("Requested add of '%s' multiple times. Is this intentional? - jkmcd", audioName.str())); return eventInfo; } @@ -856,7 +856,7 @@ void AudioManager::addAudioEventInfo( AudioEventInfo * newEvent ) AudioEventInfo *eventInfo = findAudioEventInfo( newEvent->m_audioName ); if (eventInfo) { - DEBUG_CRASH(("Requested add of '%s' multiple times. Is this intentional? - jkmcd\n", newEvent->m_audioName.str())); + DEBUG_CRASH(("Requested add of '%s' multiple times. Is this intentional? - jkmcd", newEvent->m_audioName.str())); *eventInfo = *newEvent; } else @@ -1031,7 +1031,7 @@ Bool AudioManager::shouldPlayLocally(const AudioEventRTS *audioEvent) } if (!BitIsSet(ei->m_type, (ST_PLAYER | ST_ALLIES | ST_ENEMIES | ST_EVERYONE))) { - DEBUG_CRASH(("No player restrictions specified for '%s'. Using Everyone.\n", ei->m_audioName.str())); + DEBUG_CRASH(("No player restrictions specified for '%s'. Using Everyone.", ei->m_audioName.str())); return TRUE; } @@ -1047,7 +1047,7 @@ Bool AudioManager::shouldPlayLocally(const AudioEventRTS *audioEvent) } if (owningPlayer == NULL) { - DEBUG_CRASH(("Sound '%s' expects an owning player, but the audio event that created it didn't specify one.\n", ei->m_audioName.str())); + DEBUG_CRASH(("Sound '%s' expects an owning player, but the audio event that created it didn't specify one.", ei->m_audioName.str())); return FALSE; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp index c9916c0b7d..7bcf356ab5 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp @@ -112,7 +112,7 @@ static void ConvertShortMapPathToLongMapPath(AsciiString &mapName) //============================================================================= Int parseNoLogOrCrash(char *args[], int) { - DEBUG_CRASH(("-NoLogOrCrash not supported in this build\n")); + DEBUG_CRASH(("-NoLogOrCrash not supported in this build")); return 1; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Dict.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Dict.cpp index 65114fdbf1..a83c4aa823 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Dict.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Dict.cpp @@ -350,7 +350,7 @@ Bool Dict::getNthBool(Int n) const if (pair && pair->getType() == DICT_BOOL) return *pair->asBool(); } - DEBUG_CRASH(("dict key missing, or of wrong type\n")); + DEBUG_CRASH(("dict key missing, or of wrong type")); return false; } @@ -365,7 +365,7 @@ Int Dict::getNthInt(Int n) const if (pair && pair->getType() == DICT_INT) return *pair->asInt(); } - DEBUG_CRASH(("dict key missing, or of wrong type\n")); + DEBUG_CRASH(("dict key missing, or of wrong type")); return 0; } @@ -380,7 +380,7 @@ Real Dict::getNthReal(Int n) const if (pair && pair->getType() == DICT_REAL) return *pair->asReal(); } - DEBUG_CRASH(("dict key missing, or of wrong type\n")); + DEBUG_CRASH(("dict key missing, or of wrong type")); return 0.0f; } @@ -395,7 +395,7 @@ AsciiString Dict::getNthAsciiString(Int n) const if (pair && pair->getType() == DICT_ASCIISTRING) return *pair->asAsciiString(); } - DEBUG_CRASH(("dict key missing, or of wrong type\n")); + DEBUG_CRASH(("dict key missing, or of wrong type")); return AsciiString::TheEmptyString; } @@ -410,7 +410,7 @@ UnicodeString Dict::getNthUnicodeString(Int n) const if (pair && pair->getType() == DICT_UNICODESTRING) return *pair->asUnicodeString(); } - DEBUG_CRASH(("dict key missing, or of wrong type\n")); + DEBUG_CRASH(("dict key missing, or of wrong type")); return UnicodeString::TheEmptyString; } @@ -525,7 +525,7 @@ Bool Dict::remove(NameKeyType key) validate(); return true; } - DEBUG_CRASH(("dict key missing in remove\n")); + DEBUG_CRASH(("dict key missing in remove")); return false; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp index 6607d3c673..9627087bf0 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp @@ -244,7 +244,7 @@ BenchProfile *GameLODManager::newBenchProfile(void) return &m_benchProfiles[m_numBenchProfiles-1]; } - DEBUG_CRASH(( "GameLODManager::newBenchProfile - Too many profiles defined\n")); + DEBUG_CRASH(( "GameLODManager::newBenchProfile - Too many profiles defined")); return NULL; } @@ -258,7 +258,7 @@ LODPresetInfo *GameLODManager::newLODPreset(StaticGameLODLevel index) return &m_lodPresets[index][m_numLevelPresets[index]-1]; } - DEBUG_CRASH(( "GameLODManager::newLODPreset - Too many presets defined for '%s'\n", TheGameLODManager->getStaticGameLODLevelName(index))); + DEBUG_CRASH(( "GameLODManager::newLODPreset - Too many presets defined for '%s'", TheGameLODManager->getStaticGameLODLevelName(index))); } return NULL; @@ -393,7 +393,7 @@ Int GameLODManager::getStaticGameLODIndex(AsciiString name) return i; } - DEBUG_CRASH(( "GameLODManager::getGameLODIndex - Invalid LOD name '%s'\n", name.str() )); + DEBUG_CRASH(( "GameLODManager::getGameLODIndex - Invalid LOD name '%s'", name.str() )); return STATIC_GAME_LOD_UNKNOWN; } @@ -430,7 +430,7 @@ void INI::parseStaticGameLODLevel( INI* ini, void * , void *store, const void*) return; } - DEBUG_CRASH(("invalid GameLODLevel token %s -- expected LOW/MEDIUM/HIGH\n",tok)); + DEBUG_CRASH(("invalid GameLODLevel token %s -- expected LOW/MEDIUM/HIGH",tok)); throw INI_INVALID_DATA; } @@ -624,7 +624,7 @@ void INI::parseDynamicGameLODLevel( INI* ini, void * , void *store, const void*) return; } - DEBUG_CRASH(("invalid GameLODLevel token %s -- expected LOW/MEDIUM/HIGH\n",tok)); + DEBUG_CRASH(("invalid GameLODLevel token %s -- expected LOW/MEDIUM/HIGH",tok)); throw INI_INVALID_DATA; } @@ -637,7 +637,7 @@ Int GameLODManager::getDynamicGameLODIndex(AsciiString name) return i; } - DEBUG_CRASH(( "GameLODManager::getGameLODIndex - Invalid LOD name '%s'\n", name.str() )); + DEBUG_CRASH(( "GameLODManager::getGameLODIndex - Invalid LOD name '%s'", name.str() )); return STATIC_GAME_LOD_UNKNOWN; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp index bd21f455a8..786df276db 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp @@ -263,7 +263,7 @@ void INI::prepFile( AsciiString filename, INILoadType loadType ) if( m_file != NULL ) { - DEBUG_CRASH(( "INI::load, cannot open file '%s', file already open\n", filename.str() )); + DEBUG_CRASH(( "INI::load, cannot open file '%s', file already open", filename.str() )); throw INI_FILE_ALREADY_OPEN; } // end if @@ -273,7 +273,7 @@ void INI::prepFile( AsciiString filename, INILoadType loadType ) if( m_file == NULL ) { - DEBUG_CRASH(( "INI::load, cannot open file '%s'\n", filename.str() )); + DEBUG_CRASH(( "INI::load, cannot open file '%s'", filename.str() )); throw INI_CANT_OPEN_FILE; } // end if @@ -377,7 +377,7 @@ void INI::load( AsciiString filename, INILoadType loadType, Xfer *pXfer ) (*parse)( this ); } catch (...) { - DEBUG_CRASH(("Error parsing block '%s' in INI file '%s'\n", token, m_filename.str()) ); + DEBUG_CRASH(("Error parsing block '%s' in INI file '%s'", token, m_filename.str()) ); char buff[1024]; sprintf(buff, "Error parsing INI file '%s' (Line: '%s')\n", m_filename.str(), currentLine.str()); @@ -567,7 +567,7 @@ void INI::parsePositiveNonZeroReal( INI* ini, void * /*instance*/, void *store, *(Real *)store = scanReal(token); if (*(Real *)store <= 0.0f) { - DEBUG_CRASH(("invalid Real value %f -- expected > 0\n",*(Real*)store)); + DEBUG_CRASH(("invalid Real value %f -- expected > 0",*(Real*)store)); throw INI_INVALID_DATA; } @@ -636,7 +636,7 @@ void INI::parseBitInInt32( INI *ini, void *instance, void *store, const void* us return FALSE; else { - DEBUG_CRASH(("invalid boolean token %s -- expected Yes or No\n",token)); + DEBUG_CRASH(("invalid boolean token %s -- expected Yes or No",token)); throw INI_INVALID_DATA; return false; // keep compiler happy } @@ -856,7 +856,7 @@ void INI::parseMappedImage( INI *ini, void * /*instance*/, void *store, const vo else { - DEBUG_CRASH(( "INI::parseAnim2DTemplate - TheAnim2DCollection is NULL\n" )); + DEBUG_CRASH(( "INI::parseAnim2DTemplate - TheAnim2DCollection is NULL" )); throw INI_UNKNOWN_ERROR; } // end else @@ -1361,7 +1361,7 @@ void INI::parseSpecialPowerTemplate( INI* ini, void * /*instance*/, void *store, const SpecialPowerTemplate *sPowerT = TheSpecialPowerStore->findSpecialPowerTemplate( AsciiString( token ) ); if( !sPowerT && stricmp( token, "None" ) != 0 ) { - DEBUG_CRASH( ("[LINE: %d in '%s'] Specialpower %s not found!\n", ini->getLineNum(), ini->getFilename().str(), token) ); + DEBUG_CRASH( ("[LINE: %d in '%s'] Specialpower %s not found!", ini->getLineNum(), ini->getFilename().str(), token) ); } typedef const SpecialPowerTemplate* ConstSpecialPowerTemplatePtr; @@ -1511,7 +1511,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList (*parse)( this, what, (char *)what + offset + parseTableList.getNthExtraOffset(ptIdx), userData ); } catch (...) { - DEBUG_CRASH( ("[LINE: %d - FILE: '%s'] Error reading field '%s' of block '%s'\n", + DEBUG_CRASH( ("[LINE: %d - FILE: '%s'] Error reading field '%s' of block '%s'", INI::getLineNum(), INI::getFilename().str(), field, m_curBlockStart) ); @@ -1633,7 +1633,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList } } - DEBUG_CRASH(("token %s is not a valid member of the index list\n",token)); + DEBUG_CRASH(("token %s is not a valid member of the index list",token)); throw INI_INVALID_DATA; return 0; // never executed, but keeps compiler happy @@ -1659,7 +1659,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList } } - DEBUG_CRASH(("token %s is not a valid member of the lookup list\n",token)); + DEBUG_CRASH(("token %s is not a valid member of the lookup list",token)); throw INI_INVALID_DATA; return 0; // never executed, but keeps compiler happy diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAnimation.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAnimation.cpp index 45ee3d6cff..b9e04b7c7d 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAnimation.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAnimation.cpp @@ -73,7 +73,7 @@ void INI::parseAnim2DDefinition( INI* ini ) { // we're loading over an existing animation template ... something is probably wrong - DEBUG_CRASH(( "INI::parseAnim2DDefinition - Animation template '%s' already exists\n", + DEBUG_CRASH(( "INI::parseAnim2DDefinition - Animation template '%s' already exists", animTemplate->getName().str() )); return; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/NameKeyGenerator.cpp b/GeneralsMD/Code/GameEngine/Source/Common/NameKeyGenerator.cpp index 71eb01b149..d1054f50e9 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/NameKeyGenerator.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/NameKeyGenerator.cpp @@ -162,7 +162,7 @@ NameKeyType NameKeyGenerator::nameToKey(const char* nameString) // if more than a small percent of the sockets are getting deep, probably want to increase the socket count. if (numOverThresh > SOCKET_COUNT/20) { - DEBUG_CRASH(("hmm, might need to increase the number of bucket-sockets for NameKeyGenerator (numOverThresh %d = %f%%)\n",numOverThresh,(Real)numOverThresh/(Real)(SOCKET_COUNT/20))); + DEBUG_CRASH(("hmm, might need to increase the number of bucket-sockets for NameKeyGenerator (numOverThresh %d = %f%%)",numOverThresh,(Real)numOverThresh/(Real)(SOCKET_COUNT/20))); } #endif @@ -210,7 +210,7 @@ NameKeyType NameKeyGenerator::nameToLowercaseKey(const char* nameString) // if more than a small percent of the sockets are getting deep, probably want to increase the socket count. if (numOverThresh > SOCKET_COUNT/20) { - DEBUG_CRASH(("hmm, might need to increase the number of bucket-sockets for NameKeyGenerator (numOverThresh %d = %f%%)\n",numOverThresh,(Real)numOverThresh/(Real)(SOCKET_COUNT/20))); + DEBUG_CRASH(("hmm, might need to increase the number of bucket-sockets for NameKeyGenerator (numOverThresh %d = %f%%)",numOverThresh,(Real)numOverThresh/(Real)(SOCKET_COUNT/20))); } #endif diff --git a/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp b/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp index 474ae8d21c..c2fe0ea8df 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp @@ -599,7 +599,7 @@ void PerfTimer::outputInfo( void ) #endif if (m_crashWithInfo) { - DEBUG_CRASH(("%s\n" + DEBUG_CRASH(("%s" "Average Time (per call): %.4f ms\n" "Average Time (per frame): %.4f ms\n" "Average calls per frame: %.2f\n" diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp index 6ebca097ad..6890969ed6 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -2602,7 +2602,7 @@ Bool Player::attemptToPurchaseScience(ScienceType science) { if (!isCapableOfPurchasingScience(science)) { - DEBUG_CRASH(("isCapableOfPurchasingScience: need other prereqs/points to purchase, request is ignored!\n")); + DEBUG_CRASH(("isCapableOfPurchasingScience: need other prereqs/points to purchase, request is ignored!")); return false; } @@ -2625,7 +2625,7 @@ Bool Player::grantScience(ScienceType science) { if (!TheScienceStore->isScienceGrantable(science)) { - DEBUG_CRASH(("Cannot grant science %s, since it is marked as nonGrantable.\n",TheScienceStore->getInternalNameForScience(science).str())); + DEBUG_CRASH(("Cannot grant science %s, since it is marked as nonGrantable.",TheScienceStore->getInternalNameForScience(science).str())); return false; // it's not grantable, so tough, can't have it, even via this method. } @@ -4069,7 +4069,7 @@ void Player::xfer( Xfer *xfer ) if( upgradeTemplate == NULL ) { - DEBUG_CRASH(( "Player::xfer - Unable to find upgrade '%s'\n", upgradeName.str() )); + DEBUG_CRASH(( "Player::xfer - Unable to find upgrade '%s'", upgradeName.str() )); throw SC_INVALID_DATA; } // end if @@ -4141,7 +4141,7 @@ void Player::xfer( Xfer *xfer ) if( prototype == NULL ) { - DEBUG_CRASH(( "Player::xfer - Unable to find team prototype by id\n" )); + DEBUG_CRASH(( "Player::xfer - Unable to find team prototype by id" )); throw SC_INVALID_DATA; } // end if @@ -4213,7 +4213,7 @@ void Player::xfer( Xfer *xfer ) if( (aiPlayerPresent == TRUE && m_ai == NULL) || (aiPlayerPresent == FALSE && m_ai != NULL) ) { - DEBUG_CRASH(( "Player::xfer - m_ai present/missing mismatch\n" )); + DEBUG_CRASH(( "Player::xfer - m_ai present/missing mismatch" )); throw SC_INVALID_DATA;; } // end if @@ -4227,7 +4227,7 @@ void Player::xfer( Xfer *xfer ) (resourceGatheringManagerPresent == FALSE && m_resourceGatheringManager != NULL ) ) { - DEBUG_CRASH(( "Player::xfer - m_resourceGatheringManager present/missing mismatch\n" )); + DEBUG_CRASH(( "Player::xfer - m_resourceGatheringManager present/missing mismatch" )); throw SC_INVALID_DATA; } // end if @@ -4241,7 +4241,7 @@ void Player::xfer( Xfer *xfer ) (tunnelTrackerPresent == FALSE && m_tunnelSystem != NULL) ) { - DEBUG_CRASH(( "Player::xfer - m_tunnelSystem present/missing mismatch\n" )); + DEBUG_CRASH(( "Player::xfer - m_tunnelSystem present/missing mismatch" )); throw SC_INVALID_DATA; } // end if @@ -4393,7 +4393,7 @@ void Player::xfer( Xfer *xfer ) if( m_kindOfPercentProductionChangeList.size() != 0 ) { - DEBUG_CRASH(( "Player::xfer - m_kindOfPercentProductionChangeList should be empty but is not\n" )); + DEBUG_CRASH(( "Player::xfer - m_kindOfPercentProductionChangeList should be empty but is not" )); throw SC_INVALID_DATA; } // end if @@ -4445,7 +4445,7 @@ void Player::xfer( Xfer *xfer ) { if( m_specialPowerReadyTimerList.size() != 0 ) // sanity, list must be empty right now { - DEBUG_CRASH(( "Player::xfer - m_specialPowerReadyTimerList should be empty but is not\n" )); + DEBUG_CRASH(( "Player::xfer - m_specialPowerReadyTimerList should be empty but is not" )); throw SC_INVALID_DATA; } // end if @@ -4475,7 +4475,7 @@ void Player::xfer( Xfer *xfer ) if( squadCount != NUM_HOTKEY_SQUADS ) { - DEBUG_CRASH(( "Player::xfer - size of m_squadCount array has changed\n" )); + DEBUG_CRASH(( "Player::xfer - size of m_squadCount array has changed" )); throw SC_INVALID_DATA; } // end if @@ -4485,7 +4485,7 @@ void Player::xfer( Xfer *xfer ) if( m_squads[ i ] == NULL ) { - DEBUG_CRASH(( "Player::xfer - NULL squad at index '%d'\n", i )); + DEBUG_CRASH(( "Player::xfer - NULL squad at index '%d'", i )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp index c24ef8dc78..b44ab5e4f2 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp @@ -91,7 +91,7 @@ Player *PlayerList::getNthPlayer(Int i) { if( i < 0 || i >= MAX_PLAYER_COUNT ) { -// DEBUG_CRASH( ("Illegal player index\n") ); +// DEBUG_CRASH( ("Illegal player index") ); return NULL; } return m_players[i]; @@ -294,7 +294,7 @@ Team *PlayerList::validateTeam( AsciiString owner ) } else { - DEBUG_CRASH(("no team or player named %s could be found!\n", owner.str())); + DEBUG_CRASH(("no team or player named %s could be found!", owner.str())); t = getNeutralPlayer()->getDefaultTeam(); } return t; @@ -358,7 +358,7 @@ Player *PlayerList::getPlayerFromMask( PlayerMaskType mask ) } // end for i - DEBUG_CRASH( ("Player does not exist for mask\n") ); + DEBUG_CRASH( ("Player does not exist for mask") ); return NULL; // mask not found } // end getPlayerFromMask @@ -380,7 +380,7 @@ Player *PlayerList::getEachPlayerFromMask( PlayerMaskType& maskToAdjust ) } } // end for i - DEBUG_CRASH( ("No players found that contain any matching masks.\n") ); + DEBUG_CRASH( ("No players found that contain any matching masks.") ); maskToAdjust = 0; return NULL; // mask not found } @@ -465,7 +465,7 @@ void PlayerList::xfer( Xfer *xfer ) if( playerCount != m_playerCount ) { - DEBUG_CRASH(( "Invalid player count '%d', should be '%d'\n", playerCount, m_playerCount )); + DEBUG_CRASH(( "Invalid player count '%d', should be '%d'", playerCount, m_playerCount )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Science.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Science.cpp index 4bb6f1979e..4cc4e26e2d 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Science.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Science.cpp @@ -215,7 +215,7 @@ const ScienceInfo* ScienceStore::findScienceInfo(ScienceType st) const { if (info != NULL) { - DEBUG_CRASH(("duplicate science %s!\n",c)); + DEBUG_CRASH(("duplicate science %s!",c)); throw INI_INVALID_DATA; } info = newInstance(ScienceInfo); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp index 7fcb1079f8..1abd8952e3 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/ScoreKeeper.cpp @@ -413,7 +413,7 @@ void ScoreKeeper::xferObjectCountMap( Xfer *xfer, ObjectCountMap *map ) if( map == NULL ) { - DEBUG_CRASH(( "xferObjectCountMap - Invalid map parameter\n" )); + DEBUG_CRASH(( "xferObjectCountMap - Invalid map parameter" )); throw SC_INVALID_DATA; } // end if @@ -464,7 +464,7 @@ void ScoreKeeper::xferObjectCountMap( Xfer *xfer, ObjectCountMap *map ) if( thingTemplate == NULL ) { - DEBUG_CRASH(( "xferObjectCountMap - Unknown thing template '%s'\n", thingTemplateName.str() )); + DEBUG_CRASH(( "xferObjectCountMap - Unknown thing template '%s'", thingTemplateName.str() )); throw SC_INVALID_DATA; } // end if @@ -539,7 +539,7 @@ void ScoreKeeper::xfer( Xfer *xfer ) if( destroyedArraySize != MAX_PLAYER_COUNT ) { - DEBUG_CRASH(( "ScoreKeeper::xfer - size of objects destroyed array has changed\n" )); + DEBUG_CRASH(( "ScoreKeeper::xfer - size of objects destroyed array has changed" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp index 5565fd127e..ec5eab0182 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp @@ -447,7 +447,7 @@ void TeamFactory::xfer( Xfer *xfer ) if( prototypeCount != m_prototypes.size() ) { - DEBUG_CRASH(( "TeamFactory::xfer - Prototype count mismatch '%d should be '%d'\n", + DEBUG_CRASH(( "TeamFactory::xfer - Prototype count mismatch '%d should be '%d'", prototypeCount, m_prototypes.size() )); throw SC_INVALID_DATA; @@ -495,7 +495,7 @@ void TeamFactory::xfer( Xfer *xfer ) if( teamPrototype == NULL ) { - DEBUG_CRASH(( "TeamFactory::xfer - Unable to find team prototype by id\n" )); + DEBUG_CRASH(( "TeamFactory::xfer - Unable to find team prototype by id" )); throw SC_INVALID_DATA; } // end if @@ -2577,7 +2577,7 @@ void Team::xfer( Xfer *xfer ) if( teamID != m_id ) { - DEBUG_CRASH(( "Team::xfer - TeamID mismatch. Xfered '%d' but should be '%d'\n", + DEBUG_CRASH(( "Team::xfer - TeamID mismatch. Xfered '%d' but should be '%d'", teamID, m_id )); throw SC_INVALID_DATA; @@ -2712,7 +2712,7 @@ void Team::loadPostProcess( void ) if( obj == NULL ) { - DEBUG_CRASH(( "Team::loadPostProcess - Unable to post process object to member list, object ID = '%d'\n", *it )); + DEBUG_CRASH(( "Team::loadPostProcess - Unable to post process object to member list, object ID = '%d'", *it )); throw SC_INVALID_DATA; } // end if @@ -2726,7 +2726,7 @@ void Team::loadPostProcess( void ) if( isInList_TeamMemberList( obj ) == FALSE ) { - DEBUG_CRASH(( "Team::loadPostProcess - Object '%s'(%d) should be in team list but is not\n", + DEBUG_CRASH(( "Team::loadPostProcess - Object '%s'(%d) should be in team list but is not", obj->getTemplate()->getName().str(), obj->getID() )); throw SC_INVALID_DATA; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp index 748e9aa003..0b430f3d68 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/TunnelTracker.cpp @@ -371,7 +371,7 @@ void TunnelTracker::loadPostProcess( void ) if( m_containList.size() != 0 ) { - DEBUG_CRASH(( "TunnelTracker::loadPostProcess - m_containList should be empty but is not\n" )); + DEBUG_CRASH(( "TunnelTracker::loadPostProcess - m_containList should be empty but is not" )); throw SC_INVALID_DATA; } // end if @@ -386,7 +386,7 @@ void TunnelTracker::loadPostProcess( void ) if( obj == NULL ) { - DEBUG_CRASH(( "TunnelTracker::loadPostProcess - Unable to find object ID '%d'\n", *it )); + DEBUG_CRASH(( "TunnelTracker::loadPostProcess - Unable to find object ID '%d'", *it )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp index 2dd6866ccf..7ac92f098c 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp @@ -385,7 +385,7 @@ Real GameClientRandomVariable::getValue( void ) const default: /// @todo fill in support for nonuniform GameClientRandomVariables. - DEBUG_CRASH(("unsupported DistributionType in GameClientRandomVariable::getValue\n")); + DEBUG_CRASH(("unsupported DistributionType in GameClientRandomVariable::getValue")); return 0.0f; } } @@ -430,7 +430,7 @@ Real GameLogicRandomVariable::getValue( void ) const default: /// @todo fill in support for nonuniform GameLogicRandomVariables. - DEBUG_CRASH(("unsupported DistributionType in GameLogicRandomVariable::getValue\n")); + DEBUG_CRASH(("unsupported DistributionType in GameLogicRandomVariable::getValue")); return 0.0f; } } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp index 3544526a24..66c7f05dfc 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/DataChunk.cpp @@ -461,7 +461,7 @@ UnsignedInt DataChunkTableOfContents::getID( const AsciiString& name ) if (m) return m->id; - DEBUG_CRASH(("name not found in DataChunkTableOfContents::getName for name %s\n",name.str())); + DEBUG_CRASH(("name not found in DataChunkTableOfContents::getName for name %s",name.str())); return 0; } @@ -474,7 +474,7 @@ AsciiString DataChunkTableOfContents::getName( UnsignedInt id ) if (m->id == id) return m->name; - DEBUG_CRASH(("name not found in DataChunkTableOfContents::getName for id %d\n",id)); + DEBUG_CRASH(("name not found in DataChunkTableOfContents::getName for id %d",id)); return AsciiString::TheEmptyString; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/FileSystem.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/FileSystem.cpp index ce6da86cb2..14ff99f176 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/FileSystem.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/FileSystem.cpp @@ -358,12 +358,12 @@ Bool FileSystem::isPathInDirectory(const AsciiString& testPath, const AsciiStrin if (basePathNormalized.isEmpty()) { - DEBUG_CRASH(("Unable to normalize base directory path '%s'.\n", basePath.str())); + DEBUG_CRASH(("Unable to normalize base directory path '%s'.", basePath.str())); return false; } else if (testPathNormalized.isEmpty()) { - DEBUG_CRASH(("Unable to normalize file path '%s'.\n", testPath.str())); + DEBUG_CRASH(("Unable to normalize file path '%s'.", testPath.str())); return false; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp index c9451cffec..7c15b28085 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp @@ -1081,7 +1081,7 @@ Bool MemoryPoolSingleBlock::debugCheckUnderrun() { if (*p != m_wallPattern+i) { - DEBUG_CRASH(("memory underrun for block \"%s\" (expected %08x, got %08x)\n",m_debugLiteralTagString,m_wallPattern+i,*p)); + DEBUG_CRASH(("memory underrun for block \"%s\" (expected %08x, got %08x)",m_debugLiteralTagString,m_wallPattern+i,*p)); return true; } } @@ -1106,7 +1106,7 @@ Bool MemoryPoolSingleBlock::debugCheckOverrun() { if (*p != m_wallPattern-i) { - DEBUG_CRASH(("memory overrun for block \"%s\" (expected %08x, got %08x)\n",m_debugLiteralTagString,m_wallPattern+i,*p)); + DEBUG_CRASH(("memory overrun for block \"%s\" (expected %08x, got %08x)",m_debugLiteralTagString,m_wallPattern+i,*p)); return true; } } @@ -2143,7 +2143,7 @@ void DynamicMemoryAllocator::debugIgnoreLeaksForThisBlock(void* pBlockPtr) } else { - DEBUG_CRASH(("cannot currently ignore leaks for raw blocks (allocation too large)\n")); + DEBUG_CRASH(("cannot currently ignore leaks for raw blocks (allocation too large)")); } } #endif @@ -2656,7 +2656,7 @@ MemoryPool *MemoryPoolFactory::createMemoryPool(const char *poolName, Int alloca if (initialAllocationCount <= 0 || overflowAllocationCount < 0) { - DEBUG_CRASH(("illegal pool size: %d %d\n",initialAllocationCount,overflowAllocationCount)); + DEBUG_CRASH(("illegal pool size: %d %d",initialAllocationCount,overflowAllocationCount)); throw ERROR_OUT_OF_MEMORY; } @@ -3455,7 +3455,7 @@ void initMemoryManager() if (theLinkTester != 6) #endif { - DEBUG_CRASH(("Wrong operator new/delete linked in! Fix this...\n")); + DEBUG_CRASH(("Wrong operator new/delete linked in! Fix this...")); } theMainInitFlag = true; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/MemoryInit.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/MemoryInit.cpp index 7c5d74d5c1..992af9ea1f 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/MemoryInit.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/MemoryInit.cpp @@ -733,7 +733,7 @@ void userMemoryAdjustPoolSize(const char *poolName, Int& initialAllocationCount, } } - DEBUG_CRASH(("Initial size for pool %s not found -- you should add it to MemoryInit.cpp\n",poolName)); + DEBUG_CRASH(("Initial size for pool %s not found -- you should add it to MemoryInit.cpp",poolName)); } //----------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/RAMFile.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/RAMFile.cpp index 0c44ce50c5..8962e03578 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/RAMFile.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/RAMFile.cpp @@ -495,7 +495,7 @@ char* RAMFile::readEntireAndClose() if (m_data == NULL) { - DEBUG_CRASH(("m_data is NULL in RAMFile::readEntireAndClose -- should not happen!\n")); + DEBUG_CRASH(("m_data is NULL in RAMFile::readEntireAndClose -- should not happen!")); return NEW char[1]; // just to avoid crashing... } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp index 025362552f..baf7c548a6 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp @@ -175,7 +175,7 @@ void RadarObject::xfer( Xfer *xfer ) if( m_object == NULL ) { - DEBUG_CRASH(( "RadarObject::xfer - Unable to find object for radar data\n" )); + DEBUG_CRASH(( "RadarObject::xfer - Unable to find object for radar data" )); throw SC_INVALID_DATA; } // end if @@ -866,7 +866,7 @@ Object *Radar::searchListForRadarLocationMatch( RadarObject *listHead, ICoord2D if( obj == NULL ) { - DEBUG_CRASH(( "Radar::searchListForRadarLocationMatch - NULL object encountered in list\n" )); + DEBUG_CRASH(( "Radar::searchListForRadarLocationMatch - NULL object encountered in list" )); continue; } // end if @@ -1042,7 +1042,7 @@ void Radar::createEvent( const Coord3D *world, RadarEventType type, Real seconds static RGBAColorInt color1 = { 255, 255, 255, 255 }; static RGBAColorInt color2 = { 255, 255, 255, 255 }; - DEBUG_CRASH(( "Radar::createEvent - Event not found in color table, using default colors\n" )); + DEBUG_CRASH(( "Radar::createEvent - Event not found in color table, using default colors" )); color[ 0 ] = color1; color[ 1 ] = color2; @@ -1426,12 +1426,12 @@ static void xferRadarObjectList( Xfer *xfer, RadarObject **head ) { if (!radarObject->friend_getObject()->isDestroyed()) { - DEBUG_CRASH(( "xferRadarObjectList - List head should be NULL, or contain only destroyed objects\n" )); + DEBUG_CRASH(( "xferRadarObjectList - List head should be NULL, or contain only destroyed objects" )); throw SC_INVALID_DATA; } } #else - DEBUG_CRASH(( "xferRadarObjectList - List head should be NULL, but isn't\n" )); + DEBUG_CRASH(( "xferRadarObjectList - List head should be NULL, but isn't" )); throw SC_INVALID_DATA; #endif } // end if @@ -1500,7 +1500,7 @@ void Radar::xfer( Xfer *xfer ) if( eventCount != eventCountVerify ) { - DEBUG_CRASH(( "Radar::xfer - size of MAX_RADAR_EVENTS has changed, you must version this xfer method to accomodate the new array size. Was '%d' and is now '%d'\n", + DEBUG_CRASH(( "Radar::xfer - size of MAX_RADAR_EVENTS has changed, you must version this xfer method to accomodate the new array size. Was '%d' and is now '%d'", eventCount, eventCountVerify )); throw SC_INVALID_DATA; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp index 739cdd245e..ca80cc77a8 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp @@ -379,7 +379,7 @@ void GameState::addSnapshotBlock( AsciiString blockName, Snapshot *snapshot, Sna if( blockName.isEmpty() || snapshot == NULL ) { - DEBUG_CRASH(( "addSnapshotBlock: Invalid parameters\n" )); + DEBUG_CRASH(( "addSnapshotBlock: Invalid parameters" )); return; } // end if @@ -519,7 +519,7 @@ AsciiString GameState::findNextSaveFilename( UnicodeString desc ) else { - DEBUG_CRASH(( "GameState::findNextSaveFilename - Unknown file search type '%d'\n", searchType )); + DEBUG_CRASH(( "GameState::findNextSaveFilename - Unknown file search type '%d'", searchType )); return AsciiString::TheEmptyString; } // end else @@ -544,7 +544,7 @@ SaveCode GameState::saveGame( AsciiString filename, UnicodeString desc, if( filename.isEmpty() ) { - DEBUG_CRASH(( "GameState::saveGame - Unable to find valid filename for save game\n" )); + DEBUG_CRASH(( "GameState::saveGame - Unable to find valid filename for save game" )); return SC_NO_FILE_AVAILABLE; } // end if @@ -986,7 +986,7 @@ void GameState::getSaveGameInfoFromFile( AsciiString filename, SaveGameInfo *sav if( filename.isEmpty() == TRUE || saveGameInfo == NULL ) { - DEBUG_CRASH(( "GameState::getSaveGameInfoFromFile - Illegal parameters\n" )); + DEBUG_CRASH(( "GameState::getSaveGameInfoFromFile - Illegal parameters" )); return; } // end if @@ -1013,7 +1013,7 @@ void GameState::getSaveGameInfoFromFile( AsciiString filename, SaveGameInfo *sav { // we should never get here, if we did, we didn't find block of data we needed - DEBUG_CRASH(( "GameState::getSaveGameInfoFromFile - Game info not found in file '%s'\n", filename.str() )); + DEBUG_CRASH(( "GameState::getSaveGameInfoFromFile - Game info not found in file '%s'", filename.str() )); done = TRUE; } // end if @@ -1044,7 +1044,7 @@ void GameState::getSaveGameInfoFromFile( AsciiString filename, SaveGameInfo *sav catch( ... ) { - DEBUG_CRASH(( "GameState::getSaveGameInfoFromFile - Error loading block '%s' in file '%s'\n", + DEBUG_CRASH(( "GameState::getSaveGameInfoFromFile - Error loading block '%s' in file '%s'", blockInfo->blockName.str(), filename.str() )); throw; @@ -1396,7 +1396,7 @@ void GameState::xferSaveData( Xfer *xfer, SnapshotType which ) catch( ... ) { - DEBUG_CRASH(( "Error saving block '%s' in file '%s'\n", + DEBUG_CRASH(( "Error saving block '%s' in file '%s'", blockName.str(), xfer->getIdentifier().str() )); throw; @@ -1473,7 +1473,7 @@ void GameState::xferSaveData( Xfer *xfer, SnapshotType which ) catch( ... ) { - DEBUG_CRASH(( "Error loading block '%s' in file '%s'\n", + DEBUG_CRASH(( "Error loading block '%s' in file '%s'", blockInfo->blockName.str(), xfer->getIdentifier().str() )); throw; @@ -1497,7 +1497,7 @@ void GameState::addPostProcessSnapshot( Snapshot *snapshot ) if( snapshot == NULL ) { - DEBUG_CRASH(( "GameState::addPostProcessSnapshot - invalid parameters\n" )); + DEBUG_CRASH(( "GameState::addPostProcessSnapshot - invalid parameters" )); return; } // end if @@ -1516,7 +1516,7 @@ void GameState::addPostProcessSnapshot( Snapshot *snapshot ) if( (*it) == snapshot ) { - DEBUG_CRASH(( "GameState::addPostProcessSnapshot - snapshot is already in list!\n" )); + DEBUG_CRASH(( "GameState::addPostProcessSnapshot - snapshot is already in list!" )); return; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp index 7d94e462f7..fc3f18c0dd 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp @@ -79,7 +79,7 @@ static void embedPristineMap( AsciiString map, Xfer *xfer ) if( file == NULL ) { - DEBUG_CRASH(( "embedPristineMap - Error opening source file '%s'\n", map.str() )); + DEBUG_CRASH(( "embedPristineMap - Error opening source file '%s'", map.str() )); throw SC_INVALID_DATA; } // end if @@ -95,7 +95,7 @@ static void embedPristineMap( AsciiString map, Xfer *xfer ) if( buffer == NULL ) { - DEBUG_CRASH(( "embedPristineMap - Unable to allocate buffer for file '%s'\n", map.str() )); + DEBUG_CRASH(( "embedPristineMap - Unable to allocate buffer for file '%s'", map.str() )); throw SC_INVALID_DATA; } // end if @@ -104,7 +104,7 @@ static void embedPristineMap( AsciiString map, Xfer *xfer ) if( file->read( buffer, fileSize ) != fileSize ) { - DEBUG_CRASH(( "embeddPristineMap - Error reading from file '%s'\n", map.str() )); + DEBUG_CRASH(( "embeddPristineMap - Error reading from file '%s'", map.str() )); throw SC_INVALID_DATA; } // end if @@ -135,7 +135,7 @@ static void embedInUseMap( AsciiString map, Xfer *xfer ) if( fp == NULL ) { - DEBUG_CRASH(( "embedInUseMap - Unable to open file '%s'\n", map.str() )); + DEBUG_CRASH(( "embedInUseMap - Unable to open file '%s'", map.str() )); throw SC_INVALID_DATA; } // end if @@ -152,7 +152,7 @@ static void embedInUseMap( AsciiString map, Xfer *xfer ) if( buffer == NULL ) { - DEBUG_CRASH(( "embedInUseMap - Unable to allocate buffer for file '%s'\n", map.str() )); + DEBUG_CRASH(( "embedInUseMap - Unable to allocate buffer for file '%s'", map.str() )); throw SC_INVALID_DATA; } // end if @@ -161,7 +161,7 @@ static void embedInUseMap( AsciiString map, Xfer *xfer ) if( fread( buffer, 1, fileSize, fp ) != fileSize ) { - DEBUG_CRASH(( "embedInUseMap - Error reading from file '%s'\n", map.str() )); + DEBUG_CRASH(( "embedInUseMap - Error reading from file '%s'", map.str() )); throw SC_INVALID_DATA; } // end if @@ -191,7 +191,7 @@ static void extractAndSaveMap( AsciiString mapToSave, Xfer *xfer ) if( fp == NULL ) { - DEBUG_CRASH(( "extractAndSaveMap - Unable to open file '%s'\n", mapToSave.str() )); + DEBUG_CRASH(( "extractAndSaveMap - Unable to open file '%s'", mapToSave.str() )); throw SC_INVALID_DATA; } // en @@ -204,7 +204,7 @@ static void extractAndSaveMap( AsciiString mapToSave, Xfer *xfer ) if( buffer == NULL ) { - DEBUG_CRASH(( "extractAndSaveMap - Unable to allocate buffer for file '%s'\n", mapToSave.str() )); + DEBUG_CRASH(( "extractAndSaveMap - Unable to allocate buffer for file '%s'", mapToSave.str() )); throw SC_INVALID_DATA; } // end if @@ -216,7 +216,7 @@ static void extractAndSaveMap( AsciiString mapToSave, Xfer *xfer ) if( fwrite( buffer, 1, dataSize, fp ) != dataSize ) { - DEBUG_CRASH(( "extractAndSaveMap - Error writing to file '%s'\n", mapToSave.str() )); + DEBUG_CRASH(( "extractAndSaveMap - Error writing to file '%s'", mapToSave.str() )); throw SC_INVALID_DATA; } // end if @@ -328,7 +328,7 @@ void GameStateMap::xfer( Xfer *xfer ) if (!TheGameState->isInSaveDirectory(saveGameInfo->saveGameMapName)) { - DEBUG_CRASH(("GameState::xfer - The map filename read from the file '%s' is not in the SAVE directory, but should be\n", + DEBUG_CRASH(("GameState::xfer - The map filename read from the file '%s' is not in the SAVE directory, but should be", saveGameInfo->saveGameMapName.str()) ); throw SC_INVALID_DATA; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/StreamingArchiveFile.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/StreamingArchiveFile.cpp index 4a5c08e16c..6150910f61 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/StreamingArchiveFile.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/StreamingArchiveFile.cpp @@ -239,7 +239,7 @@ Int StreamingArchiveFile::read( void *buffer, Int bytes ) Int StreamingArchiveFile::write( const void *buffer, Int bytes ) { - DEBUG_CRASH(("Cannot write to streaming files.\n")); + DEBUG_CRASH(("Cannot write to streaming files.")); return -1; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/Module.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/Module.cpp index 9b9c776cc9..11255952ad 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/Module.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/Module.cpp @@ -108,7 +108,7 @@ ObjectModule::ObjectModule( Thing *thing, const ModuleData* moduleData ) : Modul { if (!moduleData) { - DEBUG_CRASH(("module data may not be null\n")); + DEBUG_CRASH(("module data may not be null")); throw INI_INVALID_DATA; } @@ -171,7 +171,7 @@ DrawableModule::DrawableModule( Thing *thing, const ModuleData* moduleData ) : M { if (!moduleData) { - DEBUG_CRASH(("module data may not be null\n")); + DEBUG_CRASH(("module data may not be null")); throw INI_INVALID_DATA; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp index 9c03ddbc38..f69b8a08f0 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp @@ -614,7 +614,7 @@ const ModuleFactory::ModuleTemplate* ModuleFactory::findModuleTemplate(const Asc ModuleTemplateMap::const_iterator it = m_moduleTemplateMap.find(namekey); if (it == m_moduleTemplateMap.end()) { - DEBUG_CRASH(( "Module name '%s' not found\n", name.str() )); + DEBUG_CRASH(( "Module name '%s' not found", name.str() )); return NULL; } else @@ -631,7 +631,7 @@ Module *ModuleFactory::newModule( Thing *thing, const AsciiString& name, const M // sanity if( name.isEmpty() ) { - DEBUG_CRASH(("attempting to create module with empty name\n")); + DEBUG_CRASH(("attempting to create module with empty name")); return NULL; } const ModuleTemplate* mt = findModuleTemplate(name, type); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp index 0f856581b6..033a366469 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp @@ -84,7 +84,7 @@ void ThingFactory::addTemplate( ThingTemplate *tmplate ) ThingTemplateHashMapIt tIt = m_templateHashMap.find(tmplate->getName()); if (tIt != m_templateHashMap.end()) { - DEBUG_CRASH(("Duplicate Thing Template name found: %s\n", tmplate->getName().str())); + DEBUG_CRASH(("Duplicate Thing Template name found: %s", tmplate->getName().str())); } // Link it to the list @@ -258,7 +258,7 @@ const ThingTemplate *ThingFactory::findByTemplateID( UnsignedShort id ) if (tmpl->getTemplateID() == id) return tmpl; } - DEBUG_CRASH(("template %d not found\n",(Int)id)); + DEBUG_CRASH(("template %d not found",(Int)id)); return NULL; } @@ -413,7 +413,7 @@ AsciiString TheThingTemplateBeingParsedName; } else { - DEBUG_CRASH(("ObjectReskin must come after the original Object (%s, %s).\n",reskinFrom.str(),name.str())); + DEBUG_CRASH(("ObjectReskin must come after the original Object (%s, %s).",reskinFrom.str(),name.str())); throw INI_INVALID_DATA; } } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp index 1e69e945f3..7582434492 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -519,7 +519,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const catch( ... ) { - DEBUG_CRASH(( "[LINE: %d - FILE: '%s'] Module tag not found for module '%s' on thing template '%s'. Module tags are required and must be unique for all modules within an object definition\n", + DEBUG_CRASH(( "[LINE: %d - FILE: '%s'] Module tag not found for module '%s' on thing template '%s'. Module tags are required and must be unique for all modules within an object definition", ini->getLineNum(), ini->getFilename().str(), tokenStr.str(), self->getName().str() )); throw; @@ -559,7 +559,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const } else { - DEBUG_CRASH(("[LINE: %d - FILE: '%s'] You must use AddModule to add modules in override INI files.\n", + DEBUG_CRASH(("[LINE: %d - FILE: '%s'] You must use AddModule to add modules in override INI files.", ini->getLineNum(), ini->getFilename().str(), self->getName().str())); throw INI_INVALID_DATA; } @@ -579,7 +579,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const && self->m_moduleBeingReplacedName.isNotEmpty() && self->m_moduleBeingReplacedName != tokenStr) { - DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule must replace modules with another module of the same type, but you are attempting to replace a %s with a %s for Object %s.\n", + DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule must replace modules with another module of the same type, but you are attempting to replace a %s with a %s for Object %s.", ini->getLineNum(), ini->getFilename().str(), self->m_moduleBeingReplacedName.str(), tokenStr.str(), self->getName().str())); throw INI_INVALID_DATA; } @@ -588,7 +588,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const && self->m_moduleBeingReplacedTag.isNotEmpty() && self->m_moduleBeingReplacedTag == moduleTagStr) { - DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule must specify a new, unique tag for the replaced module, but you are not doing so for %s (%s) for Object %s.\n", + DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule must specify a new, unique tag for the replaced module, but you are not doing so for %s (%s) for Object %s.", ini->getLineNum(), ini->getFilename().str(), moduleTagStr.str(), self->m_moduleBeingReplacedName.str(), self->getName().str())); throw INI_INVALID_DATA; } @@ -790,7 +790,7 @@ void ThingTemplate::parseReplaceModule(INI *ini, void *instance, void *store, co Bool removed = self->removeModuleInfo(modToRemove, removedModuleName); if (!removed) { - DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule %s was not found for %s; cannot continue.\n", + DEBUG_CRASH(("[LINE: %d - FILE: '%s'] ReplaceModule %s was not found for %s; cannot continue.", ini->getLineNum(), ini->getFilename().str(), modToRemove, self->getName().str())); throw INI_INVALID_DATA; } @@ -910,7 +910,7 @@ void ThingTemplate::parseArmorTemplateSet( INI* ini, void *instance, void * /*st { if (it->getNthConditionsYes(0) == ws.getNthConditionsYes(0)) { - DEBUG_CRASH(("dup armorset condition in %s\n",self->getName().str())); + DEBUG_CRASH(("dup armorset condition in %s",self->getName().str())); } } } @@ -938,7 +938,7 @@ void ThingTemplate::parseWeaponTemplateSet( INI* ini, void *instance, void * /*s { if (it->getNthConditionsYes(0) == ws.getNthConditionsYes(0)) { - DEBUG_CRASH(("dup weaponset condition in %s\n",self->getName().str())); + DEBUG_CRASH(("dup weaponset condition in %s",self->getName().str())); } } } @@ -1183,25 +1183,25 @@ void ThingTemplate::validate() if (isKindOf(KINDOF_STRUCTURE) && !isImmobile) { - DEBUG_CRASH(("Structure %s is not marked immobile, but probably should be -- please fix it. (If we ever add mobile structures, this debug sniffer will need to be revised.)\n",getName().str())); + DEBUG_CRASH(("Structure %s is not marked immobile, but probably should be -- please fix it. (If we ever add mobile structures, this debug sniffer will need to be revised.)",getName().str())); } if (isKindOf(KINDOF_STICK_TO_TERRAIN_SLOPE) && !isImmobile) { - DEBUG_CRASH(("item %s is marked STICK_TO_TERRAIN_SLOPE but not IMMOBILE -- please fix it.\n",getName().str())); + DEBUG_CRASH(("item %s is marked STICK_TO_TERRAIN_SLOPE but not IMMOBILE -- please fix it.",getName().str())); } if (isKindOf(KINDOF_STRUCTURE)) { if (m_armorTemplateSets.empty() || (m_armorTemplateSets.size() == 1 && m_armorTemplateSets[0].getArmorTemplate() == NULL)) { - DEBUG_CRASH(("Structure %s has no armor, but probably should (StructureArmor) -- please fix it.)\n",getName().str())); + DEBUG_CRASH(("Structure %s has no armor, but probably should (StructureArmor) -- please fix it.)",getName().str())); } for (ArmorTemplateSetVector::const_iterator it = m_armorTemplateSets.begin(); it != m_armorTemplateSets.end(); ++it) { if (it->getDamageFX() == NULL) { - DEBUG_CRASH(("Structure %s has no ArmorDamageFX, and really should.\n",getName().str())); + DEBUG_CRASH(("Structure %s has no ArmorDamageFX, and really should.",getName().str())); } } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp index 2c9ad924b9..ce8d710aac 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp @@ -2528,14 +2528,14 @@ void Drawable::validatePos() const const Coord3D* ourPos = getPosition(); if (_isnan(ourPos->x) || _isnan(ourPos->y) || _isnan(ourPos->z)) { - DEBUG_CRASH(("Drawable/Object position NAN! '%s'\n", getTemplate()->getName().str())); + DEBUG_CRASH(("Drawable/Object position NAN! '%s'", getTemplate()->getName().str())); } if (getObject()) { const Coord3D* objPos = getObject()->getPosition(); if (ourPos->x != objPos->x || ourPos->y != objPos->y || ourPos->z != objPos->z) { - DEBUG_CRASH(("Drawable/Object position mismatch! '%s'\n", getTemplate()->getName().str())); + DEBUG_CRASH(("Drawable/Object position mismatch! '%s'", getTemplate()->getName().str())); } } } @@ -4878,7 +4878,7 @@ void Drawable::xferDrawableModules( Xfer *xfer ) { // for testing purposes, this module better be found - DEBUG_CRASH(( "Drawable::xferDrawableModules - Module '%s' was indicated in file, but not found on Drawable %s %d\n", + DEBUG_CRASH(( "Drawable::xferDrawableModules - Module '%s' was indicated in file, but not found on Drawable %s %d", moduleIdentifier.str(), getTemplate()->getName().str(),getID() )); // skip this data in the file @@ -5038,7 +5038,7 @@ void Drawable::xfer( Xfer *xfer ) if( objectID != m_object->getID() ) { - DEBUG_CRASH(( "Drawable::xfer - Drawable '%s' is attached to wrong object '%s'\n", + DEBUG_CRASH(( "Drawable::xfer - Drawable '%s' is attached to wrong object '%s'", getTemplate()->getName().str(), m_object->getTemplate()->getName().str() )); throw SC_INVALID_DATA; @@ -5054,7 +5054,7 @@ void Drawable::xfer( Xfer *xfer ) #ifdef DEBUG_CRASHING Object *obj = TheGameLogic->findObjectByID( objectID ); - DEBUG_CRASH(( "Drawable::xfer - Drawable '%s' is not attached to an object but should be attached to object '%s' with id '%d'\n", + DEBUG_CRASH(( "Drawable::xfer - Drawable '%s' is not attached to an object but should be attached to object '%s' with id '%d'", getTemplate()->getName().str(), obj ? obj->getTemplate()->getName().str() : "Unknown", objectID )); @@ -5270,7 +5270,7 @@ void Drawable::xfer( Xfer *xfer ) if( animTemplate == NULL ) { - DEBUG_CRASH(( "Drawable::xfer - Unknown icon template '%s'\n", iconTemplateName.str() )); + DEBUG_CRASH(( "Drawable::xfer - Unknown icon template '%s'", iconTemplateName.str() )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index 40c3a1ddef..6438a93d64 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -795,7 +795,7 @@ void CommandSet::parseCommandButton( INI* ini, void *instance, void *store, cons if( commandButton == NULL ) { - DEBUG_CRASH(( "[LINE: %d - FILE: '%s'] Unknown command '%s' found in command set\n", + DEBUG_CRASH(( "[LINE: %d - FILE: '%s'] Unknown command '%s' found in command set", ini->getLineNum(), ini->getFilename().str(), token )); throw INI_INVALID_DATA; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp index 9f3068c1ee..6da57cd91d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp @@ -1413,7 +1413,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com { // sanity ... we must have a module for the special power, if we don't somebody probably // forgot to put it in the object - DEBUG_CRASH(( "Object %s does not contain special power module (%s) to execute. Did you forget to add it to the object INI?\n", + DEBUG_CRASH(( "Object %s does not contain special power module (%s) to execute. Did you forget to add it to the object INI?", obj->getTemplate()->getName().str(), command->getSpecialPowerTemplate()->getName().str() )); } else if( mod->isReady() == FALSE ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index 1ce609aa44..66569b50ba 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -1856,7 +1856,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); req.lastHouse = ptIdx; TheGameSpyPSMessageQueue->addRequest(req); } - DEBUG_CRASH(("populatePlayerInfo() - not tracking stats - we haven't gotten the original stuff yet\n")); + DEBUG_CRASH(("populatePlayerInfo() - not tracking stats - we haven't gotten the original stuff yet")); return; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp index e38af65784..096690365b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp @@ -514,7 +514,7 @@ void HandleBuddyResponses( void ) if (TheGameSpyInfo->isSavedIgnored(resp.profile)) { - //DEBUG_CRASH(("Player is ignored!\n")); + //DEBUG_CRASH(("Player is ignored!")); break; // no buddy messages from ignored people } @@ -637,7 +637,7 @@ void HandleBuddyResponses( void ) } else { - DEBUG_CRASH(("No buddy message queue!\n")); + DEBUG_CRASH(("No buddy message queue!")); } if(noticeLayout && timeGetTime() > noticeExpires) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp index 9ba65d372c..0b7d914e0f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp @@ -512,7 +512,7 @@ void GadgetCheckLikeButtonSetVisualCheck( GameWindow *g, Bool checked ) if( BitIsSet( g->winGetStatus(), WIN_STATUS_CHECK_LIKE ) == FALSE ) { - DEBUG_CRASH(( "GadgetCheckLikeButtonSetVisualCheck: Window is not 'CHECK-LIKE'\n" )); + DEBUG_CRASH(( "GadgetCheckLikeButtonSetVisualCheck: Window is not 'CHECK-LIKE'" )); return; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp index 1b8b18b7b2..cf4223a04d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameFont.cpp @@ -75,7 +75,7 @@ void FontLibrary::unlinkFont( GameFont *font ) if( other == NULL ) { - DEBUG_CRASH(( "Font '%s' not found in library\n", font->nameString.str() )); + DEBUG_CRASH(( "Font '%s' not found in library", font->nameString.str() )); return; } // end if @@ -197,7 +197,7 @@ GameFont *FontLibrary::getFont( AsciiString name, Int pointSize, Bool bold ) if( font == NULL ) { - DEBUG_CRASH(( "getFont: Unable to allocate new font list element\n" )); + DEBUG_CRASH(( "getFont: Unable to allocate new font list element" )); return NULL; } // end if @@ -213,7 +213,7 @@ GameFont *FontLibrary::getFont( AsciiString name, Int pointSize, Bool bold ) if( loadFontData( font ) == FALSE ) { - DEBUG_CRASH(( "getFont: Unable to load font data pointer '%s'\n", name.str() )); + DEBUG_CRASH(( "getFont: Unable to load font data pointer '%s'", name.str() )); deleteInstance(font); return NULL; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp index 0b8c5dfed6..d25e179286 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp @@ -633,7 +633,7 @@ void Shell::linkScreen( WindowLayout *screen ) if( m_screenCount == MAX_SHELL_STACK ) { - DEBUG_CRASH(( "No room in shell stack for screen\n" )); + DEBUG_CRASH(( "No room in shell stack for screen" )); return; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp index ed0dd40366..2d6cef34bf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -1269,7 +1269,7 @@ static Bool shouldSaveDrawable(const Drawable* draw) } else { - DEBUG_CRASH(("You should not ever set DRAWABLE_STATUS_NO_SAVE for a Drawable with an object. (%s)\n",draw->getTemplate()->getName().str())); + DEBUG_CRASH(("You should not ever set DRAWABLE_STATUS_NO_SAVE for a Drawable with an object. (%s)",draw->getTemplate()->getName().str())); } } return true; @@ -1422,7 +1422,7 @@ void GameClient::xfer( Xfer *xfer ) if( tocEntry == NULL ) { - DEBUG_CRASH(( "GameClient::xfer - Drawable TOC entry not found for '%s'\n", draw->getTemplate()->getName().str() )); + DEBUG_CRASH(( "GameClient::xfer - Drawable TOC entry not found for '%s'", draw->getTemplate()->getName().str() )); throw SC_INVALID_DATA; } // end if @@ -1464,7 +1464,7 @@ void GameClient::xfer( Xfer *xfer ) if( tocEntry == NULL ) { - DEBUG_CRASH(( "GameClient::xfer - No TOC entry match for id '%d'\n", tocID )); + DEBUG_CRASH(( "GameClient::xfer - No TOC entry match for id '%d'", tocID )); throw SC_INVALID_DATA; } // end if @@ -1477,7 +1477,7 @@ void GameClient::xfer( Xfer *xfer ) if( thingTemplate == NULL ) { - DEBUG_CRASH(( "GameClient::xfer - Unrecognized thing template '%s', skipping. ENGINEERS - Are you *sure* it's OK to be ignoring this object from the save file??? Think hard about it!\n", + DEBUG_CRASH(( "GameClient::xfer - Unrecognized thing template '%s', skipping. ENGINEERS - Are you *sure* it's OK to be ignoring this object from the save file??? Think hard about it!", tocEntry->name.str() )); xfer->skip( dataSize ); continue; @@ -1499,7 +1499,7 @@ void GameClient::xfer( Xfer *xfer ) if( object == NULL ) { - DEBUG_CRASH(( "GameClient::xfer - Cannot find object '%d' that is supposed to be attached to this drawable '%s'\n", + DEBUG_CRASH(( "GameClient::xfer - Cannot find object '%d' that is supposed to be attached to this drawable '%s'", objectID, thingTemplate->getName().str() )); throw SC_INVALID_DATA; @@ -1510,7 +1510,7 @@ void GameClient::xfer( Xfer *xfer ) if( draw == NULL ) { - DEBUG_CRASH(( "GameClient::xfer - There is no drawable attached to the object '%s' (%d) and there should be\n", + DEBUG_CRASH(( "GameClient::xfer - There is no drawable attached to the object '%s' (%d) and there should be", object->getTemplate()->getName().str(), object->getID() )); throw SC_INVALID_DATA; @@ -1545,7 +1545,7 @@ void GameClient::xfer( Xfer *xfer ) if( draw == NULL ) { - DEBUG_CRASH(( "GameClient::xfer - Unable to create drawable for '%s'\n", + DEBUG_CRASH(( "GameClient::xfer - Unable to create drawable for '%s'", thingTemplate->getName().str() )); throw SC_INVALID_DATA; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index 219fa642d1..b835342df5 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -453,7 +453,7 @@ void InGameUI::xfer( Xfer *xfer ) } else if (playerIndex < 0 || playerIndex >= MAX_PLAYER_COUNT) { - DEBUG_CRASH(("SWInfo bad plyrindex\n")); + DEBUG_CRASH(("SWInfo bad plyrindex")); throw INI_INVALID_DATA; } @@ -462,7 +462,7 @@ void InGameUI::xfer( Xfer *xfer ) const SpecialPowerTemplate* powerTemplate = TheSpecialPowerStore->findSpecialPowerTemplate(templateName); if (powerTemplate == NULL) { - DEBUG_CRASH(("power %s not found\n",templateName.str())); + DEBUG_CRASH(("power %s not found",templateName.str())); throw INI_INVALID_DATA; } @@ -1746,7 +1746,7 @@ void InGameUI::update( void ) { // if we've exceeded the allocated number of display strings, this will force us to essentially truncate the remaining text m_militarySubtitle->index = m_militarySubtitle->subtitle.getLength(); - DEBUG_CRASH(("You're Only Allowed to use %d lines of subtitle text\n",MAX_SUBTITLE_LINES)); + DEBUG_CRASH(("You're Only Allowed to use %d lines of subtitle text",MAX_SUBTITLE_LINES)); } } else diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp index d569e9f45b..0c0c984235 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp @@ -77,7 +77,7 @@ void Keyboard::createStreamMessages( void ) else { - DEBUG_CRASH(( "Unknown key state when creating msg stream\n" )); + DEBUG_CRASH(( "Unknown key state when creating msg stream" )); } // end else diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp index ee3c148ccc..6cca3b46a5 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp @@ -1147,7 +1147,7 @@ Int Mouse::getCursorIndex(const AsciiString& name) return i; } - DEBUG_CRASH(( "Mouse::getCursorIndex - Invalid cursor name '%s'\n", name.str() )); + DEBUG_CRASH(( "Mouse::getCursorIndex - Invalid cursor name '%s'", name.str() )); return INVALID_MOUSE_CURSOR; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp index d1864381d1..3cd814bb5a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp @@ -104,7 +104,7 @@ static UnsignedInt calcCRC( AsciiString dirName, AsciiString fname ) fp = TheFileSystem->openFile(asciiFile.str(), File::READ); if( !fp ) { - DEBUG_CRASH(("Couldn't open '%s'\n", fname.str())); + DEBUG_CRASH(("Couldn't open '%s'", fname.str())); return 0; } @@ -1095,7 +1095,7 @@ static void copyFromBigToDir( const AsciiString& infile, const AsciiString& outf File *file = TheFileSystem->openFile( infile.str(), File::READ | File::BINARY ); if( file == NULL ) { - DEBUG_CRASH(( "copyFromBigToDir - Error opening source file '%s'\n", infile.str() )); + DEBUG_CRASH(( "copyFromBigToDir - Error opening source file '%s'", infile.str() )); throw SC_INVALID_DATA; } // end if @@ -1110,14 +1110,14 @@ static void copyFromBigToDir( const AsciiString& infile, const AsciiString& outf char *buffer = NEW char[ fileSize ]; if( buffer == NULL ) { - DEBUG_CRASH(( "copyFromBigToDir - Unable to allocate buffer for file '%s'\n", infile.str() )); + DEBUG_CRASH(( "copyFromBigToDir - Unable to allocate buffer for file '%s'", infile.str() )); throw SC_INVALID_DATA; } // end if // copy the file to the buffer if( file->read( buffer, fileSize ) < fileSize ) { - DEBUG_CRASH(( "copyFromBigToDir - Error reading from file '%s'\n", infile.str() )); + DEBUG_CRASH(( "copyFromBigToDir - Error reading from file '%s'", infile.str() )); throw SC_INVALID_DATA; } // end if // close the BIG file @@ -1127,7 +1127,7 @@ static void copyFromBigToDir( const AsciiString& infile, const AsciiString& outf if( !filenew || filenew->write(buffer, fileSize) < fileSize) { - DEBUG_CRASH(( "copyFromBigToDir - Error writing to file '%s'\n", outfile.str() )); + DEBUG_CRASH(( "copyFromBigToDir - Error writing to file '%s'", outfile.str() )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp index c35f90bf44..f2e992731f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp @@ -391,7 +391,7 @@ static const char * findGameMessageNameByType(GameMessage::Type type) if (metaNames->value == (Int)type) return metaNames->name; - DEBUG_CRASH(("MetaTypeName %d not found -- did you remember to add it to GameMessageMetaTypeNames[] ?\n")); + DEBUG_CRASH(("MetaTypeName %d not found -- did you remember to add it to GameMessageMetaTypeNames[] ?")); return "???"; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/ParabolicEase.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/ParabolicEase.cpp index d4fa40cb96..cebc09f8f2 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/ParabolicEase.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/ParabolicEase.cpp @@ -49,18 +49,18 @@ ParabolicEase::setEaseTimes(Real easeInTime, Real easeOutTime) { m_in = easeInTime; if (m_in < 0.0f || m_in > 1.0f) { - DEBUG_CRASH(("Ease-in out of range (in = %g)\n", m_in)); + DEBUG_CRASH(("Ease-in out of range (in = %g)", m_in)); m_in = clamp(m_in); } m_out = 1.0f - easeOutTime; if (m_out < 0.0f || m_out > 1.0f) { - DEBUG_CRASH(("Ease-out out of range (out = %g)\n", m_out)); + DEBUG_CRASH(("Ease-out out of range (out = %g)", m_out)); m_out = clamp(m_out); } if (m_in > m_out) { - DEBUG_CRASH(("Ease-in and ease-out overlap (in = %g, out = %g)\n", m_in, m_out)); + DEBUG_CRASH(("Ease-in and ease-out overlap (in = %g, out = %g)", m_in, m_out)); m_in = m_out; } } @@ -70,7 +70,7 @@ Real ParabolicEase::operator ()(Real param) const { if (param < 0.0f || param > 1.0f) { - DEBUG_CRASH(("Ease-in/ease-out parameter out of range (param = %g)\n", param)); + DEBUG_CRASH(("Ease-in/ease-out parameter out of range (param = %g)", param)); param = clamp(param); } #if 0 diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp index e9f0eac2f1..592c8d2dc9 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp @@ -56,7 +56,7 @@ void RadiusDecalTemplate::createRadiusDecal(const Coord3D& pos, Real radius, con if (owningPlayer == NULL) { - DEBUG_CRASH(("You MUST specify a non-NULL owningPlayer to createRadiusDecal. (srj)\n")); + DEBUG_CRASH(("You MUST specify a non-NULL owningPlayer to createRadiusDecal. (srj)")); return; } @@ -87,7 +87,7 @@ void RadiusDecalTemplate::createRadiusDecal(const Coord3D& pos, Real radius, con } else { - DEBUG_CRASH(("Unable to add decal %s\n",decalInfo.m_ShadowName)); + DEBUG_CRASH(("Unable to add decal %s",decalInfo.m_ShadowName)); } } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp index cff1867b24..012ff50c65 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp @@ -106,7 +106,7 @@ void Anim2DTemplate::parseNumImages( INI *ini, void *instance, void *store, cons if( numFrames < minimumFrames ) { - DEBUG_CRASH(( "Anim2DTemplate::parseNumImages - Invalid animation '%s', animations must have '%d' or more frames defined\n", + DEBUG_CRASH(( "Anim2DTemplate::parseNumImages - Invalid animation '%s', animations must have '%d' or more frames defined", animTemplate->getName().str(), minimumFrames )); throw INI_INVALID_DATA; @@ -150,7 +150,7 @@ void Anim2DTemplate::parseImage( INI *ini, void *instance, void *store, const vo { //We don't care if we're in the builder - //DEBUG_CRASH(( "Anim2DTemplate::parseImage - Image not found\n" )); + //DEBUG_CRASH(( "Anim2DTemplate::parseImage - Image not found" )); //throw INI_INVALID_DATA; } // end if @@ -189,7 +189,7 @@ void Anim2DTemplate::parseImage( INI *ini, void *instance, void *store, const vo if( animTemplate->getNumFrames() == NUM_FRAMES_INVALID ) { - DEBUG_CRASH(( "Anim2DTemplate::parseImageSequence - You must specify the number of animation frames for animation '%s' *BEFORE* specifying the image sequence name\n", + DEBUG_CRASH(( "Anim2DTemplate::parseImageSequence - You must specify the number of animation frames for animation '%s' *BEFORE* specifying the image sequence name", animTemplate->getName().str() )); throw INI_INVALID_DATA; @@ -215,7 +215,7 @@ void Anim2DTemplate::parseImage( INI *ini, void *instance, void *store, const vo if( image == NULL ) { - DEBUG_CRASH(( "Anim2DTemplate::parseImageSequence - Image '%s' not found for animation '%s'. Check the number of images specified in INI and also make sure all the actual images exist.\n", + DEBUG_CRASH(( "Anim2DTemplate::parseImageSequence - Image '%s' not found for animation '%s'. Check the number of images specified in INI and also make sure all the actual images exist.", imageName.str(), animTemplate->getName().str() )); throw INI_INVALID_DATA; @@ -253,7 +253,7 @@ void Anim2DTemplate::storeImage( const Image *image ) } // end for i // if we got here we tried to store an image in an array that was too small - DEBUG_CRASH(( "Anim2DTemplate::storeImage - Unable to store image '%s' into animation '%s' because the animation is setup to only support '%d' image frames\n", + DEBUG_CRASH(( "Anim2DTemplate::storeImage - Unable to store image '%s' into animation '%s' because the animation is setup to only support '%d' image frames", image->getName().str(), getName().str(), m_numFrames )); throw INI_INVALID_DATA; @@ -274,7 +274,7 @@ const Image* Anim2DTemplate::getFrame( UnsignedShort frameNumber ) const if( frameNumber < 0 || frameNumber >= m_numFrames ) { - DEBUG_CRASH(( "Anim2DTemplate::getFrame - Illegal frame number '%d' for animation '%s'\n", + DEBUG_CRASH(( "Anim2DTemplate::getFrame - Illegal frame number '%d' for animation '%s'", frameNumber, getName().str() )); return NULL; @@ -421,7 +421,7 @@ void Anim2D::reset( void ) // -------------------------------------------------------------------------------------------- default: - DEBUG_CRASH(( "Anim2D::reset - Unknown animation mode '%d' for '%s'\n", + DEBUG_CRASH(( "Anim2D::reset - Unknown animation mode '%d' for '%s'", m_template->getAnimMode(), m_template->getName().str() )); break; @@ -553,7 +553,7 @@ void Anim2D::tryNextFrame( void ) default: { - DEBUG_CRASH(( "Anim2D::tryNextFrame - Unknown animation mode '%d' for '%s'\n", + DEBUG_CRASH(( "Anim2D::tryNextFrame - Unknown animation mode '%d' for '%s'", m_template->getAnimMode(), m_template->getName().str() )); break; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp index ed47a2e681..b7747fc379 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp @@ -707,7 +707,7 @@ void Particle::loadPostProcess( void ) if( m_systemUnderControlID == NULL ) { - DEBUG_CRASH(( "Particle::loadPostProcess - Unable to find system under control pointer\n" )); + DEBUG_CRASH(( "Particle::loadPostProcess - Unable to find system under control pointer" )); throw SC_INVALID_DATA; } // end if @@ -2546,7 +2546,7 @@ void ParticleSystem::loadPostProcess( void ) if( m_slaveSystem != NULL ) { - DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_slaveSystem is not NULL but should be\n" )); + DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_slaveSystem is not NULL but should be" )); throw SC_INVALID_DATA; } // end if @@ -2558,7 +2558,7 @@ void ParticleSystem::loadPostProcess( void ) if( m_slaveSystem == NULL || m_slaveSystem->isDestroyed() == TRUE ) { - DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_slaveSystem is NULL or destroyed\n" )); + DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_slaveSystem is NULL or destroyed" )); throw SC_INVALID_DATA; } // end if @@ -2573,7 +2573,7 @@ void ParticleSystem::loadPostProcess( void ) if( m_masterSystem != NULL ) { - DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_masterSystem is not NULL but should be\n" )); + DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_masterSystem is not NULL but should be" )); throw SC_INVALID_DATA; } // end if @@ -2585,7 +2585,7 @@ void ParticleSystem::loadPostProcess( void ) if( m_masterSystem == NULL || m_masterSystem->isDestroyed() == TRUE ) { - DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_masterSystem is NULL or destroyed\n" )); + DEBUG_CRASH(( "ParticleSystem::loadPostProcess - m_masterSystem is NULL or destroyed" )); throw SC_INVALID_DATA; } // end if @@ -3315,7 +3315,7 @@ void ParticleSystemManager::xfer( Xfer *xfer ) if( systemTemplate == NULL ) { - DEBUG_CRASH(( "ParticleSystemManager::xfer - Unknown particle system template '%s'\n", + DEBUG_CRASH(( "ParticleSystemManager::xfer - Unknown particle system template '%s'", systemName.str() )); throw SC_INVALID_DATA; @@ -3327,7 +3327,7 @@ void ParticleSystemManager::xfer( Xfer *xfer ) if( system == NULL ) { - DEBUG_CRASH(( "ParticleSystemManager::xfer - Unable to allocate particle system '%s'\n", + DEBUG_CRASH(( "ParticleSystemManager::xfer - Unable to allocate particle system '%s'", systemName.str() )); throw SC_INVALID_DATA; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp index 8ba75e2ba4..b14b5df375 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp @@ -112,7 +112,7 @@ const FieldParse TerrainRoadType::m_terrainBridgeFieldParseTable[] = else { - DEBUG_CRASH(( "Expected Damage/Repair transition keyword\n" )); + DEBUG_CRASH(( "Expected Damage/Repair transition keyword" )); throw INI_INVALID_DATA; } // end else @@ -132,7 +132,7 @@ const FieldParse TerrainRoadType::m_terrainBridgeFieldParseTable[] = if( effectNum < 0 || effectNum >= MAX_BRIDGE_BODY_FX ) { - DEBUG_CRASH(( "Effect number max on bridge transitions is '%d'\n", MAX_BRIDGE_BODY_FX )); + DEBUG_CRASH(( "Effect number max on bridge transitions is '%d'", MAX_BRIDGE_BODY_FX )); throw INI_INVALID_DATA; } // end if @@ -168,7 +168,7 @@ const FieldParse TerrainRoadType::m_terrainBridgeFieldParseTable[] = else { - DEBUG_CRASH(( "Expected Damage/Repair transition keyword\n" )); + DEBUG_CRASH(( "Expected Damage/Repair transition keyword" )); throw INI_INVALID_DATA; } // end else @@ -188,7 +188,7 @@ const FieldParse TerrainRoadType::m_terrainBridgeFieldParseTable[] = if( effectNum < 0 || effectNum >= MAX_BRIDGE_BODY_FX ) { - DEBUG_CRASH(( "Effect number max on bridge transitions is '%d'\n", MAX_BRIDGE_BODY_FX )); + DEBUG_CRASH(( "Effect number max on bridge transitions is '%d'", MAX_BRIDGE_BODY_FX )); throw INI_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp index 9a87234574..16e0859bec 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp @@ -3346,7 +3346,7 @@ void AIPlayer::xfer( Xfer *xfer ) if( getFirstItemIn_TeamBuildQueue() != NULL ) { - DEBUG_CRASH(( "AIPlayer::xfer - TeamBuildQueue head is not NULL, you should delete it or something before loading a new list\n" )); + DEBUG_CRASH(( "AIPlayer::xfer - TeamBuildQueue head is not NULL, you should delete it or something before loading a new list" )); throw SC_INVALID_DATA; } // end if @@ -3405,7 +3405,7 @@ void AIPlayer::xfer( Xfer *xfer ) if( getFirstItemIn_TeamReadyQueue() != NULL ) { - DEBUG_CRASH(( "AIPlayer::xfer - TeamReadyQueue head is not NULL, you should delete it or something before loading a new list\n" )); + DEBUG_CRASH(( "AIPlayer::xfer - TeamReadyQueue head is not NULL, you should delete it or something before loading a new list" )); throw SC_INVALID_DATA; } // end if @@ -3436,7 +3436,7 @@ void AIPlayer::xfer( Xfer *xfer ) if( playerIndex != m_player->getPlayerIndex() ) { - DEBUG_CRASH(( "AIPlayer::xfer - player index mismatch\n" )); + DEBUG_CRASH(( "AIPlayer::xfer - player index mismatch" )); throw SC_INVALID_DATA; } // end if @@ -3644,7 +3644,7 @@ void TeamInQueue::xfer( Xfer *xfer ) if( m_workOrders != NULL ) { - DEBUG_CRASH(( "TeamInQueue::xfer - m_workOrders should be NULL but isn't. Perhaps you should blow it away before loading\n" )); + DEBUG_CRASH(( "TeamInQueue::xfer - m_workOrders should be NULL but isn't. Perhaps you should blow it away before loading" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp index a95d4d89af..f664ccc0f6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp @@ -6748,7 +6748,7 @@ StateReturnType AIGuardState::update() Object* owner = getMachineOwner(); if( owner->getAI()->getJetAIUpdate() && owner->isOutOfAmmo() && !owner->isKindOf(KINDOF_PROJECTILE) && !owner->getTemplate()->isEnterGuard()) { - DEBUG_CRASH(("Hmm, this should probably never happen, since this case should be intercepted by JetAIUpdate\n")); + DEBUG_CRASH(("Hmm, this should probably never happen, since this case should be intercepted by JetAIUpdate")); return STATE_FAILURE; } @@ -6895,7 +6895,7 @@ StateReturnType AIGuardRetaliateState::update() Object* owner = getMachineOwner(); if( owner->getAI()->getJetAIUpdate() && owner->isOutOfAmmo() && !owner->isKindOf(KINDOF_PROJECTILE) && !owner->getTemplate()->isEnterGuard()) { - DEBUG_CRASH(("Hmm, this should probably never happen, since this case should be intercepted by JetAIUpdate\n")); + DEBUG_CRASH(("Hmm, this should probably never happen, since this case should be intercepted by JetAIUpdate")); return STATE_FAILURE; } @@ -7026,7 +7026,7 @@ StateReturnType AITunnelNetworkGuardState::update() Object* owner = getMachineOwner(); if (owner->isOutOfAmmo() && !owner->isKindOf(KINDOF_PROJECTILE)) { - DEBUG_CRASH(("Hmm, this should probably never happen, since this case should be intercepted by JetAIUpdate\n")); + DEBUG_CRASH(("Hmm, this should probably never happen, since this case should be intercepted by JetAIUpdate")); return STATE_FAILURE; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/Squad.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/Squad.cpp index 1a1ce1696f..ec9792ac49 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/Squad.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/Squad.cpp @@ -236,7 +236,7 @@ void Squad::xfer( Xfer *xfer ) if( m_objectsCached.size() != 0 ) { - DEBUG_CRASH(( "Squad::xfer - m_objectsCached should be emtpy, but is not\n" )); + DEBUG_CRASH(( "Squad::xfer - m_objectsCached should be emtpy, but is not" )); throw SC_INVALID_DATA; } // end of diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp index 12f61d32bf..861142c7f0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp @@ -1065,7 +1065,7 @@ StateReturnType TurretAIAimTurretState::update() Weapon *curWeapon = obj->getCurrentWeapon( &slot ); if (!curWeapon) { - DEBUG_CRASH(("TurretAIAimTurretState::update - curWeapon is NULL.\n")); + DEBUG_CRASH(("TurretAIAimTurretState::update - curWeapon is NULL.")); return STATE_FAILURE; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp index dc20bba141..f55acb520d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/SidesList.cpp @@ -809,7 +809,7 @@ Bool SidesList::validateSides() AsciiString tname = tdict->getAsciiString(TheKey_teamName); if (findSideInfo(tname)) { - DEBUG_CRASH(("name %s is duplicate between player and team, removing...\n",tname.str())); + DEBUG_CRASH(("name %s is duplicate between player and team, removing...",tname.str())); removeTeam(i); modified = true; goto validate_team_names; @@ -865,7 +865,7 @@ void SidesList::xfer( Xfer *xfer ) if( sideCount != getNumSides() ) { - DEBUG_CRASH(( "SidesList::xfer - The sides list size has changed, this was not supposed to happen, you must version this method and figure out how to translate between old and new versions now\n" )); + DEBUG_CRASH(( "SidesList::xfer - The sides list size has changed, this was not supposed to happen, you must version this method and figure out how to translate between old and new versions now" )); throw SC_INVALID_DATA; } // end if @@ -884,7 +884,7 @@ void SidesList::xfer( Xfer *xfer ) (scriptList != NULL && scriptListPresent == FALSE) ) { - DEBUG_CRASH(( "SidesList::xfer - script list missing/present mismatch\n" )); + DEBUG_CRASH(( "SidesList::xfer - script list missing/present mismatch" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index 6ec87f1985..be9b11c42b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -131,7 +131,7 @@ Object *Bridge::createTower( Coord3D *worldPos, if( towerTemplate == NULL || bridge == NULL ) { - DEBUG_CRASH(( "Bridge::createTower(): Invalid params\n" )); + DEBUG_CRASH(( "Bridge::createTower(): Invalid params" )); return NULL; } // end if @@ -166,7 +166,7 @@ Object *Bridge::createTower( Coord3D *worldPos, // -------------------------------------------------------------------------------------------- default: - DEBUG_CRASH(( "Bridge::createTower - Unknown bridge tower type '%d'\n", towerType )); + DEBUG_CRASH(( "Bridge::createTower - Unknown bridge tower type '%d'", towerType )); return NULL; } // end switch @@ -1211,7 +1211,7 @@ void TerrainLogic::enableWaterGrid( Bool enable ) if( waterSettingIndex == -1 ) { - DEBUG_CRASH(( "!!!!!! Deformable water won't work because there was no group of vertex water data defined in GameData.INI for this map name '%s' !!!!!! (C. Day)\n", + DEBUG_CRASH(( "!!!!!! Deformable water won't work because there was no group of vertex water data defined in GameData.INI for this map name '%s' !!!!!! (C. Day)", TheGlobalData->m_mapName.str() )); return; @@ -2273,7 +2273,7 @@ Real TerrainLogic::getWaterHeight( const WaterHandle *water ) if( water == &m_gridWaterHandle ) { - DEBUG_CRASH(( "TerrainLogic::getWaterHeight( WaterHandle *water ) - water is a grid handle, cannot make this query\n" )); + DEBUG_CRASH(( "TerrainLogic::getWaterHeight( WaterHandle *water ) - water is a grid handle, cannot make this query" )); return 0.0f; } // end if @@ -2422,7 +2422,7 @@ void TerrainLogic::changeWaterHeightOverTime( const WaterHandle *water, if( m_numWaterToUpdate >= MAX_DYNAMIC_WATER ) { - DEBUG_CRASH(( "Only '%d' simultaneous water table changes are supported\n", MAX_DYNAMIC_WATER )); + DEBUG_CRASH(( "Only '%d' simultaneous water table changes are supported", MAX_DYNAMIC_WATER )); return; } // end if @@ -2971,7 +2971,7 @@ void TerrainLogic::xfer( Xfer *xfer ) if( poly == NULL ) { - DEBUG_CRASH(( "TerrainLogic::xfer - Unable to find polygon trigger for water table with trigger ID '%d'\n", + DEBUG_CRASH(( "TerrainLogic::xfer - Unable to find polygon trigger for water table with trigger ID '%d'", triggerID )); throw SC_INVALID_DATA; @@ -2984,7 +2984,7 @@ void TerrainLogic::xfer( Xfer *xfer ) if( m_waterToUpdate[ i ].waterTable == NULL ) { - DEBUG_CRASH(( "TerrainLogic::xfer - Polygon trigger to use for water handle has no water handle!\n" )); + DEBUG_CRASH(( "TerrainLogic::xfer - Polygon trigger to use for water handle has no water handle!" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp index bad1b6315a..9f95e066cf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp @@ -109,7 +109,7 @@ static void parseTimeAndLocationInfo( INI *ini, void *instance, if( stricmp( token, "Delay" ) != 0 ) { - DEBUG_CRASH(( "Expected 'Delay' token, found '%s'\n", token )); + DEBUG_CRASH(( "Expected 'Delay' token, found '%s'", token )); throw INI_INVALID_DATA; } // end if @@ -126,7 +126,7 @@ static void parseTimeAndLocationInfo( INI *ini, void *instance, if( stricmp( token, "Bone" ) != 0 ) { - DEBUG_CRASH(( "Expected 'Bone' token, found '%s'\n", token )); + DEBUG_CRASH(( "Expected 'Bone' token, found '%s'", token )); throw INI_INVALID_DATA; } // end if @@ -159,7 +159,7 @@ static void parseTimeAndLocationInfo( INI *ini, void *instance, if( stricmp( token, "FX" ) != 0 ) { - DEBUG_CRASH(( "Expected 'FX' token, found '%s'\n", token )); + DEBUG_CRASH(( "Expected 'FX' token, found '%s'", token )); throw INI_INVALID_DATA; } // end if @@ -200,7 +200,7 @@ static void parseTimeAndLocationInfo( INI *ini, void *instance, if( stricmp( token, "OCL" ) != 0 ) { - DEBUG_CRASH(( "Expected 'OCL' token, found '%s'\n", token )); + DEBUG_CRASH(( "Expected 'OCL' token, found '%s'", token )); throw INI_INVALID_DATA; } // end if @@ -352,22 +352,22 @@ void BridgeBehavior::resolveFX( void ) name = bridgeTemplate->getDamageToOCLString( (BodyDamageType)bodyState, i ); m_damageToOCL[ bodyState ][ i ] = TheObjectCreationListStore->findObjectCreationList( name.str() ); if( name.isEmpty() == FALSE && m_damageToOCL[ bodyState ][ i ] == NULL ) - DEBUG_CRASH(( "OCL list '%s' not found\n", name.str() )); + DEBUG_CRASH(( "OCL list '%s' not found", name.str() )); name = bridgeTemplate->getDamageToFXString( (BodyDamageType)bodyState, i ); m_damageToFX[ bodyState ][ i ] = TheFXListStore->findFXList( name.str() ); if( name.isEmpty() == FALSE && m_damageToFX[ bodyState ][ i ] == NULL ) - DEBUG_CRASH(( "FX list '%s' not found\n", name.str() )); + DEBUG_CRASH(( "FX list '%s' not found", name.str() )); name = bridgeTemplate->getRepairedToOCLString( (BodyDamageType)bodyState, i ); m_repairToOCL[ bodyState ][ i ] = TheObjectCreationListStore->findObjectCreationList( name.str() ); if( name.isEmpty() == FALSE && m_repairToOCL[ bodyState ][ i ] == NULL ) - DEBUG_CRASH(( "OCL list '%s' not found\n", name.str() )); + DEBUG_CRASH(( "OCL list '%s' not found", name.str() )); name = bridgeTemplate->getRepairedToFXString( (BodyDamageType)bodyState, i ); m_repairToFX[ bodyState ][ i ] = TheFXListStore->findFXList( name.str() );; if( name.isEmpty() == FALSE && m_repairToFX[ bodyState ][ i ] == NULL ) - DEBUG_CRASH(( "FX list '%s' not found\n", name.str() )); + DEBUG_CRASH(( "FX list '%s' not found", name.str() )); } // end for i @@ -396,7 +396,7 @@ void BridgeBehavior::setTower( BridgeTowerType towerType, Object *tower ) if( towerType < 0 || towerType >= BRIDGE_MAX_TOWERS ) { - DEBUG_CRASH(( "BridgeBehavior::setTower - Invalid tower type index '%d'\n", towerType )); + DEBUG_CRASH(( "BridgeBehavior::setTower - Invalid tower type index '%d'", towerType )); return; } // end if @@ -418,7 +418,7 @@ ObjectID BridgeBehavior::getTowerID( BridgeTowerType towerType ) if( towerType < 0 || towerType >= BRIDGE_MAX_TOWERS ) { - DEBUG_CRASH(( "BridgeBehavior::setTower - Invalid tower type index '%d'\n", towerType )); + DEBUG_CRASH(( "BridgeBehavior::setTower - Invalid tower type index '%d'", towerType )); return INVALID_ID; } // end if @@ -638,7 +638,7 @@ void BridgeBehavior::onBodyDamageStateChange( const DamageInfo* damageInfo, if( bridge == NULL ) { - DEBUG_CRASH(( "BridgeBehavior - Unable to find bridge\n" )); + DEBUG_CRASH(( "BridgeBehavior - Unable to find bridge" )); return; } // end if @@ -1044,7 +1044,7 @@ void BridgeBehavior::createScaffolding( void ) if( scaffoldTemplate == NULL ) { - DEBUG_CRASH(( "Unable to find bridge scaffold template\n" )); + DEBUG_CRASH(( "Unable to find bridge scaffold template" )); return; } // end if @@ -1055,7 +1055,7 @@ void BridgeBehavior::createScaffolding( void ) if( scaffoldSupportTemplate == NULL ) { - DEBUG_CRASH(( "Unable to find bridge support scaffold template\n" )); + DEBUG_CRASH(( "Unable to find bridge support scaffold template" )); return; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp index 252d95a1fb..9ba7f136be 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp @@ -767,7 +767,7 @@ void DumbProjectileBehavior::xfer( Xfer *xfer ) if( m_detonationWeaponTmpl == NULL ) { - DEBUG_CRASH(( "DumbProjectileBehavior::xfer - Unknown weapon template '%s'\n", + DEBUG_CRASH(( "DumbProjectileBehavior::xfer - Unknown weapon template '%s'", weaponTemplateName.str() )); throw SC_INVALID_DATA; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp index 87f1e83d4d..76decb43c0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp @@ -1200,7 +1200,7 @@ UpdateSleepTime FlightDeckBehavior::update() if( pu == NULL ) { - DEBUG_CRASH( ("MSG_QUEUE_UNIT_CREATE: Producer '%s' doesn't have a unit production interface\n", getObject()->getTemplate()->getName().str()) ); + DEBUG_CRASH( ("MSG_QUEUE_UNIT_CREATE: Producer '%s' doesn't have a unit production interface", getObject()->getTemplate()->getName().str()) ); break; } // end if DEBUG_ASSERTCRASH( m_thingTemplate != NULL, ("flightdeck has a null thingtemplate... no jets for you!\n") ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/GenerateMinefieldBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/GenerateMinefieldBehavior.cpp index e8fac70259..2d7110c8a6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/GenerateMinefieldBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/GenerateMinefieldBehavior.cpp @@ -388,7 +388,7 @@ void GenerateMinefieldBehavior::placeMines() if (!mineTemplate) { - DEBUG_CRASH(("mine %s not found\n",d->m_mineName.str())); + DEBUG_CRASH(("mine %s not found",d->m_mineName.str())); return; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp index 81cc84d551..a5e0b63c70 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/MinefieldBehavior.cpp @@ -670,7 +670,7 @@ void MinefieldBehavior::xfer( Xfer *xfer ) if( maxImmunity != MAX_IMMUNITY ) { - DEBUG_CRASH(( "MinefieldBehavior::xfer - MAX_IMMUNITY has changed size, you must version this code and then you can remove this error message\n" )); + DEBUG_CRASH(( "MinefieldBehavior::xfer - MAX_IMMUNITY has changed size, you must version this code and then you can remove this error message" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp index fed2ffbb38..35e7e2a0cf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp @@ -850,7 +850,7 @@ void ParkingPlaceBehavior::unreserveDoorForExit( ExitDoorType exitDoor ) } } - DEBUG_CRASH(("ParkingPlaceBehavior::unreserveDoorForExit: door %d was not found\n",exitDoor)); + DEBUG_CRASH(("ParkingPlaceBehavior::unreserveDoorForExit: door %d was not found",exitDoor)); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PrisonBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PrisonBehavior.cpp index 59f36177b3..b613fefbee 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PrisonBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PrisonBehavior.cpp @@ -437,7 +437,7 @@ void PrisonBehavior::xfer( Xfer *xfer ) if( m_visualList != NULL ) { - DEBUG_CRASH(( "PrisonBehavior::xfer - the visual list should be empty but is not\n" )); + DEBUG_CRASH(( "PrisonBehavior::xfer - the visual list should be empty but is not" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaTowerBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaTowerBehavior.cpp index 15e6736ef6..d8640fc439 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaTowerBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaTowerBehavior.cpp @@ -416,7 +416,7 @@ void PropagandaTowerBehavior::doScan( void ) default: { - DEBUG_CRASH(( "PropagandaTowerBehavior::doScan - Unknown upgrade type '%d'\n", + DEBUG_CRASH(( "PropagandaTowerBehavior::doScan - Unknown upgrade type '%d'", m_upgradeRequired->getUpgradeType() )); break; @@ -609,7 +609,7 @@ void PropagandaTowerBehavior::xfer( Xfer *xfer ) if( m_insideList != NULL ) { - DEBUG_CRASH(( "PropagandaTowerBehavior::xfer - m_insideList should be empty but is not\n" )); + DEBUG_CRASH(( "PropagandaTowerBehavior::xfer - m_insideList should be empty but is not" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/RebuildHoleBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/RebuildHoleBehavior.cpp index a8a76b6ec1..f270f0099b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/RebuildHoleBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/RebuildHoleBehavior.cpp @@ -435,7 +435,7 @@ void RebuildHoleBehavior::xfer( Xfer *xfer ) if( m_workerTemplate == NULL ) { - DEBUG_CRASH(( "RebuildHoleBehavior::xfer - Unable to find template '%s'\n", + DEBUG_CRASH(( "RebuildHoleBehavior::xfer - Unable to find template '%s'", workerName.str() )); throw SC_INVALID_DATA; @@ -460,7 +460,7 @@ void RebuildHoleBehavior::xfer( Xfer *xfer ) if( m_rebuildTemplate == NULL ) { - DEBUG_CRASH(( "RebuildHoleBehavior::xfer - Unable to find template '%s'\n", + DEBUG_CRASH(( "RebuildHoleBehavior::xfer - Unable to find template '%s'", rebuildName.str() )); throw SC_INVALID_DATA; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp index 7a68963d29..179518c43e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp @@ -159,7 +159,7 @@ SlowDeathBehavior::SlowDeathBehavior( Thing *thing, const ModuleData* moduleData if (getSlowDeathBehaviorModuleData()->m_probabilityModifier < 1) { - DEBUG_CRASH(("ProbabilityModifer must be >= 1.\n")); + DEBUG_CRASH(("ProbabilityModifer must be >= 1.")); throw INI_INVALID_DATA; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp index f4d017bf7b..4e9ab670eb 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp @@ -1105,7 +1105,7 @@ void SpawnBehavior::xfer( Xfer *xfer ) if( m_spawnTemplate == NULL ) { - DEBUG_CRASH(( "SpawnBehavior::xfer - Unable to find template '%s'\n", name.str() )); + DEBUG_CRASH(( "SpawnBehavior::xfer - Unable to find template '%s'", name.str() )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp index 5892653ac6..22557d8285 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp @@ -1610,7 +1610,7 @@ void ActiveBody::xfer( Xfer *xfer ) if( m_particleSystems != NULL ) { - DEBUG_CRASH(( "ActiveBody::xfer - m_particleSystems should be empty, but is not\n" )); + DEBUG_CRASH(( "ActiveBody::xfer - m_particleSystems should be empty, but is not" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/CaveContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/CaveContain.cpp index a40b98e413..329ca25254 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/CaveContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/CaveContain.cpp @@ -411,7 +411,7 @@ void CaveContain::xfer( Xfer *xfer ) if( m_originalTeam == NULL ) { - DEBUG_CRASH(( "CaveContain::xfer - Unable to find original team by id\n" )); + DEBUG_CRASH(( "CaveContain::xfer - Unable to find original team by id" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp index 55525ee75a..73fd075626 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp @@ -161,7 +161,7 @@ void GarrisonContain::putObjectAtGarrisonPoint( Object *obj, conditionIndex < 0 || conditionIndex >= MAX_GARRISON_POINT_CONDITIONS ) { - DEBUG_CRASH(( "GarrisionContain::putObjectAtGarrisionPoint - Invalid arguments\n" )); + DEBUG_CRASH(( "GarrisionContain::putObjectAtGarrisionPoint - Invalid arguments" )); return; } // end if @@ -170,7 +170,7 @@ void GarrisonContain::putObjectAtGarrisonPoint( Object *obj, if( m_garrisonPointData[ pointIndex ].object != NULL ) { - DEBUG_CRASH(( "GarrisonContain::putObjectAtGarrisonPoint - Garrison Point '%d' is not empty\n", + DEBUG_CRASH(( "GarrisonContain::putObjectAtGarrisonPoint - Garrison Point '%d' is not empty", pointIndex )); return; @@ -262,7 +262,7 @@ Int GarrisonContain::findConditionIndex( void ) // -------------------------------------------------------------------------------------------- default: - DEBUG_CRASH(( "GarrisonContain::findConditionIndex - Unknown body damage type '%d'\n", + DEBUG_CRASH(( "GarrisonContain::findConditionIndex - Unknown body damage type '%d'", bodyDamage )); break; @@ -296,7 +296,7 @@ Bool GarrisonContain::calcBestGarrisonPosition( Coord3D *sourcePos, const Coord3 Int placeIndex = findClosestFreeGarrisonPointIndex( conditionIndex, targetPos ); if( placeIndex == GARRISON_INDEX_INVALID ) { - DEBUG_CRASH( ("GarrisonContain::calcBestGarrisonPosition - Unable to find suitable garrison point.\n") ); + DEBUG_CRASH( ("GarrisonContain::calcBestGarrisonPosition - Unable to find suitable garrison point.") ); return FALSE; } @@ -1822,7 +1822,7 @@ void GarrisonContain::xfer( Xfer *xfer ) if( m_originalTeam == NULL ) { - DEBUG_CRASH(( "GarrisonContain::xfer - Unable to find original team by id\n" )); + DEBUG_CRASH(( "GarrisonContain::xfer - Unable to find original team by id" )); throw SC_INVALID_DATA; } // end if @@ -1941,7 +1941,7 @@ void GarrisonContain::loadPostProcess( void ) if( m_garrisonPointData[ i ].object == NULL ) { - DEBUG_CRASH(( "GarrisonContain::loadPostProcess - Unable to find object for point data\n" )); + DEBUG_CRASH(( "GarrisonContain::loadPostProcess - Unable to find object for point data" )); throw SC_INVALID_DATA; } // end if @@ -1958,7 +1958,7 @@ void GarrisonContain::loadPostProcess( void ) if( m_garrisonPointData[ i ].effect == NULL ) { - DEBUG_CRASH(( "GarrisonContain::loadPostProcess - Unable to find effect for point data\n" )); + DEBUG_CRASH(( "GarrisonContain::loadPostProcess - Unable to find effect for point data" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp index 7681176f88..95fcda7b77 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp @@ -1709,7 +1709,7 @@ void OpenContain::xfer( Xfer *xfer ) } m_containList.clear(); #else - DEBUG_CRASH(( "OpenContain::xfer - Contain list should be empty before load but is not\n" )); + DEBUG_CRASH(( "OpenContain::xfer - Contain list should be empty before load but is not" )); throw SC_INVALID_DATA; #endif @@ -1800,7 +1800,7 @@ void OpenContain::xfer( Xfer *xfer ) if( m_objectEnterExitInfo.empty() == FALSE ) { - DEBUG_CRASH(( "OpenContain::xfer - m_objectEnterExitInfo should be empty, but is not\n" )); + DEBUG_CRASH(( "OpenContain::xfer - m_objectEnterExitInfo should be empty, but is not" )); throw SC_INVALID_DATA; } // end if @@ -1848,7 +1848,7 @@ void OpenContain::loadPostProcess( void ) if( m_containList.empty() == FALSE ) { - DEBUG_CRASH(( "OpenContain::loadPostProcess - Contain list should be empty before load but is not\n" )); + DEBUG_CRASH(( "OpenContain::loadPostProcess - Contain list should be empty before load but is not" )); throw SC_INVALID_DATA; } // end if @@ -1866,7 +1866,7 @@ void OpenContain::loadPostProcess( void ) if( obj == NULL ) { - DEBUG_CRASH(( "OpenContain::loadPostProcess - Unable to find object to put on contain list\n" )); + DEBUG_CRASH(( "OpenContain::loadPostProcess - Unable to find object to put on contain list" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp index 4e2e8cb1c4..8b25e939aa 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/ParachuteContain.cpp @@ -163,13 +163,13 @@ void ParachuteContain::updateBonePositions() { if (parachuteDraw->getPristineBonePositions( "PARA_COG", 0, &m_paraSwayBone, NULL, 1) != 1) { - DEBUG_CRASH(("PARA_COG not found\n")); + DEBUG_CRASH(("PARA_COG not found")); m_paraSwayBone.zero(); } if (parachuteDraw->getPristineBonePositions( "PARA_ATTCH", 0, &m_paraAttachBone, NULL, 1 ) != 1) { - DEBUG_CRASH(("PARA_ATTCH not found\n")); + DEBUG_CRASH(("PARA_ATTCH not found")); m_paraAttachBone.zero(); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/GhostObject.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/GhostObject.cpp index 1206b9f14f..7d01a3491c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/GhostObject.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/GhostObject.cpp @@ -98,7 +98,7 @@ void GhostObject::xfer( Xfer *xfer ) if( parentObjectID != INVALID_ID && m_parentObject == NULL ) { - DEBUG_CRASH(( "GhostObject::xfer - Unable to connect m_parentObject\n" )); + DEBUG_CRASH(( "GhostObject::xfer - Unable to connect m_parentObject" )); throw INI_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp index f104875522..b4f4c5462c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp @@ -400,7 +400,7 @@ void LocomotorTemplate::validate() m_lift != 0.0f || m_liftDamaged != 0.0f) { - DEBUG_CRASH(("THRUST locos may not use ZAxisBehavior or lift!\n")); + DEBUG_CRASH(("THRUST locos may not use ZAxisBehavior or lift!")); throw INI_INVALID_DATA; } if (m_maxSpeed <= 0.0f) @@ -2682,7 +2682,7 @@ void LocomotorSet::xfer( Xfer *xfer ) // vector should be empty at this point if (m_locomotors.empty() == FALSE) { - DEBUG_CRASH(( "LocomotorSet::xfer - vector is not empty, but should be\n" )); + DEBUG_CRASH(( "LocomotorSet::xfer - vector is not empty, but should be" )); throw XFER_LIST_NOT_EMPTY; } @@ -2694,7 +2694,7 @@ void LocomotorSet::xfer( Xfer *xfer ) const LocomotorTemplate* lt = TheLocomotorStore->findLocomotorTemplate(NAMEKEY(name)); if (lt == NULL) { - DEBUG_CRASH(( "LocomotorSet::xfer - template %s not found\n", name.str() )); + DEBUG_CRASH(( "LocomotorSet::xfer - template %s not found", name.str() )); throw XFER_UNKNOWN_STRING; } @@ -2749,7 +2749,7 @@ void LocomotorSet::xferSelfAndCurLocoPtr(Xfer *xfer, Locomotor** loco) } } - DEBUG_CRASH(( "LocomotorSet::xfer - template %s not found\n", name.str() )); + DEBUG_CRASH(( "LocomotorSet::xfer - template %s not found", name.str() )); throw XFER_UNKNOWN_STRING; } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 96cb3c7c6c..0bb19f899d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -804,13 +804,13 @@ void Object::restoreOriginalTeam() Team* origTeam = TheTeamFactory->findTeam(m_originalTeamName); if (origTeam == NULL) { - DEBUG_CRASH(("Object original team (%s) could not be found or created! (srj)\n",m_originalTeamName.str())); + DEBUG_CRASH(("Object original team (%s) could not be found or created! (srj)",m_originalTeamName.str())); return; } if (m_team == origTeam) { - DEBUG_CRASH(("Object appears to still be on its original team, so why are we attempting to restore it? (srj)\n")); + DEBUG_CRASH(("Object appears to still be on its original team, so why are we attempting to restore it? (srj)")); return; } @@ -2875,7 +2875,7 @@ Module* Object::findModule(NameKeyType key) const } else { - DEBUG_CRASH(("Duplicate modules found for name %s!\n",TheNameKeyGenerator->keyToName(key).str())); + DEBUG_CRASH(("Duplicate modules found for name %s!",TheNameKeyGenerator->keyToName(key).str())); } #else m = *b; @@ -4100,7 +4100,7 @@ void Object::xfer( Xfer *xfer ) Team *team = TheTeamFactory->findTeamByID( teamID ); if( team == NULL ) { - DEBUG_CRASH(( "Object::xfer - Unable to load team\n" )); + DEBUG_CRASH(( "Object::xfer - Unable to load team" )); throw SC_INVALID_DATA; } const Bool restoring = true; @@ -4330,7 +4330,7 @@ void Object::xfer( Xfer *xfer ) { // for testing purposes, this module better be found -// DEBUG_CRASH(( "Object::xfer - Module '%s' was indicated in file, but not found on object '%s'(%d)\n", +// DEBUG_CRASH(( "Object::xfer - Module '%s' was indicated in file, but not found on object '%s'(%d)", // moduleIdentifier.str(), getTemplate()->getName().str(), getID() )); // skip this data in the file diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectTypes.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectTypes.cpp index a97057286e..1353c5be0a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectTypes.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectTypes.cpp @@ -179,7 +179,7 @@ void ObjectTypes::xfer(Xfer *xfer) if( m_objectTypes.empty() == FALSE ) { - DEBUG_CRASH(( "ObjectTypes::xfer - m_objectTypes vector should be emtpy but is not!\n" )); + DEBUG_CRASH(( "ObjectTypes::xfer - m_objectTypes vector should be emtpy but is not!" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index f4ab8482e8..b67eab3066 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -1887,7 +1887,7 @@ void PartitionData::doSmallFill( Real halfCellSize = ThePartitionManager->getCellSize() * 0.5f; if (radius > halfCellSize) { - DEBUG_CRASH(("object is too large to use a 'small' geometry, truncating size to cellsize\n")); + DEBUG_CRASH(("object is too large to use a 'small' geometry, truncating size to cellsize")); radius = halfCellSize; } @@ -4626,7 +4626,7 @@ void PartitionManager::xfer( Xfer *xfer ) if( cellSize != m_cellSize ) { - DEBUG_CRASH(( "Partition cell size has changed, this save game file is invalid\n" )); + DEBUG_CRASH(( "Partition cell size has changed, this save game file is invalid" )); throw SC_INVALID_DATA; } // end if @@ -4639,7 +4639,7 @@ void PartitionManager::xfer( Xfer *xfer ) if( totalCellCount != m_totalCellCount ) { - DEBUG_CRASH(( "Partition total cell count mismatch %d, should be %d\n", + DEBUG_CRASH(( "Partition total cell count mismatch %d, should be %d", totalCellCount, m_totalCellCount )); throw SC_INVALID_DATA; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp index 5156e45d27..6ba05422dd 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/SpecialPowerModule.cpp @@ -469,8 +469,8 @@ Bool SpecialPowerModule::initiateIntentToDoSpecialPower( const Object *targetObj //appropriate update module! if( !valid && getSpecialPowerModuleData()->m_updateModuleStartsAttack ) { - DEBUG_CRASH( ("Object does not contain a special power module to execute. Did you forget to add it to the object INI?\n")); - //DEBUG_CRASH(( "Object does not contain special power module (%s) to execute. Did you forget to add it to the object INI?\n", + DEBUG_CRASH( ("Object does not contain a special power module to execute. Did you forget to add it to the object INI?")); + //DEBUG_CRASH(( "Object does not contain special power module (%s) to execute. Did you forget to add it to the object INI?", // command->m_specialPower->getName().str() )); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index b466c634eb..5bd9001661 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -172,7 +172,7 @@ const LocomotorTemplateVector* AIUpdateModuleData::findLocomotorTemplateVector(L { if (ini->getLoadType() != INI_LOAD_CREATE_OVERRIDES) { - DEBUG_CRASH(("re-specifying a LocomotorSet is no longer allowed\n")); + DEBUG_CRASH(("re-specifying a LocomotorSet is no longer allowed")); throw INI_INVALID_DATA; } } @@ -187,7 +187,7 @@ const LocomotorTemplateVector* AIUpdateModuleData::findLocomotorTemplateVector(L const LocomotorTemplate* lt = TheLocomotorStore->findLocomotorTemplate(locoKey); if (!lt) { - DEBUG_CRASH(("Locomotor %s not found!\n",locoName)); + DEBUG_CRASH(("Locomotor %s not found!",locoName)); throw INI_INVALID_DATA; } self->m_locomotorTemplates[set].push_back(lt); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index 3308b472b9..1c70c28179 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -432,7 +432,7 @@ class ChinookCombatDropState : public State { if (!m_ropes.empty()) { - DEBUG_CRASH(( "ChinookCombatDropState - ropes should be empty\n" )); + DEBUG_CRASH(( "ChinookCombatDropState - ropes should be empty" )); throw SC_INVALID_DATA; } m_ropes.resize(numRopes); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp index 25e040a86f..b0ae960c67 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp @@ -753,7 +753,7 @@ StateReturnType DozerActionDoActionState::update( void ) default: { - DEBUG_CRASH(( "Unknown task for the dozer action do action state\n" )); + DEBUG_CRASH(( "Unknown task for the dozer action do action state" )); return STATE_FAILURE; } // end default @@ -1777,7 +1777,7 @@ Bool DozerAIUpdate::canAcceptNewRepair( Object *obj ) if( currentTowerInterface == NULL || newTowerInterface == NULL ) { - DEBUG_CRASH(( "Unable to find bridge tower interface on object\n" )); + DEBUG_CRASH(( "Unable to find bridge tower interface on object" )); return FALSE; } // end if @@ -2222,7 +2222,7 @@ void DozerAIUpdate::internalTaskCompleteOrCancelled( DozerTask task ) default: { - DEBUG_CRASH(( "internalTaskCompleteOrCancelled: Unknown Dozer task '%d'\n", task )); + DEBUG_CRASH(( "internalTaskCompleteOrCancelled: Unknown Dozer task '%d'", task )); break; } // end default diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp index 1ebe3ba2df..9d674bd737 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp @@ -198,7 +198,7 @@ UpdateSleepTime POWTruckAIUpdate::update( void ) updateReturnPrisoners(); break; default: - DEBUG_CRASH(( "POWTruckAIUpdate::update - Unknown current task '%d'\n", m_currentTask )); + DEBUG_CRASH(( "POWTruckAIUpdate::update - Unknown current task '%d'", m_currentTask )); break; } // end switch, current task @@ -223,7 +223,7 @@ void POWTruckAIUpdate::setTask( POWTruckTask task, Object *taskObject ) taskObject == NULL ) { - DEBUG_CRASH(( "POWTruckAIUpdate::setTask - Illegal arguments\n" )); + DEBUG_CRASH(( "POWTruckAIUpdate::setTask - Illegal arguments" )); setTask( POW_TRUCK_TASK_WAITING ); return; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp index ab50d0de34..6f379f1ed8 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp @@ -513,7 +513,7 @@ Bool WorkerAIUpdate::canAcceptNewRepair( Object *obj ) if( currentTowerInterface == NULL || newTowerInterface == NULL ) { - DEBUG_CRASH(( "Unable to find bridge tower interface on object\n" )); + DEBUG_CRASH(( "Unable to find bridge tower interface on object" )); return FALSE; } // end if @@ -867,7 +867,7 @@ void WorkerAIUpdate::internalTaskCompleteOrCancelled( DozerTask task ) default: { - DEBUG_CRASH(( "internalTaskCompleteOrCancelled: Unknown Dozer task '%d'\n", task )); + DEBUG_CRASH(( "internalTaskCompleteOrCancelled: Unknown Dozer task '%d'", task )); break; } // end default diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BoneFXUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BoneFXUpdate.cpp index ad8422c476..85abfe2bce 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BoneFXUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BoneFXUpdate.cpp @@ -601,7 +601,7 @@ void BoneFXUpdate::xfer( Xfer *xfer ) if( m_particleSystemIDs.empty() == FALSE ) { - DEBUG_CRASH(( "BoneFXUpdate::xfer - m_particleSystemIDs should be empty but is not\n" )); + DEBUG_CRASH(( "BoneFXUpdate::xfer - m_particleSystemIDs should be empty but is not" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HordeUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HordeUpdate.cpp index fc1758c69e..54103361c2 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HordeUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HordeUpdate.cpp @@ -211,7 +211,7 @@ void HordeUpdate::joinOrLeaveHorde(SimpleObjectIterator *iter, Bool join) if( ai ) ai->evaluateMoraleBonus(); else - DEBUG_CRASH(( "HordeUpdate::joinOrLeaveHorde - We (%s) must have an AI to benefit from horde\n", + DEBUG_CRASH(( "HordeUpdate::joinOrLeaveHorde - We (%s) must have an AI to benefit from horde", getObject()->getTemplate()->getName().str() )); } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp index d044f1afa4..7bbd117cf3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp @@ -497,7 +497,7 @@ void NeutronMissileSlowDeathBehavior::xfer( Xfer *xfer ) if( maxNeutronBlasts != MAX_NEUTRON_BLASTS ) { - DEBUG_CRASH(( "NeutronMissileSlowDeathBehavior::xfer - Size of MAX_NEUTRON_BLASTS has changed, you must version this xfer code and then you can remove this error message\n" )); + DEBUG_CRASH(( "NeutronMissileSlowDeathBehavior::xfer - Size of MAX_NEUTRON_BLASTS has changed, you must version this xfer code and then you can remove this error message" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp index e8bb8d2315..4dbfa7e239 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileUpdate.cpp @@ -215,7 +215,7 @@ void NeutronMissileUpdate::doLaunch( void ) if (!launcher->getDrawable() || !launcher->getDrawable()->getProjectileLaunchOffset(m_attach_wslot, m_attach_specificBarrelToUse, &attachTransform, TURRET_INVALID, NULL)) { - DEBUG_CRASH(("ProjectileLaunchPos %d %d not found!\n",m_attach_wslot, m_attach_specificBarrelToUse)); + DEBUG_CRASH(("ProjectileLaunchPos %d %d not found!",m_attach_wslot, m_attach_specificBarrelToUse)); attachTransform.Make_Identity(); } @@ -619,7 +619,7 @@ void NeutronMissileUpdate::xfer( Xfer *xfer ) if( m_exhaustSysTmpl == NULL ) { - DEBUG_CRASH(( "NeutronMissileUpdate::xfer - Unable to find particle system '%s'\n", name.str() )); + DEBUG_CRASH(( "NeutronMissileUpdate::xfer - Unable to find particle system '%s'", name.str() )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp index 04e6b17533..8896d02482 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp @@ -1548,7 +1548,7 @@ void ParticleUplinkCannonUpdate::loadPostProcess( void ) } else { - DEBUG_CRASH(( "ParticleUplinkCannonUpdate::loadPostProcess - Unable to find drawable for m_orbitToTargetBeamID\n" )); + DEBUG_CRASH(( "ParticleUplinkCannonUpdate::loadPostProcess - Unable to find drawable for m_orbitToTargetBeamID" )); } } #endif diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp index 13dc755cc6..f14885058d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp @@ -1154,7 +1154,7 @@ void ProductionUpdate::cancelAndRefundAllProduction( void ) else { // unknown production type - DEBUG_CRASH(( "ProductionUpdate::cancelAndRefundAllProduction - Unknown production type '%d'\n", m_productionQueue->getProductionType() )); + DEBUG_CRASH(( "ProductionUpdate::cancelAndRefundAllProduction - Unknown production type '%d'", m_productionQueue->getProductionType() )); return; } // end else } // end if @@ -1287,7 +1287,7 @@ void ProductionUpdate::xfer( Xfer *xfer ) if( m_productionQueue != NULL ) { - DEBUG_CRASH(( "ProductionUpdate::xfer - m_productionQueue is not empty, but should be\n" )); + DEBUG_CRASH(( "ProductionUpdate::xfer - m_productionQueue is not empty, but should be" )); throw SC_INVALID_DATA; } // end if @@ -1327,7 +1327,7 @@ void ProductionUpdate::xfer( Xfer *xfer ) if( production->m_objectToProduce == NULL ) { - DEBUG_CRASH(( "ProductionUpdate::xfer - Cannot find template '%s'\n", name.str() )); + DEBUG_CRASH(( "ProductionUpdate::xfer - Cannot find template '%s'", name.str() )); throw SC_INVALID_DATA; } // end if @@ -1340,7 +1340,7 @@ void ProductionUpdate::xfer( Xfer *xfer ) if( production->m_upgradeToResearch == NULL ) { - DEBUG_CRASH(( "ProductionUpdate::xfer - Cannot find upgrade '%s'\n", name.str() )); + DEBUG_CRASH(( "ProductionUpdate::xfer - Cannot find upgrade '%s'", name.str() )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp index 7b83fce86f..fac6458a83 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp @@ -1180,7 +1180,7 @@ void StealthUpdate::xfer( Xfer *xfer ) if( m_disguiseAsTemplate == NULL ) { - DEBUG_CRASH(( "StealthUpdate::xfer - Unknown template '%s'\n", name.str() )); + DEBUG_CRASH(( "StealthUpdate::xfer - Unknown template '%s'", name.str() )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/WaveGuideUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/WaveGuideUpdate.cpp index f5890cc18e..047e3045ad 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/WaveGuideUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/WaveGuideUpdate.cpp @@ -179,7 +179,7 @@ Bool WaveGuideUpdate::startMoving( void ) if( verify->getNumLinks() > 1 ) { - DEBUG_CRASH(( "WaveGuideUpdate::startMoving - The waypoint path cannot have multiple link choices at any node\n" )); + DEBUG_CRASH(( "WaveGuideUpdate::startMoving - The waypoint path cannot have multiple link choices at any node" )); return FALSE; } // end if @@ -197,7 +197,7 @@ Bool WaveGuideUpdate::startMoving( void ) if( next == NULL ) { - DEBUG_CRASH(( "WaveGuideUpdate:startMoving - There must be a linked waypoint path to follow\n" )); + DEBUG_CRASH(( "WaveGuideUpdate:startMoving - There must be a linked waypoint path to follow" )); return FALSE; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 68560b36c8..4d16771846 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -1144,7 +1144,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate } else { - //DEBUG_CRASH(("Projectiles should implement ProjectileUpdateInterface!\n")); + //DEBUG_CRASH(("Projectiles should implement ProjectileUpdateInterface!")); // actually, this is ok, for things like Firestorm.... (srj) projectile->setPosition(&projectileDestination); } @@ -1483,7 +1483,7 @@ void WeaponTemplate::dealDamageInternal(ObjectID sourceID, ObjectID victimID, co } else { - DEBUG_CRASH(("projectile weapons should never get dealDamage called directly\n")); + DEBUG_CRASH(("projectile weapons should never get dealDamage called directly")); } } @@ -2957,7 +2957,7 @@ void Weapon::processRequestAssistance( const Object *requestingObject, Object *v if (!draw || !draw->getProjectileLaunchOffset(wslot, specificBarrelToUse, &attachTransform, tur, &turretRotPos, &turretPitchPos)) { //CRCDEBUG_LOG(("ProjectileLaunchPos %d %d not found!",wslot, specificBarrelToUse)); - DEBUG_CRASH(("ProjectileLaunchPos %d %d not found!\n",wslot, specificBarrelToUse)); + DEBUG_CRASH(("ProjectileLaunchPos %d %d not found!",wslot, specificBarrelToUse)); attachTransform.Make_Identity(); turretRotPos.zero(); turretPitchPos.zero(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp index b9aa4dee46..7028218963 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp @@ -1056,7 +1056,7 @@ Bool WeaponSet::setWeaponLock( WeaponSlotType weaponSlot, WeaponLockType lockTyp { if (lockType == NOT_LOCKED) { - DEBUG_CRASH(("calling setWeaponLock with NOT_LOCKED, so I am doing nothing... did you mean to use releaseWeaponLock()?\n")); + DEBUG_CRASH(("calling setWeaponLock with NOT_LOCKED, so I am doing nothing... did you mean to use releaseWeaponLock()?")); return false; } @@ -1080,7 +1080,7 @@ Bool WeaponSet::setWeaponLock( WeaponSlotType weaponSlot, WeaponLockType lockTyp return true; } - DEBUG_CRASH(("setWeaponLock: weapon %d not found (missing an upgrade?)\n", (Int)weaponSlot)); + DEBUG_CRASH(("setWeaponLock: weapon %d not found (missing an upgrade?)", (Int)weaponSlot)); return false; } @@ -1105,7 +1105,7 @@ void WeaponSet::releaseWeaponLock(WeaponLockType lockType) } else { - DEBUG_CRASH(("calling releaseWeaponLock with NOT_LOCKED makes no sense. why did you do this?\n")); + DEBUG_CRASH(("calling releaseWeaponLock with NOT_LOCKED makes no sense. why did you do this?")); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp index b933f10753..2e2d717ab3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp @@ -6878,7 +6878,7 @@ void ScriptActions::executeAction( ScriptAction *pAction ) { const char* MSG = "Your Script requested the following message be displayed:\n\n"; const char* MSG2 = "\n\nTHIS IS NOT A BUG. DO NOT REPORT IT."; - DEBUG_CRASH(("%s%s%s\n",MSG,pAction->getParameter(0)->getString().str(),MSG2)); + DEBUG_CRASH(("%s%s%s",MSG,pAction->getParameter(0)->getString().str(),MSG2)); } #endif return; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp index 3251f175e2..2d43db5c96 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp @@ -1071,7 +1071,7 @@ Bool ScriptConditions::evaluateEnemySighted(Parameter *pItemParm, Parameter *pAl relationDescriber = PartitionFilterRelationship::ALLOW_ENEMIES; break; default: - DEBUG_CRASH(("Unhandled case in ScriptConditions::evaluateEnemySighted()\n")); + DEBUG_CRASH(("Unhandled case in ScriptConditions::evaluateEnemySighted()")); relationDescriber = 0; break; } @@ -2871,7 +2871,7 @@ Bool ScriptConditions::evaluateCondition( Condition *pCondition ) return evaluateNamedHasFreeContainerSlots(pCondition->getParameter(0)); case Condition::DEFUNCT_PLAYER_SELECTED_GENERAL: case Condition::DEFUNCT_PLAYER_SELECTED_GENERAL_FROM_NAMED: - DEBUG_CRASH(("PLAYER_SELECTED_GENERAL script conditions are no longer in use\n")); + DEBUG_CRASH(("PLAYER_SELECTED_GENERAL script conditions are no longer in use")); return false; case Condition::PLAYER_BUILT_UPGRADE: return evaluateUpgradeFromUnitComplete(pCondition->getParameter(0), pCondition->getParameter(1), NULL); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp index 8b8719c28c..f76dcf5ffc 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp @@ -329,7 +329,7 @@ void AttackPriorityInfo::xfer( Xfer *xfer ) if( thingTemplate == NULL ) { - DEBUG_CRASH(( "AttackPriorityInfo::xfer - Unable to find thing template '%s'\n", + DEBUG_CRASH(( "AttackPriorityInfo::xfer - Unable to find thing template '%s'", thingTemplateName.str() )); throw SC_INVALID_DATA; @@ -6168,7 +6168,7 @@ void ScriptEngine::createNamedMapReveal(const AsciiString& revealName, const Asc // Will fail if there's already one in existence of the same name. for (it = m_namedReveals.begin(); it != m_namedReveals.end(); ++it) { if (it->m_revealName == revealName) { - DEBUG_CRASH(("ScriptEngine::createNamedMapReveal: Attempted to redefine named Reveal '%s', so I won't change it.\n", revealName.str())); + DEBUG_CRASH(("ScriptEngine::createNamedMapReveal: Attempted to redefine named Reveal '%s', so I won't change it.", revealName.str())); return; } } @@ -8173,7 +8173,7 @@ void SequentialScript::xfer( Xfer *xfer ) if( teamID != TEAM_ID_INVALID && m_teamToExecOn == NULL ) { - DEBUG_CRASH(( "SequentialScript::xfer - Unable to find team by ID (#%d) for m_teamToExecOn\n", + DEBUG_CRASH(( "SequentialScript::xfer - Unable to find team by ID (#%d) for m_teamToExecOn", teamID )); throw SC_INVALID_DATA; @@ -8573,7 +8573,7 @@ static void xferListAsciiString( Xfer *xfer, ListAsciiString *list ) if( list->empty() == FALSE ) { - DEBUG_CRASH(( "xferListAsciiString - list should be empty upon loading but is not\n" )); + DEBUG_CRASH(( "xferListAsciiString - list should be empty upon loading but is not" )); throw SC_INVALID_DATA; } // end if @@ -8643,7 +8643,7 @@ static void xferListAsciiStringUINT( Xfer *xfer, ListAsciiStringUINT *list ) if( list->empty() == FALSE ) { - DEBUG_CRASH(( "xferListAsciiStringUINT - list should be empty upon loading but is not\n" )); + DEBUG_CRASH(( "xferListAsciiStringUINT - list should be empty upon loading but is not" )); throw SC_INVALID_DATA; } // end if @@ -8718,7 +8718,7 @@ static void xferListAsciiStringObjectID( Xfer *xfer, ListAsciiStringObjectID *li if( list->empty() == FALSE ) { - DEBUG_CRASH(( "xferListAsciiStringObjectID - list should be empty upon loading but is not\n" )); + DEBUG_CRASH(( "xferListAsciiStringObjectID - list should be empty upon loading but is not" )); throw SC_INVALID_DATA; } // end if @@ -8793,7 +8793,7 @@ static void xferListAsciiStringCoord3D( Xfer *xfer, ListAsciiStringCoord3D *list if( list->empty() == FALSE ) { - DEBUG_CRASH(( "xferListAsciiStringCoord3D - list should be empty upon loading but is not\n" )); + DEBUG_CRASH(( "xferListAsciiStringCoord3D - list should be empty upon loading but is not" )); throw SC_INVALID_DATA; } // end if @@ -8874,7 +8874,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( m_sequentialScripts.size() != 0 ) { - DEBUG_CRASH(( "ScriptEngine::xfer - m_sequentialScripts should be empty but is not\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - m_sequentialScripts should be empty but is not" )); throw SC_INVALID_DATA; } // end if @@ -8902,7 +8902,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( countersSize > MAX_COUNTERS ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_COUNTERS has changed size, need to version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_COUNTERS has changed size, need to version this" )); throw SC_INVALID_DATA; } // end if @@ -8929,7 +8929,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( flagsSize > MAX_FLAGS ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_FLAGS has changed size, need to version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_FLAGS has changed size, need to version this" )); throw SC_INVALID_DATA; } // end if @@ -8953,7 +8953,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( attackPriorityInfoSize > MAX_ATTACK_PRIORITIES ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_ATTACK_PRIORITIES size has changed, need to version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_ATTACK_PRIORITIES size has changed, need to version this" )); throw SC_INVALID_DATA; } // end if @@ -9021,7 +9021,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( obj == NULL && objectID != INVALID_ID ) { - DEBUG_CRASH(( "ScriptEngine::xfer - Unable to find object by ID for m_namedObjects\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - Unable to find object by ID for m_namedObjects" )); throw SC_INVALID_DATA; } // end if @@ -9080,7 +9080,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( triggeredSpecialPowersSize != MAX_PLAYER_COUNT ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_triggeredSpecialPowers size is now different and we must version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_triggeredSpecialPowers size is now different and we must version this" )); throw SC_INVALID_DATA; } // end if @@ -9093,7 +9093,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( midwaySpecialPowersSize != MAX_PLAYER_COUNT ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_midwaySpecialPowers size is now different and we must version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_midwaySpecialPowers size is now different and we must version this" )); throw SC_INVALID_DATA; } // end if @@ -9106,7 +9106,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( finishedSpecialPowersSize != MAX_PLAYER_COUNT ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_finishedSpecialPowers size is now different and we must version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_finishedSpecialPowers size is now different and we must version this" )); throw SC_INVALID_DATA; } // end if @@ -9119,7 +9119,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( completedUpgradesSize != MAX_PLAYER_COUNT ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_completedUpgrades size is now different and we must version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_completedUpgrades size is now different and we must version this" )); throw SC_INVALID_DATA; } // end if @@ -9132,7 +9132,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( acquiredSciencesSize != MAX_PLAYER_COUNT ) { - DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_acquiredSciences size is now different and we must version this\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - MAX_PLAYER_COUNT has changed, m_acquiredSciences size is now different and we must version this" )); throw SC_INVALID_DATA; } // end if @@ -9197,7 +9197,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( m_namedReveals.empty() == FALSE ) { - DEBUG_CRASH(( "ScriptEngine::xfer - m_namedReveals should be empty but is not!\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - m_namedReveals should be empty but is not!" )); throw SC_INVALID_DATA; } // end if @@ -9256,7 +9256,7 @@ void ScriptEngine::xfer( Xfer *xfer ) if( m_allObjectTypeLists.empty() == FALSE ) { - DEBUG_CRASH(( "ScriptEngine::xfer - m_allObjectTypeLists should be empty but is not!\n" )); + DEBUG_CRASH(( "ScriptEngine::xfer - m_allObjectTypeLists should be empty but is not!" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp index 3e4e3a51bb..3cdef992e2 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp @@ -1974,7 +1974,7 @@ AsciiString Parameter::getUiText(void) const case RADAR_EVENT_TYPE: switch (m_int) { //case RADAR_EVENT_INVALID: ++m_int; // continue to the next case. - case RADAR_EVENT_INVALID: DEBUG_CRASH(("Invalid radar event\n")); uiText.format("Construction"); break; + case RADAR_EVENT_INVALID: DEBUG_CRASH(("Invalid radar event")); uiText.format("Construction"); break; case RADAR_EVENT_CONSTRUCTION: uiText.format("Construction"); break; case RADAR_EVENT_UPGRADE: uiText.format("Upgrade"); break; case RADAR_EVENT_UNDER_ATTACK: uiText.format("Under Attack"); break; @@ -2477,7 +2477,7 @@ ScriptAction *ScriptAction::ParseAction(DataChunkInput &file, DataChunkInfo *inf #ifdef DEBUG_CRASHING Script *pScript = (Script *)userData; if (at && (at->getName().isEmpty() || (at->getName().compareNoCase("(placeholder)") == 0))) { - DEBUG_CRASH(("Invalid Script Action found in script '%s'\n", pScript->getName().str())); + DEBUG_CRASH(("Invalid Script Action found in script '%s'", pScript->getName().str())); } #endif #ifdef COUNT_SCRIPT_USAGE diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/CaveSystem.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/CaveSystem.cpp index 4647bbff0e..f194703a0b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/CaveSystem.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/CaveSystem.cpp @@ -169,7 +169,7 @@ void CaveSystem::xfer( Xfer *xfer ) if( m_tunnelTrackerVector.empty() == FALSE ) { - DEBUG_CRASH(( "CaveSystem::xfer - m_tunnelTrackerVector should be empty but is not\n" )); + DEBUG_CRASH(( "CaveSystem::xfer - m_tunnelTrackerVector should be empty but is not" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index e0df08d644..271698acac 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -1159,7 +1159,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) if (TheGameState->isInSaveDirectory(TheGlobalData->m_mapName)) { - DEBUG_CRASH(( "FATAL SAVE/LOAD ERROR! - Setting a pristine map name that refers to a map in the save directory. The pristine map should always refer to the ORIGINAL map in the Maps directory, if the pristine map string is corrupt then map.ini files will not load correctly.\n" )); + DEBUG_CRASH(( "FATAL SAVE/LOAD ERROR! - Setting a pristine map name that refers to a map in the save directory. The pristine map should always refer to the ORIGINAL map in the Maps directory, if the pristine map string is corrupt then map.ini files will not load correctly." )); } // end if @@ -3044,7 +3044,7 @@ void GameLogic::friend_awakenUpdateModule(Object* obj, UpdateModulePtr u, Unsign if (u == m_curUpdateModule) { - DEBUG_CRASH(("You should not call setWakeFrame() from inside your update(), because it will be ignored, in favor of the return code from update.\n")); + DEBUG_CRASH(("You should not call setWakeFrame() from inside your update(), because it will be ignored, in favor of the return code from update.")); return; } @@ -4862,7 +4862,7 @@ void GameLogic::xfer( Xfer *xfer ) if( tocEntry == NULL ) { - DEBUG_CRASH(( "GameLogic::xfer - Object TOC entry not found for '%s'\n", obj->getTemplate()->getName().str() )); + DEBUG_CRASH(( "GameLogic::xfer - Object TOC entry not found for '%s'", obj->getTemplate()->getName().str() )); throw SC_INVALID_DATA; } // end if @@ -4902,7 +4902,7 @@ void GameLogic::xfer( Xfer *xfer ) if( tocEntry == NULL ) { - DEBUG_CRASH(( "GameLogic::xfer - No TOC entry match for id '%d'\n", tocID )); + DEBUG_CRASH(( "GameLogic::xfer - No TOC entry match for id '%d'", tocID )); throw SC_INVALID_DATA; } // end if @@ -4915,7 +4915,7 @@ void GameLogic::xfer( Xfer *xfer ) if( thingTemplate == NULL ) { - DEBUG_CRASH(( "GameLogic::xfer - Unrecognized thing template name '%s', skipping. ENGINEERS - Are you *sure* it's OK to be ignoring this object from the save file??? Think hard about it!\n", + DEBUG_CRASH(( "GameLogic::xfer - Unrecognized thing template name '%s', skipping. ENGINEERS - Are you *sure* it's OK to be ignoring this object from the save file??? Think hard about it!", tocEntry->name.str() )); xfer->skip( objectDataSize ); continue; @@ -4972,7 +4972,7 @@ void GameLogic::xfer( Xfer *xfer ) if( sanityTriggerCount != triggerCount ) { - DEBUG_CRASH(( "GameLogic::xfer - Polygon trigger count mismatch. Save file has a count of '%d', but map had '%d' triggers\n", + DEBUG_CRASH(( "GameLogic::xfer - Polygon trigger count mismatch. Save file has a count of '%d', but map had '%d' triggers", sanityTriggerCount, triggerCount )); throw SC_INVALID_DATA; @@ -5014,7 +5014,7 @@ void GameLogic::xfer( Xfer *xfer ) if( poly == NULL ) { - DEBUG_CRASH(( "GameLogic::xfer - Unable to find polygon trigger with id '%d'\n", + DEBUG_CRASH(( "GameLogic::xfer - Unable to find polygon trigger with id '%d'", triggerID )); throw SC_INVALID_DATA; @@ -5065,7 +5065,7 @@ void GameLogic::xfer( Xfer *xfer ) { if (m_thingTemplateBuildableOverrides.empty() == false) { - DEBUG_CRASH(( "GameLogic::xfer - m_thingTemplateBuildableOverrides should be empty, but is not\n")); + DEBUG_CRASH(( "GameLogic::xfer - m_thingTemplateBuildableOverrides should be empty, but is not")); throw SC_INVALID_DATA; } @@ -5105,7 +5105,7 @@ void GameLogic::xfer( Xfer *xfer ) { if (m_controlBarOverrides.empty() == false) { - DEBUG_CRASH(( "GameLogic::xfer - m_controlBarOverrides should be empty, but is not\n")); + DEBUG_CRASH(( "GameLogic::xfer - m_controlBarOverrides should be empty, but is not")); throw SC_INVALID_DATA; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp index 2754f1f3ac..eb29cbc75c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp @@ -1913,7 +1913,7 @@ void ConnectionManager::parseUserList(const GameInfo *game) /* if ( numUsers < 2 || m_localSlot == -1 ) { - DEBUG_CRASH(("FAILED parseUserList - network game won't work as expected\n")); + DEBUG_CRASH(("FAILED parseUserList - network game won't work as expected")); return; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/FirewallHelper.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/FirewallHelper.cpp index 10d8821cb0..e252020593 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/FirewallHelper.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/FirewallHelper.cpp @@ -1174,7 +1174,7 @@ Bool FirewallHelperClass::detectionTest4Stage2Update() { DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - NAT uses the same source port for different destination ports")); } else { DEBUG_LOG(("FirewallHelperClass::detectionTest4Stage2Update - Unable to complete destination port mangling test")); - DEBUG_CRASH(("Unable to complete destination port mangling test\n")); + DEBUG_CRASH(("Unable to complete destination port mangling test")); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp index 8a5ebe91f1..51ee6b34d0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp @@ -137,7 +137,7 @@ void ShowUnderlyingGUIElements( Bool show, const char *layoutFilename, const cha GameWindow *parent = TheWindowManager->winGetWindowFromId( NULL, parentID ); if (!parent) { - DEBUG_CRASH(("Window %s not found\n", parentNameStr.str())); + DEBUG_CRASH(("Window %s not found", parentNameStr.str())); return; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp index 3478b9e28e..70ed82cdf6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp @@ -203,7 +203,7 @@ void GameSlot::setState( SlotState state, UnicodeString name, UnsignedInt IP ) if (state == SLOT_OPEN && TheGameSpyGame && TheGameSpyGame->getConstSlot(0) == this) { - DEBUG_CRASH(("Game Is Hosed!\n")); + DEBUG_CRASH(("Game Is Hosed!")); } } if (state == SLOT_PLAYER) diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp index 186b0f77cd..ce46713036 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp @@ -308,7 +308,7 @@ static void gameTooltip(GameWindow *window, GameSpyGameSlot *slot = room->getGameSpySlot(i); if (i == 0 && (!slot || !slot->isHuman())) { - DEBUG_CRASH(("About to tooltip a non-hosted game!\n")); + DEBUG_CRASH(("About to tooltip a non-hosted game!")); } if (slot && slot->isHuman()) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp index 131857399e..4ad815aba4 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp @@ -118,7 +118,7 @@ Bool Transport::init( UnsignedInt ip, UnsignedShort port ) } if (retval != 0) { - DEBUG_CRASH(("Could not bind to 0x%8.8X:%d\n", ip, port)); + DEBUG_CRASH(("Could not bind to 0x%8.8X:%d", ip, port)); DEBUG_LOG(("Transport::init - Failure to bind socket with error code %x", retval)); delete m_udpsock; m_udpsock = NULL; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp index b96d1250bc..31a898b73f 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp @@ -2993,7 +2993,7 @@ void MilesAudioManager::friend_forcePlayAudioEventRTS(const AudioEventRTS* event if (!eventToPlay->getAudioEventInfo()) { getInfoForAudioEvent(eventToPlay); if (!eventToPlay->getAudioEventInfo()) { - DEBUG_CRASH(("No info for forced audio event '%s'\n", eventToPlay->getEventName().str())); + DEBUG_CRASH(("No info for forced audio event '%s'", eventToPlay->getEventName().str())); return; } } @@ -3106,7 +3106,7 @@ AudioFileCache::~AudioFileCache() OpenFilesHashIt it; for ( it = m_openFiles.begin(); it != m_openFiles.end(); ++it ) { if (it->second.m_openCount > 0) { - DEBUG_CRASH(("Sample '%s' is still playing, and we're trying to quit.\n", it->second.m_eventInfo->m_audioName.str())); + DEBUG_CRASH(("Sample '%s' is still playing, and we're trying to quit.", it->second.m_eventInfo->m_audioName.str())); } releaseOpenAudioFile(&it->second); @@ -3188,7 +3188,7 @@ void *AudioFileCache::openFile( AudioEventRTS *eventToOpenFrom ) openedAudioFile.m_soundInfo = soundInfo; openedAudioFile.m_openCount = 1; } else { - DEBUG_CRASH(("Unexpected compression type in '%s'\n", strToFind.str())); + DEBUG_CRASH(("Unexpected compression type in '%s'", strToFind.str())); // prevent leaks delete [] buffer; return NULL; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp index b3d8a659f6..ca54069ad8 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp @@ -86,7 +86,7 @@ static WW3DFormat findFormat(const WW3DFormat formats[]) } // end if } // end for i - DEBUG_CRASH(("WW3DRadar: No appropriate texture format\n") ); + DEBUG_CRASH(("WW3DRadar: No appropriate texture format") ); return WW3D_FORMAT_UNKNOWN; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 79d7f1bb31..025ae6846d 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -675,7 +675,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c if (!doSingleBoneName(robj, *it, m_pristineBones)) { // don't crash here, since these are catch-all global bones and won't be present in most models. - //DEBUG_CRASH(("public bone %s (and variations thereof) not found in model %s!\n",it->str(),m_modelName.str())); + //DEBUG_CRASH(("public bone %s (and variations thereof) not found in model %s!",it->str(),m_modelName.str())); } //else //{ @@ -688,7 +688,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c if (!doSingleBoneName(robj, *it, m_pristineBones)) { // DO crash here, since we specifically requested this bone for this model - DEBUG_CRASH(("*** ASSET ERROR: public bone '%s' (and variations thereof) not found in model %s!\n",it->str(),m_modelName.str())); + DEBUG_CRASH(("*** ASSET ERROR: public bone '%s' (and variations thereof) not found in model %s!",it->str(),m_modelName.str())); } //else //{ @@ -875,7 +875,7 @@ void ModelConditionInfo::validateTurretInfo() const { if (findPristineBone(tur.m_turretAngleNameKey, &tur.m_turretAngleBone) == NULL) { - DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found! (%s)\n",KEYNAME(tur.m_turretAngleNameKey).str(),m_modelName.str())); + DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found! (%s)",KEYNAME(tur.m_turretAngleNameKey).str(),m_modelName.str())); tur.m_turretAngleBone = 0; } } @@ -888,7 +888,7 @@ void ModelConditionInfo::validateTurretInfo() const { if (findPristineBone(tur.m_turretPitchNameKey, &tur.m_turretPitchBone) == NULL) { - DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found! (%s)\n",KEYNAME(tur.m_turretPitchNameKey).str(),m_modelName.str())); + DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found! (%s)",KEYNAME(tur.m_turretPitchNameKey).str(),m_modelName.str())); tur.m_turretPitchBone = 0; } } @@ -1451,19 +1451,19 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void { if (self->m_defaultState >= 0) { - DEBUG_CRASH(("*** ASSET ERROR: you may have only one default state!\n")); + DEBUG_CRASH(("*** ASSET ERROR: you may have only one default state!")); throw INI_INVALID_DATA; } else if (ini->getNextTokenOrNull()) { - DEBUG_CRASH(("*** ASSET ERROR: unknown keyword\n")); + DEBUG_CRASH(("*** ASSET ERROR: unknown keyword")); throw INI_INVALID_DATA; } else { if (!self->m_conditionStates.empty()) { - DEBUG_CRASH(("*** ASSET ERROR: when using DefaultConditionState, it must be the first state listed (%s)\n",TheThingTemplateBeingParsedName.str())); + DEBUG_CRASH(("*** ASSET ERROR: when using DefaultConditionState, it must be the first state listed (%s)",TheThingTemplateBeingParsedName.str())); throw INI_INVALID_DATA; } @@ -1494,7 +1494,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void if (firstKey == secondKey) { - DEBUG_CRASH(("*** ASSET ERROR: You may not declare a transition between two identical states\n")); + DEBUG_CRASH(("*** ASSET ERROR: You may not declare a transition between two identical states")); throw INI_INVALID_DATA; } @@ -1523,7 +1523,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void { if (self->m_conditionStates.empty()) { - DEBUG_CRASH(("*** ASSET ERROR: AliasConditionState must refer to the previous state!\n")); + DEBUG_CRASH(("*** ASSET ERROR: AliasConditionState must refer to the previous state!")); throw INI_INVALID_DATA; } @@ -1543,7 +1543,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void if (conditionsYes.anyIntersectionWith(self->m_ignoreConditionStates)) { - DEBUG_CRASH(("You should not specify bits in a state once they are used in IgnoreConditionStates (%s)\n", TheThingTemplateBeingParsedName.str())); + DEBUG_CRASH(("You should not specify bits in a state once they are used in IgnoreConditionStates (%s)", TheThingTemplateBeingParsedName.str())); throw INI_INVALID_DATA; } @@ -1578,7 +1578,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void // files too badly. maybe someday. // else // { - // DEBUG_CRASH(("*** ASSET ERROR: you must specify a default state\n")); + // DEBUG_CRASH(("*** ASSET ERROR: you must specify a default state")); // throw INI_INVALID_DATA; // } @@ -1597,14 +1597,14 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void if (conditionsYes.anyIntersectionWith(self->m_ignoreConditionStates)) { - DEBUG_CRASH(("You should not specify bits in a state once they are used in IgnoreConditionStates (%s)\n", TheThingTemplateBeingParsedName.str())); + DEBUG_CRASH(("You should not specify bits in a state once they are used in IgnoreConditionStates (%s)", TheThingTemplateBeingParsedName.str())); throw INI_INVALID_DATA; } if (self->m_defaultState < 0 && self->m_conditionStates.empty() && conditionsYes.any()) { // it doesn't actually NEED to be first, but it does need to be present, and this is the simplest way to enforce... - DEBUG_CRASH(("*** ASSET ERROR: when not using DefaultConditionState, the first ConditionState must be for NONE (%s)\n",TheThingTemplateBeingParsedName.str())); + DEBUG_CRASH(("*** ASSET ERROR: when not using DefaultConditionState, the first ConditionState must be for NONE (%s)",TheThingTemplateBeingParsedName.str())); throw INI_INVALID_DATA; } @@ -1647,7 +1647,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void if ((info.m_iniReadFlags & (1<subObjName.str(),getDrawable()->getTemplate()->getName().str())); + DEBUG_CRASH(("*** ASSET ERROR: SubObject %s not found (%s)!",it->subObjName.str(),getDrawable()->getTemplate()->getName().str())); } } } @@ -3368,7 +3368,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( if (turInfo.m_turretAngleNameKey != NAMEKEY_INVALID && !stateToUse->findPristineBonePos(turInfo.m_turretAngleNameKey, *turretRotPos)) { - DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found!\n",KEYNAME(turInfo.m_turretAngleNameKey).str())); + DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found!",KEYNAME(turInfo.m_turretAngleNameKey).str())); } #ifdef CACHE_ATTACH_BONE if (offset) @@ -3384,7 +3384,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( if (turInfo.m_turretPitchNameKey != NAMEKEY_INVALID && !stateToUse->findPristineBonePos(turInfo.m_turretPitchNameKey, *turretPitchPos)) { - DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found!\n",KEYNAME(turInfo.m_turretPitchNameKey).str())); + DEBUG_CRASH(("*** ASSET ERROR: TurretBone %s not found!",KEYNAME(turInfo.m_turretPitchNameKey).str())); } #ifdef CACHE_ATTACH_BONE if (offset) @@ -3473,7 +3473,7 @@ Int W3DModelDraw::getPristineBonePositionsForConditionState( } else { - //DEBUG_CRASH(("*** ASSET ERROR: Bone %s not found!\n",buffer)); + //DEBUG_CRASH(("*** ASSET ERROR: Bone %s not found!",buffer)); const Object *obj = getDrawable()->getObject(); if (obj) transforms[posCount] = *obj->getTransformMatrix(); @@ -4005,7 +4005,7 @@ void W3DModelDraw::updateSubObjects() } else { - DEBUG_CRASH(("*** ASSET ERROR: SubObject %s not found (%s)!\n",it->subObjName.str(),getDrawable()->getTemplate()->getName().str())); + DEBUG_CRASH(("*** ASSET ERROR: SubObject %s not found (%s)!",it->subObjName.str(),getDrawable()->getTemplate()->getName().str())); } } } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp index fc5a706a02..4898e7c08d 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp @@ -233,7 +233,7 @@ DisplayString *W3DDisplayStringManager::getGroupNumeralString( Int numeral ) { if (numeral < 0 || numeral > MAX_GROUPS - 1 ) { - DEBUG_CRASH(("Numeral '%d' out of range.\n", numeral)); + DEBUG_CRASH(("Numeral '%d' out of range.", numeral)); return m_groupNumeralStrings[0]; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DPropBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DPropBuffer.cpp index c4b3bdcb17..2f91e7b5e4 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DPropBuffer.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DPropBuffer.cpp @@ -159,7 +159,7 @@ Int W3DPropBuffer::addPropType(const AsciiString &modelName) m_propTypes[m_numPropTypes].m_robj = WW3DAssetManager::Get_Instance()->Create_Render_Obj(modelName.str()); if (m_propTypes[m_numPropTypes].m_robj==NULL) { - DEBUG_CRASH(("Unable to find model for prop %s\n", modelName.str())); + DEBUG_CRASH(("Unable to find model for prop %s", modelName.str())); return -1; } m_propTypes[m_numPropTypes].m_robjName = modelName; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp index 0213771ce5..575bf2a67c 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp @@ -1205,7 +1205,7 @@ void W3DTerrainVisual::xfer( Xfer *xfer ) if( gridEnabled != m_isWaterGridRenderingEnabled ) { - DEBUG_CRASH(( "W3DTerrainVisual::xfer - m_isWaterGridRenderingEnabled mismatch\n" )); + DEBUG_CRASH(( "W3DTerrainVisual::xfer - m_isWaterGridRenderingEnabled mismatch" )); throw SC_INVALID_DATA; } // end if @@ -1225,7 +1225,7 @@ void W3DTerrainVisual::xfer( Xfer *xfer ) if( width != getGridWidth() ) { - DEBUG_CRASH(( "W3DTerainVisual::xfer - grid width mismatch '%d' should be '%d'\n", + DEBUG_CRASH(( "W3DTerainVisual::xfer - grid width mismatch '%d' should be '%d'", width, getGridWidth() )); throw SC_INVALID_DATA; @@ -1233,7 +1233,7 @@ void W3DTerrainVisual::xfer( Xfer *xfer ) if( height != getGridHeight() ) { - DEBUG_CRASH(( "W3DTerainVisual::xfer - grid height mismatch '%d' should be '%d'\n", + DEBUG_CRASH(( "W3DTerainVisual::xfer - grid height mismatch '%d' should be '%d'", height, getGridHeight() )); throw SC_INVALID_DATA; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp index 586a6d2403..7db697d447 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp @@ -509,7 +509,7 @@ void W3DTreeBuffer::updateTexture(void) } theFile->close(); } else { - DEBUG_CRASH(("Could not find texture %s\n", m_treeTypes[i].m_data->m_textureName.str())); + DEBUG_CRASH(("Could not find texture %s", m_treeTypes[i].m_data->m_textureName.str())); m_treeTypes[i].m_firstTile = 0; m_treeTypes[i].m_tileWidth = 0; m_treeTypes[i].m_numTiles = 0; @@ -1348,7 +1348,7 @@ Int W3DTreeBuffer::addTreeType(const W3DTreeDrawModuleData *data) RenderObjClass *robj=WW3DAssetManager::Get_Instance()->Create_Render_Obj(data->m_modelName.str()); if (robj==NULL) { - DEBUG_CRASH(("Unable to find model for tree %s\n", data->m_modelName.str())); + DEBUG_CRASH(("Unable to find model for tree %s", data->m_modelName.str())); return 0; } AABoxClass box; @@ -1367,7 +1367,7 @@ Int W3DTreeBuffer::addTreeType(const W3DTreeDrawModuleData *data) m_treeTypes[m_numTreeTypes].m_mesh = (MeshClass*)robj; if (m_treeTypes[m_numTreeTypes].m_mesh==NULL) { - DEBUG_CRASH(("Tree %s is not simple mesh. Tell artist to re-export. Don't Ignore!!!\n", data->m_modelName.str())); + DEBUG_CRASH(("Tree %s is not simple mesh. Tell artist to re-export. Don't Ignore!!!", data->m_modelName.str())); return 0; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp index 1c42db91a6..a66a1971b0 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp @@ -3452,7 +3452,7 @@ void WaterRenderObjClass::xfer( Xfer *xfer ) if( cellsX != m_gridCellsX ) { - DEBUG_CRASH(( "WaterRenderObjClass::xfer - cells X mismatch\n" )); + DEBUG_CRASH(( "WaterRenderObjClass::xfer - cells X mismatch" )); throw SC_INVALID_DATA; } // end if @@ -3463,7 +3463,7 @@ void WaterRenderObjClass::xfer( Xfer *xfer ) if( cellsY != m_gridCellsY ) { - DEBUG_CRASH(( "WaterRenderObjClass::xfer - cells Y mismatch\n" )); + DEBUG_CRASH(( "WaterRenderObjClass::xfer - cells Y mismatch" )); throw SC_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp index 8924c8e879..20cd0710ab 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp @@ -636,7 +636,7 @@ void W3DGhostObject::xfer( Xfer *xfer ) // sanity if( drawableID != INVALID_DRAWABLE_ID && m_drawableInfo.m_drawable == NULL ) - DEBUG_CRASH(( "W3DGhostObject::xfer - Unable to find drawable for ghost object\n" )); + DEBUG_CRASH(( "W3DGhostObject::xfer - Unable to find drawable for ghost object" )); } // end if @@ -675,7 +675,7 @@ void W3DGhostObject::xfer( Xfer *xfer ) if( snapshotCount == 0 && m_parentSnapshots[ i ] != NULL ) { - DEBUG_CRASH(( "W3DGhostObject::xfer - m_parentShapshots[ %d ] has data present but the count from the xfer stream is empty\n" )); + DEBUG_CRASH(( "W3DGhostObject::xfer - m_parentShapshots[ %d ] has data present but the count from the xfer stream is empty" )); throw INI_INVALID_DATA; } // end if diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp index ca1f217322..278e5d2929 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp @@ -248,7 +248,7 @@ void Win32Mouse::translateEvent( UnsignedInt eventIndex, MouseIO *result ) default: { - DEBUG_CRASH(( "translateEvent: Unknown Win32 mouse event [%d,%d,%d]\n", + DEBUG_CRASH(( "translateEvent: Unknown Win32 mouse event [%d,%d,%d]", msg, wParam, lParam )); return; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp index da0842d331..9c054fe2fa 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp @@ -1468,7 +1468,7 @@ void DX8SkinFVFCategoryContainer::Add_Visible_Skin(MeshClass * mesh) { if (mesh->Peek_Next_Visible_Skin() != NULL || mesh == VisibleSkinTail) { - DEBUG_CRASH(("Mesh %s is already a visible skin, and we tried to add it again... please notify Mark W or Steven J immediately!\n",mesh->Get_Name())); + DEBUG_CRASH(("Mesh %s is already a visible skin, and we tried to add it again... please notify Mark W or Steven J immediately!",mesh->Get_Name())); return; } if (VisibleSkinHead == NULL) diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/MainFrm.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/MainFrm.cpp index ecfa71b739..b071fea661 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/MainFrm.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/MainFrm.cpp @@ -132,7 +132,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { - DEBUG_CRASH(("Failed to create status bar\n")); + DEBUG_CRASH(("Failed to create status bar")); } if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/ObjectOptions.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/ObjectOptions.cpp index 08876404dc..69414c9d86 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/ObjectOptions.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/ObjectOptions.cpp @@ -101,7 +101,7 @@ static Int findSideListEntryWithPlayerOfSide(AsciiString side) } } - // DEBUG_CRASH(("no SideList entry found for %s!\n",side.str())); + // DEBUG_CRASH(("no SideList entry found for %s!",side.str())); return -1; } @@ -218,7 +218,7 @@ static const PlayerTemplate* findFirstPlayerTemplateOnSide(AsciiString side) } } - DEBUG_CRASH(("no player found for %s!\n",side.str())); + DEBUG_CRASH(("no player found for %s!",side.str())); return NULL; } #endif diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WBFrameWnd.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WBFrameWnd.cpp index e56c6b51f0..a5c9bf23f5 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WBFrameWnd.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WBFrameWnd.cpp @@ -55,7 +55,7 @@ BOOL CWBFrameWnd::LoadFrame(UINT nIDResource, SWP_NOZORDER|SWP_NOSIZE); if (!m_cellSizeToolBar.Create(this, IDD_CELL_SLIDER, CBRS_LEFT, IDD_CELL_SLIDER)) { - DEBUG_CRASH(("Failed to create toolbar\n")); + DEBUG_CRASH(("Failed to create toolbar")); } EnableDocking(CBRS_ALIGN_ANY); m_cellSizeToolBar.SetupSlider(); From 4abff60946743b0eb7982396540a0889962e71a2 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:06:09 +0200 Subject: [PATCH 04/13] [GEN][ZH] Remove trailing LF from DEBUG_ASSERTLOG strings with script (#1232) --- .../Source/Common/Audio/GameAudio.cpp | 2 +- .../GameEngine/Source/Common/RandomValue.cpp | 2 +- .../Common/System/ArchiveFileSystem.cpp | 2 +- .../Source/Common/System/BuildAssistant.cpp | 2 +- .../Source/Common/Thing/ThingTemplate.cpp | 2 +- .../GUI/ControlBar/ControlBarCommand.cpp | 2 +- .../GUICallbacks/Menus/PopupPlayerInfo.cpp | 2 +- .../GUICallbacks/Menus/WOLGameSetupMenu.cpp | 4 ++-- .../GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp | 2 +- .../GameClient/GUI/Gadget/GadgetListBox.cpp | 2 +- .../Source/GameClient/System/ParticleSys.cpp | 8 ++++---- .../Source/GameLogic/AI/AIPathfind.cpp | 2 +- .../Source/GameLogic/AI/AISkirmishPlayer.cpp | 2 +- .../Source/GameLogic/AI/AIStates.cpp | 6 +++--- .../Source/GameLogic/Map/TerrainLogic.cpp | 2 +- .../Source/GameLogic/Object/Locomotor.cpp | 8 ++++---- .../GameLogic/Object/PartitionManager.cpp | 4 ++-- .../GameLogic/Object/Update/AIUpdate.cpp | 2 +- .../Source/GameLogic/Object/Weapon.cpp | 4 ++-- .../Source/GameLogic/Object/WeaponSet.cpp | 2 +- .../GameLogic/ScriptEngine/ScriptActions.cpp | 14 ++++++------- .../GameNetwork/GameSpy/Thread/PeerThread.cpp | 6 +++--- .../Source/GameNetwork/Transport.cpp | 4 ++-- .../GameEngine/Source/GameNetwork/udp.cpp | 6 +++--- .../MilesAudioDevice/MilesAudioManager.cpp | 2 +- .../VideoDevice/Bink/BinkVideoPlayer.cpp | 6 +++--- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 2 +- .../GameClient/Shadow/W3DVolumetricShadow.cpp | 2 +- .../W3DDevice/GameClient/W3DRoadBuffer.cpp | 20 +++++++++---------- .../Source/W3DDevice/GameClient/W3DView.cpp | 2 +- .../Code/Tools/WorldBuilder/src/CUndoable.cpp | 2 +- .../Tools/WorldBuilder/src/WHeightMapEdit.cpp | 2 +- .../Tools/WorldBuilder/src/mapobjectprops.cpp | 2 +- .../Source/Common/Audio/GameAudio.cpp | 2 +- .../GameEngine/Source/Common/RandomValue.cpp | 2 +- .../Common/System/ArchiveFileSystem.cpp | 2 +- .../Source/Common/System/BuildAssistant.cpp | 2 +- .../Source/Common/Thing/ThingTemplate.cpp | 2 +- .../GUI/ControlBar/ControlBarCommand.cpp | 2 +- .../GUICallbacks/Menus/PopupPlayerInfo.cpp | 2 +- .../GUICallbacks/Menus/WOLGameSetupMenu.cpp | 4 ++-- .../GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp | 2 +- .../GameClient/GUI/Gadget/GadgetListBox.cpp | 2 +- .../Source/GameClient/System/ParticleSys.cpp | 8 ++++---- .../Source/GameLogic/AI/AIPathfind.cpp | 2 +- .../Source/GameLogic/AI/AISkirmishPlayer.cpp | 2 +- .../Source/GameLogic/AI/AIStates.cpp | 6 +++--- .../Source/GameLogic/Map/TerrainLogic.cpp | 2 +- .../Source/GameLogic/Object/Locomotor.cpp | 8 ++++---- .../GameLogic/Object/PartitionManager.cpp | 4 ++-- .../GameLogic/Object/Update/AIUpdate.cpp | 2 +- .../Source/GameLogic/Object/Weapon.cpp | 4 ++-- .../Source/GameLogic/Object/WeaponSet.cpp | 2 +- .../GameLogic/ScriptEngine/ScriptActions.cpp | 16 +++++++-------- .../Source/GameNetwork/Transport.cpp | 4 ++-- .../GameEngine/Source/GameNetwork/udp.cpp | 6 +++--- .../MilesAudioDevice/MilesAudioManager.cpp | 2 +- .../VideoDevice/Bink/BinkVideoPlayer.cpp | 6 +++--- .../VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp | 6 +++--- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 2 +- .../GameClient/Shadow/W3DVolumetricShadow.cpp | 2 +- .../W3DDevice/GameClient/W3DRoadBuffer.cpp | 20 +++++++++---------- .../Source/W3DDevice/GameClient/W3DView.cpp | 2 +- .../Code/Tools/WorldBuilder/src/CUndoable.cpp | 2 +- .../Tools/WorldBuilder/src/WHeightMapEdit.cpp | 2 +- .../Tools/WorldBuilder/src/mapobjectprops.cpp | 2 +- 66 files changed, 133 insertions(+), 133 deletions(-) diff --git a/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp b/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp index 21bb273240..98009bae93 100644 --- a/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp +++ b/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp @@ -1098,7 +1098,7 @@ void AudioManager::releaseAudioEventRTS( AudioEventRTS *&eventToRelease ) //------------------------------------------------------------------------------------------------- void AudioManager::loseFocus( void ) { - DEBUG_ASSERTLOG(m_savedValues == NULL, ("AudioManager::loseFocus() - leak - jkmcd\n")); + DEBUG_ASSERTLOG(m_savedValues == NULL, ("AudioManager::loseFocus() - leak - jkmcd")); // In this case, make all the audio go silent. m_savedValues = NEW Real[NUM_VOLUME_TYPES]; m_savedValues[0] = m_systemMusicVolume; diff --git a/Generals/Code/GameEngine/Source/Common/RandomValue.cpp b/Generals/Code/GameEngine/Source/Common/RandomValue.cpp index 068d6c1fcf..b57546df51 100644 --- a/Generals/Code/GameEngine/Source/Common/RandomValue.cpp +++ b/Generals/Code/GameEngine/Source/Common/RandomValue.cpp @@ -374,7 +374,7 @@ Real GameClientRandomVariable::getValue( void ) const switch( m_type ) { case CONSTANT: - DEBUG_ASSERTLOG(m_low == m_high, ("m_low != m_high for a CONSTANT GameClientRandomVariable\n")); + DEBUG_ASSERTLOG(m_low == m_high, ("m_low != m_high for a CONSTANT GameClientRandomVariable")); if (m_low == m_high) { return m_low; } // else return as though a UNIFORM. diff --git a/Generals/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp b/Generals/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp index 352ed202f5..f1a3419e34 100644 --- a/Generals/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp @@ -189,7 +189,7 @@ void ArchiveFileSystem::loadMods() { Bool ret = #endif loadBigFilesFromDirectory(TheGlobalData->m_modDir, "*.big", TRUE); - DEBUG_ASSERTLOG(ret, ("loadBigFilesFromDirectory(%s) returned FALSE!\n", TheGlobalData->m_modDir.str())); + DEBUG_ASSERTLOG(ret, ("loadBigFilesFromDirectory(%s) returned FALSE!", TheGlobalData->m_modDir.str())); } } diff --git a/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp b/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp index 77f8dcfb57..f47b1a0553 100644 --- a/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp @@ -1196,7 +1196,7 @@ Bool BuildAssistant::isPossibleToMakeUnit( Object *builder, const ThingTemplate if( commandSet == NULL ) { - DEBUG_ASSERTLOG( 0, ("Can't build a '%s' from the builder '%s' because '%s' doesn't have any command set defined\n", + DEBUG_ASSERTLOG( 0, ("Can't build a '%s' from the builder '%s' because '%s' doesn't have any command set defined", whatToBuild->getName().str(), builder->getTemplate()->getName().str(), builder->getTemplate()->getName().str()) ); diff --git a/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp index aaa2e682c0..11e48d7fec 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -924,7 +924,7 @@ void ThingTemplate::validateAudio() #define AUDIO_TEST(y) \ if (!get##y()->getEventName().isEmpty() && get##y()->getEventName().compareNoCase("NoSound") != 0) { \ - DEBUG_ASSERTLOG(TheAudio->isValidAudioEvent(get##y()), ("Invalid Sound '%s' in Object '%s'. (%s?)\n", #y, getName().str(), get##y()->getEventName().str())); \ + DEBUG_ASSERTLOG(TheAudio->isValidAudioEvent(get##y()), ("Invalid Sound '%s' in Object '%s'. (%s?)", #y, getName().str(), get##y()->getEventName().str())); \ } AUDIO_TEST(VoiceSelect) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp index 43accaa85e..c81f53724f 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp @@ -1164,7 +1164,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com // changed this to Log rather than Crash, because this can legitimately happen now for // dozers and workers with mine-clearing stuff... (srj) - //DEBUG_ASSERTLOG( w, ("Unit %s's CommandButton %s is trying to access weaponslot %d, but doesn't have a weapon there in its FactionUnit ini entry.\n", + //DEBUG_ASSERTLOG( w, ("Unit %s's CommandButton %s is trying to access weaponslot %d, but doesn't have a weapon there in its FactionUnit ini entry.", // obj->getTemplate()->getName().str(), command->getName().str(), (Int)command->getWeaponSlot() ) ); UnsignedInt now = TheGameLogic->getFrame(); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp index 053faf0323..f402745868 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp @@ -730,7 +730,7 @@ static GameWindow* findWindow(GameWindow *parent, AsciiString baseWindow, AsciiS AsciiString fullPath; fullPath.format("%s:%s", baseWindow.str(), gadgetName.str()); GameWindow *res = TheWindowManager->winGetWindowFromId(parent, NAMEKEY(fullPath)); - DEBUG_ASSERTLOG(res, ("Cannot find window %s\n", fullPath.str())); + DEBUG_ASSERTLOG(res, ("Cannot find window %s", fullPath.str())); return res; } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp index 6382711271..c92d69bd47 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp @@ -1857,9 +1857,9 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) #ifdef DEBUG_LOGGING UnsignedShort newPort = game->getConstSlot(i)->getPort(); UnsignedInt newIP = game->getConstSlot(i)->getIP(); - DEBUG_ASSERTLOG(newIP == ips[i], ("IP was different for player %d (%X --> %X)\n", + DEBUG_ASSERTLOG(newIP == ips[i], ("IP was different for player %d (%X --> %X)", i, ips[i], newIP)); - DEBUG_ASSERTLOG(newPort == ports[i], ("Port was different for player %d (%d --> %d)\n", + DEBUG_ASSERTLOG(newPort == ports[i], ("Port was different for player %d (%d --> %d)", i, ports[i], newPort)); #endif game->getSlot(i)->setPort(ports[i]); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index 98d9d36947..e72ea41cd6 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -410,7 +410,7 @@ const Image* LookupSmallRankImage(Int side, Int rankPoints) AsciiString fullImageName; fullImageName.format("%s-%s", rankNames[rank], sideStr.str()); const Image *img = TheMappedImageCollection->findImageByName(fullImageName); - DEBUG_ASSERTLOG(img, ("*** Could not load small rank image '%s' from TheMappedImageCollection!\n", fullImageName.str())); + DEBUG_ASSERTLOG(img, ("*** Could not load small rank image '%s' from TheMappedImageCollection!", fullImageName.str())); return img; } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp index bcac0e91fb..4c49f2641d 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp @@ -2229,7 +2229,7 @@ Int GadgetListBoxAddEntryText( GameWindow *listbox, /// @TODO: Don't do this type cast! index = (Int) TheWindowManager->winSendSystemMsg( listbox, GLM_ADD_ENTRY, (WindowMsgData)&addInfo, color ); - //DEBUG_ASSERTLOG(!listData->scrollIfAtEnd, ("Adding line %d (orig end was %d, newEntryOffset is %d, (%d-%d)?=%d, isFull=%d/%d ll=%d, end=%d\n", + //DEBUG_ASSERTLOG(!listData->scrollIfAtEnd, ("Adding line %d (orig end was %d, newEntryOffset is %d, (%d-%d)?=%d, isFull=%d/%d ll=%d, end=%d", //index, oldBottomIndex, newEntryOffset, index, oldBottomIndex, newEntryOffset, wasFull, GadgetListBoxIsFull(listbox), listData->listLength, listData->endPos)); if(listData->scrollIfAtEnd && index - oldBottomIndex == newEntryOffset && GadgetListBoxIsFull(listbox)) { diff --git a/Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp b/Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp index 724f67656f..83262d1294 100644 --- a/Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp @@ -353,7 +353,7 @@ Particle::Particle( ParticleSystem *system, const ParticleInfo *info ) // add this particle to the Particle System list, retaining local creation order m_system->addParticle(this); - //DEBUG_ASSERTLOG(!(totalParticleCount % 100 == 0), ( "TotalParticleCount = %d\n", m_totalParticleCount )); + //DEBUG_ASSERTLOG(!(totalParticleCount % 100 == 0), ( "TotalParticleCount = %d", m_totalParticleCount )); } // ------------------------------------------------------------------------------------------------ @@ -379,7 +379,7 @@ Particle::~Particle() // remove from the global list TheParticleSystemManager->removeParticle(this); - //DEBUG_ASSERTLOG(!(totalParticleCount % 100 == 0), ( "TotalParticleCount = %d\n", m_totalParticleCount )); + //DEBUG_ASSERTLOG(!(totalParticleCount % 100 == 0), ( "TotalParticleCount = %d", m_totalParticleCount )); } // ------------------------------------------------------------------------------------------------ @@ -1278,7 +1278,7 @@ ParticleSystem::ParticleSystem( const ParticleSystemTemplate *sysTemplate, TheParticleSystemManager->friend_addParticleSystem(this); - //DEBUG_ASSERTLOG(!(m_totalParticleSystemCount % 10 == 0), ( "TotalParticleSystemCount = %d\n", m_totalParticleSystemCount )); + //DEBUG_ASSERTLOG(!(m_totalParticleSystemCount % 10 == 0), ( "TotalParticleSystemCount = %d", m_totalParticleSystemCount )); } // ------------------------------------------------------------------------------------------------ @@ -1322,7 +1322,7 @@ ParticleSystem::~ParticleSystem() m_controlParticle = NULL; TheParticleSystemManager->friend_removeParticleSystem(this); - //DEBUG_ASSERTLOG(!(m_totalParticleSystemCount % 10 == 0), ( "TotalParticleSystemCount = %d\n", m_totalParticleSystemCount )); + //DEBUG_ASSERTLOG(!(m_totalParticleSystemCount % 10 == 0), ( "TotalParticleSystemCount = %d", m_totalParticleSystemCount )); } // ------------------------------------------------------------------------------------------------ diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index 5ebc925168..f66552edb3 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -5157,7 +5157,7 @@ Bool Pathfinder::queueForPath(ObjectID id) AIUpdateInterface *tmpAI = tmpObj->getAIUpdateInterface(); if (tmpAI) { const Coord3D* pos = tmpAI->friend_getRequestedDestination(); - DEBUG_ASSERTLOG(pos->x != 0.0 && pos->y != 0.0, ("Queueing pathfind to (0, 0), usually a bug. (Unit Name: '%s', Type: '%s' \n", tmpObj->getName().str(), tmpObj->getTemplate()->getName().str())); + DEBUG_ASSERTLOG(pos->x != 0.0 && pos->y != 0.0, ("Queueing pathfind to (0, 0), usually a bug. (Unit Name: '%s', Type: '%s' ", tmpObj->getName().str(), tmpObj->getTemplate()->getName().str())); } } } diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp index 27247f0674..7c35709fdf 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp @@ -1078,7 +1078,7 @@ void AISkirmishPlayer::newMap( void ) } build = build->m_next; } - DEBUG_ASSERTLOG(build!=NULL, ("Couldn't find build list for skirmish player.\n")); + DEBUG_ASSERTLOG(build!=NULL, ("Couldn't find build list for skirmish player.")); // Build any with the initially built flag. for( BuildListInfo *info = m_player->getBuildList(); info; info = info->getNext() ) diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp index 470af781f0..3fcf932bfd 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp @@ -1730,7 +1730,7 @@ void AIInternalMoveToState::onExit( StateExitType status ) // (This is why destructors should not do game logic) if (ai) { ai->friend_endingMove(); - DEBUG_ASSERTLOG(obj->getTeam(), ("AIInternalMoveToState::onExit obj has NULL team.\n")); + DEBUG_ASSERTLOG(obj->getTeam(), ("AIInternalMoveToState::onExit obj has NULL team.")); if (obj->getTeam() && ai->isDoingGroundMovement() && ai->getCurLocomotor() && ai->getCurLocomotor()->isUltraAccurate()) { Real dx = m_goalPosition.x-obj->getPosition()->x; @@ -1887,7 +1887,7 @@ StateReturnType AIInternalMoveToState::update() { ai->setLocomotorGoalNone(); } - DEBUG_ASSERTLOG(!getMachine()->getWantsDebugOutput(), ("AIInternalMoveToState::update: reached end of path, exiting state with success\n")); + DEBUG_ASSERTLOG(!getMachine()->getWantsDebugOutput(), ("AIInternalMoveToState::update: reached end of path, exiting state with success")); return STATE_SUCCESS; } @@ -5275,7 +5275,7 @@ void AIAttackState::chooseWeapon() if (victim) { /*bool found =*/ source->chooseBestWeaponForTarget(victim, PREFER_MOST_DAMAGE, ai->getLastCommandSource()); - //DEBUG_ASSERTLOG(found, ("unable to autochoose any weapon for %s\n",source->getTemplate()->getName().str())); + //DEBUG_ASSERTLOG(found, ("unable to autochoose any weapon for %s",source->getTemplate()->getName().str())); } // Check if we need to update because of the weapon choice switch. diff --git a/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index fa8e4eedfc..6d1fc2977b 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -330,7 +330,7 @@ Bridge::Bridge(Object *bridgeObj) // save the template name m_templateName = bridgeObj->getTemplate()->getName(); - DEBUG_ASSERTLOG( bridgeObj->getGeometryInfo().getGeomType()==GEOMETRY_BOX, ("Bridges need to be rectangles.\n")); + DEBUG_ASSERTLOG( bridgeObj->getGeometryInfo().getGeomType()==GEOMETRY_BOX, ("Bridges need to be rectangles.")); const Coord3D *pos = bridgeObj->getPosition(); Real angle = bridgeObj->getOrientation(); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp index f6965ad887..133ae97fec 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp @@ -866,7 +866,7 @@ void Locomotor::locoUpdate_moveTowardsAngle(Object* obj, Real goalAngle) } #ifdef DEBUG_OBJECT_ID_EXISTS -// DEBUG_ASSERTLOG(obj->getID() != TheObjectIDToDebug, ("locoUpdate_moveTowardsAngle %f (%f deg), spd %f (%f)\n",goalAngle,goalAngle*180/PI,physics->getSpeed(),physics->getForwardSpeed2D())); +// DEBUG_ASSERTLOG(obj->getID() != TheObjectIDToDebug, ("locoUpdate_moveTowardsAngle %f (%f deg), spd %f (%f)",goalAngle,goalAngle*180/PI,physics->getSpeed(),physics->getForwardSpeed2D())); #endif Real minSpeed = getMinSpeed(); @@ -953,7 +953,7 @@ void Locomotor::locoUpdate_moveTowardsPosition(Object* obj, const Coord3D& goalP } #ifdef DEBUG_OBJECT_ID_EXISTS -// DEBUG_ASSERTLOG(obj->getID() != TheObjectIDToDebug, ("locoUpdate_moveTowardsPosition %f %f %f (dtg %f, spd %f), speed %f (%f)\n",goalPos.x,goalPos.y,goalPos.z,onPathDistToGoal,desiredSpeed,physics->getSpeed(),physics->getForwardSpeed2D())); +// DEBUG_ASSERTLOG(obj->getID() != TheObjectIDToDebug, ("locoUpdate_moveTowardsPosition %f %f %f (dtg %f, spd %f), speed %f (%f)",goalPos.x,goalPos.y,goalPos.z,onPathDistToGoal,desiredSpeed,physics->getSpeed(),physics->getForwardSpeed2D())); #endif // @@ -2334,7 +2334,7 @@ void Locomotor::moveTowardsPositionOther(Object* obj, PhysicsBehavior *physics, const Coord3D* pos = obj->getPosition(); Coord3D dirToApplyForce = *obj->getUnitDirectionVector2D(); -//DEBUG_ASSERTLOG(!getFlag(ULTRA_ACCURATE),("thresh %f %f (%f %f)\n", +//DEBUG_ASSERTLOG(!getFlag(ULTRA_ACCURATE),("thresh %f %f (%f %f)", //fabs(goalPos.y - pos->y),fabs(goalPos.x - pos->x), //fabs(goalPos.y - pos->y)/goalSpeed,fabs(goalPos.x - pos->x)/goalSpeed)); if (getFlag(ULTRA_ACCURATE) && @@ -2416,7 +2416,7 @@ Bool Locomotor::locoUpdate_maintainCurrentPosition(Object* obj) } #ifdef DEBUG_OBJECT_ID_EXISTS -// DEBUG_ASSERTLOG(obj->getID() != TheObjectIDToDebug, ("locoUpdate_maintainCurrentPosition %f %f %f, speed %f (%f)\n",m_maintainPos.x,m_maintainPos.y,m_maintainPos.z,physics->getSpeed(),physics->getForwardSpeed2D())); +// DEBUG_ASSERTLOG(obj->getID() != TheObjectIDToDebug, ("locoUpdate_maintainCurrentPosition %f %f %f, speed %f (%f)",m_maintainPos.x,m_maintainPos.y,m_maintainPos.z,physics->getSpeed(),physics->getForwardSpeed2D())); #endif Bool requiresConstantCalling = TRUE; // assume the worst. diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index 46a0331f05..f2e4572598 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -2450,7 +2450,7 @@ for (int ii = 0; ii < PartitionContactList_SOCKET_COUNT; ++ii) } } aggcount += 1.0f; -DEBUG_ASSERTLOG(((Int)aggcount)%1000!=0,("avg hash depth at %f is %f, fullness %f%%\n", +DEBUG_ASSERTLOG(((Int)aggcount)%1000!=0,("avg hash depth at %f is %f, fullness %f%%", aggcount,aggtotal/(aggcount*PartitionContactList_SOCKET_COUNT),(aggfull*100)/(aggcount*PartitionContactList_SOCKET_COUNT))); #endif @@ -2771,7 +2771,7 @@ void PartitionManager::update() ctList.processContactList(); #ifdef INTENSE_DEBUG - DEBUG_ASSERTLOG(cc==0,("updated partition info for %d objects\n",cc)); + DEBUG_ASSERTLOG(cc==0,("updated partition info for %d objects",cc)); #endif TheContactList = NULL; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 358bbe9df1..d5d5452874 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -2346,7 +2346,7 @@ Bool AIUpdateInterface::isDoingGroundMovement(void) const } // After all exceptions, we must be doing ground movement. - //DEBUG_ASSERTLOG(getObject()->isSignificantlyAboveTerrain(), ("Object %s is significantly airborne but also doing ground movement. What?\n",getObject()->getTemplate()->getName().str())); + //DEBUG_ASSERTLOG(getObject()->isSignificantlyAboveTerrain(), ("Object %s is significantly airborne but also doing ground movement. What?",getObject()->getTemplate()->getName().str())); return TRUE; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 6cb29e62d8..bd2b496ab2 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -772,7 +772,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate Coord3D victimPosStorage; if (victimObj) { - DEBUG_ASSERTLOG(sourceObj != victimObj, ("*** firing weapon at self -- is this really what you want?\n")); + DEBUG_ASSERTLOG(sourceObj != victimObj, ("*** firing weapon at self -- is this really what you want?")); victimPos = victimObj->getPosition(); victimID = victimObj->getID(); @@ -1330,7 +1330,7 @@ void WeaponTemplate::dealDamageInternal(ObjectID sourceID, ObjectID victimID, co } curVictim->attemptDamage(&damageInfo); - //DEBUG_ASSERTLOG(damageInfo.out.m_noEffect, ("WeaponTemplate::dealDamageInternal: dealt to %s %08lx: attempted %f, actual %f (%f)\n", + //DEBUG_ASSERTLOG(damageInfo.out.m_noEffect, ("WeaponTemplate::dealDamageInternal: dealt to %s %08lx: attempted %f, actual %f (%f)", // curVictim->getTemplate()->getName().str(),curVictim, // damageInfo.in.m_amount, damageInfo.out.m_actualDamageDealt, damageInfo.out.m_actualDamageClipped)); } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp index 4e1c78fd22..9e91d009d1 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp @@ -292,7 +292,7 @@ void WeaponSet::updateWeaponSet(const Object* obj) { if( ! set->isWeaponLockSharedAcrossSets() ) { - DEBUG_ASSERTLOG(!isCurWeaponLocked(), ("changing WeaponSet while Weapon is Locked... implicit unlock occurring!\n")); + DEBUG_ASSERTLOG(!isCurWeaponLocked(), ("changing WeaponSet while Weapon is Locked... implicit unlock occurring!")); releaseWeaponLock(LOCKED_PERMANENTLY); // release all locks. sorry! m_curWeapon = PRIMARY_WEAPON; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp index 3ce0e802fc..b550442367 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp @@ -1596,7 +1596,7 @@ void ScriptActions::doNamedFollowWaypoints(const AsciiString& unitName, const As return; } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.")); theUnit->leaveGroup(); aiUpdate->chooseLocomotorSet(LOCOMOTORSET_NORMAL); @@ -1623,7 +1623,7 @@ void ScriptActions::doNamedFollowWaypointsExact(const AsciiString& unitName, con return; } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.")); theUnit->leaveGroup(); aiUpdate->chooseLocomotorSet(LOCOMOTORSET_NORMAL); @@ -1688,7 +1688,7 @@ void ScriptActions::doTeamFollowSkirmishApproachPath(const AsciiString& teamName aiPlayer->checkBridges(firstUnit, way); } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, pathLabel), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, pathLabel), ("***Wrong waypoint purpose. Make jba fix this.")); if (asTeam) { theGroup->groupFollowWaypointPathAsTeam(way, CMD_FROM_SCRIPT); @@ -1745,7 +1745,7 @@ void ScriptActions::doTeamMoveToSkirmishApproachPath(const AsciiString& teamName if (!way) { return; } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, pathLabel), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, pathLabel), ("***Wrong waypoint purpose. Make jba fix this.")); theGroup->groupMoveToPosition(way->getLocation(), false, CMD_FROM_SCRIPT); } @@ -1791,7 +1791,7 @@ void ScriptActions::doTeamFollowWaypoints(const AsciiString& teamName, const Asc if (!way) { return; } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.")); if (asTeam) { theGroup->groupFollowWaypointPathAsTeam(way, CMD_FROM_SCRIPT); @@ -1842,7 +1842,7 @@ void ScriptActions::doTeamFollowWaypointsExact(const AsciiString& teamName, cons if (!way) { return; } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.")); if (asTeam) { theGroup->groupFollowWaypointPathAsTeamExact(way, CMD_FROM_SCRIPT); @@ -4495,7 +4495,7 @@ void ScriptActions::doNamedFireWeaponFollowingWaypointPath( const AsciiString& u { return; } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPath), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPath), ("***Wrong waypoint purpose. Make jba fix this.")); projectile->leaveGroup(); aiUpdate->chooseLocomotorSet(LOCOMOTORSET_NORMAL); diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp index 3259b10573..2c200d87c2 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp @@ -2557,9 +2557,9 @@ static void roomKeyChangedCallback(PEER peer, RoomType roomType, const char *nic DEBUG_ASSERTCRASH(nick && key && val, ("Bad values %X %X %X\n", nick, key, val)); if (!t || !nick || !key || !val) { - DEBUG_ASSERTLOG(!nick, ("nick = %s\n", nick)); - DEBUG_ASSERTLOG(!key, ("key = %s\n", key)); - DEBUG_ASSERTLOG(!val, ("val = %s\n", val)); + DEBUG_ASSERTLOG(!nick, ("nick = %s", nick)); + DEBUG_ASSERTLOG(!key, ("key = %s", key)); + DEBUG_ASSERTLOG(!val, ("val = %s", val)); return; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/Transport.cpp b/Generals/Code/GameEngine/Source/GameNetwork/Transport.cpp index 3f89cb19a5..883cb1d04e 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/Transport.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/Transport.cpp @@ -182,12 +182,12 @@ Bool Transport::update( void ) { retval = FALSE; } - DEBUG_ASSERTLOG(retval, ("WSA error is %s\n", GetWSAErrorString(WSAGetLastError()).str())); + DEBUG_ASSERTLOG(retval, ("WSA error is %s", GetWSAErrorString(WSAGetLastError()).str())); if (doSend() == FALSE && m_udpsock && m_udpsock->GetStatus() == UDP::ADDRNOTAVAIL) { retval = FALSE; } - DEBUG_ASSERTLOG(retval, ("WSA error is %s\n", GetWSAErrorString(WSAGetLastError()).str())); + DEBUG_ASSERTLOG(retval, ("WSA error is %s", GetWSAErrorString(WSAGetLastError()).str())); return retval; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/udp.cpp b/Generals/Code/GameEngine/Source/GameNetwork/udp.cpp index 9c68bc1039..f612893cf4 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/udp.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/udp.cpp @@ -255,7 +255,7 @@ Int UDP::Write(const unsigned char *msg,UnsignedInt len,UnsignedInt IP,UnsignedS #ifdef DEBUG_LOGGING static Int errCount = 0; #endif - DEBUG_ASSERTLOG(errCount++ > 100, ("UDP::Write() - WSA error is %s\n", GetWSAErrorString(WSAGetLastError()).str())); + DEBUG_ASSERTLOG(errCount++ > 100, ("UDP::Write() - WSA error is %s", GetWSAErrorString(WSAGetLastError()).str())); } #endif @@ -280,7 +280,7 @@ Int UDP::Read(unsigned char *msg,UnsignedInt len,sockaddr_in *from) #ifdef DEBUG_LOGGING static Int errCount = 0; #endif - DEBUG_ASSERTLOG(errCount++ > 100, ("UDP::Read() - WSA error is %s\n", GetWSAErrorString(WSAGetLastError()).str())); + DEBUG_ASSERTLOG(errCount++ > 100, ("UDP::Read() - WSA error is %s", GetWSAErrorString(WSAGetLastError()).str())); retval = -1; } else { retval = 0; @@ -301,7 +301,7 @@ Int UDP::Read(unsigned char *msg,UnsignedInt len,sockaddr_in *from) #ifdef DEBUG_LOGGING static Int errCount = 0; #endif - DEBUG_ASSERTLOG(errCount++ > 100, ("UDP::Read() - WSA error is %s\n", GetWSAErrorString(WSAGetLastError()).str())); + DEBUG_ASSERTLOG(errCount++ > 100, ("UDP::Read() - WSA error is %s", GetWSAErrorString(WSAGetLastError()).str())); retval = -1; } else { retval = 0; diff --git a/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp b/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp index e1ec6538cf..c465a43346 100644 --- a/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp +++ b/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp @@ -3151,7 +3151,7 @@ void *AudioFileCache::openFile( AudioEventRTS *eventToOpenFrom ) // Couldn't find the file, so actually open it. File *file = TheFileSystem->openFile(strToFind.str()); if (!file) { - DEBUG_ASSERTLOG(strToFind.isEmpty(), ("Missing Audio File: '%s'\n", strToFind.str())); + DEBUG_ASSERTLOG(strToFind.isEmpty(), ("Missing Audio File: '%s'", strToFind.str())); return NULL; } diff --git a/Generals/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp b/Generals/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp index 53dbbcfce1..291ea18004 100644 --- a/Generals/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp +++ b/Generals/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp @@ -231,7 +231,7 @@ VideoStreamInterface* BinkVideoPlayer::open( AsciiString movieTitle ) char filePath[ _MAX_PATH ]; sprintf( filePath, "%s%s\\%s.%s", TheGlobalData->m_modDir.str(), VIDEO_PATH, pVideo->m_filename.str(), VIDEO_EXT ); HBINK handle = BinkOpen(filePath , BINKPRELOADALL ); - DEBUG_ASSERTLOG(!handle, ("opened bink file %s\n", filePath)); + DEBUG_ASSERTLOG(!handle, ("opened bink file %s", filePath)); if (handle) { return createStream( handle ); @@ -241,13 +241,13 @@ VideoStreamInterface* BinkVideoPlayer::open( AsciiString movieTitle ) char localizedFilePath[ _MAX_PATH ]; sprintf( localizedFilePath, VIDEO_LANG_PATH_FORMAT, GetRegistryLanguage().str(), pVideo->m_filename.str(), VIDEO_EXT ); HBINK handle = BinkOpen(localizedFilePath , BINKPRELOADALL ); - DEBUG_ASSERTLOG(!handle, ("opened localized bink file %s\n", localizedFilePath)); + DEBUG_ASSERTLOG(!handle, ("opened localized bink file %s", localizedFilePath)); if (!handle) { char filePath[ _MAX_PATH ]; sprintf( filePath, "%s\\%s.%s", VIDEO_PATH, pVideo->m_filename.str(), VIDEO_EXT ); handle = BinkOpen(filePath , BINKPRELOADALL ); - DEBUG_ASSERTLOG(!handle, ("opened bink file %s\n", localizedFilePath)); + DEBUG_ASSERTLOG(!handle, ("opened bink file %s", localizedFilePath)); } DEBUG_LOG(("BinkVideoPlayer::createStream() - About to create stream")); diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 34a232dba0..7dc87bc293 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -2507,7 +2507,7 @@ void W3DModelDraw::handleClientRecoil() Matrix3D gunXfrm; gunXfrm.Make_Identity(); gunXfrm.Translate_X( -recoils[i].m_shift ); - //DEBUG_ASSERTLOG(recoils[i].m_shift==0.0f,("adjust bone %d by %f\n",recoils[i].m_recoilBone,recoils[i].m_shift)); + //DEBUG_ASSERTLOG(recoils[i].m_shift==0.0f,("adjust bone %d by %f",recoils[i].m_recoilBone,recoils[i].m_shift)); if (m_renderObject) { diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp index 6f839204dc..882753ab57 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp @@ -2976,7 +2976,7 @@ void W3DVolumetricShadow::constructVolumeVB( Vector3 *lightPosObject,Real shadow } } -// DEBUG_ASSERTLOG(polygonCount == vertexCount, ("WARNING***Shadow volume mesh not optimal: %s\n",m_geometry->Get_Name())); +// DEBUG_ASSERTLOG(polygonCount == vertexCount, ("WARNING***Shadow volume mesh not optimal: %s",m_geometry->Get_Name())); } // end constructVolume // allocateShadowVolume ======================================================= diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp index 02b32aa584..dbd92f2ffc 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp @@ -1375,9 +1375,9 @@ void W3DRoadBuffer::checkLinkBefore(Int ndx) Vector2 loc2 = m_roads[ndx].m_pt2.loc; #ifdef RTS_DEBUG - DEBUG_ASSERTLOG(m_roads[ndx].m_pt1.loc == m_roads[ndx+1].m_pt2.loc, ("Bad link\n")); + DEBUG_ASSERTLOG(m_roads[ndx].m_pt1.loc == m_roads[ndx+1].m_pt2.loc, ("Bad link")); if (ndx>0) { - DEBUG_ASSERTLOG(m_roads[ndx].m_pt2.loc != m_roads[ndx-1].m_pt1.loc, ("Bad Link\n")); + DEBUG_ASSERTLOG(m_roads[ndx].m_pt2.loc != m_roads[ndx-1].m_pt1.loc, ("Bad Link")); } #endif @@ -1392,7 +1392,7 @@ void W3DRoadBuffer::checkLinkBefore(Int ndx) while (checkNdx < m_numRoads) { if (m_roads[checkNdx].m_pt1.loc == loc2) { #ifdef RTS_DEBUG - DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt1.count==1, ("Bad count\n")); + DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt1.count==1, ("Bad count")); #endif moveRoadSegTo(checkNdx, ndx); loc2 = m_roads[ndx].m_pt2.loc; @@ -1403,7 +1403,7 @@ void W3DRoadBuffer::checkLinkBefore(Int ndx) if (m_roads[checkNdx].m_pt2.count!=1) { ::OutputDebugString("fooey.\n"); } - DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt2.count==1, ("Bad count\n")); + DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt2.count==1, ("Bad count")); #endif flipTheRoad(&m_roads[checkNdx]); moveRoadSegTo(checkNdx, ndx); @@ -1437,14 +1437,14 @@ void W3DRoadBuffer::checkLinkAfter(Int ndx) Vector2 loc1 = m_roads[ndx].m_pt1.loc; #ifdef RTS_DEBUG - DEBUG_ASSERTLOG(m_roads[ndx].m_pt2.loc == m_roads[ndx-1].m_pt1.loc, ("Bad link\n")); + DEBUG_ASSERTLOG(m_roads[ndx].m_pt2.loc == m_roads[ndx-1].m_pt1.loc, ("Bad link")); #endif Int checkNdx = ndx+1; while (checkNdx < m_numRoads && ndx < m_numRoads-1) { if (m_roads[checkNdx].m_pt2.loc == loc1) { #ifdef RTS_DEBUG - DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt2.count==1, ("Bad count\n")); + DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt2.count==1, ("Bad count")); #endif ndx++; moveRoadSegTo(checkNdx, ndx); @@ -1452,7 +1452,7 @@ void W3DRoadBuffer::checkLinkAfter(Int ndx) if (m_roads[ndx].m_pt1.count != 1) return; } else if (m_roads[checkNdx].m_pt1.loc == loc1) { #ifdef RTS_DEBUG - DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt1.count==1, ("Wrong m_pt1.count.\n")); + DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt1.count==1, ("Wrong m_pt1.count.")); if ( m_roads[checkNdx].m_pt1.count!=1) { ::OutputDebugString("Wrong m_pt1.count.\n"); } @@ -1575,7 +1575,7 @@ void W3DRoadBuffer::addMapObjects() if (pMapObj->getFlag(FLAG_ROAD_POINT1)) { pMapObj2 = pMapObj->getNext(); #ifdef RTS_DEBUG - DEBUG_ASSERTLOG(pMapObj2 && pMapObj2->getFlag(FLAG_ROAD_POINT2), ("Bad Flag\n")); + DEBUG_ASSERTLOG(pMapObj2 && pMapObj2->getFlag(FLAG_ROAD_POINT2), ("Bad Flag")); #endif if (pMapObj2==NULL) break; if (!pMapObj2->getFlag(FLAG_ROAD_POINT2)) continue; @@ -2676,13 +2676,13 @@ void W3DRoadBuffer::adjustStacking(Int topUniqueID, Int bottomUniqueID) for (i=0; i=m_maxRoadTypes) return; for (j=0; j=m_maxRoadTypes) return; if (m_roadTypes[i].getStacking() > m_roadTypes[j].getStacking()) { diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index 911ef313dd..a339ae84e4 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -448,7 +448,7 @@ void W3DView::setCameraTransform( void ) m_3DCamera->Set_Transform( cameraTransform ); calcCameraConstraints(); } - DEBUG_ASSERTLOG(m_cameraConstraintValid,("*** cam constraints are not valid!!!\n")); + DEBUG_ASSERTLOG(m_cameraConstraintValid,("*** cam constraints are not valid!!!")); if (m_cameraConstraintValid) { diff --git a/Generals/Code/Tools/WorldBuilder/src/CUndoable.cpp b/Generals/Code/Tools/WorldBuilder/src/CUndoable.cpp index 3ea61a9206..0e40890ddc 100644 --- a/Generals/Code/Tools/WorldBuilder/src/CUndoable.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/CUndoable.cpp @@ -724,7 +724,7 @@ m_pDoc(pDoc) // ensure the new setup is valid. (don't mess with the old one.) Bool modified = m_new.validateSides(); (void)modified; - DEBUG_ASSERTLOG(!modified,("*** had to clean up sides in SidesListUndoable! (caller should do this)\n")); + DEBUG_ASSERTLOG(!modified,("*** had to clean up sides in SidesListUndoable! (caller should do this)")); } SidesListUndoable::~SidesListUndoable() diff --git a/Generals/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp b/Generals/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp index 832ba04fd8..c498529636 100644 --- a/Generals/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp @@ -2665,7 +2665,7 @@ Bool WorldHeightMapEdit::adjustForTiling( TCliffInfo &cliffInfo, Real textureWid // Bool doOffset = false; Real offset; - DEBUG_ASSERTLOG(minU<-delta && maxU > delta, ("Oops, wrong.\n")) ; + DEBUG_ASSERTLOG(minU<-delta && maxU > delta, ("Oops, wrong.")) ; // Straddles the 0 line. if (maxU > -minU) { diff --git a/Generals/Code/Tools/WorldBuilder/src/mapobjectprops.cpp b/Generals/Code/Tools/WorldBuilder/src/mapobjectprops.cpp index f0503504c7..aa6198b184 100644 --- a/Generals/Code/Tools/WorldBuilder/src/mapobjectprops.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/mapobjectprops.cpp @@ -369,7 +369,7 @@ void MapObjectProps::_DictToTeam(void) if (name == NEUTRAL_TEAM_INTERNAL_STR) name = NEUTRAL_TEAM_UI_STR; i = owner->FindStringExact(-1, name.str()); - DEBUG_ASSERTLOG(i >= 0, ("missing team '%s'. Non-fatal (jkmcd)\n", name.str())); + DEBUG_ASSERTLOG(i >= 0, ("missing team '%s'. Non-fatal (jkmcd)", name.str())); } owner->SetCurSel(i); } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp index 9acb3a2257..ae27f11ad1 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp @@ -1098,7 +1098,7 @@ void AudioManager::releaseAudioEventRTS( AudioEventRTS *&eventToRelease ) //------------------------------------------------------------------------------------------------- void AudioManager::loseFocus( void ) { - DEBUG_ASSERTLOG(m_savedValues == NULL, ("AudioManager::loseFocus() - leak - jkmcd\n")); + DEBUG_ASSERTLOG(m_savedValues == NULL, ("AudioManager::loseFocus() - leak - jkmcd")); // In this case, make all the audio go silent. m_savedValues = NEW Real[NUM_VOLUME_TYPES]; m_savedValues[0] = m_systemMusicVolume; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp index 7ac92f098c..c7c5e83922 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RandomValue.cpp @@ -374,7 +374,7 @@ Real GameClientRandomVariable::getValue( void ) const switch( m_type ) { case CONSTANT: - DEBUG_ASSERTLOG(m_low == m_high, ("m_low != m_high for a CONSTANT GameClientRandomVariable\n")); + DEBUG_ASSERTLOG(m_low == m_high, ("m_low != m_high for a CONSTANT GameClientRandomVariable")); if (m_low == m_high) { return m_low; } // else return as though a UNIFORM. diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp index 26a1ccdbf6..70a7b5b4dd 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/ArchiveFileSystem.cpp @@ -189,7 +189,7 @@ void ArchiveFileSystem::loadMods() { Bool ret = #endif loadBigFilesFromDirectory(TheGlobalData->m_modDir, "*.big", TRUE); - DEBUG_ASSERTLOG(ret, ("loadBigFilesFromDirectory(%s) returned FALSE!\n", TheGlobalData->m_modDir.str())); + DEBUG_ASSERTLOG(ret, ("loadBigFilesFromDirectory(%s) returned FALSE!", TheGlobalData->m_modDir.str())); } } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp index 59360d66ae..d067e5f090 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp @@ -1249,7 +1249,7 @@ Bool BuildAssistant::isPossibleToMakeUnit( Object *builder, const ThingTemplate if( commandSet == NULL ) { - DEBUG_ASSERTLOG( 0, ("Can't build a '%s' from the builder '%s' because '%s' doesn't have any command set defined\n", + DEBUG_ASSERTLOG( 0, ("Can't build a '%s' from the builder '%s' because '%s' doesn't have any command set defined", whatToBuild->getName().str(), builder->getTemplate()->getName().str(), builder->getTemplate()->getName().str()) ); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp index 7582434492..437b184790 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -1067,7 +1067,7 @@ void ThingTemplate::validateAudio() #define AUDIO_TEST(y) \ if (!get##y()->getEventName().isEmpty() && get##y()->getEventName().compareNoCase("NoSound") != 0) { \ - DEBUG_ASSERTLOG(TheAudio->isValidAudioEvent(get##y()), ("Invalid Sound '%s' in Object '%s'. (%s?)\n", #y, getName().str(), get##y()->getEventName().str())); \ + DEBUG_ASSERTLOG(TheAudio->isValidAudioEvent(get##y()), ("Invalid Sound '%s' in Object '%s'. (%s?)", #y, getName().str(), get##y()->getEventName().str())); \ } AUDIO_TEST(VoiceSelect) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp index 6da57cd91d..2763ef0423 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp @@ -1292,7 +1292,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com // changed this to Log rather than Crash, because this can legitimately happen now for // dozers and workers with mine-clearing stuff... (srj) - //DEBUG_ASSERTLOG( w, ("Unit %s's CommandButton %s is trying to access weaponslot %d, but doesn't have a weapon there in its FactionUnit ini entry.\n", + //DEBUG_ASSERTLOG( w, ("Unit %s's CommandButton %s is trying to access weaponslot %d, but doesn't have a weapon there in its FactionUnit ini entry.", // obj->getTemplate()->getName().str(), command->getName().str(), (Int)command->getWeaponSlot() ) ); UnsignedInt now = TheGameLogic->getFrame(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp index 345ad7576f..56d94758a9 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp @@ -800,7 +800,7 @@ static GameWindow* findWindow(GameWindow *parent, AsciiString baseWindow, AsciiS AsciiString fullPath; fullPath.format("%s:%s", baseWindow.str(), gadgetName.str()); GameWindow *res = TheWindowManager->winGetWindowFromId(parent, NAMEKEY(fullPath)); - DEBUG_ASSERTLOG(res, ("Cannot find window %s\n", fullPath.str())); + DEBUG_ASSERTLOG(res, ("Cannot find window %s", fullPath.str())); return res; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp index c1285e2b8c..d59691e501 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp @@ -2035,9 +2035,9 @@ void WOLGameSetupMenuUpdate( WindowLayout * layout, void *userData) #ifdef DEBUG_LOGGING UnsignedShort newPort = game->getConstSlot(i)->getPort(); UnsignedInt newIP = game->getConstSlot(i)->getIP(); - DEBUG_ASSERTLOG(newIP == ips[i], ("IP was different for player %d (%X --> %X)\n", + DEBUG_ASSERTLOG(newIP == ips[i], ("IP was different for player %d (%X --> %X)", i, ips[i], newIP)); - DEBUG_ASSERTLOG(newPort == ports[i], ("Port was different for player %d (%d --> %d)\n", + DEBUG_ASSERTLOG(newPort == ports[i], ("Port was different for player %d (%d --> %d)", i, ports[i], newPort)); #endif game->getSlot(i)->setPort(ports[i]); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index b6c1a474dc..10ba1a970b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -421,7 +421,7 @@ const Image* LookupSmallRankImage(Int side, Int rankPoints) AsciiString fullImageName; fullImageName.format("%s-%s", rankNames[rank], sideStr.str()); const Image *img = TheMappedImageCollection->findImageByName(fullImageName); - DEBUG_ASSERTLOG(img, ("*** Could not load small rank image '%s' from TheMappedImageCollection!\n", fullImageName.str())); + DEBUG_ASSERTLOG(img, ("*** Could not load small rank image '%s' from TheMappedImageCollection!", fullImageName.str())); return img; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp index 4997ac49af..31943c14c5 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp @@ -2229,7 +2229,7 @@ Int GadgetListBoxAddEntryText( GameWindow *listbox, /// @TODO: Don't do this type cast! index = (Int) TheWindowManager->winSendSystemMsg( listbox, GLM_ADD_ENTRY, (WindowMsgData)&addInfo, color ); - //DEBUG_ASSERTLOG(!listData->scrollIfAtEnd, ("Adding line %d (orig end was %d, newEntryOffset is %d, (%d-%d)?=%d, isFull=%d/%d ll=%d, end=%d\n", + //DEBUG_ASSERTLOG(!listData->scrollIfAtEnd, ("Adding line %d (orig end was %d, newEntryOffset is %d, (%d-%d)?=%d, isFull=%d/%d ll=%d, end=%d", //index, oldBottomIndex, newEntryOffset, index, oldBottomIndex, newEntryOffset, wasFull, GadgetListBoxIsFull(listbox), listData->listLength, listData->endPos)); if(listData->scrollIfAtEnd && index - oldBottomIndex == newEntryOffset && GadgetListBoxIsFull(listbox)) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp index b7747fc379..e2829d259f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp @@ -313,7 +313,7 @@ Particle::Particle( ParticleSystem *system, const ParticleInfo *info ) // add this particle to the Particle System list, retaining local creation order m_system->addParticle(this); - //DEBUG_ASSERTLOG(!(totalParticleCount % 100 == 0), ( "TotalParticleCount = %d\n", m_totalParticleCount )); + //DEBUG_ASSERTLOG(!(totalParticleCount % 100 == 0), ( "TotalParticleCount = %d", m_totalParticleCount )); } // ------------------------------------------------------------------------------------------------ @@ -335,7 +335,7 @@ Particle::~Particle() // remove from the global list TheParticleSystemManager->removeParticle(this); - //DEBUG_ASSERTLOG(!(totalParticleCount % 100 == 0), ( "TotalParticleCount = %d\n", m_totalParticleCount )); + //DEBUG_ASSERTLOG(!(totalParticleCount % 100 == 0), ( "TotalParticleCount = %d", m_totalParticleCount )); } // ------------------------------------------------------------------------------------------------ @@ -1178,7 +1178,7 @@ ParticleSystem::ParticleSystem( const ParticleSystemTemplate *sysTemplate, TheParticleSystemManager->friend_addParticleSystem(this); - //DEBUG_ASSERTLOG(!(m_totalParticleSystemCount % 10 == 0), ( "TotalParticleSystemCount = %d\n", m_totalParticleSystemCount )); + //DEBUG_ASSERTLOG(!(m_totalParticleSystemCount % 10 == 0), ( "TotalParticleSystemCount = %d", m_totalParticleSystemCount )); } // ------------------------------------------------------------------------------------------------ @@ -1222,7 +1222,7 @@ ParticleSystem::~ParticleSystem() m_controlParticle = NULL; TheParticleSystemManager->friend_removeParticleSystem(this); - //DEBUG_ASSERTLOG(!(m_totalParticleSystemCount % 10 == 0), ( "TotalParticleSystemCount = %d\n", m_totalParticleSystemCount )); + //DEBUG_ASSERTLOG(!(m_totalParticleSystemCount % 10 == 0), ( "TotalParticleSystemCount = %d", m_totalParticleSystemCount )); } // ------------------------------------------------------------------------------------------------ diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index 731c705ac7..4d485cd6bb 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -5656,7 +5656,7 @@ Bool Pathfinder::queueForPath(ObjectID id) AIUpdateInterface *tmpAI = tmpObj->getAIUpdateInterface(); if (tmpAI) { const Coord3D* pos = tmpAI->friend_getRequestedDestination(); - DEBUG_ASSERTLOG(pos->x != 0.0 && pos->y != 0.0, ("Queueing pathfind to (0, 0), usually a bug. (Unit Name: '%s', Type: '%s' \n", tmpObj->getName().str(), tmpObj->getTemplate()->getName().str())); + DEBUG_ASSERTLOG(pos->x != 0.0 && pos->y != 0.0, ("Queueing pathfind to (0, 0), usually a bug. (Unit Name: '%s', Type: '%s' ", tmpObj->getName().str(), tmpObj->getTemplate()->getName().str())); } } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp index 213613e32a..025f107a98 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp @@ -1087,7 +1087,7 @@ void AISkirmishPlayer::newMap( void ) } build = build->m_next; } - DEBUG_ASSERTLOG(build!=NULL, ("Couldn't find build list for skirmish player.\n")); + DEBUG_ASSERTLOG(build!=NULL, ("Couldn't find build list for skirmish player.")); // Build any with the initially built flag. for( BuildListInfo *info = m_player->getBuildList(); info; info = info->getNext() ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp index f664ccc0f6..1b26fbd29e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp @@ -1741,7 +1741,7 @@ void AIInternalMoveToState::onExit( StateExitType status ) // (This is why destructors should not do game logic) if (ai) { ai->friend_endingMove(); - DEBUG_ASSERTLOG(obj->getTeam(), ("AIInternalMoveToState::onExit obj has NULL team.\n")); + DEBUG_ASSERTLOG(obj->getTeam(), ("AIInternalMoveToState::onExit obj has NULL team.")); if (obj->getTeam() && ai->isDoingGroundMovement() && ai->getCurLocomotor() && ai->getCurLocomotor()->isUltraAccurate()) { Real dx = m_goalPosition.x-obj->getPosition()->x; @@ -1926,7 +1926,7 @@ StateReturnType AIInternalMoveToState::update() { ai->setLocomotorGoalNone(); } - DEBUG_ASSERTLOG(!getMachine()->getWantsDebugOutput(), ("AIInternalMoveToState::update: reached end of path, exiting state with success\n")); + DEBUG_ASSERTLOG(!getMachine()->getWantsDebugOutput(), ("AIInternalMoveToState::update: reached end of path, exiting state with success")); //Kris: 7/01/03 (Temporary debug hook for units not being able to leave maps) if( blah ) { @@ -5471,7 +5471,7 @@ Bool AIAttackState::chooseWeapon() // if (victim) // Pardon? We still need to pick a weapon if we are attacking the ground. // { found = source->chooseBestWeaponForTarget(victim, PREFER_MOST_DAMAGE, ai->getLastCommandSource()); - //DEBUG_ASSERTLOG(found, ("unable to autochoose any weapon for %s\n",source->getTemplate()->getName().str())); + //DEBUG_ASSERTLOG(found, ("unable to autochoose any weapon for %s",source->getTemplate()->getName().str())); // } // Check if we need to update because of the weapon choice switch. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index be9b11c42b..6a550f0289 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -330,7 +330,7 @@ Bridge::Bridge(Object *bridgeObj) // save the template name m_templateName = bridgeObj->getTemplate()->getName(); - DEBUG_ASSERTLOG( bridgeObj->getGeometryInfo().getGeomType()==GEOMETRY_BOX, ("Bridges need to be rectangles.\n")); + DEBUG_ASSERTLOG( bridgeObj->getGeometryInfo().getGeomType()==GEOMETRY_BOX, ("Bridges need to be rectangles.")); const Coord3D *pos = bridgeObj->getPosition(); Real angle = bridgeObj->getOrientation(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp index b4f4c5462c..6145c55afa 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp @@ -884,7 +884,7 @@ void Locomotor::locoUpdate_moveTowardsAngle(Object* obj, Real goalAngle) } #ifdef DEBUG_OBJECT_ID_EXISTS -// DEBUG_ASSERTLOG(obj->getID() != TheObjectIDToDebug, ("locoUpdate_moveTowardsAngle %f (%f deg), spd %f (%f)\n",goalAngle,goalAngle*180/PI,physics->getSpeed(),physics->getForwardSpeed2D())); +// DEBUG_ASSERTLOG(obj->getID() != TheObjectIDToDebug, ("locoUpdate_moveTowardsAngle %f (%f deg), spd %f (%f)",goalAngle,goalAngle*180/PI,physics->getSpeed(),physics->getForwardSpeed2D())); #endif Real minSpeed = getMinSpeed(); @@ -977,7 +977,7 @@ void Locomotor::locoUpdate_moveTowardsPosition(Object* obj, const Coord3D& goalP } #ifdef DEBUG_OBJECT_ID_EXISTS -// DEBUG_ASSERTLOG(obj->getID() != TheObjectIDToDebug, ("locoUpdate_moveTowardsPosition %f %f %f (dtg %f, spd %f), speed %f (%f)\n",goalPos.x,goalPos.y,goalPos.z,onPathDistToGoal,desiredSpeed,physics->getSpeed(),physics->getForwardSpeed2D())); +// DEBUG_ASSERTLOG(obj->getID() != TheObjectIDToDebug, ("locoUpdate_moveTowardsPosition %f %f %f (dtg %f, spd %f), speed %f (%f)",goalPos.x,goalPos.y,goalPos.z,onPathDistToGoal,desiredSpeed,physics->getSpeed(),physics->getForwardSpeed2D())); #endif // @@ -2364,7 +2364,7 @@ void Locomotor::moveTowardsPositionOther(Object* obj, PhysicsBehavior *physics, const Coord3D* pos = obj->getPosition(); Coord3D dirToApplyForce = *obj->getUnitDirectionVector2D(); -//DEBUG_ASSERTLOG(!getFlag(ULTRA_ACCURATE),("thresh %f %f (%f %f)\n", +//DEBUG_ASSERTLOG(!getFlag(ULTRA_ACCURATE),("thresh %f %f (%f %f)", //fabs(goalPos.y - pos->y),fabs(goalPos.x - pos->x), //fabs(goalPos.y - pos->y)/goalSpeed,fabs(goalPos.x - pos->x)/goalSpeed)); if (getFlag(ULTRA_ACCURATE) && @@ -2446,7 +2446,7 @@ Bool Locomotor::locoUpdate_maintainCurrentPosition(Object* obj) } #ifdef DEBUG_OBJECT_ID_EXISTS -// DEBUG_ASSERTLOG(obj->getID() != TheObjectIDToDebug, ("locoUpdate_maintainCurrentPosition %f %f %f, speed %f (%f)\n",m_maintainPos.x,m_maintainPos.y,m_maintainPos.z,physics->getSpeed(),physics->getForwardSpeed2D())); +// DEBUG_ASSERTLOG(obj->getID() != TheObjectIDToDebug, ("locoUpdate_maintainCurrentPosition %f %f %f, speed %f (%f)",m_maintainPos.x,m_maintainPos.y,m_maintainPos.z,physics->getSpeed(),physics->getForwardSpeed2D())); #endif Bool requiresConstantCalling = TRUE; // assume the worst. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index b67eab3066..25f50525c3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -2457,7 +2457,7 @@ for (int ii = 0; ii < PartitionContactList_SOCKET_COUNT; ++ii) } } aggcount += 1.0f; -DEBUG_ASSERTLOG(((Int)aggcount)%1000!=0,("avg hash depth at %f is %f, fullness %f%%\n", +DEBUG_ASSERTLOG(((Int)aggcount)%1000!=0,("avg hash depth at %f is %f, fullness %f%%", aggcount,aggtotal/(aggcount*PartitionContactList_SOCKET_COUNT),(aggfull*100)/(aggcount*PartitionContactList_SOCKET_COUNT))); #endif @@ -2778,7 +2778,7 @@ void PartitionManager::update() ctList.processContactList(); #ifdef INTENSE_DEBUG - DEBUG_ASSERTLOG(cc==0,("updated partition info for %d objects\n",cc)); + DEBUG_ASSERTLOG(cc==0,("updated partition info for %d objects",cc)); #endif TheContactList = NULL; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 5bd9001661..0c54f474ec 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -2395,7 +2395,7 @@ Bool AIUpdateInterface::isDoingGroundMovement(void) const } // After all exceptions, we must be doing ground movement. - //DEBUG_ASSERTLOG(getObject()->isSignificantlyAboveTerrain(), ("Object %s is significantly airborne but also doing ground movement. What?\n",getObject()->getTemplate()->getName().str())); + //DEBUG_ASSERTLOG(getObject()->isSignificantlyAboveTerrain(), ("Object %s is significantly airborne but also doing ground movement. What?",getObject()->getTemplate()->getName().str())); return TRUE; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 4d16771846..973e50d2b6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -803,7 +803,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate Coord3D victimPosStorage; if (victimObj) { - DEBUG_ASSERTLOG(sourceObj != victimObj, ("*** firing weapon at self -- is this really what you want?\n")); + DEBUG_ASSERTLOG(sourceObj != victimObj, ("*** firing weapon at self -- is this really what you want?")); victimPos = victimObj->getPosition(); victimID = victimObj->getID(); @@ -1476,7 +1476,7 @@ void WeaponTemplate::dealDamageInternal(ObjectID sourceID, ObjectID victimID, co } curVictim->attemptDamage(&damageInfo); - //DEBUG_ASSERTLOG(damageInfo.out.m_noEffect, ("WeaponTemplate::dealDamageInternal: dealt to %s %08lx: attempted %f, actual %f (%f)\n", + //DEBUG_ASSERTLOG(damageInfo.out.m_noEffect, ("WeaponTemplate::dealDamageInternal: dealt to %s %08lx: attempted %f, actual %f (%f)", // curVictim->getTemplate()->getName().str(),curVictim, // damageInfo.in.m_amount, damageInfo.out.m_actualDamageDealt, damageInfo.out.m_actualDamageClipped)); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp index 7028218963..c616e325d9 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp @@ -300,7 +300,7 @@ void WeaponSet::updateWeaponSet(const Object* obj) { if( ! set->isWeaponLockSharedAcrossSets() ) { - DEBUG_ASSERTLOG(!isCurWeaponLocked(), ("changing WeaponSet while Weapon is Locked... implicit unlock occurring!\n")); + DEBUG_ASSERTLOG(!isCurWeaponLocked(), ("changing WeaponSet while Weapon is Locked... implicit unlock occurring!")); releaseWeaponLock(LOCKED_PERMANENTLY); // release all locks. sorry! m_curWeapon = PRIMARY_WEAPON; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp index 2e2d717ab3..d983d71a06 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp @@ -1666,7 +1666,7 @@ void ScriptActions::doNamedFollowWaypoints(const AsciiString& unitName, const As return; } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.")); theUnit->leaveGroup(); aiUpdate->chooseLocomotorSet(LOCOMOTORSET_NORMAL); @@ -1693,7 +1693,7 @@ void ScriptActions::doNamedFollowWaypointsExact(const AsciiString& unitName, con return; } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.")); theUnit->leaveGroup(); aiUpdate->chooseLocomotorSet(LOCOMOTORSET_NORMAL); @@ -1758,7 +1758,7 @@ void ScriptActions::doTeamFollowSkirmishApproachPath(const AsciiString& teamName aiPlayer->checkBridges(firstUnit, way); } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, pathLabel), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, pathLabel), ("***Wrong waypoint purpose. Make jba fix this.")); if (asTeam) { theGroup->groupFollowWaypointPathAsTeam(way, CMD_FROM_SCRIPT); @@ -1815,7 +1815,7 @@ void ScriptActions::doTeamMoveToSkirmishApproachPath(const AsciiString& teamName if (!way) { return; } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, pathLabel), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, pathLabel), ("***Wrong waypoint purpose. Make jba fix this.")); theGroup->groupMoveToPosition(way->getLocation(), false, CMD_FROM_SCRIPT); } @@ -1861,7 +1861,7 @@ void ScriptActions::doTeamFollowWaypoints(const AsciiString& teamName, const Asc if (!way) { return; } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.")); if (asTeam) { theGroup->groupFollowWaypointPathAsTeam(way, CMD_FROM_SCRIPT); @@ -1912,7 +1912,7 @@ void ScriptActions::doTeamFollowWaypointsExact(const AsciiString& teamName, cons if (!way) { return; } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPathLabel), ("***Wrong waypoint purpose. Make jba fix this.")); if (asTeam) { theGroup->groupFollowWaypointPathAsTeamExact(way, CMD_FROM_SCRIPT); @@ -4826,7 +4826,7 @@ void ScriptActions::doNamedFireWeaponFollowingWaypointPath( const AsciiString& u { return; } - DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPath), ("***Wrong waypoint purpose. Make jba fix this.\n")); + DEBUG_ASSERTLOG(TheTerrainLogic->isPurposeOfPath(way, waypointPath), ("***Wrong waypoint purpose. Make jba fix this.")); projectile->leaveGroup(); aiUpdate->chooseLocomotorSet(LOCOMOTORSET_NORMAL); @@ -6218,7 +6218,7 @@ void ScriptActions::doC3CameraShake ) { Waypoint *way = TheTerrainLogic->getWaypointByName(waypointName); - DEBUG_ASSERTLOG( (way != NULL), ("Camera shake with No Valid Waypoint\n") ); + DEBUG_ASSERTLOG( (way != NULL), ("Camera shake with No Valid Waypoint") ); Coord3D pos = *way->getLocation(); TheTacticalView->Add_Camera_Shake(pos, radius, duration_seconds, amplitude); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp index 4ad815aba4..6c098861a7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/Transport.cpp @@ -182,12 +182,12 @@ Bool Transport::update( void ) { retval = FALSE; } - DEBUG_ASSERTLOG(retval, ("WSA error is %s\n", GetWSAErrorString(WSAGetLastError()).str())); + DEBUG_ASSERTLOG(retval, ("WSA error is %s", GetWSAErrorString(WSAGetLastError()).str())); if (doSend() == FALSE && m_udpsock && m_udpsock->GetStatus() == UDP::ADDRNOTAVAIL) { retval = FALSE; } - DEBUG_ASSERTLOG(retval, ("WSA error is %s\n", GetWSAErrorString(WSAGetLastError()).str())); + DEBUG_ASSERTLOG(retval, ("WSA error is %s", GetWSAErrorString(WSAGetLastError()).str())); return retval; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/udp.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/udp.cpp index 595a07f72f..25f6846d15 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/udp.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/udp.cpp @@ -255,7 +255,7 @@ Int UDP::Write(const unsigned char *msg,UnsignedInt len,UnsignedInt IP,UnsignedS #ifdef DEBUG_LOGGING static Int errCount = 0; #endif - DEBUG_ASSERTLOG(errCount++ > 100, ("UDP::Write() - WSA error is %s\n", GetWSAErrorString(WSAGetLastError()).str())); + DEBUG_ASSERTLOG(errCount++ > 100, ("UDP::Write() - WSA error is %s", GetWSAErrorString(WSAGetLastError()).str())); } #endif @@ -280,7 +280,7 @@ Int UDP::Read(unsigned char *msg,UnsignedInt len,sockaddr_in *from) #ifdef DEBUG_LOGGING static Int errCount = 0; #endif - DEBUG_ASSERTLOG(errCount++ > 100, ("UDP::Read() - WSA error is %s\n", GetWSAErrorString(WSAGetLastError()).str())); + DEBUG_ASSERTLOG(errCount++ > 100, ("UDP::Read() - WSA error is %s", GetWSAErrorString(WSAGetLastError()).str())); retval = -1; } else { retval = 0; @@ -301,7 +301,7 @@ Int UDP::Read(unsigned char *msg,UnsignedInt len,sockaddr_in *from) #ifdef DEBUG_LOGGING static Int errCount = 0; #endif - DEBUG_ASSERTLOG(errCount++ > 100, ("UDP::Read() - WSA error is %s\n", GetWSAErrorString(WSAGetLastError()).str())); + DEBUG_ASSERTLOG(errCount++ > 100, ("UDP::Read() - WSA error is %s", GetWSAErrorString(WSAGetLastError()).str())); retval = -1; } else { retval = 0; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp index 31a898b73f..a8ba598148 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp @@ -3151,7 +3151,7 @@ void *AudioFileCache::openFile( AudioEventRTS *eventToOpenFrom ) // Couldn't find the file, so actually open it. File *file = TheFileSystem->openFile(strToFind.str()); if (!file) { - DEBUG_ASSERTLOG(strToFind.isEmpty(), ("Missing Audio File: '%s'\n", strToFind.str())); + DEBUG_ASSERTLOG(strToFind.isEmpty(), ("Missing Audio File: '%s'", strToFind.str())); return NULL; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp index d8db8eee18..9cd7f34dee 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/Bink/BinkVideoPlayer.cpp @@ -231,7 +231,7 @@ VideoStreamInterface* BinkVideoPlayer::open( AsciiString movieTitle ) char filePath[ _MAX_PATH ]; sprintf( filePath, "%s%s\\%s.%s", TheGlobalData->m_modDir.str(), VIDEO_PATH, pVideo->m_filename.str(), VIDEO_EXT ); HBINK handle = BinkOpen(filePath , BINKPRELOADALL ); - DEBUG_ASSERTLOG(!handle, ("opened bink file %s\n", filePath)); + DEBUG_ASSERTLOG(!handle, ("opened bink file %s", filePath)); if (handle) { return createStream( handle ); @@ -241,13 +241,13 @@ VideoStreamInterface* BinkVideoPlayer::open( AsciiString movieTitle ) char localizedFilePath[ _MAX_PATH ]; sprintf( localizedFilePath, VIDEO_LANG_PATH_FORMAT, GetRegistryLanguage().str(), pVideo->m_filename.str(), VIDEO_EXT ); HBINK handle = BinkOpen(localizedFilePath , BINKPRELOADALL ); - DEBUG_ASSERTLOG(!handle, ("opened localized bink file %s\n", localizedFilePath)); + DEBUG_ASSERTLOG(!handle, ("opened localized bink file %s", localizedFilePath)); if (!handle) { char filePath[ _MAX_PATH ]; sprintf( filePath, "%s\\%s.%s", VIDEO_PATH, pVideo->m_filename.str(), VIDEO_EXT ); handle = BinkOpen(filePath , BINKPRELOADALL ); - DEBUG_ASSERTLOG(!handle, ("opened bink file %s\n", localizedFilePath)); + DEBUG_ASSERTLOG(!handle, ("opened bink file %s", localizedFilePath)); } DEBUG_LOG(("BinkVideoPlayer::createStream() - About to create stream")); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp index ce2d57b9dd..2e1dbc37a4 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp @@ -237,7 +237,7 @@ VideoStreamInterface* FFmpegVideoPlayer::open( AsciiString movieTitle ) char filePath[ _MAX_PATH ]; sprintf( filePath, "%s%s\\%s.%s", TheGlobalData->m_modDir.str(), VIDEO_PATH, pVideo->m_filename.str(), VIDEO_EXT ); File* file = TheFileSystem->openFile(filePath); - DEBUG_ASSERTLOG(!file, ("opened bink file %s\n", filePath)); + DEBUG_ASSERTLOG(!file, ("opened bink file %s", filePath)); if (file) { return createStream( file ); @@ -247,13 +247,13 @@ VideoStreamInterface* FFmpegVideoPlayer::open( AsciiString movieTitle ) char localizedFilePath[ _MAX_PATH ]; sprintf( localizedFilePath, VIDEO_LANG_PATH_FORMAT, GetRegistryLanguage().str(), pVideo->m_filename.str(), VIDEO_EXT ); File* file = TheFileSystem->openFile(localizedFilePath); - DEBUG_ASSERTLOG(!file, ("opened localized bink file %s\n", localizedFilePath)); + DEBUG_ASSERTLOG(!file, ("opened localized bink file %s", localizedFilePath)); if (!file) { char filePath[ _MAX_PATH ]; sprintf( filePath, "%s\\%s.%s", VIDEO_PATH, pVideo->m_filename.str(), VIDEO_EXT ); file = TheFileSystem->openFile(filePath); - DEBUG_ASSERTLOG(!file, ("opened bink file %s\n", filePath)); + DEBUG_ASSERTLOG(!file, ("opened bink file %s", filePath)); } DEBUG_LOG(("FFmpegVideoPlayer::createStream() - About to create stream")); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 025ae6846d..46914da020 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -2552,7 +2552,7 @@ void W3DModelDraw::handleClientRecoil() Matrix3D gunXfrm; gunXfrm.Make_Identity(); gunXfrm.Translate_X( -recoils[i].m_shift ); - //DEBUG_ASSERTLOG(recoils[i].m_shift==0.0f,("adjust bone %d by %f\n",recoils[i].m_recoilBone,recoils[i].m_shift)); + //DEBUG_ASSERTLOG(recoils[i].m_shift==0.0f,("adjust bone %d by %f",recoils[i].m_recoilBone,recoils[i].m_shift)); if (m_renderObject) { diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp index 7445bc7286..545b0d1da2 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp @@ -3120,7 +3120,7 @@ void W3DVolumetricShadow::constructVolumeVB( Vector3 *lightPosObject,Real shadow } } -// DEBUG_ASSERTLOG(polygonCount == vertexCount, ("WARNING***Shadow volume mesh not optimal: %s\n",m_geometry->Get_Name())); +// DEBUG_ASSERTLOG(polygonCount == vertexCount, ("WARNING***Shadow volume mesh not optimal: %s",m_geometry->Get_Name())); } // end constructVolume // allocateShadowVolume ======================================================= diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp index 1ca606d719..5e9fde9a15 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp @@ -1399,9 +1399,9 @@ void W3DRoadBuffer::checkLinkBefore(Int ndx) Vector2 loc2 = m_roads[ndx].m_pt2.loc; #ifdef RTS_DEBUG - DEBUG_ASSERTLOG(m_roads[ndx].m_pt1.loc == m_roads[ndx+1].m_pt2.loc, ("Bad link\n")); + DEBUG_ASSERTLOG(m_roads[ndx].m_pt1.loc == m_roads[ndx+1].m_pt2.loc, ("Bad link")); if (ndx>0) { - DEBUG_ASSERTLOG(m_roads[ndx].m_pt2.loc != m_roads[ndx-1].m_pt1.loc, ("Bad Link\n")); + DEBUG_ASSERTLOG(m_roads[ndx].m_pt2.loc != m_roads[ndx-1].m_pt1.loc, ("Bad Link")); } #endif @@ -1416,7 +1416,7 @@ void W3DRoadBuffer::checkLinkBefore(Int ndx) while (checkNdx < m_numRoads) { if (m_roads[checkNdx].m_pt1.loc == loc2) { #ifdef RTS_DEBUG - DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt1.count==1, ("Bad count\n")); + DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt1.count==1, ("Bad count")); #endif moveRoadSegTo(checkNdx, ndx); loc2 = m_roads[ndx].m_pt2.loc; @@ -1427,7 +1427,7 @@ void W3DRoadBuffer::checkLinkBefore(Int ndx) if (m_roads[checkNdx].m_pt2.count!=1) { ::OutputDebugString("fooey.\n"); } - DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt2.count==1, ("Bad count\n")); + DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt2.count==1, ("Bad count")); #endif flipTheRoad(&m_roads[checkNdx]); moveRoadSegTo(checkNdx, ndx); @@ -1461,14 +1461,14 @@ void W3DRoadBuffer::checkLinkAfter(Int ndx) Vector2 loc1 = m_roads[ndx].m_pt1.loc; #ifdef RTS_DEBUG - DEBUG_ASSERTLOG(m_roads[ndx].m_pt2.loc == m_roads[ndx-1].m_pt1.loc, ("Bad link\n")); + DEBUG_ASSERTLOG(m_roads[ndx].m_pt2.loc == m_roads[ndx-1].m_pt1.loc, ("Bad link")); #endif Int checkNdx = ndx+1; while (checkNdx < m_numRoads && ndx < m_numRoads-1) { if (m_roads[checkNdx].m_pt2.loc == loc1) { #ifdef RTS_DEBUG - DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt2.count==1, ("Bad count\n")); + DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt2.count==1, ("Bad count")); #endif ndx++; moveRoadSegTo(checkNdx, ndx); @@ -1476,7 +1476,7 @@ void W3DRoadBuffer::checkLinkAfter(Int ndx) if (m_roads[ndx].m_pt1.count != 1) return; } else if (m_roads[checkNdx].m_pt1.loc == loc1) { #ifdef RTS_DEBUG - DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt1.count==1, ("Wrong m_pt1.count.\n")); + DEBUG_ASSERTLOG(m_roads[checkNdx].m_pt1.count==1, ("Wrong m_pt1.count.")); if ( m_roads[checkNdx].m_pt1.count!=1) { ::OutputDebugString("Wrong m_pt1.count.\n"); } @@ -1599,7 +1599,7 @@ void W3DRoadBuffer::addMapObjects() if (pMapObj->getFlag(FLAG_ROAD_POINT1)) { pMapObj2 = pMapObj->getNext(); #ifdef RTS_DEBUG - DEBUG_ASSERTLOG(pMapObj2 && pMapObj2->getFlag(FLAG_ROAD_POINT2), ("Bad Flag\n")); + DEBUG_ASSERTLOG(pMapObj2 && pMapObj2->getFlag(FLAG_ROAD_POINT2), ("Bad Flag")); #endif if (pMapObj2==NULL) break; if (!pMapObj2->getFlag(FLAG_ROAD_POINT2)) continue; @@ -2700,13 +2700,13 @@ void W3DRoadBuffer::adjustStacking(Int topUniqueID, Int bottomUniqueID) for (i=0; i=m_maxRoadTypes) return; for (j=0; j=m_maxRoadTypes) return; if (m_roadTypes[i].getStacking() > m_roadTypes[j].getStacking()) { diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index a95383ff32..8b8b84178d 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -592,7 +592,7 @@ void W3DView::setCameraTransform( void ) m_3DCamera->Set_Transform( cameraTransform ); calcCameraConstraints(); } - DEBUG_ASSERTLOG(m_cameraConstraintValid,("*** cam constraints are not valid!!!\n")); + DEBUG_ASSERTLOG(m_cameraConstraintValid,("*** cam constraints are not valid!!!")); if (m_cameraConstraintValid) { diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/CUndoable.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/CUndoable.cpp index 2b84af2333..49ce5d3303 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/CUndoable.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/CUndoable.cpp @@ -724,7 +724,7 @@ m_pDoc(pDoc) // ensure the new setup is valid. (don't mess with the old one.) Bool modified = m_new.validateSides(); (void)modified; - DEBUG_ASSERTLOG(!modified,("*** had to clean up sides in SidesListUndoable! (caller should do this)\n")); + DEBUG_ASSERTLOG(!modified,("*** had to clean up sides in SidesListUndoable! (caller should do this)")); } SidesListUndoable::~SidesListUndoable() diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp index 3ec2aabef9..af4b73b57c 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp @@ -2637,7 +2637,7 @@ Bool WorldHeightMapEdit::adjustForTiling( TCliffInfo &cliffInfo, Real textureWid // Bool doOffset = false; Real offset; - DEBUG_ASSERTLOG(minU<-delta && maxU > delta, ("Oops, wrong.\n")) ; + DEBUG_ASSERTLOG(minU<-delta && maxU > delta, ("Oops, wrong.")) ; // Straddles the 0 line. if (maxU > -minU) { diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/mapobjectprops.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/mapobjectprops.cpp index ec6bc5ae44..6830c2df5f 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/mapobjectprops.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/mapobjectprops.cpp @@ -212,7 +212,7 @@ void MapObjectProps::_DictToTeam(void) if (name == NEUTRAL_TEAM_INTERNAL_STR) name = NEUTRAL_TEAM_UI_STR; i = owner->FindStringExact(-1, name.str()); - DEBUG_ASSERTLOG(i >= 0, ("missing team '%s'. Non-fatal (jkmcd)\n", name.str())); + DEBUG_ASSERTLOG(i >= 0, ("missing team '%s'. Non-fatal (jkmcd)", name.str())); } owner->SetCurSel(i); From 0ed03cc062739c2bc7c52a59aa53ac2d42681871 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:09:02 +0200 Subject: [PATCH 05/13] [GEN][ZH] Remove trailing LF from DEBUG_ASSERTCRASH strings with script (#1232) --- Core/GameEngine/Source/Common/System/Xfer.cpp | 4 +- .../Source/Common/System/XferCRC.cpp | 2 +- .../Source/Common/System/XferLoad.cpp | 8 +-- .../Source/Common/System/XferSave.cpp | 8 +-- .../Source/Compression/CompressionManager.cpp | 4 +- Core/Tools/ImagePacker/Source/ImagePacker.cpp | 4 +- Core/Tools/ImagePacker/Source/TexturePage.cpp | 10 +-- .../GameEngine/Include/Common/GameMemory.h | 16 ++--- .../Include/Common/SparseMatchFinder.h | 2 +- .../GameEngine/Include/GameLogic/Locomotor.h | 2 +- .../Source/Common/Audio/GameAudio.cpp | 2 +- .../Code/GameEngine/Source/Common/Dict.cpp | 22 +++--- .../GameEngine/Source/Common/GameEngine.cpp | 2 +- .../GameEngine/Source/Common/GlobalData.cpp | 8 +-- .../Code/GameEngine/Source/Common/INI/INI.cpp | 40 +++++------ .../Source/Common/INI/INIAnimation.cpp | 2 +- .../Source/Common/INI/INIControlBarScheme.cpp | 4 +- .../Source/Common/INI/INIMappedImage.cpp | 2 +- .../Source/Common/INI/INITerrain.cpp | 2 +- .../Source/Common/INI/INITerrainBridge.cpp | 4 +- .../Source/Common/INI/INITerrainRoad.cpp | 4 +- .../Source/Common/INI/INIWebpageURL.cpp | 2 +- .../Source/Common/RTS/ActionManager.cpp | 4 +- .../GameEngine/Source/Common/RTS/Energy.cpp | 2 +- .../GameEngine/Source/Common/RTS/Player.cpp | 6 +- .../Source/Common/RTS/PlayerList.cpp | 2 +- .../Common/RTS/ProductionPrerequisite.cpp | 2 +- .../GameEngine/Source/Common/RTS/Team.cpp | 2 +- .../GameEngine/Source/Common/Recorder.cpp | 2 +- .../GameEngine/Source/Common/StateMachine.cpp | 2 +- .../Source/Common/System/AsciiString.cpp | 4 +- .../Source/Common/System/BuildAssistant.cpp | 2 +- .../Source/Common/System/GameCommon.cpp | 2 +- .../Source/Common/System/GameMemory.cpp | 12 ++-- .../GameEngine/Source/Common/System/Radar.cpp | 6 +- .../Common/System/SaveGame/GameState.cpp | 6 +- .../Common/System/SaveGame/GameStateMap.cpp | 2 +- .../Source/Common/System/UnicodeString.cpp | 2 +- .../Source/Common/System/Upgrade.cpp | 2 +- .../GameEngine/Source/Common/Thing/Module.cpp | 8 +-- .../GameEngine/Source/Common/Thing/Thing.cpp | 12 ++-- .../Source/Common/Thing/ThingFactory.cpp | 4 +- .../Source/Common/Thing/ThingTemplate.cpp | 4 +- .../GameEngine/Source/GameClient/Credits.cpp | 4 +- .../GameEngine/Source/GameClient/Drawable.cpp | 8 +-- .../Drawable/Update/BeaconClientUpdate.cpp | 2 +- .../GameEngine/Source/GameClient/FXList.cpp | 4 +- .../GameClient/GUI/ControlBar/ControlBar.cpp | 18 ++--- .../GUI/ControlBar/ControlBarCommand.cpp | 6 +- .../ControlBarCommandProcessing.cpp | 16 ++--- .../GUI/ControlBar/ControlBarMultiSelect.cpp | 4 +- .../GUI/ControlBar/ControlBarOCLTimer.cpp | 2 +- .../GUI/ControlBar/ControlBarResizer.cpp | 2 +- .../GUI/ControlBar/ControlBarScheme.cpp | 12 ++-- .../ControlBarStructureInventory.cpp | 4 +- .../ControlBarUnderConstruction.cpp | 2 +- .../GUI/GUICallbacks/InGamePopupMessage.cpp | 2 +- .../GUI/GUICallbacks/Menus/MainMenu.cpp | 2 +- .../GUI/GUICallbacks/Menus/PopupReplay.cpp | 12 ++-- .../GUI/GUICallbacks/Menus/PopupSaveLoad.cpp | 18 ++--- .../GUI/GUICallbacks/Menus/ScoreScreen.cpp | 4 +- .../GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp | 2 +- .../GameClient/GUI/GameWindowTransitions.cpp | 4 +- .../Source/GameClient/GUI/LoadScreen.cpp | 6 +- .../Source/GameClient/GUI/Shell/Shell.cpp | 12 ++-- .../GameClient/GUI/Shell/ShellMenuScheme.cpp | 4 +- .../Source/GameClient/GameClient.cpp | 2 +- .../Source/GameClient/GraphDraw.cpp | 4 +- .../GameEngine/Source/GameClient/InGameUI.cpp | 4 +- .../Source/GameClient/Input/Keyboard.cpp | 4 +- .../GameClient/MessageStream/CommandXlat.cpp | 2 +- .../MessageStream/GUICommandTranslator.cpp | 6 +- .../Source/GameClient/System/Anim2D.cpp | 14 ++-- .../GameClient/System/CampaignManager.cpp | 4 +- .../Source/GameClient/System/ParticleSys.cpp | 18 ++--- .../GameClient/Terrain/TerrainRoads.cpp | 4 +- .../GameEngine/Source/GameLogic/AI/AI.cpp | 2 +- .../Source/GameLogic/Map/TerrainLogic.cpp | 8 +-- .../Object/Behavior/BridgeBehavior.cpp | 18 ++--- .../Object/Behavior/BridgeTowerBehavior.cpp | 4 +- .../Behavior/DumbProjectileBehavior.cpp | 4 +- .../Object/Behavior/JetSlowDeathBehavior.cpp | 2 +- .../Object/Behavior/POWTruckBehavior.cpp | 4 +- .../Object/Behavior/ParkingPlaceBehavior.cpp | 2 +- .../Behavior/PropagandaCenterBehavior.cpp | 2 +- .../Object/Contain/GarrisonContain.cpp | 2 +- .../GameLogic/Object/Contain/OpenContain.cpp | 4 +- .../Object/Damage/TransitionDamageFX.cpp | 2 +- .../Source/GameLogic/Object/Die/CrushDie.cpp | 2 +- .../Object/Die/RebuildHoleExposeDie.cpp | 2 +- .../Source/GameLogic/Object/Locomotor.cpp | 2 +- .../Source/GameLogic/Object/Object.cpp | 16 ++--- .../GameLogic/Object/ObjectCreationList.cpp | 6 +- .../GameLogic/Object/PartitionManager.cpp | 8 +-- .../GameLogic/Object/Update/AIUpdate.cpp | 2 +- .../Object/Update/AIUpdate/DozerAIUpdate.cpp | 28 ++++---- .../Update/AIUpdate/POWTruckAIUpdate.cpp | 20 +++--- .../AIUpdate/RailedTransportAIUpdate.cpp | 4 +- .../Update/AIUpdate/RailroadGuideAIUpdate.cpp | 2 +- .../Object/Update/AIUpdate/WorkerAIUpdate.cpp | 10 +-- .../Object/Update/BattlePlanUpdate.cpp | 2 +- .../Update/DockUpdate/PrisonDockUpdate.cpp | 4 +- .../DockUpdate/RailedTransportDockUpdate.cpp | 2 +- .../GameLogic/Object/Update/EMPUpdate.cpp | 6 +- .../Update/HelicopterSlowDeathUpdate.cpp | 2 +- .../GameLogic/Object/Update/PhysicsUpdate.cpp | 8 +-- .../Object/Update/ProductionUpdate.cpp | 2 +- .../Source/GameLogic/Object/Weapon.cpp | 12 ++-- .../GameLogic/ScriptEngine/ScriptEngine.cpp | 72 +++++++++---------- .../Source/GameLogic/System/GameLogic.cpp | 36 +++++----- .../GameLogic/System/GameLogicDispatch.cpp | 6 +- .../Source/GameNetwork/GameSpy/LobbyUtils.cpp | 2 +- .../GameSpy/StagingRoomGameInfo.cpp | 2 +- .../GameNetwork/GameSpy/Thread/PeerThread.cpp | 4 +- .../Thread/PersistentStorageThread.cpp | 6 +- .../Source/GameNetwork/LANAPICallbacks.cpp | 2 +- .../Source/GameNetwork/LANAPIhandlers.cpp | 2 +- .../GameNetwork/NetCommandWrapperList.cpp | 2 +- .../MilesAudioDevice/MilesAudioManager.cpp | 6 +- .../W3DDevice/Common/System/W3DRadar.cpp | 12 ++-- .../Drawable/Draw/W3DDebrisDraw.cpp | 2 +- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 12 ++-- .../Drawable/Draw/W3DTankTruckDraw.cpp | 16 ++--- .../GameClient/Drawable/Draw/W3DTruckDraw.cpp | 22 +++--- .../GameClient/Shadow/W3DProjectedShadow.cpp | 4 +- .../W3DDevice/GameClient/W3DBridgeBuffer.cpp | 22 +++--- .../W3DDevice/GameClient/W3DDisplay.cpp | 2 +- .../W3DDevice/GameClient/Water/W3DWater.cpp | 4 +- .../W3DDevice/GameLogic/W3DGhostObject.cpp | 2 +- .../Win32Device/GameClient/Win32Mouse.cpp | 2 +- .../Dialog Procedures/CallbackEditor.cpp | 2 +- .../Code/Tools/WorldBuilder/src/BuildList.cpp | 2 +- .../WorldBuilder/src/EditObjectParameter.cpp | 2 +- .../Tools/WorldBuilder/src/FenceOptions.cpp | 2 +- .../Tools/WorldBuilder/src/ObjectOptions.cpp | 2 +- .../Tools/WorldBuilder/src/PickUnitDialog.cpp | 2 +- .../WorldBuilder/src/WorldBuilderDoc.cpp | 2 +- .../GameEngine/Include/Common/GameMemory.h | 16 ++--- .../Include/Common/SparseMatchFinder.h | 2 +- .../GameEngine/Include/GameLogic/Locomotor.h | 2 +- .../Source/Common/Audio/GameAudio.cpp | 2 +- .../Code/GameEngine/Source/Common/Dict.cpp | 22 +++--- .../GameEngine/Source/Common/GameEngine.cpp | 2 +- .../GameEngine/Source/Common/GlobalData.cpp | 8 +-- .../Code/GameEngine/Source/Common/INI/INI.cpp | 38 +++++----- .../Source/Common/INI/INIAnimation.cpp | 2 +- .../Source/Common/INI/INIControlBarScheme.cpp | 4 +- .../Source/Common/INI/INIMappedImage.cpp | 2 +- .../Source/Common/INI/INITerrain.cpp | 2 +- .../Source/Common/INI/INITerrainBridge.cpp | 4 +- .../Source/Common/INI/INITerrainRoad.cpp | 4 +- .../Source/Common/INI/INIWebpageURL.cpp | 2 +- .../Source/Common/RTS/ActionManager.cpp | 4 +- .../GameEngine/Source/Common/RTS/Energy.cpp | 2 +- .../GameEngine/Source/Common/RTS/Player.cpp | 6 +- .../Source/Common/RTS/PlayerList.cpp | 2 +- .../Common/RTS/ProductionPrerequisite.cpp | 2 +- .../GameEngine/Source/Common/RTS/Team.cpp | 2 +- .../GameEngine/Source/Common/Recorder.cpp | 2 +- .../GameEngine/Source/Common/StateMachine.cpp | 2 +- .../Source/Common/System/AsciiString.cpp | 4 +- .../Source/Common/System/BuildAssistant.cpp | 2 +- .../Source/Common/System/GameCommon.cpp | 2 +- .../Source/Common/System/GameMemory.cpp | 12 ++-- .../GameEngine/Source/Common/System/Radar.cpp | 6 +- .../Common/System/SaveGame/GameState.cpp | 6 +- .../Common/System/SaveGame/GameStateMap.cpp | 2 +- .../Source/Common/System/UnicodeString.cpp | 2 +- .../Source/Common/System/Upgrade.cpp | 2 +- .../GameEngine/Source/Common/Thing/Module.cpp | 8 +-- .../GameEngine/Source/Common/Thing/Thing.cpp | 12 ++-- .../Source/Common/Thing/ThingFactory.cpp | 4 +- .../Source/Common/Thing/ThingTemplate.cpp | 4 +- .../GameEngine/Source/GameClient/Credits.cpp | 4 +- .../GameEngine/Source/GameClient/Drawable.cpp | 8 +-- .../Drawable/Update/BeaconClientUpdate.cpp | 2 +- .../GameEngine/Source/GameClient/FXList.cpp | 4 +- .../GameClient/GUI/ControlBar/ControlBar.cpp | 18 ++--- .../GUI/ControlBar/ControlBarCommand.cpp | 6 +- .../ControlBarCommandProcessing.cpp | 16 ++--- .../GUI/ControlBar/ControlBarMultiSelect.cpp | 4 +- .../GUI/ControlBar/ControlBarOCLTimer.cpp | 2 +- .../GUI/ControlBar/ControlBarResizer.cpp | 2 +- .../GUI/ControlBar/ControlBarScheme.cpp | 12 ++-- .../ControlBarStructureInventory.cpp | 4 +- .../ControlBarUnderConstruction.cpp | 2 +- .../GUI/GUICallbacks/InGamePopupMessage.cpp | 2 +- .../GUI/GUICallbacks/Menus/MainMenu.cpp | 2 +- .../GUI/GUICallbacks/Menus/PopupReplay.cpp | 12 ++-- .../GUI/GUICallbacks/Menus/PopupSaveLoad.cpp | 18 ++--- .../GUI/GUICallbacks/Menus/ScoreScreen.cpp | 6 +- .../GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp | 2 +- .../GameClient/GUI/GameWindowTransitions.cpp | 4 +- .../Source/GameClient/GUI/LoadScreen.cpp | 6 +- .../Source/GameClient/GUI/Shell/Shell.cpp | 12 ++-- .../GameClient/GUI/Shell/ShellMenuScheme.cpp | 4 +- .../Source/GameClient/GameClient.cpp | 2 +- .../Source/GameClient/GraphDraw.cpp | 4 +- .../GameEngine/Source/GameClient/InGameUI.cpp | 4 +- .../Source/GameClient/Input/Keyboard.cpp | 4 +- .../GameClient/MessageStream/CommandXlat.cpp | 2 +- .../MessageStream/GUICommandTranslator.cpp | 6 +- .../Source/GameClient/System/Anim2D.cpp | 14 ++-- .../GameClient/System/CampaignManager.cpp | 4 +- .../Source/GameClient/System/ParticleSys.cpp | 16 ++--- .../GameClient/Terrain/TerrainRoads.cpp | 4 +- .../GameEngine/Source/GameLogic/AI/AI.cpp | 2 +- .../Source/GameLogic/Map/TerrainLogic.cpp | 8 +-- .../Object/Behavior/BridgeBehavior.cpp | 18 ++--- .../Object/Behavior/BridgeTowerBehavior.cpp | 4 +- .../Behavior/DumbProjectileBehavior.cpp | 4 +- .../Object/Behavior/FlightDeckBehavior.cpp | 2 +- .../Object/Behavior/JetSlowDeathBehavior.cpp | 2 +- .../Object/Behavior/POWTruckBehavior.cpp | 4 +- .../Object/Behavior/ParkingPlaceBehavior.cpp | 2 +- .../Behavior/PropagandaCenterBehavior.cpp | 2 +- .../Object/Contain/GarrisonContain.cpp | 2 +- .../GameLogic/Object/Contain/OpenContain.cpp | 4 +- .../Object/Damage/TransitionDamageFX.cpp | 2 +- .../Source/GameLogic/Object/Die/CrushDie.cpp | 2 +- .../Object/Die/RebuildHoleExposeDie.cpp | 2 +- .../Source/GameLogic/Object/Locomotor.cpp | 2 +- .../Source/GameLogic/Object/Object.cpp | 18 ++--- .../GameLogic/Object/ObjectCreationList.cpp | 6 +- .../GameLogic/Object/PartitionManager.cpp | 8 +-- .../GameLogic/Object/Update/AIUpdate.cpp | 4 +- .../Object/Update/AIUpdate/DozerAIUpdate.cpp | 28 ++++---- .../Update/AIUpdate/POWTruckAIUpdate.cpp | 20 +++--- .../AIUpdate/RailedTransportAIUpdate.cpp | 4 +- .../Update/AIUpdate/RailroadGuideAIUpdate.cpp | 2 +- .../Object/Update/AIUpdate/WorkerAIUpdate.cpp | 10 +-- .../Object/Update/BattlePlanUpdate.cpp | 2 +- .../Update/DockUpdate/PrisonDockUpdate.cpp | 4 +- .../DockUpdate/RailedTransportDockUpdate.cpp | 2 +- .../GameLogic/Object/Update/EMPUpdate.cpp | 10 +-- .../Update/HelicopterSlowDeathUpdate.cpp | 2 +- .../GameLogic/Object/Update/PhysicsUpdate.cpp | 8 +-- .../Object/Update/ProductionUpdate.cpp | 2 +- .../Source/GameLogic/Object/Weapon.cpp | 12 ++-- .../GameLogic/ScriptEngine/ScriptEngine.cpp | 72 +++++++++---------- .../Source/GameLogic/System/GameLogic.cpp | 42 +++++------ .../GameLogic/System/GameLogicDispatch.cpp | 6 +- .../Source/GameNetwork/GameSpy/LobbyUtils.cpp | 2 +- .../GameSpy/StagingRoomGameInfo.cpp | 2 +- .../GameNetwork/GameSpy/Thread/PeerThread.cpp | 4 +- .../Thread/PersistentStorageThread.cpp | 6 +- .../Source/GameNetwork/LANAPICallbacks.cpp | 2 +- .../Source/GameNetwork/LANAPIhandlers.cpp | 2 +- .../GameNetwork/NetCommandWrapperList.cpp | 2 +- .../MilesAudioDevice/MilesAudioManager.cpp | 6 +- .../W3DDevice/Common/System/W3DRadar.cpp | 12 ++-- .../Drawable/Draw/W3DDebrisDraw.cpp | 2 +- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 12 ++-- .../Drawable/Draw/W3DTankTruckDraw.cpp | 16 ++--- .../GameClient/Drawable/Draw/W3DTruckDraw.cpp | 22 +++--- .../GameClient/Shadow/W3DProjectedShadow.cpp | 4 +- .../W3DDevice/GameClient/W3DBridgeBuffer.cpp | 22 +++--- .../W3DDevice/GameClient/W3DDisplay.cpp | 2 +- .../W3DDevice/GameClient/Water/W3DWater.cpp | 4 +- .../W3DDevice/GameLogic/W3DGhostObject.cpp | 2 +- .../Win32Device/GameClient/Win32Mouse.cpp | 2 +- .../Dialog Procedures/CallbackEditor.cpp | 2 +- .../Code/Tools/WorldBuilder/src/BuildList.cpp | 2 +- .../WorldBuilder/src/EditObjectParameter.cpp | 2 +- .../Tools/WorldBuilder/src/FenceOptions.cpp | 2 +- .../Tools/WorldBuilder/src/ObjectOptions.cpp | 2 +- .../Tools/WorldBuilder/src/PickUnitDialog.cpp | 2 +- .../WorldBuilder/src/WorldBuilderDoc.cpp | 2 +- 268 files changed, 889 insertions(+), 889 deletions(-) diff --git a/Core/GameEngine/Source/Common/System/Xfer.cpp b/Core/GameEngine/Source/Common/System/Xfer.cpp index 3485dcfb7a..1b6a7f7463 100644 --- a/Core/GameEngine/Source/Common/System/Xfer.cpp +++ b/Core/GameEngine/Source/Common/System/Xfer.cpp @@ -562,7 +562,7 @@ void Xfer::xferScienceType( ScienceType *science ) { // sanity - DEBUG_ASSERTCRASH( science != NULL, ("xferScienceType - Invalid parameters\n") ); + DEBUG_ASSERTCRASH( science != NULL, ("xferScienceType - Invalid parameters") ); AsciiString scienceName; @@ -611,7 +611,7 @@ void Xfer::xferScienceVec( ScienceVec *scienceVec ) { // sanity - DEBUG_ASSERTCRASH( scienceVec != NULL, ("xferScienceVec - Invalid parameters\n") ); + DEBUG_ASSERTCRASH( scienceVec != NULL, ("xferScienceVec - Invalid parameters") ); // this deserves a version number const XferVersion currentVersion = 1; diff --git a/Core/GameEngine/Source/Common/System/XferCRC.cpp b/Core/GameEngine/Source/Common/System/XferCRC.cpp index e51a88b05c..b00700ffea 100644 --- a/Core/GameEngine/Source/Common/System/XferCRC.cpp +++ b/Core/GameEngine/Source/Common/System/XferCRC.cpp @@ -282,7 +282,7 @@ void XferDeepCRC::xferImplementation( void *data, Int dataSize ) } // sanity - DEBUG_ASSERTCRASH( m_fileFP != NULL, ("XferSave - file pointer for '%s' is NULL\n", + DEBUG_ASSERTCRASH( m_fileFP != NULL, ("XferSave - file pointer for '%s' is NULL", m_identifier.str()) ); // write data to file diff --git a/Core/GameEngine/Source/Common/System/XferLoad.cpp b/Core/GameEngine/Source/Common/System/XferLoad.cpp index 2c6bfb4ad3..2682d62cea 100644 --- a/Core/GameEngine/Source/Common/System/XferLoad.cpp +++ b/Core/GameEngine/Source/Common/System/XferLoad.cpp @@ -122,7 +122,7 @@ Int XferLoad::beginBlock( void ) { // sanity - DEBUG_ASSERTCRASH( m_fileFP != NULL, ("Xfer begin block - file pointer for '%s' is NULL\n", + DEBUG_ASSERTCRASH( m_fileFP != NULL, ("Xfer begin block - file pointer for '%s' is NULL", m_identifier.str()) ); // read block size @@ -155,11 +155,11 @@ void XferLoad::skip( Int dataSize ) { // sanity - DEBUG_ASSERTCRASH( m_fileFP != NULL, ("XferLoad::skip - file pointer for '%s' is NULL\n", + DEBUG_ASSERTCRASH( m_fileFP != NULL, ("XferLoad::skip - file pointer for '%s' is NULL", m_identifier.str()) ); // sanity - DEBUG_ASSERTCRASH( dataSize >=0, ("XferLoad::skip - dataSize '%d' must be greater than 0\n", + DEBUG_ASSERTCRASH( dataSize >=0, ("XferLoad::skip - dataSize '%d' must be greater than 0", dataSize) ); // skip datasize in the file from the current position @@ -244,7 +244,7 @@ void XferLoad::xferImplementation( void *data, Int dataSize ) { // sanity - DEBUG_ASSERTCRASH( m_fileFP != NULL, ("XferLoad - file pointer for '%s' is NULL\n", + DEBUG_ASSERTCRASH( m_fileFP != NULL, ("XferLoad - file pointer for '%s' is NULL", m_identifier.str()) ); // read data from file diff --git a/Core/GameEngine/Source/Common/System/XferSave.cpp b/Core/GameEngine/Source/Common/System/XferSave.cpp index 6be40bbd3c..13cfd3431a 100644 --- a/Core/GameEngine/Source/Common/System/XferSave.cpp +++ b/Core/GameEngine/Source/Common/System/XferSave.cpp @@ -166,7 +166,7 @@ Int XferSave::beginBlock( void ) { // sanity - DEBUG_ASSERTCRASH( m_fileFP != NULL, ("Xfer begin block - file pointer for '%s' is NULL\n", + DEBUG_ASSERTCRASH( m_fileFP != NULL, ("Xfer begin block - file pointer for '%s' is NULL", m_identifier.str()) ); // get the current file position so we can back up here for the next end block call @@ -211,7 +211,7 @@ void XferSave::endBlock( void ) { // sanity - DEBUG_ASSERTCRASH( m_fileFP != NULL, ("Xfer end block - file pointer for '%s' is NULL\n", + DEBUG_ASSERTCRASH( m_fileFP != NULL, ("Xfer end block - file pointer for '%s' is NULL", m_identifier.str()) ); // sanity, make sure we have a block started @@ -258,7 +258,7 @@ void XferSave::skip( Int dataSize ) { // sanity - DEBUG_ASSERTCRASH( m_fileFP != NULL, ("XferSave - file pointer for '%s' is NULL\n", + DEBUG_ASSERTCRASH( m_fileFP != NULL, ("XferSave - file pointer for '%s' is NULL", m_identifier.str()) ); @@ -343,7 +343,7 @@ void XferSave::xferImplementation( void *data, Int dataSize ) { // sanity - DEBUG_ASSERTCRASH( m_fileFP != NULL, ("XferSave - file pointer for '%s' is NULL\n", + DEBUG_ASSERTCRASH( m_fileFP != NULL, ("XferSave - file pointer for '%s' is NULL", m_identifier.str()) ); // write data to file diff --git a/Core/Libraries/Source/Compression/CompressionManager.cpp b/Core/Libraries/Source/Compression/CompressionManager.cpp index 73acbb0515..ba3e94cb5a 100644 --- a/Core/Libraries/Source/Compression/CompressionManager.cpp +++ b/Core/Libraries/Source/Compression/CompressionManager.cpp @@ -421,10 +421,10 @@ void DoCompressTest( void ) } d.compressedSize[i] = compressedLen; DEBUG_LOG(("Compressed len is %d (%g%% of original size)", compressedLen, (double)compressedLen/(double)origSize*100.0)); - DEBUG_ASSERTCRASH(compressedLen, ("Failed to compress\n")); + DEBUG_ASSERTCRASH(compressedLen, ("Failed to compress")); DEBUG_LOG(("Decompressed len is %d (%g%% of original size)", decompressedLen, (double)decompressedLen/(double)origSize*100.0)); - DEBUG_ASSERTCRASH(decompressedLen == origSize, ("orig size does not match compressed+uncompressed output\n")); + DEBUG_ASSERTCRASH(decompressedLen == origSize, ("orig size does not match compressed+uncompressed output")); if (decompressedLen == origSize) { Int ret = memcmp(buf, uncompressedBuf, origSize); diff --git a/Core/Tools/ImagePacker/Source/ImagePacker.cpp b/Core/Tools/ImagePacker/Source/ImagePacker.cpp index 0e8c23c5b0..3fd1125a07 100644 --- a/Core/Tools/ImagePacker/Source/ImagePacker.cpp +++ b/Core/Tools/ImagePacker/Source/ImagePacker.cpp @@ -83,7 +83,7 @@ TexturePage *ImagePacker::createNewTexturePage( void ) if( page == NULL ) { - DEBUG_ASSERTCRASH( page, ("Unable to allocate new texture page.\n") ); + DEBUG_ASSERTCRASH( page, ("Unable to allocate new texture page.") ); return NULL; } // end if @@ -1154,7 +1154,7 @@ Bool ImagePacker::init( void ) if( m_targa == NULL ) { - DEBUG_ASSERTCRASH( m_targa, ("Unable to allocate targa header during init\n") ); + DEBUG_ASSERTCRASH( m_targa, ("Unable to allocate targa header during init") ); MessageBox( NULL, "ImagePacker can't init, unable to create targa", "Internal Error", MB_OK | MB_ICONERROR ); return FALSE; diff --git a/Core/Tools/ImagePacker/Source/TexturePage.cpp b/Core/Tools/ImagePacker/Source/TexturePage.cpp index ad0d5343a3..fb1d222caa 100644 --- a/Core/Tools/ImagePacker/Source/TexturePage.cpp +++ b/Core/Tools/ImagePacker/Source/TexturePage.cpp @@ -532,7 +532,7 @@ Bool TexturePage::addImageData( Byte *destBuffer, // get the source image buffer char *sourceBuffer = source.GetImage(); - DEBUG_ASSERTCRASH( sourceBuffer, ("No Source buffer for source image\n") ); + DEBUG_ASSERTCRASH( sourceBuffer, ("No Source buffer for source image") ); // get the source bytes per pixel Int sourceBPP = TGA_BytesPerPixel( source.Header.PixelDepth ); @@ -863,7 +863,7 @@ TexturePage::TexturePage( Int width, Int height ) // create a "canvas" to represent used and unused areas canvasSize = m_size.x * m_size.y; m_canvas = new UnsignedByte[ canvasSize ]; - DEBUG_ASSERTCRASH( m_canvas, ("Cannot allocate canvas for texture page\n") ); + DEBUG_ASSERTCRASH( m_canvas, ("Cannot allocate canvas for texture page") ); memset( m_canvas, FREE, sizeof( UnsignedByte ) * canvasSize ); } // end TexturePage @@ -899,7 +899,7 @@ Bool TexturePage::addImage( ImageInfo *image ) if( image == NULL ) { - DEBUG_ASSERTCRASH( image, ("TexturePage::addImage: NULL image!\n") ); + DEBUG_ASSERTCRASH( image, ("TexturePage::addImage: NULL image!") ); return TRUE; // say it was added } // end if @@ -1181,8 +1181,8 @@ Bool TexturePage::generateTexture( void ) return FALSE; // sanity - DEBUG_ASSERTCRASH( m_packedImage == NULL, ("The packed image list must be NULL before generating texture\n") ); - DEBUG_ASSERTCRASH( m_targa == NULL, ("The targa must be NULL before generating a new texture\n") ); + DEBUG_ASSERTCRASH( m_packedImage == NULL, ("The packed image list must be NULL before generating texture") ); + DEBUG_ASSERTCRASH( m_targa == NULL, ("The targa must be NULL before generating a new texture") ); // allocate targa to help us generate the final texture m_targa = new Targa; diff --git a/Generals/Code/GameEngine/Include/Common/GameMemory.h b/Generals/Code/GameEngine/Include/Common/GameMemory.h index 8f6bcff89d..76d6c7ce52 100644 --- a/Generals/Code/GameEngine/Include/Common/GameMemory.h +++ b/Generals/Code/GameEngine/Include/Common/GameMemory.h @@ -592,11 +592,11 @@ private: \ order-of-execution problem for static variables, ensuring this is not executed \ prior to the initialization of TheMemoryPoolFactory. \ */ \ - DEBUG_ASSERTCRASH(TheMemoryPoolFactory, ("TheMemoryPoolFactory is NULL\n")); \ + DEBUG_ASSERTCRASH(TheMemoryPoolFactory, ("TheMemoryPoolFactory is NULL")); \ static MemoryPool *The##ARGCLASS##Pool = TheMemoryPoolFactory->findMemoryPool(ARGPOOLNAME); \ - DEBUG_ASSERTCRASH(The##ARGCLASS##Pool, ("Pool \"%s\" not found (did you set it up in initMemoryPools?)\n", ARGPOOLNAME)); \ - DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() >= sizeof(ARGCLASS), ("Pool \"%s\" is too small for this class (currently %d, need %d)\n", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ - DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() <= sizeof(ARGCLASS)+MEMORY_POOL_OBJECT_ALLOCATION_SLOP, ("Pool \"%s\" is too large for this class (currently %d, need %d)\n", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ + DEBUG_ASSERTCRASH(The##ARGCLASS##Pool, ("Pool \"%s\" not found (did you set it up in initMemoryPools?)", ARGPOOLNAME)); \ + DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() >= sizeof(ARGCLASS), ("Pool \"%s\" is too small for this class (currently %d, need %d)", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ + DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() <= sizeof(ARGCLASS)+MEMORY_POOL_OBJECT_ALLOCATION_SLOP, ("Pool \"%s\" is too large for this class (currently %d, need %d)", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ return The##ARGCLASS##Pool; \ } @@ -611,11 +611,11 @@ private: \ order-of-execution problem for static variables, ensuring this is not executed \ prior to the initialization of TheMemoryPoolFactory. \ */ \ - DEBUG_ASSERTCRASH(TheMemoryPoolFactory, ("TheMemoryPoolFactory is NULL\n")); \ + DEBUG_ASSERTCRASH(TheMemoryPoolFactory, ("TheMemoryPoolFactory is NULL")); \ static MemoryPool *The##ARGCLASS##Pool = TheMemoryPoolFactory->createMemoryPool(ARGPOOLNAME, sizeof(ARGCLASS), ARGINITIAL, ARGOVERFLOW); \ - DEBUG_ASSERTCRASH(The##ARGCLASS##Pool, ("Pool \"%s\" not found (did you set it up in initMemoryPools?)\n", ARGPOOLNAME)); \ - DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() >= sizeof(ARGCLASS), ("Pool \"%s\" is too small for this class (currently %d, need %d)\n", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ - DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() <= sizeof(ARGCLASS)+MEMORY_POOL_OBJECT_ALLOCATION_SLOP, ("Pool \"%s\" is too large for this class (currently %d, need %d)\n", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ + DEBUG_ASSERTCRASH(The##ARGCLASS##Pool, ("Pool \"%s\" not found (did you set it up in initMemoryPools?)", ARGPOOLNAME)); \ + DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() >= sizeof(ARGCLASS), ("Pool \"%s\" is too small for this class (currently %d, need %d)", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ + DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() <= sizeof(ARGCLASS)+MEMORY_POOL_OBJECT_ALLOCATION_SLOP, ("Pool \"%s\" is too large for this class (currently %d, need %d)", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ return The##ARGCLASS##Pool; \ } diff --git a/Generals/Code/GameEngine/Include/Common/SparseMatchFinder.h b/Generals/Code/GameEngine/Include/Common/SparseMatchFinder.h index d866fd8014..41e28ae542 100644 --- a/Generals/Code/GameEngine/Include/Common/SparseMatchFinder.h +++ b/Generals/Code/GameEngine/Include/Common/SparseMatchFinder.h @@ -208,7 +208,7 @@ class SparseMatchFinder const MATCHABLE* info = findBestInfoSlow(v, bits); - DEBUG_ASSERTCRASH(info != NULL, ("no suitable match for criteria was found!\n")); + DEBUG_ASSERTCRASH(info != NULL, ("no suitable match for criteria was found!")); if (info != NULL) { m_bestMatches[bits] = info; } diff --git a/Generals/Code/GameEngine/Include/GameLogic/Locomotor.h b/Generals/Code/GameEngine/Include/GameLogic/Locomotor.h index ba66691759..9054c827a4 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/Locomotor.h +++ b/Generals/Code/GameEngine/Include/GameLogic/Locomotor.h @@ -286,7 +286,7 @@ class Locomotor : public MemoryPoolObject, public Snapshot inline void setMaxLift(Real lift) { m_maxLift = lift; } inline void setMaxSpeed(Real speed) { - DEBUG_ASSERTCRASH(!(speed <= 0.0f && m_template->m_appearance == LOCO_THRUST), ("THRUST locos may not have zero speeds!\n")); + DEBUG_ASSERTCRASH(!(speed <= 0.0f && m_template->m_appearance == LOCO_THRUST), ("THRUST locos may not have zero speeds!")); m_maxSpeed = speed; } inline void setMaxAcceleration(Real accel) { m_maxAccel = accel; } diff --git a/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp b/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp index 98009bae93..66717162e7 100644 --- a/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp +++ b/Generals/Code/GameEngine/Source/Common/Audio/GameAudio.cpp @@ -1042,7 +1042,7 @@ Bool AudioManager::shouldPlayLocally(const AudioEventRTS *audioEvent) Player *owningPlayer = ThePlayerList->getNthPlayer(audioEvent->getPlayerIndex()); if (BitIsSet(ei->m_type, ST_PLAYER) && BitIsSet(ei->m_type, ST_UI) && owningPlayer == NULL) { - DEBUG_ASSERTCRASH(!TheGameLogic->isInGameLogicUpdate(), ("Playing %s sound -- player-based UI sound without specifying a player.\n")); + DEBUG_ASSERTCRASH(!TheGameLogic->isInGameLogicUpdate(), ("Playing %s sound -- player-based UI sound without specifying a player.")); return TRUE; } diff --git a/Generals/Code/GameEngine/Source/Common/Dict.cpp b/Generals/Code/GameEngine/Source/Common/Dict.cpp index 7594b2d4ae..d794610612 100644 --- a/Generals/Code/GameEngine/Source/Common/Dict.cpp +++ b/Generals/Code/GameEngine/Source/Common/Dict.cpp @@ -160,7 +160,7 @@ Dict::DictPair *Dict::ensureUnique(int numPairsNeeded, Bool preserveData, DictPa Dict::DictPairData* newData = NULL; if (numPairsNeeded > 0) { - DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != NULL, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.\n")); + DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != NULL, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.")); DEBUG_ASSERTCRASH(numPairsNeeded <= MAX_LEN, ("Dict::ensureUnique exceeds max pairs length %d with requested length %d", MAX_LEN, numPairsNeeded)); int minBytes = sizeof(Dict::DictPairData) + numPairsNeeded*sizeof(Dict::DictPair); int actualBytes = TheDynamicMemoryAllocator->getActualAllocationSize(minBytes); @@ -274,7 +274,7 @@ Bool Dict::getBool(NameKeyType key, Bool *exists/*=NULL*/) const if (exists) *exists = true; return *pair->asBool(); } - DEBUG_ASSERTCRASH(exists != NULL, ("dict key missing, or of wrong type\n")); // only assert if they didn't check result + DEBUG_ASSERTCRASH(exists != NULL, ("dict key missing, or of wrong type")); // only assert if they didn't check result if (exists) *exists = false; return false; } @@ -289,7 +289,7 @@ Int Dict::getInt(NameKeyType key, Bool *exists/*=NULL*/) const if (exists) *exists = true; return *pair->asInt(); } - DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type\n")); // only assert if they didn't check result + DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type")); // only assert if they didn't check result if (exists) *exists = false; return 0; } @@ -304,7 +304,7 @@ Real Dict::getReal(NameKeyType key, Bool *exists/*=NULL*/) const if (exists) *exists = true; return *pair->asReal(); } - DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type\n")); // only assert if they didn't check result + DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type")); // only assert if they didn't check result if (exists) *exists = false; return 0.0f; } @@ -319,7 +319,7 @@ AsciiString Dict::getAsciiString(NameKeyType key, Bool *exists/*=NULL*/) const if (exists) *exists = true; return *pair->asAsciiString(); } - DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type\n")); // only assert if they didn't check result + DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type")); // only assert if they didn't check result if (exists) *exists = false; return AsciiString::TheEmptyString; } @@ -334,7 +334,7 @@ UnicodeString Dict::getUnicodeString(NameKeyType key, Bool *exists/*=NULL*/) con if (exists) *exists = true; return *pair->asUnicodeString(); } - DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type\n")); // only assert if they didn't check result + DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type")); // only assert if they didn't check result if (exists) *exists = false; return UnicodeString::TheEmptyString; } @@ -343,7 +343,7 @@ UnicodeString Dict::getUnicodeString(NameKeyType key, Bool *exists/*=NULL*/) con Bool Dict::getNthBool(Int n) const { validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range\n")); + DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); if (m_data) { DictPair* pair = &m_data->peek()[n]; @@ -358,7 +358,7 @@ Bool Dict::getNthBool(Int n) const Int Dict::getNthInt(Int n) const { validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range\n")); + DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); if (m_data) { DictPair* pair = &m_data->peek()[n]; @@ -373,7 +373,7 @@ Int Dict::getNthInt(Int n) const Real Dict::getNthReal(Int n) const { validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range\n")); + DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); if (m_data) { DictPair* pair = &m_data->peek()[n]; @@ -388,7 +388,7 @@ Real Dict::getNthReal(Int n) const AsciiString Dict::getNthAsciiString(Int n) const { validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range\n")); + DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); if (m_data) { DictPair* pair = &m_data->peek()[n]; @@ -403,7 +403,7 @@ AsciiString Dict::getNthAsciiString(Int n) const UnicodeString Dict::getNthUnicodeString(Int n) const { validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range\n")); + DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); if (m_data) { DictPair* pair = &m_data->peek()[n]; diff --git a/Generals/Code/GameEngine/Source/Common/GameEngine.cpp b/Generals/Code/GameEngine/Source/Common/GameEngine.cpp index 09ac26ccb5..ee73c05ebe 100644 --- a/Generals/Code/GameEngine/Source/Common/GameEngine.cpp +++ b/Generals/Code/GameEngine/Source/Common/GameEngine.cpp @@ -294,7 +294,7 @@ void GameEngine::init() initSubsystem(TheLocalFileSystem, "TheLocalFileSystem", createLocalFileSystem(), NULL); initSubsystem(TheArchiveFileSystem, "TheArchiveFileSystem", createArchiveFileSystem(), NULL); // this MUST come after TheLocalFileSystem creation - DEBUG_ASSERTCRASH(TheWritableGlobalData,("TheWritableGlobalData expected to be created\n")); + DEBUG_ASSERTCRASH(TheWritableGlobalData,("TheWritableGlobalData expected to be created")); initSubsystem(TheWritableGlobalData, "TheWritableGlobalData", TheWritableGlobalData, &xferCRC, "Data\\INI\\Default\\GameData.ini", "Data\\INI\\GameData.ini"); // TheSuperHackers @bugfix helmutbuhler 14/04/2025 diff --git a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp index 8d2a558262..077d532a33 100644 --- a/Generals/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/Generals/Code/GameEngine/Source/Common/GlobalData.cpp @@ -1020,7 +1020,7 @@ AsciiString GlobalData::getPath_UserData() const //------------------------------------------------------------------------------------------------- GlobalData::~GlobalData( void ) { - DEBUG_ASSERTCRASH( TheWritableGlobalData->m_next == NULL, ("~GlobalData: theOriginal is not original\n") ); + DEBUG_ASSERTCRASH( TheWritableGlobalData->m_next == NULL, ("~GlobalData: theOriginal is not original") ); if (m_weaponBonusSet) deleteInstance(m_weaponBonusSet); @@ -1063,7 +1063,7 @@ GlobalData *GlobalData::newOverride( void ) GlobalData *override = NEW GlobalData; // copy the data from the latest override (TheWritableGlobalData) to the newly created instance - DEBUG_ASSERTCRASH( TheWritableGlobalData, ("GlobalData::newOverride() - no existing data\n") ); + DEBUG_ASSERTCRASH( TheWritableGlobalData, ("GlobalData::newOverride() - no existing data") ); *override = *TheWritableGlobalData; // @@ -1116,8 +1116,8 @@ void GlobalData::reset( void ) // we now have the one single global data in TheWritableGlobalData singleton, lets sanity check // some of all that // - DEBUG_ASSERTCRASH( TheWritableGlobalData->m_next == NULL, ("ResetGlobalData: theOriginal is not original\n") ); - DEBUG_ASSERTCRASH( TheWritableGlobalData == GlobalData::m_theOriginal, ("ResetGlobalData: oops\n") ); + DEBUG_ASSERTCRASH( TheWritableGlobalData->m_next == NULL, ("ResetGlobalData: theOriginal is not original") ); + DEBUG_ASSERTCRASH( TheWritableGlobalData == GlobalData::m_theOriginal, ("ResetGlobalData: oops") ); } // end ResetGlobalData diff --git a/Generals/Code/GameEngine/Source/Common/INI/INI.cpp b/Generals/Code/GameEngine/Source/Common/INI/INI.cpp index 0406f9cec0..f5ad10c3c5 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INI.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INI.cpp @@ -348,7 +348,7 @@ void INI::load( AsciiString filename, INILoadType loadType, Xfer *pXfer ) { // read all lines in the file - DEBUG_ASSERTCRASH( m_endOfFile == FALSE, ("INI::load, EOF at the beginning!\n") ); + DEBUG_ASSERTCRASH( m_endOfFile == FALSE, ("INI::load, EOF at the beginning!") ); while( m_endOfFile == FALSE ) { // read this line @@ -382,7 +382,7 @@ void INI::load( AsciiString filename, INILoadType loadType, Xfer *pXfer ) } else { - DEBUG_ASSERTCRASH( 0, ("[LINE: %d - FILE: '%s'] Unknown block '%s'\n", + DEBUG_ASSERTCRASH( 0, ("[LINE: %d - FILE: '%s'] Unknown block '%s'", getLineNum(), getFilename().str(), token ) ); throw INI_UNKNOWN_TOKEN; } @@ -412,7 +412,7 @@ void INI::readLine( void ) Bool isComment = FALSE; // sanity - DEBUG_ASSERTCRASH( m_file, ("readLine(), file pointer is NULL\n") ); + DEBUG_ASSERTCRASH( m_file, ("readLine(), file pointer is NULL") ); // if we've reached end of file we'll just keep returning empty string in our buffer if( m_endOfFile ) @@ -443,7 +443,7 @@ void INI::readLine( void ) if( m_buffer[ i ] == '\n' ) done = TRUE; - DEBUG_ASSERTCRASH(m_buffer[ i ] != '\t', ("tab characters are not allowed in INI files (%s). please check your editor settings. Line Number %d\n",m_filename.str(), getLineNum())); + DEBUG_ASSERTCRASH(m_buffer[ i ] != '\t', ("tab characters are not allowed in INI files (%s). please check your editor settings. Line Number %d",m_filename.str(), getLineNum())); // make all whitespace characters actual spaces if( isspace( m_buffer[ i ] ) ) @@ -477,7 +477,7 @@ void INI::readLine( void ) if( i == INI_MAX_CHARS_PER_LINE ) { - DEBUG_ASSERTCRASH( 0, ("Buffer too small (%d) and was truncated, increase INI_MAX_CHARS_PER_LINE\n", + DEBUG_ASSERTCRASH( 0, ("Buffer too small (%d) and was truncated, increase INI_MAX_CHARS_PER_LINE", INI_MAX_CHARS_PER_LINE) ); } // end if @@ -905,7 +905,7 @@ void INI::parseBitString32( INI* ini, void * /*instance*/, void *store, const vo if( flagList == NULL || flagList[ 0 ] == NULL) { - DEBUG_ASSERTCRASH( flagList, ("INTERNAL ERROR! parseBitString32: No flag list provided!\n") ); + DEBUG_ASSERTCRASH( flagList, ("INTERNAL ERROR! parseBitString32: No flag list provided!") ); throw INI_INVALID_NAME_LIST; } @@ -1202,7 +1202,7 @@ void INI::parseThingTemplate( INI* ini, void * /*instance*/, void *store, const else { const ThingTemplate *tt = TheThingFactory->findTemplate(token); // could be null! - DEBUG_ASSERTCRASH(tt, ("ThingTemplate %s not found!\n",token)); + DEBUG_ASSERTCRASH(tt, ("ThingTemplate %s not found!",token)); // assign it, even if null! *theThingTemplate = tt; } @@ -1226,7 +1226,7 @@ void INI::parseArmorTemplate( INI* ini, void * /*instance*/, void *store, const else { const ArmorTemplate *tt = TheArmorStore->findArmorTemplate(token); // could be null! - DEBUG_ASSERTCRASH(tt, ("ArmorTemplate %s not found!\n",token)); + DEBUG_ASSERTCRASH(tt, ("ArmorTemplate %s not found!",token)); // assign it, even if null! *theArmorTemplate = tt; } @@ -1244,7 +1244,7 @@ void INI::parseWeaponTemplate( INI* ini, void * /*instance*/, void *store, const ConstWeaponTemplatePtr* theWeaponTemplate = (ConstWeaponTemplatePtr*)store; const WeaponTemplate *tt = TheWeaponStore->findWeaponTemplate(token); // could be null! - DEBUG_ASSERTCRASH(tt || stricmp(token, "None") == 0, ("WeaponTemplate %s not found!\n",token)); + DEBUG_ASSERTCRASH(tt || stricmp(token, "None") == 0, ("WeaponTemplate %s not found!",token)); // assign it, even if null! *theWeaponTemplate = tt; @@ -1261,7 +1261,7 @@ void INI::parseFXList( INI* ini, void * /*instance*/, void *store, const void* / ConstFXListPtr* theFXList = (ConstFXListPtr*)store; const FXList *fxl = TheFXListStore->findFXList(token); // could be null! - DEBUG_ASSERTCRASH(fxl != NULL || stricmp(token, "None") == 0, ("FXList %s not found!\n",token)); + DEBUG_ASSERTCRASH(fxl != NULL || stricmp(token, "None") == 0, ("FXList %s not found!",token)); // assign it, even if null! *theFXList = fxl; @@ -1275,7 +1275,7 @@ void INI::parseParticleSystemTemplate( INI *ini, void * /*instance*/, void *stor const char *token = ini->getNextToken(); const ParticleSystemTemplate *pSystemT = TheParticleSystemManager->findTemplate( AsciiString( token ) ); - DEBUG_ASSERTCRASH( pSystemT || stricmp( token, "None" ) == 0, ("ParticleSystem %s not found!\n",token) ); + DEBUG_ASSERTCRASH( pSystemT || stricmp( token, "None" ) == 0, ("ParticleSystem %s not found!",token) ); typedef const ParticleSystemTemplate* ConstParticleSystemTemplatePtr; ConstParticleSystemTemplatePtr* theParticleSystemTemplate = (ConstParticleSystemTemplatePtr*)store; @@ -1301,7 +1301,7 @@ void INI::parseDamageFX( INI* ini, void * /*instance*/, void *store, const void* else { const DamageFX *fxl = TheDamageFXStore->findDamageFX(token); // could be null! - DEBUG_ASSERTCRASH(fxl, ("DamageFX %s not found!\n",token)); + DEBUG_ASSERTCRASH(fxl, ("DamageFX %s not found!",token)); // assign it, even if null! *theDamageFX = fxl; } @@ -1319,7 +1319,7 @@ void INI::parseObjectCreationList( INI* ini, void * /*instance*/, void *store, c ConstObjectCreationListPtr* theObjectCreationList = (ConstObjectCreationListPtr*)store; const ObjectCreationList *ocl = TheObjectCreationListStore->findObjectCreationList(token); // could be null! - DEBUG_ASSERTCRASH(ocl || stricmp(token, "None") == 0, ("ObjectCreationList %s not found!\n",token)); + DEBUG_ASSERTCRASH(ocl || stricmp(token, "None") == 0, ("ObjectCreationList %s not found!",token)); // assign it, even if null! *theObjectCreationList = ocl; @@ -1339,7 +1339,7 @@ void INI::parseUpgradeTemplate( INI* ini, void * /*instance*/, void *store, cons } const UpgradeTemplate *uu = TheUpgradeCenter->findUpgrade( AsciiString( token ) ); - DEBUG_ASSERTCRASH( uu || stricmp( token, "None" ) == 0, ("Upgrade %s not found!\n",token) ); + DEBUG_ASSERTCRASH( uu || stricmp( token, "None" ) == 0, ("Upgrade %s not found!",token) ); typedef const UpgradeTemplate* ConstUpgradeTemplatePtr; ConstUpgradeTemplatePtr* theUpgradeTemplate = (ConstUpgradeTemplatePtr *)store; @@ -1360,7 +1360,7 @@ void INI::parseSpecialPowerTemplate( INI* ini, void * /*instance*/, void *store, } const SpecialPowerTemplate *sPowerT = TheSpecialPowerStore->findSpecialPowerTemplate( AsciiString( token ) ); - DEBUG_ASSERTCRASH( sPowerT || stricmp( token, "None" ) == 0, ("Specialpower %s not found!\n",token) ); + DEBUG_ASSERTCRASH( sPowerT || stricmp( token, "None" ) == 0, ("Specialpower %s not found!",token) ); typedef const SpecialPowerTemplate* ConstSpecialPowerTemplatePtr; ConstSpecialPowerTemplatePtr* theSpecialPowerTemplate = (ConstSpecialPowerTemplatePtr *)store; @@ -1473,7 +1473,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList if( what == NULL ) { - DEBUG_ASSERTCRASH( 0, ("INI::initFromINI - Invalid parameters supplied!\n") ); + DEBUG_ASSERTCRASH( 0, ("INI::initFromINI - Invalid parameters supplied!") ); throw INI_INVALID_PARAMS; } @@ -1526,7 +1526,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList if (!found) { - DEBUG_ASSERTCRASH( 0, ("[LINE: %d - FILE: '%s'] Unknown field '%s' in block '%s'\n", + DEBUG_ASSERTCRASH( 0, ("[LINE: %d - FILE: '%s'] Unknown field '%s' in block '%s'", INI::getLineNum(), INI::getFilename().str(), field, m_curBlockStart) ); throw INI_UNKNOWN_TOKEN; } @@ -1540,7 +1540,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList { done = TRUE; - DEBUG_ASSERTCRASH( 0, ("Error parsing block '%s', in INI file '%s'. Missing '%s' token\n", + DEBUG_ASSERTCRASH( 0, ("Error parsing block '%s', in INI file '%s'. Missing '%s' token", m_curBlockStart, getFilename().str(), m_blockEndToken) ); throw INI_MISSING_END_TOKEN; @@ -1616,7 +1616,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList if( nameList == NULL || nameList[ 0 ] == NULL ) { - DEBUG_ASSERTCRASH( 0, ("INTERNAL ERROR! scanIndexList, invalid name list\n") ); + DEBUG_ASSERTCRASH( 0, ("INTERNAL ERROR! scanIndexList, invalid name list") ); throw INI_INVALID_NAME_LIST; } @@ -1641,7 +1641,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList { if( lookupList == NULL || lookupList[ 0 ].name == NULL ) { - DEBUG_ASSERTCRASH( 0, ("INTERNAL ERROR! scanLookupList, invalid name list\n") ); + DEBUG_ASSERTCRASH( 0, ("INTERNAL ERROR! scanLookupList, invalid name list") ); throw INI_INVALID_NAME_LIST; } diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIAnimation.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIAnimation.cpp index 27962e0996..e87c9a81f1 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INIAnimation.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INIAnimation.cpp @@ -65,7 +65,7 @@ void INI::parseAnim2DDefinition( INI* ini ) // item not found, create a new one animTemplate = TheAnim2DCollection->newTemplate( name ); - DEBUG_ASSERTCRASH( animTemplate, ("INI""parseAnim2DDefinition - unable to allocate animation template for '%s'\n", + DEBUG_ASSERTCRASH( animTemplate, ("INI""parseAnim2DDefinition - unable to allocate animation template for '%s'", name.str()) ); } // end if diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp index 2988e64d02..4c4e9abb44 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp @@ -82,7 +82,7 @@ void INI::parseControlBarSchemeDefinition( INI *ini ) // find existing item if present CBSchemeManager = TheControlBar->getControlBarSchemeManager(); - DEBUG_ASSERTCRASH( CBSchemeManager, ("parseControlBarSchemeDefinition: Unable to Get CBSchemeManager\n") ); + DEBUG_ASSERTCRASH( CBSchemeManager, ("parseControlBarSchemeDefinition: Unable to Get CBSchemeManager") ); if( !CBSchemeManager ) return; @@ -91,7 +91,7 @@ void INI::parseControlBarSchemeDefinition( INI *ini ) CBScheme = CBSchemeManager->newControlBarScheme( name ); // sanity - DEBUG_ASSERTCRASH( CBScheme, ("parseControlBarSchemeDefinition: Unable to allocate Scheme '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( CBScheme, ("parseControlBarSchemeDefinition: Unable to allocate Scheme '%s'", name.str()) ); // parse the ini definition ini->initFromINI( CBScheme, CBSchemeManager->getFieldParse() ); diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp index 403eafb173..30ada35059 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp @@ -68,7 +68,7 @@ void INI::parseMappedImageDefinition( INI* ini ) // image not found, create a new one image = TheMappedImageCollection->newImage(); image->setName( name ); - DEBUG_ASSERTCRASH( image, ("parseMappedImage: unable to allocate image for '%s'\n", + DEBUG_ASSERTCRASH( image, ("parseMappedImage: unable to allocate image for '%s'", name.str()) ); } // end if diff --git a/Generals/Code/GameEngine/Source/Common/INI/INITerrain.cpp b/Generals/Code/GameEngine/Source/Common/INI/INITerrain.cpp index 6a3c5c1bcc..ac98475ef2 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INITerrain.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INITerrain.cpp @@ -51,7 +51,7 @@ void INI::parseTerrainDefinition( INI* ini ) terrainType = TheTerrainTypes->newTerrain( name ); // sanity - DEBUG_ASSERTCRASH( terrainType, ("Unable to allocate terrain type '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( terrainType, ("Unable to allocate terrain type '%s'", name.str()) ); // parse the ini definition ini->initFromINI( terrainType, terrainType->getFieldParse() ); diff --git a/Generals/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp b/Generals/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp index ac0b0fe7fa..65ca39ccae 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp @@ -53,7 +53,7 @@ void INI::parseTerrainBridgeDefinition( INI* ini ) { // sanity - DEBUG_ASSERTCRASH( bridge->isBridge(), ("Redefining road '%s' as a bridge!\n", + DEBUG_ASSERTCRASH( bridge->isBridge(), ("Redefining road '%s' as a bridge!", bridge->getName().str()) ); throw INI_INVALID_DATA; @@ -62,7 +62,7 @@ void INI::parseTerrainBridgeDefinition( INI* ini ) if( bridge == NULL ) bridge = TheTerrainRoads->newBridge( name ); - DEBUG_ASSERTCRASH( bridge, ("Unable to allcoate bridge '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( bridge, ("Unable to allcoate bridge '%s'", name.str()) ); // parse the ini definition ini->initFromINI( bridge, bridge->getBridgeFieldParse() ); diff --git a/Generals/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp b/Generals/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp index dc6e3695a8..40aff440d0 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp @@ -53,7 +53,7 @@ void INI::parseTerrainRoadDefinition( INI* ini ) { // sanity - DEBUG_ASSERTCRASH( road->isBridge() == FALSE, ("Redefining bridge '%s' as a road!\n", + DEBUG_ASSERTCRASH( road->isBridge() == FALSE, ("Redefining bridge '%s' as a road!", road->getName().str()) ); throw INI_INVALID_DATA; @@ -62,7 +62,7 @@ void INI::parseTerrainRoadDefinition( INI* ini ) if( road == NULL ) road = TheTerrainRoads->newRoad( name ); - DEBUG_ASSERTCRASH( road, ("Unable to allocate road '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( road, ("Unable to allocate road '%s'", name.str()) ); // parse the ini definition ini->initFromINI( road, road->getRoadFieldParse() ); diff --git a/Generals/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp b/Generals/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp index d7a582fe80..60f16de728 100644 --- a/Generals/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp +++ b/Generals/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp @@ -104,7 +104,7 @@ void INI::parseWebpageURLDefinition( INI* ini ) // } // end if -// DEBUG_ASSERTCRASH( track, ("parseMusicTrackDefinition: Unable to allocate track '%s'\n", +// DEBUG_ASSERTCRASH( track, ("parseMusicTrackDefinition: Unable to allocate track '%s'", // name.str()) ); // parse the ini definition diff --git a/Generals/Code/GameEngine/Source/Common/RTS/ActionManager.cpp b/Generals/Code/GameEngine/Source/Common/RTS/ActionManager.cpp index 49ddc3358f..d842ebebd7 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/ActionManager.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/ActionManager.cpp @@ -479,12 +479,12 @@ Bool ActionManager::canResumeConstructionOf( const Object *obj, if( builder ) { AIUpdateInterface *ai = builder->getAI(); - DEBUG_ASSERTCRASH( ai, ("Builder object does not have an AI interface!\n") ); + DEBUG_ASSERTCRASH( ai, ("Builder object does not have an AI interface!") ); if( ai ) { DozerAIInterface *dozerAI = ai->getDozerAIInterface(); - DEBUG_ASSERTCRASH( dozerAI, ("Builder object doest not have a DozerAI interface!\n") ); + DEBUG_ASSERTCRASH( dozerAI, ("Builder object doest not have a DozerAI interface!") ); if( dozerAI ) { diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Energy.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Energy.cpp index 49df05a3fe..aa7b8a8348 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/Energy.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/Energy.cpp @@ -69,7 +69,7 @@ Int Energy::getProduction() const //----------------------------------------------------------------------------- Real Energy::getEnergySupplyRatio() const { - DEBUG_ASSERTCRASH(m_energyProduction >= 0 && m_energyConsumption >= 0, ("neg Energy numbers\n")); + DEBUG_ASSERTCRASH(m_energyProduction >= 0 && m_energyConsumption >= 0, ("neg Energy numbers")); if (m_energyConsumption == 0) return (Real)m_energyProduction; diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp index fd22adddf9..7e03e4330a 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -354,7 +354,7 @@ Player::Player( Int playerIndex ) void Player::init(const PlayerTemplate* pt) { - DEBUG_ASSERTCRASH(m_playerTeamPrototypes.size() == 0, ("Player::m_playerTeamPrototypes is not empty at game start!\n")); + DEBUG_ASSERTCRASH(m_playerTeamPrototypes.size() == 0, ("Player::m_playerTeamPrototypes is not empty at game start!")); m_skillPointsModifier = 1.0f; m_attackedFrame = 0; @@ -756,7 +756,7 @@ void Player::initFromDict(const Dict* d) { AsciiString tmplname = d->getAsciiString(TheKey_playerFaction); const PlayerTemplate* pt = ThePlayerTemplateStore->findPlayerTemplate(NAMEKEY(tmplname)); - DEBUG_ASSERTCRASH(pt != NULL, ("PlayerTemplate %s not found -- this is an obsolete map (please open and resave in WB)\n",tmplname.str())); + DEBUG_ASSERTCRASH(pt != NULL, ("PlayerTemplate %s not found -- this is an obsolete map (please open and resave in WB)",tmplname.str())); init(pt); @@ -2689,7 +2689,7 @@ void Player::removeRadar( Bool disableProof ) Bool hadRadar = hasRadar(); // decrement count - DEBUG_ASSERTCRASH( m_radarCount > 0, ("removeRadar: An Object is taking its radar away, but the player radar count says they don't have radar!\n") ); + DEBUG_ASSERTCRASH( m_radarCount > 0, ("removeRadar: An Object is taking its radar away, but the player radar count says they don't have radar!") ); --m_radarCount; if( disableProof ) diff --git a/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp b/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp index 9f8dfdbfc0..cbfd431e95 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/PlayerList.cpp @@ -166,7 +166,7 @@ void PlayerList::newGame() if (!setLocal) { - DEBUG_ASSERTCRASH(TheNetwork, ("*** Map has no human player... picking first nonneutral player for control\n")); + DEBUG_ASSERTCRASH(TheNetwork, ("*** Map has no human player... picking first nonneutral player for control")); for( i = 0; i < TheSidesList->getNumSides(); i++) { Player* p = getNthPlayer(i); diff --git a/Generals/Code/GameEngine/Source/Common/RTS/ProductionPrerequisite.cpp b/Generals/Code/GameEngine/Source/Common/RTS/ProductionPrerequisite.cpp index ec1f25b377..bd3d94715d 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/ProductionPrerequisite.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/ProductionPrerequisite.cpp @@ -88,7 +88,7 @@ void ProductionPrerequisite::resolveNames() /** @todo for now removing this assert until we can completely remove the GDF stuff, the problem is that some INI files refer to GDF names, and they aren't yet loaded in the world builder but will all go away later anyway etc */ - DEBUG_ASSERTCRASH(m_prereqUnits[i].unit,("could not find prereq %s\n",m_prereqUnits[i].name.str())); + DEBUG_ASSERTCRASH(m_prereqUnits[i].unit,("could not find prereq %s",m_prereqUnits[i].name.str())); m_prereqUnits[i].name.clear(); // we're done with it diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp index f693d799d2..eeaa47a6e0 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp @@ -236,7 +236,7 @@ void TeamFactory::initTeam(const AsciiString& name, const AsciiString& owner, Bo { DEBUG_ASSERTCRASH(findTeamPrototype(name)==NULL,("team already exists")); Player *pOwner = ThePlayerList->findPlayerWithNameKey(NAMEKEY(owner)); - DEBUG_ASSERTCRASH(pOwner, ("no owner found for team %s (%s)\n",name.str(),owner.str())); + DEBUG_ASSERTCRASH(pOwner, ("no owner found for team %s (%s)",name.str(),owner.str())); if (!pOwner) pOwner = ThePlayerList->getNeutralPlayer(); /*TeamPrototype *tp =*/ newInstance(TeamPrototype)(this, name, pOwner, isSingleton, d, ++m_uniqueTeamPrototypeID); diff --git a/Generals/Code/GameEngine/Source/Common/Recorder.cpp b/Generals/Code/GameEngine/Source/Common/Recorder.cpp index 965ebce153..2cf23da987 100644 --- a/Generals/Code/GameEngine/Source/Common/Recorder.cpp +++ b/Generals/Code/GameEngine/Source/Common/Recorder.cpp @@ -528,7 +528,7 @@ void RecorderClass::updateRecord() } if (needFlush) { - DEBUG_ASSERTCRASH(m_file != NULL, ("RecorderClass::updateRecord() - unexpected call to fflush(m_file)\n")); + DEBUG_ASSERTCRASH(m_file != NULL, ("RecorderClass::updateRecord() - unexpected call to fflush(m_file)")); fflush(m_file); } } diff --git a/Generals/Code/GameEngine/Source/Common/StateMachine.cpp b/Generals/Code/GameEngine/Source/Common/StateMachine.cpp index a486d1d414..f16e426144 100644 --- a/Generals/Code/GameEngine/Source/Common/StateMachine.cpp +++ b/Generals/Code/GameEngine/Source/Common/StateMachine.cpp @@ -486,7 +486,7 @@ StateReturnType StateMachine::updateStateMachine() void StateMachine::defineState( StateID id, State *state, StateID successID, StateID failureID, const StateConditionInfo* conditions ) { #ifdef STATE_MACHINE_DEBUG - DEBUG_ASSERTCRASH(m_stateMap.find( id ) == m_stateMap.end(), ("duplicate state ID in statemachine %s\n",m_name.str())); + DEBUG_ASSERTCRASH(m_stateMap.find( id ) == m_stateMap.end(), ("duplicate state ID in statemachine %s",m_name.str())); #endif // map the ID to the state diff --git a/Generals/Code/GameEngine/Source/Common/System/AsciiString.cpp b/Generals/Code/GameEngine/Source/Common/System/AsciiString.cpp index af1efbf3be..a05b52a3b7 100644 --- a/Generals/Code/GameEngine/Source/Common/System/AsciiString.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/AsciiString.cpp @@ -138,7 +138,7 @@ void AsciiString::ensureUniqueBufferOfSize(int numCharsNeeded, Bool preserveData return; } - DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != NULL, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.\n")); + DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != NULL, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.")); DEBUG_ASSERTCRASH(numCharsNeeded <= MAX_LEN, ("AsciiString::ensureUniqueBufferOfSize exceeds max string length %d with requested length %d", MAX_LEN, numCharsNeeded)); int minBytes = sizeof(AsciiStringData) + numCharsNeeded*sizeof(char); int actualBytes = TheDynamicMemoryAllocator->getActualAllocationSize(minBytes); @@ -188,7 +188,7 @@ void AsciiString::releaseBuffer() // ----------------------------------------------------- AsciiString::AsciiString(const char* s) : m_data(0) { - //DEBUG_ASSERTCRASH(isMemoryManagerOfficiallyInited(), ("Initializing AsciiStrings prior to main (ie, as static vars) can cause memory leak reporting problems. Are you sure you want to do this?\n")); + //DEBUG_ASSERTCRASH(isMemoryManagerOfficiallyInited(), ("Initializing AsciiStrings prior to main (ie, as static vars) can cause memory leak reporting problems. Are you sure you want to do this?")); int len = (s)?strlen(s):0; if (len) { diff --git a/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp b/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp index f47b1a0553..bd13b41e83 100644 --- a/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp @@ -590,7 +590,7 @@ void BuildAssistant::iterateFootprint( const ThingTemplate *build, else { - DEBUG_ASSERTCRASH( 0, ("iterateFootprint: Undefined geometry '%d' for '%s'\n", + DEBUG_ASSERTCRASH( 0, ("iterateFootprint: Undefined geometry '%d' for '%s'", build->getTemplateGeometryInfo().getGeomType(), build->getName().str()) ); return; diff --git a/Generals/Code/GameEngine/Source/Common/System/GameCommon.cpp b/Generals/Code/GameEngine/Source/Common/System/GameCommon.cpp index e85783ad91..856520c0aa 100644 --- a/Generals/Code/GameEngine/Source/Common/System/GameCommon.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/GameCommon.cpp @@ -50,7 +50,7 @@ const char *TheRelationshipNames[] = //------------------------------------------------------------------------------------------------- Real normalizeAngle(Real angle) { - DEBUG_ASSERTCRASH(!_isnan(angle), ("Angle is NAN in normalizeAngle!\n")); + DEBUG_ASSERTCRASH(!_isnan(angle), ("Angle is NAN in normalizeAngle!")); if( _isnan(angle) ) return 0;// ARGH!!!! Don't assert and then not handle it! Error bad! Fix error! diff --git a/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp b/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp index 3258bfb89f..5123890295 100644 --- a/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp @@ -1605,7 +1605,7 @@ Int MemoryPool::freeBlob(MemoryPoolBlob* blob) // save these for later... Int totalBlocksInBlob = blob->getTotalBlockCount(); Int usedBlocksInBlob = blob->getUsedBlockCount(); - DEBUG_ASSERTCRASH(usedBlocksInBlob == 0, ("freeing a nonempty blob (%d)\n",usedBlocksInBlob)); + DEBUG_ASSERTCRASH(usedBlocksInBlob == 0, ("freeing a nonempty blob (%d)",usedBlocksInBlob)); // this is really just an estimate... will be too small in debug mode. Int amtFreed = totalBlocksInBlob * getAllocationSize() + sizeof(MemoryPoolBlob); @@ -3193,7 +3193,7 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en { any += dma->debugDmaReportLeaks(); } - DEBUG_ASSERTCRASH(!any, ("There were %d memory leaks. Please fix them.\n",any)); + DEBUG_ASSERTCRASH(!any, ("There were %d memory leaks. Please fix them.",any)); DEBUG_LOG(("------------------------------------------")); DEBUG_LOG(("End Simple Leak Report")); DEBUG_LOG(("------------------------------------------")); @@ -3539,7 +3539,7 @@ void shutdownMemoryManager() #ifdef MEMORYPOOL_DEBUG DEBUG_LOG(("Peak system allocation was %d bytes",thePeakSystemAllocationInBytes)); DEBUG_LOG(("Wasted DMA space (peak) was %d bytes",thePeakWastedDMA)); - DEBUG_ASSERTCRASH(theTotalSystemAllocationInBytes == 0, ("Leaked a total of %d raw bytes\n", theTotalSystemAllocationInBytes)); + DEBUG_ASSERTCRASH(theTotalSystemAllocationInBytes == 0, ("Leaked a total of %d raw bytes", theTotalSystemAllocationInBytes)); #endif } @@ -3559,7 +3559,7 @@ void* createW3DMemPool(const char *poolName, int allocationSize) //----------------------------------------------------------------------------- void* allocateFromW3DMemPool(void* pool, int allocationSize) { - DEBUG_ASSERTCRASH(pool, ("pool is null\n")); + DEBUG_ASSERTCRASH(pool, ("pool is null")); DEBUG_ASSERTCRASH(pool && ((MemoryPool*)pool)->getAllocationSize() == allocationSize, ("bad w3d pool size %s",((MemoryPool*)pool)->getPoolName())); return ((MemoryPool*)pool)->allocateBlock("allocateFromW3DMemPool"); } @@ -3567,7 +3567,7 @@ void* allocateFromW3DMemPool(void* pool, int allocationSize) //----------------------------------------------------------------------------- void* allocateFromW3DMemPool(void* pool, int allocationSize, const char* msg, int unused) { - DEBUG_ASSERTCRASH(pool, ("pool is null\n")); + DEBUG_ASSERTCRASH(pool, ("pool is null")); DEBUG_ASSERTCRASH(pool && ((MemoryPool*)pool)->getAllocationSize() == allocationSize, ("bad w3d pool size %s",((MemoryPool*)pool)->getPoolName())); return ((MemoryPool*)pool)->allocateBlock(msg); } @@ -3575,6 +3575,6 @@ void* allocateFromW3DMemPool(void* pool, int allocationSize, const char* msg, in //----------------------------------------------------------------------------- void freeFromW3DMemPool(void* pool, void* p) { - DEBUG_ASSERTCRASH(pool, ("pool is null\n")); + DEBUG_ASSERTCRASH(pool, ("pool is null")); ((MemoryPool*)pool)->freeBlock(p); } diff --git a/Generals/Code/GameEngine/Source/Common/System/Radar.cpp b/Generals/Code/GameEngine/Source/Common/System/Radar.cpp index d18fd2ac98..de7d1cce01 100644 --- a/Generals/Code/GameEngine/Source/Common/System/Radar.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/Radar.cpp @@ -331,7 +331,7 @@ void Radar::newMap( TerrainLogic *terrain ) // keep a pointer for our radar window Int id = NAMEKEY( "ControlBar.wnd:LeftHUD" ); m_radarWindow = TheWindowManager->winGetWindowFromId( NULL, id ); - DEBUG_ASSERTCRASH( m_radarWindow, ("Radar::newMap - Unable to find radar game window\n") ); + DEBUG_ASSERTCRASH( m_radarWindow, ("Radar::newMap - Unable to find radar game window") ); // reset all the data in the radar reset(); @@ -601,7 +601,7 @@ bool Radar::removeObject( Object *obj ) { // sanity - DEBUG_ASSERTCRASH( 0, ("Radar: Tried to remove object '%s' which was not found\n", + DEBUG_ASSERTCRASH( 0, ("Radar: Tried to remove object '%s' which was not found", obj->getTemplate()->getName().str()) ); return false; } // end else @@ -1382,7 +1382,7 @@ static void xferRadarObjectList( Xfer *xfer, RadarObject **head ) RadarObject *radarObject; // sanity - DEBUG_ASSERTCRASH( head != NULL, ("xferRadarObjectList - Invalid parameters\n" )); + DEBUG_ASSERTCRASH( head != NULL, ("xferRadarObjectList - Invalid parameters" )); // version XferVersion currentVersion = 1; diff --git a/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp b/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp index 284d194a80..9e774cb028 100644 --- a/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp @@ -794,7 +794,7 @@ AsciiString GameState::getMapLeafName(const AsciiString& in) const // at the name only // ++p; - DEBUG_ASSERTCRASH( p != NULL && *p != 0, ("GameState::xfer - Illegal map name encountered\n") ); + DEBUG_ASSERTCRASH( p != NULL && *p != 0, ("GameState::xfer - Illegal map name encountered") ); return p; } else @@ -1085,8 +1085,8 @@ static void addGameToAvailableList( AsciiString filename, void *userData ) AvailableGameInfo **listHead = (AvailableGameInfo **)userData; // sanity - DEBUG_ASSERTCRASH( listHead != NULL, ("addGameToAvailableList - Illegal parameters\n") ); - DEBUG_ASSERTCRASH( filename.isEmpty() == FALSE, ("addGameToAvailableList - Illegal filename\n") ); + DEBUG_ASSERTCRASH( listHead != NULL, ("addGameToAvailableList - Illegal parameters") ); + DEBUG_ASSERTCRASH( filename.isEmpty() == FALSE, ("addGameToAvailableList - Illegal filename") ); try { // get header info from this listbox diff --git a/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp b/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp index e820d5a237..19f1a3d7de 100644 --- a/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp @@ -111,7 +111,7 @@ static void embedPristineMap( AsciiString map, Xfer *xfer ) file->close(); // write the contents to the save file - DEBUG_ASSERTCRASH( xfer->getXferMode() == XFER_SAVE, ("embedPristineMap - Unsupposed xfer mode\n") ); + DEBUG_ASSERTCRASH( xfer->getXferMode() == XFER_SAVE, ("embedPristineMap - Unsupposed xfer mode") ); xfer->beginBlock(); xfer->xferUser( buffer, fileSize ); xfer->endBlock(); diff --git a/Generals/Code/GameEngine/Source/Common/System/UnicodeString.cpp b/Generals/Code/GameEngine/Source/Common/System/UnicodeString.cpp index b08523232d..bae146c650 100644 --- a/Generals/Code/GameEngine/Source/Common/System/UnicodeString.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/UnicodeString.cpp @@ -89,7 +89,7 @@ void UnicodeString::ensureUniqueBufferOfSize(int numCharsNeeded, Bool preserveDa return; } - DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != NULL, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.\n")); + DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != NULL, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.")); DEBUG_ASSERTCRASH(numCharsNeeded <= MAX_LEN, ("UnicodeString::ensureUniqueBufferOfSize exceeds max string length %d with requested length %d", MAX_LEN, numCharsNeeded)); int minBytes = sizeof(UnicodeStringData) + numCharsNeeded*sizeof(WideChar); int actualBytes = TheDynamicMemoryAllocator->getActualAllocationSize(minBytes); diff --git a/Generals/Code/GameEngine/Source/Common/System/Upgrade.cpp b/Generals/Code/GameEngine/Source/Common/System/Upgrade.cpp index c1d6c3f6bf..8d54153150 100644 --- a/Generals/Code/GameEngine/Source/Common/System/Upgrade.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/Upgrade.cpp @@ -488,7 +488,7 @@ void UpgradeCenter::parseUpgradeDefinition( INI *ini ) } // end if // sanity - DEBUG_ASSERTCRASH( upgrade, ("parseUpgradeDefinition: Unable to allocate upgrade '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( upgrade, ("parseUpgradeDefinition: Unable to allocate upgrade '%s'", name.str()) ); // parse the ini definition ini->initFromINI( upgrade, upgrade->getFieldParse() ); diff --git a/Generals/Code/GameEngine/Source/Common/Thing/Module.cpp b/Generals/Code/GameEngine/Source/Common/Thing/Module.cpp index 1785a6e7db..6da2cec579 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/Module.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/Module.cpp @@ -112,9 +112,9 @@ ObjectModule::ObjectModule( Thing *thing, const ModuleData* moduleData ) : Modul throw INI_INVALID_DATA; } - DEBUG_ASSERTCRASH( thing, ("Thing passed to ObjectModule is NULL!\n") ); + DEBUG_ASSERTCRASH( thing, ("Thing passed to ObjectModule is NULL!") ); m_object = AsObject(thing); - DEBUG_ASSERTCRASH( m_object, ("Thing passed to ObjectModule is not an Object!\n") ); + DEBUG_ASSERTCRASH( m_object, ("Thing passed to ObjectModule is not an Object!") ); } // end ObjectModule @@ -175,9 +175,9 @@ DrawableModule::DrawableModule( Thing *thing, const ModuleData* moduleData ) : M throw INI_INVALID_DATA; } - DEBUG_ASSERTCRASH( thing, ("Thing passed to DrawableModule is NULL!\n") ); + DEBUG_ASSERTCRASH( thing, ("Thing passed to DrawableModule is NULL!") ); m_drawable = AsDrawable(thing); - DEBUG_ASSERTCRASH( m_drawable, ("Thing passed to DrawableModule is not a Drawable!\n") ); + DEBUG_ASSERTCRASH( m_drawable, ("Thing passed to DrawableModule is not a Drawable!") ); } // end ~DrawableModule diff --git a/Generals/Code/GameEngine/Source/Common/Thing/Thing.cpp b/Generals/Code/GameEngine/Source/Common/Thing/Thing.cpp index f6157c85d8..57b18b4fca 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/Thing.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/Thing.cpp @@ -157,7 +157,7 @@ void Thing::setPositionZ( Real z ) TheTerrainLogic->alignOnTerrain(getOrientation(), pos, stickToGround, mtx ); setTransformMatrix(&mtx); } - DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'\n", m_template->getName().str() )); + DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() )); } //============================================================================= @@ -170,7 +170,7 @@ void Thing::setPosition( const Coord3D *pos ) Coord3D oldPos = m_cachedPos; Matrix3D oldMtx = m_transform; - //DEBUG_ASSERTCRASH(!(_isnan(pos->x) || _isnan(pos->y) || _isnan(pos->z)), ("Drawable/Object position NAN! '%s'\n", m_template->getName().str() )); + //DEBUG_ASSERTCRASH(!(_isnan(pos->x) || _isnan(pos->y) || _isnan(pos->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() )); m_transform.Set_X_Translation( pos->x ); m_transform.Set_Y_Translation( pos->y ); m_transform.Set_Z_Translation( pos->z ); @@ -186,7 +186,7 @@ void Thing::setPosition( const Coord3D *pos ) TheTerrainLogic->alignOnTerrain(getOrientation(), *pos, stickToGround, mtx ); setTransformMatrix(&mtx); } - DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'\n", m_template->getName().str() )); + DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() )); } //============================================================================= @@ -230,13 +230,13 @@ void Thing::setOrientation( Real angle ) x.z, y.z, z.z, pos.z ); } - //DEBUG_ASSERTCRASH(-PI <= angle && angle <= PI, ("Please pass only normalized (-PI..PI) angles to setOrientation (%f).\n", angle)); + //DEBUG_ASSERTCRASH(-PI <= angle && angle <= PI, ("Please pass only normalized (-PI..PI) angles to setOrientation (%f).", angle)); m_cachedAngle = normalizeAngle(angle); m_cachedPos = pos; m_cacheFlags &= ~VALID_DIRVECTOR; // but don't clear the altitude flags. reactToTransformChange(&oldMtx, &oldPos, oldAngle); - DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'\n", m_template->getName().str() )); + DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() )); } //============================================================================= @@ -257,7 +257,7 @@ void Thing::setTransformMatrix( const Matrix3D *mx ) m_cacheFlags = 0; reactToTransformChange(&oldMtx, &oldPos, oldAngle); - DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'\n", m_template->getName().str() )); + DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() )); } //------------------------------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp b/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp index e26a14d179..05678d1ff4 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp @@ -169,7 +169,7 @@ ThingTemplate* ThingFactory::newOverride( ThingTemplate *thingTemplate ) { // sanity - DEBUG_ASSERTCRASH( thingTemplate, ("newOverride(): NULL 'parent' thing template\n") ); + DEBUG_ASSERTCRASH( thingTemplate, ("newOverride(): NULL 'parent' thing template") ); // sanity just for debuging, the weapon must be in the master list to do overrides DEBUG_ASSERTCRASH( findTemplate( thingTemplate->getName() ) != NULL, @@ -312,7 +312,7 @@ Object *ThingFactory::newObject( const ThingTemplate *tmplate, Team *team, Objec tmplate = tmp; } - DEBUG_ASSERTCRASH(!tmplate->isKindOf(KINDOF_DRAWABLE_ONLY), ("You may not create Objects with the template %s, only Drawables\n",tmplate->getName().str())); + DEBUG_ASSERTCRASH(!tmplate->isKindOf(KINDOF_DRAWABLE_ONLY), ("You may not create Objects with the template %s, only Drawables",tmplate->getName().str())); // have the game logic create an object of the correct type. // (this will throw an exception on failure.) diff --git a/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp index 11e48d7fec..9d1702cbb4 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -595,7 +595,7 @@ static void parseArbitraryFXIntoMap( INI* ini, void *instance, void* /* store */ const char* name = (const char*)userData; const char* token = ini->getNextToken(); const FXList* fxl = TheFXListStore->findFXList(token); // could be null! - DEBUG_ASSERTCRASH(fxl != NULL || stricmp(token, "None") == 0, ("FXList %s not found!\n",token)); + DEBUG_ASSERTCRASH(fxl != NULL || stricmp(token, "None") == 0, ("FXList %s not found!",token)); mapFX->insert(std::make_pair(AsciiString(name), fxl)); } @@ -683,7 +683,7 @@ void ThingTemplate::parseRemoveModule(INI *ini, void *instance, void *store, con Bool removed = self->removeModuleInfo(modToRemove, removedModuleName); if (!removed) { - DEBUG_ASSERTCRASH(removed, ("RemoveModule %s was not found for %s. The game will crash now!\n",modToRemove, self->getName().str())); + DEBUG_ASSERTCRASH(removed, ("RemoveModule %s was not found for %s. The game will crash now!",modToRemove, self->getName().str())); throw INI_INVALID_DATA; } diff --git a/Generals/Code/GameEngine/Source/GameClient/Credits.cpp b/Generals/Code/GameEngine/Source/GameClient/Credits.cpp index 8e04ed6775..d796669777 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Credits.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Credits.cpp @@ -87,7 +87,7 @@ const FieldParse CreditsManager::m_creditsFieldParseTable[] = void INI::parseCredits( INI *ini ) { // find existing item if present - DEBUG_ASSERTCRASH( TheCredits, ("parseCredits: TheCredits has not been ininialized yet.\n") ); + DEBUG_ASSERTCRASH( TheCredits, ("parseCredits: TheCredits has not been ininialized yet.") ); if( !TheCredits ) return; @@ -460,7 +460,7 @@ void CreditsManager::addText( AsciiString text ) } break; default: - DEBUG_ASSERTCRASH( FALSE, ("CreditsManager::addText we tried to add a credit text with the wrong style before it. Style is %d\n", m_currentStyle) ); + DEBUG_ASSERTCRASH( FALSE, ("CreditsManager::addText we tried to add a credit text with the wrong style before it. Style is %d", m_currentStyle) ); delete cLine; } diff --git a/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp b/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp index 3e8e525ff8..d5f51904bc 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp @@ -198,7 +198,7 @@ static const char *drawableIconIndexToName( DrawableIconType iconIndex ) static DrawableIconType drawableIconNameToIndex( const char *iconName ) { - DEBUG_ASSERTCRASH( iconName != NULL, ("drawableIconNameToIndex - Illegal name\n") ); + DEBUG_ASSERTCRASH( iconName != NULL, ("drawableIconNameToIndex - Illegal name") ); for( Int i = ICON_FIRST; i < MAX_ICONS; ++i ) if( stricmp( TheDrawableIconNames[ i ], iconName ) == 0 ) @@ -2382,7 +2382,7 @@ void Drawable::setEmoticon( const AsciiString &name, Int duration ) Anim2DTemplate *animTemplate = TheAnim2DCollection->findTemplate( name ); if( animTemplate ) { - DEBUG_ASSERTCRASH( getIconInfo()->m_icon[ ICON_EMOTICON ] == NULL, ("Drawable::setEmoticon - Emoticon isn't empty, need to refuse to set or destroy the old one in favor of the new one\n") ); + DEBUG_ASSERTCRASH( getIconInfo()->m_icon[ ICON_EMOTICON ] == NULL, ("Drawable::setEmoticon - Emoticon isn't empty, need to refuse to set or destroy the old one in favor of the new one") ); if( getIconInfo()->m_icon[ ICON_EMOTICON ] == NULL ) { getIconInfo()->m_icon[ ICON_EMOTICON ] = newInstance(Anim2D)( animTemplate, TheAnim2DCollection ); @@ -3641,7 +3641,7 @@ DrawableID Drawable::getID( void ) const { // we should never be getting the ID of a drawable who doesn't yet have and ID assigned to it - DEBUG_ASSERTCRASH( m_id != 0, ("Drawable::getID - Using ID before it was assigned!!!!\n") ); + DEBUG_ASSERTCRASH( m_id != 0, ("Drawable::getID - Using ID before it was assigned!!!!") ); return m_id; @@ -4646,7 +4646,7 @@ void Drawable::xfer( Xfer *xfer ) // #ifdef DIRTY_CONDITION_FLAGS if( xfer->getXferMode() == XFER_SAVE ) - DEBUG_ASSERTCRASH( m_isModelDirty == FALSE, ("Drawble::xfer - m_isModelDirty is not FALSE!\n") ); + DEBUG_ASSERTCRASH( m_isModelDirty == FALSE, ("Drawble::xfer - m_isModelDirty is not FALSE!") ); else m_isModelDirty = TRUE; #endif diff --git a/Generals/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp b/Generals/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp index 1f0b0451d7..b7a86ead19 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp @@ -95,7 +95,7 @@ static ParticleSystem* createParticleSystem( Drawable *draw ) templateName.format("BeaconSmoke%6.6X", (0xffffff & obj->getIndicatorColor())); const ParticleSystemTemplate *particleTemplate = TheParticleSystemManager->findTemplate( templateName ); - DEBUG_ASSERTCRASH(particleTemplate, ("Could not find particle system %s\n", templateName.str())); + DEBUG_ASSERTCRASH(particleTemplate, ("Could not find particle system %s", templateName.str())); if (particleTemplate) { diff --git a/Generals/Code/GameEngine/Source/GameClient/FXList.cpp b/Generals/Code/GameEngine/Source/GameClient/FXList.cpp index a57ac72b2b..90e0339c1b 100644 --- a/Generals/Code/GameEngine/Source/GameClient/FXList.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/FXList.cpp @@ -265,7 +265,7 @@ class RayEffectFXNugget : public FXNugget virtual void doFXPos(const Coord3D *primary, const Matrix3D* /*primaryMtx*/, const Real /*primarySpeed*/, const Coord3D * secondary, const Real /*overrideRadius*/ ) const { const ThingTemplate* tmpl = TheThingFactory->findTemplate(m_templateName); - DEBUG_ASSERTCRASH(tmpl, ("RayEffect %s not found\n",m_templateName.str())); + DEBUG_ASSERTCRASH(tmpl, ("RayEffect %s not found",m_templateName.str())); if (primary && secondary && tmpl) { Coord3D sourcePos = *primary; @@ -595,7 +595,7 @@ class ParticleSystemFXNugget : public FXNugget } const ParticleSystemTemplate *tmp = TheParticleSystemManager->findTemplate(m_name); - DEBUG_ASSERTCRASH(tmp, ("ParticleSystem %s not found\n",m_name.str())); + DEBUG_ASSERTCRASH(tmp, ("ParticleSystem %s not found",m_name.str())); if (tmp) { for (Int i = 0; i < m_count; i++ ) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index 19e9d7063b..24780e9f8e 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -783,7 +783,7 @@ void CommandSet::parseCommandButton( INI* ini, void *instance, void *store, cons Int buttonIndex = (Int)userData; // sanity - DEBUG_ASSERTCRASH( buttonIndex < MAX_COMMANDS_PER_SET, ("parseCommandButton: button index '%d' out of range\n", + DEBUG_ASSERTCRASH( buttonIndex < MAX_COMMANDS_PER_SET, ("parseCommandButton: button index '%d' out of range", buttonIndex) ); // save it @@ -1526,7 +1526,7 @@ void ControlBar::update( void ) { // we better be in the default none context - DEBUG_ASSERTCRASH( m_currContext == CB_CONTEXT_NONE, ("ControlBar::update no selection, but not we're not showing the default NONE context\n") ); + DEBUG_ASSERTCRASH( m_currContext == CB_CONTEXT_NONE, ("ControlBar::update no selection, but not we're not showing the default NONE context") ); return; } // end if @@ -1987,7 +1987,7 @@ CommandButton *ControlBar::newCommandButtonOverride( CommandButton *buttonToOver } // sanity - DEBUG_ASSERTCRASH( commandSet, ("parseCommandSetDefinition: Unable to allocate set '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( commandSet, ("parseCommandSetDefinition: Unable to allocate set '%s'", name.str()) ); // parse the ini definition ini->initFromINI( commandSet, commandSet->friend_getFieldParse() ); @@ -2350,7 +2350,7 @@ void ControlBar::switchToContext( ControlBarContext context, Drawable *draw ) default: { - DEBUG_ASSERTCRASH( 0, ("ControlBar::switchToContext, unknown context '%d'\n", context) ); + DEBUG_ASSERTCRASH( 0, ("ControlBar::switchToContext, unknown context '%d'", context) ); break; } // end default @@ -2411,7 +2411,7 @@ void ControlBar::setControlCommand( GameWindow *button, const CommandButton *com if( button->winGetInputFunc() != GadgetPushButtonInput ) { - DEBUG_ASSERTCRASH( 0, ("setControlCommand: Window is not a button\n") ); + DEBUG_ASSERTCRASH( 0, ("setControlCommand: Window is not a button") ); return; } // end if @@ -2420,7 +2420,7 @@ void ControlBar::setControlCommand( GameWindow *button, const CommandButton *com if( commandButton == NULL ) { - DEBUG_ASSERTCRASH( 0, ("setControlCommand: NULL commandButton passed in\n") ); + DEBUG_ASSERTCRASH( 0, ("setControlCommand: NULL commandButton passed in") ); return; } // end if @@ -2522,7 +2522,7 @@ void ControlBar::setControlCommand( const AsciiString& buttonWindowName, GameWin if( win == NULL ) { - DEBUG_ASSERTCRASH( 0, ("setControlCommand: Unable to find window '%s'\n", buttonWindowName.str()) ); + DEBUG_ASSERTCRASH( 0, ("setControlCommand: Unable to find window '%s'", buttonWindowName.str()) ); return; } // end if @@ -2693,7 +2693,7 @@ void ControlBar::showRallyPoint( const Coord3D *loc ) const ThingTemplate* ttn = TheThingFactory->findTemplate("RallyPointMarker"); marker = TheThingFactory->newDrawable( ttn ); - DEBUG_ASSERTCRASH( marker, ("showRallyPoint: Unable to create rally point drawable\n") ); + DEBUG_ASSERTCRASH( marker, ("showRallyPoint: Unable to create rally point drawable") ); if (marker) { marker->setDrawableStatus(DRAWABLE_STATUS_NO_SAVE); @@ -2705,7 +2705,7 @@ void ControlBar::showRallyPoint( const Coord3D *loc ) marker = TheGameClient->findDrawableByID( m_rallyPointDrawableID ); // sanity - DEBUG_ASSERTCRASH( marker, ("showRallyPoint: No rally point marker found\n" ) ); + DEBUG_ASSERTCRASH( marker, ("showRallyPoint: No rally point marker found" ) ); // set the position of the rally point drawble to the position passed in marker->setPosition( loc ); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp index c81f53724f..b5d396fe20 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp @@ -93,7 +93,7 @@ void ControlBar::populateInvDataCallback( Object *obj, void *userData ) if( data->currIndex > data->maxIndex ) { - DEBUG_ASSERTCRASH( 0, ("There is not enough GUI slots to hold the # of items inside a '%s'\n", + DEBUG_ASSERTCRASH( 0, ("There is not enough GUI slots to hold the # of items inside a '%s'", data->transport->getTemplate()->getName().str()) ); return; @@ -101,7 +101,7 @@ void ControlBar::populateInvDataCallback( Object *obj, void *userData ) // get the window control that we're going to put our smiling faces in GameWindow *control = data->controls[ data->currIndex ]; - DEBUG_ASSERTCRASH( control, ("populateInvDataCallback: Control not found\n") ); + DEBUG_ASSERTCRASH( control, ("populateInvDataCallback: Control not found") ); // assign our control and object id to the transport data m_containData[ data->currIndex ].control = control; @@ -717,7 +717,7 @@ void ControlBar::updateContextCommand( void ) static NameKeyType winID = TheNameKeyGenerator->nameToKey( "ControlBar.wnd:ButtonQueue01" ); GameWindow *win = TheWindowManager->winGetWindowFromId( m_contextParent[ CP_BUILD_QUEUE ], winID ); - DEBUG_ASSERTCRASH( win, ("updateContextCommand: Unable to find first build queue button\n") ); + DEBUG_ASSERTCRASH( win, ("updateContextCommand: Unable to find first build queue button") ); // UnicodeString text; // // text.format( L"%.0f%%", produce->getPercentComplete() ); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp index 07549bcaf7..78e2f08523 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp @@ -264,7 +264,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, break; // sanity, we must have something to build - DEBUG_ASSERTCRASH( whatToBuild, ("Undefined BUILD command for object '%s'\n", + DEBUG_ASSERTCRASH( whatToBuild, ("Undefined BUILD command for object '%s'", commandButton->getThingTemplate()->getName().str()) ); CanMakeType cmt = TheBuildAssistant->canMakeUnit(factory, whatToBuild); @@ -292,7 +292,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, } else if (cmt != CANMAKE_OK) { - DEBUG_ASSERTCRASH( 0, ("Cannot create '%s' because the factory object '%s' returns false for canMakeUnit\n", + DEBUG_ASSERTCRASH( 0, ("Cannot create '%s' because the factory object '%s' returns false for canMakeUnit", whatToBuild->getName().str(), factory->getTemplate()->getName().str()) ); break; @@ -305,7 +305,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, if( pu == NULL ) { - DEBUG_ASSERTCRASH( 0, ("Cannot create '%s' because the factory object '%s' is not capable of producting units\n", + DEBUG_ASSERTCRASH( 0, ("Cannot create '%s' because the factory object '%s' is not capable of producting units", whatToBuild->getName().str(), factory->getTemplate()->getName().str()) ); break; @@ -339,7 +339,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, if( i == MAX_BUILD_QUEUE_BUTTONS ) { - DEBUG_ASSERTCRASH( 0, ("Control not found in build queue data\n") ); + DEBUG_ASSERTCRASH( 0, ("Control not found in build queue data") ); break; } // end if @@ -372,7 +372,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, case GUI_COMMAND_PLAYER_UPGRADE: { const UpgradeTemplate *upgradeT = commandButton->getUpgradeTemplate(); - DEBUG_ASSERTCRASH( upgradeT, ("Undefined upgrade '%s' in player upgrade command\n", "UNKNOWN") ); + DEBUG_ASSERTCRASH( upgradeT, ("Undefined upgrade '%s' in player upgrade command", "UNKNOWN") ); // sanity if( obj == NULL || upgradeT == NULL ) @@ -408,7 +408,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, case GUI_COMMAND_OBJECT_UPGRADE: { const UpgradeTemplate *upgradeT = commandButton->getUpgradeTemplate(); - DEBUG_ASSERTCRASH( upgradeT, ("Undefined upgrade '%s' in object upgrade command\n", "UNKNOWN") ); + DEBUG_ASSERTCRASH( upgradeT, ("Undefined upgrade '%s' in object upgrade command", "UNKNOWN") ); // sanity if( upgradeT == NULL ) break; @@ -463,7 +463,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, if( i == MAX_BUILD_QUEUE_BUTTONS ) { - DEBUG_ASSERTCRASH( 0, ("Control not found in build queue data\n") ); + DEBUG_ASSERTCRASH( 0, ("Control not found in build queue data") ); break; } // end if @@ -731,7 +731,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, //--------------------------------------------------------------------------------------------- default: - DEBUG_ASSERTCRASH( 0, ("Unknown command '%d'\n", commandButton->getCommandType()) ); + DEBUG_ASSERTCRASH( 0, ("Unknown command '%d'", commandButton->getCommandType()) ); return CBC_COMMAND_NOT_USED; } // end switch diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp index 5c09932d42..1511e5bcdf 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp @@ -232,7 +232,7 @@ void ControlBar::populateMultiSelect( void ) const DrawableList *selectedDrawables = TheInGameUI->getAllSelectedDrawables(); // sanity - DEBUG_ASSERTCRASH( selectedDrawables->empty() == FALSE, ("populateMultiSelect: Drawable list is empty\n") ); + DEBUG_ASSERTCRASH( selectedDrawables->empty() == FALSE, ("populateMultiSelect: Drawable list is empty") ); // loop through all the selected drawables for( DrawableListCIt it = selectedDrawables->begin(); @@ -313,7 +313,7 @@ void ControlBar::updateContextMultiSelect( void ) const DrawableList *selectedDrawables = TheInGameUI->getAllSelectedDrawables(); // sanity - DEBUG_ASSERTCRASH( selectedDrawables->empty() == FALSE, ("populateMultiSelect: Drawable list is empty\n") ); + DEBUG_ASSERTCRASH( selectedDrawables->empty() == FALSE, ("populateMultiSelect: Drawable list is empty") ); // loop through all the selected drawable IDs for( DrawableListCIt it = selectedDrawables->begin(); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp index f543255ed6..73281d5991 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp @@ -54,7 +54,7 @@ void ControlBar::updateOCLTimerTextDisplay( UnsignedInt totalSeconds, Real perce GameWindow *barWindow = TheWindowManager->winGetWindowFromId( NULL, barID ); // santiy - DEBUG_ASSERTCRASH( descWindow, ("Under construction window not found\n") ); + DEBUG_ASSERTCRASH( descWindow, ("Under construction window not found") ); Int minutes = totalSeconds / 60; Int seconds = totalSeconds - (minutes * 60); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp index 090be0f759..c65071aa04 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp @@ -228,7 +228,7 @@ void INI::parseControlBarResizerDefinition( INI* ini ) // // // image not found, create a new one // rWin = resizer->newResizerWindow(name); -// DEBUG_ASSERTCRASH( rWin, ("parseControlBarResizerDefinition: unable to allocate ResizerWindow for '%s'\n", +// DEBUG_ASSERTCRASH( rWin, ("parseControlBarResizerDefinition: unable to allocate ResizerWindow for '%s'", // name.str()) ); // // } // end if diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp index ffb10797fc..8f6de28d10 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp @@ -437,9 +437,9 @@ void ControlBarScheme::init(void) win= TheWindowManager->winGetWindowFromId( NULL, TheNameKeyGenerator->nameToKey( "ControlBar.wnd:PopupCommunicator" ) ); if(win) { -// DEBUG_ASSERTCRASH(m_buddyButtonEnable, ("No enable button image for communicator in scheme %s!\n", m_name.str())); -// DEBUG_ASSERTCRASH(m_buddyButtonHightlited, ("No hilite button image for communicator in scheme %s!\n", m_name.str())); -// DEBUG_ASSERTCRASH(m_buddyButtonPushed, ("No pushed button image for communicator in scheme %s!\n", m_name.str())); +// DEBUG_ASSERTCRASH(m_buddyButtonEnable, ("No enable button image for communicator in scheme %s!", m_name.str())); +// DEBUG_ASSERTCRASH(m_buddyButtonHightlited, ("No hilite button image for communicator in scheme %s!", m_name.str())); +// DEBUG_ASSERTCRASH(m_buddyButtonPushed, ("No pushed button image for communicator in scheme %s!", m_name.str())); GadgetButtonSetEnabledImage(win, m_buddyButtonEnable); GadgetButtonSetHiliteImage(win, m_buddyButtonHightlited); GadgetButtonSetHiliteSelectedImage(win, m_buddyButtonPushed); @@ -674,7 +674,7 @@ void ControlBarScheme::addAnimation( ControlBarSchemeAnimation *schemeAnim ) { if( !schemeAnim ) { - DEBUG_ASSERTCRASH(FALSE,("Trying to add a null animation to the controlbarscheme\n")); + DEBUG_ASSERTCRASH(FALSE,("Trying to add a null animation to the controlbarscheme")); return; } m_animations.push_back( schemeAnim ); @@ -687,13 +687,13 @@ void ControlBarScheme::addImage( ControlBarSchemeImage *schemeImage ) { if( !schemeImage ) { - DEBUG_ASSERTCRASH(FALSE,("Trying to add a null image to the controlbarscheme\n")); + DEBUG_ASSERTCRASH(FALSE,("Trying to add a null image to the controlbarscheme")); return; } if(schemeImage->m_layer < 0 || schemeImage->m_layer >= MAX_CONTROL_BAR_SCHEME_IMAGE_LAYERS) { - DEBUG_ASSERTCRASH(FALSE,("SchemeImage %s attempted to be added to layer %d which is not Between to %d, %d\n", + DEBUG_ASSERTCRASH(FALSE,("SchemeImage %s attempted to be added to layer %d which is not Between to %d, %d", schemeImage->m_name.str(), schemeImage->m_layer, 0, MAX_CONTROL_BAR_SCHEME_IMAGE_LAYERS)); // bring the foobar to the front so we make it obvious that something's wrong schemeImage->m_layer = 0; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp index 9fb3ddb383..06eaaf1bac 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp @@ -107,7 +107,7 @@ void ControlBar::populateStructureInventory( Object *building ) // get the contain module of the object ContainModuleInterface *contain = building->getContain(); - DEBUG_ASSERTCRASH( contain, ("Object in structure inventory does not contain a Contain Module\n") ); + DEBUG_ASSERTCRASH( contain, ("Object in structure inventory does not contain a Contain Module") ); if (!contain) return; @@ -213,7 +213,7 @@ void ControlBar::updateContextStructureInventory( void ) // about we need to repopulate the buttons of the interface // ContainModuleInterface *contain = source->getContain(); - DEBUG_ASSERTCRASH( contain, ("No contain module defined for object in the iventory bar\n") ); + DEBUG_ASSERTCRASH( contain, ("No contain module defined for object in the iventory bar") ); if (!contain) return; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp index 1b42b8ff00..f16e50fabe 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp @@ -52,7 +52,7 @@ void ControlBar::updateConstructionTextDisplay( Object *obj ) GameWindow *descWindow = TheWindowManager->winGetWindowFromId( NULL, descID ); // santiy - DEBUG_ASSERTCRASH( descWindow, ("Under construction window not found\n") ); + DEBUG_ASSERTCRASH( descWindow, ("Under construction window not found") ); // format the message text.format( TheGameText->fetch( "CONTROLBAR:UnderConstructionDesc" ), diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp index 2a82d0ec37..9351a4d37d 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp @@ -101,7 +101,7 @@ void InGamePopupMessageInit( WindowLayout *layout, void *userData ) if(!pMData) { - DEBUG_ASSERTCRASH(pMData, ("We're in InGamePopupMessage without a pointer to pMData\n") ); + DEBUG_ASSERTCRASH(pMData, ("We're in InGamePopupMessage without a pointer to pMData") ); ///< @todo: add a call to the close this bitch method when I implement it CLH return; } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp index a37b5bcd46..5690561cb5 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp @@ -1335,7 +1335,7 @@ WindowMsgHandledType MainMenuSystem( GameWindow *window, UnsignedInt msg, dontAllowTransitions = TRUE; // SaveLoadLayoutType layoutType = SLLT_LOAD_ONLY; // WindowLayout *saveLoadMenuLayout = TheShell->getSaveLoadMenuLayout(); -// DEBUG_ASSERTCRASH( saveLoadMenuLayout, ("Unable to get save load menu layout.\n") ); +// DEBUG_ASSERTCRASH( saveLoadMenuLayout, ("Unable to get save load menu layout.") ); // saveLoadMenuLayout->runInit( &layoutType ); // saveLoadMenuLayout->hide( FALSE ); // saveLoadMenuLayout->bringForward(); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp index 8b9c2c8224..bdd4e32629 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp @@ -135,7 +135,7 @@ void PopupReplayInit( WindowLayout *layout, void *userData ) // get the listbox that will have the save games in it GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( NULL, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("PopupReplayInit - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("PopupReplayInit - Unable to find games listbox") ); // populate the listbox with the save games on disk PopulateReplayFileListbox(listboxGames); @@ -296,7 +296,7 @@ void reallySaveReplay(void) // get the listbox that will have the save games in it GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( parent, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("reallySaveReplay - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("reallySaveReplay - Unable to find games listbox") ); // populate the listbox with the save games on disk PopulateReplayFileListbox(listboxGames); @@ -323,7 +323,7 @@ void reallySaveReplay(void) // get the listbox that will have the save games in it GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( parent, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("reallySaveReplay - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("reallySaveReplay - Unable to find games listbox") ); // populate the listbox with the save games on disk PopulateReplayFileListbox(listboxGames); @@ -375,7 +375,7 @@ WindowMsgHandledType PopupReplaySystem( GameWindow *window, UnsignedInt msg, GameWindow *control = (GameWindow *)mData1; GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( window, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("PopupReplaySystem - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("PopupReplaySystem - Unable to find games listbox") ); // // handle games listbox, when certain items are selected in the listbox only some @@ -389,7 +389,7 @@ WindowMsgHandledType PopupReplaySystem( GameWindow *window, UnsignedInt msg, UnicodeString filename; filename = GadgetListBoxGetText(listboxGames, rowSelected); GameWindow *textEntryReplayName = TheWindowManager->winGetWindowFromId( window, textEntryReplayNameKey ); - DEBUG_ASSERTCRASH( textEntryReplayName != NULL, ("PopupReplaySystem - Unable to find text entry\n") ); + DEBUG_ASSERTCRASH( textEntryReplayName != NULL, ("PopupReplaySystem - Unable to find text entry") ); GadgetTextEntrySetText(textEntryReplayName, filename); } } @@ -427,7 +427,7 @@ WindowMsgHandledType PopupReplaySystem( GameWindow *window, UnsignedInt msg, { // get the filename, and see if we are overwriting GameWindow *textEntryReplayName = TheWindowManager->winGetWindowFromId( window, textEntryReplayNameKey ); - DEBUG_ASSERTCRASH( textEntryReplayName != NULL, ("PopupReplaySystem - Unable to find text entry\n") ); + DEBUG_ASSERTCRASH( textEntryReplayName != NULL, ("PopupReplaySystem - Unable to find text entry") ); UnicodeString filename = GadgetTextEntryGetText( textEntryReplayName ); if (filename.isEmpty()) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp index ddad0deef7..2fdd24cebc 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp @@ -102,7 +102,7 @@ static void updateMenuActions( void ) // for loading only, disable the save button, otherwise enable it GameWindow *saveButton = TheWindowManager->winGetWindowFromId( NULL, buttonSaveKey ); - DEBUG_ASSERTCRASH( saveButton, ("SaveLoadMenuInit: Unable to find save button\n") ); + DEBUG_ASSERTCRASH( saveButton, ("SaveLoadMenuInit: Unable to find save button") ); if( currentLayoutType == SLLT_LOAD_ONLY ) saveButton->winEnable( FALSE ); else @@ -172,7 +172,7 @@ void SaveLoadMenuInit( WindowLayout *layout, void *userData ) editDesc = TheWindowManager->winGetWindowFromId( parent, NAMEKEY( "PopupSaveLoad.wnd:EntryDesc" ) ); // get the listbox that will have the save games in it listboxGames = TheWindowManager->winGetWindowFromId( NULL, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox") ); // populate the listbox with the save games on disk TheGameState->populateSaveGameListbox( listboxGames, currentLayoutType ); @@ -235,7 +235,7 @@ void SaveLoadMenuFullScreenInit( WindowLayout *layout, void *userData ) deleteConfirm = TheWindowManager->winGetWindowFromId( parent, NAMEKEY( "SaveLoad.wnd:DeleteConfirmParent" ) ); // get the listbox that will have the save games in it listboxGames = TheWindowManager->winGetWindowFromId( NULL, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox") ); // populate the listbox with the save games on disk TheGameState->populateSaveGameListbox( listboxGames, currentLayoutType ); @@ -357,7 +357,7 @@ static AvailableGameInfo *getSelectedSaveFileInfo( GameWindow *window ) // get the listbox //GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( window, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox") ); // which item is selected Int selected; @@ -378,11 +378,11 @@ static void doLoadGame( void ) // get listbox of games //GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( parent, NAMEKEY( "PopupSaveLoad.wnd:ListboxGames" ) ); - DEBUG_ASSERTCRASH( listboxGames, ("doLoadGame: Unable to find game listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames, ("doLoadGame: Unable to find game listbox") ); // get selected game info AvailableGameInfo *selectedGameInfo = getSelectedSaveFileInfo( listboxGames ); - DEBUG_ASSERTCRASH( selectedGameInfo, ("doLoadGame: No selected game info found\n") ); + DEBUG_ASSERTCRASH( selectedGameInfo, ("doLoadGame: No selected game info found") ); // when loading a game we also close the quit/esc menu for the user when in-game if( TheShell->isShellActive() == FALSE ) @@ -544,7 +544,7 @@ WindowMsgHandledType SaveLoadMenuSystem( GameWindow *window, UnsignedInt msg, { GameWindow *control = (GameWindow *)mData1; GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( window, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox") ); if (listboxGames != NULL) { int rowSelected = mData2; @@ -564,7 +564,7 @@ WindowMsgHandledType SaveLoadMenuSystem( GameWindow *window, UnsignedInt msg, GameWindow *control = (GameWindow *)mData1; GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( window, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox") ); // // handle games listbox, when certain items are selected in the listbox only some @@ -742,7 +742,7 @@ WindowMsgHandledType SaveLoadMenuSystem( GameWindow *window, UnsignedInt msg, // get the item data of the selection AvailableGameInfo *selectedGameInfo; selectedGameInfo = (AvailableGameInfo *)GadgetListBoxGetItemData( listboxGames, selected ); - DEBUG_ASSERTCRASH( selectedGameInfo, ("SaveLoadMenuSystem: Internal error, listbox entry to overwrite game has no item data set into listbox element\n") ); + DEBUG_ASSERTCRASH( selectedGameInfo, ("SaveLoadMenuSystem: Internal error, listbox entry to overwrite game has no item data set into listbox element") ); // enable the listbox of games //GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( parent, NAMEKEY( "PopupSaveLoad.wnd:ListboxGames" ) ); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index c84990f8ab..c15fa8f802 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -494,7 +494,7 @@ WindowMsgHandledType ScoreScreenSystem( GameWindow *window, UnsignedInt msg, { ScoreScreenEnableControls(FALSE); WindowLayout *saveReplayLayout = TheShell->getPopupReplayLayout(); - DEBUG_ASSERTCRASH( saveReplayLayout, ("Unable to get save replay menu layout.\n") ); + DEBUG_ASSERTCRASH( saveReplayLayout, ("Unable to get save replay menu layout.") ); saveReplayLayout->runInit(); saveReplayLayout->hide( FALSE ); saveReplayLayout->bringForward(); @@ -1527,7 +1527,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); gameResReq.hostname = TheGameSpyGame->getLadderIP().str(); gameResReq.port = TheGameSpyGame->getLadderPort(); gameResReq.results = TheGameSpyGame->generateLadderGameResultsPacket().str(); - DEBUG_ASSERTCRASH(TheGameResultsQueue, ("No Game Results queue!\n")); + DEBUG_ASSERTCRASH(TheGameResultsQueue, ("No Game Results queue!")); if (TheGameResultsQueue) { TheGameResultsQueue->addRequest(gameResReq); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index e72ea41cd6..cdda34c2f4 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -1230,7 +1230,7 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) } } } - DEBUG_ASSERTCRASH(numPlayers, ("Game had no players!\n")); + DEBUG_ASSERTCRASH(numPlayers, ("Game had no players!")); //DEBUG_LOG(("Saw room: hasPass=%d, allowsObservers=%d", room.getHasPassword(), room.getAllowObservers())); if (resp.stagingRoom.action == PEER_ADD) { diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp index f582a403f8..9d181979e7 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp @@ -80,7 +80,7 @@ void INI::parseWindowTransitions( INI* ini ) // find existing item if present - DEBUG_ASSERTCRASH( TheTransitionHandler, ("parseWindowTransitions: TheTransitionHandler doesn't exist yet\n") ); + DEBUG_ASSERTCRASH( TheTransitionHandler, ("parseWindowTransitions: TheTransitionHandler doesn't exist yet") ); if( !TheTransitionHandler ) return; @@ -89,7 +89,7 @@ void INI::parseWindowTransitions( INI* ini ) g = TheTransitionHandler->getNewGroup( name ); // sanity - DEBUG_ASSERTCRASH( g, ("parseWindowTransitions: Unable to allocate group '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( g, ("parseWindowTransitions: Unable to allocate group '%s'", name.str()) ); // parse the ini definition ini->initFromINI( g, TheTransitionHandler->getFieldParse() ); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index 27cc138e49..afc48d4cd3 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -875,7 +875,7 @@ void MultiPlayerLoadScreen::processProgress(Int playerId, Int percentage) if( percentage < 0 || percentage > 100 || playerId >= MAX_SLOTS || playerId < 0 || m_playerLookup[playerId] == -1) { - DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d\n", percentage, playerId)); + DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d", percentage, playerId)); return; } //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)", percentage, playerId, m_playerLookup[playerId])); @@ -1203,7 +1203,7 @@ void GameSpyLoadScreen::processProgress(Int playerId, Int percentage) if( percentage < 0 || percentage > 100 || playerId >= MAX_SLOTS || playerId < 0 || m_playerLookup[playerId] == -1) { - DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d\n", percentage, playerId)); + DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d", percentage, playerId)); return; } //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)", percentage, playerId, m_playerLookup[playerId])); @@ -1356,7 +1356,7 @@ void MapTransferLoadScreen::processProgress(Int playerId, Int percentage, AsciiS if( percentage < 0 || percentage > 100 || playerId >= MAX_SLOTS || playerId < 0 || m_playerLookup[playerId] == -1) { - DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d\n", percentage, playerId)); + DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d", percentage, playerId)); return; } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp index 9f8177aefe..bc38139fb1 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp @@ -195,7 +195,7 @@ void Shell::update( void ) for( Int i = m_screenCount - 1; i >= 0; i-- ) { - DEBUG_ASSERTCRASH( m_screenStack[ i ], ("Top of shell stack is NULL!\n") ); + DEBUG_ASSERTCRASH( m_screenStack[ i ], ("Top of shell stack is NULL!") ); m_screenStack[ i ]->runUpdate( NULL ); } // end for i @@ -666,7 +666,7 @@ void Shell::doPush( AsciiString layoutFile ) // create new layout and load from window manager newScreen = TheWindowManager->winCreateLayout( layoutFile ); - DEBUG_ASSERTCRASH( newScreen != NULL, ("Shell unable to load pending push layout\n") ); + DEBUG_ASSERTCRASH( newScreen != NULL, ("Shell unable to load pending push layout") ); // link screen to the top linkScreen( newScreen ); @@ -689,7 +689,7 @@ void Shell::doPop( Bool impendingPush ) WindowLayout *currentTop = top(); // there better be a top of the stack since we're popping - DEBUG_ASSERTCRASH( currentTop, ("Shell: No top of stack and we want to pop!\n") ); + DEBUG_ASSERTCRASH( currentTop, ("Shell: No top of stack and we want to pop!") ); if (currentTop) { @@ -845,7 +845,7 @@ WindowLayout *Shell::getSaveLoadMenuLayout( void ) m_saveLoadMenuLayout = TheWindowManager->winCreateLayout( AsciiString( "Menus/PopupSaveLoad.wnd" ) ); // sanity - DEBUG_ASSERTCRASH( m_saveLoadMenuLayout, ("Unable to create save/load menu layout\n") ); + DEBUG_ASSERTCRASH( m_saveLoadMenuLayout, ("Unable to create save/load menu layout") ); // return the layout return m_saveLoadMenuLayout; @@ -862,7 +862,7 @@ WindowLayout *Shell::getPopupReplayLayout( void ) m_popupReplayLayout = TheWindowManager->winCreateLayout( AsciiString( "Menus/PopupReplay.wnd" ) ); // sanity - DEBUG_ASSERTCRASH( m_popupReplayLayout, ("Unable to create replay save menu layout\n") ); + DEBUG_ASSERTCRASH( m_popupReplayLayout, ("Unable to create replay save menu layout") ); // return the layout return m_popupReplayLayout; @@ -879,7 +879,7 @@ WindowLayout *Shell::getOptionsLayout( Bool create ) m_optionsLayout = TheWindowManager->winCreateLayout( AsciiString( "Menus/OptionsMenu.wnd" ) ); // sanity - DEBUG_ASSERTCRASH( m_optionsLayout, ("Unable to create options menu layout\n") ); + DEBUG_ASSERTCRASH( m_optionsLayout, ("Unable to create options menu layout") ); } // return the layout diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp index 10772d8548..542ca9b660 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp @@ -84,7 +84,7 @@ void INI::parseShellMenuSchemeDefinition( INI *ini ) // find existing item if present SMSchemeManager = TheShell->getShellMenuSchemeManager(); - DEBUG_ASSERTCRASH( SMSchemeManager, ("parseShellMenuSchemeDefinition: Unable to Get SMSchemeManager\n") ); + DEBUG_ASSERTCRASH( SMSchemeManager, ("parseShellMenuSchemeDefinition: Unable to Get SMSchemeManager") ); if( !SMSchemeManager ) return; @@ -93,7 +93,7 @@ void INI::parseShellMenuSchemeDefinition( INI *ini ) SMScheme = SMSchemeManager->newShellMenuScheme( name ); // sanity - DEBUG_ASSERTCRASH( SMScheme, ("parseControlBarSchemeDefinition: Unable to allocate Scheme '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( SMScheme, ("parseControlBarSchemeDefinition: Unable to allocate Scheme '%s'", name.str()) ); // parse the ini definition ini->initFromINI( SMScheme, SMSchemeManager->getFieldParse() ); diff --git a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp index 3238ad797a..b2586da4b7 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -809,7 +809,7 @@ void GameClient::destroyDrawable( Drawable *draw ) if( obj ) { - DEBUG_ASSERTCRASH( obj->getDrawable() == draw, ("Object/Drawable pointer mismatch!\n") ); + DEBUG_ASSERTCRASH( obj->getDrawable() == draw, ("Object/Drawable pointer mismatch!") ); obj->friend_bindToDrawable( NULL ); } // end if diff --git a/Generals/Code/GameEngine/Source/GameClient/GraphDraw.cpp b/Generals/Code/GameEngine/Source/GameClient/GraphDraw.cpp index ef6f50dbe0..195ad51469 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GraphDraw.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GraphDraw.cpp @@ -91,8 +91,8 @@ void GraphDraw::render() Int height = TheDisplay->getHeight(); Int totalCount = m_graphEntries.size(); - DEBUG_ASSERTCRASH(totalCount < MAX_GRAPH_VALUES, ("MAX_GRAPH_VALUES must be increased, not all labels will appear (max %d, cur %d).\n",MAX_GRAPH_VALUES,totalCount)); - DEBUG_ASSERTCRASH(BAR_HEIGHT * totalCount < height, ("BAR_HEIGHT must be reduced, as bars are being drawn off-screen.\n")); + DEBUG_ASSERTCRASH(totalCount < MAX_GRAPH_VALUES, ("MAX_GRAPH_VALUES must be increased, not all labels will appear (max %d, cur %d).",MAX_GRAPH_VALUES,totalCount)); + DEBUG_ASSERTCRASH(BAR_HEIGHT * totalCount < height, ("BAR_HEIGHT must be reduced, as bars are being drawn off-screen.")); VecGraphEntriesIt it; Int count = 0; diff --git a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp index 2c62e1f09c..127d3021f2 100644 --- a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -2829,7 +2829,7 @@ void InGameUI::setGUICommand( const CommandButton *command ) if( BitIsSet( command->getOptions(), COMMAND_OPTION_NEED_TARGET ) == FALSE ) { - DEBUG_ASSERTCRASH( 0, ("setGUICommand: Command '%s' does not need additional user interaction\n", + DEBUG_ASSERTCRASH( 0, ("setGUICommand: Command '%s' does not need additional user interaction", command->getName().str()) ); m_pendingGUICommand = NULL; m_mouseMode = MOUSEMODE_DEFAULT; @@ -2976,7 +2976,7 @@ void InGameUI::placeBuildAvailable( const ThingTemplate *build, Drawable *buildD else draw->setIndicatorColor(sourceObject->getControllingPlayer()->getPlayerColor()); } - DEBUG_ASSERTCRASH( draw, ("Unable to create icon at cursor for placement '%s'\n", + DEBUG_ASSERTCRASH( draw, ("Unable to create icon at cursor for placement '%s'", build->getName().str()) ); // diff --git a/Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp b/Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp index c9a46e9c5d..d78b9b088c 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp @@ -64,14 +64,14 @@ void Keyboard::createStreamMessages( void ) { msg = TheMessageStream->appendMessage( GameMessage::MSG_RAW_KEY_DOWN ); - DEBUG_ASSERTCRASH( msg, ("Unable to append key down message to stream\n") ); + DEBUG_ASSERTCRASH( msg, ("Unable to append key down message to stream") ); } // end if else if( BitIsSet( key->state, KEY_STATE_UP ) ) { msg = TheMessageStream->appendMessage( GameMessage::MSG_RAW_KEY_UP ); - DEBUG_ASSERTCRASH( msg, ("Unable to append key up message to stream\n") ); + DEBUG_ASSERTCRASH( msg, ("Unable to append key up message to stream") ); } // end else if else diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index bfcfa33b44..d04aa7aeb4 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -1205,7 +1205,7 @@ GameMessage::Type CommandTranslator::createEnterMessage( Drawable *enter, return msgType; // sanity - DEBUG_ASSERTCRASH( commandType == DO_COMMAND, ("createEnterMessage - commandType is not DO_COMMAND\n") ); + DEBUG_ASSERTCRASH( commandType == DO_COMMAND, ("createEnterMessage - commandType is not DO_COMMAND") ); if( m_teamExists ) { diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp index 8d6e90b667..4ab2592b0f 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp @@ -191,7 +191,7 @@ static CommandStatus doFireWeaponCommand( const CommandButton *command, const IC //This could be legit now -- think of firing a self destruct weapon //----------------------------------------------------------------- - //DEBUG_ASSERTCRASH( 0, ("doFireWeaponCommand: Command options say it doesn't need additional user input '%s'\n", + //DEBUG_ASSERTCRASH( 0, ("doFireWeaponCommand: Command options say it doesn't need additional user input '%s'", // command->m_name.str()) ); //return COMMAND_COMPLETE; @@ -269,7 +269,7 @@ static CommandStatus doAttackMoveCommand( const CommandButton *command, const IC // so we must be sure there is only one thing selected (that thing we will set the point on) // Drawable *draw = TheInGameUI->getFirstSelectedDrawable(); - DEBUG_ASSERTCRASH( draw, ("doAttackMoveCommand: No selected object(s)\n") ); + DEBUG_ASSERTCRASH( draw, ("doAttackMoveCommand: No selected object(s)") ); // sanity if( draw == NULL || draw->getObject() == NULL ) @@ -308,7 +308,7 @@ static CommandStatus doSetRallyPointCommand( const CommandButton *command, const DEBUG_ASSERTCRASH( TheInGameUI->getSelectCount() == 1, ("doSetRallyPointCommand: The selected count is not 1, we can only set a rally point on a *SINGLE* building\n") ); Drawable *draw = TheInGameUI->getFirstSelectedDrawable(); - DEBUG_ASSERTCRASH( draw, ("doSetRallyPointCommand: No selected object\n") ); + DEBUG_ASSERTCRASH( draw, ("doSetRallyPointCommand: No selected object") ); // sanity if( draw == NULL || draw->getObject() == NULL ) diff --git a/Generals/Code/GameEngine/Source/GameClient/System/Anim2D.cpp b/Generals/Code/GameEngine/Source/GameClient/System/Anim2D.cpp index 1b0148815e..68366cb5ef 100644 --- a/Generals/Code/GameEngine/Source/GameClient/System/Anim2D.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/System/Anim2D.cpp @@ -299,7 +299,7 @@ Anim2D::Anim2D( Anim2DTemplate *animTemplate, Anim2DCollection *collectionSystem { // sanity - DEBUG_ASSERTCRASH( animTemplate != NULL, ("Anim2D::Anim2D - NULL template\n") ); + DEBUG_ASSERTCRASH( animTemplate != NULL, ("Anim2D::Anim2D - NULL template") ); //Added By Sadullah Nader //Initialization @@ -359,7 +359,7 @@ void Anim2D::setCurrentFrame( UnsignedShort frame ) { // sanity - DEBUG_ASSERTCRASH( m_template != NULL, ("Anim2D::reset - No template for animation\n") ); + DEBUG_ASSERTCRASH( m_template != NULL, ("Anim2D::reset - No template for animation") ); // sanity DEBUG_ASSERTCRASH( TheGameLogic != NULL, @@ -386,7 +386,7 @@ void Anim2D::randomizeCurrentFrame( void ) { // sanity - DEBUG_ASSERTCRASH( m_template != NULL, ("Anim2D::reset - No template for animation\n") ); + DEBUG_ASSERTCRASH( m_template != NULL, ("Anim2D::reset - No template for animation") ); // set the current frame to a random frame setCurrentFrame( GameClientRandomValue( 0, m_template->getNumFrames() - 1 ) ); @@ -400,7 +400,7 @@ void Anim2D::reset( void ) { // sanity - DEBUG_ASSERTCRASH( m_template != NULL, ("Anim2D::reset - No template for animation\n") ); + DEBUG_ASSERTCRASH( m_template != NULL, ("Anim2D::reset - No template for animation") ); switch( m_template->getAnimMode() ) { @@ -625,7 +625,7 @@ void Anim2D::draw( Int x, Int y ) const Image *image = m_template->getFrame( m_currentFrame ); // sanity - DEBUG_ASSERTCRASH( image != NULL, ("Anim2D::draw - Image not found for frame '%d' on animation '%s'\n", + DEBUG_ASSERTCRASH( image != NULL, ("Anim2D::draw - Image not found for frame '%d' on animation '%s'", m_currentFrame, m_template->getName().str()) ); // get the natural width and height of this image @@ -655,7 +655,7 @@ void Anim2D::draw( Int x, Int y, Int width, Int height ) const Image *image = m_template->getFrame( m_currentFrame ); // sanity - DEBUG_ASSERTCRASH( image != NULL, ("Anim2D::draw - Image not found for frame '%d' on animation '%s'\n", + DEBUG_ASSERTCRASH( image != NULL, ("Anim2D::draw - Image not found for frame '%d' on animation '%s'", m_currentFrame, m_template->getName().str()) ); @@ -728,7 +728,7 @@ Anim2DCollection::~Anim2DCollection( void ) { // there should not be any animation instances registered with us since we're being destroyed - DEBUG_ASSERTCRASH( m_instanceList == NULL, ("Anim2DCollection - instance list is not NULL\n") ); + DEBUG_ASSERTCRASH( m_instanceList == NULL, ("Anim2DCollection - instance list is not NULL") ); // delete all the templates Anim2DTemplate *nextTemplate; diff --git a/Generals/Code/GameEngine/Source/GameClient/System/CampaignManager.cpp b/Generals/Code/GameEngine/Source/GameClient/System/CampaignManager.cpp index 6d2c963706..7eaf7b6661 100644 --- a/Generals/Code/GameEngine/Source/GameClient/System/CampaignManager.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/System/CampaignManager.cpp @@ -91,7 +91,7 @@ void INI::parseCampaignDefinition( INI *ini ) name.set( c ); // find existing item if present - DEBUG_ASSERTCRASH( TheCampaignManager, ("parseCampaignDefinition: Unable to Get TheCampaignManager\n") ); + DEBUG_ASSERTCRASH( TheCampaignManager, ("parseCampaignDefinition: Unable to Get TheCampaignManager") ); if( !TheCampaignManager ) return; @@ -99,7 +99,7 @@ void INI::parseCampaignDefinition( INI *ini ) campaign = TheCampaignManager->newCampaign( name ); // sanity - DEBUG_ASSERTCRASH( campaign, ("parseCampaignDefinition: Unable to allocate campaign '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( campaign, ("parseCampaignDefinition: Unable to allocate campaign '%s'", name.str()) ); // parse the ini definition ini->initFromINI( campaign, TheCampaignManager->getFieldParse() ); diff --git a/Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp b/Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp index 83262d1294..1e88050300 100644 --- a/Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp @@ -335,7 +335,7 @@ Particle::Particle( ParticleSystem *system, const ParticleInfo *info ) if (system->isUsingDrawables()) { const ThingTemplate *tmpl = TheThingFactory->findTemplate(system->getParticleTypeName()); - DEBUG_ASSERTCRASH(tmpl, ("Drawable %s not found\n",system->getParticleTypeName().str())); + DEBUG_ASSERTCRASH(tmpl, ("Drawable %s not found",system->getParticleTypeName().str())); if (tmpl) { m_drawable = TheThingFactory->newDrawable(tmpl); @@ -1291,7 +1291,7 @@ ParticleSystem::~ParticleSystem() if( m_slaveSystem ) { - DEBUG_ASSERTCRASH( m_slaveSystem->getMaster() == this, ("~ParticleSystem: Our slave doesn't have us as a master!\n") ); + DEBUG_ASSERTCRASH( m_slaveSystem->getMaster() == this, ("~ParticleSystem: Our slave doesn't have us as a master!") ); m_slaveSystem->setMaster( NULL ); setSlave( NULL ); @@ -1301,7 +1301,7 @@ ParticleSystem::~ParticleSystem() if( m_masterSystem ) { - DEBUG_ASSERTCRASH( m_masterSystem->getSlave() == this, ("~ParticleSystem: Our master doesn't have us as a slave!\n") ); + DEBUG_ASSERTCRASH( m_masterSystem->getSlave() == this, ("~ParticleSystem: Our master doesn't have us as a slave!") ); m_masterSystem->setSlave( NULL ); setMaster( NULL ); @@ -2206,7 +2206,7 @@ void ParticleSystem::updateWindMotion( void ) Real endAngle = m_windMotionEndAngle; // this only works when start angle is less than end angle - DEBUG_ASSERTCRASH( startAngle < endAngle, ("updateWindMotion: startAngle must be < endAngle\n") ); + DEBUG_ASSERTCRASH( startAngle < endAngle, ("updateWindMotion: startAngle must be < endAngle") ); // how big is the total angle span Real totalSpan = endAngle - startAngle; @@ -2612,7 +2612,7 @@ void ParticleSystem::xfer( Xfer *xfer ) particle = createParticle( info, priority, TRUE ); // sanity - DEBUG_ASSERTCRASH( particle, ("ParticleSyste::xfer - Unable to create particle for loading\n") ); + DEBUG_ASSERTCRASH( particle, ("ParticleSyste::xfer - Unable to create particle for loading") ); // read in the particle data xfer->xferSnapshot( particle ); @@ -2971,8 +2971,8 @@ void ParticleSystemManager::init( void ) { // sanity - DEBUG_ASSERTCRASH( m_allParticlesHead[ i ] == NULL, ("INIT: ParticleSystem all particles head[%d] is not NULL!\n", i) ); - DEBUG_ASSERTCRASH( m_allParticlesTail[ i ] == NULL, ("INIT: ParticleSystem all particles tail[%d] is not NULL!\n", i) ); + DEBUG_ASSERTCRASH( m_allParticlesHead[ i ] == NULL, ("INIT: ParticleSystem all particles head[%d] is not NULL!", i) ); + DEBUG_ASSERTCRASH( m_allParticlesTail[ i ] == NULL, ("INIT: ParticleSystem all particles tail[%d] is not NULL!", i) ); // just to be clean set them to NULL m_allParticlesHead[ i ] = NULL; @@ -2998,8 +2998,8 @@ void ParticleSystemManager::reset( void ) { // sanity - DEBUG_ASSERTCRASH( m_allParticlesHead[ i ] == NULL, ("RESET: ParticleSystem all particles head[%d] is not NULL!\n", i) ); - DEBUG_ASSERTCRASH( m_allParticlesTail[ i ] == NULL, ("RESET: ParticleSystem all particles tail[%d] is not NULL!\n", i) ); + DEBUG_ASSERTCRASH( m_allParticlesHead[ i ] == NULL, ("RESET: ParticleSystem all particles head[%d] is not NULL!", i) ); + DEBUG_ASSERTCRASH( m_allParticlesTail[ i ] == NULL, ("RESET: ParticleSystem all particles tail[%d] is not NULL!", i) ); // just to be clean set them to NULL m_allParticlesHead[ i ] = NULL; diff --git a/Generals/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp b/Generals/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp index 51a699259e..20fa8c3f85 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp @@ -440,7 +440,7 @@ TerrainRoadType *TerrainRoadCollection::newBridge( AsciiString name ) TerrainRoadType *TerrainRoadCollection::nextRoad( TerrainRoadType *road ) { - DEBUG_ASSERTCRASH( road->isBridge() == FALSE, ("nextRoad: road not a road\n") ); + DEBUG_ASSERTCRASH( road->isBridge() == FALSE, ("nextRoad: road not a road") ); return road->friend_getNext(); } // end nextRoad @@ -451,7 +451,7 @@ TerrainRoadType *TerrainRoadCollection::nextRoad( TerrainRoadType *road ) TerrainRoadType *TerrainRoadCollection::nextBridge( TerrainRoadType *bridge ) { - DEBUG_ASSERTCRASH( bridge->isBridge() == TRUE, ("nextBridge, bridge is not a bridge\n") ); + DEBUG_ASSERTCRASH( bridge->isBridge() == TRUE, ("nextBridge, bridge is not a bridge") ); return bridge->friend_getNext(); } // end nextBridge diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp index 187232b5ed..1c21d5732a 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp @@ -340,7 +340,7 @@ void AI::reset( void ) } } #else - DEBUG_ASSERTCRASH(m_groupList.empty(), ("AI::m_groupList is expected empty already\n")); + DEBUG_ASSERTCRASH(m_groupList.empty(), ("AI::m_groupList is expected empty already")); m_groupList.clear(); // Clear just in case... #endif diff --git a/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index 6d1fc2977b..9df9a0ac81 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -177,13 +177,13 @@ Object *Bridge::createTower( Coord3D *worldPos, // tie it to the bridge BridgeBehaviorInterface *bridgeInterface = BridgeBehavior::getBridgeBehaviorInterfaceFromObject( bridge ); - DEBUG_ASSERTCRASH( bridgeInterface != NULL, ("Bridge::createTower - no 'BridgeBehaviorInterface' found\n") ); + DEBUG_ASSERTCRASH( bridgeInterface != NULL, ("Bridge::createTower - no 'BridgeBehaviorInterface' found") ); if( bridgeInterface ) bridgeInterface->setTower( towerType, tower ); // tie the bridge to us BridgeTowerBehaviorInterface *bridgeTowerInterface = BridgeTowerBehavior::getBridgeTowerBehaviorInterfaceFromObject( tower ); - DEBUG_ASSERTCRASH( bridgeTowerInterface != NULL, ("Bridge::createTower - no 'BridgeTowerBehaviorInterface' found\n") ); + DEBUG_ASSERTCRASH( bridgeTowerInterface != NULL, ("Bridge::createTower - no 'BridgeTowerBehaviorInterface' found") ); if( bridgeTowerInterface ) { @@ -1492,7 +1492,7 @@ void makeAlignToNormalMatrix( Real angle, const Coord3D& pos, const Coord3D& nor x.normalize(); } - DEBUG_ASSERTCRASH(fabs(x.x*z.x + x.y*z.y + x.z*z.z)<0.0001,("dot is not zero (%f)\n",fabs(x.x*z.x + x.y*z.y + x.z*z.z))); + DEBUG_ASSERTCRASH(fabs(x.x*z.x + x.y*z.y + x.z*z.z)<0.0001,("dot is not zero (%f)",fabs(x.x*z.x + x.y*z.y + x.z*z.z))); // now computing the y vector is trivial. y.crossProduct( &z, &x, &y ); @@ -2274,7 +2274,7 @@ Real TerrainLogic::getWaterHeight( const WaterHandle *water ) } // end if // sanity - DEBUG_ASSERTCRASH( water->m_polygon != NULL, ("getWaterHeight: polygon trigger in water handle is NULL\n") ); + DEBUG_ASSERTCRASH( water->m_polygon != NULL, ("getWaterHeight: polygon trigger in water handle is NULL") ); // return the height of the water using the polygon trigger return water->m_polygon->getPoint( 0 )->z; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp index f9b74f272a..e38b7d68cb 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp @@ -629,7 +629,7 @@ void BridgeBehavior::onBodyDamageStateChange( const DamageInfo* damageInfo, return; // sanity - DEBUG_ASSERTCRASH( oldState != newState, ("BridgeBehavior::onBodyDamageStateChange - oldState and newState should be different if this is getting called\n") ); + DEBUG_ASSERTCRASH( oldState != newState, ("BridgeBehavior::onBodyDamageStateChange - oldState and newState should be different if this is getting called") ); Object *us = getObject(); Bridge *bridge = TheTerrainLogic->findBridgeAt( us->getPosition() ); @@ -650,7 +650,7 @@ void BridgeBehavior::onBodyDamageStateChange( const DamageInfo* damageInfo, TerrainRoadType *bridgeTemplate = TheTerrainRoads->findBridge( bridgeTemplateName ); // sanity - DEBUG_ASSERTCRASH( bridgeTemplate, ("BridgeBehavior: Unable to find bridge template '%s' in bridge object '%s'\n", + DEBUG_ASSERTCRASH( bridgeTemplate, ("BridgeBehavior: Unable to find bridge template '%s' in bridge object '%s'", bridgeTemplateName.str(), us->getTemplate()->getName().str()) ); @@ -723,7 +723,7 @@ UpdateSleepTime BridgeBehavior::update( void ) TerrainRoadType *bridgeTemplate = NULL; if ( bridge ) { - DEBUG_ASSERTCRASH( bridge, ("BridgeBehavior::update - Unable to find bridge\n") ); + DEBUG_ASSERTCRASH( bridge, ("BridgeBehavior::update - Unable to find bridge") ); // get bridge info bridgeInfo = bridge->peekBridgeInfo(); @@ -731,7 +731,7 @@ UpdateSleepTime BridgeBehavior::update( void ) // get the bridge template info AsciiString bridgeTemplateName = bridge->getBridgeTemplateName(); bridgeTemplate = TheTerrainRoads->findBridge( bridgeTemplateName ); - DEBUG_ASSERTCRASH( bridgeTemplate, ("BridgeBeahvior::getRandomSurfacePosition - Encountered a bridge with no template!\n") ); + DEBUG_ASSERTCRASH( bridgeTemplate, ("BridgeBeahvior::getRandomSurfacePosition - Encountered a bridge with no template!") ); } // how much time has passed between now and our destruction frame @@ -973,7 +973,7 @@ void BridgeBehavior::setScaffoldData( Object *obj, // get the scaffold behavior interface BridgeScaffoldBehaviorInterface *scaffoldBehavior; scaffoldBehavior = BridgeScaffoldBehavior::getBridgeScaffoldBehaviorInterfaceFromObject( obj ); - DEBUG_ASSERTCRASH( scaffoldBehavior, ("Unable to find bridge scaffold behavior interface\n") ); + DEBUG_ASSERTCRASH( scaffoldBehavior, ("Unable to find bridge scaffold behavior interface") ); // compute the sunken position that the object will initially start at Real fudge = 8.0f; @@ -1036,7 +1036,7 @@ void BridgeBehavior::createScaffolding( void ) // get the bridge template AsciiString bridgeTemplateName = bridge->getBridgeTemplateName(); TerrainRoadType *bridgeTemplate = TheTerrainRoads->findBridge( bridgeTemplateName ); - DEBUG_ASSERTCRASH( bridgeTemplate, ("Unable to find bridge template to create scaffolding\n") ); + DEBUG_ASSERTCRASH( bridgeTemplate, ("Unable to find bridge template to create scaffolding") ); // get the thing template for the scaffold object we're going to use AsciiString scaffoldObjectName = bridgeTemplate->getScaffoldObjectName(); @@ -1304,7 +1304,7 @@ void BridgeBehavior::removeScaffolding( void ) // get the scaffold behavior scaffoldBehavior = BridgeScaffoldBehavior::getBridgeScaffoldBehaviorInterfaceFromObject( obj ); - DEBUG_ASSERTCRASH( scaffoldBehavior, ("Unable to find bridge scaffold behavior interface\n") ); + DEBUG_ASSERTCRASH( scaffoldBehavior, ("Unable to find bridge scaffold behavior interface") ); // reverse the motion scaffoldBehavior->reverseMotion(); @@ -1399,7 +1399,7 @@ void BridgeBehavior::xfer( Xfer *xfer ) Bridge *bridge = TheTerrainLogic->findBridgeAt( us->getPosition() ); // sanity - DEBUG_ASSERTCRASH( bridge, ("BridgeBehavior::xfer - Unable to find bridge\n" )); + DEBUG_ASSERTCRASH( bridge, ("BridgeBehavior::xfer - Unable to find bridge" )); // set new object ID in bridge info to us bridge->setBridgeObjectID( us->getID() ); @@ -1417,7 +1417,7 @@ void BridgeBehavior::xfer( Xfer *xfer ) Bridge *bridge = TheTerrainLogic->findBridgeAt( us->getPosition() ); // sanity - DEBUG_ASSERTCRASH( bridge, ("BridgeBehavior::xfer - Unable to find bridge\n" )); + DEBUG_ASSERTCRASH( bridge, ("BridgeBehavior::xfer - Unable to find bridge" )); // set new object ID in bridge info to us for( Int i = 0; i < BRIDGE_MAX_TOWERS; ++i ) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp index 5376bcbd38..62c0cdf163 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp @@ -115,7 +115,7 @@ void BridgeTowerBehavior::onDamage( DamageInfo *damageInfo ) break; } // end for bmi - DEBUG_ASSERTCRASH( bridgeInterface != NULL, ("BridgeTowerBehavior::onDamage - no 'BridgeBehaviorInterface' found\n") ); + DEBUG_ASSERTCRASH( bridgeInterface != NULL, ("BridgeTowerBehavior::onDamage - no 'BridgeBehaviorInterface' found") ); if( bridgeInterface ) { @@ -196,7 +196,7 @@ void BridgeTowerBehavior::onHealing( DamageInfo *damageInfo ) break; } // end for bmi - DEBUG_ASSERTCRASH( bridgeInterface != NULL, ("BridgeTowerBehavior::onHealing - no 'BridgeBehaviorInterface' found\n") ); + DEBUG_ASSERTCRASH( bridgeInterface != NULL, ("BridgeTowerBehavior::onHealing - no 'BridgeBehaviorInterface' found") ); if( bridgeInterface ) { diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp index daa5aa4057..033f9dc53c 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp @@ -219,8 +219,8 @@ static Bool calcTrajectory( pitches[0] = theta; // shallower angle pitches[1] = (theta >= 0.0) ? (PI/2 - theta) : (-PI/2 - theta); // steeper angle - DEBUG_ASSERTCRASH(pitches[0]<=PI/2&&pitches[0]>=-PI/2,("bad pitches[0] %f\n",rad2deg(pitches[0]))); - DEBUG_ASSERTCRASH(pitches[1]<=PI/2&&pitches[1]>=-PI/2,("bad pitches[1] %f\n",rad2deg(pitches[1]))); + DEBUG_ASSERTCRASH(pitches[0]<=PI/2&&pitches[0]>=-PI/2,("bad pitches[0] %f",rad2deg(pitches[0]))); + DEBUG_ASSERTCRASH(pitches[1]<=PI/2&&pitches[1]>=-PI/2,("bad pitches[1] %f",rad2deg(pitches[1]))); // calc the horiz-speed & time for each. // note that time can only be negative for 90getPhysics(); - DEBUG_ASSERTCRASH( physics, ("JetSlowDeathBehavior::beginSlowDeath - '%s' has no physics\n", + DEBUG_ASSERTCRASH( physics, ("JetSlowDeathBehavior::beginSlowDeath - '%s' has no physics", us->getTemplate()->getName().str()) ); if( physics ) physics->setRollRate( m_rollRate ); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp index a06ce31ece..ef4b91a6e6 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp @@ -103,10 +103,10 @@ void POWTruckBehavior::onCollide( Object *other, const Coord3D *loc, const Coord // get our AI info AIUpdateInterface *ourAI = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ourAI, ("POWTruckBehavior::onCollide - '%s' has no AI\n", + DEBUG_ASSERTCRASH( ourAI, ("POWTruckBehavior::onCollide - '%s' has no AI", us->getTemplate()->getName().str()) ); POWTruckAIUpdateInterface *powTruckAI = ourAI->getPOWTruckAIUpdateInterface(); - DEBUG_ASSERTCRASH( powTruckAI, ("POWTruckBehavior::onCollide - '%s' has no POWTruckAI\n", + DEBUG_ASSERTCRASH( powTruckAI, ("POWTruckBehavior::onCollide - '%s' has no POWTruckAI", us->getTemplate()->getName().str()) ); // pick up the prisoner diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp index e7593e80d1..7758d887fe 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp @@ -771,7 +771,7 @@ void ParkingPlaceBehavior::unreserveDoorForExit( ExitDoorType exitDoor ) { if (it->m_door == exitDoor) { - //DEBUG_ASSERTCRASH(it->m_reservedForExit, ("ParkingPlaceBehavior::unreserveDoorForExit: door %d was not reserved\n",exitDoor)); + //DEBUG_ASSERTCRASH(it->m_reservedForExit, ("ParkingPlaceBehavior::unreserveDoorForExit: door %d was not reserved",exitDoor)); it->m_objectInSpace = INVALID_ID; it->m_reservedForExit = false; return; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp index e672034964..76bd5e9e6c 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp @@ -157,7 +157,7 @@ UpdateSleepTime PropagandaCenterBehavior::update( void ) // place this object under the control of the player Player *player = us->getControllingPlayer(); - DEBUG_ASSERTCRASH( player, ("Brainwashing: No controlling player for '%s'\n", us->getTemplate()->getName().str()) ); + DEBUG_ASSERTCRASH( player, ("Brainwashing: No controlling player for '%s'", us->getTemplate()->getName().str()) ); if( player ) brainwashingSubject->setTemporaryTeam( player->getDefaultTeam() ); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp index 64b9ca17a5..b13411df5e 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp @@ -192,7 +192,7 @@ void GarrisonContain::putObjectAtGarrisonPoint( Object *obj, // garrison point ready to shoot // static const ThingTemplate *muzzle = TheThingFactory->findTemplate( "GarrisonGun" ); - DEBUG_ASSERTCRASH( muzzle, ("Warning, Object 'GarrisonGun' not found and is need for Garrison gun effects\n") ); + DEBUG_ASSERTCRASH( muzzle, ("Warning, Object 'GarrisonGun' not found and is need for Garrison gun effects") ); if( muzzle ) { Drawable *draw = TheThingFactory->newDrawable( muzzle ); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp index 6d80140d56..e1784a599f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp @@ -1307,7 +1307,7 @@ void OpenContain::processDamageToContained() // GLA Battle Bus with at least 2 half damaged GLA Terrorists inside. if (listSize != items->size()) { - DEBUG_ASSERTCRASH( listSize == 0, ("List is expected empty\n") ); + DEBUG_ASSERTCRASH( listSize == 0, ("List is expected empty") ); break; } } @@ -1336,7 +1336,7 @@ void OpenContain::processDamageToContained() { Object *object = *it; - DEBUG_ASSERTCRASH( object, ("Contain list must not contain NULL element\n") ); + DEBUG_ASSERTCRASH( object, ("Contain list must not contain NULL element") ); // Calculate the damage to be inflicted on each unit. Real damage = object->getBodyModule()->getMaxHealth() * percentDamage; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Damage/TransitionDamageFX.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Damage/TransitionDamageFX.cpp index 0a88f6b44d..f629182e2f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Damage/TransitionDamageFX.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Damage/TransitionDamageFX.cpp @@ -256,7 +256,7 @@ void TransitionDamageFX::onDelete( void ) static Coord3D getLocalEffectPos( const FXLocInfo *locInfo, Drawable *draw ) { - DEBUG_ASSERTCRASH( locInfo, ("getLocalEffectPos: locInfo is NULL\n") ); + DEBUG_ASSERTCRASH( locInfo, ("getLocalEffectPos: locInfo is NULL") ); if( locInfo->locType == FX_DAMAGE_LOC_TYPE_BONE && draw ) { diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp index 08a6df3858..dcb8bf8214 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp @@ -165,7 +165,7 @@ void CrushDie::onDie( const DamageInfo * damageInfo ) if (!isDieApplicable(damageInfo)) return; - DEBUG_ASSERTCRASH(damageInfo->in.m_damageType == DAMAGE_CRUSH, ("this should only be used for crush damage\n")); + DEBUG_ASSERTCRASH(damageInfo->in.m_damageType == DAMAGE_CRUSH, ("this should only be used for crush damage")); if (damageInfo->in.m_damageType != DAMAGE_CRUSH) return; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/RebuildHoleExposeDie.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Die/RebuildHoleExposeDie.cpp index 4e48f38920..7730766090 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Die/RebuildHoleExposeDie.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Die/RebuildHoleExposeDie.cpp @@ -145,7 +145,7 @@ void RebuildHoleExposeDie::onDie( const DamageInfo *damageInfo ) RebuildHoleBehaviorInterface *rhbi = RebuildHoleBehavior::getRebuildHoleBehaviorInterfaceFromObject( hole ); // sanity - DEBUG_ASSERTCRASH( rhbi, ("RebuildHoleExposeDie: No Rebuild Hole Behavior interface on hole\n") ); + DEBUG_ASSERTCRASH( rhbi, ("RebuildHoleExposeDie: No Rebuild Hole Behavior interface on hole") ); // start the rebuild process if( rhbi ) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp index 133ae97fec..b18bfdb166 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp @@ -887,7 +887,7 @@ void Locomotor::locoUpdate_moveTowardsAngle(Object* obj, Real goalAngle) } else { - DEBUG_ASSERTCRASH(m_template->m_appearance != LOCO_THRUST, ("THRUST should always have minspeeds!\n")); + DEBUG_ASSERTCRASH(m_template->m_appearance != LOCO_THRUST, ("THRUST should always have minspeeds!")); Coord3D desiredPos = *obj->getPosition(); desiredPos.x += Cos(goalAngle) * 1000.0f; desiredPos.y += Sin(goalAngle) * 1000.0f; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 8d2edc35ab..e0e3aa3746 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -370,14 +370,14 @@ Object::Object( const ThingTemplate *tt, const ObjectStatusMaskType &objectStatu AIUpdateInterface* ai = newMod->getAIUpdateInterface(); if (ai) { - DEBUG_ASSERTCRASH(m_ai == NULL, ("You should never have more than one AI module (srj)\n")); + DEBUG_ASSERTCRASH(m_ai == NULL, ("You should never have more than one AI module (srj)")); m_ai = ai; } static NameKeyType key_PhysicsUpdate = NAMEKEY("PhysicsBehavior"); if (newMod->getModuleNameKey() == key_PhysicsUpdate) { - DEBUG_ASSERTCRASH(m_physics == NULL, ("You should never have more than one Physics module (%s)\n",getTemplate()->getName().str())); + DEBUG_ASSERTCRASH(m_physics == NULL, ("You should never have more than one Physics module (%s)",getTemplate()->getName().str())); m_physics = (PhysicsBehavior*)newMod; } } @@ -1759,7 +1759,7 @@ void Object::kill() damageInfo.in.m_amount = getBodyModule()->getMaxHealth(); attemptDamage( &damageInfo ); - DEBUG_ASSERTCRASH(!damageInfo.out.m_noEffect, ("Attempting to kill an unKillable object (InactiveBody?)\n")); + DEBUG_ASSERTCRASH(!damageInfo.out.m_noEffect, ("Attempting to kill an unKillable object (InactiveBody?)")); } // end kill @@ -2216,7 +2216,7 @@ Bool Object::didEnter(const PolygonTrigger *pTrigger) const if (!didEnterOrExit()) return false; - DEBUG_ASSERTCRASH(!isKindOf(KINDOF_INERT), ("Asking whether an inert object entered or exited. This is invalid.\n")); + DEBUG_ASSERTCRASH(!isKindOf(KINDOF_INERT), ("Asking whether an inert object entered or exited. This is invalid.")); for (Int i=0; igetUpgradeTemplate(); - DEBUG_ASSERTCRASH( upgradeT, ("Undefined upgrade '%s' in player upgrade command\n", "UNKNOWN") ); + DEBUG_ASSERTCRASH( upgradeT, ("Undefined upgrade '%s' in player upgrade command", "UNKNOWN") ); // sanity if( upgradeT == NULL ) break; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp index e65ba8b013..dd81d350b4 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp @@ -893,7 +893,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget ini->initFromINIMulti(nugget, p); - DEBUG_ASSERTCRASH(nugget->m_mass > 0.0f, ("Zero masses are not allowed for debris!\n")); + DEBUG_ASSERTCRASH(nugget->m_mass > 0.0f, ("Zero masses are not allowed for debris!")); ((ObjectCreationList*)instance)->addObjectCreationNugget(nugget); } @@ -1097,7 +1097,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget DUMPREAL(m_mass); objUp->setMass( m_mass ); } - DEBUG_ASSERTCRASH(objUp->getMass() > 0.0f, ("Zero masses are not allowed for obj!\n")); + DEBUG_ASSERTCRASH(objUp->getMass() > 0.0f, ("Zero masses are not allowed for obj!")); objUp->setExtraBounciness(m_extraBounciness); objUp->setExtraFriction(m_extraFriction); @@ -1269,7 +1269,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget tmpl = debrisTemplate; } - DEBUG_ASSERTCRASH(tmpl, ("Object %s not found\n",m_names[pick].str())); + DEBUG_ASSERTCRASH(tmpl, ("Object %s not found",m_names[pick].str())); if (!tmpl) continue; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index f2e4572598..ae1d86454c 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -1573,7 +1573,7 @@ PartitionData::~PartitionData() { //DEBUG_LOG(("remove pd %08lx from dirty list (%08lx %08lx)",this,m_prevDirty,m_nextDirty)); ThePartitionManager->removeFromDirtyModules(this); - //DEBUG_ASSERTCRASH(!ThePartitionManager->isInListDirtyModules(this), ("hmm\n")); + //DEBUG_ASSERTCRASH(!ThePartitionManager->isInListDirtyModules(this), ("hmm")); } } @@ -2146,7 +2146,7 @@ Int PartitionData::calcMaxCoiForShape(GeometryType geom, Real majorRadius, Real #if defined(RTS_DEBUG) Int chk = calcMaxCoiForShape(geom, majorRadius, minorRadius, false); (void)chk; - DEBUG_ASSERTCRASH(chk <= 4, ("Small objects should be <= 4 cells, but I calced %s as %d\n",theObjName.str(),chk)); + DEBUG_ASSERTCRASH(chk <= 4, ("Small objects should be <= 4 cells, but I calced %s as %d",theObjName.str(),chk)); #endif result = 4; } @@ -3161,7 +3161,7 @@ void PartitionManager::calcRadiusVec() contain objects that are <= (curRadius * cellSize) distance away from cell (0,0). */ Int curRadius = calcMinRadius(cur); - DEBUG_ASSERTCRASH(curRadius <= m_maxGcoRadius, ("expected max of %d but got %d\n",m_maxGcoRadius,curRadius)); + DEBUG_ASSERTCRASH(curRadius <= m_maxGcoRadius, ("expected max of %d but got %d",m_maxGcoRadius,curRadius)); if (curRadius <= m_maxGcoRadius) m_radiusVec[curRadius].push_back(cur); } @@ -3174,7 +3174,7 @@ void PartitionManager::calcRadiusVec() total += m_radiusVec[i].size(); //DEBUG_LOG(("radius %d has %d entries",i,m_radiusVec[i].size())); } - DEBUG_ASSERTCRASH(total == (cx*2-1)*(cy*2-1),("expected %d, got %d\n",(cx*2-1)*(cy*2-1),total)); + DEBUG_ASSERTCRASH(total == (cx*2-1)*(cy*2-1),("expected %d, got %d",(cx*2-1)*(cy*2-1),total)); #endif } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index d5d5452874..97b3c52f31 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -4452,7 +4452,7 @@ void AIUpdateInterface::evaluateMoraleBonus( void ) // do we have nationalism ///@todo Find a better way to represent nationalism without hardcoding here (CBD) static const UpgradeTemplate *nationalismTemplate = TheUpgradeCenter->findUpgrade( "Upgrade_Nationalism" ); - DEBUG_ASSERTCRASH( nationalismTemplate != NULL, ("AIUpdateInterface::evaluateMoraleBonus - Nationalism upgrade not found\n") ); + DEBUG_ASSERTCRASH( nationalismTemplate != NULL, ("AIUpdateInterface::evaluateMoraleBonus - Nationalism upgrade not found") ); Player *player = us->getControllingPlayer(); if( player && player->hasUpgradeComplete( nationalismTemplate ) ) nationalism = TRUE; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp index f0011d7bf6..eadbafdd1d 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp @@ -690,11 +690,11 @@ StateReturnType DozerActionDoActionState::update( void ) if( goalObject->isKindOf( KINDOF_BRIDGE_TOWER ) ) { BridgeTowerBehaviorInterface *btbi = BridgeTowerBehavior::getBridgeTowerBehaviorInterfaceFromObject( goalObject ); - DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower interface\n") ); + DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower interface") ); Object *bridgeObject = TheGameLogic->findObjectByID( btbi->getBridgeID() ); - DEBUG_ASSERTCRASH( bridgeObject, ("Unable to find bridge center object\n") ); + DEBUG_ASSERTCRASH( bridgeObject, ("Unable to find bridge center object") ); BridgeBehaviorInterface *bbi = BridgeBehavior::getBridgeBehaviorInterfaceFromObject( bridgeObject ); - DEBUG_ASSERTCRASH( bbi, ("Unable to find bridge interface from tower goal object during repair\n") ); + DEBUG_ASSERTCRASH( bbi, ("Unable to find bridge interface from tower goal object during repair") ); if( bbi->isScaffoldInMotion() == TRUE ) canHeal = FALSE; @@ -1818,10 +1818,10 @@ void DozerAIUpdate::privateRepair( Object *obj, CommandSourceType cmdSource ) //if( obj->isKindOf( KINDOF_BRIDGE_TOWER ) ) //{ // BridgeTowerBehaviorInterface *btbi = BridgeTowerBehavior::getBridgeTowerBehaviorInterfaceFromObject( obj ); - // DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower behavior interface\n") ); + // DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower behavior interface") ); // // Object *bridge = TheGameLogic->findObjectByID( btbi->getBridgeID() ); - // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object\n") ); + // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object") ); // if( BitIsSet( bridge->getStatusBits(), OBJECT_STATUS_UNDERGOING_REPAIR ) == TRUE ) // return; // @@ -1832,10 +1832,10 @@ void DozerAIUpdate::privateRepair( Object *obj, CommandSourceType cmdSource ) //if( obj->isKindOf( KINDOF_BRIDGE_TOWER ) ) //{ // BridgeTowerBehaviorInterface *btbi = BridgeTowerBehavior::getBridgeTowerBehaviorInterfaceFromObject( obj ); - // DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower behavior interface\n") ); + // DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower behavior interface") ); // // Object *bridge = TheGameLogic->findObjectByID( btbi->getBridgeID() ); - // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object\n") ); + // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object") ); // bridge->setStatus( OBJECT_STATUS_UNDERGOING_REPAIR ); // //} // end if @@ -1963,7 +1963,7 @@ void DozerAIUpdate::newTask( DozerTask task, Object *target ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); // sanity if( target == NULL ) @@ -2045,7 +2045,7 @@ Bool DozerAIUpdate::isTaskPending( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); return m_task[ task ].m_targetObjectID != 0 ? TRUE : FALSE; @@ -2072,7 +2072,7 @@ ObjectID DozerAIUpdate::getTaskTarget( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); return m_task[ task ].m_targetObjectID; @@ -2085,7 +2085,7 @@ void DozerAIUpdate::internalTaskComplete( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); // call the single method that gets called for completing and canceling tasks internalTaskCompleteOrCancelled( task ); @@ -2108,7 +2108,7 @@ void DozerAIUpdate::internalCancelTask( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); if(task < 0 || task >= DOZER_NUM_TASKS) return; //DAMNIT! You CANNOT assert and then not handle the damn error! The. Code. Must. Not. Crash. @@ -2192,9 +2192,9 @@ void DozerAIUpdate::internalTaskCompleteOrCancelled( DozerTask task ) // // // clear the repair bit from the bridge // BridgeTowerBehaviorInterface *btbi = BridgeTowerBehavior::getBridgeTowerBehaviorInterfaceFromObject( obj ); - // DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower behavior interface\n") ); + // DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower behavior interface") ); // Object *bridge = TheGameLogic->findObjectByID( btbi->getBridgeID() ); - // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object\n") ); + // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object") ); // bridge->clearStatus( OBJECT_STATUS_UNDERGOING_REPAIR ); // // } // end if diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp index 0413542b42..589805b095 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp @@ -250,7 +250,7 @@ void POWTruckAIUpdate::setTask( POWTruckTask task, Object *taskObject ) m_targetID = taskObject->getID(); // mark this target as slated for pickup - DEBUG_ASSERTCRASH( taskObject->getAIUpdateInterface(), ("POWTruckAIUpdate::setTask - '%s' has no ai module\n", + DEBUG_ASSERTCRASH( taskObject->getAIUpdateInterface(), ("POWTruckAIUpdate::setTask - '%s' has no ai module", taskObject->getTemplate()->getName().str()) ); } // end if @@ -358,7 +358,7 @@ void POWTruckAIUpdate::updateWaiting( void ) // get our info Object *us = getObject(); AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateWaiting - '%s' has no ai\n", + DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateWaiting - '%s' has no ai", us->getTemplate()->getName().str()) ); // @@ -385,7 +385,7 @@ void POWTruckAIUpdate::updateFindTarget( void ) { // we never find targets when in manual ai mode - DEBUG_ASSERTCRASH( m_aiMode != MANUAL, ("POWTruckAIUpdate::updateFindTarget - We shouldn't be here with a manual ai mode\n") ); + DEBUG_ASSERTCRASH( m_aiMode != MANUAL, ("POWTruckAIUpdate::updateFindTarget - We shouldn't be here with a manual ai mode") ); if( m_aiMode == MANUAL ) return; @@ -399,7 +399,7 @@ void POWTruckAIUpdate::updateFindTarget( void ) // get our info Object *us = getObject(); AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateFindTarget - '%s' has no ai\n", + DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateFindTarget - '%s' has no ai", us->getTemplate()->getName().str()) ); // if we're full we should return to prison @@ -534,7 +534,7 @@ void POWTruckAIUpdate::updateReturnPrisoners( void ) { Object *us = getObject(); AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateReturnPrisoners - '%s' has no AI\n", + DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateReturnPrisoners - '%s' has no AI", us->getTemplate()->getName().str()) ); // get the prison we're returning to @@ -586,7 +586,7 @@ void POWTruckAIUpdate::doReturnPrisoners( void ) // start the prisoner return process Object *us = getObject(); AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::doReturnPrisoners - '%s' has no AI\n", + DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::doReturnPrisoners - '%s' has no AI", us->getTemplate()->getName().str()) ); ai->aiReturnPrisoners( prison, CMD_FROM_AI ); @@ -657,7 +657,7 @@ Object *POWTruckAIUpdate::findBestTarget( void ) // get our info const AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::findBestTarget- '%s' has no AI\n", + DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::findBestTarget- '%s' has no AI", us->getTemplate()->getName().str()) ); // scan all objects, there is no range @@ -727,7 +727,7 @@ static void putPrisonersInPrison( Object *obj, void *userData ) Object *prison = prisonUnloadData->destPrison; // sanity - DEBUG_ASSERTCRASH( prison, ("putPrisonersInPrison: NULL user data\n") ); + DEBUG_ASSERTCRASH( prison, ("putPrisonersInPrison: NULL user data") ); DEBUG_ASSERTCRASH( obj->getContainedBy() != NULL, ("putPrisonersInPrison: Prisoner '%s' is not contained by anything, it should be contained by a POW truck\n", obj->getTemplate()->getName().str()) ); @@ -771,12 +771,12 @@ void POWTruckAIUpdate::unloadPrisonersToPrison( Object *prison ) ContainModuleInterface *truckContain = us->getContain(); // sanity - DEBUG_ASSERTCRASH( prison->getContain(), ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain\n", + DEBUG_ASSERTCRASH( prison->getContain(), ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain", prison->getTemplate()->getName().str()) ); DEBUG_ASSERTCRASH( prison->getContain()->asOpenContain(), ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain\n", prison->getTemplate()->getName().str()) ); - DEBUG_ASSERTCRASH( truckContain, ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain\n", + DEBUG_ASSERTCRASH( truckContain, ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain", us->getTemplate()->getName().str()) ); DEBUG_ASSERTCRASH( truckContain->asOpenContain(), ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain\n", diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp index f53b0b7611..9a5bbef6ca 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp @@ -227,7 +227,7 @@ UpdateSleepTime RailedTransportAIUpdate::update( void ) Waypoint *waypoint = TheTerrainLogic->getWaypointByID( m_path[ m_currentPath ].endWaypointID ); // sanity - DEBUG_ASSERTCRASH( waypoint, ("RailedTransportAIUpdate: Invalid target waypoint\n") ); + DEBUG_ASSERTCRASH( waypoint, ("RailedTransportAIUpdate: Invalid target waypoint") ); if (waypoint) { @@ -324,7 +324,7 @@ void RailedTransportAIUpdate::privateExecuteRailedTransport( CommandSourceType c // find the start waypoint for our current path Waypoint *startWaypoint = TheTerrainLogic->getWaypointByID( m_path[ m_currentPath ].startWaypointID ); - DEBUG_ASSERTCRASH( startWaypoint, ("RailedTransportAIUpdate: Start waypoint not found\n") ); + DEBUG_ASSERTCRASH( startWaypoint, ("RailedTransportAIUpdate: Start waypoint not found") ); // follow this waypoint path aiFollowWaypointPath( startWaypoint, CMD_FROM_AI ); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp index 89513f9924..7a4f51bbaa 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp @@ -1193,7 +1193,7 @@ void alignToTerrain( Real angle, const Coord3D& pos, const Coord3D& normal, Matr x.normalize(); } - DEBUG_ASSERTCRASH(fabs(x.x*z.x + x.y*z.y + x.z*z.z)<0.0001,("dot is not zero\n")); + DEBUG_ASSERTCRASH(fabs(x.x*z.x + x.y*z.y + x.z*z.z)<0.0001,("dot is not zero")); // now computing the y vector is trivial. y.crossProduct( &z, &x, &y ); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp index 8a631cd1ce..10f3b5f772 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp @@ -612,7 +612,7 @@ void WorkerAIUpdate::newTask( DozerTask task, Object* target ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); // sanity if( target == NULL ) @@ -707,7 +707,7 @@ Bool WorkerAIUpdate::isTaskPending( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); return m_task[ task ].m_targetObjectID != 0 ? TRUE : FALSE; @@ -734,7 +734,7 @@ ObjectID WorkerAIUpdate::getTaskTarget( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); return m_task[ task ].m_targetObjectID; @@ -747,7 +747,7 @@ void WorkerAIUpdate::internalTaskComplete( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); // call the single method that gets called for completing and canceling tasks internalTaskCompleteOrCancelled( task ); @@ -770,7 +770,7 @@ void WorkerAIUpdate::internalCancelTask( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); if(task < 0 || task >= DOZER_NUM_TASKS) return; //DAMNIT! You CANNOT assert and then not handle the damn error! The. Code. Must. Not. Crash. diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp index 4163d707bf..e8791353a6 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp @@ -409,7 +409,7 @@ void BattlePlanUpdate::createVisionObject() // get template of object to create const ThingTemplate *tt = TheThingFactory->findTemplate( data->m_visionObjectName ); - DEBUG_ASSERTCRASH( tt, ("BattlePlanUpdate::setStatus - Invalid vision object name '%s'\n", + DEBUG_ASSERTCRASH( tt, ("BattlePlanUpdate::setStatus - Invalid vision object name '%s'", data->m_visionObjectName.str()) ); if (!tt) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp index b97530c8d9..6a0b690ade 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp @@ -73,10 +73,10 @@ Bool PrisonDockUpdate::action( Object *docker, Object *drone ) // unload the prisoners from the docker into us AIUpdateInterface *ai = docker->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("'%s' docking with prison has no AI\n", + DEBUG_ASSERTCRASH( ai, ("'%s' docking with prison has no AI", docker->getTemplate()->getName().str()) ); POWTruckAIUpdateInterface *powAI = ai->getPOWTruckAIUpdateInterface(); - DEBUG_ASSERTCRASH( powAI, ("'s' docking with prison has no POW Truck AI\n", + DEBUG_ASSERTCRASH( powAI, ("'s' docking with prison has no POW Truck AI", docker->getTemplate()->getName().str()) ); powAI->unloadPrisonersToPrison( getObject() ); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RailedTransportDockUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RailedTransportDockUpdate.cpp index 05cc0515ed..a52762c47f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RailedTransportDockUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RailedTransportDockUpdate.cpp @@ -461,7 +461,7 @@ void RailedTransportDockUpdate::unloadNext( void ) // better be an open container ContainModuleInterface *contain = us->getContain(); OpenContain *openContain = contain ? contain->asOpenContain() : NULL; - DEBUG_ASSERTCRASH( openContain, ("Unloading next from railed transport, but '%s' has no open container\n", + DEBUG_ASSERTCRASH( openContain, ("Unloading next from railed transport, but '%s' has no open container", us->getTemplate()->getName().str()) ); // get the first contained object diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/EMPUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/EMPUpdate.cpp index b99a13fa02..1efff1d6f6 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/EMPUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/EMPUpdate.cpp @@ -84,7 +84,7 @@ EMPUpdate::EMPUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModul if ( data ) { //SANITY - DEBUG_ASSERTCRASH( TheGameLogic, ("EMPUpdate::EMPUpdate - TheGameLogic is NULL\n" ) ); + DEBUG_ASSERTCRASH( TheGameLogic, ("EMPUpdate::EMPUpdate - TheGameLogic is NULL" ) ); UnsignedInt now = TheGameLogic->getFrame(); m_currentScale = data->m_startScale; @@ -100,13 +100,13 @@ EMPUpdate::EMPUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModul getObject()->setOrientation(GameLogicRandomValueReal(-PI,PI)); - DEBUG_ASSERTCRASH( m_tintEnvPlayFrame < m_dieFrame, ("EMPUpdate::EMPUpdate - you cant play fade after death\n" ) ); + DEBUG_ASSERTCRASH( m_tintEnvPlayFrame < m_dieFrame, ("EMPUpdate::EMPUpdate - you cant play fade after death" ) ); return; } //SANITY - DEBUG_ASSERTCRASH( data, ("EMPUpdate::EMPUpdate - getEMPUpdateModuleData is NULL\n" ) ); + DEBUG_ASSERTCRASH( data, ("EMPUpdate::EMPUpdate - getEMPUpdateModuleData is NULL" ) ); m_currentScale = 1.0f; m_dieFrame = 0; m_tintEnvFadeFrames = 0; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HelicopterSlowDeathUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HelicopterSlowDeathUpdate.cpp index 129d1c434d..1eb77e58d5 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HelicopterSlowDeathUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/HelicopterSlowDeathUpdate.cpp @@ -353,7 +353,7 @@ UpdateSleepTime HelicopterSlowDeathBehavior::update( void ) // get the physics update module PhysicsBehavior *physics = copter->getPhysics(); - DEBUG_ASSERTCRASH( physics, ("HelicopterSlowDeathBehavior: object '%s' does not have a physics module\n", + DEBUG_ASSERTCRASH( physics, ("HelicopterSlowDeathBehavior: object '%s' does not have a physics module", copter->getTemplate()->getName().str()) ); // diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp index 11511da60b..1977a8e60f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp @@ -300,7 +300,7 @@ void PhysicsBehavior::applyForce( const Coord3D *force ) { // TheSuperHackers @info helmutbuhler 06/05/2025 This debug mutates the code to become CRC incompatible #if defined(RTS_DEBUG) || !RETAIL_COMPATIBLE_CRC - DEBUG_ASSERTCRASH(!(_isnan(force->x) || _isnan(force->y) || _isnan(force->z)), ("PhysicsBehavior::applyForce force NAN!\n")); + DEBUG_ASSERTCRASH(!(_isnan(force->x) || _isnan(force->y) || _isnan(force->z)), ("PhysicsBehavior::applyForce force NAN!")); #endif if (_isnan(force->x) || _isnan(force->y) || _isnan(force->z)) { return; @@ -322,8 +322,8 @@ void PhysicsBehavior::applyForce( const Coord3D *force ) m_accel.y += modForce.y * massInv; m_accel.z += modForce.z * massInv; - //DEBUG_ASSERTCRASH(!(_isnan(m_accel.x) || _isnan(m_accel.y) || _isnan(m_accel.z)), ("PhysicsBehavior::applyForce accel NAN!\n")); - //DEBUG_ASSERTCRASH(!(_isnan(m_vel.x) || _isnan(m_vel.y) || _isnan(m_vel.z)), ("PhysicsBehavior::applyForce vel NAN!\n")); + //DEBUG_ASSERTCRASH(!(_isnan(m_accel.x) || _isnan(m_accel.y) || _isnan(m_accel.z)), ("PhysicsBehavior::applyForce accel NAN!")); + //DEBUG_ASSERTCRASH(!(_isnan(m_vel.x) || _isnan(m_vel.y) || _isnan(m_vel.z)), ("PhysicsBehavior::applyForce vel NAN!")); //DEBUG_ASSERTCRASH(fabs(force->z) < 3, ("unlikely z-force")); #ifdef SLEEPY_PHYSICS if (getFlag(IS_IN_UPDATE)) @@ -1292,7 +1292,7 @@ void PhysicsBehavior::onCollide( Object *other, const Coord3D *loc, const Coord3 force.x = factor * delta.x / dist; force.y = factor * delta.y / dist; force.z = factor * delta.z / dist; // will be zero for 2d case. - DEBUG_ASSERTCRASH(!(_isnan(force.x) || _isnan(force.y) || _isnan(force.z)), ("PhysicsBehavior::onCollide force NAN!\n")); + DEBUG_ASSERTCRASH(!(_isnan(force.x) || _isnan(force.y) || _isnan(force.z)), ("PhysicsBehavior::onCollide force NAN!")); applyForce( &force ); } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp index c10caabf72..d059b70149 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp @@ -876,7 +876,7 @@ UpdateSleepTime ProductionUpdate::update( void ) { // there is no exit interface, this is an error - DEBUG_ASSERTCRASH( 0, ("Cannot create '%s', there is no ExitUpdate interface defined for producer object '%s'\n", + DEBUG_ASSERTCRASH( 0, ("Cannot create '%s', there is no ExitUpdate interface defined for producer object '%s'", production->m_objectToProduce->getName().str(), creationBuilding->getTemplate()->getName().str()) ); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index bd2b496ab2..3eeea18d0f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -747,7 +747,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate //end -extraLogging //CRCDEBUG_LOG(("WeaponTemplate::fireWeaponTemplate() from %s", DescribeObject(sourceObj).str())); - DEBUG_ASSERTCRASH(specificBarrelToUse >= 0, ("specificBarrelToUse should no longer be -1\n")); + DEBUG_ASSERTCRASH(specificBarrelToUse >= 0, ("specificBarrelToUse should no longer be -1")); if (sourceObj == NULL || (victimObj == NULL && victimPos == NULL)) { @@ -828,7 +828,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate Real attackRangeSqr = sqr(getAttackRange(bonus)); if (distSqr > attackRangeSqr) { - //DEBUG_ASSERTCRASH(distSqr < 5*5 || distSqr < attackRangeSqr*1.2f, ("*** victim is out of range (%f vs %f) of this weapon -- why did we attempt to fire?\n",sqrtf(distSqr),sqrtf(attackRangeSqr))); + //DEBUG_ASSERTCRASH(distSqr < 5*5 || distSqr < attackRangeSqr*1.2f, ("*** victim is out of range (%f vs %f) of this weapon -- why did we attempt to fire?",sqrtf(distSqr),sqrtf(attackRangeSqr))); //-extraLogging #if defined(RTS_DEBUG) @@ -850,7 +850,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate if (distSqr < minAttackRangeSqr-0.5f && !isProjectileDetonation) #endif { - DEBUG_ASSERTCRASH(distSqr > minAttackRangeSqr*0.8f, ("*** victim is closer than min attack range (%f vs %f) of this weapon -- why did we attempt to fire?\n",sqrtf(distSqr),sqrtf(minAttackRangeSqr))); + DEBUG_ASSERTCRASH(distSqr > minAttackRangeSqr*0.8f, ("*** victim is closer than min attack range (%f vs %f) of this weapon -- why did we attempt to fire?",sqrtf(distSqr),sqrtf(minAttackRangeSqr))); //-extraLogging #if defined(RTS_DEBUG) @@ -1203,7 +1203,7 @@ void WeaponTemplate::dealDamageInternal(ObjectID sourceID, ObjectID victimID, co Real secondaryDamage = getSecondaryDamage(bonus); Int affects = getAffectsMask(); - DEBUG_ASSERTCRASH(secondaryRadius >= primaryRadius || secondaryRadius == 0.0f, ("secondary radius should be >= primary radius (or zero)\n")); + DEBUG_ASSERTCRASH(secondaryRadius >= primaryRadius || secondaryRadius == 0.0f, ("secondary radius should be >= primary radius (or zero)")); Real primaryRadiusSqr = sqr(primaryRadius); Real radius = max(primaryRadius, secondaryRadius); @@ -1400,7 +1400,7 @@ const WeaponTemplate *WeaponStore::findWeaponTemplate( AsciiString name ) const if (stricmp(name.str(), "None") == 0) return NULL; const WeaponTemplate * wt = findWeaponTemplatePrivate( TheNameKeyGenerator->nameToKey( name ) ); - DEBUG_ASSERTCRASH(wt != NULL, ("Weapon %s not found!\n",name.str())); + DEBUG_ASSERTCRASH(wt != NULL, ("Weapon %s not found!",name.str())); return wt; } @@ -1816,7 +1816,7 @@ Bool Weapon::computeApproachTarget(const Object *source, const Object *target, c if (minAttackRange > PATHFIND_CELL_SIZE_F && dist < minAttackRange) { // We aret too close, so move away from the target. - DEBUG_ASSERTCRASH((minAttackRange<0.9f*getAttackRange(source)), ("Min attack range is too near attack range.\n")); + DEBUG_ASSERTCRASH((minAttackRange<0.9f*getAttackRange(source)), ("Min attack range is too near attack range.")); // Recompute dir, cause if the bounding spheres touch, it will be 0. Coord3D srcPos = *source->getPosition(); dir.x = srcPos.x-targetPos->x; diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp index 7b292f4e6a..cf9aca3ff1 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp @@ -4651,7 +4651,7 @@ void ScriptEngine::reset( void ) m_allObjectTypeLists.erase(it); } } - DEBUG_ASSERTCRASH( m_allObjectTypeLists.empty() == TRUE, ("ScriptEngine::reset - m_allObjectTypeLists should be empty but is not!\n") ); + DEBUG_ASSERTCRASH( m_allObjectTypeLists.empty() == TRUE, ("ScriptEngine::reset - m_allObjectTypeLists should be empty but is not!") ); // reset all the reveals that have taken place. m_namedReveals.clear(); @@ -5413,7 +5413,7 @@ Int ScriptEngine::allocateCounter( const AsciiString& name) return i; } } - DEBUG_ASSERTCRASH(m_numCountersgetNumParameters() >= 3, ("Not enough parameters.\n")); - DEBUG_ASSERTCRASH(pCondition->getConditionType() == Condition::COUNTER, ("Wrong condition.\n")); + DEBUG_ASSERTCRASH(pCondition->getNumParameters() >= 3, ("Not enough parameters.")); + DEBUG_ASSERTCRASH(pCondition->getConditionType() == Condition::COUNTER, ("Wrong condition.")); Int counterNdx = pCondition->getParameter(0)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pCondition->getParameter(0)->getString()); @@ -5636,7 +5636,7 @@ Bool ScriptEngine::evaluateCounter( Condition *pCondition ) //------------------------------------------------------------------------------------------------- void ScriptEngine::setCounter( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); Int counterNdx = pAction->getParameter(0)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pAction->getParameter(0)->getString()); @@ -5659,7 +5659,7 @@ void ScriptEngine::setFade( ScriptAction *pAction ) } #endif - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 5, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 5, ("Not enough parameters.")); switch (pAction->getActionType()) { default: m_fade = FADE_NONE; return; case ScriptAction::CAMERA_FADE_ADD: m_fade = FADE_ADD; break; @@ -5685,7 +5685,7 @@ void ScriptEngine::setFade( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::setSway( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 5, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 5, ("Not enough parameters.")); ++m_breezeInfo.m_breezeVersion; m_breezeInfo.m_direction = pAction->getParameter(0)->getReal(); m_breezeInfo.m_directionVec.x = Sin(m_breezeInfo.m_direction); @@ -5704,7 +5704,7 @@ void ScriptEngine::setSway( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::addCounter( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); Int value = pAction->getParameter(0)->getInt(); Int counterNdx = pAction->getParameter(1)->getInt(); if (counterNdx == 0) { @@ -5719,7 +5719,7 @@ void ScriptEngine::addCounter( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::subCounter( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); Int value = pAction->getParameter(0)->getInt(); Int counterNdx = pAction->getParameter(1)->getInt(); if (counterNdx == 0) { @@ -5734,8 +5734,8 @@ void ScriptEngine::subCounter( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- Bool ScriptEngine::evaluateFlag( Condition *pCondition ) { - DEBUG_ASSERTCRASH(pCondition->getNumParameters() >= 2, ("Not enough parameters.\n")); - DEBUG_ASSERTCRASH(pCondition->getConditionType() == Condition::FLAG, ("Wrong condition.\n")); + DEBUG_ASSERTCRASH(pCondition->getNumParameters() >= 2, ("Not enough parameters.")); + DEBUG_ASSERTCRASH(pCondition->getConditionType() == Condition::FLAG, ("Wrong condition.")); Int flagNdx = pCondition->getParameter(0)->getInt(); if (flagNdx == 0) { flagNdx = allocateFlag(pCondition->getParameter(0)->getString()); @@ -5763,7 +5763,7 @@ Bool ScriptEngine::evaluateFlag( Condition *pCondition ) //------------------------------------------------------------------------------------------------- void ScriptEngine::setFlag( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); Int flagNdx = pAction->getParameter(0)->getInt(); if (flagNdx == 0) { flagNdx = allocateFlag(pAction->getParameter(0)->getString()); @@ -5826,7 +5826,7 @@ const AttackPriorityInfo *ScriptEngine::getAttackInfo(const AsciiString& name) //------------------------------------------------------------------------------------------------- void ScriptEngine::setPriorityThing( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 3, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 3, ("Not enough parameters.")); AsciiString typeArgument = pAction->getParameter(1)->getString(); @@ -5902,7 +5902,7 @@ void ScriptEngine::setPriorityThing( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::setPriorityKind( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 3, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 3, ("Not enough parameters.")); AttackPriorityInfo *info = findAttackInfo(pAction->getParameter(0)->getString(), true); if (info==NULL) { AppendDebugMessage("***Error allocating attack priority set - fix or raise limit. ***", false); @@ -5926,7 +5926,7 @@ void ScriptEngine::setPriorityKind( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::setPriorityDefault( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); AttackPriorityInfo *info = findAttackInfo(pAction->getParameter(0)->getString(), true); if (info==NULL) { AppendDebugMessage("***Error allocating attack priority set - fix or raise limit. ***", false); @@ -5991,8 +5991,8 @@ void ScriptEngine::removeObjectTypes(ObjectTypes *typesToRemove) //------------------------------------------------------------------------------------------------- Bool ScriptEngine::evaluateTimer( Condition *pCondition ) { - DEBUG_ASSERTCRASH(pCondition->getNumParameters() >= 1, ("Not enough parameters.\n")); - DEBUG_ASSERTCRASH(pCondition->getConditionType() == Condition::TIMER_EXPIRED, ("Wrong condition.\n")); + DEBUG_ASSERTCRASH(pCondition->getNumParameters() >= 1, ("Not enough parameters.")); + DEBUG_ASSERTCRASH(pCondition->getConditionType() == Condition::TIMER_EXPIRED, ("Wrong condition.")); Int counterNdx = pCondition->getParameter(0)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pCondition->getParameter(0)->getString()); @@ -6011,7 +6011,7 @@ Bool ScriptEngine::evaluateTimer( Condition *pCondition ) //------------------------------------------------------------------------------------------------- void ScriptEngine::setTimer( ScriptAction *pAction, Bool millisecondTimer, Bool random ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); Int counterNdx = pAction->getParameter(0)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pAction->getParameter(0)->getString()); @@ -6040,7 +6040,7 @@ void ScriptEngine::setTimer( ScriptAction *pAction, Bool millisecondTimer, Bool //------------------------------------------------------------------------------------------------- void ScriptEngine::pauseTimer( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.")); Int counterNdx = pAction->getParameter(0)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pAction->getParameter(0)->getString()); @@ -6054,7 +6054,7 @@ void ScriptEngine::pauseTimer( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::restartTimer( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.")); Int counterNdx = pAction->getParameter(0)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pAction->getParameter(0)->getString()); @@ -6070,7 +6070,7 @@ void ScriptEngine::restartTimer( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::adjustTimer( ScriptAction *pAction, Bool millisecondTimer, Bool add) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); Int counterNdx = pAction->getParameter(1)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pAction->getParameter(1)->getString()); @@ -6094,7 +6094,7 @@ void ScriptEngine::adjustTimer( ScriptAction *pAction, Bool millisecondTimer, Bo //------------------------------------------------------------------------------------------------- void ScriptEngine::enableScript( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.")); ScriptGroup *pGroup = findGroup(pAction->getParameter(0)->getString()); if (pGroup) { pGroup->setActive(true); @@ -6110,7 +6110,7 @@ void ScriptEngine::enableScript( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::disableScript( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.")); Script *pScript = findScript(pAction->getParameter(0)->getString()); if (pScript) { pScript->setActive(false); @@ -6126,7 +6126,7 @@ void ScriptEngine::disableScript( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::callSubroutine( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.")); AsciiString scriptName = pAction->getParameter(0)->getString(); Script *pScript; ScriptGroup *pGroup = findGroup(scriptName); @@ -6967,9 +6967,9 @@ void ScriptEngine::executeScripts( Script *pScriptHead ) //------------------------------------------------------------------------------------------------- const ActionTemplate * ScriptEngine::getActionTemplate( Int ndx ) { - DEBUG_ASSERTCRASH(ndx >= 0 && ndx < ScriptAction::NUM_ITEMS, ("Out of range.\n")); + DEBUG_ASSERTCRASH(ndx >= 0 && ndx < ScriptAction::NUM_ITEMS, ("Out of range.")); if (ndx <0 || ndx >= ScriptAction::NUM_ITEMS) ndx = 0; - DEBUG_ASSERTCRASH (!m_actionTemplates[ndx].getName().isEmpty(), ("Need to initialize action enum=%d.\n", ndx)); + DEBUG_ASSERTCRASH (!m_actionTemplates[ndx].getName().isEmpty(), ("Need to initialize action enum=%d.", ndx)); return &m_actionTemplates[ndx]; } // end getActionTemplate @@ -6979,9 +6979,9 @@ const ActionTemplate * ScriptEngine::getActionTemplate( Int ndx ) //------------------------------------------------------------------------------------------------- const ConditionTemplate * ScriptEngine::getConditionTemplate( Int ndx ) { - DEBUG_ASSERTCRASH(ndx >= 0 && ndx < ScriptAction::NUM_ITEMS, ("Out of range.\n")); + DEBUG_ASSERTCRASH(ndx >= 0 && ndx < ScriptAction::NUM_ITEMS, ("Out of range.")); if (ndx <0 || ndx >= Condition::NUM_ITEMS) ndx = 0; - DEBUG_ASSERTCRASH (!m_conditionTemplates[ndx].getName().isEmpty(), ("Need to initialize Condition enum=%d.\n", ndx)); + DEBUG_ASSERTCRASH (!m_conditionTemplates[ndx].getName().isEmpty(), ("Need to initialize Condition enum=%d.", ndx)); return &m_conditionTemplates[ndx]; } // end getConditionTemplate @@ -7478,7 +7478,7 @@ void SequentialScript::xfer( Xfer *xfer ) xfer->xferAsciiString( &scriptName ); // script pointer - DEBUG_ASSERTCRASH( m_scriptToExecuteSequentially == NULL, ("SequentialScript::xfer - m_scripttoExecuteSequentially\n") ); + DEBUG_ASSERTCRASH( m_scriptToExecuteSequentially == NULL, ("SequentialScript::xfer - m_scripttoExecuteSequentially") ); // find script m_scriptToExecuteSequentially = const_cast(TheScriptEngine->findScriptByName(scriptName)); @@ -7816,7 +7816,7 @@ static void xferListAsciiString( Xfer *xfer, ListAsciiString *list ) { // sanity - DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiString - Invalid parameters\n") ); + DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiString - Invalid parameters") ); // version XferVersion currentVersion = 1; @@ -7879,7 +7879,7 @@ static void xferListAsciiStringUINT( Xfer *xfer, ListAsciiStringUINT *list ) { // sanity - DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiStringUINT - Invalid parameters\n") ); + DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiStringUINT - Invalid parameters") ); // version XferVersion currentVersion = 1; @@ -7954,7 +7954,7 @@ static void xferListAsciiStringObjectID( Xfer *xfer, ListAsciiStringObjectID *li { // sanity - DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiStringObjectID - Invalid parameters\n") ); + DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiStringObjectID - Invalid parameters") ); // version XferVersion currentVersion = 1; @@ -8029,7 +8029,7 @@ static void xferListAsciiStringCoord3D( Xfer *xfer, ListAsciiStringCoord3D *list { // sanity - DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiStringCoord3D - Invalid parameters\n") ); + DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiStringCoord3D - Invalid parameters") ); // version XferVersion currentVersion = 1; @@ -9593,7 +9593,7 @@ static void _initVTune() { VTPause = (VTProc)::GetProcAddress(st_vTuneDLL, "VTPause"); VTResume = (VTProc)::GetProcAddress(st_vTuneDLL, "VTResume"); - DEBUG_ASSERTCRASH(VTPause != NULL && VTResume != NULL, ("VTuneAPI procs not found!\n")); + DEBUG_ASSERTCRASH(VTPause != NULL && VTResume != NULL, ("VTuneAPI procs not found!")); } else { @@ -9608,7 +9608,7 @@ static void _initVTune() if (VTPause) VTPause(); // only complain about it being missing if they were expecting it to be present - DEBUG_ASSERTCRASH(st_vTuneDLL != NULL, ("VTuneAPI DLL not found!\n")); + DEBUG_ASSERTCRASH(st_vTuneDLL != NULL, ("VTuneAPI DLL not found!")); } else { diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 3e75fbf39f..6f143f5b95 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -311,7 +311,7 @@ void GameLogic::destroyAllObjectsImmediate() // process the destroy list immediately processDestroyList(); - DEBUG_ASSERTCRASH( m_objList == NULL, ("destroyAllObjectsImmediate: Object list not cleared\n") ); + DEBUG_ASSERTCRASH( m_objList == NULL, ("destroyAllObjectsImmediate: Object list not cleared") ); } // end destroyAllObjectsImmediate @@ -499,7 +499,7 @@ static Object * placeObjectAtPosition(Int slotNum, AsciiString objectTemplateNam { const ThingTemplate* btt = TheThingFactory->findTemplate(objectTemplateName); Object *obj = TheThingFactory->newObject( btt, pPlayer->getDefaultTeam() ); - DEBUG_ASSERTCRASH(obj, ("TheThingFactory didn't give me a valid Object for player %d's (%ls) starting building\n", + DEBUG_ASSERTCRASH(obj, ("TheThingFactory didn't give me a valid Object for player %d's (%ls) starting building", slotNum, pTemplate->getDisplayName().str())); if (obj) { @@ -551,7 +551,7 @@ static void placeNetworkBuildingsForPlayer(Int slotNum, const GameSlot *pSlot, P Waypoint *waypoint = findNamedWaypoint(waypointName); Waypoint *rallyWaypoint = findNamedWaypoint(rallyWaypointName); - DEBUG_ASSERTCRASH(waypoint, ("Player %d has no starting waypoint (Player_%d_Start)\n", slotNum, startPos)); + DEBUG_ASSERTCRASH(waypoint, ("Player %d has no starting waypoint (Player_%d_Start)", slotNum, startPos)); if (!waypoint) return; @@ -560,7 +560,7 @@ static void placeNetworkBuildingsForPlayer(Int slotNum, const GameSlot *pSlot, P AsciiString buildingTemplateName = pTemplate->getStartingBuilding(); - DEBUG_ASSERTCRASH(!buildingTemplateName.isEmpty(), ("no starting building type for player %d (playertemplate %ls)\n", + DEBUG_ASSERTCRASH(!buildingTemplateName.isEmpty(), ("no starting building type for player %d (playertemplate %ls)", slotNum, pTemplate->getDisplayName().str())); if (buildingTemplateName.isEmpty()) return; @@ -731,7 +731,7 @@ static void populateRandomSideAndColor( GameInfo *game ) DEBUG_LOG(("Player %d has playerTemplate index %d", i, playerTemplateIdx)); while (playerTemplateIdx != PLAYERTEMPLATE_OBSERVER && (playerTemplateIdx < 0 || playerTemplateIdx >= ThePlayerTemplateStore->getPlayerTemplateCount())) { - DEBUG_ASSERTCRASH(playerTemplateIdx == -1, ("Non-random bad playerTemplate %d in slot %d\n", playerTemplateIdx, i)); + DEBUG_ASSERTCRASH(playerTemplateIdx == -1, ("Non-random bad playerTemplate %d in slot %d", playerTemplateIdx, i)); #ifdef MORE_RANDOM // our RNG is basically shit -- horribly nonrandom at the start of the sequence. // get a few values at random to get rid of the dreck. @@ -764,7 +764,7 @@ static void populateRandomSideAndColor( GameInfo *game ) Int colorIdx = slot->getColor(); if (colorIdx < 0 || colorIdx >= TheMultiplayerSettings->getNumColors()) { - DEBUG_ASSERTCRASH(colorIdx == -1, ("Non-random bad color %d in slot %d\n", colorIdx, i)); + DEBUG_ASSERTCRASH(colorIdx == -1, ("Non-random bad color %d in slot %d", colorIdx, i)); while (colorIdx == -1) { colorIdx = GameLogicRandomValue(0, TheMultiplayerSettings->getNumColors()-1); @@ -862,7 +862,7 @@ static void populateRandomStartPosition( GameInfo *game ) Int posIdx = slot->getStartPos(); if (posIdx < 0 || posIdx >= numPlayers) { - DEBUG_ASSERTCRASH(posIdx == -1, ("Non-random bad start position %d in slot %d\n", posIdx, i)); + DEBUG_ASSERTCRASH(posIdx == -1, ("Non-random bad start position %d in slot %d", posIdx, i)); if (hasStartSpotBeenPicked) { // pick the farthest spot away @@ -897,7 +897,7 @@ static void populateRandomStartPosition( GameInfo *game ) } } } - DEBUG_ASSERTCRASH(farthestIndex >= 0, ("Couldn't find a farthest spot!\n")); + DEBUG_ASSERTCRASH(farthestIndex >= 0, ("Couldn't find a farthest spot!")); slot->setStartPos(farthestIndex); taken[farthestIndex] = TRUE; } @@ -1154,7 +1154,7 @@ void GameLogic::startNewGame( Bool saveGame ) if(m_loadScreen) updateLoadProgress(LOAD_PROGRESS_POST_PARTICLE_INI_LOAD); - DEBUG_ASSERTCRASH(m_frame == 0, ("framecounter expected to be 0 here\n")); + DEBUG_ASSERTCRASH(m_frame == 0, ("framecounter expected to be 0 here")); // before loading the map, load the map.ini file in the same directory. loadMapINI( TheGlobalData->m_mapName ); @@ -1264,7 +1264,7 @@ void GameLogic::startNewGame( Bool saveGame ) Int colorIdx = slot->getColor(); if (colorIdx < 0 || colorIdx >= TheMultiplayerSettings->getNumColors()) { - DEBUG_ASSERTCRASH(colorIdx == -1, ("Non-random bad color %d in slot %d\n", colorIdx, i)); + DEBUG_ASSERTCRASH(colorIdx == -1, ("Non-random bad color %d in slot %d", colorIdx, i)); while (colorIdx == -1) { colorIdx = GameLogicRandomValue(0, TheMultiplayerSettings->getNumColors()-1); @@ -1676,7 +1676,7 @@ void GameLogic::startNewGame( Bool saveGame ) continue; // Get the team information - DEBUG_ASSERTCRASH(pMapObj->getProperties()->getType(TheKey_originalOwner) == Dict::DICT_ASCIISTRING, ("unit %s has no original owner specified (obsolete map file)\n",pMapObj->getName().str())); + DEBUG_ASSERTCRASH(pMapObj->getProperties()->getType(TheKey_originalOwner) == Dict::DICT_ASCIISTRING, ("unit %s has no original owner specified (obsolete map file)",pMapObj->getName().str())); AsciiString originalOwner = pMapObj->getProperties()->getAsciiString(TheKey_originalOwner); Team *team = ThePlayerList->validateTeam(originalOwner); @@ -2455,7 +2455,7 @@ inline void GameLogic::validateSleepyUpdate() const //} for (i = 0; i < sz; ++i) { - DEBUG_ASSERTCRASH(m_sleepyUpdates[i]->friend_getIndexInLogic() == i, ("index mismatch: expected %d, got %d\n",i,m_sleepyUpdates[i]->friend_getIndexInLogic())); + DEBUG_ASSERTCRASH(m_sleepyUpdates[i]->friend_getIndexInLogic() == i, ("index mismatch: expected %d, got %d",i,m_sleepyUpdates[i]->friend_getIndexInLogic())); UnsignedInt pri = m_sleepyUpdates[i]->friend_getPriority(); if (i > 0) { @@ -2668,7 +2668,7 @@ UpdateModulePtr GameLogic::peekSleepyUpdate() const USE_PERF_TIMER(SleepyMaintenance) UpdateModulePtr u = m_sleepyUpdates.front(); - DEBUG_ASSERTCRASH(u->friend_getIndexInLogic() == 0, ("index mismatch: expected %d, got %d\n",0,u->friend_getIndexInLogic())); + DEBUG_ASSERTCRASH(u->friend_getIndexInLogic() == 0, ("index mismatch: expected %d, got %d",0,u->friend_getIndexInLogic())); return u; } @@ -3837,7 +3837,7 @@ void GameLogic::processProgressComplete(Int playerId) { if(playerId < 0 || playerId >= MAX_SLOTS) { - DEBUG_ASSERTCRASH(FALSE,("GameLogic::processProgressComplete, Invalid playerid was passed in %d\n", playerId)); + DEBUG_ASSERTCRASH(FALSE,("GameLogic::processProgressComplete, Invalid playerid was passed in %d", playerId)); return; } if(m_progressComplete[playerId] == TRUE) @@ -4189,13 +4189,13 @@ void GameLogic::prepareLogicForObjectLoad( void ) Bridge *bridge = TheTerrainLogic->findBridgeAt( obj->getPosition() ); // sanity - DEBUG_ASSERTCRASH( bridge, ("GameLogic::prepareLogicForObjectLoad - Unable to find bridge\n" )); + DEBUG_ASSERTCRASH( bridge, ("GameLogic::prepareLogicForObjectLoad - Unable to find bridge" )); // get the old object that is in the bridge info const BridgeInfo *bridgeInfo = bridge->peekBridgeInfo(); Object *oldObject = findObjectByID( bridgeInfo->bridgeObjectID ); - DEBUG_ASSERTCRASH( oldObject, ("GameLogic::prepareLogicForObjectLoad - Unable to find old bridge object\n") ); - DEBUG_ASSERTCRASH( oldObject == obj, ("GameLogic::prepareLogicForObjectLoad - obj != oldObject\n") ); + DEBUG_ASSERTCRASH( oldObject, ("GameLogic::prepareLogicForObjectLoad - Unable to find old bridge object") ); + DEBUG_ASSERTCRASH( oldObject == obj, ("GameLogic::prepareLogicForObjectLoad - obj != oldObject") ); // // destroy the 4 towers that are attached to this old object (they will be loaded from @@ -4553,7 +4553,7 @@ void GameLogic::xfer( Xfer *xfer ) if (value.isNotEmpty()) { button = TheControlBar->findCommandButton(value); - DEBUG_ASSERTCRASH(button != NULL, ("Could not find button %s\n",value.str())); + DEBUG_ASSERTCRASH(button != NULL, ("Could not find button %s",value.str())); } m_controlBarOverrides[name] = button; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp index 290c1ddade..8bb40bd63b 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp @@ -99,7 +99,7 @@ static int thePlanSubjectCount = 0; static void doMoveTo( Object *obj, const Coord3D *pos ) { AIUpdateInterface *ai = obj->getAIUpdateInterface(); - DEBUG_ASSERTCRASH(ai, ("Attemped doMoveTo() on an Object with no AI\n")); + DEBUG_ASSERTCRASH(ai, ("Attemped doMoveTo() on an Object with no AI")); if (ai) { if (theBuildPlan) @@ -343,7 +343,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) #endif Player *thisPlayer = ThePlayerList->getNthPlayer( msg->getPlayerIndex() ); - DEBUG_ASSERTCRASH( thisPlayer, ("logicMessageDispatcher: Processing message from unknown player (player index '%d')\n", + DEBUG_ASSERTCRASH( thisPlayer, ("logicMessageDispatcher: Processing message from unknown player (player index '%d')", msg->getPlayerIndex()) ); AIGroupPtr currentlySelectedGroup = NULL; @@ -1355,7 +1355,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) if( pu == NULL ) { - DEBUG_ASSERTCRASH( 0, ("MSG_QUEUE_UNIT_CREATE: Producer '%s' doesn't have a unit production interface\n", + DEBUG_ASSERTCRASH( 0, ("MSG_QUEUE_UNIT_CREATE: Producer '%s' doesn't have a unit production interface", producer->getTemplate()->getName().str()) ); break; diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp index bad49a704e..d2ebe60096 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp @@ -322,7 +322,7 @@ static void gameTooltip(GameWindow *window, } } } - DEBUG_ASSERTCRASH(numPlayers, ("Tooltipping a 0-player game!\n")); + DEBUG_ASSERTCRASH(numPlayers, ("Tooltipping a 0-player game!")); TheMouse->setCursorTooltip( tooltip, 10, NULL, 2.0f ); // the text and width are the only params used. the others are the default values. } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp index c46f4a0bb1..5a48bf261d 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp @@ -467,7 +467,7 @@ void GameSpyStagingRoom::cleanUpSlotPointers( void ) GameSpyGameSlot * GameSpyStagingRoom::getGameSpySlot( Int index ) { GameSlot *slot = getSlot(index); - DEBUG_ASSERTCRASH(slot && (slot == &(m_GameSpySlot[index])), ("Bad game slot pointer\n")); + DEBUG_ASSERTCRASH(slot && (slot == &(m_GameSpySlot[index])), ("Bad game slot pointer")); return (GameSpyGameSlot *)slot; } diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp index 2c200d87c2..50c058a305 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp @@ -2554,7 +2554,7 @@ static void roomKeyChangedCallback(PEER peer, RoomType roomType, const char *nic #ifdef USE_BROADCAST_KEYS PeerThreadClass *t = (PeerThreadClass *)param; DEBUG_ASSERTCRASH(t, ("No Peer thread!")); - DEBUG_ASSERTCRASH(nick && key && val, ("Bad values %X %X %X\n", nick, key, val)); + DEBUG_ASSERTCRASH(nick && key && val, ("Bad values %X %X %X", nick, key, val)); if (!t || !nick || !key || !val) { DEBUG_ASSERTLOG(!nick, ("nick = %s", nick)); @@ -2789,7 +2789,7 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, #endif // DEBUG_LOGGING PeerThreadClass *t = (PeerThreadClass *)param; - DEBUG_ASSERTCRASH(name, ("Game has no name!\n")); + DEBUG_ASSERTCRASH(name, ("Game has no name!")); if (!t || !success || (!name && (msg == PEER_ADD || msg == PEER_UPDATE))) { DEBUG_LOG(("Bailing from listingGamesCallback() - success=%d, name=%X, server=%X, msg=%X", success, name, server, msg)); diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp index ede800d31d..522de0866d 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp @@ -544,7 +544,7 @@ void GameSpyPSMessageQueue::trackPlayerStats( PSPlayerStats stats ) { #ifdef DEBUG_LOGGING debugDumpPlayerStats( stats ); - DEBUG_ASSERTCRASH(stats.id != 0, ("Tracking stats with ID of 0\n")); + DEBUG_ASSERTCRASH(stats.id != 0, ("Tracking stats with ID of 0")); #endif PSPlayerStats newStats; std::map::iterator it = m_playerStats.find(stats.id); @@ -1320,8 +1320,8 @@ PSPlayerStats GameSpyPSMessageQueueInterface::parsePlayerKVPairs( std::string kv continue; } - //DEBUG_ASSERTCRASH(generalMarker >= 0, ("Unknown KV Pair in persistent storage: [%s] = [%s]\n", k.c_str(), v.c_str())); - //DEBUG_ASSERTCRASH(generalMarker < 0, ("Unknown KV Pair in persistent storage for PlayerTemplate %d: [%s] = [%s]\n", generalMarker, k.c_str(), v.c_str())); + //DEBUG_ASSERTCRASH(generalMarker >= 0, ("Unknown KV Pair in persistent storage: [%s] = [%s]", k.c_str(), v.c_str())); + //DEBUG_ASSERTCRASH(generalMarker < 0, ("Unknown KV Pair in persistent storage for PlayerTemplate %d: [%s] = [%s]", generalMarker, k.c_str(), v.c_str())); } return s; diff --git a/Generals/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp b/Generals/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp index c8ea381f19..b9405f769a 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp @@ -549,7 +549,7 @@ void LANAPI::OnPlayerLeave( UnicodeString player ) if (m_name.compare(player) == 0) { // We're leaving. Save options and Pop the shell up a screen. - //DEBUG_ASSERTCRASH(false, ("Slot is %d\n", m_currentGame->getLocalSlotNum())); + //DEBUG_ASSERTCRASH(false, ("Slot is %d", m_currentGame->getLocalSlotNum())); if (m_currentGame && m_currentGame->isInGame() && m_currentGame->getLocalSlotNum() >= 0) { LANPreferences pref; diff --git a/Generals/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp b/Generals/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp index bbdaee94f2..72de097c4f 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp @@ -421,7 +421,7 @@ void LANAPI::handleJoinAccept( LANMessage *msg, UnsignedInt senderIP ) prefs.write(); OnGameJoin(RET_OK, m_currentGame); - //DEBUG_ASSERTCRASH(false, ("setting host to %ls@%ls\n", m_currentGame->getLANSlot(0)->getUser()->getLogin().str(), + //DEBUG_ASSERTCRASH(false, ("setting host to %ls@%ls", m_currentGame->getLANSlot(0)->getUser()->getLogin().str(), // m_currentGame->getLANSlot(0)->getUser()->getHost().str())); } m_pendingAction = ACT_NONE; diff --git a/Generals/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp b/Generals/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp index e8a823fcab..76d752e38e 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp @@ -93,7 +93,7 @@ void NetCommandWrapperListNode::copyChunkData(NetWrapperCommandMsg *msg) { return; } - DEBUG_ASSERTCRASH(msg->getChunkNumber() < m_numChunks, ("MunkeeChunk %d of %d\n", + DEBUG_ASSERTCRASH(msg->getChunkNumber() < m_numChunks, ("MunkeeChunk %d of %d", msg->getChunkNumber(), m_numChunks)); if (msg->getChunkNumber() >= m_numChunks) return; diff --git a/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp b/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp index c465a43346..57cd486bca 100644 --- a/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp +++ b/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp @@ -105,7 +105,7 @@ MilesAudioManager::~MilesAudioManager() closeDevice(); delete m_audioCache; - DEBUG_ASSERTCRASH(this == TheAudio, ("Umm...\n")); + DEBUG_ASSERTCRASH(this == TheAudio, ("Umm...")); TheAudio = NULL; } @@ -2909,7 +2909,7 @@ void MilesAudioManager::initSamplePools( void ) int i = 0; for (i = 0; i < getAudioSettings()->m_sampleCount2D; ++i) { HSAMPLE sample = AIL_allocate_sample_handle(m_digitalHandle); - DEBUG_ASSERTCRASH(sample, ("Couldn't get %d 2D samples\n", i + 1)); + DEBUG_ASSERTCRASH(sample, ("Couldn't get %d 2D samples", i + 1)); if (sample) { AIL_init_sample(sample); AIL_set_sample_user_data(sample, 0, i + 1); @@ -2920,7 +2920,7 @@ void MilesAudioManager::initSamplePools( void ) for (i = 0; i < getAudioSettings()->m_sampleCount3D; ++i) { H3DSAMPLE sample = AIL_allocate_3D_sample_handle(m_provider3D[m_selectedProvider].id); - DEBUG_ASSERTCRASH(sample, ("Couldn't get %d 3D samples\n", i + 1)); + DEBUG_ASSERTCRASH(sample, ("Couldn't get %d 3D samples", i + 1)); if (sample) { AIL_set_3D_user_data(sample, 0, i + 1); m_available3DSamples.push_back(sample); diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp index f113abaa92..ec7404d7c1 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp @@ -869,12 +869,12 @@ void W3DRadar::init( void ) // poolify m_terrainTexture = MSGNEW("TextureClass") TextureClass( m_textureWidth, m_textureHeight, m_terrainTextureFormat, MIP_LEVELS_1 ); - DEBUG_ASSERTCRASH( m_terrainTexture, ("W3DRadar: Unable to allocate terrain texture\n") ); + DEBUG_ASSERTCRASH( m_terrainTexture, ("W3DRadar: Unable to allocate terrain texture") ); // allocate our overlay texture m_overlayTexture = MSGNEW("TextureClass") TextureClass( m_textureWidth, m_textureHeight, m_overlayTextureFormat, MIP_LEVELS_1 ); - DEBUG_ASSERTCRASH( m_overlayTexture, ("W3DRadar: Unable to allocate overlay texture\n") ); + DEBUG_ASSERTCRASH( m_overlayTexture, ("W3DRadar: Unable to allocate overlay texture") ); // set filter type for the overlay texture, try it and see if you like it, I don't ;) // m_overlayTexture->Set_Min_Filter( TextureFilterClass::FILTER_TYPE_NONE ); @@ -883,7 +883,7 @@ void W3DRadar::init( void ) // allocate our shroud texture m_shroudTexture = MSGNEW("TextureClass") TextureClass( m_textureWidth, m_textureHeight, m_shroudTextureFormat, MIP_LEVELS_1 ); - DEBUG_ASSERTCRASH( m_shroudTexture, ("W3DRadar: Unable to allocate shroud texture\n") ); + DEBUG_ASSERTCRASH( m_shroudTexture, ("W3DRadar: Unable to allocate shroud texture") ); m_shroudTexture->Get_Filter().Set_Min_Filter( TextureFilterClass::FILTER_TYPE_DEFAULT ); m_shroudTexture->Get_Filter().Set_Mag_Filter( TextureFilterClass::FILTER_TYPE_DEFAULT ); @@ -1051,7 +1051,7 @@ void W3DRadar::buildTerrainTexture( TerrainLogic *terrain ) // get the terrain surface to draw in surface = m_terrainTexture->Get_Surface_Level(); - DEBUG_ASSERTCRASH( surface, ("W3DRadar: Can't get surface for terrain texture\n") ); + DEBUG_ASSERTCRASH( surface, ("W3DRadar: Can't get surface for terrain texture") ); // build the terrain RGBColor sampleColor; @@ -1193,7 +1193,7 @@ void W3DRadar::buildTerrainTexture( TerrainLogic *terrain ) TerrainRoadType *bridgeTemplate = TheTerrainRoads->findBridge( bridgeTName ); // sanity - DEBUG_ASSERTCRASH( bridgeTemplate, ("W3DRadar::buildTerrainTexture - Can't find bridge template for '%s'\n", bridgeTName.str()) ); + DEBUG_ASSERTCRASH( bridgeTemplate, ("W3DRadar::buildTerrainTexture - Can't find bridge template for '%s'", bridgeTName.str()) ); // use bridge color if ( bridgeTemplate ) @@ -1309,7 +1309,7 @@ void W3DRadar::setShroudLevel(Int shroudX, Int shroudY, CellShroudStatus setting return; SurfaceClass* surface = m_shroudTexture->Get_Surface_Level(); - DEBUG_ASSERTCRASH( surface, ("W3DRadar: Can't get surface for Shroud texture\n") ); + DEBUG_ASSERTCRASH( surface, ("W3DRadar: Can't get surface for Shroud texture") ); Int mapMinX = shroudX * shroud->getCellWidth(); Int mapMinY = shroudY * shroud->getCellHeight(); diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp index 6c66ca7232..b9d548d32f 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp @@ -109,7 +109,7 @@ void W3DDebrisDraw::setModelName(AsciiString name, Color color, ShadowType t) if (color != 0) hexColor = color | 0xFF000000; m_renderObject = W3DDisplay::m_assetManager->Create_Render_Obj(name.str(), getDrawable()->getScale(), hexColor); - DEBUG_ASSERTCRASH(m_renderObject, ("Debris model %s not found!\n",name.str())); + DEBUG_ASSERTCRASH(m_renderObject, ("Debris model %s not found!",name.str())); if (m_renderObject) { if (W3DDisplay::m_3DScene != NULL) diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 7dc87bc293..155a589bdc 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -343,7 +343,7 @@ HAnimClass* W3DAnimationInfo::getAnimHandle() const { // Get_HAnim addrefs it, so we'll have to release it in our dtor. m_handle = W3DDisplay::m_assetManager->Get_HAnim(m_name.str()); - DEBUG_ASSERTCRASH(m_handle, ("*** ASSET ERROR: animation %s not found\n",m_name.str())); + DEBUG_ASSERTCRASH(m_handle, ("*** ASSET ERROR: animation %s not found",m_name.str())); if (m_handle) { m_naturalDurationInMsec = m_handle->Get_Num_Frames() * 1000.0f / m_handle->Get_Frame_Rate(); @@ -355,7 +355,7 @@ HAnimClass* W3DAnimationInfo::getAnimHandle() const return m_handle; #else HAnimClass* handle = W3DDisplay::m_assetManager->Get_HAnim(m_name.str()); - DEBUG_ASSERTCRASH(handle, ("*** ASSET ERROR: animation %s not found\n",m_name.str())); + DEBUG_ASSERTCRASH(handle, ("*** ASSET ERROR: animation %s not found",m_name.str())); if (handle != NULL && m_naturalDurationInMsec < 0) { m_naturalDurationInMsec = handle->Get_Num_Frames() * 1000.0f / handle->Get_Frame_Rate(); @@ -614,7 +614,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c } robj = W3DDisplay::m_assetManager->Create_Render_Obj(m_modelName.str(), scale, 0); - DEBUG_ASSERTCRASH(robj, ("*** ASSET ERROR: Model %s not found!\n",m_modelName.str())); + DEBUG_ASSERTCRASH(robj, ("*** ASSET ERROR: Model %s not found!",m_modelName.str())); if (!robj) { //BONEPOS_LOG(("Bailing: could not load render object\n")); @@ -825,7 +825,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const } } // if empty - DEBUG_ASSERTCRASH(!(m_modelName.isNotEmpty() && m_weaponBarrelInfoVec[wslot].empty()), ("*** ASSET ERROR: No fx bone named '%s' found in model %s!\n",fxBoneName.str(),m_modelName.str())); + DEBUG_ASSERTCRASH(!(m_modelName.isNotEmpty() && m_weaponBarrelInfoVec[wslot].empty()), ("*** ASSET ERROR: No fx bone named '%s' found in model %s!",fxBoneName.str(),m_modelName.str())); } } m_validStuff |= BARRELS_VALID; @@ -2850,7 +2850,7 @@ static Bool turretNamesDiffer(const ModelConditionInfo* a, const ModelConditionI //------------------------------------------------------------------------------------------------- void W3DModelDraw::setModelState(const ModelConditionInfo* newState) { - DEBUG_ASSERTCRASH(newState, ("invalid state in W3DModelDraw::setModelState\n")); + DEBUG_ASSERTCRASH(newState, ("invalid state in W3DModelDraw::setModelState")); #ifdef DEBUG_OBJECT_ID_EXISTS if (getDrawable() && getDrawable()->getObject() && getDrawable()->getObject()->getID() == TheObjectIDToDebug) @@ -2972,7 +2972,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) else { m_renderObject = W3DDisplay::m_assetManager->Create_Render_Obj(newState->m_modelName.str(), draw->getScale(), m_hexColor); - DEBUG_ASSERTCRASH(m_renderObject, ("*** ASSET ERROR: Model %s not found!\n",newState->m_modelName.str())); + DEBUG_ASSERTCRASH(m_renderObject, ("*** ASSET ERROR: Model %s not found!",newState->m_modelName.str())); } //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::setModelState()\n")); diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp index 925c282f28..e1a37dc330 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp @@ -326,10 +326,10 @@ void W3DTankTruckDraw::updateBones( void ) { if( !getW3DTankTruckDrawModuleData()->m_frontLeftTireBoneName.isEmpty() ) { m_frontLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_frontLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_frontLeftTireBone, ("Missing front-left tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_frontLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_frontLeftTireBone, ("Missing front-left tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_frontLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_frontRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_frontRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_frontRightTireBone, ("Missing front-right tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_frontRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_frontRightTireBone, ("Missing front-right tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_frontRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_frontRightTireBone ) { @@ -340,10 +340,10 @@ void W3DTankTruckDraw::updateBones( void ) { if( !getW3DTankTruckDrawModuleData()->m_rearLeftTireBoneName.isEmpty() ) { m_rearLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_rearLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_rearLeftTireBone, ("Missing rear-left tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_rearLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_rearLeftTireBone, ("Missing rear-left tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_rearLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_rearRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_rearRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_rearRightTireBone, ("Missing rear-left tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_rearRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_rearRightTireBone, ("Missing rear-left tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_rearRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_rearRightTireBone) { @@ -355,10 +355,10 @@ void W3DTankTruckDraw::updateBones( void ) { if( !getW3DTankTruckDrawModuleData()->m_midFrontLeftTireBoneName.isEmpty() ) { m_midFrontLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_midFrontLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midFrontLeftTireBone, ("Missing mid-front-left tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_midFrontLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midFrontLeftTireBone, ("Missing mid-front-left tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_midFrontLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_midFrontRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_midFrontRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midFrontRightTireBone, ("Missing mid-front-right tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_midFrontRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midFrontRightTireBone, ("Missing mid-front-right tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_midFrontRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_midFrontRightTireBone ) { @@ -370,10 +370,10 @@ void W3DTankTruckDraw::updateBones( void ) { if( !getW3DTankTruckDrawModuleData()->m_midRearLeftTireBoneName.isEmpty() ) { m_midRearLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_midRearLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midRearLeftTireBone, ("Missing mid-rear-left tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_midRearLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midRearLeftTireBone, ("Missing mid-rear-left tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_midRearLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_midRearRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_midRearRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midRearRightTireBone, ("Missing mid-rear-right tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_midRearRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midRearRightTireBone, ("Missing mid-rear-right tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_midRearRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_midRearRightTireBone) { diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp index a35c0f232f..a85d6d2f82 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp @@ -268,36 +268,36 @@ void W3DTruckDraw::updateBones( void ) if( !getW3DTruckDrawModuleData()->m_frontLeftTireBoneName.isEmpty() ) { m_frontLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_frontLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_frontLeftTireBone, ("Missing front-left tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_frontLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_frontLeftTireBone, ("Missing front-left tire bone %s in model %s", getW3DTruckDrawModuleData()->m_frontLeftTireBoneName.str(), getRenderObject()->Get_Name())); } if( !getW3DTruckDrawModuleData()->m_frontRightTireBoneName.isEmpty() ) { m_frontRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_frontRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_frontRightTireBone, ("Missing front-right tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_frontRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_frontRightTireBone, ("Missing front-right tire bone %s in model %s", getW3DTruckDrawModuleData()->m_frontRightTireBoneName.str(), getRenderObject()->Get_Name())); } //Rear tires if( !getW3DTruckDrawModuleData()->m_rearLeftTireBoneName.isEmpty() ) { m_rearLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_rearLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_rearLeftTireBone, ("Missing rear-left tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_rearLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_rearLeftTireBone, ("Missing rear-left tire bone %s in model %s", getW3DTruckDrawModuleData()->m_rearLeftTireBoneName.str(), getRenderObject()->Get_Name())); } if( !getW3DTruckDrawModuleData()->m_rearRightTireBoneName.isEmpty() ) { m_rearRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_rearRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_rearRightTireBone, ("Missing rear-left tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_rearRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_rearRightTireBone, ("Missing rear-left tire bone %s in model %s", getW3DTruckDrawModuleData()->m_rearRightTireBoneName.str(), getRenderObject()->Get_Name())); } //midFront tires if( !getW3DTruckDrawModuleData()->m_midFrontLeftTireBoneName.isEmpty() ) { m_midFrontLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_midFrontLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midFrontLeftTireBone, ("Missing mid-front-left tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_midFrontLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midFrontLeftTireBone, ("Missing mid-front-left tire bone %s in model %s", getW3DTruckDrawModuleData()->m_midFrontLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_midFrontRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_midFrontRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midFrontRightTireBone, ("Missing mid-front-right tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_midFrontRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midFrontRightTireBone, ("Missing mid-front-right tire bone %s in model %s", getW3DTruckDrawModuleData()->m_midFrontRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_midFrontRightTireBone ) { @@ -309,10 +309,10 @@ void W3DTruckDraw::updateBones( void ) if( !getW3DTruckDrawModuleData()->m_midRearLeftTireBoneName.isEmpty() ) { m_midRearLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_midRearLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midRearLeftTireBone, ("Missing mid-rear-left tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_midRearLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midRearLeftTireBone, ("Missing mid-rear-left tire bone %s in model %s", getW3DTruckDrawModuleData()->m_midRearLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_midRearRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_midRearRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midRearRightTireBone, ("Missing mid-rear-right tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_midRearRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midRearRightTireBone, ("Missing mid-rear-right tire bone %s in model %s", getW3DTruckDrawModuleData()->m_midRearRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_midRearRightTireBone) { @@ -324,10 +324,10 @@ void W3DTruckDraw::updateBones( void ) if( !getW3DTruckDrawModuleData()->m_midMidLeftTireBoneName.isEmpty() ) { m_midMidLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_midMidLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midMidLeftTireBone, ("Missing mid-mid-left tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_midMidLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midMidLeftTireBone, ("Missing mid-mid-left tire bone %s in model %s", getW3DTruckDrawModuleData()->m_midMidLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_midMidRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_midMidRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midMidRightTireBone, ("Missing mid-mid-right tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_midMidRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midMidRightTireBone, ("Missing mid-mid-right tire bone %s in model %s", getW3DTruckDrawModuleData()->m_midMidRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_midMidRightTireBone) { @@ -339,7 +339,7 @@ void W3DTruckDraw::updateBones( void ) if( !getW3DTruckDrawModuleData()->m_cabBoneName.isEmpty() ) { m_cabBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_cabBoneName.str()); - DEBUG_ASSERTCRASH(m_cabBone, ("Missing cab bone %s in model %s\n", getW3DTruckDrawModuleData()->m_cabBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_cabBone, ("Missing cab bone %s in model %s", getW3DTruckDrawModuleData()->m_cabBoneName.str(), getRenderObject()->Get_Name())); m_trailerBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_trailerBoneName.str()); } } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp index 8e0ea9fe11..8f9701e3cc 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp @@ -1495,7 +1495,7 @@ Shadow* W3DProjectedShadowManager::addDecal(Shadow::ShadowTypeInfo *shadowInfo) w3dTexture->Get_Filter().Set_V_Addr_Mode(TextureFilterClass::TEXTURE_ADDRESS_CLAMP); w3dTexture->Get_Filter().Set_Mip_Mapping(TextureFilterClass::FILTER_TYPE_NONE); - DEBUG_ASSERTCRASH(w3dTexture != NULL, ("Could not load decal texture: %s\n",texture_name)); + DEBUG_ASSERTCRASH(w3dTexture != NULL, ("Could not load decal texture: %s",texture_name)); if (!w3dTexture) return NULL; @@ -1614,7 +1614,7 @@ Shadow* W3DProjectedShadowManager::addDecal(RenderObjClass *robj, Shadow::Shadow w3dTexture->Get_Filter().Set_V_Addr_Mode(TextureFilterClass::TEXTURE_ADDRESS_CLAMP); w3dTexture->Get_Filter().Set_Mip_Mapping(TextureFilterClass::FILTER_TYPE_NONE); - DEBUG_ASSERTCRASH(w3dTexture != NULL, ("Could not load decal texture: %s\n",texture_name)); + DEBUG_ASSERTCRASH(w3dTexture != NULL, ("Could not load decal texture: %s",texture_name)); if (!w3dTexture) return NULL; diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp index 35a719578b..b7ac85405d 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp @@ -517,13 +517,13 @@ void W3DBridge::getIndicesNVertices(UnsignedShort *destination_ib, VertexFormatX numV = getModelVerticesFixed(destination_vb, *curVertexP, m_leftMtx, m_leftMesh, pLightsIterator); if (!numV) { //not enough room for vertices - DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.\n") ); + DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.") ); return; } numI = getModelIndices( destination_ib, *curIndexP, *curVertexP, m_leftMesh); if (!numI) { //not enough room for indices - DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.\n") ); + DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.") ); return; } *curIndexP += numI; @@ -567,13 +567,13 @@ void W3DBridge::getIndicesNVertices(UnsignedShort *destination_ib, VertexFormatX m_leftMtx, m_leftMesh, pLightsIterator); if (!numV) { //not enough room for vertices - DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.\n") ); + DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.") ); return; } numI = getModelIndices( destination_ib, *curIndexP, *curVertexP, m_leftMesh); if (!numI) { //not enough room for indices - DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.\n") ); + DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.") ); return; } *curIndexP += numI; @@ -588,13 +588,13 @@ void W3DBridge::getIndicesNVertices(UnsignedShort *destination_ib, VertexFormatX m_sectionMtx, m_sectionMesh, pLightsIterator); if (!numV) { //not enough room for vertices - DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.\n") ); + DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.") ); return; } numI = getModelIndices( destination_ib, *curIndexP, *curVertexP, m_sectionMesh); if (!numI) { //not enough room for indices - DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.\n") ); + DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.") ); return; } *curIndexP += numI; @@ -608,13 +608,13 @@ void W3DBridge::getIndicesNVertices(UnsignedShort *destination_ib, VertexFormatX m_rightMtx, m_rightMesh, pLightsIterator); if (!numV) { //not enough room for vertices - DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.\n") ); + DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.") ); return; } numI = getModelIndices( destination_ib, *curIndexP, *curVertexP, m_rightMesh); if (!numI) { //not enough room for indices - DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.\n") ); + DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.") ); return; } *curIndexP += numI; @@ -848,7 +848,7 @@ static RenderObjClass* createTower( SimpleSceneClass *scene, return NULL; // get template for this bridge - DEBUG_ASSERTCRASH( TheTerrainRoads, ("createTower: TheTerrainRoads is NULL\n") ); + DEBUG_ASSERTCRASH( TheTerrainRoads, ("createTower: TheTerrainRoads is NULL") ); TerrainRoadType *bridgeTemplate = TheTerrainRoads->findBridge( mapObject->getName() ); if( bridgeTemplate == NULL ) return NULL; @@ -871,7 +871,7 @@ static RenderObjClass* createTower( SimpleSceneClass *scene, // find the thing template for the tower we want to construct AsciiString towerTemplateName = bridgeTemplate->getTowerObjectName( type ); - DEBUG_ASSERTCRASH( TheThingFactory, ("createTower: TheThingFactory is NULL\n") ); + DEBUG_ASSERTCRASH( TheThingFactory, ("createTower: TheThingFactory is NULL") ); const ThingTemplate *towerTemplate = TheThingFactory->findTemplate( towerTemplateName ); if( towerTemplate == NULL ) return NULL; @@ -1033,7 +1033,7 @@ void W3DBridgeBuffer::worldBuilderUpdateBridgeTowers( W3DAssetManager *assetMana } // end if // sanity - DEBUG_ASSERTCRASH( towerRenderObj != NULL, ("worldBuilderUpdateBridgeTowers: unable to create tower for bridge '%s'\n", + DEBUG_ASSERTCRASH( towerRenderObj != NULL, ("worldBuilderUpdateBridgeTowers: unable to create tower for bridge '%s'", m_bridges[ i ].getTemplateName().str()) ); // update the position of the towers diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp index a385436e67..9405b72153 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp @@ -738,7 +738,7 @@ void W3DDisplay::init( void ) WW3D::Shutdown(); WWMath::Shutdown(); throw ERROR_INVALID_D3D; //failed to initialize. User probably doesn't have DX 8.1 - DEBUG_ASSERTCRASH( 0, ("Unable to set render device\n") ); + DEBUG_ASSERTCRASH( 0, ("Unable to set render device") ); return; } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp index f1918165c2..ee1d7fab7f 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp @@ -1335,7 +1335,7 @@ void WaterRenderObjClass::loadSetting( Setting *setting, TimeOfDay timeOfDay ) SurfaceClass::SurfaceDescription surfaceDesc; // sanity - DEBUG_ASSERTCRASH( setting, ("WaterRenderObjClass::loadSetting, NULL setting\n") ); + DEBUG_ASSERTCRASH( setting, ("WaterRenderObjClass::loadSetting, NULL setting") ); // textures setting->skyTexture = WW3DAssetManager::Get_Instance()->Get_Texture( WaterSettings[ timeOfDay ].m_skyTextureFile.str() ); @@ -2430,7 +2430,7 @@ void WaterRenderObjClass::renderWaterMesh(void) inline void WaterRenderObjClass::setGridVertexHeight(Int x, Int y, Real value) { - DEBUG_ASSERTCRASH( x < (m_gridCellsX+1) && y < (m_gridCellsY+1), ("Invalid Water Mesh Coordinates\n") ); + DEBUG_ASSERTCRASH( x < (m_gridCellsX+1) && y < (m_gridCellsY+1), ("Invalid Water Mesh Coordinates") ); if (m_meshData) { diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp index 22bd766165..96bdfe0134 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp @@ -183,7 +183,7 @@ void W3DRenderObjectSnapshot::xfer( Xfer *xfer ) xfer->xferVersion( &version, currentVersion ); // sanity - DEBUG_ASSERTCRASH( m_robj, ("W3DRenderObjectSnapshot::xfer - invalid m_robj\n") ); + DEBUG_ASSERTCRASH( m_robj, ("W3DRenderObjectSnapshot::xfer - invalid m_robj") ); // transform on the main render object Matrix3D transform; diff --git a/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp b/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp index c11312d3b2..ccbdd5c83c 100644 --- a/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp +++ b/Generals/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp @@ -403,7 +403,7 @@ void Win32Mouse::initCursorResources(void) if (!loaded) cursorResources[cursor][direction]=LoadCursorFromFile(resourcePath); - DEBUG_ASSERTCRASH(cursorResources[cursor][direction], ("MissingCursor %s\n",resourcePath)); + DEBUG_ASSERTCRASH(cursorResources[cursor][direction], ("MissingCursor %s",resourcePath)); } } // SetCursor(cursorResources[cursor][m_directionFrame]); diff --git a/Generals/Code/Tools/GUIEdit/Source/Dialog Procedures/CallbackEditor.cpp b/Generals/Code/Tools/GUIEdit/Source/Dialog Procedures/CallbackEditor.cpp index 373ac42488..92d1e1bc3f 100644 --- a/Generals/Code/Tools/GUIEdit/Source/Dialog Procedures/CallbackEditor.cpp +++ b/Generals/Code/Tools/GUIEdit/Source/Dialog Procedures/CallbackEditor.cpp @@ -85,7 +85,7 @@ void SaveCallbacks( GameWindow *window, HWND dialog ) // get edit data for window GameWindowEditData *editData = window->winGetEditData(); - DEBUG_ASSERTCRASH( editData, ("No edit data for window saving callbacks!\n") ); + DEBUG_ASSERTCRASH( editData, ("No edit data for window saving callbacks!") ); // get the currently selected item from each of the combos and save Int index; diff --git a/Generals/Code/Tools/WorldBuilder/src/BuildList.cpp b/Generals/Code/Tools/WorldBuilder/src/BuildList.cpp index f7b7d32690..025a42e4e7 100644 --- a/Generals/Code/Tools/WorldBuilder/src/BuildList.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/BuildList.cpp @@ -766,7 +766,7 @@ void BuildList::OnExport() AsciiString tmplname = d->getAsciiString(TheKey_playerFaction); const PlayerTemplate* pt = ThePlayerTemplateStore->findPlayerTemplate(NAMEKEY(tmplname)); - DEBUG_ASSERTCRASH(pt != NULL, ("PlayerTemplate %s not found -- this is an obsolete map (please open and resave in WB)\n",tmplname.str())); + DEBUG_ASSERTCRASH(pt != NULL, ("PlayerTemplate %s not found -- this is an obsolete map (please open and resave in WB)",tmplname.str())); fprintf(theLogFile, ";Skirmish AI Build List\n"); fprintf(theLogFile, "SkirmishBuildList %s\n", pt->getSide().str()); diff --git a/Generals/Code/Tools/WorldBuilder/src/EditObjectParameter.cpp b/Generals/Code/Tools/WorldBuilder/src/EditObjectParameter.cpp index ea68756746..6adb73b72f 100644 --- a/Generals/Code/Tools/WorldBuilder/src/EditObjectParameter.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/EditObjectParameter.cpp @@ -120,7 +120,7 @@ void EditObjectParameter::addObject( const ThingTemplate *thingTemplate ) // first sort by Side, either create or find the tree item with matching side name AsciiString side = thingTemplate->getDefaultOwningSide(); - DEBUG_ASSERTCRASH(!side.isEmpty(), ("NULL default side in template\n") ); + DEBUG_ASSERTCRASH(!side.isEmpty(), ("NULL default side in template") ); strcpy( buffer, side.str() ); parent = findOrAdd( parent, buffer ); diff --git a/Generals/Code/Tools/WorldBuilder/src/FenceOptions.cpp b/Generals/Code/Tools/WorldBuilder/src/FenceOptions.cpp index 59012bd346..65c3d2eb30 100644 --- a/Generals/Code/Tools/WorldBuilder/src/FenceOptions.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/FenceOptions.cpp @@ -263,7 +263,7 @@ void FenceOptions::addObject( MapObject *mapObject, const char *pPath, const cha // first sort by side, either create or find the tree item with matching side name AsciiString side = thingTemplate->getDefaultOwningSide(); - DEBUG_ASSERTCRASH( !side.isEmpty(), ("NULL default side in template\n") ); + DEBUG_ASSERTCRASH( !side.isEmpty(), ("NULL default side in template") ); strcpy( buffer, side.str() ); parent = findOrAdd( parent, buffer ); diff --git a/Generals/Code/Tools/WorldBuilder/src/ObjectOptions.cpp b/Generals/Code/Tools/WorldBuilder/src/ObjectOptions.cpp index 259b47b2b3..4f85a65146 100644 --- a/Generals/Code/Tools/WorldBuilder/src/ObjectOptions.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/ObjectOptions.cpp @@ -481,7 +481,7 @@ void ObjectOptions::addObject( MapObject *mapObject, const char *pPath, // first sort by side, either create or find the tree item with matching side name AsciiString side = thingTemplate->getDefaultOwningSide(); - DEBUG_ASSERTCRASH( !side.isEmpty(), ("NULL default side in template\n") ); + DEBUG_ASSERTCRASH( !side.isEmpty(), ("NULL default side in template") ); strcpy( buffer, side.str() ); parent = findOrAdd( parent, buffer ); diff --git a/Generals/Code/Tools/WorldBuilder/src/PickUnitDialog.cpp b/Generals/Code/Tools/WorldBuilder/src/PickUnitDialog.cpp index a44095ae1a..d1959c6e88 100644 --- a/Generals/Code/Tools/WorldBuilder/src/PickUnitDialog.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/PickUnitDialog.cpp @@ -308,7 +308,7 @@ void PickUnitDialog::addObject( MapObject *mapObject, const char *pPath, Int ind // first sort by side, either create or find the tree item with matching side name AsciiString side = thingTemplate->getDefaultOwningSide(); - DEBUG_ASSERTCRASH( !side.isEmpty(), ("NULL default side in template\n") ); + DEBUG_ASSERTCRASH( !side.isEmpty(), ("NULL default side in template") ); strcpy( buffer, side.str() ); parent = findOrAdd( parent, buffer ); diff --git a/Generals/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp b/Generals/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp index 79a99719bd..26216aa18d 100644 --- a/Generals/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp @@ -258,7 +258,7 @@ class CompressedCachedMFCFileOutputStream : public OutputStream compressedLen = CompressionManager::compressData( compressionToUse, srcBuffer, m_totalBytes, destBuffer, compressedLen ); DEBUG_LOG(("Compressed %d bytes to %d bytes - compression of %g%%", m_totalBytes, compressedLen, compressedLen/(Real)m_totalBytes*100.0f)); - DEBUG_ASSERTCRASH(compressedLen, ("Failed to compress!\n")); + DEBUG_ASSERTCRASH(compressedLen, ("Failed to compress!")); if (compressedLen) { m_file->Write(destBuffer, compressedLen); diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GameMemory.h b/GeneralsMD/Code/GameEngine/Include/Common/GameMemory.h index 375ef02d5b..d0566fdb3f 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GameMemory.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GameMemory.h @@ -592,11 +592,11 @@ private: \ order-of-execution problem for static variables, ensuring this is not executed \ prior to the initialization of TheMemoryPoolFactory. \ */ \ - DEBUG_ASSERTCRASH(TheMemoryPoolFactory, ("TheMemoryPoolFactory is NULL\n")); \ + DEBUG_ASSERTCRASH(TheMemoryPoolFactory, ("TheMemoryPoolFactory is NULL")); \ static MemoryPool *The##ARGCLASS##Pool = TheMemoryPoolFactory->findMemoryPool(ARGPOOLNAME); \ - DEBUG_ASSERTCRASH(The##ARGCLASS##Pool, ("Pool \"%s\" not found (did you set it up in initMemoryPools?)\n", ARGPOOLNAME)); \ - DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() >= sizeof(ARGCLASS), ("Pool \"%s\" is too small for this class (currently %d, need %d)\n", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ - DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() <= sizeof(ARGCLASS)+MEMORY_POOL_OBJECT_ALLOCATION_SLOP, ("Pool \"%s\" is too large for this class (currently %d, need %d)\n", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ + DEBUG_ASSERTCRASH(The##ARGCLASS##Pool, ("Pool \"%s\" not found (did you set it up in initMemoryPools?)", ARGPOOLNAME)); \ + DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() >= sizeof(ARGCLASS), ("Pool \"%s\" is too small for this class (currently %d, need %d)", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ + DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() <= sizeof(ARGCLASS)+MEMORY_POOL_OBJECT_ALLOCATION_SLOP, ("Pool \"%s\" is too large for this class (currently %d, need %d)", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ return The##ARGCLASS##Pool; \ } @@ -611,11 +611,11 @@ private: \ order-of-execution problem for static variables, ensuring this is not executed \ prior to the initialization of TheMemoryPoolFactory. \ */ \ - DEBUG_ASSERTCRASH(TheMemoryPoolFactory, ("TheMemoryPoolFactory is NULL\n")); \ + DEBUG_ASSERTCRASH(TheMemoryPoolFactory, ("TheMemoryPoolFactory is NULL")); \ static MemoryPool *The##ARGCLASS##Pool = TheMemoryPoolFactory->createMemoryPool(ARGPOOLNAME, sizeof(ARGCLASS), ARGINITIAL, ARGOVERFLOW); \ - DEBUG_ASSERTCRASH(The##ARGCLASS##Pool, ("Pool \"%s\" not found (did you set it up in initMemoryPools?)\n", ARGPOOLNAME)); \ - DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() >= sizeof(ARGCLASS), ("Pool \"%s\" is too small for this class (currently %d, need %d)\n", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ - DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() <= sizeof(ARGCLASS)+MEMORY_POOL_OBJECT_ALLOCATION_SLOP, ("Pool \"%s\" is too large for this class (currently %d, need %d)\n", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ + DEBUG_ASSERTCRASH(The##ARGCLASS##Pool, ("Pool \"%s\" not found (did you set it up in initMemoryPools?)", ARGPOOLNAME)); \ + DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() >= sizeof(ARGCLASS), ("Pool \"%s\" is too small for this class (currently %d, need %d)", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ + DEBUG_ASSERTCRASH(The##ARGCLASS##Pool->getAllocationSize() <= sizeof(ARGCLASS)+MEMORY_POOL_OBJECT_ALLOCATION_SLOP, ("Pool \"%s\" is too large for this class (currently %d, need %d)", ARGPOOLNAME, The##ARGCLASS##Pool->getAllocationSize(), sizeof(ARGCLASS))); \ return The##ARGCLASS##Pool; \ } diff --git a/GeneralsMD/Code/GameEngine/Include/Common/SparseMatchFinder.h b/GeneralsMD/Code/GameEngine/Include/Common/SparseMatchFinder.h index eaac259f39..6574147d61 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/SparseMatchFinder.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/SparseMatchFinder.h @@ -210,7 +210,7 @@ class SparseMatchFinder const MATCHABLE* info = findBestInfoSlow(v, bits); - DEBUG_ASSERTCRASH(info != NULL, ("no suitable match for criteria was found!\n")); + DEBUG_ASSERTCRASH(info != NULL, ("no suitable match for criteria was found!")); if (info != NULL) { m_bestMatches[bits] = info; } diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Locomotor.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Locomotor.h index af8c7f1a97..7de6c648b4 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Locomotor.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Locomotor.h @@ -303,7 +303,7 @@ class Locomotor : public MemoryPoolObject, public Snapshot inline void setMaxLift(Real lift) { m_maxLift = lift; } inline void setMaxSpeed(Real speed) { - DEBUG_ASSERTCRASH(!(speed <= 0.0f && m_template->m_appearance == LOCO_THRUST), ("THRUST locos may not have zero speeds!\n")); + DEBUG_ASSERTCRASH(!(speed <= 0.0f && m_template->m_appearance == LOCO_THRUST), ("THRUST locos may not have zero speeds!")); m_maxSpeed = speed; } inline void setMaxAcceleration(Real accel) { m_maxAccel = accel; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp index ae27f11ad1..2997571b18 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp @@ -1042,7 +1042,7 @@ Bool AudioManager::shouldPlayLocally(const AudioEventRTS *audioEvent) Player *owningPlayer = ThePlayerList->getNthPlayer(audioEvent->getPlayerIndex()); if (BitIsSet(ei->m_type, ST_PLAYER) && BitIsSet(ei->m_type, ST_UI) && owningPlayer == NULL) { - DEBUG_ASSERTCRASH(!TheGameLogic->isInGameLogicUpdate(), ("Playing %s sound -- player-based UI sound without specifying a player.\n")); + DEBUG_ASSERTCRASH(!TheGameLogic->isInGameLogicUpdate(), ("Playing %s sound -- player-based UI sound without specifying a player.")); return TRUE; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Dict.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Dict.cpp index a83c4aa823..240b2de065 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Dict.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Dict.cpp @@ -160,7 +160,7 @@ Dict::DictPair *Dict::ensureUnique(int numPairsNeeded, Bool preserveData, DictPa Dict::DictPairData* newData = NULL; if (numPairsNeeded > 0) { - DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != NULL, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.\n")); + DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != NULL, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.")); DEBUG_ASSERTCRASH(numPairsNeeded <= MAX_LEN, ("Dict::ensureUnique exceeds max pairs length %d with requested length %d", MAX_LEN, numPairsNeeded)); int minBytes = sizeof(Dict::DictPairData) + numPairsNeeded*sizeof(Dict::DictPair); int actualBytes = TheDynamicMemoryAllocator->getActualAllocationSize(minBytes); @@ -274,7 +274,7 @@ Bool Dict::getBool(NameKeyType key, Bool *exists/*=NULL*/) const if (exists) *exists = true; return *pair->asBool(); } - DEBUG_ASSERTCRASH(exists != NULL, ("dict key missing, or of wrong type\n")); // only assert if they didn't check result + DEBUG_ASSERTCRASH(exists != NULL, ("dict key missing, or of wrong type")); // only assert if they didn't check result if (exists) *exists = false; return false; } @@ -289,7 +289,7 @@ Int Dict::getInt(NameKeyType key, Bool *exists/*=NULL*/) const if (exists) *exists = true; return *pair->asInt(); } - DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type\n")); // only assert if they didn't check result + DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type")); // only assert if they didn't check result if (exists) *exists = false; return 0; } @@ -304,7 +304,7 @@ Real Dict::getReal(NameKeyType key, Bool *exists/*=NULL*/) const if (exists) *exists = true; return *pair->asReal(); } - DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type\n")); // only assert if they didn't check result + DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type")); // only assert if they didn't check result if (exists) *exists = false; return 0.0f; } @@ -319,7 +319,7 @@ AsciiString Dict::getAsciiString(NameKeyType key, Bool *exists/*=NULL*/) const if (exists) *exists = true; return *pair->asAsciiString(); } - DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type\n")); // only assert if they didn't check result + DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type")); // only assert if they didn't check result if (exists) *exists = false; return AsciiString::TheEmptyString; } @@ -334,7 +334,7 @@ UnicodeString Dict::getUnicodeString(NameKeyType key, Bool *exists/*=NULL*/) con if (exists) *exists = true; return *pair->asUnicodeString(); } - DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type\n")); // only assert if they didn't check result + DEBUG_ASSERTCRASH(exists != NULL,("dict key missing, or of wrong type")); // only assert if they didn't check result if (exists) *exists = false; return UnicodeString::TheEmptyString; } @@ -343,7 +343,7 @@ UnicodeString Dict::getUnicodeString(NameKeyType key, Bool *exists/*=NULL*/) con Bool Dict::getNthBool(Int n) const { validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range\n")); + DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); if (m_data) { DictPair* pair = &m_data->peek()[n]; @@ -358,7 +358,7 @@ Bool Dict::getNthBool(Int n) const Int Dict::getNthInt(Int n) const { validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range\n")); + DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); if (m_data) { DictPair* pair = &m_data->peek()[n]; @@ -373,7 +373,7 @@ Int Dict::getNthInt(Int n) const Real Dict::getNthReal(Int n) const { validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range\n")); + DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); if (m_data) { DictPair* pair = &m_data->peek()[n]; @@ -388,7 +388,7 @@ Real Dict::getNthReal(Int n) const AsciiString Dict::getNthAsciiString(Int n) const { validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range\n")); + DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); if (m_data) { DictPair* pair = &m_data->peek()[n]; @@ -403,7 +403,7 @@ AsciiString Dict::getNthAsciiString(Int n) const UnicodeString Dict::getNthUnicodeString(Int n) const { validate(); - DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range\n")); + DEBUG_ASSERTCRASH(n >= 0 && n < getPairCount(), ("n out of range")); if (m_data) { DictPair* pair = &m_data->peek()[n]; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp index 63dc4a0b34..d338266116 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp @@ -356,7 +356,7 @@ void GameEngine::init() #endif///////////////////////////////////////////////////////////////////////////////////////////// - DEBUG_ASSERTCRASH(TheWritableGlobalData,("TheWritableGlobalData expected to be created\n")); + DEBUG_ASSERTCRASH(TheWritableGlobalData,("TheWritableGlobalData expected to be created")); initSubsystem(TheWritableGlobalData, "TheWritableGlobalData", TheWritableGlobalData, &xferCRC, "Data\\INI\\Default\\GameData.ini", "Data\\INI\\GameData.ini"); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp index 1389dd15a9..8c761540fe 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp @@ -1058,7 +1058,7 @@ GlobalData::GlobalData() //------------------------------------------------------------------------------------------------- GlobalData::~GlobalData( void ) { - DEBUG_ASSERTCRASH( TheWritableGlobalData->m_next == NULL, ("~GlobalData: theOriginal is not original\n") ); + DEBUG_ASSERTCRASH( TheWritableGlobalData->m_next == NULL, ("~GlobalData: theOriginal is not original") ); if (m_weaponBonusSet) deleteInstance(m_weaponBonusSet); @@ -1101,7 +1101,7 @@ GlobalData *GlobalData::newOverride( void ) GlobalData *override = NEW GlobalData; // copy the data from the latest override (TheWritableGlobalData) to the newly created instance - DEBUG_ASSERTCRASH( TheWritableGlobalData, ("GlobalData::newOverride() - no existing data\n") ); + DEBUG_ASSERTCRASH( TheWritableGlobalData, ("GlobalData::newOverride() - no existing data") ); *override = *TheWritableGlobalData; // @@ -1154,8 +1154,8 @@ void GlobalData::reset( void ) // we now have the one single global data in TheWritableGlobalData singleton, lets sanity check // some of all that // - DEBUG_ASSERTCRASH( TheWritableGlobalData->m_next == NULL, ("ResetGlobalData: theOriginal is not original\n") ); - DEBUG_ASSERTCRASH( TheWritableGlobalData == GlobalData::m_theOriginal, ("ResetGlobalData: oops\n") ); + DEBUG_ASSERTCRASH( TheWritableGlobalData->m_next == NULL, ("ResetGlobalData: theOriginal is not original") ); + DEBUG_ASSERTCRASH( TheWritableGlobalData == GlobalData::m_theOriginal, ("ResetGlobalData: oops") ); } // end ResetGlobalData diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp index 786df276db..b883e6a12b 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INI.cpp @@ -355,7 +355,7 @@ void INI::load( AsciiString filename, INILoadType loadType, Xfer *pXfer ) { // read all lines in the file - DEBUG_ASSERTCRASH( m_endOfFile == FALSE, ("INI::load, EOF at the beginning!\n") ); + DEBUG_ASSERTCRASH( m_endOfFile == FALSE, ("INI::load, EOF at the beginning!") ); while( m_endOfFile == FALSE ) { // read this line @@ -389,7 +389,7 @@ void INI::load( AsciiString filename, INILoadType loadType, Xfer *pXfer ) } else { - DEBUG_ASSERTCRASH( 0, ("[LINE: %d - FILE: '%s'] Unknown block '%s'\n", + DEBUG_ASSERTCRASH( 0, ("[LINE: %d - FILE: '%s'] Unknown block '%s'", getLineNum(), getFilename().str(), token ) ); throw INI_UNKNOWN_TOKEN; } @@ -417,7 +417,7 @@ void INI::load( AsciiString filename, INILoadType loadType, Xfer *pXfer ) void INI::readLine( void ) { // sanity - DEBUG_ASSERTCRASH( m_file, ("readLine(), file pointer is NULL\n") ); + DEBUG_ASSERTCRASH( m_file, ("readLine(), file pointer is NULL") ); if (m_endOfFile) *m_buffer=0; @@ -450,7 +450,7 @@ void INI::readLine( void ) break; } - DEBUG_ASSERTCRASH(*p != '\t', ("tab characters are not allowed in INI files (%s). please check your editor settings. Line Number %d\n",m_filename.str(), getLineNum())); + DEBUG_ASSERTCRASH(*p != '\t', ("tab characters are not allowed in INI files (%s). please check your editor settings. Line Number %d",m_filename.str(), getLineNum())); // comment? if (*p==';') @@ -469,7 +469,7 @@ void INI::readLine( void ) if ( p == m_buffer+INI_MAX_CHARS_PER_LINE ) { - DEBUG_ASSERTCRASH( 0, ("Buffer too small (%d) and was truncated, increase INI_MAX_CHARS_PER_LINE\n", + DEBUG_ASSERTCRASH( 0, ("Buffer too small (%d) and was truncated, increase INI_MAX_CHARS_PER_LINE", INI_MAX_CHARS_PER_LINE) ); } // end if @@ -904,7 +904,7 @@ void INI::parseBitString32( INI* ini, void * /*instance*/, void *store, const vo if( flagList == NULL || flagList[ 0 ] == NULL) { - DEBUG_ASSERTCRASH( flagList, ("INTERNAL ERROR! parseBitString32: No flag list provided!\n") ); + DEBUG_ASSERTCRASH( flagList, ("INTERNAL ERROR! parseBitString32: No flag list provided!") ); throw INI_INVALID_NAME_LIST; } @@ -1201,7 +1201,7 @@ void INI::parseThingTemplate( INI* ini, void * /*instance*/, void *store, const else { const ThingTemplate *tt = TheThingFactory->findTemplate(token); // could be null! - DEBUG_ASSERTCRASH(tt, ("ThingTemplate %s not found!\n",token)); + DEBUG_ASSERTCRASH(tt, ("ThingTemplate %s not found!",token)); // assign it, even if null! *theThingTemplate = tt; } @@ -1225,7 +1225,7 @@ void INI::parseArmorTemplate( INI* ini, void * /*instance*/, void *store, const else { const ArmorTemplate *tt = TheArmorStore->findArmorTemplate(token); // could be null! - DEBUG_ASSERTCRASH(tt, ("ArmorTemplate %s not found!\n",token)); + DEBUG_ASSERTCRASH(tt, ("ArmorTemplate %s not found!",token)); // assign it, even if null! *theArmorTemplate = tt; } @@ -1243,7 +1243,7 @@ void INI::parseWeaponTemplate( INI* ini, void * /*instance*/, void *store, const ConstWeaponTemplatePtr* theWeaponTemplate = (ConstWeaponTemplatePtr*)store; const WeaponTemplate *tt = TheWeaponStore->findWeaponTemplate(token); // could be null! - DEBUG_ASSERTCRASH(tt || stricmp(token, "None") == 0, ("WeaponTemplate %s not found!\n",token)); + DEBUG_ASSERTCRASH(tt || stricmp(token, "None") == 0, ("WeaponTemplate %s not found!",token)); // assign it, even if null! *theWeaponTemplate = tt; @@ -1260,7 +1260,7 @@ void INI::parseFXList( INI* ini, void * /*instance*/, void *store, const void* / ConstFXListPtr* theFXList = (ConstFXListPtr*)store; const FXList *fxl = TheFXListStore->findFXList(token); // could be null! - DEBUG_ASSERTCRASH(fxl != NULL || stricmp(token, "None") == 0, ("FXList %s not found!\n",token)); + DEBUG_ASSERTCRASH(fxl != NULL || stricmp(token, "None") == 0, ("FXList %s not found!",token)); // assign it, even if null! *theFXList = fxl; @@ -1274,7 +1274,7 @@ void INI::parseParticleSystemTemplate( INI *ini, void * /*instance*/, void *stor const char *token = ini->getNextToken(); const ParticleSystemTemplate *pSystemT = TheParticleSystemManager->findTemplate( AsciiString( token ) ); - DEBUG_ASSERTCRASH( pSystemT || stricmp( token, "None" ) == 0, ("ParticleSystem %s not found!\n",token) ); + DEBUG_ASSERTCRASH( pSystemT || stricmp( token, "None" ) == 0, ("ParticleSystem %s not found!",token) ); typedef const ParticleSystemTemplate* ConstParticleSystemTemplatePtr; ConstParticleSystemTemplatePtr* theParticleSystemTemplate = (ConstParticleSystemTemplatePtr*)store; @@ -1300,7 +1300,7 @@ void INI::parseDamageFX( INI* ini, void * /*instance*/, void *store, const void* else { const DamageFX *fxl = TheDamageFXStore->findDamageFX(token); // could be null! - DEBUG_ASSERTCRASH(fxl, ("DamageFX %s not found!\n",token)); + DEBUG_ASSERTCRASH(fxl, ("DamageFX %s not found!",token)); // assign it, even if null! *theDamageFX = fxl; } @@ -1318,7 +1318,7 @@ void INI::parseObjectCreationList( INI* ini, void * /*instance*/, void *store, c ConstObjectCreationListPtr* theObjectCreationList = (ConstObjectCreationListPtr*)store; const ObjectCreationList *ocl = TheObjectCreationListStore->findObjectCreationList(token); // could be null! - DEBUG_ASSERTCRASH(ocl || stricmp(token, "None") == 0, ("ObjectCreationList %s not found!\n",token)); + DEBUG_ASSERTCRASH(ocl || stricmp(token, "None") == 0, ("ObjectCreationList %s not found!",token)); // assign it, even if null! *theObjectCreationList = ocl; @@ -1338,7 +1338,7 @@ void INI::parseUpgradeTemplate( INI* ini, void * /*instance*/, void *store, cons } const UpgradeTemplate *uu = TheUpgradeCenter->findUpgrade( AsciiString( token ) ); - DEBUG_ASSERTCRASH( uu || stricmp( token, "None" ) == 0, ("Upgrade %s not found!\n",token) ); + DEBUG_ASSERTCRASH( uu || stricmp( token, "None" ) == 0, ("Upgrade %s not found!",token) ); typedef const UpgradeTemplate* ConstUpgradeTemplatePtr; ConstUpgradeTemplatePtr* theUpgradeTemplate = (ConstUpgradeTemplatePtr *)store; @@ -1475,7 +1475,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList if( what == NULL ) { - DEBUG_ASSERTCRASH( 0, ("INI::initFromINI - Invalid parameters supplied!\n") ); + DEBUG_ASSERTCRASH( 0, ("INI::initFromINI - Invalid parameters supplied!") ); throw INI_INVALID_PARAMS; } @@ -1528,7 +1528,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList if (!found) { - DEBUG_ASSERTCRASH( 0, ("[LINE: %d - FILE: '%s'] Unknown field '%s' in block '%s'\n", + DEBUG_ASSERTCRASH( 0, ("[LINE: %d - FILE: '%s'] Unknown field '%s' in block '%s'", INI::getLineNum(), INI::getFilename().str(), field, m_curBlockStart) ); throw INI_UNKNOWN_TOKEN; } @@ -1542,7 +1542,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList { done = TRUE; - DEBUG_ASSERTCRASH( 0, ("Error parsing block '%s', in INI file '%s'. Missing '%s' token\n", + DEBUG_ASSERTCRASH( 0, ("Error parsing block '%s', in INI file '%s'. Missing '%s' token", m_curBlockStart, getFilename().str(), m_blockEndToken) ); throw INI_MISSING_END_TOKEN; @@ -1618,7 +1618,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList if( nameList == NULL || nameList[ 0 ] == NULL ) { - DEBUG_ASSERTCRASH( 0, ("INTERNAL ERROR! scanIndexList, invalid name list\n") ); + DEBUG_ASSERTCRASH( 0, ("INTERNAL ERROR! scanIndexList, invalid name list") ); throw INI_INVALID_NAME_LIST; } @@ -1643,7 +1643,7 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList { if( lookupList == NULL || lookupList[ 0 ].name == NULL ) { - DEBUG_ASSERTCRASH( 0, ("INTERNAL ERROR! scanLookupList, invalid name list\n") ); + DEBUG_ASSERTCRASH( 0, ("INTERNAL ERROR! scanLookupList, invalid name list") ); throw INI_INVALID_NAME_LIST; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAnimation.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAnimation.cpp index b9e04b7c7d..fe607291bc 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAnimation.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIAnimation.cpp @@ -65,7 +65,7 @@ void INI::parseAnim2DDefinition( INI* ini ) // item not found, create a new one animTemplate = TheAnim2DCollection->newTemplate( name ); - DEBUG_ASSERTCRASH( animTemplate, ("INI""parseAnim2DDefinition - unable to allocate animation template for '%s'\n", + DEBUG_ASSERTCRASH( animTemplate, ("INI""parseAnim2DDefinition - unable to allocate animation template for '%s'", name.str()) ); } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp index c215e0f2d8..3f8323bc4d 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIControlBarScheme.cpp @@ -82,7 +82,7 @@ void INI::parseControlBarSchemeDefinition( INI *ini ) // find existing item if present CBSchemeManager = TheControlBar->getControlBarSchemeManager(); - DEBUG_ASSERTCRASH( CBSchemeManager, ("parseControlBarSchemeDefinition: Unable to Get CBSchemeManager\n") ); + DEBUG_ASSERTCRASH( CBSchemeManager, ("parseControlBarSchemeDefinition: Unable to Get CBSchemeManager") ); if( !CBSchemeManager ) return; @@ -91,7 +91,7 @@ void INI::parseControlBarSchemeDefinition( INI *ini ) CBScheme = CBSchemeManager->newControlBarScheme( name ); // sanity - DEBUG_ASSERTCRASH( CBScheme, ("parseControlBarSchemeDefinition: Unable to allocate Scheme '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( CBScheme, ("parseControlBarSchemeDefinition: Unable to allocate Scheme '%s'", name.str()) ); // parse the ini definition ini->initFromINI( CBScheme, CBSchemeManager->getFieldParse() ); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp index 0510a1f208..ca9e360235 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIMappedImage.cpp @@ -69,7 +69,7 @@ void INI::parseMappedImageDefinition( INI* ini ) image = newInstance(Image); image->setName( name ); TheMappedImageCollection->addImage(image); - DEBUG_ASSERTCRASH( image, ("parseMappedImage: unable to allocate image for '%s'\n", + DEBUG_ASSERTCRASH( image, ("parseMappedImage: unable to allocate image for '%s'", name.str()) ); } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrain.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrain.cpp index ba4fe206e5..17b5c59a27 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrain.cpp @@ -51,7 +51,7 @@ void INI::parseTerrainDefinition( INI* ini ) terrainType = TheTerrainTypes->newTerrain( name ); // sanity - DEBUG_ASSERTCRASH( terrainType, ("Unable to allocate terrain type '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( terrainType, ("Unable to allocate terrain type '%s'", name.str()) ); // parse the ini definition ini->initFromINI( terrainType, terrainType->getFieldParse() ); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp index 7d1f454226..7a74479a95 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrainBridge.cpp @@ -53,7 +53,7 @@ void INI::parseTerrainBridgeDefinition( INI* ini ) { // sanity - DEBUG_ASSERTCRASH( bridge->isBridge(), ("Redefining road '%s' as a bridge!\n", + DEBUG_ASSERTCRASH( bridge->isBridge(), ("Redefining road '%s' as a bridge!", bridge->getName().str()) ); throw INI_INVALID_DATA; @@ -62,7 +62,7 @@ void INI::parseTerrainBridgeDefinition( INI* ini ) if( bridge == NULL ) bridge = TheTerrainRoads->newBridge( name ); - DEBUG_ASSERTCRASH( bridge, ("Unable to allcoate bridge '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( bridge, ("Unable to allcoate bridge '%s'", name.str()) ); // parse the ini definition ini->initFromINI( bridge, bridge->getBridgeFieldParse() ); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp index 16d579b0ab..f46b9baa18 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INITerrainRoad.cpp @@ -53,7 +53,7 @@ void INI::parseTerrainRoadDefinition( INI* ini ) { // sanity - DEBUG_ASSERTCRASH( road->isBridge() == FALSE, ("Redefining bridge '%s' as a road!\n", + DEBUG_ASSERTCRASH( road->isBridge() == FALSE, ("Redefining bridge '%s' as a road!", road->getName().str()) ); throw INI_INVALID_DATA; @@ -62,7 +62,7 @@ void INI::parseTerrainRoadDefinition( INI* ini ) if( road == NULL ) road = TheTerrainRoads->newRoad( name ); - DEBUG_ASSERTCRASH( road, ("Unable to allocate road '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( road, ("Unable to allocate road '%s'", name.str()) ); // parse the ini definition ini->initFromINI( road, road->getRoadFieldParse() ); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp index db531da003..81cc5bae45 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/INI/INIWebpageURL.cpp @@ -104,7 +104,7 @@ void INI::parseWebpageURLDefinition( INI* ini ) // } // end if -// DEBUG_ASSERTCRASH( track, ("parseMusicTrackDefinition: Unable to allocate track '%s'\n", +// DEBUG_ASSERTCRASH( track, ("parseMusicTrackDefinition: Unable to allocate track '%s'", // name.str()) ); // parse the ini definition diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/ActionManager.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/ActionManager.cpp index ef14ac76f8..1528c53278 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/ActionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/ActionManager.cpp @@ -483,12 +483,12 @@ Bool ActionManager::canResumeConstructionOf( const Object *obj, if( builder ) { AIUpdateInterface *ai = builder->getAI(); - DEBUG_ASSERTCRASH( ai, ("Builder object does not have an AI interface!\n") ); + DEBUG_ASSERTCRASH( ai, ("Builder object does not have an AI interface!") ); if( ai ) { DozerAIInterface *dozerAI = ai->getDozerAIInterface(); - DEBUG_ASSERTCRASH( dozerAI, ("Builder object doest not have a DozerAI interface!\n") ); + DEBUG_ASSERTCRASH( dozerAI, ("Builder object doest not have a DozerAI interface!") ); if( dozerAI ) { diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Energy.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Energy.cpp index 393bcb05e3..a8c7401693 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Energy.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Energy.cpp @@ -77,7 +77,7 @@ Int Energy::getProduction() const //----------------------------------------------------------------------------- Real Energy::getEnergySupplyRatio() const { - DEBUG_ASSERTCRASH(m_energyProduction >= 0 && m_energyConsumption >= 0, ("neg Energy numbers\n")); + DEBUG_ASSERTCRASH(m_energyProduction >= 0 && m_energyConsumption >= 0, ("neg Energy numbers")); if( TheGameLogic->getFrame() < m_powerSabotagedTillFrame ) { diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp index 6890969ed6..b3e2a765c7 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -355,7 +355,7 @@ Player::Player( Int playerIndex ) void Player::init(const PlayerTemplate* pt) { - DEBUG_ASSERTCRASH(m_playerTeamPrototypes.size() == 0, ("Player::m_playerTeamPrototypes is not empty at game start!\n")); + DEBUG_ASSERTCRASH(m_playerTeamPrototypes.size() == 0, ("Player::m_playerTeamPrototypes is not empty at game start!")); m_skillPointsModifier = 1.0f; m_attackedFrame = 0; @@ -804,7 +804,7 @@ void Player::initFromDict(const Dict* d) { AsciiString tmplname = d->getAsciiString(TheKey_playerFaction); const PlayerTemplate* pt = ThePlayerTemplateStore->findPlayerTemplate(NAMEKEY(tmplname)); - DEBUG_ASSERTCRASH(pt != NULL, ("PlayerTemplate %s not found -- this is an obsolete map (please open and resave in WB)\n",tmplname.str())); + DEBUG_ASSERTCRASH(pt != NULL, ("PlayerTemplate %s not found -- this is an obsolete map (please open and resave in WB)",tmplname.str())); init(pt); @@ -3188,7 +3188,7 @@ void Player::removeRadar( Bool disableProof ) Bool hadRadar = hasRadar(); // decrement count - DEBUG_ASSERTCRASH( m_radarCount > 0, ("removeRadar: An Object is taking its radar away, but the player radar count says they don't have radar!\n") ); + DEBUG_ASSERTCRASH( m_radarCount > 0, ("removeRadar: An Object is taking its radar away, but the player radar count says they don't have radar!") ); --m_radarCount; if( disableProof ) diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp index b44ab5e4f2..e81e1d6052 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerList.cpp @@ -166,7 +166,7 @@ void PlayerList::newGame() if (!setLocal) { - DEBUG_ASSERTCRASH(TheNetwork, ("*** Map has no human player... picking first nonneutral player for control\n")); + DEBUG_ASSERTCRASH(TheNetwork, ("*** Map has no human player... picking first nonneutral player for control")); for( i = 0; i < TheSidesList->getNumSides(); i++) { Player* p = getNthPlayer(i); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/ProductionPrerequisite.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/ProductionPrerequisite.cpp index 29d84b1598..be5946e595 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/ProductionPrerequisite.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/ProductionPrerequisite.cpp @@ -90,7 +90,7 @@ void ProductionPrerequisite::resolveNames() /** @todo for now removing this assert until we can completely remove the GDF stuff, the problem is that some INI files refer to GDF names, and they aren't yet loaded in the world builder but will all go away later anyway etc */ - DEBUG_ASSERTCRASH(m_prereqUnits[i].unit,("could not find prereq %s\n",m_prereqUnits[i].name.str())); + DEBUG_ASSERTCRASH(m_prereqUnits[i].unit,("could not find prereq %s",m_prereqUnits[i].name.str())); m_prereqUnits[i].name.clear(); // we're done with it } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp index ec5eab0182..17fd60d9f7 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp @@ -236,7 +236,7 @@ void TeamFactory::initTeam(const AsciiString& name, const AsciiString& owner, Bo { DEBUG_ASSERTCRASH(findTeamPrototype(name)==NULL,("team already exists")); Player *pOwner = ThePlayerList->findPlayerWithNameKey(NAMEKEY(owner)); - DEBUG_ASSERTCRASH(pOwner, ("no owner found for team %s (%s)\n",name.str(),owner.str())); + DEBUG_ASSERTCRASH(pOwner, ("no owner found for team %s (%s)",name.str(),owner.str())); if (!pOwner) pOwner = ThePlayerList->getNeutralPlayer(); /*TeamPrototype *tp =*/ newInstance(TeamPrototype)(this, name, pOwner, isSingleton, d, ++m_uniqueTeamPrototypeID); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp index 1a23e127e5..bd771dd06a 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp @@ -530,7 +530,7 @@ void RecorderClass::updateRecord() } if (needFlush) { - DEBUG_ASSERTCRASH(m_file != NULL, ("RecorderClass::updateRecord() - unexpected call to fflush(m_file)\n")); + DEBUG_ASSERTCRASH(m_file != NULL, ("RecorderClass::updateRecord() - unexpected call to fflush(m_file)")); fflush(m_file); } } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/StateMachine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/StateMachine.cpp index 0494bfbda1..601c8fe877 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/StateMachine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/StateMachine.cpp @@ -486,7 +486,7 @@ StateReturnType StateMachine::updateStateMachine() void StateMachine::defineState( StateID id, State *state, StateID successID, StateID failureID, const StateConditionInfo* conditions ) { #ifdef STATE_MACHINE_DEBUG - DEBUG_ASSERTCRASH(m_stateMap.find( id ) == m_stateMap.end(), ("duplicate state ID in statemachine %s\n",m_name.str())); + DEBUG_ASSERTCRASH(m_stateMap.find( id ) == m_stateMap.end(), ("duplicate state ID in statemachine %s",m_name.str())); #endif // map the ID to the state diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/AsciiString.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/AsciiString.cpp index 2848a1d87d..7a935ddaad 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/AsciiString.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/AsciiString.cpp @@ -138,7 +138,7 @@ void AsciiString::ensureUniqueBufferOfSize(int numCharsNeeded, Bool preserveData return; } - DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != NULL, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.\n")); + DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != NULL, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.")); DEBUG_ASSERTCRASH(numCharsNeeded <= MAX_LEN, ("AsciiString::ensureUniqueBufferOfSize exceeds max string length %d with requested length %d", MAX_LEN, numCharsNeeded)); int minBytes = sizeof(AsciiStringData) + numCharsNeeded*sizeof(char); int actualBytes = TheDynamicMemoryAllocator->getActualAllocationSize(minBytes); @@ -188,7 +188,7 @@ void AsciiString::releaseBuffer() // ----------------------------------------------------- AsciiString::AsciiString(const char* s) : m_data(0) { - //DEBUG_ASSERTCRASH(isMemoryManagerOfficiallyInited(), ("Initializing AsciiStrings prior to main (ie, as static vars) can cause memory leak reporting problems. Are you sure you want to do this?\n")); + //DEBUG_ASSERTCRASH(isMemoryManagerOfficiallyInited(), ("Initializing AsciiStrings prior to main (ie, as static vars) can cause memory leak reporting problems. Are you sure you want to do this?")); int len = (s)?strlen(s):0; if (len) { diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp index d067e5f090..6daad1eee2 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp @@ -590,7 +590,7 @@ void BuildAssistant::iterateFootprint( const ThingTemplate *build, else { - DEBUG_ASSERTCRASH( 0, ("iterateFootprint: Undefined geometry '%d' for '%s'\n", + DEBUG_ASSERTCRASH( 0, ("iterateFootprint: Undefined geometry '%d' for '%s'", build->getTemplateGeometryInfo().getGeomType(), build->getName().str()) ); return; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/GameCommon.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/GameCommon.cpp index 1535089371..13e397fc8d 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/GameCommon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/GameCommon.cpp @@ -50,7 +50,7 @@ const char *TheRelationshipNames[] = //------------------------------------------------------------------------------------------------- Real normalizeAngle(Real angle) { - DEBUG_ASSERTCRASH(!_isnan(angle), ("Angle is NAN in normalizeAngle!\n")); + DEBUG_ASSERTCRASH(!_isnan(angle), ("Angle is NAN in normalizeAngle!")); if( _isnan(angle) ) return 0;// ARGH!!!! Don't assert and then not handle it! Error bad! Fix error! diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp index 7c15b28085..19adb63bef 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp @@ -1587,7 +1587,7 @@ Int MemoryPool::freeBlob(MemoryPoolBlob* blob) // save these for later... Int totalBlocksInBlob = blob->getTotalBlockCount(); Int usedBlocksInBlob = blob->getUsedBlockCount(); - DEBUG_ASSERTCRASH(usedBlocksInBlob == 0, ("freeing a nonempty blob (%d)\n",usedBlocksInBlob)); + DEBUG_ASSERTCRASH(usedBlocksInBlob == 0, ("freeing a nonempty blob (%d)",usedBlocksInBlob)); // this is really just an estimate... will be too small in debug mode. Int amtFreed = totalBlocksInBlob * getAllocationSize() + sizeof(MemoryPoolBlob); @@ -3183,7 +3183,7 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en { any += dma->debugDmaReportLeaks(); } - DEBUG_ASSERTCRASH(!any, ("There were %d memory leaks. Please fix them.\n",any)); + DEBUG_ASSERTCRASH(!any, ("There were %d memory leaks. Please fix them.",any)); DEBUG_LOG(("------------------------------------------")); DEBUG_LOG(("End Simple Leak Report")); DEBUG_LOG(("------------------------------------------")); @@ -3529,7 +3529,7 @@ void shutdownMemoryManager() #ifdef MEMORYPOOL_DEBUG DEBUG_LOG(("Peak system allocation was %d bytes",thePeakSystemAllocationInBytes)); DEBUG_LOG(("Wasted DMA space (peak) was %d bytes",thePeakWastedDMA)); - DEBUG_ASSERTCRASH(theTotalSystemAllocationInBytes == 0, ("Leaked a total of %d raw bytes\n", theTotalSystemAllocationInBytes)); + DEBUG_ASSERTCRASH(theTotalSystemAllocationInBytes == 0, ("Leaked a total of %d raw bytes", theTotalSystemAllocationInBytes)); #endif } @@ -3549,7 +3549,7 @@ void* createW3DMemPool(const char *poolName, int allocationSize) //----------------------------------------------------------------------------- void* allocateFromW3DMemPool(void* pool, int allocationSize) { - DEBUG_ASSERTCRASH(pool, ("pool is null\n")); + DEBUG_ASSERTCRASH(pool, ("pool is null")); DEBUG_ASSERTCRASH(pool && ((MemoryPool*)pool)->getAllocationSize() == allocationSize, ("bad w3d pool size %s",((MemoryPool*)pool)->getPoolName())); return ((MemoryPool*)pool)->allocateBlock("allocateFromW3DMemPool"); } @@ -3557,7 +3557,7 @@ void* allocateFromW3DMemPool(void* pool, int allocationSize) //----------------------------------------------------------------------------- void* allocateFromW3DMemPool(void* pool, int allocationSize, const char* msg, int unused) { - DEBUG_ASSERTCRASH(pool, ("pool is null\n")); + DEBUG_ASSERTCRASH(pool, ("pool is null")); DEBUG_ASSERTCRASH(pool && ((MemoryPool*)pool)->getAllocationSize() == allocationSize, ("bad w3d pool size %s",((MemoryPool*)pool)->getPoolName())); return ((MemoryPool*)pool)->allocateBlock(msg); } @@ -3565,6 +3565,6 @@ void* allocateFromW3DMemPool(void* pool, int allocationSize, const char* msg, in //----------------------------------------------------------------------------- void freeFromW3DMemPool(void* pool, void* p) { - DEBUG_ASSERTCRASH(pool, ("pool is null\n")); + DEBUG_ASSERTCRASH(pool, ("pool is null")); ((MemoryPool*)pool)->freeBlock(p); } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp index baf7c548a6..8f02a41d0f 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp @@ -331,7 +331,7 @@ void Radar::newMap( TerrainLogic *terrain ) // keep a pointer for our radar window Int id = NAMEKEY( "ControlBar.wnd:LeftHUD" ); m_radarWindow = TheWindowManager->winGetWindowFromId( NULL, id ); - DEBUG_ASSERTCRASH( m_radarWindow, ("Radar::newMap - Unable to find radar game window\n") ); + DEBUG_ASSERTCRASH( m_radarWindow, ("Radar::newMap - Unable to find radar game window") ); // reset all the data in the radar reset(); @@ -604,7 +604,7 @@ bool Radar::removeObject( Object *obj ) { // sanity - DEBUG_ASSERTCRASH( 0, ("Radar: Tried to remove object '%s' which was not found\n", + DEBUG_ASSERTCRASH( 0, ("Radar: Tried to remove object '%s' which was not found", obj->getTemplate()->getName().str()) ); return false; } // end else @@ -1385,7 +1385,7 @@ static void xferRadarObjectList( Xfer *xfer, RadarObject **head ) RadarObject *radarObject; // sanity - DEBUG_ASSERTCRASH( head != NULL, ("xferRadarObjectList - Invalid parameters\n" )); + DEBUG_ASSERTCRASH( head != NULL, ("xferRadarObjectList - Invalid parameters" )); // version XferVersion currentVersion = 1; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp index ca80cc77a8..171bcd74ba 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp @@ -794,7 +794,7 @@ AsciiString GameState::getMapLeafName(const AsciiString& in) const // at the name only // ++p; - DEBUG_ASSERTCRASH( p != NULL && *p != 0, ("GameState::xfer - Illegal map name encountered\n") ); + DEBUG_ASSERTCRASH( p != NULL && *p != 0, ("GameState::xfer - Illegal map name encountered") ); return p; } else @@ -1085,8 +1085,8 @@ static void addGameToAvailableList( AsciiString filename, void *userData ) AvailableGameInfo **listHead = (AvailableGameInfo **)userData; // sanity - DEBUG_ASSERTCRASH( listHead != NULL, ("addGameToAvailableList - Illegal parameters\n") ); - DEBUG_ASSERTCRASH( filename.isEmpty() == FALSE, ("addGameToAvailableList - Illegal filename\n") ); + DEBUG_ASSERTCRASH( listHead != NULL, ("addGameToAvailableList - Illegal parameters") ); + DEBUG_ASSERTCRASH( filename.isEmpty() == FALSE, ("addGameToAvailableList - Illegal filename") ); try { // get header info from this listbox diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp index fc3f18c0dd..44ab43b4d6 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameStateMap.cpp @@ -113,7 +113,7 @@ static void embedPristineMap( AsciiString map, Xfer *xfer ) file->close(); // write the contents to the save file - DEBUG_ASSERTCRASH( xfer->getXferMode() == XFER_SAVE, ("embedPristineMap - Unsupposed xfer mode\n") ); + DEBUG_ASSERTCRASH( xfer->getXferMode() == XFER_SAVE, ("embedPristineMap - Unsupposed xfer mode") ); xfer->beginBlock(); xfer->xferUser( buffer, fileSize ); xfer->endBlock(); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/UnicodeString.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/UnicodeString.cpp index 2aa1232104..2ca7f51f07 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/UnicodeString.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/UnicodeString.cpp @@ -89,7 +89,7 @@ void UnicodeString::ensureUniqueBufferOfSize(int numCharsNeeded, Bool preserveDa return; } - DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != NULL, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.\n")); + DEBUG_ASSERTCRASH(TheDynamicMemoryAllocator != NULL, ("Cannot use dynamic memory allocator before its initialization. Check static initialization order.")); DEBUG_ASSERTCRASH(numCharsNeeded <= MAX_LEN, ("UnicodeString::ensureUniqueBufferOfSize exceeds max string length %d with requested length %d", MAX_LEN, numCharsNeeded)); int minBytes = sizeof(UnicodeStringData) + numCharsNeeded*sizeof(WideChar); int actualBytes = TheDynamicMemoryAllocator->getActualAllocationSize(minBytes); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Upgrade.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/Upgrade.cpp index f59d309175..636dc60cb6 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/Upgrade.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/Upgrade.cpp @@ -489,7 +489,7 @@ void UpgradeCenter::parseUpgradeDefinition( INI *ini ) } // end if // sanity - DEBUG_ASSERTCRASH( upgrade, ("parseUpgradeDefinition: Unable to allocate upgrade '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( upgrade, ("parseUpgradeDefinition: Unable to allocate upgrade '%s'", name.str()) ); // parse the ini definition ini->initFromINI( upgrade, upgrade->getFieldParse() ); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/Module.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/Module.cpp index 11255952ad..794cb06ef2 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/Module.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/Module.cpp @@ -112,9 +112,9 @@ ObjectModule::ObjectModule( Thing *thing, const ModuleData* moduleData ) : Modul throw INI_INVALID_DATA; } - DEBUG_ASSERTCRASH( thing, ("Thing passed to ObjectModule is NULL!\n") ); + DEBUG_ASSERTCRASH( thing, ("Thing passed to ObjectModule is NULL!") ); m_object = AsObject(thing); - DEBUG_ASSERTCRASH( m_object, ("Thing passed to ObjectModule is not an Object!\n") ); + DEBUG_ASSERTCRASH( m_object, ("Thing passed to ObjectModule is not an Object!") ); } // end ObjectModule @@ -175,9 +175,9 @@ DrawableModule::DrawableModule( Thing *thing, const ModuleData* moduleData ) : M throw INI_INVALID_DATA; } - DEBUG_ASSERTCRASH( thing, ("Thing passed to DrawableModule is NULL!\n") ); + DEBUG_ASSERTCRASH( thing, ("Thing passed to DrawableModule is NULL!") ); m_drawable = AsDrawable(thing); - DEBUG_ASSERTCRASH( m_drawable, ("Thing passed to DrawableModule is not a Drawable!\n") ); + DEBUG_ASSERTCRASH( m_drawable, ("Thing passed to DrawableModule is not a Drawable!") ); } // end ~DrawableModule diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/Thing.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/Thing.cpp index 9d180eb475..651eb57de6 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/Thing.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/Thing.cpp @@ -157,7 +157,7 @@ void Thing::setPositionZ( Real z ) TheTerrainLogic->alignOnTerrain(getOrientation(), pos, stickToGround, mtx ); setTransformMatrix(&mtx); } - DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'\n", m_template->getName().str() )); + DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() )); } //============================================================================= @@ -170,7 +170,7 @@ void Thing::setPosition( const Coord3D *pos ) Coord3D oldPos = m_cachedPos; Matrix3D oldMtx = m_transform; - //DEBUG_ASSERTCRASH(!(_isnan(pos->x) || _isnan(pos->y) || _isnan(pos->z)), ("Drawable/Object position NAN! '%s'\n", m_template->getName().str() )); + //DEBUG_ASSERTCRASH(!(_isnan(pos->x) || _isnan(pos->y) || _isnan(pos->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() )); m_transform.Set_X_Translation( pos->x ); m_transform.Set_Y_Translation( pos->y ); m_transform.Set_Z_Translation( pos->z ); @@ -186,7 +186,7 @@ void Thing::setPosition( const Coord3D *pos ) TheTerrainLogic->alignOnTerrain(getOrientation(), *pos, stickToGround, mtx ); setTransformMatrix(&mtx); } - DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'\n", m_template->getName().str() )); + DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() )); } //============================================================================= @@ -230,13 +230,13 @@ void Thing::setOrientation( Real angle ) x.z, y.z, z.z, pos.z ); } - //DEBUG_ASSERTCRASH(-PI <= angle && angle <= PI, ("Please pass only normalized (-PI..PI) angles to setOrientation (%f).\n", angle)); + //DEBUG_ASSERTCRASH(-PI <= angle && angle <= PI, ("Please pass only normalized (-PI..PI) angles to setOrientation (%f).", angle)); m_cachedAngle = normalizeAngle(angle); m_cachedPos = pos; m_cacheFlags &= ~VALID_DIRVECTOR; // but don't clear the altitude flags. reactToTransformChange(&oldMtx, &oldPos, oldAngle); - DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'\n", m_template->getName().str() )); + DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() )); } //============================================================================= @@ -257,7 +257,7 @@ void Thing::setTransformMatrix( const Matrix3D *mx ) m_cacheFlags = 0; reactToTransformChange(&oldMtx, &oldPos, oldAngle); - DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'\n", m_template->getName().str() )); + DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() )); } //------------------------------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp index 033a366469..56f48f1286 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp @@ -169,7 +169,7 @@ ThingTemplate* ThingFactory::newOverride( ThingTemplate *thingTemplate ) { // sanity - DEBUG_ASSERTCRASH( thingTemplate, ("newOverride(): NULL 'parent' thing template\n") ); + DEBUG_ASSERTCRASH( thingTemplate, ("newOverride(): NULL 'parent' thing template") ); // sanity just for debuging, the weapon must be in the master list to do overrides DEBUG_ASSERTCRASH( findTemplate( thingTemplate->getName() ) != NULL, @@ -315,7 +315,7 @@ Object *ThingFactory::newObject( const ThingTemplate *tmplate, Team *team, Objec tmplate = tmp; } - DEBUG_ASSERTCRASH(!tmplate->isKindOf(KINDOF_DRAWABLE_ONLY), ("You may not create Objects with the template %s, only Drawables\n",tmplate->getName().str())); + DEBUG_ASSERTCRASH(!tmplate->isKindOf(KINDOF_DRAWABLE_ONLY), ("You may not create Objects with the template %s, only Drawables",tmplate->getName().str())); // have the game logic create an object of the correct type. // (this will throw an exception on failure.) diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp index 437b184790..2f3fe11038 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -677,7 +677,7 @@ static void parseArbitraryFXIntoMap( INI* ini, void *instance, void* /* store */ const char* name = (const char*)userData; const char* token = ini->getNextToken(); const FXList* fxl = TheFXListStore->findFXList(token); // could be null! - DEBUG_ASSERTCRASH(fxl != NULL || stricmp(token, "None") == 0, ("FXList %s not found!\n",token)); + DEBUG_ASSERTCRASH(fxl != NULL || stricmp(token, "None") == 0, ("FXList %s not found!",token)); mapFX->insert(std::make_pair(AsciiString(name), fxl)); } @@ -765,7 +765,7 @@ void ThingTemplate::parseRemoveModule(INI *ini, void *instance, void *store, con Bool removed = self->removeModuleInfo(modToRemove, removedModuleName); if (!removed) { - DEBUG_ASSERTCRASH(removed, ("RemoveModule %s was not found for %s. The game will crash now!\n",modToRemove, self->getName().str())); + DEBUG_ASSERTCRASH(removed, ("RemoveModule %s was not found for %s. The game will crash now!",modToRemove, self->getName().str())); throw INI_INVALID_DATA; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Credits.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Credits.cpp index b01f91c031..28a1b08649 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Credits.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Credits.cpp @@ -87,7 +87,7 @@ const FieldParse CreditsManager::m_creditsFieldParseTable[] = void INI::parseCredits( INI *ini ) { // find existing item if present - DEBUG_ASSERTCRASH( TheCredits, ("parseCredits: TheCredits has not been ininialized yet.\n") ); + DEBUG_ASSERTCRASH( TheCredits, ("parseCredits: TheCredits has not been ininialized yet.") ); if( !TheCredits ) return; @@ -460,7 +460,7 @@ void CreditsManager::addText( AsciiString text ) } break; default: - DEBUG_ASSERTCRASH( FALSE, ("CreditsManager::addText we tried to add a credit text with the wrong style before it. Style is %d\n", m_currentStyle) ); + DEBUG_ASSERTCRASH( FALSE, ("CreditsManager::addText we tried to add a credit text with the wrong style before it. Style is %d", m_currentStyle) ); delete cLine; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp index ce8d710aac..cc2bfd10b9 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp @@ -227,7 +227,7 @@ static const char *drawableIconIndexToName( DrawableIconType iconIndex ) static DrawableIconType drawableIconNameToIndex( const char *iconName ) { - DEBUG_ASSERTCRASH( iconName != NULL, ("drawableIconNameToIndex - Illegal name\n") ); + DEBUG_ASSERTCRASH( iconName != NULL, ("drawableIconNameToIndex - Illegal name") ); for( Int i = ICON_FIRST; i < MAX_ICONS; ++i ) if( stricmp( TheDrawableIconNames[ i ], iconName ) == 0 ) @@ -2832,7 +2832,7 @@ void Drawable::setEmoticon( const AsciiString &name, Int duration ) Anim2DTemplate *animTemplate = TheAnim2DCollection->findTemplate( name ); if( animTemplate ) { - DEBUG_ASSERTCRASH( getIconInfo()->m_icon[ ICON_EMOTICON ] == NULL, ("Drawable::setEmoticon - Emoticon isn't empty, need to refuse to set or destroy the old one in favor of the new one\n") ); + DEBUG_ASSERTCRASH( getIconInfo()->m_icon[ ICON_EMOTICON ] == NULL, ("Drawable::setEmoticon - Emoticon isn't empty, need to refuse to set or destroy the old one in favor of the new one") ); if( getIconInfo()->m_icon[ ICON_EMOTICON ] == NULL ) { getIconInfo()->m_icon[ ICON_EMOTICON ] = newInstance(Anim2D)( animTemplate, TheAnim2DCollection ); @@ -4147,7 +4147,7 @@ DrawableID Drawable::getID( void ) const { // we should never be getting the ID of a drawable who doesn't yet have and ID assigned to it - DEBUG_ASSERTCRASH( m_id != 0, ("Drawable::getID - Using ID before it was assigned!!!!\n") ); + DEBUG_ASSERTCRASH( m_id != 0, ("Drawable::getID - Using ID before it was assigned!!!!") ); return m_id; @@ -5304,7 +5304,7 @@ void Drawable::xfer( Xfer *xfer ) // #ifdef DIRTY_CONDITION_FLAGS if( xfer->getXferMode() == XFER_SAVE ) - DEBUG_ASSERTCRASH( m_isModelDirty == FALSE, ("Drawble::xfer - m_isModelDirty is not FALSE!\n") ); + DEBUG_ASSERTCRASH( m_isModelDirty == FALSE, ("Drawble::xfer - m_isModelDirty is not FALSE!") ); else m_isModelDirty = TRUE; #endif diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp index de2e91a078..f0ce82bd57 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable/Update/BeaconClientUpdate.cpp @@ -95,7 +95,7 @@ static ParticleSystem* createParticleSystem( Drawable *draw ) templateName.format("BeaconSmoke%6.6X", (0xffffff & obj->getIndicatorColor())); const ParticleSystemTemplate *particleTemplate = TheParticleSystemManager->findTemplate( templateName ); - DEBUG_ASSERTCRASH(particleTemplate, ("Could not find particle system %s\n", templateName.str())); + DEBUG_ASSERTCRASH(particleTemplate, ("Could not find particle system %s", templateName.str())); if (particleTemplate) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp index 03cd1bde2d..4c541c5e5e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp @@ -265,7 +265,7 @@ class RayEffectFXNugget : public FXNugget virtual void doFXPos(const Coord3D *primary, const Matrix3D* /*primaryMtx*/, const Real /*primarySpeed*/, const Coord3D * secondary, const Real /*overrideRadius*/ ) const { const ThingTemplate* tmpl = TheThingFactory->findTemplate(m_templateName); - DEBUG_ASSERTCRASH(tmpl, ("RayEffect %s not found\n",m_templateName.str())); + DEBUG_ASSERTCRASH(tmpl, ("RayEffect %s not found",m_templateName.str())); if (primary && secondary && tmpl) { Coord3D sourcePos = *primary; @@ -595,7 +595,7 @@ class ParticleSystemFXNugget : public FXNugget } const ParticleSystemTemplate *tmp = TheParticleSystemManager->findTemplate(m_name); - DEBUG_ASSERTCRASH(tmp, ("ParticleSystem %s not found\n",m_name.str())); + DEBUG_ASSERTCRASH(tmp, ("ParticleSystem %s not found",m_name.str())); if (tmp) { for (Int i = 0; i < m_count; i++ ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index 6438a93d64..e50ca4f354 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -806,7 +806,7 @@ void CommandSet::parseCommandButton( INI* ini, void *instance, void *store, cons Int buttonIndex = (Int)userData; // sanity - DEBUG_ASSERTCRASH( buttonIndex < MAX_COMMANDS_PER_SET, ("parseCommandButton: button index '%d' out of range\n", + DEBUG_ASSERTCRASH( buttonIndex < MAX_COMMANDS_PER_SET, ("parseCommandButton: button index '%d' out of range", buttonIndex) ); // save it @@ -1549,7 +1549,7 @@ void ControlBar::update( void ) { // we better be in the default none context - DEBUG_ASSERTCRASH( m_currContext == CB_CONTEXT_NONE, ("ControlBar::update no selection, but not we're not showing the default NONE context\n") ); + DEBUG_ASSERTCRASH( m_currContext == CB_CONTEXT_NONE, ("ControlBar::update no selection, but not we're not showing the default NONE context") ); return; } // end if @@ -2010,7 +2010,7 @@ CommandButton *ControlBar::newCommandButtonOverride( CommandButton *buttonToOver } // sanity - DEBUG_ASSERTCRASH( commandSet, ("parseCommandSetDefinition: Unable to allocate set '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( commandSet, ("parseCommandSetDefinition: Unable to allocate set '%s'", name.str()) ); // parse the ini definition ini->initFromINI( commandSet, commandSet->friend_getFieldParse() ); @@ -2373,7 +2373,7 @@ void ControlBar::switchToContext( ControlBarContext context, Drawable *draw ) default: { - DEBUG_ASSERTCRASH( 0, ("ControlBar::switchToContext, unknown context '%d'\n", context) ); + DEBUG_ASSERTCRASH( 0, ("ControlBar::switchToContext, unknown context '%d'", context) ); break; } // end default @@ -2434,7 +2434,7 @@ void ControlBar::setControlCommand( GameWindow *button, const CommandButton *com if( button->winGetInputFunc() != GadgetPushButtonInput ) { - DEBUG_ASSERTCRASH( 0, ("setControlCommand: Window is not a button\n") ); + DEBUG_ASSERTCRASH( 0, ("setControlCommand: Window is not a button") ); return; } // end if @@ -2443,7 +2443,7 @@ void ControlBar::setControlCommand( GameWindow *button, const CommandButton *com if( commandButton == NULL ) { - DEBUG_ASSERTCRASH( 0, ("setControlCommand: NULL commandButton passed in\n") ); + DEBUG_ASSERTCRASH( 0, ("setControlCommand: NULL commandButton passed in") ); return; } // end if @@ -2545,7 +2545,7 @@ void ControlBar::setControlCommand( const AsciiString& buttonWindowName, GameWin if( win == NULL ) { - DEBUG_ASSERTCRASH( 0, ("setControlCommand: Unable to find window '%s'\n", buttonWindowName.str()) ); + DEBUG_ASSERTCRASH( 0, ("setControlCommand: Unable to find window '%s'", buttonWindowName.str()) ); return; } // end if @@ -2716,7 +2716,7 @@ void ControlBar::showRallyPoint( const Coord3D *loc ) const ThingTemplate* ttn = TheThingFactory->findTemplate("RallyPointMarker"); marker = TheThingFactory->newDrawable( ttn ); - DEBUG_ASSERTCRASH( marker, ("showRallyPoint: Unable to create rally point drawable\n") ); + DEBUG_ASSERTCRASH( marker, ("showRallyPoint: Unable to create rally point drawable") ); if (marker) { marker->setDrawableStatus(DRAWABLE_STATUS_NO_SAVE); @@ -2728,7 +2728,7 @@ void ControlBar::showRallyPoint( const Coord3D *loc ) marker = TheGameClient->findDrawableByID( m_rallyPointDrawableID ); // sanity - DEBUG_ASSERTCRASH( marker, ("showRallyPoint: No rally point marker found\n" ) ); + DEBUG_ASSERTCRASH( marker, ("showRallyPoint: No rally point marker found" ) ); // set the position of the rally point drawble to the position passed in marker->setPosition( loc ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp index 2763ef0423..a4bf12485f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp @@ -94,7 +94,7 @@ void ControlBar::populateInvDataCallback( Object *obj, void *userData ) if( data->currIndex > data->maxIndex ) { - DEBUG_ASSERTCRASH( 0, ("There is not enough GUI slots to hold the # of items inside a '%s'\n", + DEBUG_ASSERTCRASH( 0, ("There is not enough GUI slots to hold the # of items inside a '%s'", data->transport->getTemplate()->getName().str()) ); return; @@ -102,7 +102,7 @@ void ControlBar::populateInvDataCallback( Object *obj, void *userData ) // get the window control that we're going to put our smiling faces in GameWindow *control = data->controls[ data->currIndex ]; - DEBUG_ASSERTCRASH( control, ("populateInvDataCallback: Control not found\n") ); + DEBUG_ASSERTCRASH( control, ("populateInvDataCallback: Control not found") ); // assign our control and object id to the transport data m_containData[ data->currIndex ].control = control; @@ -787,7 +787,7 @@ void ControlBar::updateContextCommand( void ) static NameKeyType winID = TheNameKeyGenerator->nameToKey( "ControlBar.wnd:ButtonQueue01" ); GameWindow *win = TheWindowManager->winGetWindowFromId( m_contextParent[ CP_BUILD_QUEUE ], winID ); - DEBUG_ASSERTCRASH( win, ("updateContextCommand: Unable to find first build queue button\n") ); + DEBUG_ASSERTCRASH( win, ("updateContextCommand: Unable to find first build queue button") ); // UnicodeString text; // // text.format( L"%.0f%%", produce->getPercentComplete() ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp index 3a11618bba..432907db8b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp @@ -397,7 +397,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, break; // sanity, we must have something to build - DEBUG_ASSERTCRASH( whatToBuild, ("Undefined BUILD command for object '%s'\n", + DEBUG_ASSERTCRASH( whatToBuild, ("Undefined BUILD command for object '%s'", commandButton->getThingTemplate()->getName().str()) ); CanMakeType cmt = TheBuildAssistant->canMakeUnit(factory, whatToBuild); @@ -425,7 +425,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, } else if (cmt != CANMAKE_OK) { - DEBUG_ASSERTCRASH( 0, ("Cannot create '%s' because the factory object '%s' returns false for canMakeUnit\n", + DEBUG_ASSERTCRASH( 0, ("Cannot create '%s' because the factory object '%s' returns false for canMakeUnit", whatToBuild->getName().str(), factory->getTemplate()->getName().str()) ); break; @@ -438,7 +438,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, if( pu == NULL ) { - DEBUG_ASSERTCRASH( 0, ("Cannot create '%s' because the factory object '%s' is not capable of producting units\n", + DEBUG_ASSERTCRASH( 0, ("Cannot create '%s' because the factory object '%s' is not capable of producting units", whatToBuild->getName().str(), factory->getTemplate()->getName().str()) ); break; @@ -472,7 +472,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, if( i == MAX_BUILD_QUEUE_BUTTONS ) { - DEBUG_ASSERTCRASH( 0, ("Control not found in build queue data\n") ); + DEBUG_ASSERTCRASH( 0, ("Control not found in build queue data") ); break; } // end if @@ -505,7 +505,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, case GUI_COMMAND_PLAYER_UPGRADE: { const UpgradeTemplate *upgradeT = commandButton->getUpgradeTemplate(); - DEBUG_ASSERTCRASH( upgradeT, ("Undefined upgrade '%s' in player upgrade command\n", "UNKNOWN") ); + DEBUG_ASSERTCRASH( upgradeT, ("Undefined upgrade '%s' in player upgrade command", "UNKNOWN") ); // sanity if( obj == NULL || upgradeT == NULL ) @@ -541,7 +541,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, case GUI_COMMAND_OBJECT_UPGRADE: { const UpgradeTemplate *upgradeT = commandButton->getUpgradeTemplate(); - DEBUG_ASSERTCRASH( upgradeT, ("Undefined upgrade '%s' in object upgrade command\n", "UNKNOWN") ); + DEBUG_ASSERTCRASH( upgradeT, ("Undefined upgrade '%s' in object upgrade command", "UNKNOWN") ); // sanity if( upgradeT == NULL ) break; @@ -596,7 +596,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, if( i == MAX_BUILD_QUEUE_BUTTONS ) { - DEBUG_ASSERTCRASH( 0, ("Control not found in build queue data\n") ); + DEBUG_ASSERTCRASH( 0, ("Control not found in build queue data") ); break; } // end if @@ -901,7 +901,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control, //--------------------------------------------------------------------------------------------- default: - DEBUG_ASSERTCRASH( 0, ("Unknown command '%d'\n", commandButton->getCommandType()) ); + DEBUG_ASSERTCRASH( 0, ("Unknown command '%d'", commandButton->getCommandType()) ); return CBC_COMMAND_NOT_USED; } // end switch diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp index 3265fd9e41..83bf217496 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp @@ -232,7 +232,7 @@ void ControlBar::populateMultiSelect( void ) const DrawableList *selectedDrawables = TheInGameUI->getAllSelectedDrawables(); // sanity - DEBUG_ASSERTCRASH( selectedDrawables->empty() == FALSE, ("populateMultiSelect: Drawable list is empty\n") ); + DEBUG_ASSERTCRASH( selectedDrawables->empty() == FALSE, ("populateMultiSelect: Drawable list is empty") ); // loop through all the selected drawables for( DrawableListCIt it = selectedDrawables->begin(); @@ -313,7 +313,7 @@ void ControlBar::updateContextMultiSelect( void ) const DrawableList *selectedDrawables = TheInGameUI->getAllSelectedDrawables(); // sanity - DEBUG_ASSERTCRASH( selectedDrawables->empty() == FALSE, ("populateMultiSelect: Drawable list is empty\n") ); + DEBUG_ASSERTCRASH( selectedDrawables->empty() == FALSE, ("populateMultiSelect: Drawable list is empty") ); // loop through all the selected drawable IDs for( DrawableListCIt it = selectedDrawables->begin(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp index f947ea4560..fd002a9a3b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp @@ -54,7 +54,7 @@ void ControlBar::updateOCLTimerTextDisplay( UnsignedInt totalSeconds, Real perce GameWindow *barWindow = TheWindowManager->winGetWindowFromId( NULL, barID ); // santiy - DEBUG_ASSERTCRASH( descWindow, ("Under construction window not found\n") ); + DEBUG_ASSERTCRASH( descWindow, ("Under construction window not found") ); Int minutes = totalSeconds / 60; Int seconds = totalSeconds - (minutes * 60); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp index 31a721ada0..3549bc3dcf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp @@ -228,7 +228,7 @@ void INI::parseControlBarResizerDefinition( INI* ini ) // // // image not found, create a new one // rWin = resizer->newResizerWindow(name); -// DEBUG_ASSERTCRASH( rWin, ("parseControlBarResizerDefinition: unable to allocate ResizerWindow for '%s'\n", +// DEBUG_ASSERTCRASH( rWin, ("parseControlBarResizerDefinition: unable to allocate ResizerWindow for '%s'", // name.str()) ); // // } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp index 3e66a91cea..c11eca0da0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp @@ -440,9 +440,9 @@ void ControlBarScheme::init(void) win= TheWindowManager->winGetWindowFromId( NULL, TheNameKeyGenerator->nameToKey( "ControlBar.wnd:PopupCommunicator" ) ); if(win) { -// DEBUG_ASSERTCRASH(m_buddyButtonEnable, ("No enable button image for communicator in scheme %s!\n", m_name.str())); -// DEBUG_ASSERTCRASH(m_buddyButtonHightlited, ("No hilite button image for communicator in scheme %s!\n", m_name.str())); -// DEBUG_ASSERTCRASH(m_buddyButtonPushed, ("No pushed button image for communicator in scheme %s!\n", m_name.str())); +// DEBUG_ASSERTCRASH(m_buddyButtonEnable, ("No enable button image for communicator in scheme %s!", m_name.str())); +// DEBUG_ASSERTCRASH(m_buddyButtonHightlited, ("No hilite button image for communicator in scheme %s!", m_name.str())); +// DEBUG_ASSERTCRASH(m_buddyButtonPushed, ("No pushed button image for communicator in scheme %s!", m_name.str())); GadgetButtonSetEnabledImage(win, m_buddyButtonEnable); GadgetButtonSetHiliteImage(win, m_buddyButtonHightlited); GadgetButtonSetHiliteSelectedImage(win, m_buddyButtonPushed); @@ -687,7 +687,7 @@ void ControlBarScheme::addAnimation( ControlBarSchemeAnimation *schemeAnim ) { if( !schemeAnim ) { - DEBUG_ASSERTCRASH(FALSE,("Trying to add a null animation to the controlbarscheme\n")); + DEBUG_ASSERTCRASH(FALSE,("Trying to add a null animation to the controlbarscheme")); return; } m_animations.push_back( schemeAnim ); @@ -700,13 +700,13 @@ void ControlBarScheme::addImage( ControlBarSchemeImage *schemeImage ) { if( !schemeImage ) { - DEBUG_ASSERTCRASH(FALSE,("Trying to add a null image to the controlbarscheme\n")); + DEBUG_ASSERTCRASH(FALSE,("Trying to add a null image to the controlbarscheme")); return; } if(schemeImage->m_layer < 0 || schemeImage->m_layer >= MAX_CONTROL_BAR_SCHEME_IMAGE_LAYERS) { - DEBUG_ASSERTCRASH(FALSE,("SchemeImage %s attempted to be added to layer %d which is not Between to %d, %d\n", + DEBUG_ASSERTCRASH(FALSE,("SchemeImage %s attempted to be added to layer %d which is not Between to %d, %d", schemeImage->m_name.str(), schemeImage->m_layer, 0, MAX_CONTROL_BAR_SCHEME_IMAGE_LAYERS)); // bring the foobar to the front so we make it obvious that something's wrong schemeImage->m_layer = 0; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp index beeec46734..85bac8a759 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp @@ -117,7 +117,7 @@ void ControlBar::populateStructureInventory( Object *building ) // get the contain module of the object ContainModuleInterface *contain = building->getContain(); - DEBUG_ASSERTCRASH( contain, ("Object in structure inventory does not contain a Contain Module\n") ); + DEBUG_ASSERTCRASH( contain, ("Object in structure inventory does not contain a Contain Module") ); if (!contain) return; @@ -223,7 +223,7 @@ void ControlBar::updateContextStructureInventory( void ) // about we need to repopulate the buttons of the interface // ContainModuleInterface *contain = source->getContain(); - DEBUG_ASSERTCRASH( contain, ("No contain module defined for object in the iventory bar\n") ); + DEBUG_ASSERTCRASH( contain, ("No contain module defined for object in the iventory bar") ); if (!contain) return; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp index fab6b00b4c..97bee97e32 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp @@ -52,7 +52,7 @@ void ControlBar::updateConstructionTextDisplay( Object *obj ) GameWindow *descWindow = TheWindowManager->winGetWindowFromId( NULL, descID ); // santiy - DEBUG_ASSERTCRASH( descWindow, ("Under construction window not found\n") ); + DEBUG_ASSERTCRASH( descWindow, ("Under construction window not found") ); // format the message text.format( TheGameText->fetch( "CONTROLBAR:UnderConstructionDesc" ), diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp index ba3d317fcf..95cf505a32 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp @@ -101,7 +101,7 @@ void InGamePopupMessageInit( WindowLayout *layout, void *userData ) if(!pMData) { - DEBUG_ASSERTCRASH(pMData, ("We're in InGamePopupMessage without a pointer to pMData\n") ); + DEBUG_ASSERTCRASH(pMData, ("We're in InGamePopupMessage without a pointer to pMData") ); ///< @todo: add a call to the close this bitch method when I implement it CLH return; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp index ed6969f957..e7a95faa4d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp @@ -1408,7 +1408,7 @@ WindowMsgHandledType MainMenuSystem( GameWindow *window, UnsignedInt msg, dontAllowTransitions = TRUE; // SaveLoadLayoutType layoutType = SLLT_LOAD_ONLY; // WindowLayout *saveLoadMenuLayout = TheShell->getSaveLoadMenuLayout(); -// DEBUG_ASSERTCRASH( saveLoadMenuLayout, ("Unable to get save load menu layout.\n") ); +// DEBUG_ASSERTCRASH( saveLoadMenuLayout, ("Unable to get save load menu layout.") ); // saveLoadMenuLayout->runInit( &layoutType ); // saveLoadMenuLayout->hide( FALSE ); // saveLoadMenuLayout->bringForward(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp index f270b3c962..7e5cc695d1 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp @@ -135,7 +135,7 @@ void PopupReplayInit( WindowLayout *layout, void *userData ) // get the listbox that will have the save games in it GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( NULL, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("PopupReplayInit - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("PopupReplayInit - Unable to find games listbox") ); // populate the listbox with the save games on disk PopulateReplayFileListbox(listboxGames); @@ -296,7 +296,7 @@ void reallySaveReplay(void) // get the listbox that will have the save games in it GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( parent, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("reallySaveReplay - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("reallySaveReplay - Unable to find games listbox") ); // populate the listbox with the save games on disk PopulateReplayFileListbox(listboxGames); @@ -323,7 +323,7 @@ void reallySaveReplay(void) // get the listbox that will have the save games in it GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( parent, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("reallySaveReplay - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("reallySaveReplay - Unable to find games listbox") ); // populate the listbox with the save games on disk PopulateReplayFileListbox(listboxGames); @@ -375,7 +375,7 @@ WindowMsgHandledType PopupReplaySystem( GameWindow *window, UnsignedInt msg, GameWindow *control = (GameWindow *)mData1; GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( window, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("PopupReplaySystem - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("PopupReplaySystem - Unable to find games listbox") ); // // handle games listbox, when certain items are selected in the listbox only some @@ -389,7 +389,7 @@ WindowMsgHandledType PopupReplaySystem( GameWindow *window, UnsignedInt msg, UnicodeString filename; filename = GadgetListBoxGetText(listboxGames, rowSelected); GameWindow *textEntryReplayName = TheWindowManager->winGetWindowFromId( window, textEntryReplayNameKey ); - DEBUG_ASSERTCRASH( textEntryReplayName != NULL, ("PopupReplaySystem - Unable to find text entry\n") ); + DEBUG_ASSERTCRASH( textEntryReplayName != NULL, ("PopupReplaySystem - Unable to find text entry") ); GadgetTextEntrySetText(textEntryReplayName, filename); } } @@ -427,7 +427,7 @@ WindowMsgHandledType PopupReplaySystem( GameWindow *window, UnsignedInt msg, { // get the filename, and see if we are overwriting GameWindow *textEntryReplayName = TheWindowManager->winGetWindowFromId( window, textEntryReplayNameKey ); - DEBUG_ASSERTCRASH( textEntryReplayName != NULL, ("PopupReplaySystem - Unable to find text entry\n") ); + DEBUG_ASSERTCRASH( textEntryReplayName != NULL, ("PopupReplaySystem - Unable to find text entry") ); UnicodeString filename = GadgetTextEntryGetText( textEntryReplayName ); if (filename.isEmpty()) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp index 04703084d5..9d713387f7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp @@ -102,7 +102,7 @@ static void updateMenuActions( void ) // for loading only, disable the save button, otherwise enable it GameWindow *saveButton = TheWindowManager->winGetWindowFromId( NULL, buttonSaveKey ); - DEBUG_ASSERTCRASH( saveButton, ("SaveLoadMenuInit: Unable to find save button\n") ); + DEBUG_ASSERTCRASH( saveButton, ("SaveLoadMenuInit: Unable to find save button") ); if( currentLayoutType == SLLT_LOAD_ONLY ) saveButton->winEnable( FALSE ); else @@ -172,7 +172,7 @@ void SaveLoadMenuInit( WindowLayout *layout, void *userData ) editDesc = TheWindowManager->winGetWindowFromId( parent, NAMEKEY( "PopupSaveLoad.wnd:EntryDesc" ) ); // get the listbox that will have the save games in it listboxGames = TheWindowManager->winGetWindowFromId( NULL, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox") ); // populate the listbox with the save games on disk TheGameState->populateSaveGameListbox( listboxGames, currentLayoutType ); @@ -235,7 +235,7 @@ void SaveLoadMenuFullScreenInit( WindowLayout *layout, void *userData ) deleteConfirm = TheWindowManager->winGetWindowFromId( parent, NAMEKEY( "SaveLoad.wnd:DeleteConfirmParent" ) ); // get the listbox that will have the save games in it listboxGames = TheWindowManager->winGetWindowFromId( NULL, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox") ); // populate the listbox with the save games on disk TheGameState->populateSaveGameListbox( listboxGames, currentLayoutType ); @@ -367,7 +367,7 @@ static AvailableGameInfo *getSelectedSaveFileInfo( GameWindow *window ) // get the listbox //GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( window, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox") ); // which item is selected Int selected; @@ -388,11 +388,11 @@ static void doLoadGame( void ) // get listbox of games //GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( parent, NAMEKEY( "PopupSaveLoad.wnd:ListboxGames" ) ); - DEBUG_ASSERTCRASH( listboxGames, ("doLoadGame: Unable to find game listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames, ("doLoadGame: Unable to find game listbox") ); // get selected game info AvailableGameInfo *selectedGameInfo = getSelectedSaveFileInfo( listboxGames ); - DEBUG_ASSERTCRASH( selectedGameInfo, ("doLoadGame: No selected game info found\n") ); + DEBUG_ASSERTCRASH( selectedGameInfo, ("doLoadGame: No selected game info found") ); // when loading a game we also close the quit/esc menu for the user when in-game if( TheShell->isShellActive() == FALSE ) @@ -563,7 +563,7 @@ WindowMsgHandledType SaveLoadMenuSystem( GameWindow *window, UnsignedInt msg, { GameWindow *control = (GameWindow *)mData1; GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( window, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox") ); if (listboxGames != NULL) { int rowSelected = mData2; @@ -583,7 +583,7 @@ WindowMsgHandledType SaveLoadMenuSystem( GameWindow *window, UnsignedInt msg, GameWindow *control = (GameWindow *)mData1; GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( window, listboxGamesKey ); - DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox\n") ); + DEBUG_ASSERTCRASH( listboxGames != NULL, ("SaveLoadMenuInit - Unable to find games listbox") ); // // handle games listbox, when certain items are selected in the listbox only some @@ -761,7 +761,7 @@ WindowMsgHandledType SaveLoadMenuSystem( GameWindow *window, UnsignedInt msg, // get the item data of the selection AvailableGameInfo *selectedGameInfo; selectedGameInfo = (AvailableGameInfo *)GadgetListBoxGetItemData( listboxGames, selected ); - DEBUG_ASSERTCRASH( selectedGameInfo, ("SaveLoadMenuSystem: Internal error, listbox entry to overwrite game has no item data set into listbox element\n") ); + DEBUG_ASSERTCRASH( selectedGameInfo, ("SaveLoadMenuSystem: Internal error, listbox entry to overwrite game has no item data set into listbox element") ); // enable the listbox of games //GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( parent, NAMEKEY( "PopupSaveLoad.wnd:ListboxGames" ) ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index 66569b50ba..782a99672d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -197,7 +197,7 @@ void startNextCampaignGame(void) TheWritableGlobalData->m_pendingFile = TheCampaignManager->getCurrentMap(); if (TheCampaignManager->getCurrentCampaign() && TheCampaignManager->getCurrentCampaign()->isChallengeCampaign()) { - DEBUG_ASSERTCRASH( TheChallengeGameInfo, ("TheChallengeGameInfo doesn't exist.\n") ); + DEBUG_ASSERTCRASH( TheChallengeGameInfo, ("TheChallengeGameInfo doesn't exist.") ); TheChallengeGameInfo->init(); TheChallengeGameInfo->clearSlotList(); TheChallengeGameInfo->reset(); @@ -586,7 +586,7 @@ WindowMsgHandledType ScoreScreenSystem( GameWindow *window, UnsignedInt msg, { ScoreScreenEnableControls(FALSE); WindowLayout *saveReplayLayout = TheShell->getPopupReplayLayout(); - DEBUG_ASSERTCRASH( saveReplayLayout, ("Unable to get save replay menu layout.\n") ); + DEBUG_ASSERTCRASH( saveReplayLayout, ("Unable to get save replay menu layout.") ); saveReplayLayout->runInit(); saveReplayLayout->hide( FALSE ); saveReplayLayout->bringForward(); @@ -1795,7 +1795,7 @@ winName.format("ScoreScreen.wnd:StaticTextScore%d", pos); gameResReq.hostname = TheGameSpyGame->getLadderIP().str(); gameResReq.port = TheGameSpyGame->getLadderPort(); gameResReq.results = TheGameSpyGame->generateLadderGameResultsPacket().str(); - DEBUG_ASSERTCRASH(TheGameResultsQueue, ("No Game Results queue!\n")); + DEBUG_ASSERTCRASH(TheGameResultsQueue, ("No Game Results queue!")); if (TheGameResultsQueue) { TheGameResultsQueue->addRequest(gameResReq); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index 10ba1a970b..ccf976739d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -1249,7 +1249,7 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) } } } - DEBUG_ASSERTCRASH(numPlayers, ("Game had no players!\n")); + DEBUG_ASSERTCRASH(numPlayers, ("Game had no players!")); //DEBUG_LOG(("Saw room: hasPass=%d, allowsObservers=%d", room.getHasPassword(), room.getAllowObservers())); if (resp.stagingRoom.action == PEER_ADD) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp index 3b5b521476..6ef1c7c032 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp @@ -80,7 +80,7 @@ void INI::parseWindowTransitions( INI* ini ) // find existing item if present - DEBUG_ASSERTCRASH( TheTransitionHandler, ("parseWindowTransitions: TheTransitionHandler doesn't exist yet\n") ); + DEBUG_ASSERTCRASH( TheTransitionHandler, ("parseWindowTransitions: TheTransitionHandler doesn't exist yet") ); if( !TheTransitionHandler ) return; @@ -89,7 +89,7 @@ void INI::parseWindowTransitions( INI* ini ) g = TheTransitionHandler->getNewGroup( name ); // sanity - DEBUG_ASSERTCRASH( g, ("parseWindowTransitions: Unable to allocate group '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( g, ("parseWindowTransitions: Unable to allocate group '%s'", name.str()) ); // parse the ini definition ini->initFromINI( g, TheTransitionHandler->getFieldParse() ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index ff645814c7..f668adc8d0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -1470,7 +1470,7 @@ void MultiPlayerLoadScreen::processProgress(Int playerId, Int percentage) if( percentage < 0 || percentage > 100 || playerId >= MAX_SLOTS || playerId < 0 || m_playerLookup[playerId] == -1) { - DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d\n", percentage, playerId)); + DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d", percentage, playerId)); return; } //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)", percentage, playerId, m_playerLookup[playerId])); @@ -1838,7 +1838,7 @@ void GameSpyLoadScreen::processProgress(Int playerId, Int percentage) if( percentage < 0 || percentage > 100 || playerId >= MAX_SLOTS || playerId < 0 || m_playerLookup[playerId] == -1) { - DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d\n", percentage, playerId)); + DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d", percentage, playerId)); return; } //DEBUG_LOG(("Percentage %d was passed in for Player %d (in loadscreen position %d)", percentage, playerId, m_playerLookup[playerId])); @@ -1991,7 +1991,7 @@ void MapTransferLoadScreen::processProgress(Int playerId, Int percentage, AsciiS if( percentage < 0 || percentage > 100 || playerId >= MAX_SLOTS || playerId < 0 || m_playerLookup[playerId] == -1) { - DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d\n", percentage, playerId)); + DEBUG_ASSERTCRASH(FALSE, ("Percentage %d was passed in for Player %d", percentage, playerId)); return; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp index d25e179286..55faa78a4a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp @@ -197,7 +197,7 @@ void Shell::update( void ) for( Int i = m_screenCount - 1; i >= 0; i-- ) { - DEBUG_ASSERTCRASH( m_screenStack[ i ], ("Top of shell stack is NULL!\n") ); + DEBUG_ASSERTCRASH( m_screenStack[ i ], ("Top of shell stack is NULL!") ); m_screenStack[ i ]->runUpdate( NULL ); } // end for i @@ -673,7 +673,7 @@ void Shell::doPush( AsciiString layoutFile ) // create new layout and load from window manager newScreen = TheWindowManager->winCreateLayout( layoutFile ); - DEBUG_ASSERTCRASH( newScreen != NULL, ("Shell unable to load pending push layout\n") ); + DEBUG_ASSERTCRASH( newScreen != NULL, ("Shell unable to load pending push layout") ); // link screen to the top linkScreen( newScreen ); @@ -696,7 +696,7 @@ void Shell::doPop( Bool impendingPush ) WindowLayout *currentTop = top(); // there better be a top of the stack since we're popping - DEBUG_ASSERTCRASH( currentTop, ("Shell: No top of stack and we want to pop!\n") ); + DEBUG_ASSERTCRASH( currentTop, ("Shell: No top of stack and we want to pop!") ); if (currentTop) { @@ -852,7 +852,7 @@ WindowLayout *Shell::getSaveLoadMenuLayout( void ) m_saveLoadMenuLayout = TheWindowManager->winCreateLayout( AsciiString( "Menus/PopupSaveLoad.wnd" ) ); // sanity - DEBUG_ASSERTCRASH( m_saveLoadMenuLayout, ("Unable to create save/load menu layout\n") ); + DEBUG_ASSERTCRASH( m_saveLoadMenuLayout, ("Unable to create save/load menu layout") ); // return the layout return m_saveLoadMenuLayout; @@ -869,7 +869,7 @@ WindowLayout *Shell::getPopupReplayLayout( void ) m_popupReplayLayout = TheWindowManager->winCreateLayout( AsciiString( "Menus/PopupReplay.wnd" ) ); // sanity - DEBUG_ASSERTCRASH( m_popupReplayLayout, ("Unable to create replay save menu layout\n") ); + DEBUG_ASSERTCRASH( m_popupReplayLayout, ("Unable to create replay save menu layout") ); // return the layout return m_popupReplayLayout; @@ -886,7 +886,7 @@ WindowLayout *Shell::getOptionsLayout( Bool create ) m_optionsLayout = TheWindowManager->winCreateLayout( AsciiString( "Menus/OptionsMenu.wnd" ) ); // sanity - DEBUG_ASSERTCRASH( m_optionsLayout, ("Unable to create options menu layout\n") ); + DEBUG_ASSERTCRASH( m_optionsLayout, ("Unable to create options menu layout") ); } // return the layout diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp index b56f66f0c5..5065ec34b7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp @@ -84,7 +84,7 @@ void INI::parseShellMenuSchemeDefinition( INI *ini ) // find existing item if present SMSchemeManager = TheShell->getShellMenuSchemeManager(); - DEBUG_ASSERTCRASH( SMSchemeManager, ("parseShellMenuSchemeDefinition: Unable to Get SMSchemeManager\n") ); + DEBUG_ASSERTCRASH( SMSchemeManager, ("parseShellMenuSchemeDefinition: Unable to Get SMSchemeManager") ); if( !SMSchemeManager ) return; @@ -93,7 +93,7 @@ void INI::parseShellMenuSchemeDefinition( INI *ini ) SMScheme = SMSchemeManager->newShellMenuScheme( name ); // sanity - DEBUG_ASSERTCRASH( SMScheme, ("parseControlBarSchemeDefinition: Unable to allocate Scheme '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( SMScheme, ("parseControlBarSchemeDefinition: Unable to allocate Scheme '%s'", name.str()) ); // parse the ini definition ini->initFromINI( SMScheme, SMSchemeManager->getFieldParse() ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp index 2d6cef34bf..72e5368030 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -847,7 +847,7 @@ void GameClient::destroyDrawable( Drawable *draw ) if( obj ) { - DEBUG_ASSERTCRASH( obj->getDrawable() == draw, ("Object/Drawable pointer mismatch!\n") ); + DEBUG_ASSERTCRASH( obj->getDrawable() == draw, ("Object/Drawable pointer mismatch!") ); obj->friend_bindToDrawable( NULL ); } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GraphDraw.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GraphDraw.cpp index 3db0c78a27..5206f8f6fe 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GraphDraw.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GraphDraw.cpp @@ -91,8 +91,8 @@ void GraphDraw::render() Int height = TheDisplay->getHeight(); Int totalCount = m_graphEntries.size(); - DEBUG_ASSERTCRASH(totalCount < MAX_GRAPH_VALUES, ("MAX_GRAPH_VALUES must be increased, not all labels will appear (max %d, cur %d).\n",MAX_GRAPH_VALUES,totalCount)); - DEBUG_ASSERTCRASH(BAR_HEIGHT * totalCount < height, ("BAR_HEIGHT must be reduced, as bars are being drawn off-screen.\n")); + DEBUG_ASSERTCRASH(totalCount < MAX_GRAPH_VALUES, ("MAX_GRAPH_VALUES must be increased, not all labels will appear (max %d, cur %d).",MAX_GRAPH_VALUES,totalCount)); + DEBUG_ASSERTCRASH(BAR_HEIGHT * totalCount < height, ("BAR_HEIGHT must be reduced, as bars are being drawn off-screen.")); VecGraphEntriesIt it; Int count = 0; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index b835342df5..abf9b47854 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -2908,7 +2908,7 @@ void InGameUI::setGUICommand( const CommandButton *command ) if( BitIsSet( command->getOptions(), COMMAND_OPTION_NEED_TARGET ) == FALSE ) { - DEBUG_ASSERTCRASH( 0, ("setGUICommand: Command '%s' does not need additional user interaction\n", + DEBUG_ASSERTCRASH( 0, ("setGUICommand: Command '%s' does not need additional user interaction", command->getName().str()) ); m_pendingGUICommand = NULL; m_mouseMode = MOUSEMODE_DEFAULT; @@ -3055,7 +3055,7 @@ void InGameUI::placeBuildAvailable( const ThingTemplate *build, Drawable *buildD else draw->setIndicatorColor(sourceObject->getControllingPlayer()->getPlayerColor()); } - DEBUG_ASSERTCRASH( draw, ("Unable to create icon at cursor for placement '%s'\n", + DEBUG_ASSERTCRASH( draw, ("Unable to create icon at cursor for placement '%s'", build->getName().str()) ); // diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp index 0c0c984235..ea814dad34 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp @@ -64,14 +64,14 @@ void Keyboard::createStreamMessages( void ) { msg = TheMessageStream->appendMessage( GameMessage::MSG_RAW_KEY_DOWN ); - DEBUG_ASSERTCRASH( msg, ("Unable to append key down message to stream\n") ); + DEBUG_ASSERTCRASH( msg, ("Unable to append key down message to stream") ); } // end if else if( BitIsSet( key->state, KEY_STATE_UP ) ) { msg = TheMessageStream->appendMessage( GameMessage::MSG_RAW_KEY_UP ); - DEBUG_ASSERTCRASH( msg, ("Unable to append key up message to stream\n") ); + DEBUG_ASSERTCRASH( msg, ("Unable to append key up message to stream") ); } // end else if else diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index 099292f6a4..6b8d750597 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -1287,7 +1287,7 @@ GameMessage::Type CommandTranslator::createEnterMessage( Drawable *enter, return msgType; // sanity - DEBUG_ASSERTCRASH( commandType == DO_COMMAND, ("createEnterMessage - commandType is not DO_COMMAND\n") ); + DEBUG_ASSERTCRASH( commandType == DO_COMMAND, ("createEnterMessage - commandType is not DO_COMMAND") ); if( m_teamExists ) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp index 4e255cc83c..a78651919d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp @@ -191,7 +191,7 @@ static CommandStatus doFireWeaponCommand( const CommandButton *command, const IC //This could be legit now -- think of firing a self destruct weapon //----------------------------------------------------------------- - //DEBUG_ASSERTCRASH( 0, ("doFireWeaponCommand: Command options say it doesn't need additional user input '%s'\n", + //DEBUG_ASSERTCRASH( 0, ("doFireWeaponCommand: Command options say it doesn't need additional user input '%s'", // command->m_name.str()) ); //return COMMAND_COMPLETE; @@ -269,7 +269,7 @@ static CommandStatus doAttackMoveCommand( const CommandButton *command, const IC // so we must be sure there is only one thing selected (that thing we will set the point on) // Drawable *draw = TheInGameUI->getFirstSelectedDrawable(); - DEBUG_ASSERTCRASH( draw, ("doAttackMoveCommand: No selected object(s)\n") ); + DEBUG_ASSERTCRASH( draw, ("doAttackMoveCommand: No selected object(s)") ); // sanity if( draw == NULL || draw->getObject() == NULL ) @@ -308,7 +308,7 @@ static CommandStatus doSetRallyPointCommand( const CommandButton *command, const DEBUG_ASSERTCRASH( TheInGameUI->getSelectCount() == 1, ("doSetRallyPointCommand: The selected count is not 1, we can only set a rally point on a *SINGLE* building\n") ); Drawable *draw = TheInGameUI->getFirstSelectedDrawable(); - DEBUG_ASSERTCRASH( draw, ("doSetRallyPointCommand: No selected object\n") ); + DEBUG_ASSERTCRASH( draw, ("doSetRallyPointCommand: No selected object") ); // sanity if( draw == NULL || draw->getObject() == NULL ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp index 012ff50c65..1daed61fe7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp @@ -299,7 +299,7 @@ Anim2D::Anim2D( Anim2DTemplate *animTemplate, Anim2DCollection *collectionSystem { // sanity - DEBUG_ASSERTCRASH( animTemplate != NULL, ("Anim2D::Anim2D - NULL template\n") ); + DEBUG_ASSERTCRASH( animTemplate != NULL, ("Anim2D::Anim2D - NULL template") ); //Added By Sadullah Nader //Initialization @@ -359,7 +359,7 @@ void Anim2D::setCurrentFrame( UnsignedShort frame ) { // sanity - DEBUG_ASSERTCRASH( m_template != NULL, ("Anim2D::reset - No template for animation\n") ); + DEBUG_ASSERTCRASH( m_template != NULL, ("Anim2D::reset - No template for animation") ); // sanity DEBUG_ASSERTCRASH( TheGameLogic != NULL, @@ -386,7 +386,7 @@ void Anim2D::randomizeCurrentFrame( void ) { // sanity - DEBUG_ASSERTCRASH( m_template != NULL, ("Anim2D::reset - No template for animation\n") ); + DEBUG_ASSERTCRASH( m_template != NULL, ("Anim2D::reset - No template for animation") ); // set the current frame to a random frame setCurrentFrame( GameClientRandomValue( 0, m_template->getNumFrames() - 1 ) ); @@ -400,7 +400,7 @@ void Anim2D::reset( void ) { // sanity - DEBUG_ASSERTCRASH( m_template != NULL, ("Anim2D::reset - No template for animation\n") ); + DEBUG_ASSERTCRASH( m_template != NULL, ("Anim2D::reset - No template for animation") ); switch( m_template->getAnimMode() ) { @@ -625,7 +625,7 @@ void Anim2D::draw( Int x, Int y ) const Image *image = m_template->getFrame( m_currentFrame ); // sanity - DEBUG_ASSERTCRASH( image != NULL, ("Anim2D::draw - Image not found for frame '%d' on animation '%s'\n", + DEBUG_ASSERTCRASH( image != NULL, ("Anim2D::draw - Image not found for frame '%d' on animation '%s'", m_currentFrame, m_template->getName().str()) ); // get the natural width and height of this image @@ -655,7 +655,7 @@ void Anim2D::draw( Int x, Int y, Int width, Int height ) const Image *image = m_template->getFrame( m_currentFrame ); // sanity - DEBUG_ASSERTCRASH( image != NULL, ("Anim2D::draw - Image not found for frame '%d' on animation '%s'\n", + DEBUG_ASSERTCRASH( image != NULL, ("Anim2D::draw - Image not found for frame '%d' on animation '%s'", m_currentFrame, m_template->getName().str()) ); @@ -728,7 +728,7 @@ Anim2DCollection::~Anim2DCollection( void ) { // there should not be any animation instances registered with us since we're being destroyed - DEBUG_ASSERTCRASH( m_instanceList == NULL, ("Anim2DCollection - instance list is not NULL\n") ); + DEBUG_ASSERTCRASH( m_instanceList == NULL, ("Anim2DCollection - instance list is not NULL") ); // delete all the templates Anim2DTemplate *nextTemplate; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/CampaignManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/CampaignManager.cpp index 842d91bc65..1bb4cd8fd3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/CampaignManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/CampaignManager.cpp @@ -97,7 +97,7 @@ void INI::parseCampaignDefinition( INI *ini ) name.set( c ); // find existing item if present - DEBUG_ASSERTCRASH( TheCampaignManager, ("parseCampaignDefinition: Unable to Get TheCampaignManager\n") ); + DEBUG_ASSERTCRASH( TheCampaignManager, ("parseCampaignDefinition: Unable to Get TheCampaignManager") ); if( !TheCampaignManager ) return; @@ -105,7 +105,7 @@ void INI::parseCampaignDefinition( INI *ini ) campaign = TheCampaignManager->newCampaign( name ); // sanity - DEBUG_ASSERTCRASH( campaign, ("parseCampaignDefinition: Unable to allocate campaign '%s'\n", name.str()) ); + DEBUG_ASSERTCRASH( campaign, ("parseCampaignDefinition: Unable to allocate campaign '%s'", name.str()) ); // parse the ini definition ini->initFromINI( campaign, TheCampaignManager->getFieldParse() ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp index e2829d259f..5ccd0e6548 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp @@ -1191,7 +1191,7 @@ ParticleSystem::~ParticleSystem() if( m_slaveSystem ) { - DEBUG_ASSERTCRASH( m_slaveSystem->getMaster() == this, ("~ParticleSystem: Our slave doesn't have us as a master!\n") ); + DEBUG_ASSERTCRASH( m_slaveSystem->getMaster() == this, ("~ParticleSystem: Our slave doesn't have us as a master!") ); m_slaveSystem->setMaster( NULL ); setSlave( NULL ); @@ -1201,7 +1201,7 @@ ParticleSystem::~ParticleSystem() if( m_masterSystem ) { - DEBUG_ASSERTCRASH( m_masterSystem->getSlave() == this, ("~ParticleSystem: Our master doesn't have us as a slave!\n") ); + DEBUG_ASSERTCRASH( m_masterSystem->getSlave() == this, ("~ParticleSystem: Our master doesn't have us as a slave!") ); m_masterSystem->setSlave( NULL ); setMaster( NULL ); @@ -2116,7 +2116,7 @@ void ParticleSystem::updateWindMotion( void ) Real endAngle = m_windMotionEndAngle; // this only works when start angle is less than end angle - DEBUG_ASSERTCRASH( startAngle < endAngle, ("updateWindMotion: startAngle must be < endAngle\n") ); + DEBUG_ASSERTCRASH( startAngle < endAngle, ("updateWindMotion: startAngle must be < endAngle") ); // how big is the total angle span Real totalSpan = endAngle - startAngle; @@ -2518,7 +2518,7 @@ void ParticleSystem::xfer( Xfer *xfer ) particle = createParticle( info, priority, TRUE ); // sanity - DEBUG_ASSERTCRASH( particle, ("ParticleSyste::xfer - Unable to create particle for loading\n") ); + DEBUG_ASSERTCRASH( particle, ("ParticleSyste::xfer - Unable to create particle for loading") ); // read in the particle data xfer->xferSnapshot( particle ); @@ -2873,8 +2873,8 @@ void ParticleSystemManager::init( void ) { // sanity - DEBUG_ASSERTCRASH( m_allParticlesHead[ i ] == NULL, ("INIT: ParticleSystem all particles head[%d] is not NULL!\n", i) ); - DEBUG_ASSERTCRASH( m_allParticlesTail[ i ] == NULL, ("INIT: ParticleSystem all particles tail[%d] is not NULL!\n", i) ); + DEBUG_ASSERTCRASH( m_allParticlesHead[ i ] == NULL, ("INIT: ParticleSystem all particles head[%d] is not NULL!", i) ); + DEBUG_ASSERTCRASH( m_allParticlesTail[ i ] == NULL, ("INIT: ParticleSystem all particles tail[%d] is not NULL!", i) ); // just to be clean set them to NULL m_allParticlesHead[ i ] = NULL; @@ -2900,8 +2900,8 @@ void ParticleSystemManager::reset( void ) { // sanity - DEBUG_ASSERTCRASH( m_allParticlesHead[ i ] == NULL, ("RESET: ParticleSystem all particles head[%d] is not NULL!\n", i) ); - DEBUG_ASSERTCRASH( m_allParticlesTail[ i ] == NULL, ("RESET: ParticleSystem all particles tail[%d] is not NULL!\n", i) ); + DEBUG_ASSERTCRASH( m_allParticlesHead[ i ] == NULL, ("RESET: ParticleSystem all particles head[%d] is not NULL!", i) ); + DEBUG_ASSERTCRASH( m_allParticlesTail[ i ] == NULL, ("RESET: ParticleSystem all particles tail[%d] is not NULL!", i) ); // just to be clean set them to NULL m_allParticlesHead[ i ] = NULL; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp index b14b5df375..bec7793904 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp @@ -440,7 +440,7 @@ TerrainRoadType *TerrainRoadCollection::newBridge( AsciiString name ) TerrainRoadType *TerrainRoadCollection::nextRoad( TerrainRoadType *road ) { - DEBUG_ASSERTCRASH( road->isBridge() == FALSE, ("nextRoad: road not a road\n") ); + DEBUG_ASSERTCRASH( road->isBridge() == FALSE, ("nextRoad: road not a road") ); return road->friend_getNext(); } // end nextRoad @@ -451,7 +451,7 @@ TerrainRoadType *TerrainRoadCollection::nextRoad( TerrainRoadType *road ) TerrainRoadType *TerrainRoadCollection::nextBridge( TerrainRoadType *bridge ) { - DEBUG_ASSERTCRASH( bridge->isBridge() == TRUE, ("nextBridge, bridge is not a bridge\n") ); + DEBUG_ASSERTCRASH( bridge->isBridge() == TRUE, ("nextBridge, bridge is not a bridge") ); return bridge->friend_getNext(); } // end nextBridge diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp index 2ba16afed8..2af7ccfb95 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp @@ -343,7 +343,7 @@ void AI::reset( void ) } } #else - DEBUG_ASSERTCRASH(m_groupList.empty(), ("AI::m_groupList is expected empty already\n")); + DEBUG_ASSERTCRASH(m_groupList.empty(), ("AI::m_groupList is expected empty already")); m_groupList.clear(); // Clear just in case... #endif diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index 6a550f0289..26ba81860f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -177,13 +177,13 @@ Object *Bridge::createTower( Coord3D *worldPos, // tie it to the bridge BridgeBehaviorInterface *bridgeInterface = BridgeBehavior::getBridgeBehaviorInterfaceFromObject( bridge ); - DEBUG_ASSERTCRASH( bridgeInterface != NULL, ("Bridge::createTower - no 'BridgeBehaviorInterface' found\n") ); + DEBUG_ASSERTCRASH( bridgeInterface != NULL, ("Bridge::createTower - no 'BridgeBehaviorInterface' found") ); if( bridgeInterface ) bridgeInterface->setTower( towerType, tower ); // tie the bridge to us BridgeTowerBehaviorInterface *bridgeTowerInterface = BridgeTowerBehavior::getBridgeTowerBehaviorInterfaceFromObject( tower ); - DEBUG_ASSERTCRASH( bridgeTowerInterface != NULL, ("Bridge::createTower - no 'BridgeTowerBehaviorInterface' found\n") ); + DEBUG_ASSERTCRASH( bridgeTowerInterface != NULL, ("Bridge::createTower - no 'BridgeTowerBehaviorInterface' found") ); if( bridgeTowerInterface ) { @@ -1492,7 +1492,7 @@ void makeAlignToNormalMatrix( Real angle, const Coord3D& pos, const Coord3D& nor x.normalize(); } - DEBUG_ASSERTCRASH(fabs(x.x*z.x + x.y*z.y + x.z*z.z)<0.0001,("dot is not zero (%f)\n",fabs(x.x*z.x + x.y*z.y + x.z*z.z))); + DEBUG_ASSERTCRASH(fabs(x.x*z.x + x.y*z.y + x.z*z.z)<0.0001,("dot is not zero (%f)",fabs(x.x*z.x + x.y*z.y + x.z*z.z))); // now computing the y vector is trivial. y.crossProduct( &z, &x, &y ); @@ -2279,7 +2279,7 @@ Real TerrainLogic::getWaterHeight( const WaterHandle *water ) } // end if // sanity - DEBUG_ASSERTCRASH( water->m_polygon != NULL, ("getWaterHeight: polygon trigger in water handle is NULL\n") ); + DEBUG_ASSERTCRASH( water->m_polygon != NULL, ("getWaterHeight: polygon trigger in water handle is NULL") ); // return the height of the water using the polygon trigger return water->m_polygon->getPoint( 0 )->z; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp index 9f95e066cf..18473d29c2 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp @@ -629,7 +629,7 @@ void BridgeBehavior::onBodyDamageStateChange( const DamageInfo* damageInfo, return; // sanity - DEBUG_ASSERTCRASH( oldState != newState, ("BridgeBehavior::onBodyDamageStateChange - oldState and newState should be different if this is getting called\n") ); + DEBUG_ASSERTCRASH( oldState != newState, ("BridgeBehavior::onBodyDamageStateChange - oldState and newState should be different if this is getting called") ); Object *us = getObject(); Bridge *bridge = TheTerrainLogic->findBridgeAt( us->getPosition() ); @@ -650,7 +650,7 @@ void BridgeBehavior::onBodyDamageStateChange( const DamageInfo* damageInfo, TerrainRoadType *bridgeTemplate = TheTerrainRoads->findBridge( bridgeTemplateName ); // sanity - DEBUG_ASSERTCRASH( bridgeTemplate, ("BridgeBehavior: Unable to find bridge template '%s' in bridge object '%s'\n", + DEBUG_ASSERTCRASH( bridgeTemplate, ("BridgeBehavior: Unable to find bridge template '%s' in bridge object '%s'", bridgeTemplateName.str(), us->getTemplate()->getName().str()) ); @@ -723,7 +723,7 @@ UpdateSleepTime BridgeBehavior::update( void ) TerrainRoadType *bridgeTemplate = NULL; if ( bridge ) { - DEBUG_ASSERTCRASH( bridge, ("BridgeBehavior::update - Unable to find bridge\n") ); + DEBUG_ASSERTCRASH( bridge, ("BridgeBehavior::update - Unable to find bridge") ); // get bridge info bridgeInfo = bridge->peekBridgeInfo(); @@ -731,7 +731,7 @@ UpdateSleepTime BridgeBehavior::update( void ) // get the bridge template info AsciiString bridgeTemplateName = bridge->getBridgeTemplateName(); bridgeTemplate = TheTerrainRoads->findBridge( bridgeTemplateName ); - DEBUG_ASSERTCRASH( bridgeTemplate, ("BridgeBeahvior::getRandomSurfacePosition - Encountered a bridge with no template!\n") ); + DEBUG_ASSERTCRASH( bridgeTemplate, ("BridgeBeahvior::getRandomSurfacePosition - Encountered a bridge with no template!") ); } // how much time has passed between now and our destruction frame @@ -973,7 +973,7 @@ void BridgeBehavior::setScaffoldData( Object *obj, // get the scaffold behavior interface BridgeScaffoldBehaviorInterface *scaffoldBehavior; scaffoldBehavior = BridgeScaffoldBehavior::getBridgeScaffoldBehaviorInterfaceFromObject( obj ); - DEBUG_ASSERTCRASH( scaffoldBehavior, ("Unable to find bridge scaffold behavior interface\n") ); + DEBUG_ASSERTCRASH( scaffoldBehavior, ("Unable to find bridge scaffold behavior interface") ); // compute the sunken position that the object will initially start at Real fudge = 8.0f; @@ -1036,7 +1036,7 @@ void BridgeBehavior::createScaffolding( void ) // get the bridge template AsciiString bridgeTemplateName = bridge->getBridgeTemplateName(); TerrainRoadType *bridgeTemplate = TheTerrainRoads->findBridge( bridgeTemplateName ); - DEBUG_ASSERTCRASH( bridgeTemplate, ("Unable to find bridge template to create scaffolding\n") ); + DEBUG_ASSERTCRASH( bridgeTemplate, ("Unable to find bridge template to create scaffolding") ); // get the thing template for the scaffold object we're going to use AsciiString scaffoldObjectName = bridgeTemplate->getScaffoldObjectName(); @@ -1304,7 +1304,7 @@ void BridgeBehavior::removeScaffolding( void ) // get the scaffold behavior scaffoldBehavior = BridgeScaffoldBehavior::getBridgeScaffoldBehaviorInterfaceFromObject( obj ); - DEBUG_ASSERTCRASH( scaffoldBehavior, ("Unable to find bridge scaffold behavior interface\n") ); + DEBUG_ASSERTCRASH( scaffoldBehavior, ("Unable to find bridge scaffold behavior interface") ); // reverse the motion scaffoldBehavior->reverseMotion(); @@ -1399,7 +1399,7 @@ void BridgeBehavior::xfer( Xfer *xfer ) Bridge *bridge = TheTerrainLogic->findBridgeAt( us->getPosition() ); // sanity - DEBUG_ASSERTCRASH( bridge, ("BridgeBehavior::xfer - Unable to find bridge\n" )); + DEBUG_ASSERTCRASH( bridge, ("BridgeBehavior::xfer - Unable to find bridge" )); // set new object ID in bridge info to us bridge->setBridgeObjectID( us->getID() ); @@ -1417,7 +1417,7 @@ void BridgeBehavior::xfer( Xfer *xfer ) Bridge *bridge = TheTerrainLogic->findBridgeAt( us->getPosition() ); // sanity - DEBUG_ASSERTCRASH( bridge, ("BridgeBehavior::xfer - Unable to find bridge\n" )); + DEBUG_ASSERTCRASH( bridge, ("BridgeBehavior::xfer - Unable to find bridge" )); // set new object ID in bridge info to us for( Int i = 0; i < BRIDGE_MAX_TOWERS; ++i ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp index c75c10b1fc..e6565196cb 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeTowerBehavior.cpp @@ -115,7 +115,7 @@ void BridgeTowerBehavior::onDamage( DamageInfo *damageInfo ) break; } // end for bmi - DEBUG_ASSERTCRASH( bridgeInterface != NULL, ("BridgeTowerBehavior::onDamage - no 'BridgeBehaviorInterface' found\n") ); + DEBUG_ASSERTCRASH( bridgeInterface != NULL, ("BridgeTowerBehavior::onDamage - no 'BridgeBehaviorInterface' found") ); if( bridgeInterface ) { @@ -196,7 +196,7 @@ void BridgeTowerBehavior::onHealing( DamageInfo *damageInfo ) break; } // end for bmi - DEBUG_ASSERTCRASH( bridgeInterface != NULL, ("BridgeTowerBehavior::onHealing - no 'BridgeBehaviorInterface' found\n") ); + DEBUG_ASSERTCRASH( bridgeInterface != NULL, ("BridgeTowerBehavior::onHealing - no 'BridgeBehaviorInterface' found") ); if( bridgeInterface ) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp index 9ba7f136be..b33f7bd020 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp @@ -222,8 +222,8 @@ static Bool calcTrajectory( pitches[0] = theta; // shallower angle pitches[1] = (theta >= 0.0) ? (PI/2 - theta) : (-PI/2 - theta); // steeper angle - DEBUG_ASSERTCRASH(pitches[0]<=PI/2&&pitches[0]>=-PI/2,("bad pitches[0] %f\n",rad2deg(pitches[0]))); - DEBUG_ASSERTCRASH(pitches[1]<=PI/2&&pitches[1]>=-PI/2,("bad pitches[1] %f\n",rad2deg(pitches[1]))); + DEBUG_ASSERTCRASH(pitches[0]<=PI/2&&pitches[0]>=-PI/2,("bad pitches[0] %f",rad2deg(pitches[0]))); + DEBUG_ASSERTCRASH(pitches[1]<=PI/2&&pitches[1]>=-PI/2,("bad pitches[1] %f",rad2deg(pitches[1]))); // calc the horiz-speed & time for each. // note that time can only be negative for 90getTemplate()->getName().str()) ); break; } // end if - DEBUG_ASSERTCRASH( m_thingTemplate != NULL, ("flightdeck has a null thingtemplate... no jets for you!\n") ); + DEBUG_ASSERTCRASH( m_thingTemplate != NULL, ("flightdeck has a null thingtemplate... no jets for you!") ); if( !pu->getProductionCount() && now >= m_nextAllowedProductionFrame && m_thingTemplate != NULL ) { //Queue the build diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/JetSlowDeathBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/JetSlowDeathBehavior.cpp index 87f38df614..f566b0fbf5 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/JetSlowDeathBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/JetSlowDeathBehavior.cpp @@ -234,7 +234,7 @@ UpdateSleepTime JetSlowDeathBehavior::update( void ) // roll us around in the air PhysicsBehavior *physics = us->getPhysics(); - DEBUG_ASSERTCRASH( physics, ("JetSlowDeathBehavior::beginSlowDeath - '%s' has no physics\n", + DEBUG_ASSERTCRASH( physics, ("JetSlowDeathBehavior::beginSlowDeath - '%s' has no physics", us->getTemplate()->getName().str()) ); if( physics ) physics->setRollRate( m_rollRate ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp index 9704ce3527..a7c4ceb939 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/POWTruckBehavior.cpp @@ -103,10 +103,10 @@ void POWTruckBehavior::onCollide( Object *other, const Coord3D *loc, const Coord // get our AI info AIUpdateInterface *ourAI = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ourAI, ("POWTruckBehavior::onCollide - '%s' has no AI\n", + DEBUG_ASSERTCRASH( ourAI, ("POWTruckBehavior::onCollide - '%s' has no AI", us->getTemplate()->getName().str()) ); POWTruckAIUpdateInterface *powTruckAI = ourAI->getPOWTruckAIUpdateInterface(); - DEBUG_ASSERTCRASH( powTruckAI, ("POWTruckBehavior::onCollide - '%s' has no POWTruckAI\n", + DEBUG_ASSERTCRASH( powTruckAI, ("POWTruckBehavior::onCollide - '%s' has no POWTruckAI", us->getTemplate()->getName().str()) ); // pick up the prisoner diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp index 35e7e2a0cf..9c74e34e46 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp @@ -843,7 +843,7 @@ void ParkingPlaceBehavior::unreserveDoorForExit( ExitDoorType exitDoor ) { if (it->m_door == exitDoor) { - //DEBUG_ASSERTCRASH(it->m_reservedForExit, ("ParkingPlaceBehavior::unreserveDoorForExit: door %d was not reserved\n",exitDoor)); + //DEBUG_ASSERTCRASH(it->m_reservedForExit, ("ParkingPlaceBehavior::unreserveDoorForExit: door %d was not reserved",exitDoor)); it->m_objectInSpace = INVALID_ID; it->m_reservedForExit = false; return; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp index d29147d3d0..4d3cb38d5e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp @@ -157,7 +157,7 @@ UpdateSleepTime PropagandaCenterBehavior::update( void ) // place this object under the control of the player Player *player = us->getControllingPlayer(); - DEBUG_ASSERTCRASH( player, ("Brainwashing: No controlling player for '%s'\n", us->getTemplate()->getName().str()) ); + DEBUG_ASSERTCRASH( player, ("Brainwashing: No controlling player for '%s'", us->getTemplate()->getName().str()) ); if( player ) brainwashingSubject->setTemporaryTeam( player->getDefaultTeam() ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp index 73fd075626..f5f09b4860 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp @@ -193,7 +193,7 @@ void GarrisonContain::putObjectAtGarrisonPoint( Object *obj, // garrison point ready to shoot // static const ThingTemplate *muzzle = TheThingFactory->findTemplate( "GarrisonGun" ); - DEBUG_ASSERTCRASH( muzzle, ("Warning, Object 'GarrisonGun' not found and is need for Garrison gun effects\n") ); + DEBUG_ASSERTCRASH( muzzle, ("Warning, Object 'GarrisonGun' not found and is need for Garrison gun effects") ); if( muzzle && isEnclosingContainerFor( obj ) )// If we are showing the contained, we need no gun barrel drawable added { Drawable *draw = TheThingFactory->newDrawable( muzzle ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp index 95fcda7b77..18e21b1594 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp @@ -1477,7 +1477,7 @@ void OpenContain::processDamageToContained(Real percentDamage) // GLA Battle Bus with at least 2 half damaged GLA Terrorists inside. if (listSize != items->size()) { - DEBUG_ASSERTCRASH( listSize == 0, ("List is expected empty\n") ); + DEBUG_ASSERTCRASH( listSize == 0, ("List is expected empty") ); break; } } @@ -1506,7 +1506,7 @@ void OpenContain::processDamageToContained(Real percentDamage) { Object *object = *it; - DEBUG_ASSERTCRASH( object, ("Contain list must not contain NULL element\n") ); + DEBUG_ASSERTCRASH( object, ("Contain list must not contain NULL element") ); // Calculate the damage to be inflicted on each unit. Real damage = object->getBodyModule()->getMaxHealth() * percentDamage; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Damage/TransitionDamageFX.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Damage/TransitionDamageFX.cpp index 9e1a2bb348..eb615d5060 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Damage/TransitionDamageFX.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Damage/TransitionDamageFX.cpp @@ -259,7 +259,7 @@ void TransitionDamageFX::onDelete( void ) static Coord3D getLocalEffectPos( const FXLocInfo *locInfo, Drawable *draw ) { - DEBUG_ASSERTCRASH( locInfo, ("getLocalEffectPos: locInfo is NULL\n") ); + DEBUG_ASSERTCRASH( locInfo, ("getLocalEffectPos: locInfo is NULL") ); if( locInfo->locType == FX_DAMAGE_LOC_TYPE_BONE && draw ) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp index 90ea8b23b2..8f9babb0b2 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/CrushDie.cpp @@ -165,7 +165,7 @@ void CrushDie::onDie( const DamageInfo * damageInfo ) if (!isDieApplicable(damageInfo)) return; - DEBUG_ASSERTCRASH(damageInfo->in.m_damageType == DAMAGE_CRUSH, ("this should only be used for crush damage\n")); + DEBUG_ASSERTCRASH(damageInfo->in.m_damageType == DAMAGE_CRUSH, ("this should only be used for crush damage")); if (damageInfo->in.m_damageType != DAMAGE_CRUSH) return; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/RebuildHoleExposeDie.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/RebuildHoleExposeDie.cpp index 2741cd86d6..2be2f2964e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/RebuildHoleExposeDie.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/RebuildHoleExposeDie.cpp @@ -163,7 +163,7 @@ void RebuildHoleExposeDie::onDie( const DamageInfo *damageInfo ) RebuildHoleBehaviorInterface *rhbi = RebuildHoleBehavior::getRebuildHoleBehaviorInterfaceFromObject( hole ); // sanity - DEBUG_ASSERTCRASH( rhbi, ("RebuildHoleExposeDie: No Rebuild Hole Behavior interface on hole\n") ); + DEBUG_ASSERTCRASH( rhbi, ("RebuildHoleExposeDie: No Rebuild Hole Behavior interface on hole") ); // start the rebuild process if( rhbi ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp index 6145c55afa..d3ccec412b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp @@ -905,7 +905,7 @@ void Locomotor::locoUpdate_moveTowardsAngle(Object* obj, Real goalAngle) } else { - DEBUG_ASSERTCRASH(m_template->m_appearance != LOCO_THRUST, ("THRUST should always have minspeeds!\n")); + DEBUG_ASSERTCRASH(m_template->m_appearance != LOCO_THRUST, ("THRUST should always have minspeeds!")); Coord3D desiredPos = *obj->getPosition(); desiredPos.x += Cos(goalAngle) * 1000.0f; desiredPos.y += Sin(goalAngle) * 1000.0f; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 0bb19f899d..06177a7459 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -438,7 +438,7 @@ Object::Object( const ThingTemplate *tt, const ObjectStatusMaskType &objectStatu { if( m_ai ) { - DEBUG_ASSERTCRASH( m_ai == NULL, ("%s has more than one AI module. This is illegal!\n", getTemplate()->getName().str()) ); + DEBUG_ASSERTCRASH( m_ai == NULL, ("%s has more than one AI module. This is illegal!", getTemplate()->getName().str()) ); } m_ai = ai; } @@ -446,7 +446,7 @@ Object::Object( const ThingTemplate *tt, const ObjectStatusMaskType &objectStatu static NameKeyType key_PhysicsUpdate = NAMEKEY("PhysicsBehavior"); if (newMod->getModuleNameKey() == key_PhysicsUpdate) { - DEBUG_ASSERTCRASH(m_physics == NULL, ("You should never have more than one Physics module (%s)\n",getTemplate()->getName().str())); + DEBUG_ASSERTCRASH(m_physics == NULL, ("You should never have more than one Physics module (%s)",getTemplate()->getName().str())); m_physics = (PhysicsBehavior*)newMod; } } @@ -1955,7 +1955,7 @@ void Object::kill( DamageType damageType, DeathType deathType ) damageInfo.in.m_kill = TRUE; // Triggers object to die no matter what. attemptDamage( &damageInfo ); - DEBUG_ASSERTCRASH(!damageInfo.out.m_noEffect, ("Attempting to kill an unKillable object (InactiveBody?)\n")); + DEBUG_ASSERTCRASH(!damageInfo.out.m_noEffect, ("Attempting to kill an unKillable object (InactiveBody?)")); } // end kill @@ -2503,7 +2503,7 @@ Bool Object::didEnter(const PolygonTrigger *pTrigger) const if (!didEnterOrExit()) return false; - DEBUG_ASSERTCRASH(!isKindOf(KINDOF_INERT), ("Asking whether an inert object entered or exited. This is invalid.\n")); + DEBUG_ASSERTCRASH(!isKindOf(KINDOF_INERT), ("Asking whether an inert object entered or exited. This is invalid.")); for (Int i=0; igetUpgradeTemplate(); - DEBUG_ASSERTCRASH( upgradeT, ("Undefined upgrade '%s' in player upgrade command\n", "UNKNOWN") ); + DEBUG_ASSERTCRASH( upgradeT, ("Undefined upgrade '%s' in player upgrade command", "UNKNOWN") ); // sanity if( upgradeT == NULL ) break; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp index 80d9eb972a..753be2c327 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp @@ -908,7 +908,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget ini->initFromINIMulti(nugget, p); - DEBUG_ASSERTCRASH(nugget->m_mass > 0.0f, ("Zero masses are not allowed for debris!\n")); + DEBUG_ASSERTCRASH(nugget->m_mass > 0.0f, ("Zero masses are not allowed for debris!")); ((ObjectCreationList*)instance)->addObjectCreationNugget(nugget); } @@ -1135,7 +1135,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget DUMPREAL(m_mass); objUp->setMass( m_mass ); } - DEBUG_ASSERTCRASH(objUp->getMass() > 0.0f, ("Zero masses are not allowed for obj!\n")); + DEBUG_ASSERTCRASH(objUp->getMass() > 0.0f, ("Zero masses are not allowed for obj!")); objUp->setExtraBounciness(m_extraBounciness); objUp->setExtraFriction(m_extraFriction); @@ -1357,7 +1357,7 @@ class GenericObjectCreationNugget : public ObjectCreationNugget tmpl = debrisTemplate; } - DEBUG_ASSERTCRASH(tmpl, ("Object %s not found\n",m_names[pick].str())); + DEBUG_ASSERTCRASH(tmpl, ("Object %s not found",m_names[pick].str())); if (!tmpl) continue; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index 25f50525c3..bec04efb04 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -1577,7 +1577,7 @@ PartitionData::~PartitionData() { //DEBUG_LOG(("remove pd %08lx from dirty list (%08lx %08lx)",this,m_prevDirty,m_nextDirty)); ThePartitionManager->removeFromDirtyModules(this); - //DEBUG_ASSERTCRASH(!ThePartitionManager->isInListDirtyModules(this), ("hmm\n")); + //DEBUG_ASSERTCRASH(!ThePartitionManager->isInListDirtyModules(this), ("hmm")); } } @@ -2153,7 +2153,7 @@ Int PartitionData::calcMaxCoiForShape(GeometryType geom, Real majorRadius, Real // { // #if defined(RTS_DEBUG) // Int chk = calcMaxCoiForShape(geom, majorRadius, minorRadius, false); -// DEBUG_ASSERTCRASH(chk <= 4, ("Small objects should be <= 4 cells, but I calced %s as %d\n",theObjName.str(),chk)); +// DEBUG_ASSERTCRASH(chk <= 4, ("Small objects should be <= 4 cells, but I calced %s as %d",theObjName.str(),chk)); // #endif // result = 4; // } @@ -3194,7 +3194,7 @@ void PartitionManager::calcRadiusVec() contain objects that are <= (curRadius * cellSize) distance away from cell (0,0). */ Int curRadius = calcMinRadius(cur); - DEBUG_ASSERTCRASH(curRadius <= m_maxGcoRadius, ("expected max of %d but got %d\n",m_maxGcoRadius,curRadius)); + DEBUG_ASSERTCRASH(curRadius <= m_maxGcoRadius, ("expected max of %d but got %d",m_maxGcoRadius,curRadius)); if (curRadius <= m_maxGcoRadius) m_radiusVec[curRadius].push_back(cur); } @@ -3207,7 +3207,7 @@ void PartitionManager::calcRadiusVec() total += m_radiusVec[i].size(); //DEBUG_LOG(("radius %d has %d entries",i,m_radiusVec[i].size())); } - DEBUG_ASSERTCRASH(total == (cx*2-1)*(cy*2-1),("expected %d, got %d\n",(cx*2-1)*(cy*2-1),total)); + DEBUG_ASSERTCRASH(total == (cx*2-1)*(cy*2-1),("expected %d, got %d",(cx*2-1)*(cy*2-1),total)); #endif } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 0c54f474ec..fa20205fab 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -4694,7 +4694,7 @@ void AIUpdateInterface::evaluateMoraleBonus( void ) // do we have nationalism ///@todo Find a better way to represent nationalism without hardcoding here (CBD) static const UpgradeTemplate *nationalismTemplate = TheUpgradeCenter->findUpgrade( "Upgrade_Nationalism" ); - DEBUG_ASSERTCRASH( nationalismTemplate != NULL, ("AIUpdateInterface::evaluateMoraleBonus - Nationalism upgrade not found\n") ); + DEBUG_ASSERTCRASH( nationalismTemplate != NULL, ("AIUpdateInterface::evaluateMoraleBonus - Nationalism upgrade not found") ); Player *player = us->getControllingPlayer(); if( player && player->hasUpgradeComplete( nationalismTemplate ) ) nationalism = TRUE; @@ -4702,7 +4702,7 @@ void AIUpdateInterface::evaluateMoraleBonus( void ) // do we have fanaticism ///@todo Find a better way to represent fanaticism without hardcoding here (MAL) static const UpgradeTemplate *fanaticismTemplate = TheUpgradeCenter->findUpgrade( "Upgrade_Fanaticism" ); - DEBUG_ASSERTCRASH( fanaticismTemplate != NULL, ("AIUpdateInterface::evaluateMoraleBonus - Fanaticism upgrade not found\n") ); + DEBUG_ASSERTCRASH( fanaticismTemplate != NULL, ("AIUpdateInterface::evaluateMoraleBonus - Fanaticism upgrade not found") ); if( player && player->hasUpgradeComplete( fanaticismTemplate ) ) fanaticism = TRUE; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp index b0ae960c67..7eddc22092 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp @@ -695,11 +695,11 @@ StateReturnType DozerActionDoActionState::update( void ) if( goalObject->isKindOf( KINDOF_BRIDGE_TOWER ) ) { BridgeTowerBehaviorInterface *btbi = BridgeTowerBehavior::getBridgeTowerBehaviorInterfaceFromObject( goalObject ); - DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower interface\n") ); + DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower interface") ); Object *bridgeObject = TheGameLogic->findObjectByID( btbi->getBridgeID() ); - DEBUG_ASSERTCRASH( bridgeObject, ("Unable to find bridge center object\n") ); + DEBUG_ASSERTCRASH( bridgeObject, ("Unable to find bridge center object") ); BridgeBehaviorInterface *bbi = BridgeBehavior::getBridgeBehaviorInterfaceFromObject( bridgeObject ); - DEBUG_ASSERTCRASH( bbi, ("Unable to find bridge interface from tower goal object during repair\n") ); + DEBUG_ASSERTCRASH( bbi, ("Unable to find bridge interface from tower goal object during repair") ); if( bbi->isScaffoldInMotion() == TRUE ) canHeal = FALSE; @@ -1823,10 +1823,10 @@ void DozerAIUpdate::privateRepair( Object *obj, CommandSourceType cmdSource ) //if( obj->isKindOf( KINDOF_BRIDGE_TOWER ) ) //{ // BridgeTowerBehaviorInterface *btbi = BridgeTowerBehavior::getBridgeTowerBehaviorInterfaceFromObject( obj ); - // DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower behavior interface\n") ); + // DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower behavior interface") ); // // Object *bridge = TheGameLogic->findObjectByID( btbi->getBridgeID() ); - // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object\n") ); + // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object") ); // if( BitIsSet( bridge->getStatusBits(), OBJECT_STATUS_UNDERGOING_REPAIR ) == TRUE ) // return; // @@ -1837,10 +1837,10 @@ void DozerAIUpdate::privateRepair( Object *obj, CommandSourceType cmdSource ) //if( obj->isKindOf( KINDOF_BRIDGE_TOWER ) ) //{ // BridgeTowerBehaviorInterface *btbi = BridgeTowerBehavior::getBridgeTowerBehaviorInterfaceFromObject( obj ); - // DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower behavior interface\n") ); + // DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower behavior interface") ); // // Object *bridge = TheGameLogic->findObjectByID( btbi->getBridgeID() ); - // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object\n") ); + // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object") ); // bridge->setStatus( OBJECT_STATUS_UNDERGOING_REPAIR ); // //} // end if @@ -1968,7 +1968,7 @@ void DozerAIUpdate::newTask( DozerTask task, Object *target ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); // sanity if( target == NULL ) @@ -2050,7 +2050,7 @@ Bool DozerAIUpdate::isTaskPending( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); return m_task[ task ].m_targetObjectID != 0 ? TRUE : FALSE; @@ -2077,7 +2077,7 @@ ObjectID DozerAIUpdate::getTaskTarget( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); return m_task[ task ].m_targetObjectID; @@ -2090,7 +2090,7 @@ void DozerAIUpdate::internalTaskComplete( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); // call the single method that gets called for completing and canceling tasks internalTaskCompleteOrCancelled( task ); @@ -2113,7 +2113,7 @@ void DozerAIUpdate::internalCancelTask( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); if(task < 0 || task >= DOZER_NUM_TASKS) return; //DAMNIT! You CANNOT assert and then not handle the damn error! The. Code. Must. Not. Crash. @@ -2197,9 +2197,9 @@ void DozerAIUpdate::internalTaskCompleteOrCancelled( DozerTask task ) // // // clear the repair bit from the bridge // BridgeTowerBehaviorInterface *btbi = BridgeTowerBehavior::getBridgeTowerBehaviorInterfaceFromObject( obj ); - // DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower behavior interface\n") ); + // DEBUG_ASSERTCRASH( btbi, ("Unable to find bridge tower behavior interface") ); // Object *bridge = TheGameLogic->findObjectByID( btbi->getBridgeID() ); - // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object\n") ); + // DEBUG_ASSERTCRASH( bridge, ("Unable to find bridge object") ); // bridge->clearStatus( OBJECT_STATUS_UNDERGOING_REPAIR ); // // } // end if diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp index 9d674bd737..a05b36a8cc 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp @@ -250,7 +250,7 @@ void POWTruckAIUpdate::setTask( POWTruckTask task, Object *taskObject ) m_targetID = taskObject->getID(); // mark this target as slated for pickup - DEBUG_ASSERTCRASH( taskObject->getAIUpdateInterface(), ("POWTruckAIUpdate::setTask - '%s' has no ai module\n", + DEBUG_ASSERTCRASH( taskObject->getAIUpdateInterface(), ("POWTruckAIUpdate::setTask - '%s' has no ai module", taskObject->getTemplate()->getName().str()) ); } // end if @@ -358,7 +358,7 @@ void POWTruckAIUpdate::updateWaiting( void ) // get our info Object *us = getObject(); AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateWaiting - '%s' has no ai\n", + DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateWaiting - '%s' has no ai", us->getTemplate()->getName().str()) ); // @@ -385,7 +385,7 @@ void POWTruckAIUpdate::updateFindTarget( void ) { // we never find targets when in manual ai mode - DEBUG_ASSERTCRASH( m_aiMode != MANUAL, ("POWTruckAIUpdate::updateFindTarget - We shouldn't be here with a manual ai mode\n") ); + DEBUG_ASSERTCRASH( m_aiMode != MANUAL, ("POWTruckAIUpdate::updateFindTarget - We shouldn't be here with a manual ai mode") ); if( m_aiMode == MANUAL ) return; @@ -399,7 +399,7 @@ void POWTruckAIUpdate::updateFindTarget( void ) // get our info Object *us = getObject(); AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateFindTarget - '%s' has no ai\n", + DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateFindTarget - '%s' has no ai", us->getTemplate()->getName().str()) ); // if we're full we should return to prison @@ -534,7 +534,7 @@ void POWTruckAIUpdate::updateReturnPrisoners( void ) { Object *us = getObject(); AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateReturnPrisoners - '%s' has no AI\n", + DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::updateReturnPrisoners - '%s' has no AI", us->getTemplate()->getName().str()) ); // get the prison we're returning to @@ -586,7 +586,7 @@ void POWTruckAIUpdate::doReturnPrisoners( void ) // start the prisoner return process Object *us = getObject(); AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::doReturnPrisoners - '%s' has no AI\n", + DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::doReturnPrisoners - '%s' has no AI", us->getTemplate()->getName().str()) ); ai->aiReturnPrisoners( prison, CMD_FROM_AI ); @@ -657,7 +657,7 @@ Object *POWTruckAIUpdate::findBestTarget( void ) // get our info const AIUpdateInterface *ai = us->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::findBestTarget- '%s' has no AI\n", + DEBUG_ASSERTCRASH( ai, ("POWTruckAIUpdate::findBestTarget- '%s' has no AI", us->getTemplate()->getName().str()) ); // scan all objects, there is no range @@ -727,7 +727,7 @@ static void putPrisonersInPrison( Object *obj, void *userData ) Object *prison = prisonUnloadData->destPrison; // sanity - DEBUG_ASSERTCRASH( prison, ("putPrisonersInPrison: NULL user data\n") ); + DEBUG_ASSERTCRASH( prison, ("putPrisonersInPrison: NULL user data") ); DEBUG_ASSERTCRASH( obj->getContainedBy() != NULL, ("putPrisonersInPrison: Prisoner '%s' is not contained by anything, it should be contained by a POW truck\n", obj->getTemplate()->getName().str()) ); @@ -771,12 +771,12 @@ void POWTruckAIUpdate::unloadPrisonersToPrison( Object *prison ) ContainModuleInterface *truckContain = us->getContain(); // sanity - DEBUG_ASSERTCRASH( prison->getContain(), ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain\n", + DEBUG_ASSERTCRASH( prison->getContain(), ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain", prison->getTemplate()->getName().str()) ); DEBUG_ASSERTCRASH( prison->getContain()->asOpenContain(), ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain\n", prison->getTemplate()->getName().str()) ); - DEBUG_ASSERTCRASH( truckContain, ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain\n", + DEBUG_ASSERTCRASH( truckContain, ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain", us->getTemplate()->getName().str()) ); DEBUG_ASSERTCRASH( truckContain->asOpenContain(), ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain\n", diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp index c0d1e43c41..dd838175ca 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp @@ -227,7 +227,7 @@ UpdateSleepTime RailedTransportAIUpdate::update( void ) Waypoint *waypoint = TheTerrainLogic->getWaypointByID( m_path[ m_currentPath ].endWaypointID ); // sanity - DEBUG_ASSERTCRASH( waypoint, ("RailedTransportAIUpdate: Invalid target waypoint\n") ); + DEBUG_ASSERTCRASH( waypoint, ("RailedTransportAIUpdate: Invalid target waypoint") ); if (waypoint) { @@ -324,7 +324,7 @@ void RailedTransportAIUpdate::privateExecuteRailedTransport( CommandSourceType c // find the start waypoint for our current path Waypoint *startWaypoint = TheTerrainLogic->getWaypointByID( m_path[ m_currentPath ].startWaypointID ); - DEBUG_ASSERTCRASH( startWaypoint, ("RailedTransportAIUpdate: Start waypoint not found\n") ); + DEBUG_ASSERTCRASH( startWaypoint, ("RailedTransportAIUpdate: Start waypoint not found") ); // follow this waypoint path aiFollowWaypointPath( startWaypoint, CMD_FROM_AI ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp index 262e50780f..63359dc1f2 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp @@ -1233,7 +1233,7 @@ void alignToTerrain( Real angle, const Coord3D& pos, const Coord3D& normal, Matr x.normalize(); } - DEBUG_ASSERTCRASH(fabs(x.x*z.x + x.y*z.y + x.z*z.z)<0.0001,("dot is not zero\n")); + DEBUG_ASSERTCRASH(fabs(x.x*z.x + x.y*z.y + x.z*z.z)<0.0001,("dot is not zero")); // now computing the y vector is trivial. y.crossProduct( &z, &x, &y ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp index 6f379f1ed8..7c58e3a506 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp @@ -612,7 +612,7 @@ void WorkerAIUpdate::newTask( DozerTask task, Object* target ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); // sanity if( target == NULL ) @@ -707,7 +707,7 @@ Bool WorkerAIUpdate::isTaskPending( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); return m_task[ task ].m_targetObjectID != 0 ? TRUE : FALSE; @@ -734,7 +734,7 @@ ObjectID WorkerAIUpdate::getTaskTarget( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); return m_task[ task ].m_targetObjectID; @@ -747,7 +747,7 @@ void WorkerAIUpdate::internalTaskComplete( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); // call the single method that gets called for completing and canceling tasks internalTaskCompleteOrCancelled( task ); @@ -770,7 +770,7 @@ void WorkerAIUpdate::internalCancelTask( DozerTask task ) { // sanity - DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'\n", task) ); + DEBUG_ASSERTCRASH( task >= 0 && task < DOZER_NUM_TASKS, ("Illegal dozer task '%d'", task) ); if(task < 0 || task >= DOZER_NUM_TASKS) return; //DAMNIT! You CANNOT assert and then not handle the damn error! The. Code. Must. Not. Crash. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp index c56077a405..bd5b61dbc0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp @@ -410,7 +410,7 @@ void BattlePlanUpdate::createVisionObject() // get template of object to create const ThingTemplate *tt = TheThingFactory->findTemplate( data->m_visionObjectName ); - DEBUG_ASSERTCRASH( tt, ("BattlePlanUpdate::setStatus - Invalid vision object name '%s'\n", + DEBUG_ASSERTCRASH( tt, ("BattlePlanUpdate::setStatus - Invalid vision object name '%s'", data->m_visionObjectName.str()) ); if (!tt) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp index 149b5fb0c1..5022afa47c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/PrisonDockUpdate.cpp @@ -73,10 +73,10 @@ Bool PrisonDockUpdate::action( Object *docker, Object *drone ) // unload the prisoners from the docker into us AIUpdateInterface *ai = docker->getAIUpdateInterface(); - DEBUG_ASSERTCRASH( ai, ("'%s' docking with prison has no AI\n", + DEBUG_ASSERTCRASH( ai, ("'%s' docking with prison has no AI", docker->getTemplate()->getName().str()) ); POWTruckAIUpdateInterface *powAI = ai->getPOWTruckAIUpdateInterface(); - DEBUG_ASSERTCRASH( powAI, ("'s' docking with prison has no POW Truck AI\n", + DEBUG_ASSERTCRASH( powAI, ("'s' docking with prison has no POW Truck AI", docker->getTemplate()->getName().str()) ); powAI->unloadPrisonersToPrison( getObject() ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RailedTransportDockUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RailedTransportDockUpdate.cpp index 45fbfb2348..56c474f93e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RailedTransportDockUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/RailedTransportDockUpdate.cpp @@ -466,7 +466,7 @@ void RailedTransportDockUpdate::unloadNext( void ) // better be an open container ContainModuleInterface *contain = us->getContain(); OpenContain *openContain = contain ? contain->asOpenContain() : NULL; - DEBUG_ASSERTCRASH( openContain, ("Unloading next from railed transport, but '%s' has no open container\n", + DEBUG_ASSERTCRASH( openContain, ("Unloading next from railed transport, but '%s' has no open container", us->getTemplate()->getName().str()) ); // get the first contained object diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/EMPUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/EMPUpdate.cpp index 3e039a466d..9beb7af79e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/EMPUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/EMPUpdate.cpp @@ -86,7 +86,7 @@ EMPUpdate::EMPUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModul if ( data ) { //SANITY - DEBUG_ASSERTCRASH( TheGameLogic, ("EMPUpdate::EMPUpdate - TheGameLogic is NULL\n" ) ); + DEBUG_ASSERTCRASH( TheGameLogic, ("EMPUpdate::EMPUpdate - TheGameLogic is NULL" ) ); UnsignedInt now = TheGameLogic->getFrame(); m_currentScale = data->m_startScale; @@ -102,13 +102,13 @@ EMPUpdate::EMPUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateModul getObject()->setOrientation(GameLogicRandomValueReal(-PI,PI)); - DEBUG_ASSERTCRASH( m_tintEnvPlayFrame < m_dieFrame, ("EMPUpdate::EMPUpdate - you cant play fade after death\n" ) ); + DEBUG_ASSERTCRASH( m_tintEnvPlayFrame < m_dieFrame, ("EMPUpdate::EMPUpdate - you cant play fade after death" ) ); return; } //SANITY - DEBUG_ASSERTCRASH( data, ("EMPUpdate::EMPUpdate - getEMPUpdateModuleData is NULL\n" ) ); + DEBUG_ASSERTCRASH( data, ("EMPUpdate::EMPUpdate - getEMPUpdateModuleData is NULL" ) ); m_currentScale = 1.0f; m_dieFrame = 0; m_tintEnvFadeFrames = 0; @@ -420,7 +420,7 @@ LeafletDropBehavior::LeafletDropBehavior( Thing *thing, const ModuleData* module if ( data ) { //SANITY - DEBUG_ASSERTCRASH( TheGameLogic, ("LeafletDropBehavior::LeafletDropBehavior - TheGameLogic is NULL\n" ) ); + DEBUG_ASSERTCRASH( TheGameLogic, ("LeafletDropBehavior::LeafletDropBehavior - TheGameLogic is NULL" ) ); UnsignedInt now = TheGameLogic->getFrame(); m_startFrame = now + data->m_delayFrames; @@ -428,7 +428,7 @@ LeafletDropBehavior::LeafletDropBehavior( Thing *thing, const ModuleData* module } //SANITY - DEBUG_ASSERTCRASH( data, ("LeafletDropBehavior::LeafletDropBehavior - getLeafletDropBehaviorModuleData is NULL\n" ) ); + DEBUG_ASSERTCRASH( data, ("LeafletDropBehavior::LeafletDropBehavior - getLeafletDropBehaviorModuleData is NULL" ) ); m_startFrame = TheGameLogic->getFrame() + 1; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HelicopterSlowDeathUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HelicopterSlowDeathUpdate.cpp index f5c260738b..58b34242eb 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HelicopterSlowDeathUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HelicopterSlowDeathUpdate.cpp @@ -353,7 +353,7 @@ UpdateSleepTime HelicopterSlowDeathBehavior::update( void ) // get the physics update module PhysicsBehavior *physics = copter->getPhysics(); - DEBUG_ASSERTCRASH( physics, ("HelicopterSlowDeathBehavior: object '%s' does not have a physics module\n", + DEBUG_ASSERTCRASH( physics, ("HelicopterSlowDeathBehavior: object '%s' does not have a physics module", copter->getTemplate()->getName().str()) ); // diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp index ce04eaa70e..a3733d9753 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp @@ -318,7 +318,7 @@ void PhysicsBehavior::applyForce( const Coord3D *force ) { // TheSuperHackers @info helmutbuhler 06/05/2025 This debug mutates the code to become CRC incompatible #if defined(RTS_DEBUG) || !RETAIL_COMPATIBLE_CRC - DEBUG_ASSERTCRASH(!(_isnan(force->x) || _isnan(force->y) || _isnan(force->z)), ("PhysicsBehavior::applyForce force NAN!\n")); + DEBUG_ASSERTCRASH(!(_isnan(force->x) || _isnan(force->y) || _isnan(force->z)), ("PhysicsBehavior::applyForce force NAN!")); #endif if (_isnan(force->x) || _isnan(force->y) || _isnan(force->z)) { return; @@ -340,8 +340,8 @@ void PhysicsBehavior::applyForce( const Coord3D *force ) m_accel.y += modForce.y * massInv; m_accel.z += modForce.z * massInv; - //DEBUG_ASSERTCRASH(!(_isnan(m_accel.x) || _isnan(m_accel.y) || _isnan(m_accel.z)), ("PhysicsBehavior::applyForce accel NAN!\n")); - //DEBUG_ASSERTCRASH(!(_isnan(m_vel.x) || _isnan(m_vel.y) || _isnan(m_vel.z)), ("PhysicsBehavior::applyForce vel NAN!\n")); + //DEBUG_ASSERTCRASH(!(_isnan(m_accel.x) || _isnan(m_accel.y) || _isnan(m_accel.z)), ("PhysicsBehavior::applyForce accel NAN!")); + //DEBUG_ASSERTCRASH(!(_isnan(m_vel.x) || _isnan(m_vel.y) || _isnan(m_vel.z)), ("PhysicsBehavior::applyForce vel NAN!")); //DEBUG_ASSERTCRASH(fabs(force->z) < 3, ("unlikely z-force")); #ifdef SLEEPY_PHYSICS if (getFlag(IS_IN_UPDATE)) @@ -1417,7 +1417,7 @@ void PhysicsBehavior::onCollide( Object *other, const Coord3D *loc, const Coord3 force.x = factor * delta.x / dist; force.y = factor * delta.y / dist; force.z = factor * delta.z / dist; // will be zero for 2d case. - DEBUG_ASSERTCRASH(!(_isnan(force.x) || _isnan(force.y) || _isnan(force.z)), ("PhysicsBehavior::onCollide force NAN!\n")); + DEBUG_ASSERTCRASH(!(_isnan(force.x) || _isnan(force.y) || _isnan(force.z)), ("PhysicsBehavior::onCollide force NAN!")); applyForce( &force ); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp index f14885058d..8e3276935b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp @@ -879,7 +879,7 @@ UpdateSleepTime ProductionUpdate::update( void ) { // there is no exit interface, this is an error - DEBUG_ASSERTCRASH( 0, ("Cannot create '%s', there is no ExitUpdate interface defined for producer object '%s'\n", + DEBUG_ASSERTCRASH( 0, ("Cannot create '%s', there is no ExitUpdate interface defined for producer object '%s'", production->m_objectToProduce->getName().str(), creationBuilding->getTemplate()->getName().str()) ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 973e50d2b6..116b09ce11 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -778,7 +778,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate //end -extraLogging //CRCDEBUG_LOG(("WeaponTemplate::fireWeaponTemplate() from %s", DescribeObject(sourceObj).str())); - DEBUG_ASSERTCRASH(specificBarrelToUse >= 0, ("specificBarrelToUse should no longer be -1\n")); + DEBUG_ASSERTCRASH(specificBarrelToUse >= 0, ("specificBarrelToUse should no longer be -1")); if (sourceObj == NULL || (victimObj == NULL && victimPos == NULL)) { @@ -859,7 +859,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate Real attackRangeSqr = sqr(getAttackRange(bonus)); if (distSqr > attackRangeSqr) { - //DEBUG_ASSERTCRASH(distSqr < 5*5 || distSqr < attackRangeSqr*1.2f, ("*** victim is out of range (%f vs %f) of this weapon -- why did we attempt to fire?\n",sqrtf(distSqr),sqrtf(attackRangeSqr))); + //DEBUG_ASSERTCRASH(distSqr < 5*5 || distSqr < attackRangeSqr*1.2f, ("*** victim is out of range (%f vs %f) of this weapon -- why did we attempt to fire?",sqrtf(distSqr),sqrtf(attackRangeSqr))); //-extraLogging #if defined(RTS_DEBUG) @@ -881,7 +881,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate if (distSqr < minAttackRangeSqr-0.5f && !isProjectileDetonation) #endif { - DEBUG_ASSERTCRASH(distSqr > minAttackRangeSqr*0.8f, ("*** victim is closer than min attack range (%f vs %f) of this weapon -- why did we attempt to fire?\n",sqrtf(distSqr),sqrtf(minAttackRangeSqr))); + DEBUG_ASSERTCRASH(distSqr > minAttackRangeSqr*0.8f, ("*** victim is closer than min attack range (%f vs %f) of this weapon -- why did we attempt to fire?",sqrtf(distSqr),sqrtf(minAttackRangeSqr))); //-extraLogging #if defined(RTS_DEBUG) @@ -1282,7 +1282,7 @@ void WeaponTemplate::dealDamageInternal(ObjectID sourceID, ObjectID victimID, co Real secondaryDamage = getSecondaryDamage(bonus); Int affects = getAffectsMask(); - DEBUG_ASSERTCRASH(secondaryRadius >= primaryRadius || secondaryRadius == 0.0f, ("secondary radius should be >= primary radius (or zero)\n")); + DEBUG_ASSERTCRASH(secondaryRadius >= primaryRadius || secondaryRadius == 0.0f, ("secondary radius should be >= primary radius (or zero)")); Real primaryRadiusSqr = sqr(primaryRadius); Real radius = max(primaryRadius, secondaryRadius); @@ -1546,7 +1546,7 @@ const WeaponTemplate *WeaponStore::findWeaponTemplate( AsciiString name ) const if (stricmp(name.str(), "None") == 0) return NULL; const WeaponTemplate * wt = findWeaponTemplatePrivate( TheNameKeyGenerator->nameToKey( name ) ); - DEBUG_ASSERTCRASH(wt != NULL, ("Weapon %s not found!\n",name.str())); + DEBUG_ASSERTCRASH(wt != NULL, ("Weapon %s not found!",name.str())); return wt; } @@ -2013,7 +2013,7 @@ Bool Weapon::computeApproachTarget(const Object *source, const Object *target, c if (minAttackRange > PATHFIND_CELL_SIZE_F && dist < minAttackRange) { // We aret too close, so move away from the target. - DEBUG_ASSERTCRASH((minAttackRange<0.9f*getAttackRange(source)), ("Min attack range is too near attack range.\n")); + DEBUG_ASSERTCRASH((minAttackRange<0.9f*getAttackRange(source)), ("Min attack range is too near attack range.")); // Recompute dir, cause if the bounding spheres touch, it will be 0. Coord3D srcPos = *source->getPosition(); dir.x = srcPos.x-targetPos->x; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp index f76dcf5ffc..34928224ea 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp @@ -5386,7 +5386,7 @@ void ScriptEngine::reset( void ) m_allObjectTypeLists.erase(it); } } - DEBUG_ASSERTCRASH( m_allObjectTypeLists.empty() == TRUE, ("ScriptEngine::reset - m_allObjectTypeLists should be empty but is not!\n") ); + DEBUG_ASSERTCRASH( m_allObjectTypeLists.empty() == TRUE, ("ScriptEngine::reset - m_allObjectTypeLists should be empty but is not!") ); // reset all the reveals that have taken place. m_namedReveals.clear(); @@ -6134,7 +6134,7 @@ Int ScriptEngine::allocateCounter( const AsciiString& name) return i; } } - DEBUG_ASSERTCRASH(m_numCountersgetNumParameters() >= 3, ("Not enough parameters.\n")); - DEBUG_ASSERTCRASH(pCondition->getConditionType() == Condition::COUNTER, ("Wrong condition.\n")); + DEBUG_ASSERTCRASH(pCondition->getNumParameters() >= 3, ("Not enough parameters.")); + DEBUG_ASSERTCRASH(pCondition->getConditionType() == Condition::COUNTER, ("Wrong condition.")); Int counterNdx = pCondition->getParameter(0)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pCondition->getParameter(0)->getString()); @@ -6357,7 +6357,7 @@ Bool ScriptEngine::evaluateCounter( Condition *pCondition ) //------------------------------------------------------------------------------------------------- void ScriptEngine::setCounter( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); Int counterNdx = pAction->getParameter(0)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pAction->getParameter(0)->getString()); @@ -6380,7 +6380,7 @@ void ScriptEngine::setFade( ScriptAction *pAction ) } #endif - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 5, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 5, ("Not enough parameters.")); switch (pAction->getActionType()) { default: m_fade = FADE_NONE; return; case ScriptAction::CAMERA_FADE_ADD: m_fade = FADE_ADD; break; @@ -6406,7 +6406,7 @@ void ScriptEngine::setFade( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::setSway( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 5, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 5, ("Not enough parameters.")); ++m_breezeInfo.m_breezeVersion; m_breezeInfo.m_direction = pAction->getParameter(0)->getReal(); m_breezeInfo.m_directionVec.x = Sin(m_breezeInfo.m_direction); @@ -6425,7 +6425,7 @@ void ScriptEngine::setSway( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::addCounter( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); Int value = pAction->getParameter(0)->getInt(); Int counterNdx = pAction->getParameter(1)->getInt(); if (counterNdx == 0) { @@ -6440,7 +6440,7 @@ void ScriptEngine::addCounter( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::subCounter( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); Int value = pAction->getParameter(0)->getInt(); Int counterNdx = pAction->getParameter(1)->getInt(); if (counterNdx == 0) { @@ -6455,8 +6455,8 @@ void ScriptEngine::subCounter( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- Bool ScriptEngine::evaluateFlag( Condition *pCondition ) { - DEBUG_ASSERTCRASH(pCondition->getNumParameters() >= 2, ("Not enough parameters.\n")); - DEBUG_ASSERTCRASH(pCondition->getConditionType() == Condition::FLAG, ("Wrong condition.\n")); + DEBUG_ASSERTCRASH(pCondition->getNumParameters() >= 2, ("Not enough parameters.")); + DEBUG_ASSERTCRASH(pCondition->getConditionType() == Condition::FLAG, ("Wrong condition.")); Int flagNdx = pCondition->getParameter(0)->getInt(); if (flagNdx == 0) { flagNdx = allocateFlag(pCondition->getParameter(0)->getString()); @@ -6484,7 +6484,7 @@ Bool ScriptEngine::evaluateFlag( Condition *pCondition ) //------------------------------------------------------------------------------------------------- void ScriptEngine::setFlag( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); Int flagNdx = pAction->getParameter(0)->getInt(); if (flagNdx == 0) { flagNdx = allocateFlag(pAction->getParameter(0)->getString()); @@ -6547,7 +6547,7 @@ const AttackPriorityInfo *ScriptEngine::getAttackInfo(const AsciiString& name) //------------------------------------------------------------------------------------------------- void ScriptEngine::setPriorityThing( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 3, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 3, ("Not enough parameters.")); AsciiString typeArgument = pAction->getParameter(1)->getString(); @@ -6623,7 +6623,7 @@ void ScriptEngine::setPriorityThing( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::setPriorityKind( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 3, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 3, ("Not enough parameters.")); AttackPriorityInfo *info = findAttackInfo(pAction->getParameter(0)->getString(), true); if (info==NULL) { AppendDebugMessage("***Error allocating attack priority set - fix or raise limit. ***", false); @@ -6647,7 +6647,7 @@ void ScriptEngine::setPriorityKind( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::setPriorityDefault( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); AttackPriorityInfo *info = findAttackInfo(pAction->getParameter(0)->getString(), true); if (info==NULL) { AppendDebugMessage("***Error allocating attack priority set - fix or raise limit. ***", false); @@ -6712,8 +6712,8 @@ void ScriptEngine::removeObjectTypes(ObjectTypes *typesToRemove) //------------------------------------------------------------------------------------------------- Bool ScriptEngine::evaluateTimer( Condition *pCondition ) { - DEBUG_ASSERTCRASH(pCondition->getNumParameters() >= 1, ("Not enough parameters.\n")); - DEBUG_ASSERTCRASH(pCondition->getConditionType() == Condition::TIMER_EXPIRED, ("Wrong condition.\n")); + DEBUG_ASSERTCRASH(pCondition->getNumParameters() >= 1, ("Not enough parameters.")); + DEBUG_ASSERTCRASH(pCondition->getConditionType() == Condition::TIMER_EXPIRED, ("Wrong condition.")); Int counterNdx = pCondition->getParameter(0)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pCondition->getParameter(0)->getString()); @@ -6732,7 +6732,7 @@ Bool ScriptEngine::evaluateTimer( Condition *pCondition ) //------------------------------------------------------------------------------------------------- void ScriptEngine::setTimer( ScriptAction *pAction, Bool millisecondTimer, Bool random ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); Int counterNdx = pAction->getParameter(0)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pAction->getParameter(0)->getString()); @@ -6761,7 +6761,7 @@ void ScriptEngine::setTimer( ScriptAction *pAction, Bool millisecondTimer, Bool //------------------------------------------------------------------------------------------------- void ScriptEngine::pauseTimer( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.")); Int counterNdx = pAction->getParameter(0)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pAction->getParameter(0)->getString()); @@ -6775,7 +6775,7 @@ void ScriptEngine::pauseTimer( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::restartTimer( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.")); Int counterNdx = pAction->getParameter(0)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pAction->getParameter(0)->getString()); @@ -6791,7 +6791,7 @@ void ScriptEngine::restartTimer( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::adjustTimer( ScriptAction *pAction, Bool millisecondTimer, Bool add) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 2, ("Not enough parameters.")); Int counterNdx = pAction->getParameter(1)->getInt(); if (counterNdx == 0) { counterNdx = allocateCounter(pAction->getParameter(1)->getString()); @@ -6815,7 +6815,7 @@ void ScriptEngine::adjustTimer( ScriptAction *pAction, Bool millisecondTimer, Bo //------------------------------------------------------------------------------------------------- void ScriptEngine::enableScript( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.")); ScriptGroup *pGroup = findGroup(pAction->getParameter(0)->getString()); if (pGroup) { pGroup->setActive(true); @@ -6831,7 +6831,7 @@ void ScriptEngine::enableScript( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::disableScript( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.")); Script *pScript = findScript(pAction->getParameter(0)->getString()); if (pScript) { pScript->setActive(false); @@ -6847,7 +6847,7 @@ void ScriptEngine::disableScript( ScriptAction *pAction ) //------------------------------------------------------------------------------------------------- void ScriptEngine::callSubroutine( ScriptAction *pAction ) { - DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.\n")); + DEBUG_ASSERTCRASH(pAction->getNumParameters() >= 1, ("Not enough parameters.")); AsciiString scriptName = pAction->getParameter(0)->getString(); Script *pScript; ScriptGroup *pGroup = findGroup(scriptName); @@ -7688,9 +7688,9 @@ void ScriptEngine::executeScripts( Script *pScriptHead ) //------------------------------------------------------------------------------------------------- const ActionTemplate * ScriptEngine::getActionTemplate( Int ndx ) { - DEBUG_ASSERTCRASH(ndx >= 0 && ndx < ScriptAction::NUM_ITEMS, ("Out of range.\n")); + DEBUG_ASSERTCRASH(ndx >= 0 && ndx < ScriptAction::NUM_ITEMS, ("Out of range.")); if (ndx <0 || ndx >= ScriptAction::NUM_ITEMS) ndx = 0; - DEBUG_ASSERTCRASH (!m_actionTemplates[ndx].getName().isEmpty(), ("Need to initialize action enum=%d.\n", ndx)); + DEBUG_ASSERTCRASH (!m_actionTemplates[ndx].getName().isEmpty(), ("Need to initialize action enum=%d.", ndx)); return &m_actionTemplates[ndx]; } // end getActionTemplate @@ -7700,9 +7700,9 @@ const ActionTemplate * ScriptEngine::getActionTemplate( Int ndx ) //------------------------------------------------------------------------------------------------- const ConditionTemplate * ScriptEngine::getConditionTemplate( Int ndx ) { - DEBUG_ASSERTCRASH(ndx >= 0 && ndx < ScriptAction::NUM_ITEMS, ("Out of range.\n")); + DEBUG_ASSERTCRASH(ndx >= 0 && ndx < ScriptAction::NUM_ITEMS, ("Out of range.")); if (ndx <0 || ndx >= Condition::NUM_ITEMS) ndx = 0; - DEBUG_ASSERTCRASH (!m_conditionTemplates[ndx].getName().isEmpty(), ("Need to initialize Condition enum=%d.\n", ndx)); + DEBUG_ASSERTCRASH (!m_conditionTemplates[ndx].getName().isEmpty(), ("Need to initialize Condition enum=%d.", ndx)); return &m_conditionTemplates[ndx]; } // end getConditionTemplate @@ -8201,7 +8201,7 @@ void SequentialScript::xfer( Xfer *xfer ) xfer->xferAsciiString( &scriptName ); // script pointer - DEBUG_ASSERTCRASH( m_scriptToExecuteSequentially == NULL, ("SequentialScript::xfer - m_scripttoExecuteSequentially\n") ); + DEBUG_ASSERTCRASH( m_scriptToExecuteSequentially == NULL, ("SequentialScript::xfer - m_scripttoExecuteSequentially") ); // find script m_scriptToExecuteSequentially = const_cast(TheScriptEngine->findScriptByName(scriptName)); @@ -8539,7 +8539,7 @@ static void xferListAsciiString( Xfer *xfer, ListAsciiString *list ) { // sanity - DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiString - Invalid parameters\n") ); + DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiString - Invalid parameters") ); // version XferVersion currentVersion = 1; @@ -8602,7 +8602,7 @@ static void xferListAsciiStringUINT( Xfer *xfer, ListAsciiStringUINT *list ) { // sanity - DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiStringUINT - Invalid parameters\n") ); + DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiStringUINT - Invalid parameters") ); // version XferVersion currentVersion = 1; @@ -8677,7 +8677,7 @@ static void xferListAsciiStringObjectID( Xfer *xfer, ListAsciiStringObjectID *li { // sanity - DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiStringObjectID - Invalid parameters\n") ); + DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiStringObjectID - Invalid parameters") ); // version XferVersion currentVersion = 1; @@ -8752,7 +8752,7 @@ static void xferListAsciiStringCoord3D( Xfer *xfer, ListAsciiStringCoord3D *list { // sanity - DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiStringCoord3D - Invalid parameters\n") ); + DEBUG_ASSERTCRASH( list != NULL, ("xferListAsciiStringCoord3D - Invalid parameters") ); // version XferVersion currentVersion = 1; @@ -10300,7 +10300,7 @@ static void _initVTune() { VTPause = (VTProc)::GetProcAddress(st_vTuneDLL, "VTPause"); VTResume = (VTProc)::GetProcAddress(st_vTuneDLL, "VTResume"); - DEBUG_ASSERTCRASH(VTPause != NULL && VTResume != NULL, ("VTuneAPI procs not found!\n")); + DEBUG_ASSERTCRASH(VTPause != NULL && VTResume != NULL, ("VTuneAPI procs not found!")); } else { @@ -10315,7 +10315,7 @@ static void _initVTune() if (VTPause) VTPause(); // only complain about it being missing if they were expecting it to be present - DEBUG_ASSERTCRASH(st_vTuneDLL != NULL, ("VTuneAPI DLL not found!\n")); + DEBUG_ASSERTCRASH(st_vTuneDLL != NULL, ("VTuneAPI DLL not found!")); } else { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 271698acac..78a0df6582 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -326,7 +326,7 @@ void GameLogic::destroyAllObjectsImmediate() // process the destroy list immediately processDestroyList(); - DEBUG_ASSERTCRASH( m_objList == NULL, ("destroyAllObjectsImmediate: Object list not cleared\n") ); + DEBUG_ASSERTCRASH( m_objList == NULL, ("destroyAllObjectsImmediate: Object list not cleared") ); } // end destroyAllObjectsImmediate @@ -519,7 +519,7 @@ static Object * placeObjectAtPosition(Int slotNum, AsciiString objectTemplateNam DEBUG_ASSERTCRASH(btt, ("TheThingFactory didn't find a template in placeObjectAtPosition()") ); Object *obj = TheThingFactory->newObject( btt, pPlayer->getDefaultTeam() ); - DEBUG_ASSERTCRASH(obj, ("TheThingFactory didn't give me a valid Object for player %d's (%ls) starting building\n", + DEBUG_ASSERTCRASH(obj, ("TheThingFactory didn't give me a valid Object for player %d's (%ls) starting building", slotNum, pTemplate->getDisplayName().str())); if (obj) { @@ -571,7 +571,7 @@ static void placeNetworkBuildingsForPlayer(Int slotNum, const GameSlot *pSlot, P Waypoint *waypoint = findNamedWaypoint(waypointName); Waypoint *rallyWaypoint = findNamedWaypoint(rallyWaypointName); - DEBUG_ASSERTCRASH(waypoint, ("Player %d has no starting waypoint (Player_%d_Start)\n", slotNum, startPos)); + DEBUG_ASSERTCRASH(waypoint, ("Player %d has no starting waypoint (Player_%d_Start)", slotNum, startPos)); if (!waypoint) return; @@ -580,7 +580,7 @@ static void placeNetworkBuildingsForPlayer(Int slotNum, const GameSlot *pSlot, P AsciiString buildingTemplateName = pTemplate->getStartingBuilding(); - DEBUG_ASSERTCRASH(!buildingTemplateName.isEmpty(), ("no starting building type for player %d (playertemplate %ls)\n", + DEBUG_ASSERTCRASH(!buildingTemplateName.isEmpty(), ("no starting building type for player %d (playertemplate %ls)", slotNum, pTemplate->getDisplayName().str())); if (buildingTemplateName.isEmpty()) return; @@ -776,7 +776,7 @@ static void populateRandomSideAndColor( GameInfo *game ) DEBUG_LOG(("Player %d has playerTemplate index %d", i, playerTemplateIdx)); while (playerTemplateIdx != PLAYERTEMPLATE_OBSERVER && (playerTemplateIdx < 0 || playerTemplateIdx >= ThePlayerTemplateStore->getPlayerTemplateCount())) { - DEBUG_ASSERTCRASH(playerTemplateIdx == PLAYERTEMPLATE_RANDOM, ("Non-random bad playerTemplate %d in slot %d\n", playerTemplateIdx, i)); + DEBUG_ASSERTCRASH(playerTemplateIdx == PLAYERTEMPLATE_RANDOM, ("Non-random bad playerTemplate %d in slot %d", playerTemplateIdx, i)); #ifdef MORE_RANDOM // our RNG is basically shit -- horribly nonrandom at the start of the sequence. // get a few values at random to get rid of the dreck. @@ -809,7 +809,7 @@ static void populateRandomSideAndColor( GameInfo *game ) Int colorIdx = slot->getColor(); if (colorIdx < 0 || colorIdx >= TheMultiplayerSettings->getNumColors()) { - DEBUG_ASSERTCRASH(colorIdx == -1, ("Non-random bad color %d in slot %d\n", colorIdx, i)); + DEBUG_ASSERTCRASH(colorIdx == -1, ("Non-random bad color %d in slot %d", colorIdx, i)); while (colorIdx == -1) { colorIdx = GameLogicRandomValue(0, TheMultiplayerSettings->getNumColors()-1); @@ -908,7 +908,7 @@ static void populateRandomStartPosition( GameInfo *game ) Int posIdx = slot->getStartPos(); if (posIdx < 0 || posIdx >= numPlayers) { - DEBUG_ASSERTCRASH(posIdx == -1, ("Non-random bad start position %d in slot %d\n", posIdx, i)); + DEBUG_ASSERTCRASH(posIdx == -1, ("Non-random bad start position %d in slot %d", posIdx, i)); if (hasStartSpotBeenPicked) { // pick the farthest spot away @@ -943,7 +943,7 @@ static void populateRandomStartPosition( GameInfo *game ) } } } - DEBUG_ASSERTCRASH(farthestIndex >= 0, ("Couldn't find a farthest spot!\n")); + DEBUG_ASSERTCRASH(farthestIndex >= 0, ("Couldn't find a farthest spot!")); slot->setStartPos(farthestIndex); taken[farthestIndex] = TRUE; } @@ -980,7 +980,7 @@ static void populateRandomStartPosition( GameInfo *game ) Int posIdx = slot->getStartPos(); if (posIdx >= 0 && posIdx < numPlayers) continue; //position already assigned - DEBUG_ASSERTCRASH(posIdx == -1, ("Non-random bad start position %d in slot %d\n", posIdx, i)); + DEBUG_ASSERTCRASH(posIdx == -1, ("Non-random bad start position %d in slot %d", posIdx, i)); //choose a starting position Int team = slot->getTeamNumber(); @@ -1034,7 +1034,7 @@ static void populateRandomStartPosition( GameInfo *game ) } } //for posInx - DEBUG_ASSERTCRASH(farthestIndex >= 0, ("Couldn't find a farthest spot!\n")); + DEBUG_ASSERTCRASH(farthestIndex >= 0, ("Couldn't find a farthest spot!")); slot->setStartPos(farthestIndex); taken[farthestIndex] = TRUE; if( team > -1 ) @@ -1053,7 +1053,7 @@ static void populateRandomStartPosition( GameInfo *game ) closestIdx = n; } } //for n - DEBUG_ASSERTCRASH( closestDist < FLT_MAX, ("Couldn't find a closest starting positon!\n")); + DEBUG_ASSERTCRASH( closestDist < FLT_MAX, ("Couldn't find a closest starting positon!")); slot->setStartPos(closestIdx); taken[closestIdx] = TRUE; } @@ -1316,7 +1316,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) if(m_loadScreen) updateLoadProgress(LOAD_PROGRESS_POST_PARTICLE_INI_LOAD); - DEBUG_ASSERTCRASH(m_frame == 0, ("framecounter expected to be 0 here\n")); + DEBUG_ASSERTCRASH(m_frame == 0, ("framecounter expected to be 0 here")); // before loading the map, load the map.ini file in the same directory. loadMapINI( TheGlobalData->m_mapName ); @@ -1426,7 +1426,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) Int colorIdx = slot->getColor(); if (colorIdx < 0 || colorIdx >= TheMultiplayerSettings->getNumColors()) { - DEBUG_ASSERTCRASH(colorIdx == -1, ("Non-random bad color %d in slot %d\n", colorIdx, i)); + DEBUG_ASSERTCRASH(colorIdx == -1, ("Non-random bad color %d in slot %d", colorIdx, i)); while (colorIdx == -1) { colorIdx = GameLogicRandomValue(0, TheMultiplayerSettings->getNumColors()-1); @@ -1908,7 +1908,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) #endif // Get the team information - DEBUG_ASSERTCRASH(pMapObj->getProperties()->getType(TheKey_originalOwner) == Dict::DICT_ASCIISTRING, ("unit %s has no original owner specified (obsolete map file)\n",pMapObj->getName().str())); + DEBUG_ASSERTCRASH(pMapObj->getProperties()->getType(TheKey_originalOwner) == Dict::DICT_ASCIISTRING, ("unit %s has no original owner specified (obsolete map file)",pMapObj->getName().str())); AsciiString originalOwner = pMapObj->getProperties()->getAsciiString(TheKey_originalOwner); Team *team = ThePlayerList->validateTeam(originalOwner); @@ -2789,7 +2789,7 @@ inline void GameLogic::validateSleepyUpdate() const //} for (i = 0; i < sz; ++i) { - DEBUG_ASSERTCRASH(m_sleepyUpdates[i]->friend_getIndexInLogic() == i, ("index mismatch: expected %d, got %d\n",i,m_sleepyUpdates[i]->friend_getIndexInLogic())); + DEBUG_ASSERTCRASH(m_sleepyUpdates[i]->friend_getIndexInLogic() == i, ("index mismatch: expected %d, got %d",i,m_sleepyUpdates[i]->friend_getIndexInLogic())); UnsignedInt pri = m_sleepyUpdates[i]->friend_getPriority(); if (i > 0) { @@ -3002,7 +3002,7 @@ UpdateModulePtr GameLogic::peekSleepyUpdate() const USE_PERF_TIMER(SleepyMaintenance) UpdateModulePtr u = m_sleepyUpdates.front(); - DEBUG_ASSERTCRASH(u->friend_getIndexInLogic() == 0, ("index mismatch: expected %d, got %d\n",0,u->friend_getIndexInLogic())); + DEBUG_ASSERTCRASH(u->friend_getIndexInLogic() == 0, ("index mismatch: expected %d, got %d",0,u->friend_getIndexInLogic())); return u; } @@ -4404,7 +4404,7 @@ void GameLogic::processProgressComplete(Int playerId) { if(playerId < 0 || playerId >= MAX_SLOTS) { - DEBUG_ASSERTCRASH(FALSE,("GameLogic::processProgressComplete, Invalid playerid was passed in %d\n", playerId)); + DEBUG_ASSERTCRASH(FALSE,("GameLogic::processProgressComplete, Invalid playerid was passed in %d", playerId)); return; } if(m_progressComplete[playerId] == TRUE) @@ -4756,13 +4756,13 @@ void GameLogic::prepareLogicForObjectLoad( void ) Bridge *bridge = TheTerrainLogic->findBridgeAt( obj->getPosition() ); // sanity - DEBUG_ASSERTCRASH( bridge, ("GameLogic::prepareLogicForObjectLoad - Unable to find bridge\n" )); + DEBUG_ASSERTCRASH( bridge, ("GameLogic::prepareLogicForObjectLoad - Unable to find bridge" )); // get the old object that is in the bridge info const BridgeInfo *bridgeInfo = bridge->peekBridgeInfo(); Object *oldObject = findObjectByID( bridgeInfo->bridgeObjectID ); - DEBUG_ASSERTCRASH( oldObject, ("GameLogic::prepareLogicForObjectLoad - Unable to find old bridge object\n") ); - DEBUG_ASSERTCRASH( oldObject == obj, ("GameLogic::prepareLogicForObjectLoad - obj != oldObject\n") ); + DEBUG_ASSERTCRASH( oldObject, ("GameLogic::prepareLogicForObjectLoad - Unable to find old bridge object") ); + DEBUG_ASSERTCRASH( oldObject == obj, ("GameLogic::prepareLogicForObjectLoad - obj != oldObject") ); // // destroy the 4 towers that are attached to this old object (they will be loaded from @@ -5121,7 +5121,7 @@ void GameLogic::xfer( Xfer *xfer ) if (value.isNotEmpty()) { button = TheControlBar->findCommandButton(value); - DEBUG_ASSERTCRASH(button != NULL, ("Could not find button %s\n",value.str())); + DEBUG_ASSERTCRASH(button != NULL, ("Could not find button %s",value.str())); } m_controlBarOverrides[name] = button; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp index 530bfc8b0e..da72af5d93 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp @@ -100,7 +100,7 @@ static int thePlanSubjectCount = 0; static void doMoveTo( Object *obj, const Coord3D *pos ) { AIUpdateInterface *ai = obj->getAIUpdateInterface(); - DEBUG_ASSERTCRASH(ai, ("Attemped doMoveTo() on an Object with no AI\n")); + DEBUG_ASSERTCRASH(ai, ("Attemped doMoveTo() on an Object with no AI")); if (ai) { if (theBuildPlan) @@ -352,7 +352,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) #endif Player *thisPlayer = ThePlayerList->getNthPlayer( msg->getPlayerIndex() ); - DEBUG_ASSERTCRASH( thisPlayer, ("logicMessageDispatcher: Processing message from unknown player (player index '%d')\n", + DEBUG_ASSERTCRASH( thisPlayer, ("logicMessageDispatcher: Processing message from unknown player (player index '%d')", msg->getPlayerIndex()) ); AIGroupPtr currentlySelectedGroup = NULL; @@ -1383,7 +1383,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) if( pu == NULL ) { - DEBUG_ASSERTCRASH( 0, ("MSG_QUEUE_UNIT_CREATE: Producer '%s' doesn't have a unit production interface\n", + DEBUG_ASSERTCRASH( 0, ("MSG_QUEUE_UNIT_CREATE: Producer '%s' doesn't have a unit production interface", producer->getTemplate()->getName().str()) ); break; diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp index ce46713036..e07d2f033e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp @@ -336,7 +336,7 @@ static void gameTooltip(GameWindow *window, } } } - DEBUG_ASSERTCRASH(numPlayers, ("Tooltipping a 0-player game!\n")); + DEBUG_ASSERTCRASH(numPlayers, ("Tooltipping a 0-player game!")); TheMouse->setCursorTooltip( tooltip, 10, NULL, 2.0f ); // the text and width are the only params used. the others are the default values. } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp index 45614aec52..c975d0b834 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp @@ -467,7 +467,7 @@ void GameSpyStagingRoom::cleanUpSlotPointers( void ) GameSpyGameSlot * GameSpyStagingRoom::getGameSpySlot( Int index ) { GameSlot *slot = getSlot(index); - DEBUG_ASSERTCRASH(slot && (slot == &(m_GameSpySlot[index])), ("Bad game slot pointer\n")); + DEBUG_ASSERTCRASH(slot && (slot == &(m_GameSpySlot[index])), ("Bad game slot pointer")); return (GameSpyGameSlot *)slot; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp index fe8bb0d156..84067b1c2e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp @@ -2567,7 +2567,7 @@ static void roomKeyChangedCallback(PEER peer, RoomType roomType, const char *nic DEBUG_ASSERTCRASH(t, ("No Peer thread!")); if (!t || !nick || !key || !val) { - DEBUG_ASSERTCRASH(nick && strcmp(nick,"(END)")==0, ("roomKeyChangedCallback bad values = nick:%X:%s, key:%X:%s, val:%X:%s\n", nick, nick, key, key, val, val)); + DEBUG_ASSERTCRASH(nick && strcmp(nick,"(END)")==0, ("roomKeyChangedCallback bad values = nick:%X:%s, key:%X:%s, val:%X:%s", nick, nick, key, key, val, val)); return; } @@ -2806,7 +2806,7 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, #endif // DEBUG_LOGGING // PeerThreadClass *t = (PeerThreadClass *)param; - DEBUG_ASSERTCRASH(name || msg==PEER_CLEAR || msg==PEER_COMPLETE, ("Game has no name!\n")); + DEBUG_ASSERTCRASH(name || msg==PEER_CLEAR || msg==PEER_COMPLETE, ("Game has no name!")); if (!t || !success || (!name && (msg == PEER_ADD || msg == PEER_UPDATE))) { DEBUG_LOG(("Bailing from listingGamesCallback() - success=%d, name=%X, server=%X, msg=%X", success, name, server, msg)); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp index 484eacaef5..c76ebb3060 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp @@ -545,7 +545,7 @@ void GameSpyPSMessageQueue::trackPlayerStats( PSPlayerStats stats ) { #ifdef DEBUG_LOGGING debugDumpPlayerStats( stats ); - DEBUG_ASSERTCRASH(stats.id != 0, ("Tracking stats with ID of 0\n")); + DEBUG_ASSERTCRASH(stats.id != 0, ("Tracking stats with ID of 0")); #endif PSPlayerStats newStats; std::map::iterator it = m_playerStats.find(stats.id); @@ -1284,8 +1284,8 @@ PSPlayerStats GameSpyPSMessageQueueInterface::parsePlayerKVPairs( std::string kv continue; } - //DEBUG_ASSERTCRASH(generalMarker >= 0, ("Unknown KV Pair in persistent storage: [%s] = [%s]\n", k.c_str(), v.c_str())); - //DEBUG_ASSERTCRASH(generalMarker < 0, ("Unknown KV Pair in persistent storage for PlayerTemplate %d: [%s] = [%s]\n", generalMarker, k.c_str(), v.c_str())); + //DEBUG_ASSERTCRASH(generalMarker >= 0, ("Unknown KV Pair in persistent storage: [%s] = [%s]", k.c_str(), v.c_str())); + //DEBUG_ASSERTCRASH(generalMarker < 0, ("Unknown KV Pair in persistent storage for PlayerTemplate %d: [%s] = [%s]", generalMarker, k.c_str(), v.c_str())); } return s; diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp index 1485d173ee..ff0a97f02d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp @@ -553,7 +553,7 @@ void LANAPI::OnPlayerLeave( UnicodeString player ) if (m_name.compare(player) == 0) { // We're leaving. Save options and Pop the shell up a screen. - //DEBUG_ASSERTCRASH(false, ("Slot is %d\n", m_currentGame->getLocalSlotNum())); + //DEBUG_ASSERTCRASH(false, ("Slot is %d", m_currentGame->getLocalSlotNum())); if (m_currentGame && m_currentGame->isInGame() && m_currentGame->getLocalSlotNum() >= 0) { LANPreferences pref; diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp index 28481085db..466b9e2d48 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp @@ -422,7 +422,7 @@ void LANAPI::handleJoinAccept( LANMessage *msg, UnsignedInt senderIP ) prefs.write(); OnGameJoin(RET_OK, m_currentGame); - //DEBUG_ASSERTCRASH(false, ("setting host to %ls@%ls\n", m_currentGame->getLANSlot(0)->getUser()->getLogin().str(), + //DEBUG_ASSERTCRASH(false, ("setting host to %ls@%ls", m_currentGame->getLANSlot(0)->getUser()->getLogin().str(), // m_currentGame->getLANSlot(0)->getUser()->getHost().str())); } m_pendingAction = ACT_NONE; diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp index 851815edca..1d7c578c38 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/NetCommandWrapperList.cpp @@ -93,7 +93,7 @@ void NetCommandWrapperListNode::copyChunkData(NetWrapperCommandMsg *msg) { return; } - DEBUG_ASSERTCRASH(msg->getChunkNumber() < m_numChunks, ("MunkeeChunk %d of %d\n", + DEBUG_ASSERTCRASH(msg->getChunkNumber() < m_numChunks, ("MunkeeChunk %d of %d", msg->getChunkNumber(), m_numChunks)); if (msg->getChunkNumber() >= m_numChunks) return; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp index a8ba598148..704cebf4f6 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp @@ -105,7 +105,7 @@ MilesAudioManager::~MilesAudioManager() closeDevice(); delete m_audioCache; - DEBUG_ASSERTCRASH(this == TheAudio, ("Umm...\n")); + DEBUG_ASSERTCRASH(this == TheAudio, ("Umm...")); TheAudio = NULL; } @@ -2909,7 +2909,7 @@ void MilesAudioManager::initSamplePools( void ) int i = 0; for (i = 0; i < getAudioSettings()->m_sampleCount2D; ++i) { HSAMPLE sample = AIL_allocate_sample_handle(m_digitalHandle); - DEBUG_ASSERTCRASH(sample, ("Couldn't get %d 2D samples\n", i + 1)); + DEBUG_ASSERTCRASH(sample, ("Couldn't get %d 2D samples", i + 1)); if (sample) { AIL_init_sample(sample); AIL_set_sample_user_data(sample, 0, i + 1); @@ -2920,7 +2920,7 @@ void MilesAudioManager::initSamplePools( void ) for (i = 0; i < getAudioSettings()->m_sampleCount3D; ++i) { H3DSAMPLE sample = AIL_allocate_3D_sample_handle(m_provider3D[m_selectedProvider].id); - DEBUG_ASSERTCRASH(sample, ("Couldn't get %d 3D samples\n", i + 1)); + DEBUG_ASSERTCRASH(sample, ("Couldn't get %d 3D samples", i + 1)); if (sample) { AIL_set_3D_user_data(sample, 0, i + 1); m_available3DSamples.push_back(sample); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp index ca54069ad8..97388a4051 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp @@ -863,12 +863,12 @@ void W3DRadar::init( void ) // poolify m_terrainTexture = MSGNEW("TextureClass") TextureClass( m_textureWidth, m_textureHeight, m_terrainTextureFormat, MIP_LEVELS_1 ); - DEBUG_ASSERTCRASH( m_terrainTexture, ("W3DRadar: Unable to allocate terrain texture\n") ); + DEBUG_ASSERTCRASH( m_terrainTexture, ("W3DRadar: Unable to allocate terrain texture") ); // allocate our overlay texture m_overlayTexture = MSGNEW("TextureClass") TextureClass( m_textureWidth, m_textureHeight, m_overlayTextureFormat, MIP_LEVELS_1 ); - DEBUG_ASSERTCRASH( m_overlayTexture, ("W3DRadar: Unable to allocate overlay texture\n") ); + DEBUG_ASSERTCRASH( m_overlayTexture, ("W3DRadar: Unable to allocate overlay texture") ); // set filter type for the overlay texture, try it and see if you like it, I don't ;) // m_overlayTexture->Set_Min_Filter( TextureClass::FILTER_TYPE_NONE ); @@ -877,7 +877,7 @@ void W3DRadar::init( void ) // allocate our shroud texture m_shroudTexture = MSGNEW("TextureClass") TextureClass( m_textureWidth, m_textureHeight, m_shroudTextureFormat, MIP_LEVELS_1 ); - DEBUG_ASSERTCRASH( m_shroudTexture, ("W3DRadar: Unable to allocate shroud texture\n") ); + DEBUG_ASSERTCRASH( m_shroudTexture, ("W3DRadar: Unable to allocate shroud texture") ); m_shroudTexture->Get_Filter().Set_Min_Filter( TextureFilterClass::FILTER_TYPE_DEFAULT ); m_shroudTexture->Get_Filter().Set_Mag_Filter( TextureFilterClass::FILTER_TYPE_DEFAULT ); @@ -1045,7 +1045,7 @@ void W3DRadar::buildTerrainTexture( TerrainLogic *terrain ) // get the terrain surface to draw in surface = m_terrainTexture->Get_Surface_Level(); - DEBUG_ASSERTCRASH( surface, ("W3DRadar: Can't get surface for terrain texture\n") ); + DEBUG_ASSERTCRASH( surface, ("W3DRadar: Can't get surface for terrain texture") ); // build the terrain RGBColor sampleColor; @@ -1181,7 +1181,7 @@ void W3DRadar::buildTerrainTexture( TerrainLogic *terrain ) TerrainRoadType *bridgeTemplate = TheTerrainRoads->findBridge( bridgeTName ); // sanity - DEBUG_ASSERTCRASH( bridgeTemplate, ("W3DRadar::buildTerrainTexture - Can't find bridge template for '%s'\n", bridgeTName.str()) ); + DEBUG_ASSERTCRASH( bridgeTemplate, ("W3DRadar::buildTerrainTexture - Can't find bridge template for '%s'", bridgeTName.str()) ); // use bridge color if ( bridgeTemplate ) @@ -1297,7 +1297,7 @@ void W3DRadar::setShroudLevel(Int shroudX, Int shroudY, CellShroudStatus setting return; SurfaceClass* surface = m_shroudTexture->Get_Surface_Level(); - DEBUG_ASSERTCRASH( surface, ("W3DRadar: Can't get surface for Shroud texture\n") ); + DEBUG_ASSERTCRASH( surface, ("W3DRadar: Can't get surface for Shroud texture") ); Int mapMinX = shroudX * shroud->getCellWidth(); Int mapMinY = shroudY * shroud->getCellHeight(); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp index f4fca38dc7..4280132df5 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp @@ -109,7 +109,7 @@ void W3DDebrisDraw::setModelName(AsciiString name, Color color, ShadowType t) if (color != 0) hexColor = color | 0xFF000000; m_renderObject = W3DDisplay::m_assetManager->Create_Render_Obj(name.str(), getDrawable()->getScale(), hexColor); - DEBUG_ASSERTCRASH(m_renderObject, ("Debris model %s not found!\n",name.str())); + DEBUG_ASSERTCRASH(m_renderObject, ("Debris model %s not found!",name.str())); if (m_renderObject) { if (W3DDisplay::m_3DScene != NULL) diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 46914da020..d31141e437 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -347,7 +347,7 @@ HAnimClass* W3DAnimationInfo::getAnimHandle() const { // Get_HAnim addrefs it, so we'll have to release it in our dtor. m_handle = W3DDisplay::m_assetManager->Get_HAnim(m_name.str()); - DEBUG_ASSERTCRASH(m_handle, ("*** ASSET ERROR: animation %s not found\n",m_name.str())); + DEBUG_ASSERTCRASH(m_handle, ("*** ASSET ERROR: animation %s not found",m_name.str())); if (m_handle) { m_naturalDurationInMsec = m_handle->Get_Num_Frames() * 1000.0f / m_handle->Get_Frame_Rate(); @@ -359,7 +359,7 @@ HAnimClass* W3DAnimationInfo::getAnimHandle() const return m_handle; #else HAnimClass* handle = W3DDisplay::m_assetManager->Get_HAnim(m_name.str()); - DEBUG_ASSERTCRASH(handle, ("*** ASSET ERROR: animation %s not found\n",m_name.str())); + DEBUG_ASSERTCRASH(handle, ("*** ASSET ERROR: animation %s not found",m_name.str())); if (handle != NULL && m_naturalDurationInMsec < 0) { m_naturalDurationInMsec = handle->Get_Num_Frames() * 1000.0f / handle->Get_Frame_Rate(); @@ -618,7 +618,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c } robj = W3DDisplay::m_assetManager->Create_Render_Obj(m_modelName.str(), scale, 0); - DEBUG_ASSERTCRASH(robj, ("*** ASSET ERROR: Model %s not found!\n",m_modelName.str())); + DEBUG_ASSERTCRASH(robj, ("*** ASSET ERROR: Model %s not found!",m_modelName.str())); if (!robj) { //BONEPOS_LOG(("Bailing: could not load render object\n")); @@ -846,7 +846,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const } } // if empty - DEBUG_ASSERTCRASH(!(m_modelName.isNotEmpty() && m_weaponBarrelInfoVec[wslot].empty()), ("*** ASSET ERROR: No fx bone named '%s' found in model %s!\n",fxBoneName.str(),m_modelName.str())); + DEBUG_ASSERTCRASH(!(m_modelName.isNotEmpty() && m_weaponBarrelInfoVec[wslot].empty()), ("*** ASSET ERROR: No fx bone named '%s' found in model %s!",fxBoneName.str(),m_modelName.str())); } } m_validStuff |= BARRELS_VALID; @@ -2909,7 +2909,7 @@ static Bool turretNamesDiffer(const ModelConditionInfo* a, const ModelConditionI //------------------------------------------------------------------------------------------------- void W3DModelDraw::setModelState(const ModelConditionInfo* newState) { - DEBUG_ASSERTCRASH(newState, ("invalid state in W3DModelDraw::setModelState\n")); + DEBUG_ASSERTCRASH(newState, ("invalid state in W3DModelDraw::setModelState")); #ifdef DEBUG_OBJECT_ID_EXISTS if (getDrawable() && getDrawable()->getObject() && getDrawable()->getObject()->getID() == TheObjectIDToDebug) @@ -3031,7 +3031,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) else { m_renderObject = W3DDisplay::m_assetManager->Create_Render_Obj(newState->m_modelName.str(), draw->getScale(), m_hexColor); - DEBUG_ASSERTCRASH(m_renderObject, ("*** ASSET ERROR: Model %s not found!\n",newState->m_modelName.str())); + DEBUG_ASSERTCRASH(m_renderObject, ("*** ASSET ERROR: Model %s not found!",newState->m_modelName.str())); } //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::setModelState()\n")); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp index 65aa42b7da..c98e33e82e 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp @@ -326,10 +326,10 @@ void W3DTankTruckDraw::updateBones( void ) { if( !getW3DTankTruckDrawModuleData()->m_frontLeftTireBoneName.isEmpty() ) { m_frontLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_frontLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_frontLeftTireBone, ("Missing front-left tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_frontLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_frontLeftTireBone, ("Missing front-left tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_frontLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_frontRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_frontRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_frontRightTireBone, ("Missing front-right tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_frontRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_frontRightTireBone, ("Missing front-right tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_frontRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_frontRightTireBone ) { @@ -340,10 +340,10 @@ void W3DTankTruckDraw::updateBones( void ) { if( !getW3DTankTruckDrawModuleData()->m_rearLeftTireBoneName.isEmpty() ) { m_rearLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_rearLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_rearLeftTireBone, ("Missing rear-left tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_rearLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_rearLeftTireBone, ("Missing rear-left tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_rearLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_rearRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_rearRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_rearRightTireBone, ("Missing rear-left tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_rearRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_rearRightTireBone, ("Missing rear-left tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_rearRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_rearRightTireBone) { @@ -355,10 +355,10 @@ void W3DTankTruckDraw::updateBones( void ) { if( !getW3DTankTruckDrawModuleData()->m_midFrontLeftTireBoneName.isEmpty() ) { m_midFrontLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_midFrontLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midFrontLeftTireBone, ("Missing mid-front-left tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_midFrontLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midFrontLeftTireBone, ("Missing mid-front-left tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_midFrontLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_midFrontRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_midFrontRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midFrontRightTireBone, ("Missing mid-front-right tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_midFrontRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midFrontRightTireBone, ("Missing mid-front-right tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_midFrontRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_midFrontRightTireBone ) { @@ -370,10 +370,10 @@ void W3DTankTruckDraw::updateBones( void ) { if( !getW3DTankTruckDrawModuleData()->m_midRearLeftTireBoneName.isEmpty() ) { m_midRearLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_midRearLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midRearLeftTireBone, ("Missing mid-rear-left tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_midRearLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midRearLeftTireBone, ("Missing mid-rear-left tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_midRearLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_midRearRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTankTruckDrawModuleData()->m_midRearRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midRearRightTireBone, ("Missing mid-rear-right tire bone %s in model %s\n", getW3DTankTruckDrawModuleData()->m_midRearRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midRearRightTireBone, ("Missing mid-rear-right tire bone %s in model %s", getW3DTankTruckDrawModuleData()->m_midRearRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_midRearRightTireBone) { diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp index 61e41bc451..700fdda6ae 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTruckDraw.cpp @@ -268,36 +268,36 @@ void W3DTruckDraw::updateBones( void ) if( !getW3DTruckDrawModuleData()->m_frontLeftTireBoneName.isEmpty() ) { m_frontLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_frontLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_frontLeftTireBone, ("Missing front-left tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_frontLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_frontLeftTireBone, ("Missing front-left tire bone %s in model %s", getW3DTruckDrawModuleData()->m_frontLeftTireBoneName.str(), getRenderObject()->Get_Name())); } if( !getW3DTruckDrawModuleData()->m_frontRightTireBoneName.isEmpty() ) { m_frontRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_frontRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_frontRightTireBone, ("Missing front-right tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_frontRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_frontRightTireBone, ("Missing front-right tire bone %s in model %s", getW3DTruckDrawModuleData()->m_frontRightTireBoneName.str(), getRenderObject()->Get_Name())); } //Rear tires if( !getW3DTruckDrawModuleData()->m_rearLeftTireBoneName.isEmpty() ) { m_rearLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_rearLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_rearLeftTireBone, ("Missing rear-left tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_rearLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_rearLeftTireBone, ("Missing rear-left tire bone %s in model %s", getW3DTruckDrawModuleData()->m_rearLeftTireBoneName.str(), getRenderObject()->Get_Name())); } if( !getW3DTruckDrawModuleData()->m_rearRightTireBoneName.isEmpty() ) { m_rearRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_rearRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_rearRightTireBone, ("Missing rear-left tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_rearRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_rearRightTireBone, ("Missing rear-left tire bone %s in model %s", getW3DTruckDrawModuleData()->m_rearRightTireBoneName.str(), getRenderObject()->Get_Name())); } //midFront tires if( !getW3DTruckDrawModuleData()->m_midFrontLeftTireBoneName.isEmpty() ) { m_midFrontLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_midFrontLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midFrontLeftTireBone, ("Missing mid-front-left tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_midFrontLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midFrontLeftTireBone, ("Missing mid-front-left tire bone %s in model %s", getW3DTruckDrawModuleData()->m_midFrontLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_midFrontRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_midFrontRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midFrontRightTireBone, ("Missing mid-front-right tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_midFrontRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midFrontRightTireBone, ("Missing mid-front-right tire bone %s in model %s", getW3DTruckDrawModuleData()->m_midFrontRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_midFrontRightTireBone ) { @@ -309,10 +309,10 @@ void W3DTruckDraw::updateBones( void ) if( !getW3DTruckDrawModuleData()->m_midRearLeftTireBoneName.isEmpty() ) { m_midRearLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_midRearLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midRearLeftTireBone, ("Missing mid-rear-left tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_midRearLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midRearLeftTireBone, ("Missing mid-rear-left tire bone %s in model %s", getW3DTruckDrawModuleData()->m_midRearLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_midRearRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_midRearRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midRearRightTireBone, ("Missing mid-rear-right tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_midRearRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midRearRightTireBone, ("Missing mid-rear-right tire bone %s in model %s", getW3DTruckDrawModuleData()->m_midRearRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_midRearRightTireBone) { @@ -324,10 +324,10 @@ void W3DTruckDraw::updateBones( void ) if( !getW3DTruckDrawModuleData()->m_midMidLeftTireBoneName.isEmpty() ) { m_midMidLeftTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_midMidLeftTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midMidLeftTireBone, ("Missing mid-mid-left tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_midMidLeftTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midMidLeftTireBone, ("Missing mid-mid-left tire bone %s in model %s", getW3DTruckDrawModuleData()->m_midMidLeftTireBoneName.str(), getRenderObject()->Get_Name())); m_midMidRightTireBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_midMidRightTireBoneName.str()); - DEBUG_ASSERTCRASH(m_midMidRightTireBone, ("Missing mid-mid-right tire bone %s in model %s\n", getW3DTruckDrawModuleData()->m_midMidRightTireBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_midMidRightTireBone, ("Missing mid-mid-right tire bone %s in model %s", getW3DTruckDrawModuleData()->m_midMidRightTireBoneName.str(), getRenderObject()->Get_Name())); if (!m_midMidRightTireBone) { @@ -339,7 +339,7 @@ void W3DTruckDraw::updateBones( void ) if( !getW3DTruckDrawModuleData()->m_cabBoneName.isEmpty() ) { m_cabBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_cabBoneName.str()); - DEBUG_ASSERTCRASH(m_cabBone, ("Missing cab bone %s in model %s\n", getW3DTruckDrawModuleData()->m_cabBoneName.str(), getRenderObject()->Get_Name())); + DEBUG_ASSERTCRASH(m_cabBone, ("Missing cab bone %s in model %s", getW3DTruckDrawModuleData()->m_cabBoneName.str(), getRenderObject()->Get_Name())); m_trailerBone = getRenderObject()->Get_Bone_Index(getW3DTruckDrawModuleData()->m_trailerBoneName.str()); } } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp index 58ea8085cc..a595bd23e8 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp @@ -1495,7 +1495,7 @@ Shadow* W3DProjectedShadowManager::addDecal(Shadow::ShadowTypeInfo *shadowInfo) w3dTexture->Get_Filter().Set_V_Addr_Mode(TextureFilterClass::TEXTURE_ADDRESS_CLAMP); w3dTexture->Get_Filter().Set_Mip_Mapping(TextureFilterClass::FILTER_TYPE_NONE); - DEBUG_ASSERTCRASH(w3dTexture != NULL, ("Could not load decal texture: %s\n",texture_name)); + DEBUG_ASSERTCRASH(w3dTexture != NULL, ("Could not load decal texture: %s",texture_name)); if (!w3dTexture) return NULL; @@ -1614,7 +1614,7 @@ Shadow* W3DProjectedShadowManager::addDecal(RenderObjClass *robj, Shadow::Shadow w3dTexture->Get_Filter().Set_V_Addr_Mode(TextureFilterClass::TEXTURE_ADDRESS_CLAMP); w3dTexture->Get_Filter().Set_Mip_Mapping(TextureFilterClass::FILTER_TYPE_NONE); - DEBUG_ASSERTCRASH(w3dTexture != NULL, ("Could not load decal texture: %s\n",texture_name)); + DEBUG_ASSERTCRASH(w3dTexture != NULL, ("Could not load decal texture: %s",texture_name)); if (!w3dTexture) return NULL; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp index 3da85db871..669cfcb5f8 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp @@ -520,13 +520,13 @@ void W3DBridge::getIndicesNVertices(UnsignedShort *destination_ib, VertexFormatX numV = getModelVerticesFixed(destination_vb, *curVertexP, m_leftMtx, m_leftMesh, pLightsIterator); if (!numV) { //not enough room for vertices - DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.\n") ); + DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.") ); return; } numI = getModelIndices( destination_ib, *curIndexP, *curVertexP, m_leftMesh); if (!numI) { //not enough room for indices - DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.\n") ); + DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.") ); return; } *curIndexP += numI; @@ -570,13 +570,13 @@ void W3DBridge::getIndicesNVertices(UnsignedShort *destination_ib, VertexFormatX m_leftMtx, m_leftMesh, pLightsIterator); if (!numV) { //not enough room for vertices - DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.\n") ); + DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.") ); return; } numI = getModelIndices( destination_ib, *curIndexP, *curVertexP, m_leftMesh); if (!numI) { //not enough room for indices - DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.\n") ); + DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.") ); return; } *curIndexP += numI; @@ -591,13 +591,13 @@ void W3DBridge::getIndicesNVertices(UnsignedShort *destination_ib, VertexFormatX m_sectionMtx, m_sectionMesh, pLightsIterator); if (!numV) { //not enough room for vertices - DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.\n") ); + DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.") ); return; } numI = getModelIndices( destination_ib, *curIndexP, *curVertexP, m_sectionMesh); if (!numI) { //not enough room for indices - DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.\n") ); + DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.") ); return; } *curIndexP += numI; @@ -611,13 +611,13 @@ void W3DBridge::getIndicesNVertices(UnsignedShort *destination_ib, VertexFormatX m_rightMtx, m_rightMesh, pLightsIterator); if (!numV) { //not enough room for vertices - DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.\n") ); + DEBUG_ASSERTCRASH( numV, ("W3DBridge::GetIndicesNVertices(). Vertex overflow.") ); return; } numI = getModelIndices( destination_ib, *curIndexP, *curVertexP, m_rightMesh); if (!numI) { //not enough room for indices - DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.\n") ); + DEBUG_ASSERTCRASH( numI, ("W3DBridge::GetIndicesNVertices(). Index overflow.") ); return; } *curIndexP += numI; @@ -851,7 +851,7 @@ static RenderObjClass* createTower( SimpleSceneClass *scene, return NULL; // get template for this bridge - DEBUG_ASSERTCRASH( TheTerrainRoads, ("createTower: TheTerrainRoads is NULL\n") ); + DEBUG_ASSERTCRASH( TheTerrainRoads, ("createTower: TheTerrainRoads is NULL") ); TerrainRoadType *bridgeTemplate = TheTerrainRoads->findBridge( mapObject->getName() ); if( bridgeTemplate == NULL ) return NULL; @@ -874,7 +874,7 @@ static RenderObjClass* createTower( SimpleSceneClass *scene, // find the thing template for the tower we want to construct AsciiString towerTemplateName = bridgeTemplate->getTowerObjectName( type ); - DEBUG_ASSERTCRASH( TheThingFactory, ("createTower: TheThingFactory is NULL\n") ); + DEBUG_ASSERTCRASH( TheThingFactory, ("createTower: TheThingFactory is NULL") ); const ThingTemplate *towerTemplate = TheThingFactory->findTemplate( towerTemplateName ); if( towerTemplate == NULL ) return NULL; @@ -1036,7 +1036,7 @@ void W3DBridgeBuffer::worldBuilderUpdateBridgeTowers( W3DAssetManager *assetMana } // end if // sanity - DEBUG_ASSERTCRASH( towerRenderObj != NULL, ("worldBuilderUpdateBridgeTowers: unable to create tower for bridge '%s'\n", + DEBUG_ASSERTCRASH( towerRenderObj != NULL, ("worldBuilderUpdateBridgeTowers: unable to create tower for bridge '%s'", m_bridges[ i ].getTemplateName().str()) ); // update the position of the towers diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp index df10f776a2..2cbf3a93aa 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp @@ -788,7 +788,7 @@ void W3DDisplay::init( void ) WW3D::Shutdown(); WWMath::Shutdown(); throw ERROR_INVALID_D3D; //failed to initialize. User probably doesn't have DX 8.1 - DEBUG_ASSERTCRASH( 0, ("Unable to set render device\n") ); + DEBUG_ASSERTCRASH( 0, ("Unable to set render device") ); return; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp index a66a1971b0..607ba4edc7 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp @@ -1358,7 +1358,7 @@ void WaterRenderObjClass::loadSetting( Setting *setting, TimeOfDay timeOfDay ) SurfaceClass::SurfaceDescription surfaceDesc; // sanity - DEBUG_ASSERTCRASH( setting, ("WaterRenderObjClass::loadSetting, NULL setting\n") ); + DEBUG_ASSERTCRASH( setting, ("WaterRenderObjClass::loadSetting, NULL setting") ); // textures setting->skyTexture = WW3DAssetManager::Get_Instance()->Get_Texture( WaterSettings[ timeOfDay ].m_skyTextureFile.str() ); @@ -2453,7 +2453,7 @@ void WaterRenderObjClass::renderWaterMesh(void) inline void WaterRenderObjClass::setGridVertexHeight(Int x, Int y, Real value) { - DEBUG_ASSERTCRASH( x < (m_gridCellsX+1) && y < (m_gridCellsY+1), ("Invalid Water Mesh Coordinates\n") ); + DEBUG_ASSERTCRASH( x < (m_gridCellsX+1) && y < (m_gridCellsY+1), ("Invalid Water Mesh Coordinates") ); if (m_meshData) { diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp index 20cd0710ab..19925e780a 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp @@ -187,7 +187,7 @@ void W3DRenderObjectSnapshot::xfer( Xfer *xfer ) xfer->xferVersion( &version, currentVersion ); // sanity - DEBUG_ASSERTCRASH( m_robj, ("W3DRenderObjectSnapshot::xfer - invalid m_robj\n") ); + DEBUG_ASSERTCRASH( m_robj, ("W3DRenderObjectSnapshot::xfer - invalid m_robj") ); // transform on the main render object Matrix3D transform; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp index 278e5d2929..ec7d693863 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/Win32Device/GameClient/Win32Mouse.cpp @@ -403,7 +403,7 @@ void Win32Mouse::initCursorResources(void) if (!loaded) cursorResources[cursor][direction]=LoadCursorFromFile(resourcePath); - DEBUG_ASSERTCRASH(cursorResources[cursor][direction], ("MissingCursor %s\n",resourcePath)); + DEBUG_ASSERTCRASH(cursorResources[cursor][direction], ("MissingCursor %s",resourcePath)); } } // SetCursor(cursorResources[cursor][m_directionFrame]); diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/CallbackEditor.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/CallbackEditor.cpp index c179d718d1..30dca3bdf5 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/CallbackEditor.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/Dialog Procedures/CallbackEditor.cpp @@ -85,7 +85,7 @@ void SaveCallbacks( GameWindow *window, HWND dialog ) // get edit data for window GameWindowEditData *editData = window->winGetEditData(); - DEBUG_ASSERTCRASH( editData, ("No edit data for window saving callbacks!\n") ); + DEBUG_ASSERTCRASH( editData, ("No edit data for window saving callbacks!") ); // get the currently selected item from each of the combos and save Int index; diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/BuildList.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/BuildList.cpp index c24acc990d..3eaf44e351 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/BuildList.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/BuildList.cpp @@ -766,7 +766,7 @@ void BuildList::OnExport() AsciiString tmplname = d->getAsciiString(TheKey_playerFaction); const PlayerTemplate* pt = ThePlayerTemplateStore->findPlayerTemplate(NAMEKEY(tmplname)); - DEBUG_ASSERTCRASH(pt != NULL, ("PlayerTemplate %s not found -- this is an obsolete map (please open and resave in WB)\n",tmplname.str())); + DEBUG_ASSERTCRASH(pt != NULL, ("PlayerTemplate %s not found -- this is an obsolete map (please open and resave in WB)",tmplname.str())); fprintf(theLogFile, ";Skirmish AI Build List\n"); fprintf(theLogFile, "SkirmishBuildList %s\n", pt->getSide().str()); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/EditObjectParameter.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/EditObjectParameter.cpp index 6dc870bfc4..4b83ff6bfc 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/EditObjectParameter.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/EditObjectParameter.cpp @@ -120,7 +120,7 @@ void EditObjectParameter::addObject( const ThingTemplate *thingTemplate ) // first sort by Side, either create or find the tree item with matching side name AsciiString side = thingTemplate->getDefaultOwningSide(); - DEBUG_ASSERTCRASH(!side.isEmpty(), ("NULL default side in template\n") ); + DEBUG_ASSERTCRASH(!side.isEmpty(), ("NULL default side in template") ); strcpy( buffer, side.str() ); parent = findOrAdd( parent, buffer ); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/FenceOptions.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/FenceOptions.cpp index 189c2fad97..77aa8d5d1a 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/FenceOptions.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/FenceOptions.cpp @@ -263,7 +263,7 @@ void FenceOptions::addObject( MapObject *mapObject, const char *pPath, const cha // first sort by side, either create or find the tree item with matching side name AsciiString side = thingTemplate->getDefaultOwningSide(); - DEBUG_ASSERTCRASH( !side.isEmpty(), ("NULL default side in template\n") ); + DEBUG_ASSERTCRASH( !side.isEmpty(), ("NULL default side in template") ); strcpy( buffer, side.str() ); parent = findOrAdd( parent, buffer ); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/ObjectOptions.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/ObjectOptions.cpp index 69414c9d86..d4e8425d97 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/ObjectOptions.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/ObjectOptions.cpp @@ -481,7 +481,7 @@ void ObjectOptions::addObject( MapObject *mapObject, const char *pPath, // first sort by side, either create or find the tree item with matching side name AsciiString side = thingTemplate->getDefaultOwningSide(); - DEBUG_ASSERTCRASH( !side.isEmpty(), ("NULL default side in template\n") ); + DEBUG_ASSERTCRASH( !side.isEmpty(), ("NULL default side in template") ); strcpy( buffer, side.str() ); parent = findOrAdd( parent, buffer ); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/PickUnitDialog.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/PickUnitDialog.cpp index 9fee5c91d4..997aa28112 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/PickUnitDialog.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/PickUnitDialog.cpp @@ -308,7 +308,7 @@ void PickUnitDialog::addObject( MapObject *mapObject, const char *pPath, Int ind // first sort by side, either create or find the tree item with matching side name AsciiString side = thingTemplate->getDefaultOwningSide(); - DEBUG_ASSERTCRASH( !side.isEmpty(), ("NULL default side in template\n") ); + DEBUG_ASSERTCRASH( !side.isEmpty(), ("NULL default side in template") ); strcpy( buffer, side.str() ); parent = findOrAdd( parent, buffer ); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp index 1c5f61ceda..8c63a7bbd7 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp @@ -260,7 +260,7 @@ class CompressedCachedMFCFileOutputStream : public OutputStream compressedLen = CompressionManager::compressData( compressionToUse, srcBuffer, m_totalBytes, destBuffer, compressedLen ); DEBUG_LOG(("Compressed %d bytes to %d bytes - compression of %g%%", m_totalBytes, compressedLen, compressedLen/(Real)m_totalBytes*100.0f)); - DEBUG_ASSERTCRASH(compressedLen, ("Failed to compress!\n")); + DEBUG_ASSERTCRASH(compressedLen, ("Failed to compress!")); if (compressedLen) { m_file->Write(destBuffer, compressedLen); From 7f4a794f6188869681def227e8eea36aa17aefe7 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:11:42 +0200 Subject: [PATCH 06/13] [GEN][ZH] Remove trailing LF from RELEASE_CRASH, RELEASE_CRASHLOCALIZED strings with script (#1232) --- .../Code/GameEngine/Source/GameLogic/System/GameLogic.cpp | 6 +++--- .../Source/MilesAudioDevice/MilesAudioManager.cpp | 2 +- Generals/Code/Main/WinMain.cpp | 2 +- .../Code/GameEngine/Source/GameLogic/System/GameLogic.cpp | 6 +++--- .../Source/MilesAudioDevice/MilesAudioManager.cpp | 2 +- GeneralsMD/Code/Main/WinMain.cpp | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 6f143f5b95..62991d49d0 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -2732,13 +2732,13 @@ void GameLogic::friend_awakenUpdateModule(Object* obj, UpdateModulePtr u, Unsign { if (idx < 0 || idx >= m_sleepyUpdates.size()) { - RELEASE_CRASH("fatal error! sleepy update module illegal index.\n"); + RELEASE_CRASH("fatal error! sleepy update module illegal index."); return; } if (m_sleepyUpdates[idx] != u) { - RELEASE_CRASH("fatal error! sleepy update module index mismatch.\n"); + RELEASE_CRASH("fatal error! sleepy update module index mismatch."); return; } @@ -2757,7 +2757,7 @@ void GameLogic::friend_awakenUpdateModule(Object* obj, UpdateModulePtr u, Unsign { if (idx != -1) { - RELEASE_CRASH("fatal error! sleepy update module index mismatch.\n"); + RELEASE_CRASH("fatal error! sleepy update module index mismatch."); return; } diff --git a/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp b/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp index 57cd486bca..ecc78f02b4 100644 --- a/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp +++ b/Generals/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp @@ -3062,7 +3062,7 @@ U32 AILCALLBACK streamingFileOpen(char const *fileName, U32 *file_handle) { #if defined(RTS_DEBUG) if (sizeof(U32) != sizeof(File*)) { - RELEASE_CRASH(("streamingFileOpen - This function requires work in order to compile on non 32-bit platforms.\n")); + RELEASE_CRASH(("streamingFileOpen - This function requires work in order to compile on non 32-bit platforms.")); } #endif diff --git a/Generals/Code/Main/WinMain.cpp b/Generals/Code/Main/WinMain.cpp index bf6b77e355..e95670509c 100644 --- a/Generals/Code/Main/WinMain.cpp +++ b/Generals/Code/Main/WinMain.cpp @@ -623,7 +623,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT message, } catch (...) { - RELEASE_CRASH(("Uncaught exception in Main::WndProc... probably should not happen\n")); + RELEASE_CRASH(("Uncaught exception in Main::WndProc... probably should not happen")); // no rethrow } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 78a0df6582..a3927907f5 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -3066,13 +3066,13 @@ void GameLogic::friend_awakenUpdateModule(Object* obj, UpdateModulePtr u, Unsign { if (idx < 0 || idx >= m_sleepyUpdates.size()) { - RELEASE_CRASH("fatal error! sleepy update module illegal index.\n"); + RELEASE_CRASH("fatal error! sleepy update module illegal index."); return; } if (m_sleepyUpdates[idx] != u) { - RELEASE_CRASH("fatal error! sleepy update module index mismatch.\n"); + RELEASE_CRASH("fatal error! sleepy update module index mismatch."); return; } @@ -3091,7 +3091,7 @@ void GameLogic::friend_awakenUpdateModule(Object* obj, UpdateModulePtr u, Unsign { if (idx != -1) { - RELEASE_CRASH("fatal error! sleepy update module index mismatch.\n"); + RELEASE_CRASH("fatal error! sleepy update module index mismatch."); return; } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp index 704cebf4f6..73965d64d0 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp @@ -3062,7 +3062,7 @@ U32 AILCALLBACK streamingFileOpen(char const *fileName, U32 *file_handle) { #if defined(RTS_DEBUG) if (sizeof(U32) != sizeof(File*)) { - RELEASE_CRASH(("streamingFileOpen - This function requires work in order to compile on non 32-bit platforms.\n")); + RELEASE_CRASH(("streamingFileOpen - This function requires work in order to compile on non 32-bit platforms.")); } #endif diff --git a/GeneralsMD/Code/Main/WinMain.cpp b/GeneralsMD/Code/Main/WinMain.cpp index bd6a195fc0..631b00d3ea 100644 --- a/GeneralsMD/Code/Main/WinMain.cpp +++ b/GeneralsMD/Code/Main/WinMain.cpp @@ -645,7 +645,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT message, } catch (...) { - RELEASE_CRASH(("Uncaught exception in Main::WndProc... probably should not happen\n")); + RELEASE_CRASH(("Uncaught exception in Main::WndProc... probably should not happen")); // no rethrow } From 9390240c768956667e270824997a794039663aca Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:14:11 +0200 Subject: [PATCH 07/13] [GEN][ZH] Remove trailing CR LF from WWDEBUG_SAY strings with script (#1232) --- .../Source/WWVegas/WW3D2/agg_def.cpp | 8 +- .../Source/WWVegas/WW3D2/animatedsoundmgr.cpp | 4 +- .../Source/WWVegas/WW3D2/distlod.cpp | 2 +- .../Source/WWVegas/WW3D2/dx8polygonrenderer.h | 2 +- .../Source/WWVegas/WW3D2/dx8webbrowser.cpp | 4 +- .../Libraries/Source/WWVegas/WW3D2/font3d.cpp | 4 +- .../Libraries/Source/WWVegas/WW3D2/hcanim.cpp | 6 +- .../Source/WWVegas/WW3D2/intersec.cpp | 2 +- .../Source/WWVegas/WW3D2/rendobj.cpp | 12 +- .../Source/WWVegas/WW3D2/seglinerenderer.cpp | 2 +- .../Source/WWVegas/WW3D2/shattersystem.cpp | 12 +- .../Source/WWVegas/WW3D2/streakRender.cpp | 2 +- .../Source/WWVegas/WW3D2/ww3dformat.cpp | 2 +- .../Source/WWVegas/WWAudio/Sound3D.cpp | 2 +- .../Source/WWVegas/WWAudio/WWAudio.cpp | 26 ++-- .../Source/WWVegas/WWAudio/sound3dhandle.cpp | 2 +- .../Source/WWVegas/WWDebug/wwdebug.h | 2 +- .../Source/WWVegas/WWDebug/wwprofile.cpp | 2 +- .../Libraries/Source/WWVegas/WWLib/Except.cpp | 2 +- Core/Libraries/Source/WWVegas/WWLib/TARGA.CPP | 10 +- .../Libraries/Source/WWVegas/WWLib/thread.cpp | 2 +- .../Source/WWVegas/WWMath/aabtreecull.cpp | 2 +- .../Source/WWVegas/WWMath/cardinalspline.cpp | 4 +- .../WWVegas/WWMath/catmullromspline.cpp | 4 +- .../Source/WWVegas/WWMath/colmathaabox.cpp | 2 +- .../Libraries/Source/WWVegas/WWMath/curve.cpp | 8 +- .../Source/WWVegas/WWMath/hermitespline.cpp | 4 +- .../Source/WWVegas/WWMath/lookuptable.cpp | 2 +- .../Source/WWVegas/WWMath/matrix3d.cpp | 6 +- .../Source/WWVegas/WWMath/tcbspline.cpp | 2 +- .../WWVegas/WWSaveLoad/definitionmgr.cpp | 10 +- .../WWVegas/WWSaveLoad/pointerremap.cpp | 2 +- .../W3DView/AnimatedSoundOptionsDialog.cpp | 2 +- Core/Tools/WW3D/max2w3d/TARGA.CPP | 10 +- .../W3DDevice/GameClient/W3DAssetManager.cpp | 4 +- .../Source/WWVegas/WW3D2/animobj.cpp | 2 +- .../Source/WWVegas/WW3D2/assetmgr.cpp | 34 ++--- .../Libraries/Source/WWVegas/WW3D2/dazzle.cpp | 6 +- .../Source/WWVegas/WW3D2/ddsfile.cpp | 8 +- .../Source/WWVegas/WW3D2/decalmsh.cpp | 4 +- .../Source/WWVegas/WW3D2/dx8indexbuffer.cpp | 8 +- .../Source/WWVegas/WW3D2/dx8renderer.cpp | 14 +-- .../Source/WWVegas/WW3D2/dx8vertexbuffer.cpp | 32 ++--- .../Source/WWVegas/WW3D2/dx8wrapper.cpp | 78 ++++++------ .../Source/WWVegas/WW3D2/hanimmgr.cpp | 4 +- .../Source/WWVegas/WW3D2/hrawanim.cpp | 4 +- .../Source/WWVegas/WW3D2/htreemgr.cpp | 4 +- .../Libraries/Source/WWVegas/WW3D2/light.cpp | 2 +- .../Libraries/Source/WWVegas/WW3D2/mesh.cpp | 4 +- .../Source/WWVegas/WW3D2/meshgeometry.cpp | 2 +- .../Source/WWVegas/WW3D2/meshmatdesc.cpp | 2 +- .../Source/WWVegas/WW3D2/meshmdlio.cpp | 16 +-- .../Source/WWVegas/WW3D2/part_ldr.cpp | 2 +- .../Libraries/Source/WWVegas/WW3D2/scene.cpp | 4 +- .../Source/WWVegas/WW3D2/texproject.cpp | 8 +- .../Source/WWVegas/WW3D2/texture.cpp | 2 +- .../Source/WWVegas/WW3D2/textureloader.cpp | 4 +- .../Source/WWVegas/WW3D2/vertmaterial.cpp | 4 +- .../Libraries/Source/WWVegas/WW3D2/ww3d.cpp | 22 ++-- .../Code/Tools/WorldBuilder/src/wbview3d.cpp | 2 +- .../W3DDevice/GameClient/W3DAssetManager.cpp | 4 +- .../Source/W3DDevice/GameClient/W3DView.cpp | 4 +- .../Source/WWVegas/WW3D2/animobj.cpp | 2 +- .../Source/WWVegas/WW3D2/assetmgr.cpp | 34 ++--- .../Libraries/Source/WWVegas/WW3D2/dazzle.cpp | 6 +- .../Source/WWVegas/WW3D2/ddsfile.cpp | 6 +- .../Source/WWVegas/WW3D2/decalmsh.cpp | 4 +- .../Source/WWVegas/WW3D2/dx8indexbuffer.cpp | 12 +- .../Source/WWVegas/WW3D2/dx8renderer.cpp | 14 +-- .../Source/WWVegas/WW3D2/dx8vertexbuffer.cpp | 32 ++--- .../Source/WWVegas/WW3D2/dx8wrapper.cpp | 118 +++++++++--------- .../Source/WWVegas/WW3D2/hanimmgr.cpp | 4 +- .../Libraries/Source/WWVegas/WW3D2/hlod.cpp | 2 +- .../Source/WWVegas/WW3D2/hrawanim.cpp | 4 +- .../Source/WWVegas/WW3D2/htreemgr.cpp | 4 +- .../Libraries/Source/WWVegas/WW3D2/light.cpp | 2 +- .../Libraries/Source/WWVegas/WW3D2/mesh.cpp | 4 +- .../Source/WWVegas/WW3D2/meshgeometry.cpp | 2 +- .../Source/WWVegas/WW3D2/meshmatdesc.cpp | 2 +- .../Source/WWVegas/WW3D2/meshmdlio.cpp | 16 +-- .../Source/WWVegas/WW3D2/part_ldr.cpp | 2 +- .../Libraries/Source/WWVegas/WW3D2/scene.cpp | 4 +- .../Source/WWVegas/WW3D2/texproject.cpp | 8 +- .../Source/WWVegas/WW3D2/textureloader.cpp | 24 ++-- .../Source/WWVegas/WW3D2/texturethumbnail.cpp | 2 +- .../Libraries/Source/WWVegas/WW3D2/ww3d.cpp | 22 ++-- .../Code/Tools/WorldBuilder/src/wbview3d.cpp | 2 +- 87 files changed, 392 insertions(+), 392 deletions(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/agg_def.cpp b/Core/Libraries/Source/WWVegas/WW3D2/agg_def.cpp index a0a43d606c..1fb8e38004 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/agg_def.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/agg_def.cpp @@ -213,7 +213,7 @@ AggregateDefClass::Create (void) pmodel->Set_Sub_Objects_Match_LOD ((m_MiscInfo.Flags & W3D_AGGREGATE_FORCE_SUB_OBJ_LOD) == W3D_AGGREGATE_FORCE_SUB_OBJ_LOD); } else { - WWDEBUG_SAY (("Unable to load aggregate %s.\r\n", m_Info.BaseModelName)); + WWDEBUG_SAY (("Unable to load aggregate %s.", m_Info.BaseModelName)); } // Return a pointer to the new aggregate @@ -296,13 +296,13 @@ AggregateDefClass::Attach_Subobjects (RenderObjClass &base_model) // Attach this object to the requested bone if (base_model.Add_Sub_Object_To_Bone (prender_obj, psubobj_info->BoneName) == false) { - WWDEBUG_SAY (("Unable to attach %s to %s.\r\n", psubobj_info->SubobjectName, psubobj_info->BoneName)); + WWDEBUG_SAY (("Unable to attach %s to %s.", psubobj_info->SubobjectName, psubobj_info->BoneName)); } // Release our hold on this pointer prender_obj->Release_Ref (); } else { - WWDEBUG_SAY (("Unable to load aggregate subobject %s.\r\n", psubobj_info->SubobjectName)); + WWDEBUG_SAY (("Unable to load aggregate subobject %s.", psubobj_info->SubobjectName)); } } } @@ -559,7 +559,7 @@ AggregateDefClass::Load_W3D (ChunkLoadClass &chunk_load) case W3D_CHUNK_TEXTURE_REPLACER_INFO: if (chunk_load.Read (&header, sizeof (header)) == sizeof (header)) { if (header.ReplacedTexturesCount > 0) { - WWDEBUG_SAY(("Obsolete texture replacement chunk encountered in aggregate: %s\r\n",m_pName)); + WWDEBUG_SAY(("Obsolete texture replacement chunk encountered in aggregate: %s",m_pName)); } } break; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp index 68ce41b044..448f6427b2 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/animatedsoundmgr.cpp @@ -388,7 +388,7 @@ AnimatedSoundMgrClass::Initialize (const char *ini_filename) AnimSoundLists.Add (sound_list); } else { - //WWDEBUG_SAY (("AnimatedSoundMgrClass::Initialize -- No sounds added for %d!\n", animation_name.Peek_Buffer ())); + //WWDEBUG_SAY (("AnimatedSoundMgrClass::Initialize -- No sounds added for %d!", animation_name.Peek_Buffer ())); delete sound_list; } } @@ -544,7 +544,7 @@ AnimatedSoundMgrClass::Trigger_Sound } } - //WWDEBUG_SAY (("Triggering Sound %d %s\n", GetTickCount (), sound_list->List[index]->SoundName)); + //WWDEBUG_SAY (("Triggering Sound %d %s", GetTickCount (), sound_list->List[index]->SoundName)); retval = frame; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/distlod.cpp b/Core/Libraries/Source/WWVegas/WW3D2/distlod.cpp index f95767bde5..f4f1f3687f 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/distlod.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/distlod.cpp @@ -116,7 +116,7 @@ RenderObjClass * DistLODPrototypeClass::Create(void) } dist->Release_Ref(); - WWDEBUG_SAY(("OBSOLETE Dist-LOD model found! Please re-export %s!\r\n",name)); + WWDEBUG_SAY(("OBSOLETE Dist-LOD model found! Please re-export %s!",name)); HLodClass * hlod = NEW_REF(HLodClass , (name,robj,count)); // Now, release the temporary refs and memory for the name diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h index 0498d8216e..b2d19e882e 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h @@ -104,7 +104,7 @@ class DX8PolygonRendererClass : public MultiListObjectClass inline void DX8PolygonRendererClass::Set_Vertex_Index_Range(unsigned min_vertex_index_,unsigned vertex_index_range_) { -// WWDEBUG_SAY(("Set_Vertex_Index_Range - min: %d, range: %d\n",min_vertex_index_,vertex_index_range_)); +// WWDEBUG_SAY(("Set_Vertex_Index_Range - min: %d, range: %d",min_vertex_index_,vertex_index_range_)); // if (vertex_index_range_>30000) { // int a=0; // a++; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp index e3dd485a5d..2f5c1e7508 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp @@ -189,7 +189,7 @@ void DX8WebBrowser::Render(int backbufferindex) // ****************************************************************************************** void DX8WebBrowser::CreateBrowser(const char* browsername, const char* url, int x, int y, int w, int h, int updateticks, LONG options, LPDISPATCH gamedispatch) { - WWDEBUG_SAY(("DX8WebBrowser::CreateBrowser - Creating browser with the name %s, url = %s, (x, y, w, h) = (%d, %d, %d, %d), update ticks = %d\n", browsername, url, x, y, h, w, updateticks)); + WWDEBUG_SAY(("DX8WebBrowser::CreateBrowser - Creating browser with the name %s, url = %s, (x, y, w, h) = (%d, %d, %d, %d), update ticks = %d", browsername, url, x, y, h, w, updateticks)); if(pBrowser) { _bstr_t brsname(browsername); @@ -212,7 +212,7 @@ void DX8WebBrowser::CreateBrowser(const char* browsername, const char* url, int // ****************************************************************************************** void DX8WebBrowser::DestroyBrowser(const char* browsername) { - WWDEBUG_SAY(("DX8WebBrowser::DestroyBrowser - destroying browser %s\n", browsername)); + WWDEBUG_SAY(("DX8WebBrowser::DestroyBrowser - destroying browser %s", browsername)); if(pBrowser) pBrowser->DestroyBrowser(_bstr_t(browsername)); } diff --git a/Core/Libraries/Source/WWVegas/WW3D2/font3d.cpp b/Core/Libraries/Source/WWVegas/WW3D2/font3d.cpp index 9a9cebb767..97024fa100 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/font3d.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/font3d.cpp @@ -142,7 +142,7 @@ SurfaceClass *Font3DDataClass::Minimize_Font_Image( SurfaceClass *surface ) // we assert because we have already modified tables for some of the chars if (new_y + height > new_height) { new_y -= height; - WWDEBUG_SAY(( "Font doesn't fit texture 2 on char %c\n", char_index )); + WWDEBUG_SAY(( "Font doesn't fit texture 2 on char %c", char_index )); } } @@ -288,7 +288,7 @@ bool Font3DDataClass::Load_Font_Image( const char *filename ) int end = column; if ( end <= start ) { - WWDEBUG_SAY(( "Error Char %d start %d end %d width %d\n", char_index, start, end, width )); + WWDEBUG_SAY(( "Error Char %d start %d end %d width %d", char_index, start, end, width )); } // WWASSERT( end > start ); diff --git a/Core/Libraries/Source/WWVegas/WW3D2/hcanim.cpp b/Core/Libraries/Source/WWVegas/WW3D2/hcanim.cpp index dc0eecf81c..03ddf14637 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/hcanim.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/hcanim.cpp @@ -318,7 +318,7 @@ int HCompressedAnimClass::Load_W3D(ChunkLoadClass & cload) // gonna trash memory. Boy will we trash memory. // GTH 09-25-2000: print a warning and survive this error delete tc_chan; - WWDEBUG_SAY(("ERROR! animation %s indexes a bone not present in the model. Please re-export!\r\n",Name)); + WWDEBUG_SAY(("ERROR! animation %s indexes a bone not present in the model. Please re-export!",Name)); } break; @@ -335,7 +335,7 @@ int HCompressedAnimClass::Load_W3D(ChunkLoadClass & cload) // gonna trash memory. Boy will we trash memory. // GTH 09-25-2000: print a warning and survive this error delete ad_chan; - WWDEBUG_SAY(("ERROR! animation %s indexes a bone not present in the model. Please re-export!\r\n",Name)); + WWDEBUG_SAY(("ERROR! animation %s indexes a bone not present in the model. Please re-export!",Name)); } break; } @@ -353,7 +353,7 @@ int HCompressedAnimClass::Load_W3D(ChunkLoadClass & cload) // gonna trash memory. Boy will we trash memory. // GTH 09-25-2000: print a warning and survive this error delete newbitchan; - WWDEBUG_SAY(("ERROR! animation %s indexes a bone not present in the model. Please re-export!\r\n",Name)); + WWDEBUG_SAY(("ERROR! animation %s indexes a bone not present in the model. Please re-export!",Name)); } break; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/intersec.cpp b/Core/Libraries/Source/WWVegas/WW3D2/intersec.cpp index 2ad2ba3de8..f413d9793c 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/intersec.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/intersec.cpp @@ -166,7 +166,7 @@ void IntersectionClass::Append_Object_Array( CurrentCount++; return; } - WWDEBUG_SAY(("IntersectionClass::Append_Object_Array - Too many objects\n")); + WWDEBUG_SAY(("IntersectionClass::Append_Object_Array - Too many objects")); } // determines if specified plane-intersection point (co-planar with polygon) is within the the passed polygon. diff --git a/Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp b/Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp index defeb101f7..2ab8715530 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp @@ -1234,7 +1234,7 @@ PersistClass * RenderObjPersistFactoryClass::Load(ChunkLoadClass & cload) const break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; }; cload.Close_Chunk(); @@ -1244,8 +1244,8 @@ PersistClass * RenderObjPersistFactoryClass::Load(ChunkLoadClass & cload) const if (strlen(name) == 0) { static int count = 0; if ( ++count < 10 ) { - WWDEBUG_SAY(("RenderObjPersistFactory attempted to load an un-named render object!\r\n")); - WWDEBUG_SAY(("Replacing it with a NULL render object!\r\n")); + WWDEBUG_SAY(("RenderObjPersistFactory attempted to load an un-named render object!")); + WWDEBUG_SAY(("Replacing it with a NULL render object!")); } strcpy(name,"NULL"); } @@ -1255,9 +1255,9 @@ PersistClass * RenderObjPersistFactoryClass::Load(ChunkLoadClass & cload) const if (new_obj == NULL) { static int count = 0; if ( ++count < 10 ) { - WWDEBUG_SAY(("RenderObjPersistFactory failed to create object: %s!!\r\n",name)); - WWDEBUG_SAY(("Either the asset for this object is gone or you tried to save a procedural object.\r\n")); - WWDEBUG_SAY(("Replacing it with a NULL render object!\r\n")); + WWDEBUG_SAY(("RenderObjPersistFactory failed to create object: %s!!",name)); + WWDEBUG_SAY(("Either the asset for this object is gone or you tried to save a procedural object.")); + WWDEBUG_SAY(("Replacing it with a NULL render object!")); } strcpy(name,"NULL"); new_obj = WW3DAssetManager::Get_Instance()->Create_Render_Obj(name); diff --git a/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp b/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp index 9235b87729..ebfefe83b4 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp @@ -191,7 +191,7 @@ void SegLineRendererClass::Set_Texture_Tile_Factor(float factor) ///@todo: I raised this number and didn't see much difference on our min-spec. -MW const static float MAX_LINE_TILING_FACTOR = 50.0f; if (factor > MAX_LINE_TILING_FACTOR) { - WWDEBUG_SAY(("Texture (%s) Tile Factor (%.2f) too large in SegLineRendererClass!\r\n", Get_Texture()->Get_Texture_Name().str(), TextureTileFactor)); + WWDEBUG_SAY(("Texture (%s) Tile Factor (%.2f) too large in SegLineRendererClass!", Get_Texture()->Get_Texture_Name().str(), TextureTileFactor)); factor = MAX_LINE_TILING_FACTOR; } else { factor = MAX(factor, 0.0f); diff --git a/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp b/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp index 0b7a2e5276..1704ac1792 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp @@ -620,7 +620,7 @@ bool PolygonClass::Is_Degenerate(void) int i,j; if (NumVerts <= 2) { - WWDEBUG_SAY(("Degenerate Poly - fewer than 3 vertices\r\n")); + WWDEBUG_SAY(("Degenerate Poly - fewer than 3 vertices")); return true; } @@ -629,7 +629,7 @@ bool PolygonClass::Is_Degenerate(void) float delta = (Verts[i].Position - Verts[j].Position).Length(); if (delta < BPT_COINCIDENCE_EPSILON) { - WWDEBUG_SAY(("Degenerate Poly - coincident vertices!\r\n")); + WWDEBUG_SAY(("Degenerate Poly - coincident vertices!")); return true; } } @@ -643,7 +643,7 @@ bool PolygonClass::Is_Degenerate(void) Compute_Plane(); if (Verts[i].Which_Side(Plane) != BPT_ON) { - WWDEBUG_SAY(("Degenerate Poly - invalid plane!\r\n")); + WWDEBUG_SAY(("Degenerate Poly - invalid plane!")); return true; } } @@ -878,20 +878,20 @@ void ShatterSystem::Shatter_Mesh(MeshClass * mesh,const Vector3 & point,const Ve */ MeshModelClass * model = mesh->Get_Model(); if (model->Get_Pass_Count() > MeshMatDescClass::MAX_PASSES) { - WWDEBUG_SAY(("Failed to shatter model: %s. Too many passes (%d)\n",model->Get_Name(),model->Get_Pass_Count())); + WWDEBUG_SAY(("Failed to shatter model: %s. Too many passes (%d)",model->Get_Name(),model->Get_Pass_Count())); REF_PTR_RELEASE(model); return; } for (ipass=0; ipassGet_Pass_Count(); ipass++) { if (model->Has_Material_Array(ipass) || model->Has_Shader_Array(ipass)) { - WWDEBUG_SAY(("Failed to shatter model: %s. It has shader or material arrays\n",model->Get_Name())); + WWDEBUG_SAY(("Failed to shatter model: %s. It has shader or material arrays",model->Get_Name())); REF_PTR_RELEASE(model); return; } for (istage=0; istageHas_Texture_Array(ipass,istage)) { - WWDEBUG_SAY(("Failed to shatter model: %s. Texture array in pass: %d stage: %d\n",model->Get_Name(),ipass,istage)); + WWDEBUG_SAY(("Failed to shatter model: %s. Texture array in pass: %d stage: %d",model->Get_Name(),ipass,istage)); REF_PTR_RELEASE(model); return; } diff --git a/Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp b/Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp index 48da72ce2e..5fe67a7907 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp @@ -174,7 +174,7 @@ TextureClass * StreakRendererClass::Get_Texture(void) const // { // if (factor > 8.0f) { // factor = 8.0f; -// WWDEBUG_SAY(("Texture Tile Factor too large in StreakRendererClass!\r\n")); +// WWDEBUG_SAY(("Texture Tile Factor too large in StreakRendererClass!")); // } else { // factor = MAX(factor, 0.0f); // } diff --git a/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp b/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp index 101d8ea41f..8cf0e6555e 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp @@ -296,7 +296,7 @@ void Get_WW3D_Format(WW3DFormat& src_format,unsigned& src_bpp,const Targa& targa else src_format = WW3D_FORMAT_A8; break; default: - WWDEBUG_SAY(("TextureClass: Targa has unsupported bitdepth(%i)\n",targa.Header.PixelDepth)); + WWDEBUG_SAY(("TextureClass: Targa has unsupported bitdepth(%i)",targa.Header.PixelDepth)); // WWASSERT(0); break; } diff --git a/Core/Libraries/Source/WWVegas/WWAudio/Sound3D.cpp b/Core/Libraries/Source/WWVegas/WWAudio/Sound3D.cpp index cc5a9aeeb1..1286737a34 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/Sound3D.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/Sound3D.cpp @@ -395,7 +395,7 @@ Sound3DClass::Set_Velocity (const Vector3 &velocity) // if (m_SoundHandle != NULL) { - //WWDEBUG_SAY (("Current Velocity: %.2f %.2f %.2f\n", m_CurrentVelocity.X, m_CurrentVelocity.Y, m_CurrentVelocity.Z)); + //WWDEBUG_SAY (("Current Velocity: %.2f %.2f %.2f", m_CurrentVelocity.X, m_CurrentVelocity.Y, m_CurrentVelocity.Z)); ::AIL_set_3D_velocity_vector (m_SoundHandle->Get_H3DSAMPLE (), -m_CurrentVelocity.Y, m_CurrentVelocity.Z, diff --git a/Core/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp b/Core/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp index 2a523ef0f4..354ec8557c 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp @@ -246,7 +246,7 @@ WWAudioClass::Open_2D_Device (LPWAVEFORMAT format) (m_Driver2D->emulated_ds == TRUE)) { ::AIL_waveOutClose (m_Driver2D); success = 2; - WWDEBUG_SAY (("WWAudio: Detected 2D DirectSound emulation, switching to WaveOut.\r\n")); + WWDEBUG_SAY (("WWAudio: Detected 2D DirectSound emulation, switching to WaveOut.")); } // If we couldn't open the direct sound device, then use the @@ -269,7 +269,7 @@ WWAudioClass::Open_2D_Device (LPWAVEFORMAT format) ReAssign_2D_Handles (); } else { Close_2D_Device (); - WWDEBUG_SAY (("WWAudio: Error initializing 2D device.\r\n")); + WWDEBUG_SAY (("WWAudio: Error initializing 2D device.")); } // Return the opened device type @@ -373,7 +373,7 @@ WWAudioClass::Get_Sound_Buffer (const char *filename, bool is_3d) } else { static int count = 0; if ( ++count < 10 ) { - WWDEBUG_SAY(( "Sound \"%s\" not found\r\n", filename )); + WWDEBUG_SAY(( "Sound \"%s\" not found", filename )); } } Return_File (file); @@ -687,7 +687,7 @@ WWAudioClass::Create_Sound_Effect (const char *filename) if (file && file->Is_Available()) { sound_obj = Create_Sound_Effect (*file, filename); } else { - WWDEBUG_SAY(( "Sound %s not found\r\n", filename )); + WWDEBUG_SAY(( "Sound %s not found", filename )); } Return_File (file); @@ -808,7 +808,7 @@ WWAudioClass::Create_3D_Sound } else { static int count = 0; if ( ++count < 10 ) { - WWDEBUG_SAY(( "Sound File not Found \"%s\"\r\n", filename )); + WWDEBUG_SAY(( "Sound File not Found \"%s\"", filename )); } } @@ -975,7 +975,7 @@ WWAudioClass::Create_Continuous_Sound if (sound != NULL) { if (sound->Get_Loop_Count () != INFINITE_LOOPS) { - WWDEBUG_SAY (("Audio Error: Creating a continuous sound with a finite loop count!\r\n")); + WWDEBUG_SAY (("Audio Error: Creating a continuous sound with a finite loop count!")); } } @@ -1007,7 +1007,7 @@ WWAudioClass::Create_Instant_Sound if (sound != NULL) { if (sound->Get_Loop_Count () == INFINITE_LOOPS) { - WWDEBUG_SAY (("Audio Error: Creating an instant sound %s with an infinite loop count!\r\n",sound->Get_Definition()->Get_Name())); + WWDEBUG_SAY (("Audio Error: Creating an instant sound %s with an infinite loop count!",sound->Get_Definition()->Get_Name())); } sound_id = sound->Get_ID (); @@ -1041,7 +1041,7 @@ WWAudioClass::Create_Continuous_Sound if (sound != NULL) { if (sound->Get_Loop_Count () != INFINITE_LOOPS) { - WWDEBUG_SAY (("Audio Error: Creating a continuous sound with a finite loop count!\r\n")); + WWDEBUG_SAY (("Audio Error: Creating a continuous sound with a finite loop count!")); } } @@ -1074,7 +1074,7 @@ WWAudioClass::Create_Instant_Sound if (sound != NULL) { if (sound->Get_Loop_Count () == INFINITE_LOOPS) { - WWDEBUG_SAY (("Audio Error: Creating an instant sound %s with an infinite loop count!\r\n",sound->Get_Definition()->Get_Name())); + WWDEBUG_SAY (("Audio Error: Creating an instant sound %s with an infinite loop count!",sound->Get_Definition()->Get_Name())); } sound_id = sound->Get_ID (); @@ -1572,8 +1572,8 @@ WWAudioClass::Build_3D_Driver_List (void) ::AIL_close_3D_provider (provider); } else { char *error_info = ::AIL_last_error (); - WWDEBUG_SAY (("WWAudio: Unable to open %s.\r\n", name)); - WWDEBUG_SAY (("WWAudio: Reason %s.\r\n", error_info)); + WWDEBUG_SAY (("WWAudio: Unable to open %s.", name)); + WWDEBUG_SAY (("WWAudio: Reason %s.", error_info)); } } @@ -1741,7 +1741,7 @@ WWAudioClass::Select_3D_Device (int index) // if ((index >= 0) && (index < m_Driver3DList.Count ())) { Select_3D_Device (m_Driver3DList[index]->name, m_Driver3DList[index]->driver); - WWDEBUG_SAY (("WWAudio: Selecting 3D sound device: %s.\r\n", m_Driver3DList[index]->name)); + WWDEBUG_SAY (("WWAudio: Selecting 3D sound device: %s.", m_Driver3DList[index]->name)); retval = true; } @@ -2072,7 +2072,7 @@ WWAudioClass::Is_Disabled (void) const if (registry.Is_Valid ()) { if (registry.Get_Int ("Disabled", 0) == 1) { _disabled = true; - WWDEBUG_SAY (("WWAudio: Audio system disabled in registry.\r\n")); + WWDEBUG_SAY (("WWAudio: Audio system disabled in registry.")); } } } diff --git a/Core/Libraries/Source/WWVegas/WWAudio/sound3dhandle.cpp b/Core/Libraries/Source/WWVegas/WWAudio/sound3dhandle.cpp index 64dd294cd9..56af977788 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/sound3dhandle.cpp +++ b/Core/Libraries/Source/WWVegas/WWAudio/sound3dhandle.cpp @@ -87,7 +87,7 @@ Sound3DHandleClass::Initialize (SoundBufferClass *buffer) // WWASSERT (success != 0); if (success == 0) { - WWDEBUG_SAY (("WWAudio: Couldn't set 3d sample file. Reason %s\r\n", ::AIL_last_error ())); + WWDEBUG_SAY (("WWAudio: Couldn't set 3d sample file. Reason %s", ::AIL_last_error ())); } } diff --git a/Core/Libraries/Source/WWVegas/WWDebug/wwdebug.h b/Core/Libraries/Source/WWVegas/WWDebug/wwdebug.h index c5bff389ba..f0701c0515 100644 --- a/Core/Libraries/Source/WWVegas/WWDebug/wwdebug.h +++ b/Core/Libraries/Source/WWVegas/WWDebug/wwdebug.h @@ -107,7 +107,7 @@ void WWDebug_DBWin32_Message_Handler( const char * message); /* ** Use the following #define so that all of the debugging messages ** and strings go away when the release version is built. -** WWDEBUG_SAY(("dir = %f\n",dir)); +** WWDEBUG_SAY(("dir = %f",dir)); */ // TheSuperHackers @compile feliwir 12/04/2025 Both Debug headers are identical. Use ZH. diff --git a/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp b/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp index 8d620ba71c..aa72e8d203 100644 --- a/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp +++ b/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp @@ -995,7 +995,7 @@ WWTimeItClass::~WWTimeItClass( void ) End -= Time; #ifdef WWDEBUG float time = End * WWProfile_Get_Inv_Processor_Ticks_Per_Second(); - WWDEBUG_SAY(( "*** WWTIMEIT *** %s took %1.9f\n", Name, time )); + WWDEBUG_SAY(( "*** WWTIMEIT *** %s took %1.9f", Name, time )); #endif } diff --git a/Core/Libraries/Source/WWVegas/WWLib/Except.cpp b/Core/Libraries/Source/WWVegas/WWLib/Except.cpp index be4e7ca3bb..fe1d939101 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/Except.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/Except.cpp @@ -176,7 +176,7 @@ int __cdecl _purecall(void) /* ** Use int3 to cause an exception. */ - WWDEBUG_SAY(("Pure Virtual Function call. Oh No!\n")); + WWDEBUG_SAY(("Pure Virtual Function call. Oh No!")); WWDEBUG_BREAK #endif //_DEBUG_ASSERT diff --git a/Core/Libraries/Source/WWVegas/WWLib/TARGA.CPP b/Core/Libraries/Source/WWVegas/WWLib/TARGA.CPP index 2a6808c651..f1358c1d65 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/TARGA.CPP +++ b/Core/Libraries/Source/WWVegas/WWLib/TARGA.CPP @@ -1431,23 +1431,23 @@ long Targa_Error_Handler(long load_err,const char* filename) case 0: return 0; case TGAERR_OPEN: - WWDEBUG_SAY(("Targa: Failed to open file \"%s\"\n", filename)); + WWDEBUG_SAY(("Targa: Failed to open file \"%s\"", filename)); break; case TGAERR_READ: - WWDEBUG_SAY(("Targa: Failed to read file \"%s\"\n", filename)); + WWDEBUG_SAY(("Targa: Failed to read file \"%s\"", filename)); break; case TGAERR_NOTSUPPORTED: - WWDEBUG_SAY(("Targa: File \"%s\" is an unsupported Targa type\n", filename)); + WWDEBUG_SAY(("Targa: File \"%s\" is an unsupported Targa type", filename)); break; case TGAERR_NOMEM: - WWDEBUG_SAY(("Targa: Failed to allocate memory for file \"%s\"\n", filename)); + WWDEBUG_SAY(("Targa: Failed to allocate memory for file \"%s\"", filename)); break; default: - WWDEBUG_SAY(("Targa: Unknown error when loading file \"%s\"\n", filename)); + WWDEBUG_SAY(("Targa: Unknown error when loading file \"%s\"", filename)); break; } return load_err; diff --git a/Core/Libraries/Source/WWVegas/WWLib/thread.cpp b/Core/Libraries/Source/WWVegas/WWLib/thread.cpp index 4c8b2f27ed..6805dd0a6f 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/thread.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/thread.cpp @@ -85,7 +85,7 @@ void ThreadClass::Execute() #else handle=_beginthread(&Internal_Thread_Function,0,this); SetThreadPriority((HANDLE)handle,THREAD_PRIORITY_NORMAL+thread_priority); - WWDEBUG_SAY(("ThreadClass::Execute: Started thread %s, thread ID is %X\n", ThreadName, handle)); + WWDEBUG_SAY(("ThreadClass::Execute: Started thread %s, thread ID is %X", ThreadName, handle)); #endif } diff --git a/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.cpp b/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.cpp index 3692afa822..32c5b6b0fd 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.cpp @@ -1421,7 +1421,7 @@ void AABTreeNodeClass::Select_Splitting_Plane_Brute_Force */ #ifdef WWDEBUG if (sc->Cost == FLT_MAX) { - WWDEBUG_SAY(("Unable to split node! objcount = %d. (%.2f,%.2f,%.2f)\r\n",objcount,Box.Center.X, Box.Center.Y, Box.Center.Z)); + WWDEBUG_SAY(("Unable to split node! objcount = %d. (%.2f,%.2f,%.2f)",objcount,Box.Center.X, Box.Center.Y, Box.Center.Z)); } #endif } diff --git a/Core/Libraries/Source/WWVegas/WWMath/cardinalspline.cpp b/Core/Libraries/Source/WWVegas/WWMath/cardinalspline.cpp index c0cd1c8667..c0ed01f17d 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/cardinalspline.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/cardinalspline.cpp @@ -205,7 +205,7 @@ bool CardinalSpline3DClass::Load(ChunkLoadClass &cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); @@ -344,7 +344,7 @@ bool CardinalSpline1DClass::Load(ChunkLoadClass &cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); diff --git a/Core/Libraries/Source/WWVegas/WWMath/catmullromspline.cpp b/Core/Libraries/Source/WWVegas/WWMath/catmullromspline.cpp index dea6e5251b..0331178df0 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/catmullromspline.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/catmullromspline.cpp @@ -205,7 +205,7 @@ bool CatmullRomSpline3DClass::Load(ChunkLoadClass &cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); @@ -344,7 +344,7 @@ bool CatmullRomSpline1DClass::Load(ChunkLoadClass &cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); diff --git a/Core/Libraries/Source/WWVegas/WWMath/colmathaabox.cpp b/Core/Libraries/Source/WWVegas/WWMath/colmathaabox.cpp index b6ab81da9d..b227c1f237 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/colmathaabox.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/colmathaabox.cpp @@ -587,7 +587,7 @@ bool CollisionMath::Collide(const AABoxClass & box,const Vector3 & move,const AA if (result->ComputeContactPoint) { //WWASSERT(0); // TODO - WWDEBUG_SAY(("AABox-AABox collision does not currently support contact point computation\r\n")); + WWDEBUG_SAY(("AABox-AABox collision does not currently support contact point computation")); } return true; diff --git a/Core/Libraries/Source/WWVegas/WWMath/curve.cpp b/Core/Libraries/Source/WWVegas/WWMath/curve.cpp index 8d3fd2c964..9767491321 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/curve.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/curve.cpp @@ -252,7 +252,7 @@ bool Curve3DClass::Load(ChunkLoadClass & cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); @@ -312,7 +312,7 @@ bool LinearCurve3DClass::Load(ChunkLoadClass & cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); @@ -520,7 +520,7 @@ bool Curve1DClass::Load(ChunkLoadClass & cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); @@ -579,7 +579,7 @@ bool LinearCurve1DClass::Load(ChunkLoadClass & cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); diff --git a/Core/Libraries/Source/WWVegas/WWMath/hermitespline.cpp b/Core/Libraries/Source/WWVegas/WWMath/hermitespline.cpp index c3ef9545dd..ca22fb0a6a 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/hermitespline.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/hermitespline.cpp @@ -258,7 +258,7 @@ bool HermiteSpline3DClass::Load(ChunkLoadClass &cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); @@ -425,7 +425,7 @@ bool HermiteSpline1DClass::Load(ChunkLoadClass &cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); diff --git a/Core/Libraries/Source/WWVegas/WWMath/lookuptable.cpp b/Core/Libraries/Source/WWVegas/WWMath/lookuptable.cpp index d686d0cc33..86daa51739 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/lookuptable.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/lookuptable.cpp @@ -232,7 +232,7 @@ void LookupTableMgrClass::Load_Table_Desc break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); diff --git a/Core/Libraries/Source/WWVegas/WWMath/matrix3d.cpp b/Core/Libraries/Source/WWVegas/WWMath/matrix3d.cpp index 9d4e614c7b..f7543241c7 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/matrix3d.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/matrix3d.cpp @@ -947,11 +947,11 @@ void Matrix3D::Multiply(const Matrix3D & A,const Matrix3D & B,Matrix3D * set_res } /* - WWDEBUG_SAY(("{%2.2f, %2.2f, %2.2f, %2.2f}, {%2.2f, %2.2f, %2.2f, %2.2f}, {%2.2f, %2.2f, %2.2f, %2.2f}\n" + WWDEBUG_SAY(("{%2.2f, %2.2f, %2.2f, %2.2f}, {%2.2f, %2.2f, %2.2f, %2.2f}, {%2.2f, %2.2f, %2.2f, %2.2f}" ,res[0][0],res[0][1],res[0][2],res[0][3] ,res[1][0],res[1][1],res[1][2],res[1][3] ,res[2][0],res[2][1],res[2][2],res[2][3])); - WWDEBUG_SAY(("{%2.2f, %2.2f, %2.2f, %2.2f}, {%2.2f, %2.2f, %2.2f, %2.2f}, {%2.2f, %2.2f, %2.2f, %2.2f}\n" + WWDEBUG_SAY(("{%2.2f, %2.2f, %2.2f, %2.2f}, {%2.2f, %2.2f, %2.2f, %2.2f}, {%2.2f, %2.2f, %2.2f, %2.2f}" ,res2[0][0],res2[0][1],res2[0][2],res2[0][3] ,res2[1][0],res2[1][1],res2[1][2],res2[1][3] ,res2[2][0],res2[2][1],res2[2][2],res2[2][3])); @@ -961,7 +961,7 @@ void Matrix3D::Multiply(const Matrix3D & A,const Matrix3D & B,Matrix3D * set_res /* for (int y=0;y<3;++y) { for (int x=0;x<4;++x) { if (fabs(res2[y][x]-res[y][x])>0.001f) { - WWDEBUG_SAY(("x: %d, y: %d, %f != %f\n",x,y,res2[y][x],res[y][x])); + WWDEBUG_SAY(("x: %d, y: %d, %f != %f",x,y,res2[y][x],res[y][x])); __asm nop } } diff --git a/Core/Libraries/Source/WWVegas/WWMath/tcbspline.cpp b/Core/Libraries/Source/WWVegas/WWMath/tcbspline.cpp index bfbb8f2b9b..6d0282cdc4 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/tcbspline.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/tcbspline.cpp @@ -238,7 +238,7 @@ bool TCBSpline3DClass::Load(ChunkLoadClass &cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionmgr.cpp b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionmgr.cpp index f189f47f54..5ab7beba5a 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionmgr.cpp +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/definitionmgr.cpp @@ -227,7 +227,7 @@ DefinitionMgrClass::Find_Typed_Definition (const char *name, uint32 class_id, bo // Sanity check // if (DefinitionHash == NULL) { - WWDEBUG_SAY (("DefinitionMgrClass::Find_Typed_Definition () failed due to a NULL DefinitionHash.\n")); + WWDEBUG_SAY (("DefinitionMgrClass::Find_Typed_Definition () failed due to a NULL DefinitionHash.")); return NULL; } @@ -321,11 +321,11 @@ DefinitionMgrClass::List_Available_Definitions (void) // // Loop through all the definitions and print the definition name // - WWDEBUG_SAY(("Available definitions:\n")); + WWDEBUG_SAY(("Available definitions:")); for (int index = 0; index < _DefinitionCount; index ++) { DefinitionClass *curr_def = _SortedDefinitionArray[index]; if (curr_def != NULL) { - WWDEBUG_SAY((" >%s<\n", curr_def->Get_Name ())); + WWDEBUG_SAY((" >%s<", curr_def->Get_Name ())); } } @@ -344,13 +344,13 @@ DefinitionMgrClass::List_Available_Definitions (int superclass_id) // // Loop through all the definitions and print the definition name // - WWDEBUG_SAY(("Available superclass definitions for 0x%8X:\n", superclass_id)); + WWDEBUG_SAY(("Available superclass definitions for 0x%8X:", superclass_id)); DefinitionClass *definition = NULL; for ( definition = Get_First (superclass_id, DefinitionMgrClass::ID_SUPERCLASS); definition != NULL; definition = Get_Next (definition, superclass_id, DefinitionMgrClass::ID_SUPERCLASS)) { - WWDEBUG_SAY((" >%s<\n", definition->Get_Name ())); + WWDEBUG_SAY((" >%s<", definition->Get_Name ())); } return ; diff --git a/Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.cpp b/Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.cpp index 5fc6917664..aeae1068e1 100644 --- a/Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.cpp +++ b/Core/Libraries/Source/WWVegas/WWSaveLoad/pointerremap.cpp @@ -119,7 +119,7 @@ void PointerRemapClass::Process_Request_Table(DynamicVectorClass #ifdef WWDEBUG const char * file = request_table[pointer_index].File; int line = request_table[pointer_index].Line; - WWDEBUG_SAY(("Warning! Failed to re-map pointer! old_ptr = 0x%X file = %s line = %d\r\n",(unsigned int)pointer_to_remap,file,line)); + WWDEBUG_SAY(("Warning! Failed to re-map pointer! old_ptr = 0x%X file = %s line = %d",(unsigned int)pointer_to_remap,file,line)); WWASSERT( 0 ); #endif } diff --git a/Core/Tools/W3DView/AnimatedSoundOptionsDialog.cpp b/Core/Tools/W3DView/AnimatedSoundOptionsDialog.cpp index 189ed5b8ee..cef0220dcd 100644 --- a/Core/Tools/W3DView/AnimatedSoundOptionsDialog.cpp +++ b/Core/Tools/W3DView/AnimatedSoundOptionsDialog.cpp @@ -211,7 +211,7 @@ AnimatedSoundOptionsDialogClass::Load_Animated_Sound_Settings (void) file->Close (); _TheFileFactory->Return_File (file); } else { - WWDEBUG_SAY (("Failed to load file %s\n", sound_def_lib_path.str ())); + WWDEBUG_SAY (("Failed to load file %s", sound_def_lib_path.str ())); } // diff --git a/Core/Tools/WW3D/max2w3d/TARGA.CPP b/Core/Tools/WW3D/max2w3d/TARGA.CPP index 17fcfb44cb..91c7c78782 100644 --- a/Core/Tools/WW3D/max2w3d/TARGA.CPP +++ b/Core/Tools/WW3D/max2w3d/TARGA.CPP @@ -1374,23 +1374,23 @@ long Targa_Error_Handler(long load_err,const char* filename) case 0: return 0; case TGAERR_OPEN: -// WWDEBUG_SAY(("Targa: Failed to open file \"%s\"\n", filename)); +// WWDEBUG_SAY(("Targa: Failed to open file \"%s\"", filename)); break; case TGAERR_READ: -// WWDEBUG_SAY(("Targa: Failed to read file \"%s\"\n", filename)); +// WWDEBUG_SAY(("Targa: Failed to read file \"%s\"", filename)); break; case TGAERR_NOTSUPPORTED: -// WWDEBUG_SAY(("Targa: File \"%s\" is an unsupported Targa type\n", filename)); +// WWDEBUG_SAY(("Targa: File \"%s\" is an unsupported Targa type", filename)); break; case TGAERR_NOMEM: -// WWDEBUG_SAY(("Targa: Failed to allocate memory for file \"%s\"\n", filename)); +// WWDEBUG_SAY(("Targa: Failed to allocate memory for file \"%s\"", filename)); break; default: -// WWDEBUG_SAY(("Targa: Unknown error when loading file \"%s\"\n", filename)); +// WWDEBUG_SAY(("Targa: Unknown error when loading file \"%s\"", filename)); break; } return load_err; diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp index 484d371ba1..595e15bdc8 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp @@ -763,7 +763,7 @@ RenderObjClass * W3DAssetManager::Create_Render_Obj( static int warning_count = 0; if (++warning_count <= 20) { - WWDEBUG_SAY(("WARNING: Failed to create Render Object: %s\r\n",name)); + WWDEBUG_SAY(("WARNING: Failed to create Render Object: %s",name)); } #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); @@ -1372,7 +1372,7 @@ RenderObjClass * W3DAssetManager::Create_Render_Obj(const char * name,float scal if (proto == NULL) { static int warning_count = 0; if (++warning_count <= 20) { - WWDEBUG_SAY(("WARNING: Failed to create Render Object: %s\r\n",name)); + WWDEBUG_SAY(("WARNING: Failed to create Render Object: %s",name)); } return NULL; // Failed to find a prototype } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/animobj.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/animobj.cpp index fe4e4753cc..1503601ed7 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/animobj.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/animobj.cpp @@ -114,7 +114,7 @@ Animatable3DObjClass::Animatable3DObjClass(const char * htree_name) : if (source != NULL) { HTree = W3DNEW HTreeClass(*source); } else { - WWDEBUG_SAY(("Unable to find HTree: %s\r\n",htree_name)); + WWDEBUG_SAY(("Unable to find HTree: %s",htree_name)); HTree = W3DNEW HTreeClass; HTree->Init_Default(); } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp index a3712b62d4..fb382bed1d 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp @@ -352,7 +352,7 @@ static void Log_Textures(bool inited,unsigned& total_count, unsigned& total_mem) StringClass number; Create_Number_String(number,texmem); - WWDEBUG_SAY(("%32s %4d * %4d (%15s), init %d, size: %14s bytes, refs: %d\n", + WWDEBUG_SAY(("%32s %4d * %4d (%15s), init %d, size: %14s bytes, refs: %d", tex->Get_Texture_Name().str(), desc.Width, desc.Height, @@ -372,19 +372,19 @@ void WW3DAssetManager::Log_Texture_Statistics() unsigned total_uninitialized_count=0; StringClass number; - WWDEBUG_SAY(("\nInitialized textures ------------------------------------------\n\n")); + WWDEBUG_SAY(("\nInitialized textures ------------------------------------------\n")); Log_Textures(true,total_initialized_count,total_initialized_tex_mem); Create_Number_String(number,total_initialized_tex_mem); - WWDEBUG_SAY(("\n%d initialized textures, totalling %14s bytes\n\n", + WWDEBUG_SAY(("\n%d initialized textures, totalling %14s bytes\n", total_initialized_count, number.str())); - WWDEBUG_SAY(("\nUn-initialized textures ---------------------------------------\n\n")); + WWDEBUG_SAY(("\nUn-initialized textures ---------------------------------------\n")); Log_Textures(false,total_uninitialized_count,total_uninitialized_tex_mem); Create_Number_String(number,total_uninitialized_tex_mem); - WWDEBUG_SAY(("\n%d un-initialized textures, totalling, totalling %14s bytes\n\n", + WWDEBUG_SAY(("\n%d un-initialized textures, totalling, totalling %14s bytes\n", total_uninitialized_count, number.str())); /* @@ -397,7 +397,7 @@ void WW3DAssetManager::Log_Texture_Statistics() // robj->Release_Ref(); // } if (rite->Current_Item_Class_ID()==RenderObjClass::CLASSID_HMODEL) { - WWDEBUG_SAY(("robj: %s\n",rite->Current_Item_Name())); + WWDEBUG_SAY(("robj: %s",rite->Current_Item_Name())); } } @@ -531,10 +531,10 @@ void WW3DAssetManager::Free_Assets_With_Exclusion_List(const DynamicVectorClass< // If this prototype is excluded, copy the pointer, otherwise delete it. if (exclusion_list.Is_Excluded(proto)) { - //WWDEBUG_SAY(("excluding %s\n",proto->Get_Name())); + //WWDEBUG_SAY(("excluding %s",proto->Get_Name())); exclude_array.Add(proto); } else { - //WWDEBUG_SAY(("deleting %s\n",proto->Get_Name())); + //WWDEBUG_SAY(("deleting %s",proto->Get_Name())); proto->DeleteSelf(); } Prototypes[i] = NULL; @@ -621,7 +621,7 @@ bool WW3DAssetManager::Load_3D_Assets( const char * filename ) if ( file->Is_Available() ) { result = WW3DAssetManager::Load_3D_Assets( *file ); } else { - WWDEBUG_SAY(("Missing asset '%s'.\n", filename)); + WWDEBUG_SAY(("Missing asset '%s'.", filename)); } _TheFileFactory->Return_File( file ); } @@ -722,7 +722,7 @@ bool WW3DAssetManager::Load_Prototype(ChunkLoadClass & cload) /* ** Warn user about an unknown chunk type */ - WWDEBUG_SAY(("Unknown chunk type encountered! Chunk Id = %d\r\n",chunk_id)); + WWDEBUG_SAY(("Unknown chunk type encountered! Chunk Id = %d",chunk_id)); return false; } @@ -745,7 +745,7 @@ bool WW3DAssetManager::Load_Prototype(ChunkLoadClass & cload) ** Warn the user about a name collision with this prototype ** and dump it */ - WWDEBUG_SAY(("Render Object Name Collision: %s\r\n",newproto->Get_Name())); + WWDEBUG_SAY(("Render Object Name Collision: %s",newproto->Get_Name())); newproto->DeleteSelf(); newproto = NULL; return false; @@ -757,7 +757,7 @@ bool WW3DAssetManager::Load_Prototype(ChunkLoadClass & cload) ** Warn user that a prototype was not generated from this ** chunk type */ - WWDEBUG_SAY(("Could not generate prototype! Chunk = %d\r\n",chunk_id)); + WWDEBUG_SAY(("Could not generate prototype! Chunk = %d",chunk_id)); return false; } @@ -815,7 +815,7 @@ RenderObjClass * WW3DAssetManager::Create_Render_Obj(const char * name) // Note - objects named "#..." are scaled cached objects, so don't warn... if (name[0] != '#') { if (++warning_count <= 20) { - WWDEBUG_SAY(("WARNING: Failed to create Render Object: %s\r\n",name)); + WWDEBUG_SAY(("WARNING: Failed to create Render Object: %s",name)); } AssetStatusClass::Peek_Instance()->Report_Missing_RObj(name); } @@ -977,7 +977,7 @@ HAnimClass * WW3DAssetManager::Get_HAnim(const char * name) if (animname != NULL) { sprintf( filename, "%s.w3d", animname+1); } else { - WWDEBUG_SAY(( "Animation %s has no . in the name\n", name )); + WWDEBUG_SAY(( "Animation %s has no . in the name", name )); WWASSERT( 0 ); return NULL; } @@ -1281,7 +1281,7 @@ void WW3DAssetManager::Log_All_Textures(void) else { tmp+=" "; } - WWDEBUG_SAY(("%4.4dkb %s%s\n",bytes/1024,tmp.str(),t->Get_Texture_Name().str())); + WWDEBUG_SAY(("%4.4dkb %s%s",bytes/1024,tmp.str(),t->Get_Texture_Name().str())); } // Log procedural textures ------------------------------- @@ -1305,7 +1305,7 @@ void WW3DAssetManager::Log_All_Textures(void) else { tmp+=" "; } - WWDEBUG_SAY(("%4.4dkb %s%s\n",bytes/1024,tmp.str(),t->Get_Texture_Name().str())); + WWDEBUG_SAY(("%4.4dkb %s%s",bytes/1024,tmp.str(),t->Get_Texture_Name().str())); } // Log "ordinary" textures ------------------------------- @@ -1330,7 +1330,7 @@ void WW3DAssetManager::Log_All_Textures(void) else { tmp+=" "; } - WWDEBUG_SAY(("%4.4dkb %s%s\n",bytes/1024,tmp.str(),t->Get_Texture_Name().str())); + WWDEBUG_SAY(("%4.4dkb %s%s",bytes/1024,tmp.str(),t->Get_Texture_Name().str())); } } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp index a9a6365b05..3e5cf53b47 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp @@ -1379,7 +1379,7 @@ PersistClass * DazzlePersistFactoryClass::Load(ChunkLoadClass & cload) const break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; }; cload.Close_Chunk(); @@ -1400,8 +1400,8 @@ PersistClass * DazzlePersistFactoryClass::Load(ChunkLoadClass & cload) const if (new_obj == NULL) { static int count = 0; if ( ++count < 10 ) { - WWDEBUG_SAY(("DazzlePersistFactory failed to create dazzle of type: %s!!\r\n",dazzle_type)); - WWDEBUG_SAY(("Replacing it with a NULL render object!\r\n")); + WWDEBUG_SAY(("DazzlePersistFactory failed to create dazzle of type: %s!!",dazzle_type)); + WWDEBUG_SAY(("Replacing it with a NULL render object!")); } new_obj = WW3DAssetManager::Get_Instance()->Create_Render_Obj("NULL"); } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp index ed9818a737..07c0b48f29 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp @@ -189,7 +189,7 @@ DDSFileClass::DDSFileClass(const char* name,unsigned reduction_factor) // be a problem. The new version of ddsfile from Vegas actually has removed this check entirely. int expected_size=level_offset+SurfaceDesc.Size+4; if (expected_size!=file->Size()) { - WWDEBUG_SAY(("Warning: file % size is not consistent with the data (file size should be %d but was %d)\n",Name,expected_size,file->Size())); + WWDEBUG_SAY(("Warning: file % size is not consistent with the data (file size should be %d but was %d)",Name,expected_size,file->Size())); } #endif file->Close(); @@ -518,7 +518,7 @@ void DDSFileClass::Copy_Level_To_Surface } } if (Format==WW3D_FORMAT_DXT1 && contains_alpha) { - WWDEBUG_SAY(("Warning: DXT1 format should not contain alpha information - file %s\n",Name)); + WWDEBUG_SAY(("Warning: DXT1 format should not contain alpha information - file %s",Name)); } } } @@ -696,7 +696,7 @@ void DDSFileClass::Copy_CubeMap_Level_To_Surface } if (Format==WW3D_FORMAT_DXT1 && contains_alpha) { - WWDEBUG_SAY(("Warning: DXT1 format should not contain alpha information - file %s\n",Name)); + WWDEBUG_SAY(("Warning: DXT1 format should not contain alpha information - file %s",Name)); } } } @@ -873,7 +873,7 @@ void DDSFileClass::Copy_Volume_Level_To_Surface } if (Format==WW3D_FORMAT_DXT1 && contains_alpha) { - WWDEBUG_SAY(("Warning: DXT1 format should not contain alpha information - file %s\n",Name)); + WWDEBUG_SAY(("Warning: DXT1 format should not contain alpha information - file %s",Name)); } }*/ } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp index ab8407a21d..8988c3e507 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp @@ -779,7 +779,7 @@ void SkinDecalMeshClass::Render(void) */ MeshModelClass * model = Parent->Peek_Model(); if (model->Get_Flag(MeshModelClass::SORT)) { - WWDEBUG_SAY(("ERROR: decals applied to a sorted mesh!\n")); + WWDEBUG_SAY(("ERROR: decals applied to a sorted mesh!")); return; } @@ -1015,7 +1015,7 @@ bool SkinDecalMeshClass::Create_Decal(DecalGeneratorClass * generator, } #endif - // WWDEBUG_SAY(("Decal mesh now has: %d polys\r\n",Polys.Count())); + // WWDEBUG_SAY(("Decal mesh now has: %d polys",Polys.Count())); return true; } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.cpp index 5d2ff01c2c..0eed167a62 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.cpp @@ -79,8 +79,8 @@ IndexBufferClass::IndexBufferClass(unsigned type_, unsigned short index_count_) _IndexBufferTotalIndices+=index_count; _IndexBufferTotalSize+=index_count*sizeof(unsigned short); #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("New IB, %d indices, size %d bytes\n",index_count,index_count*sizeof(unsigned short))); - WWDEBUG_SAY(("Total IB count: %d, total %d indices, total size %d bytes\n", + WWDEBUG_SAY(("New IB, %d indices, size %d bytes",index_count,index_count*sizeof(unsigned short))); + WWDEBUG_SAY(("Total IB count: %d, total %d indices, total size %d bytes", _IndexBufferCount, _IndexBufferTotalIndices, _IndexBufferTotalSize)); @@ -93,8 +93,8 @@ IndexBufferClass::~IndexBufferClass() _IndexBufferTotalIndices-=index_count; _IndexBufferTotalSize-=index_count*sizeof(unsigned short); #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("Delete IB, %d indices, size %d bytes\n",index_count,index_count*sizeof(unsigned short))); - WWDEBUG_SAY(("Total IB count: %d, total %d indices, total size %d bytes\n", + WWDEBUG_SAY(("Delete IB, %d indices, size %d bytes",index_count,index_count*sizeof(unsigned short))); + WWDEBUG_SAY(("Total IB count: %d, total %d indices, total size %d bytes", _IndexBufferCount, _IndexBufferTotalIndices, _IndexBufferTotalSize)); diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp index 4b8c03d26a..51674398f1 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp @@ -724,18 +724,18 @@ void DX8RigidFVFCategoryContainer::Log(bool only_visible) WWDEBUG_SAY((work)); } else { - WWDEBUG_SAY(("EMPTY VB\n")); + WWDEBUG_SAY(("EMPTY VB")); } if (index_buffer) { work.Format("IB size (used/total): %d/%d\n",used_indices,index_buffer->Get_Index_Count()); WWDEBUG_SAY((work)); } else { - WWDEBUG_SAY(("EMPTY IB\n")); + WWDEBUG_SAY(("EMPTY IB")); } for (unsigned p=0;pGet_Name(),mmc->Get_Polygon_Count(),mmc->Get_Vertex_Count(),mmc->Get_Gap_Filler_Polygon_Count())); + WWDEBUG_SAY(("Registering mesh: %s (%d polys, %d verts + %d gap polygons)",mmc->Get_Name(),mmc->Get_Polygon_Count(),mmc->Get_Vertex_Count(),mmc->Get_Gap_Filler_Polygon_Count())); #endif bool skin=(mmc->Get_Flag(MeshModelClass::SKIN) && mmc->VertexBoneLink); bool sorting=((!!mmc->Get_Flag(MeshModelClass::SORT)) && WW3D::Is_Sorting_Enabled()); @@ -2051,7 +2051,7 @@ void DX8MeshRendererClass::Register_Mesh_Type(MeshModelClass* mmc) _RegisteredMeshList.Add_Tail(mmc); } else { - WWDEBUG_SAY(("Error: Register_Mesh_Type failed! file: %s line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Error: Register_Mesh_Type failed! file: %s line: %d",__FILE__,__LINE__)); } } } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp index 54aa268ed5..bf541e8073 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp @@ -86,8 +86,8 @@ VertexBufferClass::VertexBufferClass(unsigned type_, unsigned FVF, unsigned shor _VertexBufferTotalVertices+=VertexCount; _VertexBufferTotalSize+=VertexCount*fvf_info->Get_FVF_Size(); #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("New VB, %d vertices, size %d bytes\n",VertexCount,VertexCount*fvf_info->Get_FVF_Size())); - WWDEBUG_SAY(("Total VB count: %d, total %d vertices, total size %d bytes\n", + WWDEBUG_SAY(("New VB, %d vertices, size %d bytes",VertexCount,VertexCount*fvf_info->Get_FVF_Size())); + WWDEBUG_SAY(("Total VB count: %d, total %d vertices, total size %d bytes", _VertexBufferCount, _VertexBufferTotalVertices, _VertexBufferTotalSize)); @@ -103,8 +103,8 @@ VertexBufferClass::~VertexBufferClass() _VertexBufferTotalSize-=VertexCount*fvf_info->Get_FVF_Size(); #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("Delete VB, %d vertices, size %d bytes\n",VertexCount,VertexCount*fvf_info->Get_FVF_Size())); - WWDEBUG_SAY(("Total VB count: %d, total %d vertices, total size %d bytes\n", + WWDEBUG_SAY(("Delete VB, %d vertices, size %d bytes",VertexCount,VertexCount*fvf_info->Get_FVF_Size())); + WWDEBUG_SAY(("Total VB count: %d, total %d vertices, total size %d bytes", _VertexBufferCount, _VertexBufferTotalVertices, _VertexBufferTotalSize)); @@ -163,7 +163,7 @@ VertexBufferClass::WriteLockClass::WriteLockClass(VertexBufferClass* VertexBuffe { StringClass fvf_name; VertexBuffer->FVF_Info().Get_FVF_Name(fvf_name); - WWDEBUG_SAY(("VertexBuffer->Lock(start_index: 0, index_range: 0(%d), fvf_size: %d, fvf: %s)\n", + WWDEBUG_SAY(("VertexBuffer->Lock(start_index: 0, index_range: 0(%d), fvf_size: %d, fvf: %s)", VertexBuffer->Get_Vertex_Count(), VertexBuffer->FVF_Info().Get_FVF_Size(), fvf_name)); @@ -193,7 +193,7 @@ VertexBufferClass::WriteLockClass::~WriteLockClass() switch (VertexBuffer->Type()) { case BUFFER_TYPE_DX8: #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("VertexBuffer->Unlock()\n")); + WWDEBUG_SAY(("VertexBuffer->Unlock()")); #endif DX8_Assert(); DX8_ErrorCode(static_cast(VertexBuffer)->Get_DX8_Vertex_Buffer()->Unlock()); @@ -228,7 +228,7 @@ VertexBufferClass::AppendLockClass::AppendLockClass(VertexBufferClass* VertexBuf { StringClass fvf_name; VertexBuffer->FVF_Info().Get_FVF_Name(fvf_name); - WWDEBUG_SAY(("VertexBuffer->Lock(start_index: %d, index_range: %d, fvf_size: %d, fvf: %s)\n", + WWDEBUG_SAY(("VertexBuffer->Lock(start_index: %d, index_range: %d, fvf_size: %d, fvf: %s)", start_index, index_range, VertexBuffer->FVF_Info().Get_FVF_Size(), @@ -260,7 +260,7 @@ VertexBufferClass::AppendLockClass::~AppendLockClass() case BUFFER_TYPE_DX8: DX8_Assert(); #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("VertexBuffer->Unlock()\n")); + WWDEBUG_SAY(("VertexBuffer->Unlock()")); #endif DX8_ErrorCode(static_cast(VertexBuffer)->Get_DX8_Vertex_Buffer()->Unlock()); break; @@ -395,9 +395,9 @@ DX8VertexBufferClass::DX8VertexBufferClass( DX8VertexBufferClass::~DX8VertexBufferClass() { #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("VertexBuffer->Release()\n")); + WWDEBUG_SAY(("VertexBuffer->Release()")); _DX8VertexBufferCount--; - WWDEBUG_SAY(("Current vertex buffer count: %d\n",_DX8VertexBufferCount)); + WWDEBUG_SAY(("Current vertex buffer count: %d",_DX8VertexBufferCount)); #endif VertexBuffer->Release(); } @@ -416,7 +416,7 @@ void DX8VertexBufferClass::Create_Vertex_Buffer(UsageType usage) #ifdef VERTEX_BUFFER_LOG StringClass fvf_name; FVF_Info().Get_FVF_Name(fvf_name); - WWDEBUG_SAY(("CreateVertexBuffer(fvfsize=%d, vertex_count=%d, D3DUSAGE_WRITEONLY|%s|%s, fvf: %s, %s)\n", + WWDEBUG_SAY(("CreateVertexBuffer(fvfsize=%d, vertex_count=%d, D3DUSAGE_WRITEONLY|%s|%s, fvf: %s, %s)", FVF_Info().Get_FVF_Size(), VertexCount, usage&USAGE_DYNAMIC ? "D3DUSAGE_DYNAMIC" : "-", @@ -424,7 +424,7 @@ void DX8VertexBufferClass::Create_Vertex_Buffer(UsageType usage) fvf_name, dynamic ? "D3DPOOL_DEFAULT" : "D3DPOOL_MANAGED")); _DX8VertexBufferCount++; - WWDEBUG_SAY(("Current vertex buffer count: %d\n",_DX8VertexBufferCount)); + WWDEBUG_SAY(("Current vertex buffer count: %d",_DX8VertexBufferCount)); #endif unsigned usage_flags= @@ -448,7 +448,7 @@ void DX8VertexBufferClass::Create_Vertex_Buffer(UsageType usage) return; } - WWDEBUG_SAY(("Vertex buffer creation failed, trying to release assets...\n")); + WWDEBUG_SAY(("Vertex buffer creation failed, trying to release assets...")); // Vertex buffer creation failed. Must be out of memory. Try releasing all our D3D assets and re-creating // them. @@ -468,7 +468,7 @@ void DX8VertexBufferClass::Create_Vertex_Buffer(UsageType usage) &VertexBuffer); if (SUCCEEDED(ret)) { - WWDEBUG_SAY(("...Vertex buffer creation succesful\n")); + WWDEBUG_SAY(("...Vertex buffer creation succesful")); } // If it still fails it is fatal @@ -829,7 +829,7 @@ DynamicVBAccessClass::WriteLockClass::WriteLockClass(DynamicVBAccessClass* dynam dx8_lock++; StringClass fvf_name; DynamicVBAccess->VertexBuffer->FVF_Info().Get_FVF_Name(fvf_name); - WWDEBUG_SAY(("DynamicVertexBuffer->Lock(start_index: %d, index_range: %d, fvf_size: %d, fvf: %s)\n", + WWDEBUG_SAY(("DynamicVertexBuffer->Lock(start_index: %d, index_range: %d, fvf_size: %d, fvf: %s)", DynamicVBAccess->VertexBufferOffset, DynamicVBAccess->Get_Vertex_Count(), DynamicVBAccess->VertexBuffer->FVF_Info().Get_FVF_Size(), @@ -868,7 +868,7 @@ DynamicVBAccessClass::WriteLockClass::~WriteLockClass() #ifdef VERTEX_BUFFER_LOG dx8_lock--; WWASSERT(!dx8_lock); - WWDEBUG_SAY(("DynamicVertexBuffer->Unlock()\n")); + WWDEBUG_SAY(("DynamicVertexBuffer->Unlock()")); #endif DX8_Assert(); DX8_ErrorCode(static_cast(DynamicVBAccess->VertexBuffer)->Get_DX8_Vertex_Buffer()->Unlock()); diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp index 0768a1be95..6571079b48 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp @@ -231,7 +231,7 @@ void Non_Fatal_Log_DX8_ErrorCode(unsigned res,const char * file,int line) sizeof(tmp)); if (new_res==D3D_OK) { - WWDEBUG_SAY(("DX8 Error: %s, File: %s, Line: %d\n",tmp,file,line)); + WWDEBUG_SAY(("DX8 Error: %s, File: %s, Line: %d",tmp,file,line)); } } @@ -269,7 +269,7 @@ bool DX8Wrapper::Init(void * hwnd, bool lite) */ _Hwnd = (HWND)hwnd; _MainThreadID=ThreadClass::_Get_Current_Thread_ID(); - WWDEBUG_SAY(("DX8Wrapper main thread: 0x%x\n",_MainThreadID)); + WWDEBUG_SAY(("DX8Wrapper main thread: 0x%x",_MainThreadID)); CurRenderDevice = -1; ResolutionWidth = DEFAULT_RESOLUTION_WIDTH; ResolutionHeight = DEFAULT_RESOLUTION_HEIGHT; @@ -295,7 +295,7 @@ bool DX8Wrapper::Init(void * hwnd, bool lite) D3DInterface = NULL; D3DDevice = NULL; - WWDEBUG_SAY(("Reset DX8Wrapper statistics\n")); + WWDEBUG_SAY(("Reset DX8Wrapper statistics")); Reset_Statistics(); Invalidate_Cached_Render_States(); @@ -311,7 +311,7 @@ bool DX8Wrapper::Init(void * hwnd, bool lite) /* ** Create the D3D interface object */ - WWDEBUG_SAY(("Create Direct3D8\n")); + WWDEBUG_SAY(("Create Direct3D8")); D3DInterface = Direct3DCreate8Ptr(D3D_SDK_VERSION); // TODO: handle failure cases... if (D3DInterface == NULL) { return(false); @@ -321,9 +321,9 @@ bool DX8Wrapper::Init(void * hwnd, bool lite) /* ** Enumerate the available devices */ - WWDEBUG_SAY(("Enumerate devices\n")); + WWDEBUG_SAY(("Enumerate devices")); Enumerate_Devices(); - WWDEBUG_SAY(("DX8Wrapper Init completed\n")); + WWDEBUG_SAY(("DX8Wrapper Init completed")); } return(true); @@ -584,7 +584,7 @@ bool DX8Wrapper::Create_Device(void) bool DX8Wrapper::Reset_Device(bool reload_assets) { - WWDEBUG_SAY(("Resetting device.\n")); + WWDEBUG_SAY(("Resetting device.")); DX8_THREAD_ASSERT(); if ((IsInitted) && (D3DDevice != NULL)) { // Release all non-MANAGED stuff @@ -618,10 +618,10 @@ bool DX8Wrapper::Reset_Device(bool reload_assets) } Invalidate_Cached_Render_States(); Set_Default_Global_Render_States(); - WWDEBUG_SAY(("Device reset completed\n")); + WWDEBUG_SAY(("Device reset completed")); return true; } - WWDEBUG_SAY(("Device reset failed\n")); + WWDEBUG_SAY(("Device reset failed")); return false; } @@ -907,7 +907,7 @@ bool DX8Wrapper::Set_Render_Device(int dev, int width, int height, int bits, int if (windowed != -1) IsWindowed = (windowed != 0); DX8Wrapper_IsWindowed = IsWindowed; - WWDEBUG_SAY(("Attempting Set_Render_Device: name: %s (%s:%s), width: %d, height: %d, windowed: %d\n", + WWDEBUG_SAY(("Attempting Set_Render_Device: name: %s (%s:%s), width: %d, height: %d, windowed: %d", _RenderDeviceNameTable[CurRenderDevice].str(),_RenderDeviceDescriptionTable[CurRenderDevice].Get_Driver_Name(), _RenderDeviceDescriptionTable[CurRenderDevice].Get_Driver_Version(),ResolutionWidth,ResolutionHeight,(IsWindowed ? 1 : 0))); @@ -1023,19 +1023,19 @@ bool DX8Wrapper::Set_Render_Device(int dev, int width, int height, int bits, int Get_Format_Name(DisplayFormat,&displayFormat); Get_Format_Name(_PresentParameters.BackBufferFormat,&backbufferFormat); - WWDEBUG_SAY(("Using Display/BackBuffer Formats: %s/%s\n",displayFormat.str(),backbufferFormat.str())); + WWDEBUG_SAY(("Using Display/BackBuffer Formats: %s/%s",displayFormat.str(),backbufferFormat.str())); bool ret; if (reset_device) { - WWDEBUG_SAY(("DX8Wrapper::Set_Render_Device is resetting the device.\n")); + WWDEBUG_SAY(("DX8Wrapper::Set_Render_Device is resetting the device.")); ret = Reset_Device(restore_assets); //reset device without restoring data - we're likely switching out of the app. } else ret = Create_Device(); - WWDEBUG_SAY(("Reset/Create_Device done, reset_device=%d, restore_assets=%d\n", reset_device, restore_assets)); + WWDEBUG_SAY(("Reset/Create_Device done, reset_device=%d, restore_assets=%d", reset_device, restore_assets)); return ret; } @@ -1103,7 +1103,7 @@ void DX8Wrapper::Set_Swap_Interval(int swap) default: _PresentParameters.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_ONE ; break; } - WWDEBUG_SAY(("DX8Wrapper::Set_Swap_Interval is resetting the device.\n")); + WWDEBUG_SAY(("DX8Wrapper::Set_Swap_Interval is resetting the device.")); Reset_Device(); } @@ -1173,7 +1173,7 @@ bool DX8Wrapper::Set_Device_Resolution(int width,int height,int bits,int windowe Resize_And_Position_Window(); } #pragma message("TODO: support changing windowed status and changing the bit depth") - WWDEBUG_SAY(("DX8Wrapper::Set_Device_Resolution is resetting the device.\n")); + WWDEBUG_SAY(("DX8Wrapper::Set_Device_Resolution is resetting the device.")); return Reset_Device(); } else { return false; @@ -1227,7 +1227,7 @@ bool DX8Wrapper::Registry_Save_Render_Device( const char *sub_key, int device, i if ( !registry->Is_Valid() ) { delete registry; - WWDEBUG_SAY(( "Error getting Registry\n" )); + WWDEBUG_SAY(( "Error getting Registry" )); return false; } @@ -1258,12 +1258,12 @@ bool DX8Wrapper::Registry_Load_Render_Device( const char * sub_key, bool resize_ TextureBitDepth) && (*name != 0)) { - WWDEBUG_SAY(( "Device %s (%d X %d) %d bit windowed:%d\n", name,width,height,depth,windowed)); + WWDEBUG_SAY(( "Device %s (%d X %d) %d bit windowed:%d", name,width,height,depth,windowed)); if (TextureBitDepth==16 || TextureBitDepth==32) { -// WWDEBUG_SAY(( "Texture depth %d\n", TextureBitDepth)); +// WWDEBUG_SAY(( "Texture depth %d", TextureBitDepth)); } else { - WWDEBUG_SAY(( "Invalid texture depth %d, switching to 16 bits\n", TextureBitDepth)); + WWDEBUG_SAY(( "Invalid texture depth %d, switching to 16 bits", TextureBitDepth)); TextureBitDepth=16; } @@ -1274,7 +1274,7 @@ bool DX8Wrapper::Registry_Load_Render_Device( const char * sub_key, bool resize_ return true; } - WWDEBUG_SAY(( "Error getting Registry\n" )); + WWDEBUG_SAY(( "Error getting Registry" )); return Set_Any_Render_Device(); } @@ -1386,7 +1386,7 @@ bool DX8Wrapper::Find_Color_Mode(D3DFORMAT colorbuffer, int resx, int resy, UINT { D3DInterface->EnumAdapterModes(D3DADAPTER_DEFAULT, i, &dmode); if (dmode.Width==rx && dmode.Height==ry && dmode.Format==colorbuffer) { - WWDEBUG_SAY(("Found valid color mode. Width = %d Height = %d Format = %d\r\n",dmode.Width,dmode.Height,dmode.Format)); + WWDEBUG_SAY(("Found valid color mode. Width = %d Height = %d Format = %d",dmode.Width,dmode.Height,dmode.Format)); found=true; } i++; @@ -1396,7 +1396,7 @@ bool DX8Wrapper::Find_Color_Mode(D3DFORMAT colorbuffer, int resx, int resy, UINT // no match if (!found) { - WWDEBUG_SAY(("Failed to find a valid color mode\r\n")); + WWDEBUG_SAY(("Failed to find a valid color mode")); return false; } @@ -1426,47 +1426,47 @@ bool DX8Wrapper::Find_Z_Mode(D3DFORMAT colorbuffer,D3DFORMAT backbuffer, D3DFORM if (Test_Z_Mode(colorbuffer,backbuffer,D3DFMT_D24S8)) { *zmode=D3DFMT_D24S8; - WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D24S8\n")); + WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D24S8")); return true; } if (Test_Z_Mode(colorbuffer,backbuffer,D3DFMT_D32)) { *zmode=D3DFMT_D32; - WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D32\n")); + WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D32")); return true; } if (Test_Z_Mode(colorbuffer,backbuffer,D3DFMT_D24X8)) { *zmode=D3DFMT_D24X8; - WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D24X8\n")); + WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D24X8")); return true; } if (Test_Z_Mode(colorbuffer,backbuffer,D3DFMT_D24X4S4)) { *zmode=D3DFMT_D24X4S4; - WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D24X4S4\n")); + WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D24X4S4")); return true; } if (Test_Z_Mode(colorbuffer,backbuffer,D3DFMT_D16)) { *zmode=D3DFMT_D16; - WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D16\n")); + WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D16")); return true; } if (Test_Z_Mode(colorbuffer,backbuffer,D3DFMT_D15S1)) { *zmode=D3DFMT_D15S1; - WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D15S1\n")); + WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D15S1")); return true; } // can't find a match - WWDEBUG_SAY(("Failed to find a valid zbuffer mode\r\n")); + WWDEBUG_SAY(("Failed to find a valid zbuffer mode")); return false; } @@ -1476,7 +1476,7 @@ bool DX8Wrapper::Test_Z_Mode(D3DFORMAT colorbuffer,D3DFORMAT backbuffer, D3DFORM if (FAILED(D3DInterface->CheckDeviceFormat(D3DADAPTER_DEFAULT,WW3D_DEVTYPE, colorbuffer,D3DUSAGE_DEPTHSTENCIL,D3DRTYPE_SURFACE,zmode))) { - WWDEBUG_SAY(("CheckDeviceFormat failed. Colorbuffer format = %d Zbufferformat = %d\n",colorbuffer,zmode)); + WWDEBUG_SAY(("CheckDeviceFormat failed. Colorbuffer format = %d Zbufferformat = %d",colorbuffer,zmode)); return false; } @@ -1484,7 +1484,7 @@ bool DX8Wrapper::Test_Z_Mode(D3DFORMAT colorbuffer,D3DFORMAT backbuffer, D3DFORM if(FAILED(D3DInterface->CheckDepthStencilMatch(D3DADAPTER_DEFAULT, WW3D_DEVTYPE, colorbuffer,backbuffer,zmode))) { - WWDEBUG_SAY(("CheckDepthStencilMatch failed. Colorbuffer format = %d Backbuffer format = %d Zbufferformat = %d\n",colorbuffer,backbuffer,zmode)); + WWDEBUG_SAY(("CheckDepthStencilMatch failed. Colorbuffer format = %d Backbuffer format = %d Zbufferformat = %d",colorbuffer,backbuffer,zmode)); return false; } return true; @@ -1609,7 +1609,7 @@ void DX8Wrapper::End_Scene(bool flip_frames) if (hr==D3DERR_DEVICELOST) { hr=_Get_D3D_Device8()->TestCooperativeLevel(); if (hr==D3DERR_DEVICENOTRESET) { - WWDEBUG_SAY(("DX8Wrapper::End_Scene is resetting the device.\n")); + WWDEBUG_SAY(("DX8Wrapper::End_Scene is resetting the device.")); Reset_Device(); } else { @@ -1647,28 +1647,28 @@ void DX8Wrapper::Flip_To_Primary(void) HRESULT hr = _Get_D3D_Device8()->TestCooperativeLevel(); if (FAILED(hr)) { - WWDEBUG_SAY(("TestCooperativeLevel Failed!\n")); + WWDEBUG_SAY(("TestCooperativeLevel Failed!")); if (D3DERR_DEVICELOST == hr) { IsDeviceLost=true; - WWDEBUG_SAY(("DEVICELOST: Cannot flip to primary.\n")); + WWDEBUG_SAY(("DEVICELOST: Cannot flip to primary.")); return; } IsDeviceLost=false; if (D3DERR_DEVICENOTRESET == hr) { - WWDEBUG_SAY(("DEVICENOTRESET\n")); + WWDEBUG_SAY(("DEVICENOTRESET")); Reset_Device(); resetAttempts++; } } else { - WWDEBUG_SAY(("Flipping: %ld\n", FrameCount)); + WWDEBUG_SAY(("Flipping: %ld", FrameCount)); hr = _Get_D3D_Device8()->Present(NULL, NULL, NULL, NULL); if (SUCCEEDED(hr)) { IsDeviceLost=false; FrameCount++; - WWDEBUG_SAY(("Flip to primary succeeded %ld\n", FrameCount)); + WWDEBUG_SAY(("Flip to primary succeeded %ld", FrameCount)); } else { IsDeviceLost=true; @@ -2704,7 +2704,7 @@ DX8Wrapper::Create_Render_Target (int width, int height, bool alpha) number_of_DX8_calls++; if (hr != D3D_OK) { - WWDEBUG_SAY(("DX8Wrapper - Driver cannot create render target!\n")); + WWDEBUG_SAY(("DX8Wrapper - Driver cannot create render target!")); return NULL; } @@ -2719,7 +2719,7 @@ DX8Wrapper::Create_Render_Target (int width, int height, bool alpha) // that they support render targets! if (tex->Peek_D3D_Base_Texture() == NULL) { - WWDEBUG_SAY(("DX8Wrapper - Render target creation failed!\r\n")); + WWDEBUG_SAY(("DX8Wrapper - Render target creation failed!")); REF_PTR_RELEASE(tex); } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hanimmgr.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/hanimmgr.cpp index f95ee66157..98d33d2c8f 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hanimmgr.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/hanimmgr.cpp @@ -351,13 +351,13 @@ void HAnimManagerClass::Free_All_Anims_With_Exclusion_List(const W3DExclusionLis HAnimClass *anim = it.Get_Current_Anim(); if ((anim->Num_Refs() == 1) && (exclusion_list.Is_Excluded(anim) == false)) { - //WWDEBUG_SAY(("deleting HAnim %s\n",anim->Get_Name())); + //WWDEBUG_SAY(("deleting HAnim %s",anim->Get_Name())); AnimPtrTable->Remove(anim); anim->Release_Ref(); } //else //{ - // WWDEBUG_SAY(("keeping HAnim %s (ref %d)\n",anim->Get_Name(),anim->Num_Refs())); + // WWDEBUG_SAY(("keeping HAnim %s (ref %d)",anim->Get_Name(),anim->Num_Refs())); //} } } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hrawanim.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/hrawanim.cpp index c2a297f174..754e985362 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hrawanim.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/hrawanim.cpp @@ -274,7 +274,7 @@ int HRawAnimClass::Load_W3D(ChunkLoadClass & cload) if (newchan->Get_Pivot() < NumNodes) { add_channel(newchan); } else { - WWDEBUG_SAY(("Animation %s referring to missing Bone! Please re-export.\n",Name)); + WWDEBUG_SAY(("Animation %s referring to missing Bone! Please re-export.",Name)); delete newchan; } break; @@ -290,7 +290,7 @@ int HRawAnimClass::Load_W3D(ChunkLoadClass & cload) if (newbitchan->Get_Pivot() < NumNodes) { add_bit_channel(newbitchan); } else { - WWDEBUG_SAY(("Animation %s referring to missing Bone! Please re-export.\n",Name)); + WWDEBUG_SAY(("Animation %s referring to missing Bone! Please re-export.",Name)); delete newbitchan; } break; diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/htreemgr.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/htreemgr.cpp index 2b30b93122..7d0ce6fd6b 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/htreemgr.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/htreemgr.cpp @@ -153,13 +153,13 @@ void HTreeManagerClass::Free_All_Trees_With_Exclusion_List(const W3DExclusionLis if (exclusion_list.Is_Excluded(TreePtr[treeidx])) { - //WWDEBUG_SAY(("excluding tree %s\n",TreePtr[treeidx]->Get_Name())); + //WWDEBUG_SAY(("excluding tree %s",TreePtr[treeidx]->Get_Name())); TreePtr[new_tail] = TreePtr[treeidx]; new_tail++; } else { - //WWDEBUG_SAY(("deleting tree %s\n",TreePtr[treeidx]->Get_Name())); + //WWDEBUG_SAY(("deleting tree %s",TreePtr[treeidx]->Get_Name())); delete TreePtr[treeidx]; TreePtr[treeidx] = NULL; } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/light.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/light.cpp index a4d47c22b8..5f8c4fe579 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/light.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/light.cpp @@ -570,7 +570,7 @@ bool LightClass::Load (ChunkLoadClass &cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp index 55ac38b10e..47441f3b30 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp @@ -574,7 +574,7 @@ void MeshClass::Create_Decal(DecalGeneratorClass * generator) } else { - WWDEBUG_SAY(("PERFORMANCE WARNING: Decal being applied to a SKIN mesh!\r\n")); + WWDEBUG_SAY(("PERFORMANCE WARNING: Decal being applied to a SKIN mesh!")); // Skin // The deformed worldspace vertices are used both for the APT and in Create_Decal() to @@ -1107,7 +1107,7 @@ WW3DErrorType MeshClass::Load_W3D(ChunkLoadClass & cload) */ Model = NEW_REF(MeshModelClass,()); if (Model == NULL) { - WWDEBUG_SAY(("MeshClass::Load - Failed to allocate model\r\n")); + WWDEBUG_SAY(("MeshClass::Load - Failed to allocate model")); return WW3D_ERROR_LOAD_FAILED; } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshgeometry.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshgeometry.cpp index c622a74a05..a8e41b6f71 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshgeometry.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshgeometry.cpp @@ -1575,7 +1575,7 @@ WW3DErrorType MeshGeometryClass::Load_W3D(ChunkLoadClass & cload) cload.Open_Chunk(); if (cload.Cur_Chunk_ID() != W3D_CHUNK_MESH_HEADER3) { - WWDEBUG_SAY(("Old format mesh mesh, no longer supported.\n")); + WWDEBUG_SAY(("Old format mesh mesh, no longer supported.")); goto Error; } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp index bec7511723..b635eae97a 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp @@ -427,7 +427,7 @@ void MeshMatDescClass::Init_Alternate(MeshMatDescClass & default_materials,MeshM Material[pass] = NEW_REF(VertexMaterialClass,(*(default_materials.Material[pass]))); } else { if (default_materials.MaterialArray[pass]) { - WWDEBUG_SAY(("Unimplemented case: mesh has more than one default vertex material but no alternate vertex materials have been defined.\r\n")); + WWDEBUG_SAY(("Unimplemented case: mesh has more than one default vertex material but no alternate vertex materials have been defined.")); } Material[pass] = NULL; } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp index 90cecd7e81..b3353c6920 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp @@ -246,7 +246,7 @@ WW3DErrorType MeshModelClass::Load_W3D(ChunkLoadClass & cload) cload.Open_Chunk(); if (cload.Cur_Chunk_ID() != W3D_CHUNK_MESH_HEADER3) { - WWDEBUG_SAY(("Old format mesh mesh, no longer supported.\n")); + WWDEBUG_SAY(("Old format mesh mesh, no longer supported.")); goto Error; } @@ -473,12 +473,12 @@ WW3DErrorType MeshModelClass::read_chunks(ChunkLoadClass & cload,MeshLoadContext case O_W3D_CHUNK_MATERIALS: case O_W3D_CHUNK_MATERIALS2: - WWDEBUG_SAY(( "Obsolete material chunk encountered in mesh: %s.%s\r\n", context->Header.ContainerName,context->Header.MeshName)); + WWDEBUG_SAY(( "Obsolete material chunk encountered in mesh: %s.%s", context->Header.ContainerName,context->Header.MeshName)); WWASSERT(0); break; case W3D_CHUNK_MATERIALS3: - WWDEBUG_SAY(( "Obsolete material chunk encountered in mesh: %s.%s\r\n", context->Header.ContainerName,context->Header.MeshName)); + WWDEBUG_SAY(( "Obsolete material chunk encountered in mesh: %s.%s", context->Header.ContainerName,context->Header.MeshName)); error = read_v3_materials(cload,context); break; @@ -535,11 +535,11 @@ WW3DErrorType MeshModelClass::read_chunks(ChunkLoadClass & cload,MeshLoadContext break; case W3D_CHUNK_DEFORM: - WWDEBUG_SAY(("Obsolete deform chunk encountered in mesh: %s.%s\r\n", context->Header.ContainerName,context->Header.MeshName)); + WWDEBUG_SAY(("Obsolete deform chunk encountered in mesh: %s.%s", context->Header.ContainerName,context->Header.MeshName)); break; case W3D_CHUNK_DAMAGE: - WWDEBUG_SAY(("Obsolete damage chunk encountered in mesh: %s.%s\r\n", context->Header.ContainerName,context->Header.MeshName)); + WWDEBUG_SAY(("Obsolete damage chunk encountered in mesh: %s.%s", context->Header.ContainerName,context->Header.MeshName)); break; case W3D_CHUNK_PRELIT_UNLIT: @@ -706,7 +706,7 @@ WW3DErrorType MeshModelClass::read_v3_materials(ChunkLoadClass & cload,MeshLoadC if (!cload.Close_Chunk()) goto Error; if ( mapinfo.FrameCount > 1 ) { - WWDEBUG_SAY(("ERROR: Obsolete Animated Texture detected in model: %s\r\n",context->Header.MeshName)); + WWDEBUG_SAY(("ERROR: Obsolete Animated Texture detected in model: %s",context->Header.MeshName)); } tex = WW3DAssetManager::Get_Instance()->Get_Texture(filename); @@ -740,7 +740,7 @@ WW3DErrorType MeshModelClass::read_v3_materials(ChunkLoadClass & cload,MeshLoadC if (!cload.Close_Chunk()) goto Error; if ( mapinfo.FrameCount > 1 ) { - WWDEBUG_SAY(("ERROR: Obsolete Animated Texture detected in model: %s\r\n",context->Header.MeshName)); + WWDEBUG_SAY(("ERROR: Obsolete Animated Texture detected in model: %s",context->Header.MeshName)); } tex = WW3DAssetManager::Get_Instance()->Get_Texture(filename); @@ -1646,7 +1646,7 @@ void MeshModelClass::post_process() // we want to allow this now due to usage of the static sort // Ensure no sorting, multipass meshes (for they are abomination...) if (DefMatDesc->Get_Pass_Count() > 1 && Get_Flag(SORT)) { - WWDEBUG_SAY(( "Turning SORT off for multipass mesh %s\n",Get_Name() )); + WWDEBUG_SAY(( "Turning SORT off for multipass mesh %s",Get_Name() )); Set_Flag(SORT, false); } #endif diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/part_ldr.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/part_ldr.cpp index ff05f36f6c..02ea7b90a8 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/part_ldr.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/part_ldr.cpp @@ -400,7 +400,7 @@ ParticleEmitterDefClass::Load_W3D (ChunkLoadClass &chunk_load) default: - WWDEBUG_SAY(("Unhandled Chunk! File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk! File: %s Line: %d",__FILE__,__LINE__)); break; } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp index b3f5e4c333..67146ce852 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp @@ -291,7 +291,7 @@ void SceneClass::Load(ChunkLoadClass & cload) } } else { - WWDEBUG_SAY(("Unhandled Chunk: 0x%X in file: %s line: %d\r\n",cload.Cur_Chunk_ID(),__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X in file: %s line: %d",cload.Cur_Chunk_ID(),__FILE__,__LINE__)); } cload.Close_Chunk(); } @@ -558,7 +558,7 @@ void SimpleSceneClass::Customized_Render(RenderInfoClass & rinfo) } else { // Simple scene only supports 4 global lights - WWDEBUG_SAY(("Light %d ignored\n",count)); + WWDEBUG_SAY(("Light %d ignored",count)); } count++; } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp index ca510e310b..ef95a7f6ad 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp @@ -579,7 +579,7 @@ void TexProjectClass::Init_Multiplicative(void) MaterialPass->Set_Texture(grad_tex,1); grad_tex->Release_Ref(); } else { - WWDEBUG_SAY(("Could not find texture: MultProjectorGradient.tga!\n")); + WWDEBUG_SAY(("Could not find texture: MultProjectorGradient.tga!")); } } else { @@ -681,7 +681,7 @@ void TexProjectClass::Init_Additive(void) MaterialPass->Set_Texture(grad_tex,1); grad_tex->Release_Ref(); } else { - WWDEBUG_SAY(("Could not find texture: AddProjectorGradient.tga!\n")); + WWDEBUG_SAY(("Could not find texture: AddProjectorGradient.tga!")); } #if (DEBUG_SHADOW_RENDERING) @@ -870,7 +870,7 @@ bool TexProjectClass::Compute_Perspective_Projection ) { if (model == NULL) { - WWDEBUG_SAY(("Attempting to generate projection for a NULL model\r\n")); + WWDEBUG_SAY(("Attempting to generate projection for a NULL model")); return false; } @@ -997,7 +997,7 @@ bool TexProjectClass::Compute_Ortho_Projection ) { if (model == NULL) { - WWDEBUG_SAY(("Attempting to generate projection for a NULL model\r\n")); + WWDEBUG_SAY(("Attempting to generate projection for a NULL model")); return false; } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp index baac0c8d25..0e878135a4 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp @@ -320,7 +320,7 @@ TextureClass::~TextureClass(void) TextureLoadTask=NULL; if (!Initialized) { - WWDEBUG_SAY(("Warning: Texture %s was loaded but never used\n",Get_Texture_Name().str())); + WWDEBUG_SAY(("Warning: Texture %s was loaded but never used",Get_Texture_Name().str())); } if (D3DTexture) { diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp index 417aecde43..341d8e4c45 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp @@ -1101,7 +1101,7 @@ void TextureLoadTaskClass::Begin_Texture_Load() if (src_format!=WW3D_FORMAT_A8R8G8B8 && src_format!=WW3D_FORMAT_R8G8B8 && src_format!=WW3D_FORMAT_X8R8G8B8) { - WWDEBUG_SAY(("Invalid TGA format used in %s - only 24 and 32 bit formats should be used!\n",Texture->Get_Full_Path().str())); + WWDEBUG_SAY(("Invalid TGA format used in %s - only 24 and 32 bit formats should be used!",Texture->Get_Full_Path().str())); } // Destination size will be the next power of two square from the larger width and height... @@ -1128,7 +1128,7 @@ void TextureLoadTaskClass::Begin_Texture_Load() unsigned oh=height; TextureLoader::Validate_Texture_Size(width,height); if (width!=ow || height!=oh) { - WWDEBUG_SAY(("Invalid texture size, scaling required. Texture: %s, size: %d x %d -> %d x %d\n",Texture->Get_Full_Path().str(),ow,oh,width,height)); + WWDEBUG_SAY(("Invalid texture size, scaling required. Texture: %s, size: %d x %d -> %d x %d",Texture->Get_Full_Path().str(),ow,oh,width,height)); } IsLoading=true; diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/vertmaterial.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/vertmaterial.cpp index e427412e84..6736898d4e 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/vertmaterial.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/vertmaterial.cpp @@ -708,7 +708,7 @@ WW3DErrorType VertexMaterialClass::Load_W3D(ChunkLoadClass & cload) break; default: - WWDEBUG_SAY(("Unsupported mapper in %s\n",name)); + WWDEBUG_SAY(("Unsupported mapper in %s",name)); break; } @@ -868,7 +868,7 @@ WW3DErrorType VertexMaterialClass::Load_W3D(ChunkLoadClass & cload) break; default: - WWDEBUG_SAY(("Unsupported mapper in %s\n",name)); + WWDEBUG_SAY(("Unsupported mapper in %s",name)); break; } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp index edd42ac0d5..211680ee11 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp @@ -274,7 +274,7 @@ void WW3D::Set_Thumbnail_Enabled (bool b) WW3DErrorType WW3D::Init(void *hwnd, char *defaultpal, bool lite) { assert(IsInitted == false); - WWDEBUG_SAY(("WW3D::Init hwnd = %p\n",hwnd)); + WWDEBUG_SAY(("WW3D::Init hwnd = %p",hwnd)); _Hwnd = (HWND)hwnd; Lite = lite; @@ -282,11 +282,11 @@ WW3DErrorType WW3D::Init(void *hwnd, char *defaultpal, bool lite) ** Initialize d3d, this also enumerates the available devices and resolutions. */ Init_D3D_To_WW3_Conversion(); - WWDEBUG_SAY(("Init DX8Wrapper\n")); + WWDEBUG_SAY(("Init DX8Wrapper")); if (!DX8Wrapper::Init(_Hwnd, lite)) { return(WW3D_ERROR_INITIALIZATION_FAILED); } - WWDEBUG_SAY(("Allocate Debug Resources\n")); + WWDEBUG_SAY(("Allocate Debug Resources")); Allocate_Debug_Resources(); MMRESULT r=timeBeginPeriod(1); @@ -296,7 +296,7 @@ WW3DErrorType WW3D::Init(void *hwnd, char *defaultpal, bool lite) ** Initialize the dazzle system */ if (!lite) { - WWDEBUG_SAY(("Init Dazzles\n")); + WWDEBUG_SAY(("Init Dazzles")); FileClass * dazzle_ini_file = _TheFileFactory->Get_File(DAZZLE_INI_FILENAME); if (dazzle_ini_file) { INIClass dazzle_ini(*dazzle_ini_file); @@ -318,7 +318,7 @@ WW3DErrorType WW3D::Init(void *hwnd, char *defaultpal, bool lite) AnimatedSoundMgrClass::Initialize (); IsInitted = true; } - WWDEBUG_SAY(("WW3D Init completed\n")); + WWDEBUG_SAY(("WW3D Init completed")); return WW3D_ERROR_OK; } @@ -338,7 +338,7 @@ WW3DErrorType WW3D::Init(void *hwnd, char *defaultpal, bool lite) WW3DErrorType WW3D::Shutdown(void) { assert(Lite || IsInitted == true); -// WWDEBUG_SAY(("WW3D::Shutdown\n")); +// WWDEBUG_SAY(("WW3D::Shutdown")); #ifdef WW3D_DX8 if (IsCapturing) { @@ -817,7 +817,7 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, f // Check if the device needs to be reset if( D3DERR_DEVICENOTRESET == hr ) { - WWDEBUG_SAY(("WW3D::Begin_Render is resetting the device.\n")); + WWDEBUG_SAY(("WW3D::Begin_Render is resetting the device.")); DX8Wrapper::Reset_Device(); } @@ -1334,7 +1334,7 @@ void WW3D::Make_Screen_Shot( const char * filename_base , const float gamma, con } } - WWDEBUG_SAY(( "Creating Screen Shot %s\n", filename )); + WWDEBUG_SAY(( "Creating Screen Shot %s", filename )); // make the gamma look up table int i; @@ -1515,7 +1515,7 @@ void WW3D::Start_Movie_Capture( const char * filename_base, float frame_rate ) Movie = W3DNEW FrameGrabClass( filename_base, FrameGrabClass::AVI, width, height, depth, frame_rate); - WWDEBUG_SAY(( "Starting Movie %s\n", filename_base )); + WWDEBUG_SAY(( "Starting Movie %s", filename_base )); #endif } @@ -1537,7 +1537,7 @@ void WW3D::Stop_Movie_Capture( void ) #ifdef _WINDOWS if (IsCapturing) { IsCapturing = false; - WWDEBUG_SAY(( "Stoping Movie\n" )); + WWDEBUG_SAY(( "Stoping Movie" )); WWASSERT( Movie != NULL); delete Movie; @@ -1695,7 +1695,7 @@ void WW3D::Update_Movie_Capture( void ) #ifdef _WINDOWS WWASSERT( IsCapturing); WWPROFILE("WW3D::Update_Movie_Capture"); - WWDEBUG_SAY(( "Updating\n")); + WWDEBUG_SAY(( "Updating")); // TheSuperHackers @bugfix xezon 21/05/2025 Get the back buffer and create a copy of the surface. // Originally this code took the front buffer and tried to lock it. This does not work when the diff --git a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp index de3452b468..c89fa32d6f 100644 --- a/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp @@ -1969,7 +1969,7 @@ void WbView3d::redraw(void) curTicks = GetTickCount()-curTicks; // if (curTicks>2) { -// WWDEBUG_SAY(("%d ms for updateCenter, %d FPS\n", curTicks, 1000/curTicks)); +// WWDEBUG_SAY(("%d ms for updateCenter, %d FPS", curTicks, 1000/curTicks)); // } } if (m_drawObject) { diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp index 74946e5cd8..2b49f14419 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp @@ -793,7 +793,7 @@ RenderObjClass * W3DAssetManager::Create_Render_Obj( static int warning_count = 0; if (++warning_count <= 20) { - WWDEBUG_SAY(("WARNING: Failed to create Render Object: %s\r\n",name)); + WWDEBUG_SAY(("WARNING: Failed to create Render Object: %s",name)); } #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); @@ -1399,7 +1399,7 @@ RenderObjClass * W3DAssetManager::Create_Render_Obj(const char * name,float scal if (proto == NULL) { static int warning_count = 0; if (++warning_count <= 20) { - WWDEBUG_SAY(("WARNING: Failed to create Render Object: %s\r\n",name)); + WWDEBUG_SAY(("WARNING: Failed to create Render Object: %s",name)); } return NULL; // Failed to find a prototype } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index 8b8b84178d..ff283f1ba8 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -2826,7 +2826,7 @@ Bool W3DView::isCameraMovementFinished(void) Bool W3DView::isCameraMovementAtWaypointAlongPath(void) { - // WWDEBUG_SAY((( "MBL: Polling W3DView::isCameraMovementAtWaypointAlongPath\n" ))); + // WWDEBUG_SAY((( "MBL: Polling W3DView::isCameraMovementAtWaypointAlongPath" ))); Bool return_value = m_CameraArrivedAtWaypointOnPathFlag; #pragma message( "MBL: Clearing variable after polling - for scripting - see Adam.\n" ) @@ -3133,7 +3133,7 @@ void W3DView::moveAlongWaypointPath(Int milliseconds) if ( m_doingMoveCameraOnWaypointPath ) { - //WWDEBUG_SAY(( "MBL TEST: Camera waypoint along path reached!\n" )); + //WWDEBUG_SAY(( "MBL TEST: Camera waypoint along path reached!" )); m_CameraArrivedAtWaypointOnPathFlag = true; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animobj.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animobj.cpp index 329705a257..f4a7254ac4 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animobj.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animobj.cpp @@ -114,7 +114,7 @@ Animatable3DObjClass::Animatable3DObjClass(const char * htree_name) : if (source != NULL) { HTree = W3DNEW HTreeClass(*source); } else { - WWDEBUG_SAY(("Unable to find HTree: %s\r\n",htree_name)); + WWDEBUG_SAY(("Unable to find HTree: %s",htree_name)); HTree = W3DNEW HTreeClass; HTree->Init_Default(); } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp index f963b6d4fb..c22fbb321f 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp @@ -361,7 +361,7 @@ static void Log_Textures(bool inited,unsigned& total_count, unsigned& total_mem) StringClass number; Create_Number_String(number,texmem); - WWDEBUG_SAY(("%32s %4d * %4d (%15s), init %d, size: %14s bytes, refs: %d\n", + WWDEBUG_SAY(("%32s %4d * %4d (%15s), init %d, size: %14s bytes, refs: %d", tex->Get_Texture_Name().str(), desc.Width, desc.Height, @@ -381,19 +381,19 @@ void WW3DAssetManager::Log_Texture_Statistics() unsigned total_uninitialized_count=0; StringClass number; - WWDEBUG_SAY(("\nInitialized textures ------------------------------------------\n\n")); + WWDEBUG_SAY(("\nInitialized textures ------------------------------------------\n")); Log_Textures(true,total_initialized_count,total_initialized_tex_mem); Create_Number_String(number,total_initialized_tex_mem); - WWDEBUG_SAY(("\n%d initialized textures, totalling %14s bytes\n\n", + WWDEBUG_SAY(("\n%d initialized textures, totalling %14s bytes\n", total_initialized_count, number.str())); - WWDEBUG_SAY(("\nUn-initialized textures ---------------------------------------\n\n")); + WWDEBUG_SAY(("\nUn-initialized textures ---------------------------------------\n")); Log_Textures(false,total_uninitialized_count,total_uninitialized_tex_mem); Create_Number_String(number,total_uninitialized_tex_mem); - WWDEBUG_SAY(("\n%d un-initialized textures, totalling, totalling %14s bytes\n\n", + WWDEBUG_SAY(("\n%d un-initialized textures, totalling, totalling %14s bytes\n", total_uninitialized_count, number.str())); /* @@ -406,7 +406,7 @@ void WW3DAssetManager::Log_Texture_Statistics() // robj->Release_Ref(); // } if (rite->Current_Item_Class_ID()==RenderObjClass::CLASSID_HMODEL) { - WWDEBUG_SAY(("robj: %s\n",rite->Current_Item_Name())); + WWDEBUG_SAY(("robj: %s",rite->Current_Item_Name())); } } @@ -540,10 +540,10 @@ void WW3DAssetManager::Free_Assets_With_Exclusion_List(const DynamicVectorClass< // If this prototype is excluded, copy the pointer, otherwise delete it. if (exclusion_list.Is_Excluded(proto)) { - //WWDEBUG_SAY(("excluding %s\n",proto->Get_Name())); + //WWDEBUG_SAY(("excluding %s",proto->Get_Name())); exclude_array.Add(proto); } else { - //WWDEBUG_SAY(("deleting %s\n",proto->Get_Name())); + //WWDEBUG_SAY(("deleting %s",proto->Get_Name())); proto->DeleteSelf(); } Prototypes[i] = NULL; @@ -630,7 +630,7 @@ bool WW3DAssetManager::Load_3D_Assets( const char * filename ) if ( file->Is_Available() ) { result = WW3DAssetManager::Load_3D_Assets( *file ); } else { - WWDEBUG_SAY(("Missing asset '%s'.\n", filename)); + WWDEBUG_SAY(("Missing asset '%s'.", filename)); } _TheFileFactory->Return_File( file ); } @@ -731,7 +731,7 @@ bool WW3DAssetManager::Load_Prototype(ChunkLoadClass & cload) /* ** Warn user about an unknown chunk type */ - WWDEBUG_SAY(("Unknown chunk type encountered! Chunk Id = %d\r\n",chunk_id)); + WWDEBUG_SAY(("Unknown chunk type encountered! Chunk Id = %d",chunk_id)); return false; } @@ -754,7 +754,7 @@ bool WW3DAssetManager::Load_Prototype(ChunkLoadClass & cload) ** Warn the user about a name collision with this prototype ** and dump it */ - WWDEBUG_SAY(("Render Object Name Collision: %s\r\n",newproto->Get_Name())); + WWDEBUG_SAY(("Render Object Name Collision: %s",newproto->Get_Name())); newproto->DeleteSelf(); newproto = NULL; return false; @@ -766,7 +766,7 @@ bool WW3DAssetManager::Load_Prototype(ChunkLoadClass & cload) ** Warn user that a prototype was not generated from this ** chunk type */ - WWDEBUG_SAY(("Could not generate prototype! Chunk = %d\r\n",chunk_id)); + WWDEBUG_SAY(("Could not generate prototype! Chunk = %d",chunk_id)); return false; } @@ -824,7 +824,7 @@ RenderObjClass * WW3DAssetManager::Create_Render_Obj(const char * name) // Note - objects named "#..." are scaled cached objects, so don't warn... if (name[0] != '#') { if (++warning_count <= 20) { - WWDEBUG_SAY(("WARNING: Failed to create Render Object: %s\r\n",name)); + WWDEBUG_SAY(("WARNING: Failed to create Render Object: %s",name)); } AssetStatusClass::Peek_Instance()->Report_Missing_RObj(name); } @@ -986,7 +986,7 @@ HAnimClass * WW3DAssetManager::Get_HAnim(const char * name) if (animname != NULL) { sprintf( filename, "%s.w3d", animname+1); } else { - WWDEBUG_SAY(( "Animation %s has no . in the name\n", name )); + WWDEBUG_SAY(( "Animation %s has no . in the name", name )); WWASSERT( 0 ); return NULL; } @@ -1258,7 +1258,7 @@ void WW3DAssetManager::Log_All_Textures(void) else { tmp+=" "; } - WWDEBUG_SAY(("%4.4dkb %s%s\n",bytes/1024,tmp.str(),t->Get_Texture_Name().str())); + WWDEBUG_SAY(("%4.4dkb %s%s",bytes/1024,tmp.str(),t->Get_Texture_Name().str())); } // Log procedural textures ------------------------------- @@ -1282,7 +1282,7 @@ void WW3DAssetManager::Log_All_Textures(void) else { tmp+=" "; } - WWDEBUG_SAY(("%4.4dkb %s%s\n",bytes/1024,tmp.str(),t->Get_Texture_Name().str())); + WWDEBUG_SAY(("%4.4dkb %s%s",bytes/1024,tmp.str(),t->Get_Texture_Name().str())); } // Log "ordinary" textures ------------------------------- @@ -1307,7 +1307,7 @@ void WW3DAssetManager::Log_All_Textures(void) else { tmp+=" "; } - WWDEBUG_SAY(("%4.4dkb %s%s\n",bytes/1024,tmp.str(),t->Get_Texture_Name().str())); + WWDEBUG_SAY(("%4.4dkb %s%s",bytes/1024,tmp.str(),t->Get_Texture_Name().str())); } } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp index d0b2b3d622..c34841491a 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp @@ -1482,7 +1482,7 @@ PersistClass * DazzlePersistFactoryClass::Load(ChunkLoadClass & cload) const break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; }; cload.Close_Chunk(); @@ -1503,8 +1503,8 @@ PersistClass * DazzlePersistFactoryClass::Load(ChunkLoadClass & cload) const if (new_obj == NULL) { static int count = 0; if ( ++count < 10 ) { - WWDEBUG_SAY(("DazzlePersistFactory failed to create dazzle of type: %s!!\r\n",dazzle_type)); - WWDEBUG_SAY(("Replacing it with a NULL render object!\r\n")); + WWDEBUG_SAY(("DazzlePersistFactory failed to create dazzle of type: %s!!",dazzle_type)); + WWDEBUG_SAY(("Replacing it with a NULL render object!")); } new_obj = WW3DAssetManager::Get_Instance()->Create_Render_Obj("NULL"); } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp index b1651f7e0b..6a84d3ae7f 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp @@ -500,7 +500,7 @@ void DDSFileClass::Copy_Level_To_Surface } } if (Format==WW3D_FORMAT_DXT1 && contains_alpha) { - WWDEBUG_SAY(("Warning: DXT1 format should not contain alpha information - file %s\n",Name)); + WWDEBUG_SAY(("Warning: DXT1 format should not contain alpha information - file %s",Name)); } } } @@ -674,7 +674,7 @@ void DDSFileClass::Copy_CubeMap_Level_To_Surface } if (Format==WW3D_FORMAT_DXT1 && contains_alpha) { - WWDEBUG_SAY(("Warning: DXT1 format should not contain alpha information - file %s\n",Name)); + WWDEBUG_SAY(("Warning: DXT1 format should not contain alpha information - file %s",Name)); } } } @@ -851,7 +851,7 @@ void DDSFileClass::Copy_Volume_Level_To_Surface } if (Format==WW3D_FORMAT_DXT1 && contains_alpha) { - WWDEBUG_SAY(("Warning: DXT1 format should not contain alpha information - file %s\n",Name)); + WWDEBUG_SAY(("Warning: DXT1 format should not contain alpha information - file %s",Name)); } }*/ } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp index d9b08d9333..a5c7257f3c 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp @@ -781,7 +781,7 @@ void SkinDecalMeshClass::Render(void) */ MeshModelClass * model = Parent->Peek_Model(); if (model->Get_Flag(MeshModelClass::SORT)) { - WWDEBUG_SAY(("ERROR: decals applied to a sorted mesh!\n")); + WWDEBUG_SAY(("ERROR: decals applied to a sorted mesh!")); return; } @@ -1017,7 +1017,7 @@ bool SkinDecalMeshClass::Create_Decal(DecalGeneratorClass * generator, } #endif - // WWDEBUG_SAY(("Decal mesh now has: %d polys\r\n",Polys.Count())); + // WWDEBUG_SAY(("Decal mesh now has: %d polys",Polys.Count())); return true; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.cpp index 7b3e533cb1..dbf3c1b282 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8indexbuffer.cpp @@ -80,8 +80,8 @@ IndexBufferClass::IndexBufferClass(unsigned type_, unsigned short index_count_) _IndexBufferTotalIndices+=index_count; _IndexBufferTotalSize+=index_count*sizeof(unsigned short); #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("New IB, %d indices, size %d bytes\n",index_count,index_count*sizeof(unsigned short))); - WWDEBUG_SAY(("Total IB count: %d, total %d indices, total size %d bytes\n", + WWDEBUG_SAY(("New IB, %d indices, size %d bytes",index_count,index_count*sizeof(unsigned short))); + WWDEBUG_SAY(("Total IB count: %d, total %d indices, total size %d bytes", _IndexBufferCount, _IndexBufferTotalIndices, _IndexBufferTotalSize)); @@ -94,8 +94,8 @@ IndexBufferClass::~IndexBufferClass() _IndexBufferTotalIndices-=index_count; _IndexBufferTotalSize-=index_count*sizeof(unsigned short); #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("Delete IB, %d indices, size %d bytes\n",index_count,index_count*sizeof(unsigned short))); - WWDEBUG_SAY(("Total IB count: %d, total %d indices, total size %d bytes\n", + WWDEBUG_SAY(("Delete IB, %d indices, size %d bytes",index_count,index_count*sizeof(unsigned short))); + WWDEBUG_SAY(("Total IB count: %d, total %d indices, total size %d bytes", _IndexBufferCount, _IndexBufferTotalIndices, _IndexBufferTotalSize)); @@ -308,7 +308,7 @@ DX8IndexBufferClass::DX8IndexBufferClass(unsigned short index_count_,UsageType u return; } - WWDEBUG_SAY(("Index buffer creation failed, trying to release assets...\n")); + WWDEBUG_SAY(("Index buffer creation failed, trying to release assets...")); // Vertex buffer creation failed, so try releasing least used textures and flushing the mesh cache. @@ -327,7 +327,7 @@ DX8IndexBufferClass::DX8IndexBufferClass(unsigned short index_count_,UsageType u &index_buffer); if (SUCCEEDED(ret)) { - WWDEBUG_SAY(("...Index buffer creation succesful\n")); + WWDEBUG_SAY(("...Index buffer creation succesful")); } // If it still fails it is fatal diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp index 9c054fe2fa..d641387fff 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp @@ -771,18 +771,18 @@ void DX8RigidFVFCategoryContainer::Log(bool only_visible) WWDEBUG_SAY((work)); } else { - WWDEBUG_SAY(("EMPTY VB\n")); + WWDEBUG_SAY(("EMPTY VB")); } if (index_buffer) { work.Format("IB size (used/total): %d/%d\n",used_indices,index_buffer->Get_Index_Count()); WWDEBUG_SAY((work)); } else { - WWDEBUG_SAY(("EMPTY IB\n")); + WWDEBUG_SAY(("EMPTY IB")); } for (unsigned p=0;pGet_Name(),mmc->Get_Polygon_Count(),mmc->Get_Vertex_Count(),mmc->Get_Gap_Filler_Polygon_Count())); + WWDEBUG_SAY(("Registering mesh: %s (%d polys, %d verts + %d gap polygons)",mmc->Get_Name(),mmc->Get_Polygon_Count(),mmc->Get_Vertex_Count(),mmc->Get_Gap_Filler_Polygon_Count())); #endif bool skin=(mmc->Get_Flag(MeshModelClass::SKIN) && mmc->VertexBoneLink); bool sorting=((!!mmc->Get_Flag(MeshModelClass::SORT)) && WW3D::Is_Sorting_Enabled() && (mmc->Get_Sort_Level() == SORT_LEVEL_NONE)); @@ -2127,7 +2127,7 @@ void DX8MeshRendererClass::Register_Mesh_Type(MeshModelClass* mmc) _RegisteredMeshList.Add_Tail(mmc); } else { - WWDEBUG_SAY(("Error: Register_Mesh_Type failed! file: %s line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Error: Register_Mesh_Type failed! file: %s line: %d",__FILE__,__LINE__)); } } } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp index 9c15589295..1e083d4468 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp @@ -90,8 +90,8 @@ VertexBufferClass::VertexBufferClass(unsigned type_, unsigned FVF, unsigned shor _VertexBufferTotalVertices+=VertexCount; _VertexBufferTotalSize+=VertexCount*fvf_info->Get_FVF_Size(); #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("New VB, %d vertices, size %d bytes\n",VertexCount,VertexCount*fvf_info->Get_FVF_Size())); - WWDEBUG_SAY(("Total VB count: %d, total %d vertices, total size %d bytes\n", + WWDEBUG_SAY(("New VB, %d vertices, size %d bytes",VertexCount,VertexCount*fvf_info->Get_FVF_Size())); + WWDEBUG_SAY(("Total VB count: %d, total %d vertices, total size %d bytes", _VertexBufferCount, _VertexBufferTotalVertices, _VertexBufferTotalSize)); @@ -107,8 +107,8 @@ VertexBufferClass::~VertexBufferClass() _VertexBufferTotalSize-=VertexCount*fvf_info->Get_FVF_Size(); #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("Delete VB, %d vertices, size %d bytes\n",VertexCount,VertexCount*fvf_info->Get_FVF_Size())); - WWDEBUG_SAY(("Total VB count: %d, total %d vertices, total size %d bytes\n", + WWDEBUG_SAY(("Delete VB, %d vertices, size %d bytes",VertexCount,VertexCount*fvf_info->Get_FVF_Size())); + WWDEBUG_SAY(("Total VB count: %d, total %d vertices, total size %d bytes", _VertexBufferCount, _VertexBufferTotalVertices, _VertexBufferTotalSize)); @@ -167,7 +167,7 @@ VertexBufferClass::WriteLockClass::WriteLockClass(VertexBufferClass* VertexBuffe { StringClass fvf_name; VertexBuffer->FVF_Info().Get_FVF_Name(fvf_name); - WWDEBUG_SAY(("VertexBuffer->Lock(start_index: 0, index_range: 0(%d), fvf_size: %d, fvf: %s)\n", + WWDEBUG_SAY(("VertexBuffer->Lock(start_index: 0, index_range: 0(%d), fvf_size: %d, fvf: %s)", VertexBuffer->Get_Vertex_Count(), VertexBuffer->FVF_Info().Get_FVF_Size(), fvf_name)); @@ -197,7 +197,7 @@ VertexBufferClass::WriteLockClass::~WriteLockClass() switch (VertexBuffer->Type()) { case BUFFER_TYPE_DX8: #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("VertexBuffer->Unlock()\n")); + WWDEBUG_SAY(("VertexBuffer->Unlock()")); #endif DX8_Assert(); DX8_ErrorCode(static_cast(VertexBuffer)->Get_DX8_Vertex_Buffer()->Unlock()); @@ -232,7 +232,7 @@ VertexBufferClass::AppendLockClass::AppendLockClass(VertexBufferClass* VertexBuf { StringClass fvf_name; VertexBuffer->FVF_Info().Get_FVF_Name(fvf_name); - WWDEBUG_SAY(("VertexBuffer->Lock(start_index: %d, index_range: %d, fvf_size: %d, fvf: %s)\n", + WWDEBUG_SAY(("VertexBuffer->Lock(start_index: %d, index_range: %d, fvf_size: %d, fvf: %s)", start_index, index_range, VertexBuffer->FVF_Info().Get_FVF_Size(), @@ -264,7 +264,7 @@ VertexBufferClass::AppendLockClass::~AppendLockClass() case BUFFER_TYPE_DX8: DX8_Assert(); #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("VertexBuffer->Unlock()\n")); + WWDEBUG_SAY(("VertexBuffer->Unlock()")); #endif DX8_ErrorCode(static_cast(VertexBuffer)->Get_DX8_Vertex_Buffer()->Unlock()); break; @@ -400,9 +400,9 @@ DX8VertexBufferClass::DX8VertexBufferClass( DX8VertexBufferClass::~DX8VertexBufferClass() { #ifdef VERTEX_BUFFER_LOG - WWDEBUG_SAY(("VertexBuffer->Release()\n")); + WWDEBUG_SAY(("VertexBuffer->Release()")); _DX8VertexBufferCount--; - WWDEBUG_SAY(("Current vertex buffer count: %d\n",_DX8VertexBufferCount)); + WWDEBUG_SAY(("Current vertex buffer count: %d",_DX8VertexBufferCount)); #endif VertexBuffer->Release(); } @@ -421,7 +421,7 @@ void DX8VertexBufferClass::Create_Vertex_Buffer(UsageType usage) #ifdef VERTEX_BUFFER_LOG StringClass fvf_name; FVF_Info().Get_FVF_Name(fvf_name); - WWDEBUG_SAY(("CreateVertexBuffer(fvfsize=%d, vertex_count=%d, D3DUSAGE_WRITEONLY|%s|%s, fvf: %s, %s)\n", + WWDEBUG_SAY(("CreateVertexBuffer(fvfsize=%d, vertex_count=%d, D3DUSAGE_WRITEONLY|%s|%s, fvf: %s, %s)", FVF_Info().Get_FVF_Size(), VertexCount, (usage&USAGE_DYNAMIC) ? "D3DUSAGE_DYNAMIC" : "-", @@ -429,7 +429,7 @@ void DX8VertexBufferClass::Create_Vertex_Buffer(UsageType usage) fvf_name, (usage&USAGE_DYNAMIC) ? "D3DPOOL_DEFAULT" : "D3DPOOL_MANAGED")); _DX8VertexBufferCount++; - WWDEBUG_SAY(("Current vertex buffer count: %d\n",_DX8VertexBufferCount)); + WWDEBUG_SAY(("Current vertex buffer count: %d",_DX8VertexBufferCount)); #endif unsigned usage_flags= @@ -456,7 +456,7 @@ void DX8VertexBufferClass::Create_Vertex_Buffer(UsageType usage) return; } - WWDEBUG_SAY(("Vertex buffer creation failed, trying to release assets...\n")); + WWDEBUG_SAY(("Vertex buffer creation failed, trying to release assets...")); // Vertex buffer creation failed, so try releasing least used textures and flushing the mesh cache. @@ -478,7 +478,7 @@ void DX8VertexBufferClass::Create_Vertex_Buffer(UsageType usage) &VertexBuffer); if (SUCCEEDED(ret)) { - WWDEBUG_SAY(("...Vertex buffer creation succesful\n")); + WWDEBUG_SAY(("...Vertex buffer creation succesful")); } // If it still fails it is fatal @@ -841,7 +841,7 @@ DynamicVBAccessClass::WriteLockClass::WriteLockClass(DynamicVBAccessClass* dynam dx8_lock++; StringClass fvf_name; DynamicVBAccess->VertexBuffer->FVF_Info().Get_FVF_Name(fvf_name); - WWDEBUG_SAY(("DynamicVertexBuffer->Lock(start_index: %d, index_range: %d, fvf_size: %d, fvf: %s)\n", + WWDEBUG_SAY(("DynamicVertexBuffer->Lock(start_index: %d, index_range: %d, fvf_size: %d, fvf: %s)", DynamicVBAccess->VertexBufferOffset, DynamicVBAccess->Get_Vertex_Count(), DynamicVBAccess->VertexBuffer->FVF_Info().Get_FVF_Size(), @@ -881,7 +881,7 @@ DynamicVBAccessClass::WriteLockClass::~WriteLockClass() #ifdef VERTEX_BUFFER_LOG /* dx8_lock--; WWASSERT(!dx8_lock); - WWDEBUG_SAY(("DynamicVertexBuffer->Unlock()\n")); + WWDEBUG_SAY(("DynamicVertexBuffer->Unlock()")); */ #endif DX8_Assert(); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp index 5b36fd44aa..cd50c7c2fd 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp @@ -243,7 +243,7 @@ void Non_Fatal_Log_DX8_ErrorCode(unsigned res,const char * file,int line) sizeof(tmp)); if (new_res==D3D_OK) { - WWDEBUG_SAY(("DX8 Error: %s, File: %s, Line: %d\n",tmp,file,line)); + WWDEBUG_SAY(("DX8 Error: %s, File: %s, Line: %d",tmp,file,line)); } } @@ -288,7 +288,7 @@ bool DX8Wrapper::Init(void * hwnd, bool lite) */ _Hwnd = (HWND)hwnd; _MainThreadID=ThreadClass::_Get_Current_Thread_ID(); - WWDEBUG_SAY(("DX8Wrapper main thread: 0x%x\n",_MainThreadID)); + WWDEBUG_SAY(("DX8Wrapper main thread: 0x%x",_MainThreadID)); CurRenderDevice = -1; ResolutionWidth = DEFAULT_RESOLUTION_WIDTH; ResolutionHeight = DEFAULT_RESOLUTION_HEIGHT; @@ -314,7 +314,7 @@ bool DX8Wrapper::Init(void * hwnd, bool lite) D3DInterface = NULL; D3DDevice = NULL; - WWDEBUG_SAY(("Reset DX8Wrapper statistics\n")); + WWDEBUG_SAY(("Reset DX8Wrapper statistics")); Reset_Statistics(); Invalidate_Cached_Render_States(); @@ -330,7 +330,7 @@ bool DX8Wrapper::Init(void * hwnd, bool lite) /* ** Create the D3D interface object */ - WWDEBUG_SAY(("Create Direct3D8\n")); + WWDEBUG_SAY(("Create Direct3D8")); D3DInterface = Direct3DCreate8Ptr(D3D_SDK_VERSION); // TODO: handle failure cases... if (D3DInterface == NULL) { return(false); @@ -340,9 +340,9 @@ bool DX8Wrapper::Init(void * hwnd, bool lite) /* ** Enumerate the available devices */ - WWDEBUG_SAY(("Enumerate devices\n")); + WWDEBUG_SAY(("Enumerate devices")); Enumerate_Devices(); - WWDEBUG_SAY(("DX8Wrapper Init completed\n")); + WWDEBUG_SAY(("DX8Wrapper Init completed")); } return(true); @@ -645,7 +645,7 @@ bool DX8Wrapper::Create_Device(void) bool DX8Wrapper::Reset_Device(bool reload_assets) { - WWDEBUG_SAY(("Resetting device.\n")); + WWDEBUG_SAY(("Resetting device.")); DX8_THREAD_ASSERT(); if ((IsInitted) && (D3DDevice != NULL)) { // Release all non-MANAGED stuff @@ -689,10 +689,10 @@ bool DX8Wrapper::Reset_Device(bool reload_assets) Invalidate_Cached_Render_States(); Set_Default_Global_Render_States(); SHD_INIT_SHADERS; - WWDEBUG_SAY(("Device reset completed\n")); + WWDEBUG_SAY(("Device reset completed")); return true; } - WWDEBUG_SAY(("Device reset failed\n")); + WWDEBUG_SAY(("Device reset failed")); return false; } @@ -996,7 +996,7 @@ bool DX8Wrapper::Set_Render_Device(int dev, int width, int height, int bits, int if (windowed != -1) IsWindowed = (windowed != 0); DX8Wrapper_IsWindowed = IsWindowed; - WWDEBUG_SAY(("Attempting Set_Render_Device: name: %s (%s:%s), width: %d, height: %d, windowed: %d\n", + WWDEBUG_SAY(("Attempting Set_Render_Device: name: %s (%s:%s), width: %d, height: %d, windowed: %d", _RenderDeviceNameTable[CurRenderDevice].str(),_RenderDeviceDescriptionTable[CurRenderDevice].Get_Driver_Name(), _RenderDeviceDescriptionTable[CurRenderDevice].Get_Driver_Version(),ResolutionWidth,ResolutionHeight,(IsWindowed ? 1 : 0))); @@ -1113,19 +1113,19 @@ bool DX8Wrapper::Set_Render_Device(int dev, int width, int height, int bits, int Get_Format_Name(DisplayFormat,&displayFormat); Get_Format_Name(_PresentParameters.BackBufferFormat,&backbufferFormat); - WWDEBUG_SAY(("Using Display/BackBuffer Formats: %s/%s\n",displayFormat.str(),backbufferFormat.str())); + WWDEBUG_SAY(("Using Display/BackBuffer Formats: %s/%s",displayFormat.str(),backbufferFormat.str())); bool ret; if (reset_device) { - WWDEBUG_SAY(("DX8Wrapper::Set_Render_Device is resetting the device.\n")); + WWDEBUG_SAY(("DX8Wrapper::Set_Render_Device is resetting the device.")); ret = Reset_Device(restore_assets); //reset device without restoring data - we're likely switching out of the app. } else ret = Create_Device(); - WWDEBUG_SAY(("Reset/Create_Device done, reset_device=%d, restore_assets=%d\n", reset_device, restore_assets)); + WWDEBUG_SAY(("Reset/Create_Device done, reset_device=%d, restore_assets=%d", reset_device, restore_assets)); return ret; } @@ -1193,7 +1193,7 @@ void DX8Wrapper::Set_Swap_Interval(int swap) default: _PresentParameters.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_ONE ; break; } - WWDEBUG_SAY(("DX8Wrapper::Set_Swap_Interval is resetting the device.\n")); + WWDEBUG_SAY(("DX8Wrapper::Set_Swap_Interval is resetting the device.")); Reset_Device(); } @@ -1263,7 +1263,7 @@ bool DX8Wrapper::Set_Device_Resolution(int width,int height,int bits,int windowe Resize_And_Position_Window(); } #pragma message("TODO: support changing windowed status and changing the bit depth") - WWDEBUG_SAY(("DX8Wrapper::Set_Device_Resolution is resetting the device.\n")); + WWDEBUG_SAY(("DX8Wrapper::Set_Device_Resolution is resetting the device.")); return Reset_Device(); } else { return false; @@ -1317,7 +1317,7 @@ bool DX8Wrapper::Registry_Save_Render_Device( const char *sub_key, int device, i if ( !registry->Is_Valid() ) { delete registry; - WWDEBUG_SAY(( "Error getting Registry\n" )); + WWDEBUG_SAY(( "Error getting Registry" )); return false; } @@ -1348,12 +1348,12 @@ bool DX8Wrapper::Registry_Load_Render_Device( const char * sub_key, bool resize_ TextureBitDepth) && (*name != 0)) { - WWDEBUG_SAY(( "Device %s (%d X %d) %d bit windowed:%d\n", name,width,height,depth,windowed)); + WWDEBUG_SAY(( "Device %s (%d X %d) %d bit windowed:%d", name,width,height,depth,windowed)); if (TextureBitDepth==16 || TextureBitDepth==32) { -// WWDEBUG_SAY(( "Texture depth %d\n", TextureBitDepth)); +// WWDEBUG_SAY(( "Texture depth %d", TextureBitDepth)); } else { - WWDEBUG_SAY(( "Invalid texture depth %d, switching to 16 bits\n", TextureBitDepth)); + WWDEBUG_SAY(( "Invalid texture depth %d, switching to 16 bits", TextureBitDepth)); TextureBitDepth=16; } @@ -1419,7 +1419,7 @@ bool DX8Wrapper::Registry_Load_Render_Device( const char * sub_key, bool resize_ return true; } - WWDEBUG_SAY(( "Error getting Registry\n" )); + WWDEBUG_SAY(( "Error getting Registry" )); return Set_Any_Render_Device(); } @@ -1531,7 +1531,7 @@ bool DX8Wrapper::Find_Color_Mode(D3DFORMAT colorbuffer, int resx, int resy, UINT { D3DInterface->EnumAdapterModes(D3DADAPTER_DEFAULT, i, &dmode); if (dmode.Width==rx && dmode.Height==ry && dmode.Format==colorbuffer) { - WWDEBUG_SAY(("Found valid color mode. Width = %d Height = %d Format = %d\r\n",dmode.Width,dmode.Height,dmode.Format)); + WWDEBUG_SAY(("Found valid color mode. Width = %d Height = %d Format = %d",dmode.Width,dmode.Height,dmode.Format)); found=true; } i++; @@ -1541,7 +1541,7 @@ bool DX8Wrapper::Find_Color_Mode(D3DFORMAT colorbuffer, int resx, int resy, UINT // no match if (!found) { - WWDEBUG_SAY(("Failed to find a valid color mode\r\n")); + WWDEBUG_SAY(("Failed to find a valid color mode")); return false; } @@ -1571,47 +1571,47 @@ bool DX8Wrapper::Find_Z_Mode(D3DFORMAT colorbuffer,D3DFORMAT backbuffer, D3DFORM if (Test_Z_Mode(colorbuffer,backbuffer,D3DFMT_D24S8)) { *zmode=D3DFMT_D24S8; - WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D24S8\n")); + WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D24S8")); return true; } if (Test_Z_Mode(colorbuffer,backbuffer,D3DFMT_D32)) { *zmode=D3DFMT_D32; - WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D32\n")); + WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D32")); return true; } if (Test_Z_Mode(colorbuffer,backbuffer,D3DFMT_D24X8)) { *zmode=D3DFMT_D24X8; - WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D24X8\n")); + WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D24X8")); return true; } if (Test_Z_Mode(colorbuffer,backbuffer,D3DFMT_D24X4S4)) { *zmode=D3DFMT_D24X4S4; - WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D24X4S4\n")); + WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D24X4S4")); return true; } if (Test_Z_Mode(colorbuffer,backbuffer,D3DFMT_D16)) { *zmode=D3DFMT_D16; - WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D16\n")); + WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D16")); return true; } if (Test_Z_Mode(colorbuffer,backbuffer,D3DFMT_D15S1)) { *zmode=D3DFMT_D15S1; - WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D15S1\n")); + WWDEBUG_SAY(("Found zbuffer mode D3DFMT_D15S1")); return true; } // can't find a match - WWDEBUG_SAY(("Failed to find a valid zbuffer mode\r\n")); + WWDEBUG_SAY(("Failed to find a valid zbuffer mode")); return false; } @@ -1621,7 +1621,7 @@ bool DX8Wrapper::Test_Z_Mode(D3DFORMAT colorbuffer,D3DFORMAT backbuffer, D3DFORM if (FAILED(D3DInterface->CheckDeviceFormat(D3DADAPTER_DEFAULT,WW3D_DEVTYPE, colorbuffer,D3DUSAGE_DEPTHSTENCIL,D3DRTYPE_SURFACE,zmode))) { - WWDEBUG_SAY(("CheckDeviceFormat failed. Colorbuffer format = %d Zbufferformat = %d\n",colorbuffer,zmode)); + WWDEBUG_SAY(("CheckDeviceFormat failed. Colorbuffer format = %d Zbufferformat = %d",colorbuffer,zmode)); return false; } @@ -1629,7 +1629,7 @@ bool DX8Wrapper::Test_Z_Mode(D3DFORMAT colorbuffer,D3DFORMAT backbuffer, D3DFORM if(FAILED(D3DInterface->CheckDepthStencilMatch(D3DADAPTER_DEFAULT, WW3D_DEVTYPE, colorbuffer,backbuffer,zmode))) { - WWDEBUG_SAY(("CheckDepthStencilMatch failed. Colorbuffer format = %d Backbuffer format = %d Zbufferformat = %d\n",colorbuffer,backbuffer,zmode)); + WWDEBUG_SAY(("CheckDepthStencilMatch failed. Colorbuffer format = %d Backbuffer format = %d Zbufferformat = %d",colorbuffer,backbuffer,zmode)); return false; } return true; @@ -1754,7 +1754,7 @@ void DX8Wrapper::End_Scene(bool flip_frames) if (hr==D3DERR_DEVICELOST) { hr=_Get_D3D_Device8()->TestCooperativeLevel(); if (hr==D3DERR_DEVICENOTRESET) { - WWDEBUG_SAY(("DX8Wrapper::End_Scene is resetting the device.\n")); + WWDEBUG_SAY(("DX8Wrapper::End_Scene is resetting the device.")); Reset_Device(); } else { @@ -1792,28 +1792,28 @@ void DX8Wrapper::Flip_To_Primary(void) HRESULT hr = _Get_D3D_Device8()->TestCooperativeLevel(); if (FAILED(hr)) { - WWDEBUG_SAY(("TestCooperativeLevel Failed!\n")); + WWDEBUG_SAY(("TestCooperativeLevel Failed!")); if (D3DERR_DEVICELOST == hr) { IsDeviceLost=true; - WWDEBUG_SAY(("DEVICELOST: Cannot flip to primary.\n")); + WWDEBUG_SAY(("DEVICELOST: Cannot flip to primary.")); return; } IsDeviceLost=false; if (D3DERR_DEVICENOTRESET == hr) { - WWDEBUG_SAY(("DEVICENOTRESET\n")); + WWDEBUG_SAY(("DEVICENOTRESET")); Reset_Device(); resetAttempts++; } } else { - WWDEBUG_SAY(("Flipping: %ld\n", FrameCount)); + WWDEBUG_SAY(("Flipping: %ld", FrameCount)); hr = _Get_D3D_Device8()->Present(NULL, NULL, NULL, NULL); if (SUCCEEDED(hr)) { IsDeviceLost=false; FrameCount++; - WWDEBUG_SAY(("Flip to primary succeeded %ld\n", FrameCount)); + WWDEBUG_SAY(("Flip to primary succeeded %ld", FrameCount)); } else { IsDeviceLost=true; @@ -2442,7 +2442,7 @@ IDirect3DTexture8 * DX8Wrapper::_Create_DX8_Texture // If ran out of texture ram, try invalidating some textures and mesh cache. if (ret==D3DERR_OUTOFVIDEOMEMORY) { - WWDEBUG_SAY(("Error: Out of memory while creating render target. Trying to release assets...\n")); + WWDEBUG_SAY(("Error: Out of memory while creating render target. Trying to release assets...")); // Free all textures that haven't been used in the last 5 seconds TextureClass::Invalidate_Old_Unused_Textures(5000); @@ -2460,10 +2460,10 @@ IDirect3DTexture8 * DX8Wrapper::_Create_DX8_Texture &texture); if (SUCCEEDED(ret)) { - WWDEBUG_SAY(("...Render target creation succesful.\n")); + WWDEBUG_SAY(("...Render target creation succesful.")); } else { - WWDEBUG_SAY(("...Render target creation failed.\n")); + WWDEBUG_SAY(("...Render target creation failed.")); } if (ret==D3DERR_OUTOFVIDEOMEMORY) { Non_Fatal_Log_DX8_ErrorCode(ret,__FILE__,__LINE__); @@ -2492,7 +2492,7 @@ IDirect3DTexture8 * DX8Wrapper::_Create_DX8_Texture // If ran out of texture ram, try invalidating some textures and mesh cache. if (ret==D3DERR_OUTOFVIDEOMEMORY) { - WWDEBUG_SAY(("Error: Out of memory while creating texture. Trying to release assets...\n")); + WWDEBUG_SAY(("Error: Out of memory while creating texture. Trying to release assets...")); // Free all textures that haven't been used in the last 5 seconds TextureClass::Invalidate_Old_Unused_Textures(5000); @@ -2509,12 +2509,12 @@ IDirect3DTexture8 * DX8Wrapper::_Create_DX8_Texture pool, &texture); if (SUCCEEDED(ret)) { - WWDEBUG_SAY(("...Texture creation succesful.\n")); + WWDEBUG_SAY(("...Texture creation succesful.")); } else { StringClass format_name(0,true); Get_WW3D_Format_Name(format, format_name); - WWDEBUG_SAY(("...Texture creation failed. (%d x %d, format: %s, mips: %d\n",width,height,format_name.str(),mip_level_count)); + WWDEBUG_SAY(("...Texture creation failed. (%d x %d, format: %s, mips: %d",width,height,format_name.str(),mip_level_count)); } } @@ -2641,7 +2641,7 @@ IDirect3DTexture8 * DX8Wrapper::_Create_DX8_ZTexture // If ran out of texture ram, try invalidating some textures and mesh cache. if (ret==D3DERR_OUTOFVIDEOMEMORY) { - WWDEBUG_SAY(("Error: Out of memory while creating render target. Trying to release assets...\n")); + WWDEBUG_SAY(("Error: Out of memory while creating render target. Trying to release assets...")); // Free all textures that haven't been used in the last 5 seconds TextureClass::Invalidate_Old_Unused_Textures(5000); @@ -2661,11 +2661,11 @@ IDirect3DTexture8 * DX8Wrapper::_Create_DX8_ZTexture if (SUCCEEDED(ret)) { - WWDEBUG_SAY(("...Render target creation succesful.\n")); + WWDEBUG_SAY(("...Render target creation succesful.")); } else { - WWDEBUG_SAY(("...Render target creation failed.\n")); + WWDEBUG_SAY(("...Render target creation failed.")); } if (ret==D3DERR_OUTOFVIDEOMEMORY) { @@ -2732,7 +2732,7 @@ IDirect3DCubeTexture8* DX8Wrapper::_Create_DX8_Cube_Texture // If ran out of texture ram, try invalidating some textures and mesh cache. if (ret==D3DERR_OUTOFVIDEOMEMORY) { - WWDEBUG_SAY(("Error: Out of memory while creating render target. Trying to release assets...\n")); + WWDEBUG_SAY(("Error: Out of memory while creating render target. Trying to release assets...")); // Free all textures that haven't been used in the last 5 seconds TextureClass::Invalidate_Old_Unused_Textures(5000); @@ -2752,11 +2752,11 @@ IDirect3DCubeTexture8* DX8Wrapper::_Create_DX8_Cube_Texture if (SUCCEEDED(ret)) { - WWDEBUG_SAY(("...Render target creation succesful.\n")); + WWDEBUG_SAY(("...Render target creation succesful.")); } else { - WWDEBUG_SAY(("...Render target creation failed.\n")); + WWDEBUG_SAY(("...Render target creation failed.")); } if (ret==D3DERR_OUTOFVIDEOMEMORY) { @@ -2788,7 +2788,7 @@ IDirect3DCubeTexture8* DX8Wrapper::_Create_DX8_Cube_Texture // If ran out of texture ram, try invalidating some textures and mesh cache. if (ret==D3DERR_OUTOFVIDEOMEMORY) { - WWDEBUG_SAY(("Error: Out of memory while creating texture. Trying to release assets...\n")); + WWDEBUG_SAY(("Error: Out of memory while creating texture. Trying to release assets...")); // Free all textures that haven't been used in the last 5 seconds TextureClass::Invalidate_Old_Unused_Textures(5000); @@ -2807,13 +2807,13 @@ IDirect3DCubeTexture8* DX8Wrapper::_Create_DX8_Cube_Texture ); if (SUCCEEDED(ret)) { - WWDEBUG_SAY(("...Texture creation succesful.\n")); + WWDEBUG_SAY(("...Texture creation succesful.")); } else { StringClass format_name(0,true); Get_WW3D_Format_Name(format, format_name); - WWDEBUG_SAY(("...Texture creation failed. (%d x %d, format: %s, mips: %d\n",width,height,format_name.str(),mip_level_count)); + WWDEBUG_SAY(("...Texture creation failed. (%d x %d, format: %s, mips: %d",width,height,format_name.str(),mip_level_count)); } } @@ -2865,7 +2865,7 @@ IDirect3DVolumeTexture8* DX8Wrapper::_Create_DX8_Volume_Texture // If ran out of texture ram, try invalidating some textures and mesh cache. if (ret==D3DERR_OUTOFVIDEOMEMORY) { - WWDEBUG_SAY(("Error: Out of memory while creating texture. Trying to release assets...\n")); + WWDEBUG_SAY(("Error: Out of memory while creating texture. Trying to release assets...")); // Free all textures that haven't been used in the last 5 seconds TextureClass::Invalidate_Old_Unused_Textures(5000); @@ -2886,13 +2886,13 @@ IDirect3DVolumeTexture8* DX8Wrapper::_Create_DX8_Volume_Texture ); if (SUCCEEDED(ret)) { - WWDEBUG_SAY(("...Texture creation succesful.\n")); + WWDEBUG_SAY(("...Texture creation succesful.")); } else { StringClass format_name(0,true); Get_WW3D_Format_Name(format, format_name); - WWDEBUG_SAY(("...Texture creation failed. (%d x %d, format: %s, mips: %d\n",width,height,format_name.str(),mip_level_count)); + WWDEBUG_SAY(("...Texture creation failed. (%d x %d, format: %s, mips: %d",width,height,format_name.str(),mip_level_count)); } } @@ -3218,7 +3218,7 @@ DX8Wrapper::Create_Render_Target (int width, int height, WW3DFormat format) // If render target format isn't supported return NULL if (!Get_Current_Caps()->Support_Render_To_Texture_Format(format)) { - WWDEBUG_SAY(("DX8Wrapper - Render target format is not supported\r\n")); + WWDEBUG_SAY(("DX8Wrapper - Render target format is not supported")); return NULL; } @@ -3250,7 +3250,7 @@ DX8Wrapper::Create_Render_Target (int width, int height, WW3DFormat format) // that they support render targets! if (tex->Peek_D3D_Base_Texture() == NULL) { - WWDEBUG_SAY(("DX8Wrapper - Render target creation failed!\r\n")); + WWDEBUG_SAY(("DX8Wrapper - Render target creation failed!")); REF_PTR_RELEASE(tex); } @@ -3290,7 +3290,7 @@ void DX8Wrapper::Create_Render_Target if (!Get_Current_Caps()->Support_Render_To_Texture_Format(format) || !Get_Current_Caps()->Support_Depth_Stencil_Format(zformat)) { - WWDEBUG_SAY(("DX8Wrapper - Render target with depth format is not supported\r\n")); + WWDEBUG_SAY(("DX8Wrapper - Render target with depth format is not supported")); return; } @@ -3322,7 +3322,7 @@ void DX8Wrapper::Create_Render_Target // that they support render targets! if (tex->Peek_D3D_Base_Texture() == NULL) { - WWDEBUG_SAY(("DX8Wrapper - Render target creation failed!\r\n")); + WWDEBUG_SAY(("DX8Wrapper - Render target creation failed!")); REF_PTR_RELEASE(tex); } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hanimmgr.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hanimmgr.cpp index fd5720e802..82e55324bf 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hanimmgr.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hanimmgr.cpp @@ -352,13 +352,13 @@ void HAnimManagerClass::Free_All_Anims_With_Exclusion_List(const W3DExclusionLis HAnimClass *anim = it.Get_Current_Anim(); if ((anim->Num_Refs() == 1) && (exclusion_list.Is_Excluded(anim) == false)) { - //WWDEBUG_SAY(("deleting HAnim %s\n",anim->Get_Name())); + //WWDEBUG_SAY(("deleting HAnim %s",anim->Get_Name())); AnimPtrTable->Remove(anim); anim->Release_Ref(); } //else //{ - // WWDEBUG_SAY(("keeping HAnim %s (ref %d)\n",anim->Get_Name(),anim->Num_Refs())); + // WWDEBUG_SAY(("keeping HAnim %s (ref %d)",anim->Get_Name(),anim->Num_Refs())); //} } } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp index 7ed86d8c58..c65bec1703 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp @@ -3524,7 +3524,7 @@ void HLodClass::Add_Lod_Model(int lod, RenderObjClass * robj, int boneindex) // the bone that we're trying to use. This happens when a skeleton is re-exported // but the models that depend on it aren't re-exported... if (boneindex >= HTree->Num_Pivots()) { - WWDEBUG_SAY(("ERROR: Model %s tried to use bone %d in skeleton %s. Please re-export!\n",Get_Name(),boneindex,HTree->Get_Name())); + WWDEBUG_SAY(("ERROR: Model %s tried to use bone %d in skeleton %s. Please re-export!",Get_Name(),boneindex,HTree->Get_Name())); boneindex = 0; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hrawanim.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hrawanim.cpp index 281a9f4cb9..1555c053e7 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hrawanim.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hrawanim.cpp @@ -274,7 +274,7 @@ int HRawAnimClass::Load_W3D(ChunkLoadClass & cload) if (newchan->Get_Pivot() < NumNodes) { add_channel(newchan); } else { - WWDEBUG_SAY(("Animation %s referring to missing Bone! Please re-export.\n",Name)); + WWDEBUG_SAY(("Animation %s referring to missing Bone! Please re-export.",Name)); delete newchan; } break; @@ -290,7 +290,7 @@ int HRawAnimClass::Load_W3D(ChunkLoadClass & cload) if (newbitchan->Get_Pivot() < NumNodes) { add_bit_channel(newbitchan); } else { - WWDEBUG_SAY(("Animation %s referring to missing Bone! Please re-export.\n",Name)); + WWDEBUG_SAY(("Animation %s referring to missing Bone! Please re-export.",Name)); delete newbitchan; } break; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htreemgr.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htreemgr.cpp index 55b52646de..0e9c137279 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htreemgr.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/htreemgr.cpp @@ -156,13 +156,13 @@ void HTreeManagerClass::Free_All_Trees_With_Exclusion_List(const W3DExclusionLis if (exclusion_list.Is_Excluded(TreePtr[treeidx])) { - //WWDEBUG_SAY(("excluding tree %s\n",TreePtr[treeidx]->Get_Name())); + //WWDEBUG_SAY(("excluding tree %s",TreePtr[treeidx]->Get_Name())); TreePtr[new_tail] = TreePtr[treeidx]; new_tail++; } else { - //WWDEBUG_SAY(("deleting tree %s\n",TreePtr[treeidx]->Get_Name())); + //WWDEBUG_SAY(("deleting tree %s",TreePtr[treeidx]->Get_Name())); delete TreePtr[treeidx]; TreePtr[treeidx] = NULL; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/light.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/light.cpp index ef78e57d75..8e9f1f03be 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/light.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/light.cpp @@ -570,7 +570,7 @@ bool LightClass::Load (ChunkLoadClass &cload) break; default: - WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X File: %s Line: %d",__FILE__,__LINE__)); break; } cload.Close_Chunk(); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp index ab03f96298..c37a14f472 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp @@ -571,7 +571,7 @@ void MeshClass::Create_Decal(DecalGeneratorClass * generator) } else { - WWDEBUG_SAY(("PERFORMANCE WARNING: Decal being applied to a SKIN mesh!\r\n")); + WWDEBUG_SAY(("PERFORMANCE WARNING: Decal being applied to a SKIN mesh!")); // Skin // The deformed worldspace vertices are used both for the APT and in Create_Decal() to @@ -1147,7 +1147,7 @@ WW3DErrorType MeshClass::Load_W3D(ChunkLoadClass & cload) */ Model = NEW_REF(MeshModelClass,()); if (Model == NULL) { - WWDEBUG_SAY(("MeshClass::Load - Failed to allocate model\r\n")); + WWDEBUG_SAY(("MeshClass::Load - Failed to allocate model")); return WW3D_ERROR_LOAD_FAILED; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshgeometry.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshgeometry.cpp index 3cd652ffc5..1b8dd620cf 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshgeometry.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshgeometry.cpp @@ -1587,7 +1587,7 @@ WW3DErrorType MeshGeometryClass::Load_W3D(ChunkLoadClass & cload) cload.Open_Chunk(); if (cload.Cur_Chunk_ID() != W3D_CHUNK_MESH_HEADER3) { - WWDEBUG_SAY(("Old format mesh mesh, no longer supported.\n")); + WWDEBUG_SAY(("Old format mesh mesh, no longer supported.")); goto Error; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp index 5130b0520c..4cfeca63ae 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp @@ -428,7 +428,7 @@ void MeshMatDescClass::Init_Alternate(MeshMatDescClass & default_materials,MeshM Material[pass] = NEW_REF(VertexMaterialClass,(*(default_materials.Material[pass]))); } else { if (default_materials.MaterialArray[pass]) { - WWDEBUG_SAY(("Unimplemented case: mesh has more than one default vertex material but no alternate vertex materials have been defined.\r\n")); + WWDEBUG_SAY(("Unimplemented case: mesh has more than one default vertex material but no alternate vertex materials have been defined.")); } Material[pass] = NULL; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp index 4ebff7316d..1e7371a1c2 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp @@ -246,7 +246,7 @@ WW3DErrorType MeshModelClass::Load_W3D(ChunkLoadClass & cload) cload.Open_Chunk(); if (cload.Cur_Chunk_ID() != W3D_CHUNK_MESH_HEADER3) { - WWDEBUG_SAY(("Old format mesh mesh, no longer supported.\n")); + WWDEBUG_SAY(("Old format mesh mesh, no longer supported.")); goto Error; } @@ -473,12 +473,12 @@ WW3DErrorType MeshModelClass::read_chunks(ChunkLoadClass & cload,MeshLoadContext case O_W3D_CHUNK_MATERIALS: case O_W3D_CHUNK_MATERIALS2: - WWDEBUG_SAY(( "Obsolete material chunk encountered in mesh: %s.%s\r\n", context->Header.ContainerName,context->Header.MeshName)); + WWDEBUG_SAY(( "Obsolete material chunk encountered in mesh: %s.%s", context->Header.ContainerName,context->Header.MeshName)); WWASSERT(0); break; case W3D_CHUNK_MATERIALS3: - WWDEBUG_SAY(( "Obsolete material chunk encountered in mesh: %s.%s\r\n", context->Header.ContainerName,context->Header.MeshName)); + WWDEBUG_SAY(( "Obsolete material chunk encountered in mesh: %s.%s", context->Header.ContainerName,context->Header.MeshName)); error = read_v3_materials(cload,context); break; @@ -535,11 +535,11 @@ WW3DErrorType MeshModelClass::read_chunks(ChunkLoadClass & cload,MeshLoadContext break; case W3D_CHUNK_DEFORM: - WWDEBUG_SAY(("Obsolete deform chunk encountered in mesh: %s.%s\r\n", context->Header.ContainerName,context->Header.MeshName)); + WWDEBUG_SAY(("Obsolete deform chunk encountered in mesh: %s.%s", context->Header.ContainerName,context->Header.MeshName)); break; case W3D_CHUNK_DAMAGE: - WWDEBUG_SAY(("Obsolete damage chunk encountered in mesh: %s.%s\r\n", context->Header.ContainerName,context->Header.MeshName)); + WWDEBUG_SAY(("Obsolete damage chunk encountered in mesh: %s.%s", context->Header.ContainerName,context->Header.MeshName)); break; case W3D_CHUNK_PRELIT_UNLIT: @@ -706,7 +706,7 @@ WW3DErrorType MeshModelClass::read_v3_materials(ChunkLoadClass & cload,MeshLoadC if (!cload.Close_Chunk()) goto Error; if ( mapinfo.FrameCount > 1 ) { - WWDEBUG_SAY(("ERROR: Obsolete Animated Texture detected in model: %s\r\n",context->Header.MeshName)); + WWDEBUG_SAY(("ERROR: Obsolete Animated Texture detected in model: %s",context->Header.MeshName)); } tex = WW3DAssetManager::Get_Instance()->Get_Texture(filename); @@ -740,7 +740,7 @@ WW3DErrorType MeshModelClass::read_v3_materials(ChunkLoadClass & cload,MeshLoadC if (!cload.Close_Chunk()) goto Error; if ( mapinfo.FrameCount > 1 ) { - WWDEBUG_SAY(("ERROR: Obsolete Animated Texture detected in model: %s\r\n",context->Header.MeshName)); + WWDEBUG_SAY(("ERROR: Obsolete Animated Texture detected in model: %s",context->Header.MeshName)); } tex = WW3DAssetManager::Get_Instance()->Get_Texture(filename); @@ -1646,7 +1646,7 @@ void MeshModelClass::post_process() // we want to allow this now due to usage of the static sort // Ensure no sorting, multipass meshes (for they are abomination...) if (DefMatDesc->Get_Pass_Count() > 1 && Get_Flag(SORT)) { - WWDEBUG_SAY(( "Turning SORT off for multipass mesh %s\n",Get_Name() )); + WWDEBUG_SAY(( "Turning SORT off for multipass mesh %s",Get_Name() )); Set_Flag(SORT, false); } #endif diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/part_ldr.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/part_ldr.cpp index c58b2e5ae3..415db7f419 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/part_ldr.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/part_ldr.cpp @@ -406,7 +406,7 @@ ParticleEmitterDefClass::Load_W3D (ChunkLoadClass &chunk_load) break; default: - WWDEBUG_SAY(("Unhandled Chunk! File: %s Line: %d\r\n",__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk! File: %s Line: %d",__FILE__,__LINE__)); break; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp index 8bb0ddcc41..e6716d40fa 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp @@ -301,7 +301,7 @@ void SceneClass::Load(ChunkLoadClass & cload) } } else { - WWDEBUG_SAY(("Unhandled Chunk: 0x%X in file: %s line: %d\r\n",cload.Cur_Chunk_ID(),__FILE__,__LINE__)); + WWDEBUG_SAY(("Unhandled Chunk: 0x%X in file: %s line: %d",cload.Cur_Chunk_ID(),__FILE__,__LINE__)); } cload.Close_Chunk(); } @@ -574,7 +574,7 @@ void SimpleSceneClass::Customized_Render(RenderInfoClass & rinfo) } else { // Simple scene only supports 4 global lights - WWDEBUG_SAY(("Light %d ignored\n",count)); + WWDEBUG_SAY(("Light %d ignored",count)); } count++; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp index 4aa3bfed67..f84d2c0cde 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp @@ -581,7 +581,7 @@ void TexProjectClass::Init_Multiplicative(void) MaterialPass->Set_Texture(grad_tex,1); grad_tex->Release_Ref(); } else { - WWDEBUG_SAY(("Could not find texture: MultProjectorGradient.tga!\n")); + WWDEBUG_SAY(("Could not find texture: MultProjectorGradient.tga!")); } } else { @@ -683,7 +683,7 @@ void TexProjectClass::Init_Additive(void) MaterialPass->Set_Texture(grad_tex,1); grad_tex->Release_Ref(); } else { - WWDEBUG_SAY(("Could not find texture: AddProjectorGradient.tga!\n")); + WWDEBUG_SAY(("Could not find texture: AddProjectorGradient.tga!")); } #if (DEBUG_SHADOW_RENDERING) @@ -872,7 +872,7 @@ bool TexProjectClass::Compute_Perspective_Projection ) { if (model == NULL) { - WWDEBUG_SAY(("Attempting to generate projection for a NULL model\r\n")); + WWDEBUG_SAY(("Attempting to generate projection for a NULL model")); return false; } @@ -999,7 +999,7 @@ bool TexProjectClass::Compute_Ortho_Projection ) { if (model == NULL) { - WWDEBUG_SAY(("Attempting to generate projection for a NULL model\r\n")); + WWDEBUG_SAY(("Attempting to generate projection for a NULL model")); return false; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp index 6e40fb487e..bc796f671d 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp @@ -509,7 +509,7 @@ IDirect3DTexture8* TextureLoader::Load_Thumbnail(const StringClass& filename, co DX8CALL(UpdateTexture(sysmem_texture,d3d_texture)); sysmem_texture->Release(); - WWDEBUG_SAY(("Created non-managed texture (%s)\n",filename)); + WWDEBUG_SAY(("Created non-managed texture (%s)",filename)); return d3d_texture; #endif } @@ -1568,7 +1568,7 @@ bool TextureLoadTaskClass::Begin_Uncompressed_Load(void) && src_format != WW3D_FORMAT_R8G8B8 && src_format != WW3D_FORMAT_X8R8G8B8 ) { - WWDEBUG_SAY(("Invalid TGA format used in %s - only 24 and 32 bit formats should be used!\n", Texture->Get_Full_Path().str())); + WWDEBUG_SAY(("Invalid TGA format used in %s - only 24 and 32 bit formats should be used!", Texture->Get_Full_Path().str())); } // Destination size will be the next power of two square from the larger width and height... @@ -1577,7 +1577,7 @@ bool TextureLoadTaskClass::Begin_Uncompressed_Load(void) TextureLoader::Validate_Texture_Size(width, height,depth); if (width != ow || height != oh) { - WWDEBUG_SAY(("Invalid texture size, scaling required. Texture: %s, size: %d x %d -> %d x %d\n", Texture->Get_Full_Path().str(), ow, oh, width, height)); + WWDEBUG_SAY(("Invalid texture size, scaling required. Texture: %s, size: %d x %d -> %d x %d", Texture->Get_Full_Path().str(), ow, oh, width, height)); } Width = width; @@ -1722,7 +1722,7 @@ bool TextureLoadTaskClass::Begin_Uncompressed_Load(void) if ( src_format != WW3D_FORMAT_A8R8G8B8 && src_format != WW3D_FORMAT_R8G8B8 && src_format != WW3D_FORMAT_X8R8G8B8) { - WWDEBUG_SAY(("Invalid TGA format used in %s - only 24 and 32 bit formats should be used!\n", Texture->Get_Full_Path())); + WWDEBUG_SAY(("Invalid TGA format used in %s - only 24 and 32 bit formats should be used!", Texture->Get_Full_Path())); } // Destination size will be the next power of two square from the larger width and height... @@ -1749,7 +1749,7 @@ bool TextureLoadTaskClass::Begin_Uncompressed_Load(void) unsigned oh = height; TextureLoader::Validate_Texture_Size(width, height); if (width != ow || height != oh) { - WWDEBUG_SAY(("Invalid texture size, scaling required. Texture: %s, size: %d x %d -> %d x %d\n", Texture->Get_Full_Path(), ow, oh, width, height)); + WWDEBUG_SAY(("Invalid texture size, scaling required. Texture: %s, size: %d x %d -> %d x %d", Texture->Get_Full_Path(), ow, oh, width, height)); } Width = width; @@ -1818,7 +1818,7 @@ void TextureLoadTaskClass::Unlock_Surfaces(void) DX8CALL(UpdateTexture(Peek_D3D_Texture(),tex)); Peek_D3D_Texture()->Release(); D3DTexture=tex; - WWDEBUG_SAY(("Created non-managed texture (%s)\n",Texture->Get_Full_Path())); + WWDEBUG_SAY(("Created non-managed texture (%s)",Texture->Get_Full_Path())); #endif } @@ -2213,7 +2213,7 @@ void CubeTextureLoadTaskClass::Unlock_Surfaces(void) DX8CALL(UpdateTexture(Peek_D3D_Volume_Texture(),tex)); Peek_D3D_Volume_Texture()->Release(); D3DTexture=tex; - WWDEBUG_SAY(("Created non-managed texture (%s)\n",Texture->Get_Full_Path())); + WWDEBUG_SAY(("Created non-managed texture (%s)",Texture->Get_Full_Path())); #endif } @@ -2350,7 +2350,7 @@ bool CubeTextureLoadTaskClass::Begin_Uncompressed_Load(void) && src_format != WW3D_FORMAT_R8G8B8 && src_format != WW3D_FORMAT_X8R8G8B8 ) { - WWDEBUG_SAY(("Invalid TGA format used in %s - only 24 and 32 bit formats should be used!\n", Texture->Get_Full_Path().str())); + WWDEBUG_SAY(("Invalid TGA format used in %s - only 24 and 32 bit formats should be used!", Texture->Get_Full_Path().str())); } // Destination size will be the next power of two square from the larger width and height... @@ -2359,7 +2359,7 @@ bool CubeTextureLoadTaskClass::Begin_Uncompressed_Load(void) TextureLoader::Validate_Texture_Size(width, height,depth); if (width != ow || height != oh) { - WWDEBUG_SAY(("Invalid texture size, scaling required. Texture: %s, size: %d x %d -> %d x %d\n", Texture->Get_Full_Path().str(), ow, oh, width, height)); + WWDEBUG_SAY(("Invalid texture size, scaling required. Texture: %s, size: %d x %d -> %d x %d", Texture->Get_Full_Path().str(), ow, oh, width, height)); } Width = width; @@ -2573,7 +2573,7 @@ void VolumeTextureLoadTaskClass::Unlock_Surfaces() DX8CALL(UpdateTexture(Peek_D3D_Volume_Texture(),tex)); Peek_D3D_Volume_Texture()->Release(); D3DTexture=tex; - WWDEBUG_SAY(("Created non-managed texture (%s)\n",Texture->Get_Full_Path())); + WWDEBUG_SAY(("Created non-managed texture (%s)",Texture->Get_Full_Path())); #endif } @@ -2716,7 +2716,7 @@ bool VolumeTextureLoadTaskClass::Begin_Uncompressed_Load(void) && src_format != WW3D_FORMAT_R8G8B8 && src_format != WW3D_FORMAT_X8R8G8B8 ) { - WWDEBUG_SAY(("Invalid TGA format used in %s - only 24 and 32 bit formats should be used!\n", Texture->Get_Full_Path().str())); + WWDEBUG_SAY(("Invalid TGA format used in %s - only 24 and 32 bit formats should be used!", Texture->Get_Full_Path().str())); } // Destination size will be the next power of two square from the larger width and height... @@ -2726,7 +2726,7 @@ bool VolumeTextureLoadTaskClass::Begin_Uncompressed_Load(void) TextureLoader::Validate_Texture_Size(width, height, depth); if (width != ow || height != oh || depth != od) { - WWDEBUG_SAY(("Invalid texture size, scaling required. Texture: %s, size: %d x %d -> %d x %d\n", Texture->Get_Full_Path().str(), ow, oh, width, height)); + WWDEBUG_SAY(("Invalid texture size, scaling required. Texture: %s, size: %d x %d -> %d x %d", Texture->Get_Full_Path().str(), ow, oh, width, height)); } Width = width; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp index 8757e81aba..c7bdb228b2 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp @@ -163,7 +163,7 @@ ThumbnailClass::ThumbnailClass(ThumbnailManagerClass* manager, const StringClass unsigned src_bpp=0; Get_WW3D_Format(src_format,src_bpp,targa); if (src_format==WW3D_FORMAT_UNKNOWN) { - WWDEBUG_SAY(("Unknown texture format for %s\n",filename.str())); + WWDEBUG_SAY(("Unknown texture format for %s",filename.str())); return; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp index 8458d21ddc..41128dcc81 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp @@ -267,7 +267,7 @@ void WW3D::Set_NPatches_Level(unsigned level) WW3DErrorType WW3D::Init(void *hwnd, char *defaultpal, bool lite) { assert(IsInitted == false); - WWDEBUG_SAY(("WW3D::Init hwnd = %p\n",hwnd)); + WWDEBUG_SAY(("WW3D::Init hwnd = %p",hwnd)); _Hwnd = (HWND)hwnd; Lite = lite; @@ -275,11 +275,11 @@ WW3DErrorType WW3D::Init(void *hwnd, char *defaultpal, bool lite) ** Initialize d3d, this also enumerates the available devices and resolutions. */ Init_D3D_To_WW3_Conversion(); - WWDEBUG_SAY(("Init DX8Wrapper\n")); + WWDEBUG_SAY(("Init DX8Wrapper")); if (!DX8Wrapper::Init(_Hwnd, lite)) { return(WW3D_ERROR_INITIALIZATION_FAILED); } - WWDEBUG_SAY(("Allocate Debug Resources\n")); + WWDEBUG_SAY(("Allocate Debug Resources")); Allocate_Debug_Resources(); MMRESULT r=timeBeginPeriod(1); @@ -289,7 +289,7 @@ WW3DErrorType WW3D::Init(void *hwnd, char *defaultpal, bool lite) ** Initialize the dazzle system */ if (!lite) { - WWDEBUG_SAY(("Init Dazzles\n")); + WWDEBUG_SAY(("Init Dazzles")); FileClass * dazzle_ini_file = _TheFileFactory->Get_File(DAZZLE_INI_FILENAME); if (dazzle_ini_file) { INIClass dazzle_ini(*dazzle_ini_file); @@ -311,7 +311,7 @@ WW3DErrorType WW3D::Init(void *hwnd, char *defaultpal, bool lite) AnimatedSoundMgrClass::Initialize (); IsInitted = true; } - WWDEBUG_SAY(("WW3D Init completed\n")); + WWDEBUG_SAY(("WW3D Init completed")); return WW3D_ERROR_OK; } @@ -331,7 +331,7 @@ WW3DErrorType WW3D::Init(void *hwnd, char *defaultpal, bool lite) WW3DErrorType WW3D::Shutdown(void) { assert(Lite || IsInitted == true); -// WWDEBUG_SAY(("WW3D::Shutdown\n")); +// WWDEBUG_SAY(("WW3D::Shutdown")); #ifdef WW3D_DX8 if (IsCapturing) { @@ -810,7 +810,7 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, f // Check if the device needs to be reset if( D3DERR_DEVICENOTRESET == hr ) { - WWDEBUG_SAY(("WW3D::Begin_Render is resetting the device.\n")); + WWDEBUG_SAY(("WW3D::Begin_Render is resetting the device.")); DX8Wrapper::Reset_Device(); } @@ -1329,7 +1329,7 @@ void WW3D::Make_Screen_Shot( const char * filename_base , const float gamma, con } } - WWDEBUG_SAY(( "Creating Screen Shot %s\n", filename )); + WWDEBUG_SAY(( "Creating Screen Shot %s", filename )); // make the gamma look up table int i; @@ -1510,7 +1510,7 @@ void WW3D::Start_Movie_Capture( const char * filename_base, float frame_rate ) Movie = W3DNEW FrameGrabClass( filename_base, FrameGrabClass::AVI, width, height, depth, frame_rate); - WWDEBUG_SAY(( "Starting Movie %s\n", filename_base )); + WWDEBUG_SAY(( "Starting Movie %s", filename_base )); #endif } @@ -1532,7 +1532,7 @@ void WW3D::Stop_Movie_Capture( void ) #ifdef _WINDOWS if (IsCapturing) { IsCapturing = false; - WWDEBUG_SAY(( "Stoping Movie\n" )); + WWDEBUG_SAY(( "Stoping Movie" )); WWASSERT( Movie != NULL); delete Movie; @@ -1690,7 +1690,7 @@ void WW3D::Update_Movie_Capture( void ) #ifdef _WINDOWS WWASSERT( IsCapturing); WWPROFILE("WW3D::Update_Movie_Capture"); - WWDEBUG_SAY(( "Updating\n")); + WWDEBUG_SAY(( "Updating")); // TheSuperHackers @bugfix xezon 21/05/2025 Get the back buffer and create a copy of the surface. // Originally this code took the front buffer and tried to lock it. This does not work when the diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp index af8d194789..89e777abb7 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp @@ -2046,7 +2046,7 @@ void WbView3d::redraw(void) curTicks = GetTickCount()-curTicks; // if (curTicks>2) { -// WWDEBUG_SAY(("%d ms for updateCenter, %d FPS\n", curTicks, 1000/curTicks)); +// WWDEBUG_SAY(("%d ms for updateCenter, %d FPS", curTicks, 1000/curTicks)); // } } if (m_drawObject) { From 413bbcd811a85d93e19f9da6f1e5f843c5578e3c Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:20:47 +0200 Subject: [PATCH 08/13] [GEN][ZH] Remove trailing CR LF from WWRELEASE_SAY, SNAPSHOT_SAY strings with script (#1232) --- .../Source/WWVegas/WW3D2/dx8polygonrenderer.h | 14 ++--- .../Source/WWVegas/WWDebug/wwprofile.cpp | 8 +-- .../Source/WWVegas/WWSaveLoad/saveload.cpp | 2 +- .../Source/WWVegas/WW3D2/dx8renderer.cpp | 36 +++++------ .../Source/WWVegas/WW3D2/dx8wrapper.cpp | 60 +++++++++---------- .../Source/WWVegas/WW3D2/dx8wrapper.h | 18 +++--- .../Libraries/Source/WWVegas/WW3D2/mesh.cpp | 4 +- .../Source/WWVegas/WW3D2/sortingrenderer.cpp | 4 +- .../Libraries/Source/WWVegas/WW3D2/ww3d.cpp | 8 +-- .../Source/WWVegas/WW3D2/dx8renderer.cpp | 40 ++++++------- .../Source/WWVegas/WW3D2/dx8wrapper.cpp | 60 +++++++++---------- .../Source/WWVegas/WW3D2/dx8wrapper.h | 20 +++---- .../Libraries/Source/WWVegas/WW3D2/mesh.cpp | 4 +- .../Libraries/Source/WWVegas/WW3D2/shader.cpp | 30 +++++----- .../Source/WWVegas/WW3D2/sortingrenderer.cpp | 6 +- .../Source/WWVegas/WW3D2/texproject.cpp | 4 +- .../Libraries/Source/WWVegas/WW3D2/ww3d.cpp | 8 +-- 17 files changed, 163 insertions(+), 163 deletions(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h b/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h index b2d19e882e..55f773aaad 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h @@ -118,12 +118,12 @@ inline void DX8PolygonRendererClass::Set_Vertex_Index_Range(unsigned min_vertex_ inline void DX8PolygonRendererClass::Render(/*const Matrix3D & tm,*/int base_vertex_offset) { // DX8Wrapper::Set_Transform(D3DTS_WORLD,tm); -// SNAPSHOT_SAY(("Set_Transform\n")); - SNAPSHOT_SAY(("Set_Index_Buffer_Index_Offset(%d)\n",base_vertex_offset)); +// SNAPSHOT_SAY(("Set_Transform")); + SNAPSHOT_SAY(("Set_Index_Buffer_Index_Offset(%d)",base_vertex_offset)); DX8Wrapper::Set_Index_Buffer_Index_Offset(base_vertex_offset); if (strip) { - SNAPSHOT_SAY(("Draw_Strip(%d,%d,%d,%d)\n",index_offset,index_count-2,min_vertex_index,vertex_index_range)); + SNAPSHOT_SAY(("Draw_Strip(%d,%d,%d,%d)",index_offset,index_count-2,min_vertex_index,vertex_index_range)); DX8Wrapper::Draw_Strip( index_offset, index_count-2, @@ -131,7 +131,7 @@ inline void DX8PolygonRendererClass::Render(/*const Matrix3D & tm,*/int base_ver vertex_index_range); } else { - SNAPSHOT_SAY(("Draw_Triangles(%d,%d,%d,%d)\n",index_offset,index_count-2,min_vertex_index,vertex_index_range)); + SNAPSHOT_SAY(("Draw_Triangles(%d,%d,%d,%d)",index_offset,index_count-2,min_vertex_index,vertex_index_range)); DX8Wrapper::Draw_Triangles( index_offset, index_count/3, @@ -144,9 +144,9 @@ inline void DX8PolygonRendererClass::Render_Sorted(/*const Matrix3D & tm,*/int b { WWASSERT(!strip); // Strips can't be sorted for now // DX8Wrapper::Set_Transform(D3DTS_WORLD,tm); -// SNAPSHOT_SAY(("Set_Transform\n")); - SNAPSHOT_SAY(("Set_Index_Buffer_Index_Offset(%d)\n",base_vertex_offset)); - SNAPSHOT_SAY(("Insert_Sorting_Triangles(%d,%d,%d,%d)\n",index_offset,index_count-2,min_vertex_index,vertex_index_range)); +// SNAPSHOT_SAY(("Set_Transform")); + SNAPSHOT_SAY(("Set_Index_Buffer_Index_Offset(%d)",base_vertex_offset)); + SNAPSHOT_SAY(("Insert_Sorting_Triangles(%d,%d,%d,%d)",index_offset,index_count-2,min_vertex_index,vertex_index_range)); DX8Wrapper::Set_Index_Buffer_Index_Offset(base_vertex_offset); SortingRendererClass::Insert_Triangles( diff --git a/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp b/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp index aa72e8d203..c4935ce123 100644 --- a/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp +++ b/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp @@ -1039,7 +1039,7 @@ WWMemoryAndTimeLog::WWMemoryAndTimeLog(const char* name) IntermediateAllocSizeStart=AllocSizeStart; StringClass tmp(0,true); for (unsigned i=0;iGet_Total_Allocation_Count(); int current_alloc_size=FastAllocatorGeneral::Get_Allocator()->Get_Total_Allocated_Size(); - WWRELEASE_SAY(("IN TOTAL %s took %d.%3.3d s, did %d memory allocations of %d bytes\n", + WWRELEASE_SAY(("IN TOTAL %s took %d.%3.3d s, did %d memory allocations of %d bytes", Name.str(), (current_time - TimeStart)/1000, (current_time - TimeStart)%1000, current_alloc_count - AllocCountStart, current_alloc_size - AllocSizeStart)); - WWRELEASE_SAY(("\n")); + WWRELEASE_SAY(("")); } @@ -1070,7 +1070,7 @@ void WWMemoryAndTimeLog::Log_Intermediate(const char* text) int current_alloc_size=FastAllocatorGeneral::Get_Allocator()->Get_Total_Allocated_Size(); StringClass tmp(0,true); for (unsigned i=0;iName())); +//WWRELEASE_SAY((" Name: %s",sys->Name())); INIT_SUB_STATUS(sys->Name()); ok &= sys->Load(cload); WWLOG_INTERMEDIATE(sys->Name()); diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp index 51674398f1..ee67223b99 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp @@ -760,9 +760,9 @@ void DX8RigidFVFCategoryContainer::Render(void) DX8Wrapper::Set_Vertex_Buffer(vertex_buffer); DX8Wrapper::Set_Index_Buffer(index_buffer,0); - SNAPSHOT_SAY(("DX8RigidFVFCategoryContainer::Render()\n")); + SNAPSHOT_SAY(("DX8RigidFVFCategoryContainer::Render()")); for (unsigned p=0;pRender(); } @@ -1237,9 +1237,9 @@ void DX8SkinFVFCategoryContainer::Log(bool only_visible) void DX8SkinFVFCategoryContainer::Render(void) { - SNAPSHOT_SAY(("DX8SkinFVFCategoryContainer::Render()\n")); + SNAPSHOT_SAY(("DX8SkinFVFCategoryContainer::Render()")); if (!Anything_To_Render()) { - SNAPSHOT_SAY(("Nothing to render\n")); + SNAPSHOT_SAY(("Nothing to render")); return; } AnythingToRender=false; @@ -1258,7 +1258,7 @@ void DX8SkinFVFCategoryContainer::Render(void) sorting ? BUFFER_TYPE_DYNAMIC_SORTING : BUFFER_TYPE_DYNAMIC_DX8, dynamic_fvf_type, maxVertexCount); - SNAPSHOT_SAY(("DynamicVBAccess - %s - %d vertices\n",sorting ? "sorting" : "non-sorting",VisibleVertexCount)); + SNAPSHOT_SAY(("DynamicVBAccess - %s - %d vertices",sorting ? "sorting" : "non-sorting",VisibleVertexCount)); unsigned int renderedVertexCount=0; @@ -1347,14 +1347,14 @@ void DX8SkinFVFCategoryContainer::Render(void) } //while }//lock - SNAPSHOT_SAY(("Set vb: %x ib: %x\n",&vb.FVF_Info(),index_buffer)); + SNAPSHOT_SAY(("Set vb: %x ib: %x",&vb.FVF_Info(),index_buffer)); DX8Wrapper::Set_Vertex_Buffer(vb); DX8Wrapper::Set_Index_Buffer(index_buffer,0); //Flush the meshes which fit in the vertex buffer, applying all texture variations for (unsigned pass=0;passGet_Texture_Name().str() : "NULL")); + SNAPSHOT_SAY(("Set_Texture(%d,%s)",i,Peek_Texture(i) ? Peek_Texture(i)->Get_Texture_Name().str() : "NULL")); DX8Wrapper::Set_Texture(i,Peek_Texture(i)); } @@ -1640,11 +1640,11 @@ void DX8TextureCategoryClass::Render(void) } #endif - SNAPSHOT_SAY(("Set_Material(%s)\n",Peek_Material() ? Peek_Material()->Get_Name() : "NULL")); + SNAPSHOT_SAY(("Set_Material(%s)",Peek_Material() ? Peek_Material()->Get_Name() : "NULL")); VertexMaterialClass *vmaterial=(VertexMaterialClass *)Peek_Material(); //ugly cast from const but we'll restore it after changes so okay. -MW DX8Wrapper::Set_Material(vmaterial); - SNAPSHOT_SAY(("Set_Shader(%x)\n",Get_Shader().Get_Bits())); + SNAPSHOT_SAY(("Set_Shader(%x)",Get_Shader().Get_Bits())); ShaderClass theShader = Get_Shader(); //Setup an alpha blend version of this shader just in case it's needed. -MW @@ -1690,7 +1690,7 @@ void DX8TextureCategoryClass::Render(void) continue; } - SNAPSHOT_SAY(("mesh = %s\n",mesh->Get_Name())); + SNAPSHOT_SAY(("mesh = %s",mesh->Get_Name())); #ifdef WWDEBUG // Debug rendering: if it exists, expose prelighting on this mesh by disabling all base textures. @@ -1745,11 +1745,11 @@ void DX8TextureCategoryClass::Render(void) */ LightEnvironmentClass * lenv = mesh->Get_Lighting_Environment(); if (lenv != NULL) { - SNAPSHOT_SAY(("LightEnvironment, lights: %d\n",lenv->Get_Light_Count())); + SNAPSHOT_SAY(("LightEnvironment, lights: %d",lenv->Get_Light_Count())); DX8Wrapper::Set_Light_Environment(lenv); } else { - SNAPSHOT_SAY(("No light environment\n")); + SNAPSHOT_SAY(("No light environment")); } /* @@ -1760,7 +1760,7 @@ void DX8TextureCategoryClass::Render(void) Matrix3D tmp_world; if (mesh->Peek_Model()->Get_Flag(MeshModelClass::ALIGNED)) { - SNAPSHOT_SAY(("Camera mode ALIGNED\n")); + SNAPSHOT_SAY(("Camera mode ALIGNED")); Vector3 mesh_position; Vector3 camera_z_vector; @@ -1772,7 +1772,7 @@ void DX8TextureCategoryClass::Render(void) world_transform = &tmp_world; } else if (mesh->Peek_Model()->Get_Flag(MeshModelClass::ORIENTED)) { - SNAPSHOT_SAY(("Camera mode ORIENTED\n")); + SNAPSHOT_SAY(("Camera mode ORIENTED")); Vector3 mesh_position; Vector3 camera_position; @@ -1784,7 +1784,7 @@ void DX8TextureCategoryClass::Render(void) world_transform = &tmp_world; } else if (mesh->Peek_Model()->Get_Flag(MeshModelClass::SKIN)) { - SNAPSHOT_SAY(("Set world identity (for skin)\n")); + SNAPSHOT_SAY(("Set world identity (for skin)")); tmp_world.Make_Identity(); world_transform = &tmp_world; @@ -1793,11 +1793,11 @@ void DX8TextureCategoryClass::Render(void) if (identity) { - SNAPSHOT_SAY(("Set_World_Identity\n")); + SNAPSHOT_SAY(("Set_World_Identity")); DX8Wrapper::Set_World_Identity(); } else { - SNAPSHOT_SAY(("Set_World_Transform\n")); + SNAPSHOT_SAY(("Set_World_Transform")); DX8Wrapper::Set_Transform(D3DTS_WORLD,*world_transform); } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp index 6571079b48..86af36741c 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp @@ -1893,7 +1893,7 @@ void DX8Wrapper::Draw( if (DrawPolygonLowBoundLimit && DrawPolygonLowBoundLimit>=polygon_count) return; DX8_THREAD_ASSERT(); - SNAPSHOT_SAY(("DX8 - draw\n")); + SNAPSHOT_SAY(("DX8 - draw")); Apply_Render_State_Changes(); @@ -1907,51 +1907,51 @@ void DX8Wrapper::Draw( HRESULT res=D3DDevice->ValidateDevice(&passes); switch (res) { case D3D_OK: - SNAPSHOT_SAY(("OK\n")); + SNAPSHOT_SAY(("OK")); break; case D3DERR_CONFLICTINGTEXTUREFILTER: - SNAPSHOT_SAY(("D3DERR_CONFLICTINGTEXTUREFILTER\n")); + SNAPSHOT_SAY(("D3DERR_CONFLICTINGTEXTUREFILTER")); break; case D3DERR_CONFLICTINGTEXTUREPALETTE: - SNAPSHOT_SAY(("D3DERR_CONFLICTINGTEXTUREPALETTE\n")); + SNAPSHOT_SAY(("D3DERR_CONFLICTINGTEXTUREPALETTE")); break; case D3DERR_DEVICELOST: - SNAPSHOT_SAY(("D3DERR_DEVICELOST\n")); + SNAPSHOT_SAY(("D3DERR_DEVICELOST")); break; case D3DERR_TOOMANYOPERATIONS: - SNAPSHOT_SAY(("D3DERR_TOOMANYOPERATIONS\n")); + SNAPSHOT_SAY(("D3DERR_TOOMANYOPERATIONS")); break; case D3DERR_UNSUPPORTEDALPHAARG: - SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDALPHAARG\n")); + SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDALPHAARG")); break; case D3DERR_UNSUPPORTEDALPHAOPERATION: - SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDALPHAOPERATION\n")); + SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDALPHAOPERATION")); break; case D3DERR_UNSUPPORTEDCOLORARG: - SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDCOLORARG\n")); + SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDCOLORARG")); break; case D3DERR_UNSUPPORTEDCOLOROPERATION: - SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDCOLOROPERATION\n")); + SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDCOLOROPERATION")); break; case D3DERR_UNSUPPORTEDFACTORVALUE: - SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDFACTORVALUE\n")); + SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDFACTORVALUE")); break; case D3DERR_UNSUPPORTEDTEXTUREFILTER: - SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDTEXTUREFILTER\n")); + SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDTEXTUREFILTER")); break; case D3DERR_WRONGTEXTUREFORMAT: - SNAPSHOT_SAY(("D3DERR_WRONGTEXTUREFORMAT\n")); + SNAPSHOT_SAY(("D3DERR_WRONGTEXTUREFORMAT")); break; default: - SNAPSHOT_SAY(("UNKNOWN Error\n")); + SNAPSHOT_SAY(("UNKNOWN Error")); break; } } #endif // MESH_RENDER_SHAPSHOT_ENABLED - SNAPSHOT_SAY(("DX8 - draw %d polygons (%d vertices)\n",polygon_count,vertex_count)); + SNAPSHOT_SAY(("DX8 - draw %d polygons (%d vertices)",polygon_count,vertex_count)); if (vertex_count<3) { min_vertex_index=0; @@ -2079,11 +2079,11 @@ void DX8Wrapper::Draw_Strip( void DX8Wrapper::Apply_Render_State_Changes() { - SNAPSHOT_SAY(("DX8Wrapper::Apply_Render_State_Changes()\n")); + SNAPSHOT_SAY(("DX8Wrapper::Apply_Render_State_Changes()")); if (!render_state_changed) return; if (render_state_changed&SHADER_CHANGED) { - SNAPSHOT_SAY(("DX8 - apply shader\n")); + SNAPSHOT_SAY(("DX8 - apply shader")); render_state.shader.Apply(); } @@ -2093,7 +2093,7 @@ void DX8Wrapper::Apply_Render_State_Changes() { if (render_state_changed&mask) { - SNAPSHOT_SAY(("DX8 - apply texture %d\n",i)); + SNAPSHOT_SAY(("DX8 - apply texture %d",i)); if (render_state.Textures[i]) { @@ -2108,7 +2108,7 @@ void DX8Wrapper::Apply_Render_State_Changes() if (render_state_changed&MATERIAL_CHANGED) { - SNAPSHOT_SAY(("DX8 - apply material\n")); + SNAPSHOT_SAY(("DX8 - apply material")); VertexMaterialClass* material=const_cast(render_state.material); if (material) { @@ -2122,7 +2122,7 @@ void DX8Wrapper::Apply_Render_State_Changes() unsigned mask=LIGHT0_CHANGED; for (unsigned index=0;index<4;++index,mask<<=1) { if (render_state_changed&mask) { - SNAPSHOT_SAY(("DX8 - apply light %d\n",index)); + SNAPSHOT_SAY(("DX8 - apply light %d",index)); if (render_state.LightEnable[index]) { #ifdef MESH_RENDER_SNAPSHOT_ENABLED if ( WW3D::Is_Snapshot_Activated() ) { @@ -2130,12 +2130,12 @@ void DX8Wrapper::Apply_Render_State_Changes() static const char * _light_types[] = { "Unknown", "Point","Spot", "Directional" }; WWASSERT((light->Type >= 0) && (light->Type <= 3)); - SNAPSHOT_SAY((" type = %s amb = %4.2f,%4.2f,%4.2f diff = %4.2f,%4.2f,%4.2f spec = %4.2f, %4.2f, %4.2f\n", + SNAPSHOT_SAY((" type = %s amb = %4.2f,%4.2f,%4.2f diff = %4.2f,%4.2f,%4.2f spec = %4.2f, %4.2f, %4.2f", _light_types[light->Type], light->Ambient.r,light->Ambient.g,light->Ambient.b, light->Diffuse.r,light->Diffuse.g,light->Diffuse.b, light->Specular.r,light->Specular.g,light->Specular.b )); - SNAPSHOT_SAY((" pos = %f, %f, %f dir = %f, %f, %f\n", + SNAPSHOT_SAY((" pos = %f, %f, %f dir = %f, %f, %f", light->Position.x, light->Position.y, light->Position.z, light->Direction.x, light->Direction.y, light->Direction.z )); } @@ -2145,22 +2145,22 @@ void DX8Wrapper::Apply_Render_State_Changes() } else { Set_DX8_Light(index,NULL); - SNAPSHOT_SAY((" clearing light to NULL\n")); + SNAPSHOT_SAY((" clearing light to NULL")); } } } } if (render_state_changed&WORLD_CHANGED) { - SNAPSHOT_SAY(("DX8 - apply world matrix\n")); + SNAPSHOT_SAY(("DX8 - apply world matrix")); _Set_DX8_Transform(D3DTS_WORLD,render_state.world); } if (render_state_changed&VIEW_CHANGED) { - SNAPSHOT_SAY(("DX8 - apply view matrix\n")); + SNAPSHOT_SAY(("DX8 - apply view matrix")); _Set_DX8_Transform(D3DTS_VIEW,render_state.view); } if (render_state_changed&VERTEX_BUFFER_CHANGED) { - SNAPSHOT_SAY(("DX8 - apply vb change\n")); + SNAPSHOT_SAY(("DX8 - apply vb change")); if (render_state.vertex_buffer) { switch (render_state.vertex_buffer_type) {//->Type()) { case BUFFER_TYPE_DX8: @@ -2184,7 +2184,7 @@ void DX8Wrapper::Apply_Render_State_Changes() } } if (render_state_changed&INDEX_BUFFER_CHANGED) { - SNAPSHOT_SAY(("DX8 - apply ib change\n")); + SNAPSHOT_SAY(("DX8 - apply ib change")); if (render_state.index_buffer) { switch (render_state.index_buffer_type) {//->Type()) { case BUFFER_TYPE_DX8: @@ -2211,7 +2211,7 @@ void DX8Wrapper::Apply_Render_State_Changes() render_state_changed&=((unsigned)WORLD_IDENTITY|(unsigned)VIEW_IDENTITY); - SNAPSHOT_SAY(("DX8Wrapper::Apply_Render_State_Changes() - finished\n")); + SNAPSHOT_SAY(("DX8Wrapper::Apply_Render_State_Changes() - finished")); } IDirect3DTexture8 * DX8Wrapper::_Create_DX8_Texture @@ -2956,7 +2956,7 @@ void DX8Wrapper::Set_Gamma(float gamma,float bright,float contrast,bool calibrat */ void DX8Wrapper::Apply_Default_State() { - SNAPSHOT_SAY(("DX8Wrapper::Apply_Default_State()\n")); + SNAPSHOT_SAY(("DX8Wrapper::Apply_Default_State()")); // only set states used in game Set_DX8_Render_State(D3DRS_ZENABLE, TRUE); @@ -3082,7 +3082,7 @@ void DX8Wrapper::Apply_Default_State() VertexMaterialClass::Apply_Null(); for (unsigned index=0;index<4;++index) { - SNAPSHOT_SAY(("Clearing light %d to NULL\n",index)); + SNAPSHOT_SAY(("Clearing light %d to NULL",index)); Set_DX8_Light(index,NULL); } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h index ea692f4f8f..3956b85fc9 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h @@ -705,7 +705,7 @@ WWINLINE void DX8Wrapper::_Set_DX8_Transform(D3DTRANSFORMSTATETYPE transform,con #endif { DX8Transforms[transform]=m; - SNAPSHOT_SAY(("DX8 - SetTransform %d [%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f]\n",transform,m[0][0],m[0][1],m[0][2],m[0][3],m[1][0],m[1][1],m[1][2],m[1][3],m[2][0],m[2][1],m[2][2],m[2][3],m[3][0],m[3][1],m[3][2],m[3][3])); + SNAPSHOT_SAY(("DX8 - SetTransform %d [%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f]",transform,m[0][0],m[0][1],m[0][2],m[0][3],m[1][0],m[1][1],m[1][2],m[1][3],m[2][0],m[2][1],m[2][2],m[2][3],m[3][0],m[3][1],m[3][2],m[3][3])); DX8_RECORD_MATRIX_CHANGE(); DX8CALL(SetTransform(transform,(D3DMATRIX*)&m)); } @@ -721,7 +721,7 @@ WWINLINE void DX8Wrapper::_Set_DX8_Transform(D3DTRANSFORMSTATETYPE transform,con #endif { DX8Transforms[transform]=mtx; - SNAPSHOT_SAY(("DX8 - SetTransform %d [%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f]\n",transform,m[0][0],m[0][1],m[0][2],m[0][3],m[1][0],m[1][1],m[1][2],m[1][3],m[2][0],m[2][1],m[2][2],m[2][3])); + SNAPSHOT_SAY(("DX8 - SetTransform %d [%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f]",transform,m[0][0],m[0][1],m[0][2],m[0][3],m[1][0],m[1][1],m[1][2],m[1][3],m[2][0],m[2][1],m[2][2],m[2][3])); DX8_RECORD_MATRIX_CHANGE(); DX8CALL(SetTransform(transform,(D3DMATRIX*)&m)); } @@ -787,7 +787,7 @@ WWINLINE void DX8Wrapper::Set_DX8_Material(const D3DMATERIAL8* mat) { DX8_RECORD_MATERIAL_CHANGE(); WWASSERT(mat); - SNAPSHOT_SAY(("DX8 - SetMaterial\n")); + SNAPSHOT_SAY(("DX8 - SetMaterial")); DX8CALL(SetMaterial(mat)); } @@ -798,13 +798,13 @@ WWINLINE void DX8Wrapper::Set_DX8_Light(int index, D3DLIGHT8* light) DX8CALL(SetLight(index,light)); DX8CALL(LightEnable(index,TRUE)); CurrentDX8LightEnables[index]=true; - SNAPSHOT_SAY(("DX8 - SetLight %d\n",index)); + SNAPSHOT_SAY(("DX8 - SetLight %d",index)); } else if (CurrentDX8LightEnables[index]) { DX8_RECORD_LIGHT_CHANGE(); CurrentDX8LightEnables[index]=false; DX8CALL(LightEnable(index,FALSE)); - SNAPSHOT_SAY(("DX8 - DisableLight %d\n",index)); + SNAPSHOT_SAY(("DX8 - DisableLight %d",index)); } } @@ -817,7 +817,7 @@ WWINLINE void DX8Wrapper::Set_DX8_Render_State(D3DRENDERSTATETYPE state, unsigne if (WW3D::Is_Snapshot_Activated()) { StringClass value_name(0,true); Get_DX8_Render_State_Value_Name(value_name,state,value); - SNAPSHOT_SAY(("DX8 - SetRenderState(state: %s, value: %s)\n", + SNAPSHOT_SAY(("DX8 - SetRenderState(state: %s, value: %s)", Get_DX8_Render_State_Name(state), value_name.str())); } @@ -846,7 +846,7 @@ WWINLINE void DX8Wrapper::Set_DX8_Texture_Stage_State(unsigned stage, D3DTEXTURE if (WW3D::Is_Snapshot_Activated()) { StringClass value_name(0,true); Get_DX8_Texture_Stage_State_Value_Name(value_name,state,value); - SNAPSHOT_SAY(("DX8 - SetTextureStageState(stage: %d, state: %s, value: %s)\n", + SNAPSHOT_SAY(("DX8 - SetTextureStageState(stage: %d, state: %s, value: %s)", stage, Get_DX8_Texture_Stage_State_Name(state), value_name.str())); @@ -867,7 +867,7 @@ WWINLINE void DX8Wrapper::Set_DX8_Texture(unsigned int stage, IDirect3DBaseTextu if (Textures[stage]==texture) return; - SNAPSHOT_SAY(("DX8 - SetTexture(%x) \n",texture)); + SNAPSHOT_SAY(("DX8 - SetTexture(%x) ",texture)); if (Textures[stage]) Textures[stage]->Release(); Textures[stage] = texture; @@ -1138,7 +1138,7 @@ WWINLINE void DX8Wrapper::Set_Shader(const ShaderClass& shader) #ifdef MESH_RENDER_SNAPSHOT_ENABLED StringClass str; #endif - SNAPSHOT_SAY(("DX8Wrapper::Set_Shader(%s)\n",shader.Get_Description(str).str())); + SNAPSHOT_SAY(("DX8Wrapper::Set_Shader(%s)",shader.Get_Description(str).str())); } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp index 47441f3b30..3634e1cdad 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp @@ -818,7 +818,7 @@ void MeshClass::Render_Material_Pass(MaterialPassClass * pass,IndexBufferClass * pass->Install_Materials(); DX8Wrapper::Set_Index_Buffer(ib,0); - SNAPSHOT_SAY(("Set_World_Identity\n")); + SNAPSHOT_SAY(("Set_World_Identity")); DX8Wrapper::Set_World_Identity(); DX8PolygonRendererListIterator it(&Model->PolygonRendererList); @@ -945,7 +945,7 @@ void MeshClass::Render_Material_Pass(MaterialPassClass * pass,IndexBufferClass * pass->Install_Materials(); DX8Wrapper::Set_Index_Buffer(ib,0); - SNAPSHOT_SAY(("Set_World_Transform\n")); + SNAPSHOT_SAY(("Set_World_Transform")); DX8Wrapper::Set_Transform(D3DTS_WORLD,Transform); DX8PolygonRendererListIterator it(&Model->PolygonRendererList); diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp index f8b0cf9a15..070bef7a12 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp @@ -518,7 +518,7 @@ void SortingRendererClass::Flush_Sorting_Pool() { if (!overlapping_node_count) return; - SNAPSHOT_SAY(("SortingSystem - Flush \n")); + SNAPSHOT_SAY(("SortingSystem - Flush ")); unsigned node_id; // Fill dynamic index buffer with sorting index buffer vertices @@ -688,7 +688,7 @@ void SortingRendererClass::Flush_Sorting_Pool() overlapping_polygon_count=0; overlapping_vertex_count=0; - SNAPSHOT_SAY(("SortingSystem - Done flushing\n")); + SNAPSHOT_SAY(("SortingSystem - Done flushing")); } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp index 211680ee11..9463abdd46 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp @@ -804,9 +804,9 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, f WWASSERT(IsInitted); HRESULT hr; + SNAPSHOT_SAY(("==========================================")); + SNAPSHOT_SAY(("========== WW3D::Begin_Render ============")); SNAPSHOT_SAY(("==========================================\r\n")); - SNAPSHOT_SAY(("========== WW3D::Begin_Render ============\r\n")); - SNAPSHOT_SAY(("==========================================\r\n\r\n")); if (DX8Wrapper::_Get_D3D_Device8() && (hr=DX8Wrapper::_Get_D3D_Device8()->TestCooperativeLevel()) != D3D_OK) { @@ -1112,9 +1112,9 @@ WW3DErrorType WW3D::End_Render(bool flip_frame) Debug_Statistics::End_Statistics(); } + SNAPSHOT_SAY(("==========================================")); + SNAPSHOT_SAY(("========== WW3D::End_Render ==============")); SNAPSHOT_SAY(("==========================================\r\n")); - SNAPSHOT_SAY(("========== WW3D::End_Render ==============\r\n")); - SNAPSHOT_SAY(("==========================================\r\n\r\n")); Activate_Snapshot(false); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp index d641387fff..f08c0e0f80 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp @@ -296,7 +296,7 @@ void DX8FVFCategoryContainer::Render_Procedural_Material_Passes(void) bool renderTasksRemaining=false; while (mpr != NULL) { - SNAPSHOT_SAY(("Render_Procedural_Material_Pass\n")); + SNAPSHOT_SAY(("Render_Procedural_Material_Pass")); MeshClass * mesh = mpr->Peek_Mesh(); @@ -349,7 +349,7 @@ void DX8RigidFVFCategoryContainer::Render_Delayed_Procedural_Material_Passes(voi DX8Wrapper::Set_Vertex_Buffer(vertex_buffer); DX8Wrapper::Set_Index_Buffer(index_buffer,0); - SNAPSHOT_SAY(("DX8RigidFVFCategoryContainer::Render_Delayed_Procedural_Material_Passes()\n")); + SNAPSHOT_SAY(("DX8RigidFVFCategoryContainer::Render_Delayed_Procedural_Material_Passes()")); // additional passes MatPassTaskClass * mpr = delayed_matpass_head; @@ -808,13 +808,13 @@ void DX8RigidFVFCategoryContainer::Render(void) DX8Wrapper::Set_Index_Buffer(index_buffer,0); - SNAPSHOT_SAY(("DX8RigidFVFCategoryContainer::Render()\n")); + SNAPSHOT_SAY(("DX8RigidFVFCategoryContainer::Render()")); // The Z-biasing was causing more problems than they solved. // Disabling it for now HY. //int zbias=0; //DX8Wrapper::Set_DX8_ZBias(zbias); for (unsigned p=0;pRender(); } @@ -1296,9 +1296,9 @@ void DX8SkinFVFCategoryContainer::Log(bool only_visible) void DX8SkinFVFCategoryContainer::Render(void) { - SNAPSHOT_SAY(("DX8SkinFVFCategoryContainer::Render()\n")); + SNAPSHOT_SAY(("DX8SkinFVFCategoryContainer::Render()")); if (!Anything_To_Render()) { - SNAPSHOT_SAY(("Nothing to render\n")); + SNAPSHOT_SAY(("Nothing to render")); return; } AnythingToRender=false; @@ -1317,7 +1317,7 @@ void DX8SkinFVFCategoryContainer::Render(void) sorting ? BUFFER_TYPE_DYNAMIC_SORTING : BUFFER_TYPE_DYNAMIC_DX8, dynamic_fvf_type, maxVertexCount); - SNAPSHOT_SAY(("DynamicVBAccess - %s - %d vertices\n",sorting ? "sorting" : "non-sorting",VisibleVertexCount)); + SNAPSHOT_SAY(("DynamicVBAccess - %s - %d vertices",sorting ? "sorting" : "non-sorting",VisibleVertexCount)); unsigned int renderedVertexCount=0; @@ -1407,14 +1407,14 @@ void DX8SkinFVFCategoryContainer::Render(void) } //while }//lock - SNAPSHOT_SAY(("Set vb: %x ib: %x\n",&vb.FVF_Info(),index_buffer)); + SNAPSHOT_SAY(("Set vb: %x ib: %x",&vb.FVF_Info(),index_buffer)); DX8Wrapper::Set_Vertex_Buffer(vb); DX8Wrapper::Set_Index_Buffer(index_buffer,0); //Flush the meshes which fit in the vertex buffer, applying all texture variations for (unsigned pass=0;passGet_Texture_Name().str() : "NULL")); + SNAPSHOT_SAY(("Set_Texture(%d,%s)",i,Peek_Texture(i) ? Peek_Texture(i)->Get_Texture_Name().str() : "NULL")); DX8Wrapper::Set_Texture(i,Peek_Texture(i)); } @@ -1701,11 +1701,11 @@ void DX8TextureCategoryClass::Render(void) } #endif - SNAPSHOT_SAY(("Set_Material(%s)\n",Peek_Material() ? Peek_Material()->Get_Name() : "NULL")); + SNAPSHOT_SAY(("Set_Material(%s)",Peek_Material() ? Peek_Material()->Get_Name() : "NULL")); VertexMaterialClass *vmaterial=(VertexMaterialClass *)Peek_Material(); //ugly cast from const but we'll restore it after changes so okay. -MW DX8Wrapper::Set_Material(vmaterial); - SNAPSHOT_SAY(("Set_Shader(%x)\n",Get_Shader().Get_Bits())); + SNAPSHOT_SAY(("Set_Shader(%x)",Get_Shader().Get_Bits())); ShaderClass theShader = Get_Shader(); //Setup an alpha blend version of this shader just in case it's needed. -MW @@ -1751,7 +1751,7 @@ void DX8TextureCategoryClass::Render(void) continue; } - SNAPSHOT_SAY(("mesh = %s\n",mesh->Get_Name())); + SNAPSHOT_SAY(("mesh = %s",mesh->Get_Name())); #ifdef WWDEBUG // Debug rendering: if it exists, expose prelighting on this mesh by disabling all base textures. @@ -1810,11 +1810,11 @@ void DX8TextureCategoryClass::Render(void) */ LightEnvironmentClass * lenv = mesh->Get_Lighting_Environment(); if (lenv != NULL) { - SNAPSHOT_SAY(("LightEnvironment, lights: %d\n",lenv->Get_Light_Count())); + SNAPSHOT_SAY(("LightEnvironment, lights: %d",lenv->Get_Light_Count())); DX8Wrapper::Set_Light_Environment(lenv); } else { - SNAPSHOT_SAY(("No light environment\n")); + SNAPSHOT_SAY(("No light environment")); } /* @@ -1825,7 +1825,7 @@ void DX8TextureCategoryClass::Render(void) Matrix3D tmp_world; if (mesh->Peek_Model()->Get_Flag(MeshModelClass::ALIGNED)) { - SNAPSHOT_SAY(("Camera mode ALIGNED\n")); + SNAPSHOT_SAY(("Camera mode ALIGNED")); Vector3 mesh_position; Vector3 camera_z_vector; @@ -1837,7 +1837,7 @@ void DX8TextureCategoryClass::Render(void) world_transform = &tmp_world; } else if (mesh->Peek_Model()->Get_Flag(MeshModelClass::ORIENTED)) { - SNAPSHOT_SAY(("Camera mode ORIENTED\n")); + SNAPSHOT_SAY(("Camera mode ORIENTED")); Vector3 mesh_position; Vector3 camera_position; @@ -1849,7 +1849,7 @@ void DX8TextureCategoryClass::Render(void) world_transform = &tmp_world; } else if (mesh->Peek_Model()->Get_Flag(MeshModelClass::SKIN)) { - SNAPSHOT_SAY(("Set world identity (for skin)\n")); + SNAPSHOT_SAY(("Set world identity (for skin)")); tmp_world.Make_Identity(); world_transform = &tmp_world; @@ -1858,11 +1858,11 @@ void DX8TextureCategoryClass::Render(void) if (identity) { - SNAPSHOT_SAY(("Set_World_Identity\n")); + SNAPSHOT_SAY(("Set_World_Identity")); DX8Wrapper::Set_World_Identity(); } else { - SNAPSHOT_SAY(("Set_World_Transform\n")); + SNAPSHOT_SAY(("Set_World_Transform")); DX8Wrapper::Set_Transform(D3DTS_WORLD,*world_transform); } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp index cd50c7c2fd..65c2fe248b 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp @@ -2073,7 +2073,7 @@ void DX8Wrapper::Draw( if (DrawPolygonLowBoundLimit && DrawPolygonLowBoundLimit>=polygon_count) return; DX8_THREAD_ASSERT(); - SNAPSHOT_SAY(("DX8 - draw\n")); + SNAPSHOT_SAY(("DX8 - draw")); Apply_Render_State_Changes(); @@ -2087,51 +2087,51 @@ void DX8Wrapper::Draw( HRESULT res=D3DDevice->ValidateDevice(&passes); switch (res) { case D3D_OK: - SNAPSHOT_SAY(("OK\n")); + SNAPSHOT_SAY(("OK")); break; case D3DERR_CONFLICTINGTEXTUREFILTER: - SNAPSHOT_SAY(("D3DERR_CONFLICTINGTEXTUREFILTER\n")); + SNAPSHOT_SAY(("D3DERR_CONFLICTINGTEXTUREFILTER")); break; case D3DERR_CONFLICTINGTEXTUREPALETTE: - SNAPSHOT_SAY(("D3DERR_CONFLICTINGTEXTUREPALETTE\n")); + SNAPSHOT_SAY(("D3DERR_CONFLICTINGTEXTUREPALETTE")); break; case D3DERR_DEVICELOST: - SNAPSHOT_SAY(("D3DERR_DEVICELOST\n")); + SNAPSHOT_SAY(("D3DERR_DEVICELOST")); break; case D3DERR_TOOMANYOPERATIONS: - SNAPSHOT_SAY(("D3DERR_TOOMANYOPERATIONS\n")); + SNAPSHOT_SAY(("D3DERR_TOOMANYOPERATIONS")); break; case D3DERR_UNSUPPORTEDALPHAARG: - SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDALPHAARG\n")); + SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDALPHAARG")); break; case D3DERR_UNSUPPORTEDALPHAOPERATION: - SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDALPHAOPERATION\n")); + SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDALPHAOPERATION")); break; case D3DERR_UNSUPPORTEDCOLORARG: - SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDCOLORARG\n")); + SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDCOLORARG")); break; case D3DERR_UNSUPPORTEDCOLOROPERATION: - SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDCOLOROPERATION\n")); + SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDCOLOROPERATION")); break; case D3DERR_UNSUPPORTEDFACTORVALUE: - SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDFACTORVALUE\n")); + SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDFACTORVALUE")); break; case D3DERR_UNSUPPORTEDTEXTUREFILTER: - SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDTEXTUREFILTER\n")); + SNAPSHOT_SAY(("D3DERR_UNSUPPORTEDTEXTUREFILTER")); break; case D3DERR_WRONGTEXTUREFORMAT: - SNAPSHOT_SAY(("D3DERR_WRONGTEXTUREFORMAT\n")); + SNAPSHOT_SAY(("D3DERR_WRONGTEXTUREFORMAT")); break; default: - SNAPSHOT_SAY(("UNKNOWN Error\n")); + SNAPSHOT_SAY(("UNKNOWN Error")); break; } } #endif // MESH_RENDER_SHAPSHOT_ENABLED - SNAPSHOT_SAY(("DX8 - draw %d polygons (%d vertices)\n",polygon_count,vertex_count)); + SNAPSHOT_SAY(("DX8 - draw %d polygons (%d vertices)",polygon_count,vertex_count)); if (vertex_count<3) { min_vertex_index=0; @@ -2259,11 +2259,11 @@ void DX8Wrapper::Draw_Strip( void DX8Wrapper::Apply_Render_State_Changes() { - SNAPSHOT_SAY(("DX8Wrapper::Apply_Render_State_Changes()\n")); + SNAPSHOT_SAY(("DX8Wrapper::Apply_Render_State_Changes()")); if (!render_state_changed) return; if (render_state_changed&SHADER_CHANGED) { - SNAPSHOT_SAY(("DX8 - apply shader\n")); + SNAPSHOT_SAY(("DX8 - apply shader")); render_state.shader.Apply(); } @@ -2273,7 +2273,7 @@ void DX8Wrapper::Apply_Render_State_Changes() { if (render_state_changed&mask) { - SNAPSHOT_SAY(("DX8 - apply texture %d (%s)\n",i,render_state.Textures[i] ? render_state.Textures[i]->Get_Full_Path().str() : "NULL")); + SNAPSHOT_SAY(("DX8 - apply texture %d (%s)",i,render_state.Textures[i] ? render_state.Textures[i]->Get_Full_Path().str() : "NULL")); if (render_state.Textures[i]) { @@ -2288,7 +2288,7 @@ void DX8Wrapper::Apply_Render_State_Changes() if (render_state_changed&MATERIAL_CHANGED) { - SNAPSHOT_SAY(("DX8 - apply material\n")); + SNAPSHOT_SAY(("DX8 - apply material")); VertexMaterialClass* material=const_cast(render_state.material); if (material) { @@ -2302,7 +2302,7 @@ void DX8Wrapper::Apply_Render_State_Changes() unsigned mask=LIGHT0_CHANGED; for (unsigned index=0;index<4;++index,mask<<=1) { if (render_state_changed&mask) { - SNAPSHOT_SAY(("DX8 - apply light %d\n",index)); + SNAPSHOT_SAY(("DX8 - apply light %d",index)); if (render_state.LightEnable[index]) { #ifdef MESH_RENDER_SNAPSHOT_ENABLED if ( WW3D::Is_Snapshot_Activated() ) { @@ -2310,12 +2310,12 @@ void DX8Wrapper::Apply_Render_State_Changes() static const char * _light_types[] = { "Unknown", "Point","Spot", "Directional" }; WWASSERT((light->Type >= 0) && (light->Type <= 3)); - SNAPSHOT_SAY((" type = %s amb = %4.2f,%4.2f,%4.2f diff = %4.2f,%4.2f,%4.2f spec = %4.2f, %4.2f, %4.2f\n", + SNAPSHOT_SAY((" type = %s amb = %4.2f,%4.2f,%4.2f diff = %4.2f,%4.2f,%4.2f spec = %4.2f, %4.2f, %4.2f", _light_types[light->Type], light->Ambient.r,light->Ambient.g,light->Ambient.b, light->Diffuse.r,light->Diffuse.g,light->Diffuse.b, light->Specular.r,light->Specular.g,light->Specular.b )); - SNAPSHOT_SAY((" pos = %f, %f, %f dir = %f, %f, %f\n", + SNAPSHOT_SAY((" pos = %f, %f, %f dir = %f, %f, %f", light->Position.x, light->Position.y, light->Position.z, light->Direction.x, light->Direction.y, light->Direction.z )); } @@ -2325,22 +2325,22 @@ void DX8Wrapper::Apply_Render_State_Changes() } else { Set_DX8_Light(index,NULL); - SNAPSHOT_SAY((" clearing light to NULL\n")); + SNAPSHOT_SAY((" clearing light to NULL")); } } } } if (render_state_changed&WORLD_CHANGED) { - SNAPSHOT_SAY(("DX8 - apply world matrix\n")); + SNAPSHOT_SAY(("DX8 - apply world matrix")); _Set_DX8_Transform(D3DTS_WORLD,render_state.world); } if (render_state_changed&VIEW_CHANGED) { - SNAPSHOT_SAY(("DX8 - apply view matrix\n")); + SNAPSHOT_SAY(("DX8 - apply view matrix")); _Set_DX8_Transform(D3DTS_VIEW,render_state.view); } if (render_state_changed&VERTEX_BUFFER_CHANGED) { - SNAPSHOT_SAY(("DX8 - apply vb change\n")); + SNAPSHOT_SAY(("DX8 - apply vb change")); for (i=0;iType()) { @@ -2372,7 +2372,7 @@ void DX8Wrapper::Apply_Render_State_Changes() } } if (render_state_changed&INDEX_BUFFER_CHANGED) { - SNAPSHOT_SAY(("DX8 - apply ib change\n")); + SNAPSHOT_SAY(("DX8 - apply ib change")); if (render_state.index_buffer) { switch (render_state.index_buffer_type) {//->Type()) { case BUFFER_TYPE_DX8: @@ -2399,7 +2399,7 @@ void DX8Wrapper::Apply_Render_State_Changes() render_state_changed&=((unsigned)WORLD_IDENTITY|(unsigned)VIEW_IDENTITY); - SNAPSHOT_SAY(("DX8Wrapper::Apply_Render_State_Changes() - finished\n")); + SNAPSHOT_SAY(("DX8Wrapper::Apply_Render_State_Changes() - finished")); } IDirect3DTexture8 * DX8Wrapper::_Create_DX8_Texture @@ -3741,7 +3741,7 @@ void DX8Wrapper::Set_Gamma(float gamma,float bright,float contrast,bool calibrat */ void DX8Wrapper::Apply_Default_State() { - SNAPSHOT_SAY(("DX8Wrapper::Apply_Default_State()\n")); + SNAPSHOT_SAY(("DX8Wrapper::Apply_Default_State()")); // only set states used in game Set_DX8_Render_State(D3DRS_ZENABLE, TRUE); @@ -3867,7 +3867,7 @@ void DX8Wrapper::Apply_Default_State() VertexMaterialClass::Apply_Null(); for (unsigned index=0;index<4;++index) { - SNAPSHOT_SAY(("Clearing light %d to NULL\n",index)); + SNAPSHOT_SAY(("Clearing light %d to NULL",index)); Set_DX8_Light(index,NULL); } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h index 51122ecca8..9f643d89b6 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h @@ -768,7 +768,7 @@ WWINLINE void DX8Wrapper::_Set_DX8_Transform(D3DTRANSFORMSTATETYPE transform,con #endif { DX8Transforms[transform]=m; - SNAPSHOT_SAY(("DX8 - SetTransform %d [%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f]\n",transform,m[0][0],m[0][1],m[0][2],m[0][3],m[1][0],m[1][1],m[1][2],m[1][3],m[2][0],m[2][1],m[2][2],m[2][3],m[3][0],m[3][1],m[3][2],m[3][3])); + SNAPSHOT_SAY(("DX8 - SetTransform %d [%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f]",transform,m[0][0],m[0][1],m[0][2],m[0][3],m[1][0],m[1][1],m[1][2],m[1][3],m[2][0],m[2][1],m[2][2],m[2][3],m[3][0],m[3][1],m[3][2],m[3][3])); DX8_RECORD_MATRIX_CHANGE(); DX8CALL(SetTransform(transform,(D3DMATRIX*)&m)); } @@ -784,7 +784,7 @@ WWINLINE void DX8Wrapper::_Set_DX8_Transform(D3DTRANSFORMSTATETYPE transform,con #endif { DX8Transforms[transform]=mtx; - SNAPSHOT_SAY(("DX8 - SetTransform %d [%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f]\n",transform,m[0][0],m[0][1],m[0][2],m[0][3],m[1][0],m[1][1],m[1][2],m[1][3],m[2][0],m[2][1],m[2][2],m[2][3])); + SNAPSHOT_SAY(("DX8 - SetTransform %d [%f,%f,%f,%f][%f,%f,%f,%f][%f,%f,%f,%f]",transform,m[0][0],m[0][1],m[0][2],m[0][3],m[1][0],m[1][1],m[1][2],m[1][3],m[2][0],m[2][1],m[2][2],m[2][3])); DX8_RECORD_MATRIX_CHANGE(); DX8CALL(SetTransform(transform,(D3DMATRIX*)&m)); } @@ -850,7 +850,7 @@ WWINLINE void DX8Wrapper::Set_DX8_Material(const D3DMATERIAL8* mat) { DX8_RECORD_MATERIAL_CHANGE(); WWASSERT(mat); - SNAPSHOT_SAY(("DX8 - SetMaterial\n")); + SNAPSHOT_SAY(("DX8 - SetMaterial")); DX8CALL(SetMaterial(mat)); } @@ -861,13 +861,13 @@ WWINLINE void DX8Wrapper::Set_DX8_Light(int index, D3DLIGHT8* light) DX8CALL(SetLight(index,light)); DX8CALL(LightEnable(index,TRUE)); CurrentDX8LightEnables[index]=true; - SNAPSHOT_SAY(("DX8 - SetLight %d\n",index)); + SNAPSHOT_SAY(("DX8 - SetLight %d",index)); } else if (CurrentDX8LightEnables[index]) { DX8_RECORD_LIGHT_CHANGE(); CurrentDX8LightEnables[index]=false; DX8CALL(LightEnable(index,FALSE)); - SNAPSHOT_SAY(("DX8 - DisableLight %d\n",index)); + SNAPSHOT_SAY(("DX8 - DisableLight %d",index)); } } @@ -880,7 +880,7 @@ WWINLINE void DX8Wrapper::Set_DX8_Render_State(D3DRENDERSTATETYPE state, unsigne if (WW3D::Is_Snapshot_Activated()) { StringClass value_name(0,true); Get_DX8_Render_State_Value_Name(value_name,state,value); - SNAPSHOT_SAY(("DX8 - SetRenderState(state: %s, value: %s)\n", + SNAPSHOT_SAY(("DX8 - SetRenderState(state: %s, value: %s)", Get_DX8_Render_State_Name(state), value_name.str())); } @@ -909,7 +909,7 @@ WWINLINE void DX8Wrapper::Set_DX8_Texture_Stage_State(unsigned stage, D3DTEXTURE if (WW3D::Is_Snapshot_Activated()) { StringClass value_name(0,true); Get_DX8_Texture_Stage_State_Value_Name(value_name,state,value); - SNAPSHOT_SAY(("DX8 - SetTextureStageState(stage: %d, state: %s, value: %s)\n", + SNAPSHOT_SAY(("DX8 - SetTextureStageState(stage: %d, state: %s, value: %s)", stage, Get_DX8_Texture_Stage_State_Name(state), value_name.str())); @@ -930,7 +930,7 @@ WWINLINE void DX8Wrapper::Set_DX8_Texture(unsigned int stage, IDirect3DBaseTextu if (Textures[stage]==texture) return; - SNAPSHOT_SAY(("DX8 - SetTexture(%x) \n",texture)); + SNAPSHOT_SAY(("DX8 - SetTexture(%x) ",texture)); if (Textures[stage]) Textures[stage]->Release(); Textures[stage] = texture; @@ -1197,7 +1197,7 @@ WWINLINE void DX8Wrapper::Set_Material(const VertexMaterialClass* material) // } REF_PTR_SET(render_state.material,const_cast(material)); render_state_changed|=MATERIAL_CHANGED; - SNAPSHOT_SAY(("DX8Wrapper::Set_Material(%s)\n",material ? material->Get_Name() : "NULL")); + SNAPSHOT_SAY(("DX8Wrapper::Set_Material(%s)",material ? material->Get_Name() : "NULL")); } WWINLINE void DX8Wrapper::Set_Shader(const ShaderClass& shader) @@ -1210,7 +1210,7 @@ WWINLINE void DX8Wrapper::Set_Shader(const ShaderClass& shader) #ifdef MESH_RENDER_SNAPSHOT_ENABLED StringClass str; #endif - SNAPSHOT_SAY(("DX8Wrapper::Set_Shader(%s)\n",shader.Get_Description(str).str())); + SNAPSHOT_SAY(("DX8Wrapper::Set_Shader(%s)",shader.Get_Description(str).str())); } WWINLINE void DX8Wrapper::Set_Projection_Transform_With_Z_Bias(const Matrix4x4& matrix, float znear, float zfar) diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp index c37a14f472..3a62e7b680 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp @@ -856,7 +856,7 @@ void MeshClass::Render_Material_Pass(MaterialPassClass * pass,IndexBufferClass * pass->Install_Materials(); DX8Wrapper::Set_Index_Buffer(ib,0); - SNAPSHOT_SAY(("Set_World_Identity\n")); + SNAPSHOT_SAY(("Set_World_Identity")); DX8Wrapper::Set_World_Identity(); DX8PolygonRendererListIterator it(&Model->PolygonRendererList); @@ -982,7 +982,7 @@ void MeshClass::Render_Material_Pass(MaterialPassClass * pass,IndexBufferClass * pass->Install_Materials(); DX8Wrapper::Set_Index_Buffer(ib,0); - SNAPSHOT_SAY(("Set_World_Transform\n")); + SNAPSHOT_SAY(("Set_World_Transform")); DX8Wrapper::Set_Transform(D3DTS_WORLD,Transform); DX8PolygonRendererListIterator it(&Model->PolygonRendererList); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp index 9af2dd0fd3..b0ad2ca03d 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp @@ -704,7 +704,7 @@ void ShaderClass::Apply() SeccArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: SELECTARG1\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: SELECTARG1")); } break; @@ -716,7 +716,7 @@ void ShaderClass::Apply() SeccArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: MODULATE\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: MODULATE")); } break; @@ -732,7 +732,7 @@ void ShaderClass::Apply() SeccArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: ADDSMOOTH\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: ADDSMOOTH")); } break; @@ -744,7 +744,7 @@ void ShaderClass::Apply() SeccArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: ADD\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: ADD")); } break; @@ -756,7 +756,7 @@ void ShaderClass::Apply() SeccArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: SUBTRACT\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: SUBTRACT")); } break; @@ -768,7 +768,7 @@ void ShaderClass::Apply() SeccArg2 = D3DTA_TEXTURE; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: SUBTRACT\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: SUBTRACT")); } break; @@ -780,7 +780,7 @@ void ShaderClass::Apply() SeccArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: BLENDTEXTUREALPHA\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: BLENDTEXTUREALPHA")); } break; @@ -792,7 +792,7 @@ void ShaderClass::Apply() SeccArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: BLENDCURRENTALPHA\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: BLENDCURRENTALPHA")); } break; @@ -806,7 +806,7 @@ void ShaderClass::Apply() SeccArg1 = D3DTA_TEXTURE; SeccArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: ADDSIGNED\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: ADDSIGNED")); } break; @@ -824,7 +824,7 @@ void ShaderClass::Apply() SeccArg1 = D3DTA_TEXTURE; SeccArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: ADDSIGNED2X\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: ADDSIGNED2X")); } break; @@ -839,7 +839,7 @@ void ShaderClass::Apply() SeccArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: MODULATE2X\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: MODULATE2X")); } break; @@ -853,7 +853,7 @@ void ShaderClass::Apply() SeccArg1 = D3DTA_TEXTURE; SeccArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: MODULATEALPHA_ADDCOLOR\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: MODULATEALPHA_ADDCOLOR")); } break; } // color operations @@ -872,7 +872,7 @@ void ShaderClass::Apply() SecaArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: SELECTARG1\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: SELECTARG1")); } break; @@ -884,7 +884,7 @@ void ShaderClass::Apply() SecaArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: MODULATE\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: MODULATE")); } break; @@ -896,7 +896,7 @@ void ShaderClass::Apply() SecaArg2 = D3DTA_CURRENT; } else { - SNAPSHOT_SAY(("Warning: Using unsupported texture op: ADDSMOOTH\n")); + SNAPSHOT_SAY(("Warning: Using unsupported texture op: ADDSMOOTH")); } break; } // alpha operations diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp index 1288bbd6fb..f676b12a90 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp @@ -221,7 +221,7 @@ void SortingRendererClass::Insert_Triangles( return; } - SNAPSHOT_SAY(("SortingRenderer::Insert(start_i: %d, polygons : %d, min_vi: %d, vertex_count: %d)\n", + SNAPSHOT_SAY(("SortingRenderer::Insert(start_i: %d, polygons : %d, min_vi: %d, vertex_count: %d)", start_index,polygon_count,min_vertex_index,vertex_count)); @@ -406,7 +406,7 @@ void SortingRendererClass::Flush_Sorting_Pool() { if (!overlapping_node_count) return; - SNAPSHOT_SAY(("SortingSystem - Flush \n")); + SNAPSHOT_SAY(("SortingSystem - Flush ")); // Fill dynamic index buffer with sorting index buffer vertices TempIndexStruct* tis=Get_Temp_Index_Array(overlapping_polygon_count); @@ -591,7 +591,7 @@ void SortingRendererClass::Flush_Sorting_Pool() overlapping_polygon_count=0; overlapping_vertex_count=0; - SNAPSHOT_SAY(("SortingSystem - Done flushing\n")); + SNAPSHOT_SAY(("SortingSystem - Done flushing")); } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp index f84d2c0cde..97c0b73b43 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texproject.cpp @@ -1156,10 +1156,10 @@ bool TexProjectClass::Compute_Texture bool zclear=ztarget!=NULL; bool snapshot=WW3D::Is_Snapshot_Activated(); - SNAPSHOT_SAY(("TexProjectCLass::Begin_Render()\n")); + SNAPSHOT_SAY(("TexProjectCLass::Begin_Render()")); WW3D::Begin_Render(true,zclear,color); // false to zclear as we don't have z-buffer WW3D::Render(*model,*context); - SNAPSHOT_SAY(("TexProjectCLass::End_Render()\n")); + SNAPSHOT_SAY(("TexProjectCLass::End_Render()")); WW3D::End_Render(false); WW3D::Activate_Snapshot(snapshot); // End_Render() ends the shapsnot, so restore the state diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp index 41128dcc81..9a92840763 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp @@ -797,9 +797,9 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, f WWASSERT(IsInitted); HRESULT hr; + SNAPSHOT_SAY(("==========================================")); + SNAPSHOT_SAY(("========== WW3D::Begin_Render ============")); SNAPSHOT_SAY(("==========================================\r\n")); - SNAPSHOT_SAY(("========== WW3D::Begin_Render ============\r\n")); - SNAPSHOT_SAY(("==========================================\r\n\r\n")); if (DX8Wrapper::_Get_D3D_Device8() && (hr=DX8Wrapper::_Get_D3D_Device8()->TestCooperativeLevel()) != D3D_OK) { @@ -1107,9 +1107,9 @@ WW3DErrorType WW3D::End_Render(bool flip_frame) Debug_Statistics::End_Statistics(); } + SNAPSHOT_SAY(("==========================================")); + SNAPSHOT_SAY(("========== WW3D::End_Render ==============")); SNAPSHOT_SAY(("==========================================\r\n")); - SNAPSHOT_SAY(("========== WW3D::End_Render ==============\r\n")); - SNAPSHOT_SAY(("==========================================\r\n\r\n")); Activate_Snapshot(false); From 1a4a10b6887369c7c7f3b2645f8e94c8c91c8cb9 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:23:34 +0200 Subject: [PATCH 09/13] [GEN][ZH] Remove trailing CR LF from WWASSERT_PRINT strings with script (#1232) --- .../Source/WWVegas/WW3D2/shattersystem.cpp | 2 +- .../Source/WWVegas/WWMath/aabtreecull.cpp | 2 +- .../Libraries/Source/WWVegas/WW3D2/ddsfile.cpp | 6 +++--- .../Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp | 2 +- .../Libraries/Source/WWVegas/WW3D2/texture.cpp | 10 +++++----- .../Source/WWVegas/WW3D2/texturefilter.cpp | 2 +- .../Libraries/Source/WWVegas/WW3D2/ddsfile.cpp | 6 +++--- .../Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp | 2 +- .../Libraries/Source/WWVegas/WW3D2/texture.cpp | 16 ++++++++-------- .../Source/WWVegas/WW3D2/texturefilter.cpp | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp b/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp index 1704ac1792..8544d4db8d 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp @@ -592,7 +592,7 @@ void PolygonClass::Split(const PlaneClass & plane,PolygonClass & front,PolygonCl back.Verts[(back.NumVerts)++] = Verts[i]; } } else { - WWASSERT_PRINT(0,"PolygonClass::Split : invalid side\n"); + WWASSERT_PRINT(0,"PolygonClass::Split : invalid side"); } sideprev = side; diff --git a/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.cpp b/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.cpp index 32c5b6b0fd..b4a7fcf0b2 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/aabtreecull.cpp @@ -698,7 +698,7 @@ void AABTreeCullSystemClass::Update_Bounding_Boxes_Recursive(AABTreeNodeClass * void AABTreeCullSystemClass::Load(ChunkLoadClass & cload) { - WWASSERT_PRINT(Object_Count() == 0, "Remove all objects from AAB-Culling system before loading!\n"); + WWASSERT_PRINT(Object_Count() == 0, "Remove all objects from AAB-Culling system before loading!"); delete RootNode; RootNode = new AABTreeNodeClass; diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp index 07c0b48f29..08ed647b20 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp @@ -402,7 +402,7 @@ void DDSFileClass::Copy_Level_To_Surface if (!DDSMemory || !Get_Memory_Pointer(level)) { - WWASSERT_PRINT(DDSMemory,"Surface mip level pointer is missing\n"); + WWASSERT_PRINT(DDSMemory,"Surface mip level pointer is missing"); return; } @@ -557,7 +557,7 @@ void DDSFileClass::Copy_CubeMap_Level_To_Surface if (!DDSMemory || !Get_CubeMap_Memory_Pointer(face,level)) { - WWASSERT_PRINT(DDSMemory,"Surface mip level pointer is missing\n"); + WWASSERT_PRINT(DDSMemory,"Surface mip level pointer is missing"); return; } @@ -727,7 +727,7 @@ void DDSFileClass::Copy_Volume_Level_To_Surface if (!DDSMemory || !Get_Volume_Memory_Pointer(level)) { - WWASSERT_PRINT(DDSMemory,"Surface mip level pointer is missing\n"); + WWASSERT_PRINT(DDSMemory,"Surface mip level pointer is missing"); return; } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp index b3353c6920..d939313b7f 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmdlio.cpp @@ -483,7 +483,7 @@ WW3DErrorType MeshModelClass::read_chunks(ChunkLoadClass & cload,MeshLoadContext break; case O_W3D_CHUNK_SURRENDER_TRIANGLES: - WWASSERT_PRINT( 0, "Obsolete Triangle Chunk Encountered!\r\n" ); + WWASSERT_PRINT( 0, "Obsolete Triangle Chunk Encountered!" ); break; case W3D_CHUNK_TRIANGLES: diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp index 0e878135a4..2ddbdb085e 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp @@ -192,7 +192,7 @@ TextureClass::TextureClass default: break; } - WWASSERT_PRINT(name && name[0], "TextureClass CTor: NULL or empty texture name\n"); + WWASSERT_PRINT(name && name[0], "TextureClass CTor: NULL or empty texture name"); int len=strlen(name); for (int i=0;i Date: Sat, 5 Jul 2025 15:27:01 +0200 Subject: [PATCH 10/13] [GEN][ZH] Remove trailing LF from SHATTER_DEBUG_SAY, DBGMSG, REALLY_VERBOSE_LOG, DOUBLE_DEBUG, PERF_LOG, CRCGEN_LOG, STATECHANGED_LOG, PING_LOG, BONEPOS_LOG strings with script (#1232) --- .../Source/WWVegas/WW3D2/shattersystem.cpp | 40 +++++++++---------- Core/Tools/mangler/wnet/tcp.cpp | 2 +- Core/Tools/matchbot/generals.cpp | 4 +- Core/Tools/matchbot/wnet/tcp.cpp | 2 +- .../GameEngine/Source/Common/StateMachine.cpp | 6 +-- .../Source/Common/System/StackDump.cpp | 30 +++++++------- .../GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp | 6 +-- .../GUICallbacks/Menus/WOLQuickMatchMenu.cpp | 4 +- .../GameEngine/Source/GameLogic/AI/AI.cpp | 4 +- .../Source/GameLogic/AI/AIGroup.cpp | 12 +++--- .../GameLogic/Object/Update/AIUpdate.cpp | 4 +- .../Source/GameLogic/System/GameLogic.cpp | 20 +++++----- .../GameLogic/System/GameLogicDispatch.cpp | 2 +- .../GameNetwork/GameSpy/Thread/PeerThread.cpp | 6 +-- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 32 +++++++-------- .../GameEngine/Source/Common/StateMachine.cpp | 6 +-- .../Source/Common/System/StackDump.cpp | 30 +++++++------- .../GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp | 6 +-- .../GUICallbacks/Menus/WOLQuickMatchMenu.cpp | 4 +- .../GameEngine/Source/GameLogic/AI/AI.cpp | 4 +- .../Source/GameLogic/AI/AIGroup.cpp | 12 +++--- .../GameLogic/Object/Update/AIUpdate.cpp | 4 +- .../Source/GameLogic/System/GameLogic.cpp | 20 +++++----- .../GameLogic/System/GameLogicDispatch.cpp | 2 +- .../GameNetwork/GameSpy/Thread/PeerThread.cpp | 6 +-- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 32 +++++++-------- 26 files changed, 150 insertions(+), 150 deletions(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp b/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp index 8544d4db8d..72cb44c42d 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/shattersystem.cpp @@ -976,9 +976,9 @@ void ShatterSystem::Shatter_Mesh(MeshClass * mesh,const Vector3 & point,const Ve MeshMtlParamsClass mtl_params(model); - SHATTER_DEBUG_SAY(("****************************************************\n")); - SHATTER_DEBUG_SAY((" Clipping model: %s\n",model->Get_Name())); - SHATTER_DEBUG_SAY(("****************************************************\n")); + SHATTER_DEBUG_SAY(("****************************************************")); + SHATTER_DEBUG_SAY((" Clipping model: %s",model->Get_Name())); + SHATTER_DEBUG_SAY(("****************************************************")); /* ** Pass each polygon of the source model through the BSP clipper @@ -988,7 +988,7 @@ void ShatterSystem::Shatter_Mesh(MeshClass * mesh,const Vector3 & point,const Ve /* ** Set up a PolygonClass for polygon 'i' in the mesh */ - SHATTER_DEBUG_SAY(("Passing polygon %d to clipper.\n",ipoly)); + SHATTER_DEBUG_SAY(("Passing polygon %d to clipper.",ipoly)); PolygonClass polygon; for (ivert=0; ivert<3; ivert++) { @@ -996,31 +996,31 @@ void ShatterSystem::Shatter_Mesh(MeshClass * mesh,const Vector3 & point,const Ve polygon.Verts[ivert].PassCount = mtl_params.PassCount; polygon.Verts[ivert].Position = verts[vert_index]; polygon.Verts[ivert].Normal = src_vnorms[vert_index]; - SHATTER_DEBUG_SAY(("position: %f %f %f\n",verts[vert_index].X,verts[vert_index].Y,verts[vert_index].Z)); - SHATTER_DEBUG_SAY(("normal: %f %f %f\n",src_vnorms[vert_index].X,src_vnorms[vert_index].Y,src_vnorms[vert_index].Z)); + SHATTER_DEBUG_SAY(("position: %f %f %f",verts[vert_index].X,verts[vert_index].Y,verts[vert_index].Z)); + SHATTER_DEBUG_SAY(("normal: %f %f %f",src_vnorms[vert_index].X,src_vnorms[vert_index].Y,src_vnorms[vert_index].Z)); for (ipass=0; ipassGet_Name())); - SHATTER_DEBUG_SAY((" polycount = %d vertexcount = %d\n",pcount,vcount)); - SHATTER_DEBUG_SAY(("****************************************************\n")); + SHATTER_DEBUG_SAY(("****************************************************")); + SHATTER_DEBUG_SAY((" Reassembling fragment %d of model: %s",ipool,model->Get_Name())); + SHATTER_DEBUG_SAY((" polycount = %d vertexcount = %d",pcount,vcount)); + SHATTER_DEBUG_SAY(("****************************************************")); /* ** Create the new mesh, install materials @@ -1173,7 +1173,7 @@ void ShatterSystem::Process_Clip_Pools PolygonClass & poly = ClipPools[ipool][ipoly]; new_mesh->Begin_Tri_Fan(); - SHATTER_DEBUG_SAY(("Begin Tri Fan\n")); + SHATTER_DEBUG_SAY(("Begin Tri Fan")); for(ivert=0; ivertBegin_Vertex(); - SHATTER_DEBUG_SAY(("postion: %f %f %f\n",pos.X,pos.Y,pos.Z)); + SHATTER_DEBUG_SAY(("postion: %f %f %f",pos.X,pos.Y,pos.Z)); new_mesh->Location_Inline(pos); new_mesh->Normal(norm); @@ -1198,7 +1198,7 @@ void ShatterSystem::Process_Clip_Pools ** copy the color out of the vertex into the new mesh. */ if (mtl_params.DCG[ipass] != NULL) { - SHATTER_DEBUG_SAY(("DCG: pass:%d: %f %f %f\n",ipass,vert.DCG[ipass].X,vert.DCG[ipass].Y,vert.DCG[ipass].Z)); + SHATTER_DEBUG_SAY(("DCG: pass:%d: %f %f %f",ipass,vert.DCG[ipass].X,vert.DCG[ipass].Y,vert.DCG[ipass].Z)); /* OLD CODE new_mesh->DCG(Vector3(vert.DCG[ipass].X,vert.DCG[ipass].Y,vert.DCG[ipass].Z),ipass); new_mesh->Alpha(vert.DCG[ipass].W,ipass); @@ -1208,7 +1208,7 @@ void ShatterSystem::Process_Clip_Pools // HY- Multiplying DIG with DCG as in meshmdlio if (mtl_params.DIG[ipass] != NULL) { - SHATTER_DEBUG_SAY(("DIG: pass:%d: %f %f %f\n",ipass,vert.DIG[ipass].X,vert.DIG[ipass].Y,vert.DIG[ipass].Z)); + SHATTER_DEBUG_SAY(("DIG: pass:%d: %f %f %f",ipass,vert.DIG[ipass].X,vert.DIG[ipass].Y,vert.DIG[ipass].Z)); Vector4 mc=DX8Wrapper::Convert_Color(mycolor); Vector4 dc=DX8Wrapper::Convert_Color(vert.DIG[ipass]); mc=Vector4(mc.X*dc.X,mc.Y*dc.Y,mc.Z*dc.Z,mc.W); @@ -1224,7 +1224,7 @@ void ShatterSystem::Process_Clip_Pools // #pragma MESSAGE("HY- Naty, will dynamesh support multiple stages of UV?") for (istage=0; istageUV(vert.TexCoord[ipass][istage],istage); } } diff --git a/Core/Tools/mangler/wnet/tcp.cpp b/Core/Tools/mangler/wnet/tcp.cpp index 8fd62a6222..17440b05cf 100644 --- a/Core/Tools/mangler/wnet/tcp.cpp +++ b/Core/Tools/mangler/wnet/tcp.cpp @@ -559,7 +559,7 @@ sint32 TCP::TimedRead(uint8 *msg,uint32 len,int seconds,sint32 whichFD) retval=Read(msg+bytes_read,len-bytes_read,whichFD); if (retval==0) // they closed { - DBGMSG("Remote close!\n"); + DBGMSG("Remote close!"); return(bytes_read); } else if (retval>0) diff --git a/Core/Tools/matchbot/generals.cpp b/Core/Tools/matchbot/generals.cpp index 3d89477a6e..dcb8b8e740 100644 --- a/Core/Tools/matchbot/generals.cpp +++ b/Core/Tools/matchbot/generals.cpp @@ -506,7 +506,7 @@ double GeneralsMatcher::computeMatchFitness(const std::string& i1, const General //DBGMSG("Match fitness: "<first << " vs " << i2->first << " has fitness " << matchFitness << "\n" + DBGMSG(i1->first << " vs " << i2->first << " has fitness " << matchFitness << "" "\tpointPercent: " << pointPercent << "\n" "\tpingDelta: " << pingDelta << "\n" "\twidened: " << u1->widened << u2->widened << "\n" @@ -742,7 +742,7 @@ void GeneralsMatcher::checkMatchesInUserMap(UserMap& userMap, int ladderID, int if (bestUser && numPlayers == 2) { // we had a match. send the info. - DBGMSG("Matching " << i1->first << " with " << bestName << ":\n" + DBGMSG("Matching " << i1->first << " with " << bestName << ":" "\tmatch fitness: " << bestMatchFitness << "\n" "\tpoint percentage: " << (1-bestUser->points/(double)u1->points)*100 << "\n" "\tpoints: " << u1->points << ", " << u2->points << "\n" diff --git a/Core/Tools/matchbot/wnet/tcp.cpp b/Core/Tools/matchbot/wnet/tcp.cpp index 8fd62a6222..17440b05cf 100644 --- a/Core/Tools/matchbot/wnet/tcp.cpp +++ b/Core/Tools/matchbot/wnet/tcp.cpp @@ -559,7 +559,7 @@ sint32 TCP::TimedRead(uint8 *msg,uint32 len,int seconds,sint32 whichFD) retval=Read(msg+bytes_read,len-bytes_read,whichFD); if (retval==0) // they closed { - DBGMSG("Remote close!\n"); + DBGMSG("Remote close!"); return(bytes_read); } else if (retval>0) diff --git a/Generals/Code/GameEngine/Source/Common/StateMachine.cpp b/Generals/Code/GameEngine/Source/Common/StateMachine.cpp index f16e426144..f0fd29a187 100644 --- a/Generals/Code/GameEngine/Source/Common/StateMachine.cpp +++ b/Generals/Code/GameEngine/Source/Common/StateMachine.cpp @@ -663,7 +663,7 @@ StateReturnType StateMachine::initDefaultState() #define REALLY_VERBOSE_LOG(x) /* */ // Run through all the transitions and make sure there aren't any transitions to undefined states. jba. [8/18/2003] std::map::iterator i; - REALLY_VERBOSE_LOG(("SM_BEGIN\n")); + REALLY_VERBOSE_LOG(("SM_BEGIN")); for( i = m_stateMap.begin(); i != m_stateMap.end(); ++i ) { State *state = (*i).second; StateID id = state->getID(); @@ -706,11 +706,11 @@ StateReturnType StateMachine::initDefaultState() } } } - REALLY_VERBOSE_LOG(("\n")); + REALLY_VERBOSE_LOG(("")); delete ids; ids = NULL; } - REALLY_VERBOSE_LOG(("SM_END\n\n")); + REALLY_VERBOSE_LOG(("SM_END\n")); #endif #endif DEBUG_ASSERTCRASH(!m_locked, ("Machine is locked here, but probably should not be")); diff --git a/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp b/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp index 4af5761d3e..fd2aeb9127 100644 --- a/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp @@ -544,16 +544,16 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) if ( e_info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION ) { - DOUBLE_DEBUG (("Exception is access violation\n")); + DOUBLE_DEBUG (("Exception is access violation")); access_read_write = e_info->ExceptionRecord->ExceptionInformation[0]; // 0=read, 1=write access_address = e_info->ExceptionRecord->ExceptionInformation[1]; } else { - DOUBLE_DEBUG (("Exception code is %x\n", e_info->ExceptionRecord->ExceptionCode)); + DOUBLE_DEBUG (("Exception code is %x", e_info->ExceptionRecord->ExceptionCode)); } Int *winMainAddr = (Int *)WinMain; - DOUBLE_DEBUG(("WinMain at %x\n", winMainAddr)); + DOUBLE_DEBUG(("WinMain at %x", winMainAddr)); /* ** Match the exception type with the error string and print it out */ @@ -566,42 +566,42 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) break; } } - DOUBLE_DEBUG( ("%s\n", _code_txt[i])); + DOUBLE_DEBUG( ("%s", _code_txt[i])); /** For access violations, print out the violation address and if it was read or write. */ if ( e_info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION ) { if ( access_read_write ) { - DOUBLE_DEBUG( ("Access address:%08X was written to.\n", access_address)); + DOUBLE_DEBUG( ("Access address:%08X was written to.", access_address)); } else { - DOUBLE_DEBUG( ("Access address:%08X was read from.\n", access_address)); + DOUBLE_DEBUG( ("Access address:%08X was read from.", access_address)); } } - DOUBLE_DEBUG (("\nStack Dump:\n")); + DOUBLE_DEBUG (("\nStack Dump:")); StackDumpFromContext(context->Eip, context->Esp, context->Ebp, NULL); - DOUBLE_DEBUG (("\nDetails:\n")); + DOUBLE_DEBUG (("\nDetails:")); - DOUBLE_DEBUG (("Register dump...\n")); + DOUBLE_DEBUG (("Register dump...")); /* ** Dump the registers. */ - DOUBLE_DEBUG ( ( "Eip:%08X\tEsp:%08X\tEbp:%08X\n", context->Eip, context->Esp, context->Ebp)); - DOUBLE_DEBUG ( ( "Eax:%08X\tEbx:%08X\tEcx:%08X\n", context->Eax, context->Ebx, context->Ecx)); - DOUBLE_DEBUG ( ( "Edx:%08X\tEsi:%08X\tEdi:%08X\n", context->Edx, context->Esi, context->Edi)); - DOUBLE_DEBUG ( ( "EFlags:%08X \n", context->EFlags)); - DOUBLE_DEBUG ( ( "CS:%04x SS:%04x DS:%04x ES:%04x FS:%04x GS:%04x\n", context->SegCs, context->SegSs, context->SegDs, context->SegEs, context->SegFs, context->SegGs)); + DOUBLE_DEBUG ( ( "Eip:%08X\tEsp:%08X\tEbp:%08X", context->Eip, context->Esp, context->Ebp)); + DOUBLE_DEBUG ( ( "Eax:%08X\tEbx:%08X\tEcx:%08X", context->Eax, context->Ebx, context->Ecx)); + DOUBLE_DEBUG ( ( "Edx:%08X\tEsi:%08X\tEdi:%08X", context->Edx, context->Esi, context->Edi)); + DOUBLE_DEBUG ( ( "EFlags:%08X ", context->EFlags)); + DOUBLE_DEBUG ( ( "CS:%04x SS:%04x DS:%04x ES:%04x FS:%04x GS:%04x", context->SegCs, context->SegSs, context->SegDs, context->SegEs, context->SegFs, context->SegGs)); /* ** Dump the bytes at EIP. This will make it easier to match the crash address with later versions of the game. */ char scrap[512]; - DOUBLE_DEBUG ( ("EIP bytes dump...\n")); + DOUBLE_DEBUG ( ("EIP bytes dump...")); wsprintf (scrap, "\nBytes at CS:EIP (%08X) : ", context->Eip); unsigned char *eip_ptr = (unsigned char *) (context->Eip); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index cdda34c2f4..213f62a961 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -1276,13 +1276,13 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) #ifdef PERF_TEST // check performance end = timeGetTime(); - PERF_LOG(("Frame time was %d ms\n", end-start)); + PERF_LOG(("Frame time was %d ms", end-start)); std::list::const_iterator it; for (it = responses.begin(); it != responses.end(); ++it) { - PERF_LOG((" %s\n", getMessageString(*it))); + PERF_LOG((" %s", getMessageString(*it))); } - PERF_LOG(("\n")); + PERF_LOG(("")); #endif // PERF_TEST #if 0 diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp index 100103b212..b1b49c0e69 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp @@ -1384,12 +1384,12 @@ void WOLQuickMatchMenuUpdate( WindowLayout * layout, void *userData) UnicodeString munkee; munkee.format(L"inQM:%d %d ms, %d messages", s_inQM, frameTime, responses.size()); TheGameSpyInfo->addText(munkee, GameSpyColor[GSCOLOR_DEFAULT], quickmatchTextWindow); - PERF_LOG(("%ls\n", munkee.str())); + PERF_LOG(("%ls", munkee.str())); std::list::const_iterator it; for (it = responses.begin(); it != responses.end(); ++it) { - PERF_LOG((" %s\n", getMessageString(*it))); + PERF_LOG((" %s", getMessageString(*it))); } } #endif // PERF_TEST diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp index 1c21d5732a..93f9bc88cd 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp @@ -979,7 +979,7 @@ void TAiData::crc( Xfer *xfer ) xfer->xferReal( &m_maxRecruitDistance ); xfer->xferReal( &m_repulsedDistance ); xfer->xferBool( &m_enableRepulsors ); - CRCGEN_LOG(("CRC after AI TAiData for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI TAiData for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); } // end crc @@ -1005,7 +1005,7 @@ void AI::crc( Xfer *xfer ) { xfer->xferSnapshot( m_pathfinder ); - CRCGEN_LOG(("CRC after AI pathfinder for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI pathfinder for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); AsciiString marker; TAiData *aiData = m_aiData; diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp index 1fdbb155cd..a6696d3c8c 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp @@ -3234,22 +3234,22 @@ void AIGroup::crc( Xfer *xfer ) if (*it) id = (*it)->getID(); xfer->xferUser(&id, sizeof(ObjectID)); - CRCGEN_LOG(("CRC after AI AIGroup m_memberList for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI AIGroup m_memberList for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); } xfer->xferUnsignedInt( &m_memberListSize ); - CRCGEN_LOG(("CRC after AI AIGroup m_memberListSize for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI AIGroup m_memberListSize for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); id = INVALID_ID; // Used to be leader id, unused now. jba. xfer->xferObjectID( &id ); - CRCGEN_LOG(("CRC after AI AIGroup m_leader for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI AIGroup m_leader for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); xfer->xferReal( &m_speed ); - CRCGEN_LOG(("CRC after AI AIGroup m_speed for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI AIGroup m_speed for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); xfer->xferBool( &m_dirty ); - CRCGEN_LOG(("CRC after AI AIGroup m_dirty for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI AIGroup m_dirty for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); xfer->xferUnsignedInt( &m_id ); - CRCGEN_LOG(("CRC after AI AIGroup m_id (%d) for frame %d is 0x%8.8X\n", m_id, TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI AIGroup m_id (%d) for frame %d is 0x%8.8X", m_id, TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); } // end crc diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 97b3c52f31..f2d8d0d58b 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -4727,13 +4727,13 @@ AIGroup *AIUpdateInterface::getGroup(void) // ------------------------------------------------------------------------------------------------ void AIUpdateInterface::crc( Xfer *x ) { - CRCGEN_LOG(("AIUpdateInterface::crc() begin - %8.8X\n", ((XferCRC *)x)->getCRC())); + CRCGEN_LOG(("AIUpdateInterface::crc() begin - %8.8X", ((XferCRC *)x)->getCRC())); // extend base class UpdateModule::crc( x ); xfer(x); - CRCGEN_LOG(("AIUpdateInterface::crc() end - %8.8X\n", ((XferCRC *)x)->getCRC())); + CRCGEN_LOG(("AIUpdateInterface::crc() end - %8.8X", ((XferCRC *)x)->getCRC())); } // end crc diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 62991d49d0..4f829436c3 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -2350,7 +2350,7 @@ void GameLogic::selectObject(Object *obj, Bool createNewSelection, PlayerMaskTyp return; } - CRCGEN_LOG(( "Creating AIGroup in GameLogic::selectObject()\n" )); + CRCGEN_LOG(( "Creating AIGroup in GameLogic::selectObject()" )); AIGroupPtr group = TheAI->createGroup(); group->add(obj); @@ -2398,7 +2398,7 @@ void GameLogic::deselectObject(Object *obj, PlayerMaskType playerMask, Bool affe return; } - CRCGEN_LOG(( "Removing a unit from a selected group in GameLogic::deselectObject()\n" )); + CRCGEN_LOG(( "Removing a unit from a selected group in GameLogic::deselectObject()" )); AIGroupPtr group = TheAI->createGroup(); #if RETAIL_COMPATIBLE_AIGROUP player->getCurrentSelectionAsAIGroup(group); @@ -3555,7 +3555,7 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) DEBUG_ASSERTCRASH(this == TheGameLogic, ("Not in GameLogic")); if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC at start of frame %d is 0x%8.8X\n", m_frame, xferCRC->getCRC())); + CRCGEN_LOG(("CRC at start of frame %d is 0x%8.8X", m_frame, xferCRC->getCRC())); } marker = "MARKER:Objects"; @@ -3567,12 +3567,12 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) UnsignedInt seed = GetGameLogicRandomSeedCRC(); if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC after objects for frame %d is 0x%8.8X\n", m_frame, xferCRC->getCRC())); + CRCGEN_LOG(("CRC after objects for frame %d is 0x%8.8X", m_frame, xferCRC->getCRC())); } if (isInGameLogicUpdate()) { - CRCGEN_LOG(("RandomSeed: %d\n", seed)); + CRCGEN_LOG(("RandomSeed: %d", seed)); } if (xferCRC->getXferMode() == XFER_CRC) { @@ -3583,7 +3583,7 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) xferCRC->xferSnapshot( ThePartitionManager ); if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC after partition manager for frame %d is 0x%8.8X\n", m_frame, xferCRC->getCRC())); + CRCGEN_LOG(("CRC after partition manager for frame %d is 0x%8.8X", m_frame, xferCRC->getCRC())); } #ifdef DEBUG_CRC @@ -3595,7 +3595,7 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) xferCRC->xferSnapshot( TheModuleFactory ); if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC after module factory for frame %d is 0x%8.8X\n", m_frame, xferCRC->getCRC())); + CRCGEN_LOG(("CRC after module factory for frame %d is 0x%8.8X", m_frame, xferCRC->getCRC())); } } #endif //DEBUG_CRC @@ -3605,7 +3605,7 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) xferCRC->xferSnapshot( ThePlayerList ); if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC after PlayerList for frame %d is 0x%8.8X\n", m_frame, xferCRC->getCRC())); + CRCGEN_LOG(("CRC after PlayerList for frame %d is 0x%8.8X", m_frame, xferCRC->getCRC())); } marker = "MARKER:TheAI"; @@ -3613,7 +3613,7 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) xferCRC->xferSnapshot( TheAI ); if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC after AI for frame %d is 0x%8.8X\n", m_frame, xferCRC->getCRC())); + CRCGEN_LOG(("CRC after AI for frame %d is 0x%8.8X", m_frame, xferCRC->getCRC())); } if (xferCRC->getXferMode() == XFER_SAVE) @@ -3632,7 +3632,7 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC for frame %d is 0x%8.8X\n", m_frame, theCRC)); + CRCGEN_LOG(("CRC for frame %d is 0x%8.8X", m_frame, theCRC)); } return theCRC; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp index 8bb40bd63b..e473a79f0b 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp @@ -355,7 +355,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) if (msg->getType() != GameMessage::MSG_LOGIC_CRC && msg->getType() != GameMessage::MSG_SET_REPLAY_CAMERA) { currentlySelectedGroup = TheAI->createGroup(); // can't do this outside a game - it'll cause sync errors galore. - CRCGEN_LOG(( "Creating AIGroup %d in GameLogic::logicMessageDispatcher()\n", currentlySelectedGroup?currentlySelectedGroup->getID():0 )); + CRCGEN_LOG(( "Creating AIGroup %d in GameLogic::logicMessageDispatcher()", currentlySelectedGroup?currentlySelectedGroup->getID():0 )); #if RETAIL_COMPATIBLE_AIGROUP thisPlayer->getCurrentSelectionAsAIGroup(currentlySelectedGroup); #else diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp index 50c058a305..ccdb5ebc27 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp @@ -1521,7 +1521,7 @@ void PeerThreadClass::Thread_Function() UnsignedInt diff = now - prev; prev = now; #endif - STATECHANGED_LOG(("peerStateChanged() at time %d (difference of %d ms)\n", now, diff)); + STATECHANGED_LOG(("peerStateChanged() at time %d (difference of %d ms)", now, diff)); */ peerUTMRoom( peer, StagingRoom, "SL/", incomingRequest.options.c_str(), PEERFalse ); // send the full string to people in the room @@ -1723,7 +1723,7 @@ void PeerThreadClass::Thread_Function() UnsignedInt diff = now - prev; prev = now; #endif - STATECHANGED_LOG(("peerStateChanged() at time %d (difference of %d ms)\n", now, diff)); + STATECHANGED_LOG(("peerStateChanged() at time %d (difference of %d ms)", now, diff)); } } @@ -2894,7 +2894,7 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, DEBUG_LOG(("Raw stuff: [%s] [%s] [%d]", pingStr, ladIPStr, ladPort)); DEBUG_LOG(("Saw game with stuff %s %d %X %X %X %s", resp.stagingRoomMapName.c_str(), hasPassword, verVal, exeVal, iniVal, SBServerGetStringValue(server, "password", "missing"))); #ifdef PING_TEST - PING_LOG(("%s\n", pingStr)); + PING_LOG(("%s", pingStr)); #endif } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 155a589bdc..1a97f7b271 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -502,7 +502,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, if (findSingleBone(robj, boneNameTmp, info.mtx, info.boneIndex)) { //DEBUG_LOG(("added bone %s",boneNameTmp.str())); - BONEPOS_LOG(("Caching bone %s (index %d)\n", boneNameTmp.str(), info.boneIndex)); + BONEPOS_LOG(("Caching bone %s (index %d)", boneNameTmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(boneNameTmp)] = info; @@ -515,7 +515,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, if (findSingleBone(robj, tmp, info.mtx, info.boneIndex)) { //DEBUG_LOG(("added bone %s",tmp.str())); - BONEPOS_LOG(("Caching bone %s (index %d)\n", tmp.str(), info.boneIndex)); + BONEPOS_LOG(("Caching bone %s (index %d)", tmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(tmp)] = info; foundAsBone = true; @@ -531,7 +531,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, if (findSingleSubObj(robj, boneNameTmp, info.mtx, info.boneIndex)) { //DEBUG_LOG(("added subobj %s",boneNameTmp.str())); - BONEPOS_LOG(("Caching bone from subobject %s (index %d)\n", boneNameTmp.str(), info.boneIndex)); + BONEPOS_LOG(("Caching bone from subobject %s (index %d)", boneNameTmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(boneNameTmp)] = info; foundAsSubObj = true; @@ -543,7 +543,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, if (findSingleSubObj(robj, tmp, info.mtx, info.boneIndex)) { //DEBUG_LOG(("added subobj %s",tmp.str())); - BONEPOS_LOG(("Caching bone from subobject %s (index %d)\n", tmp.str(), info.boneIndex)); + BONEPOS_LOG(("Caching bone from subobject %s (index %d)", tmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(tmp)] = info; foundAsSubObj = true; @@ -596,7 +596,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c setFPMode(); BONEPOS_LOG(("Validating bones for %s: %s", m_modelName.str(), getDescription().str())); - //BONEPOS_LOG(("Passing in valid render obj: %d\n", (robj != 0))); + //BONEPOS_LOG(("Passing in valid render obj: %d", (robj != 0))); BONEPOS_DUMPREAL(scale); m_pristineBones.clear(); @@ -609,7 +609,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c { if (m_modelName.isEmpty()) { - //BONEPOS_LOG(("Bailing: model name is empty\n")); + //BONEPOS_LOG(("Bailing: model name is empty")); return; } @@ -617,7 +617,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c DEBUG_ASSERTCRASH(robj, ("*** ASSET ERROR: Model %s not found!",m_modelName.str())); if (!robj) { - //BONEPOS_LOG(("Bailing: could not load render object\n")); + //BONEPOS_LOG(("Bailing: could not load render object")); return; } tossRobj = true; @@ -774,7 +774,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s wslot %d", m_modelName.str(), wslot)); DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); - BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s wslot %d\n", m_modelName.str(), wslot)); + BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s wslot %d", m_modelName.str(), wslot)); BONEPOS_DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); m_weaponBarrelInfoVec[wslot].push_back(info); @@ -812,7 +812,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const { CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) wslot %d", m_modelName.str(), wslot)); DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); - BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) wslot %d\n", m_modelName.str(), wslot)); + BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) wslot %d", m_modelName.str(), wslot)); BONEPOS_DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); m_weaponBarrelInfoVec[wslot].push_back(info); if (info.m_recoilBone != 0 || info.m_muzzleFlashBone != 0) @@ -821,7 +821,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const else { CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) found nothing", m_modelName.str())); - BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) found nothing\n", m_modelName.str())); + BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) found nothing", m_modelName.str())); } } // if empty @@ -2975,7 +2975,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) DEBUG_ASSERTCRASH(m_renderObject, ("*** ASSET ERROR: Model %s not found!",newState->m_modelName.str())); } - //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::setModelState()\n")); + //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::setModelState()")); //BONEPOS_DUMPREAL(draw->getScale()); newState->validateStuff(m_renderObject, draw->getScale(), getW3DModelDrawModuleData()->m_extraPublicBones); @@ -3101,7 +3101,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) else { - //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::setModelState()\n")); + //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::setModelState()")); //BONEPOS_DUMPREAL(getDrawable()->getScale()); newState->validateStuff(m_renderObject, getDrawable()->getScale(), getW3DModelDrawModuleData()->m_extraPublicBones); @@ -3211,7 +3211,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( if (!stateToUse) { CRCDEBUG_LOG(("can't find best info")); - //BONEPOS_LOG(("can't find best info\n")); + //BONEPOS_LOG(("can't find best info")); return false; } #if defined(RTS_DEBUG) @@ -3235,7 +3235,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( const W3DModelDrawModuleData* d = getW3DModelDrawModuleData(); //CRCDEBUG_LOG(("validateStuffs() from within W3DModelDraw::getProjectileLaunchOffset()")); //DUMPREAL(getDrawable()->getScale()); - //BONEPOS_LOG(("validateStuffs() from within W3DModelDraw::getProjectileLaunchOffset()\n")); + //BONEPOS_LOG(("validateStuffs() from within W3DModelDraw::getProjectileLaunchOffset()")); //BONEPOS_DUMPREAL(getDrawable()->getScale()); stateToUse->validateStuff(NULL, getDrawable()->getScale(), d->m_extraPublicBones); @@ -3266,7 +3266,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( { // Can't find the launch pos, but they might still want the other info they asked for CRCDEBUG_LOG(("empty wbvec")); - //BONEPOS_LOG(("empty wbvec\n")); + //BONEPOS_LOG(("empty wbvec")); launchPos = NULL; } else @@ -3367,7 +3367,7 @@ Int W3DModelDraw::getPristineBonePositionsForConditionState( // //CRCDEBUG_LOG(("renderObject == NULL: %d", (stateToUse==m_curState)?(m_renderObject == NULL):1)); // } - //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::getPristineBonePositionsForConditionState()\n")); + //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::getPristineBonePositionsForConditionState()")); //BONEPOS_DUMPREAL(getDrawable()->getScale()); // we must call this every time we set m_nextState, to ensure cached bones are happy stateToUse->validateStuff( diff --git a/GeneralsMD/Code/GameEngine/Source/Common/StateMachine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/StateMachine.cpp index 601c8fe877..8e999761ad 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/StateMachine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/StateMachine.cpp @@ -671,7 +671,7 @@ StateReturnType StateMachine::initDefaultState() #define REALLY_VERBOSE_LOG(x) /* */ // Run through all the transitions and make sure there aren't any transitions to undefined states. jba. [8/18/2003] std::map::iterator i; - REALLY_VERBOSE_LOG(("SM_BEGIN\n")); + REALLY_VERBOSE_LOG(("SM_BEGIN")); for( i = m_stateMap.begin(); i != m_stateMap.end(); ++i ) { State *state = (*i).second; StateID id = state->getID(); @@ -714,11 +714,11 @@ StateReturnType StateMachine::initDefaultState() } } } - REALLY_VERBOSE_LOG(("\n")); + REALLY_VERBOSE_LOG(("")); delete ids; ids = NULL; } - REALLY_VERBOSE_LOG(("SM_END\n\n")); + REALLY_VERBOSE_LOG(("SM_END\n")); #endif #endif DEBUG_ASSERTCRASH(!m_locked, ("Machine is locked here, but probably should not be")); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp index 8387a1cdb6..9d17012e84 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp @@ -545,16 +545,16 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) if ( e_info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION ) { - DOUBLE_DEBUG (("Exception is access violation\n")); + DOUBLE_DEBUG (("Exception is access violation")); access_read_write = e_info->ExceptionRecord->ExceptionInformation[0]; // 0=read, 1=write access_address = e_info->ExceptionRecord->ExceptionInformation[1]; } else { - DOUBLE_DEBUG (("Exception code is %x\n", e_info->ExceptionRecord->ExceptionCode)); + DOUBLE_DEBUG (("Exception code is %x", e_info->ExceptionRecord->ExceptionCode)); } Int *winMainAddr = (Int *)WinMain; - DOUBLE_DEBUG(("WinMain at %x\n", winMainAddr)); + DOUBLE_DEBUG(("WinMain at %x", winMainAddr)); /* ** Match the exception type with the error string and print it out */ @@ -567,42 +567,42 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) break; } } - DOUBLE_DEBUG( ("%s\n", _code_txt[i])); + DOUBLE_DEBUG( ("%s", _code_txt[i])); /** For access violations, print out the violation address and if it was read or write. */ if ( e_info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION ) { if ( access_read_write ) { - DOUBLE_DEBUG( ("Access address:%08X was written to.\n", access_address)); + DOUBLE_DEBUG( ("Access address:%08X was written to.", access_address)); } else { - DOUBLE_DEBUG( ("Access address:%08X was read from.\n", access_address)); + DOUBLE_DEBUG( ("Access address:%08X was read from.", access_address)); } } - DOUBLE_DEBUG (("\nStack Dump:\n")); + DOUBLE_DEBUG (("\nStack Dump:")); StackDumpFromContext(context->Eip, context->Esp, context->Ebp, NULL); - DOUBLE_DEBUG (("\nDetails:\n")); + DOUBLE_DEBUG (("\nDetails:")); - DOUBLE_DEBUG (("Register dump...\n")); + DOUBLE_DEBUG (("Register dump...")); /* ** Dump the registers. */ - DOUBLE_DEBUG ( ( "Eip:%08X\tEsp:%08X\tEbp:%08X\n", context->Eip, context->Esp, context->Ebp)); - DOUBLE_DEBUG ( ( "Eax:%08X\tEbx:%08X\tEcx:%08X\n", context->Eax, context->Ebx, context->Ecx)); - DOUBLE_DEBUG ( ( "Edx:%08X\tEsi:%08X\tEdi:%08X\n", context->Edx, context->Esi, context->Edi)); - DOUBLE_DEBUG ( ( "EFlags:%08X \n", context->EFlags)); - DOUBLE_DEBUG ( ( "CS:%04x SS:%04x DS:%04x ES:%04x FS:%04x GS:%04x\n", context->SegCs, context->SegSs, context->SegDs, context->SegEs, context->SegFs, context->SegGs)); + DOUBLE_DEBUG ( ( "Eip:%08X\tEsp:%08X\tEbp:%08X", context->Eip, context->Esp, context->Ebp)); + DOUBLE_DEBUG ( ( "Eax:%08X\tEbx:%08X\tEcx:%08X", context->Eax, context->Ebx, context->Ecx)); + DOUBLE_DEBUG ( ( "Edx:%08X\tEsi:%08X\tEdi:%08X", context->Edx, context->Esi, context->Edi)); + DOUBLE_DEBUG ( ( "EFlags:%08X ", context->EFlags)); + DOUBLE_DEBUG ( ( "CS:%04x SS:%04x DS:%04x ES:%04x FS:%04x GS:%04x", context->SegCs, context->SegSs, context->SegDs, context->SegEs, context->SegFs, context->SegGs)); /* ** Dump the bytes at EIP. This will make it easier to match the crash address with later versions of the game. */ char scrap[512]; - DOUBLE_DEBUG ( ("EIP bytes dump...\n")); + DOUBLE_DEBUG ( ("EIP bytes dump...")); wsprintf (scrap, "\nBytes at CS:EIP (%08X) : ", context->Eip); unsigned char *eip_ptr = (unsigned char *) (context->Eip); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index ccf976739d..ee2c1baf7a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -1295,13 +1295,13 @@ void WOLLobbyMenuUpdate( WindowLayout * layout, void *userData) #ifdef PERF_TEST // check performance end = timeGetTime(); - PERF_LOG(("Frame time was %d ms\n", end-start)); + PERF_LOG(("Frame time was %d ms", end-start)); std::list::const_iterator it; for (it = responses.begin(); it != responses.end(); ++it) { - PERF_LOG((" %s\n", getMessageString(*it))); + PERF_LOG((" %s", getMessageString(*it))); } - PERF_LOG(("\n")); + PERF_LOG(("")); #endif // PERF_TEST #if 0 diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp index ce740ab911..2dafa60c5c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp @@ -1449,12 +1449,12 @@ void WOLQuickMatchMenuUpdate( WindowLayout * layout, void *userData) UnicodeString munkee; munkee.format(L"inQM:%d %d ms, %d messages", s_inQM, frameTime, responses.size()); TheGameSpyInfo->addText(munkee, GameSpyColor[GSCOLOR_DEFAULT], quickmatchTextWindow); - PERF_LOG(("%ls\n", munkee.str())); + PERF_LOG(("%ls", munkee.str())); std::list::const_iterator it; for (it = responses.begin(); it != responses.end(); ++it) { - PERF_LOG((" %s\n", getMessageString(*it))); + PERF_LOG((" %s", getMessageString(*it))); } } #endif // PERF_TEST diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp index 2af7ccfb95..60a19d5902 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp @@ -986,7 +986,7 @@ void TAiData::crc( Xfer *xfer ) xfer->xferReal( &m_skirmishBaseDefenseExtraDistance ); xfer->xferReal( &m_repulsedDistance ); xfer->xferBool( &m_enableRepulsors ); - CRCGEN_LOG(("CRC after AI TAiData for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI TAiData for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); } // end crc @@ -1012,7 +1012,7 @@ void AI::crc( Xfer *xfer ) { xfer->xferSnapshot( m_pathfinder ); - CRCGEN_LOG(("CRC after AI pathfinder for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI pathfinder for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); AsciiString marker; TAiData *aiData = m_aiData; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp index d8668d2b33..19d2a654fb 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp @@ -3326,22 +3326,22 @@ void AIGroup::crc( Xfer *xfer ) if (*it) id = (*it)->getID(); xfer->xferUser(&id, sizeof(ObjectID)); - CRCGEN_LOG(("CRC after AI AIGroup m_memberList for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI AIGroup m_memberList for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); } xfer->xferUnsignedInt( &m_memberListSize ); - CRCGEN_LOG(("CRC after AI AIGroup m_memberListSize for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI AIGroup m_memberListSize for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); id = INVALID_ID; // Used to be leader id, unused now. jba. xfer->xferObjectID( &id ); - CRCGEN_LOG(("CRC after AI AIGroup m_leader for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI AIGroup m_leader for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); xfer->xferReal( &m_speed ); - CRCGEN_LOG(("CRC after AI AIGroup m_speed for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI AIGroup m_speed for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); xfer->xferBool( &m_dirty ); - CRCGEN_LOG(("CRC after AI AIGroup m_dirty for frame %d is 0x%8.8X\n", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI AIGroup m_dirty for frame %d is 0x%8.8X", TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); xfer->xferUnsignedInt( &m_id ); - CRCGEN_LOG(("CRC after AI AIGroup m_id (%d) for frame %d is 0x%8.8X\n", m_id, TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); + CRCGEN_LOG(("CRC after AI AIGroup m_id (%d) for frame %d is 0x%8.8X", m_id, TheGameLogic->getFrame(), ((XferCRC *)xfer)->getCRC())); } // end crc diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index fa20205fab..fda1536911 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -5006,13 +5006,13 @@ AIGroup *AIUpdateInterface::getGroup(void) // ------------------------------------------------------------------------------------------------ void AIUpdateInterface::crc( Xfer *x ) { - CRCGEN_LOG(("AIUpdateInterface::crc() begin - %8.8X\n", ((XferCRC *)x)->getCRC())); + CRCGEN_LOG(("AIUpdateInterface::crc() begin - %8.8X", ((XferCRC *)x)->getCRC())); // extend base class UpdateModule::crc( x ); xfer(x); - CRCGEN_LOG(("AIUpdateInterface::crc() end - %8.8X\n", ((XferCRC *)x)->getCRC())); + CRCGEN_LOG(("AIUpdateInterface::crc() end - %8.8X", ((XferCRC *)x)->getCRC())); } // end crc diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index a3927907f5..b486491982 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -2679,7 +2679,7 @@ void GameLogic::selectObject(Object *obj, Bool createNewSelection, PlayerMaskTyp return; } - CRCGEN_LOG(( "Creating AIGroup in GameLogic::selectObject()\n" )); + CRCGEN_LOG(( "Creating AIGroup in GameLogic::selectObject()" )); AIGroupPtr group = TheAI->createGroup(); group->add(obj); @@ -2732,7 +2732,7 @@ void GameLogic::deselectObject(Object *obj, PlayerMaskType playerMask, Bool affe return; } - CRCGEN_LOG(( "Removing a unit from a selected group in GameLogic::deselectObject()\n" )); + CRCGEN_LOG(( "Removing a unit from a selected group in GameLogic::deselectObject()" )); AIGroupPtr group = TheAI->createGroup(); #if RETAIL_COMPATIBLE_AIGROUP player->getCurrentSelectionAsAIGroup(group); @@ -4114,7 +4114,7 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) DEBUG_ASSERTCRASH(this == TheGameLogic, ("Not in GameLogic")); if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC at start of frame %d is 0x%8.8X\n", m_frame, xferCRC->getCRC())); + CRCGEN_LOG(("CRC at start of frame %d is 0x%8.8X", m_frame, xferCRC->getCRC())); } marker = "MARKER:Objects"; @@ -4126,12 +4126,12 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) UnsignedInt seed = GetGameLogicRandomSeedCRC(); if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC after objects for frame %d is 0x%8.8X\n", m_frame, xferCRC->getCRC())); + CRCGEN_LOG(("CRC after objects for frame %d is 0x%8.8X", m_frame, xferCRC->getCRC())); } if (isInGameLogicUpdate()) { - CRCGEN_LOG(("RandomSeed: %d\n", seed)); + CRCGEN_LOG(("RandomSeed: %d", seed)); } if (xferCRC->getXferMode() == XFER_CRC) { @@ -4142,7 +4142,7 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) xferCRC->xferSnapshot( ThePartitionManager ); if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC after partition manager for frame %d is 0x%8.8X\n", m_frame, xferCRC->getCRC())); + CRCGEN_LOG(("CRC after partition manager for frame %d is 0x%8.8X", m_frame, xferCRC->getCRC())); } #ifdef DEBUG_CRC @@ -4154,7 +4154,7 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) xferCRC->xferSnapshot( TheModuleFactory ); if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC after module factory for frame %d is 0x%8.8X\n", m_frame, xferCRC->getCRC())); + CRCGEN_LOG(("CRC after module factory for frame %d is 0x%8.8X", m_frame, xferCRC->getCRC())); } } #endif // DEBUG_CRC @@ -4164,7 +4164,7 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) xferCRC->xferSnapshot( ThePlayerList ); if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC after PlayerList for frame %d is 0x%8.8X\n", m_frame, xferCRC->getCRC())); + CRCGEN_LOG(("CRC after PlayerList for frame %d is 0x%8.8X", m_frame, xferCRC->getCRC())); } marker = "MARKER:TheAI"; @@ -4172,7 +4172,7 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) xferCRC->xferSnapshot( TheAI ); if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC after AI for frame %d is 0x%8.8X\n", m_frame, xferCRC->getCRC())); + CRCGEN_LOG(("CRC after AI for frame %d is 0x%8.8X", m_frame, xferCRC->getCRC())); } if (xferCRC->getXferMode() == XFER_SAVE) @@ -4191,7 +4191,7 @@ UnsignedInt GameLogic::getCRC( Int mode, AsciiString deepCRCFileName ) if (isInGameLogicUpdate()) { - CRCGEN_LOG(("CRC for frame %d is 0x%8.8X\n", m_frame, theCRC)); + CRCGEN_LOG(("CRC for frame %d is 0x%8.8X", m_frame, theCRC)); } return theCRC; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp index da72af5d93..a9b1080318 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp @@ -364,7 +364,7 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) if (msg->getType() != GameMessage::MSG_LOGIC_CRC && msg->getType() != GameMessage::MSG_SET_REPLAY_CAMERA) { currentlySelectedGroup = TheAI->createGroup(); // can't do this outside a game - it'll cause sync errors galore. - CRCGEN_LOG(( "Creating AIGroup %d in GameLogic::logicMessageDispatcher()\n", currentlySelectedGroup?currentlySelectedGroup->getID():0 )); + CRCGEN_LOG(( "Creating AIGroup %d in GameLogic::logicMessageDispatcher()", currentlySelectedGroup?currentlySelectedGroup->getID():0 )); #if RETAIL_COMPATIBLE_AIGROUP thisPlayer->getCurrentSelectionAsAIGroup(currentlySelectedGroup); #else diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp index 84067b1c2e..758d7c17c0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp @@ -1531,7 +1531,7 @@ void PeerThreadClass::Thread_Function() UnsignedInt diff = now - prev; prev = now; #endif - STATECHANGED_LOG(("peerStateChanged() at time %d (difference of %d ms)\n", now, diff)); + STATECHANGED_LOG(("peerStateChanged() at time %d (difference of %d ms)", now, diff)); */ peerUTMRoom( peer, StagingRoom, "SL/", incomingRequest.options.c_str(), PEERFalse ); // send the full string to people in the room @@ -1734,7 +1734,7 @@ void PeerThreadClass::Thread_Function() UnsignedInt diff = now - prev; prev = now; #endif - STATECHANGED_LOG(("peerStateChanged() at time %d (difference of %d ms)\n", now, diff)); + STATECHANGED_LOG(("peerStateChanged() at time %d (difference of %d ms)", now, diff)); } } @@ -2913,7 +2913,7 @@ static void listingGamesCallback(PEER peer, PEERBool success, const char * name, DEBUG_LOG(("Raw stuff: [%s] [%s] [%d]", pingStr, ladIPStr, ladPort)); DEBUG_LOG(("Saw game with stuff %s %d %X %X %X %s", resp.stagingRoomMapName.c_str(), hasPassword, verVal, exeVal, iniVal, SBServerGetStringValue(server, "password", "missing"))); #ifdef PING_TEST - PING_LOG(("%s\n", pingStr)); + PING_LOG(("%s", pingStr)); #endif } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index d31141e437..356c6ca9d2 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -506,7 +506,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, if (findSingleBone(robj, boneNameTmp, info.mtx, info.boneIndex)) { //DEBUG_LOG(("added bone %s",boneNameTmp.str())); - BONEPOS_LOG(("Caching bone %s (index %d)\n", boneNameTmp.str(), info.boneIndex)); + BONEPOS_LOG(("Caching bone %s (index %d)", boneNameTmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(boneNameTmp)] = info; @@ -519,7 +519,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, if (findSingleBone(robj, tmp, info.mtx, info.boneIndex)) { //DEBUG_LOG(("added bone %s",tmp.str())); - BONEPOS_LOG(("Caching bone %s (index %d)\n", tmp.str(), info.boneIndex)); + BONEPOS_LOG(("Caching bone %s (index %d)", tmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(tmp)] = info; foundAsBone = true; @@ -535,7 +535,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, if (findSingleSubObj(robj, boneNameTmp, info.mtx, info.boneIndex)) { //DEBUG_LOG(("added subobj %s",boneNameTmp.str())); - BONEPOS_LOG(("Caching bone from subobject %s (index %d)\n", boneNameTmp.str(), info.boneIndex)); + BONEPOS_LOG(("Caching bone from subobject %s (index %d)", boneNameTmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(boneNameTmp)] = info; foundAsSubObj = true; @@ -547,7 +547,7 @@ static Bool doSingleBoneName(RenderObjClass* robj, const AsciiString& boneName, if (findSingleSubObj(robj, tmp, info.mtx, info.boneIndex)) { //DEBUG_LOG(("added subobj %s",tmp.str())); - BONEPOS_LOG(("Caching bone from subobject %s (index %d)\n", tmp.str(), info.boneIndex)); + BONEPOS_LOG(("Caching bone from subobject %s (index %d)", tmp.str(), info.boneIndex)); BONEPOS_DUMPMATRIX3D(&(info.mtx)); map[NAMEKEY(tmp)] = info; foundAsSubObj = true; @@ -600,7 +600,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c setFPMode(); BONEPOS_LOG(("Validating bones for %s: %s", m_modelName.str(), getDescription().str())); - //BONEPOS_LOG(("Passing in valid render obj: %d\n", (robj != 0))); + //BONEPOS_LOG(("Passing in valid render obj: %d", (robj != 0))); BONEPOS_DUMPREAL(scale); m_pristineBones.clear(); @@ -613,7 +613,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c { if (m_modelName.isEmpty()) { - //BONEPOS_LOG(("Bailing: model name is empty\n")); + //BONEPOS_LOG(("Bailing: model name is empty")); return; } @@ -621,7 +621,7 @@ void ModelConditionInfo::validateCachedBones(RenderObjClass* robj, Real scale) c DEBUG_ASSERTCRASH(robj, ("*** ASSET ERROR: Model %s not found!",m_modelName.str())); if (!robj) { - //BONEPOS_LOG(("Bailing: could not load render object\n")); + //BONEPOS_LOG(("Bailing: could not load render object")); return; } tossRobj = true; @@ -795,7 +795,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s wslot %d", m_modelName.str(), wslot)); DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); - BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s wslot %d\n", m_modelName.str(), wslot)); + BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s wslot %d", m_modelName.str(), wslot)); BONEPOS_DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); m_weaponBarrelInfoVec[wslot].push_back(info); @@ -833,7 +833,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const { CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) wslot %d", m_modelName.str(), wslot)); DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); - BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) wslot %d\n", m_modelName.str(), wslot)); + BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) wslot %d", m_modelName.str(), wslot)); BONEPOS_DUMPMATRIX3D(&(info.m_projectileOffsetMtx)); m_weaponBarrelInfoVec[wslot].push_back(info); if (info.m_recoilBone != 0 || info.m_muzzleFlashBone != 0) @@ -842,7 +842,7 @@ void ModelConditionInfo::validateWeaponBarrelInfo() const else { CRCDEBUG_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) found nothing", m_modelName.str())); - BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) found nothing\n", m_modelName.str())); + BONEPOS_LOG(("validateWeaponBarrelInfo() - model name %s (unadorned) found nothing", m_modelName.str())); } } // if empty @@ -3034,7 +3034,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) DEBUG_ASSERTCRASH(m_renderObject, ("*** ASSET ERROR: Model %s not found!",newState->m_modelName.str())); } - //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::setModelState()\n")); + //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::setModelState()")); //BONEPOS_DUMPREAL(draw->getScale()); newState->validateStuff(m_renderObject, draw->getScale(), getW3DModelDrawModuleData()->m_extraPublicBones); @@ -3160,7 +3160,7 @@ void W3DModelDraw::setModelState(const ModelConditionInfo* newState) else { - //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::setModelState()\n")); + //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::setModelState()")); //BONEPOS_DUMPREAL(getDrawable()->getScale()); newState->validateStuff(m_renderObject, getDrawable()->getScale(), getW3DModelDrawModuleData()->m_extraPublicBones); @@ -3270,7 +3270,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( if (!stateToUse) { CRCDEBUG_LOG(("can't find best info")); - //BONEPOS_LOG(("can't find best info\n")); + //BONEPOS_LOG(("can't find best info")); return false; } #if defined(RTS_DEBUG) @@ -3294,7 +3294,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( const W3DModelDrawModuleData* d = getW3DModelDrawModuleData(); //CRCDEBUG_LOG(("validateStuffs() from within W3DModelDraw::getProjectileLaunchOffset()")); //DUMPREAL(getDrawable()->getScale()); - //BONEPOS_LOG(("validateStuffs() from within W3DModelDraw::getProjectileLaunchOffset()\n")); + //BONEPOS_LOG(("validateStuffs() from within W3DModelDraw::getProjectileLaunchOffset()")); //BONEPOS_DUMPREAL(getDrawable()->getScale()); stateToUse->validateStuff(NULL, getDrawable()->getScale(), d->m_extraPublicBones); @@ -3325,7 +3325,7 @@ Bool W3DModelDraw::getProjectileLaunchOffset( { // Can't find the launch pos, but they might still want the other info they asked for CRCDEBUG_LOG(("empty wbvec")); - //BONEPOS_LOG(("empty wbvec\n")); + //BONEPOS_LOG(("empty wbvec")); launchPos = NULL; } else @@ -3426,7 +3426,7 @@ Int W3DModelDraw::getPristineBonePositionsForConditionState( // //CRCDEBUG_LOG(("renderObject == NULL: %d", (stateToUse==m_curState)?(m_renderObject == NULL):1)); // } - //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::getPristineBonePositionsForConditionState()\n")); + //BONEPOS_LOG(("validateStuff() from within W3DModelDraw::getPristineBonePositionsForConditionState()")); //BONEPOS_DUMPREAL(getDrawable()->getScale()); // we must call this every time we set m_nextState, to ensure cached bones are happy stateToUse->validateStuff( From 9c662f77854c221d16ef1efacfa9b5dc56e3dcb5 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:32:44 +0200 Subject: [PATCH 11/13] [GEN][ZH] Remove trailing CR LF from debug logging strings by hand (#1232) --- .../Source/WWVegas/WW3D2/assetstatus.cpp | 8 ++--- .../Source/WWVegas/WWDebug/wwprofile.cpp | 10 +++--- Core/Tools/matchbot/generals.cpp | 2 +- .../GameEngine/Source/Common/CRCDebug.cpp | 10 +++--- .../GameEngine/Source/Common/PerfTimer.cpp | 4 +-- .../Source/Common/System/GameMemory.cpp | 3 +- .../GameEngine/Source/Common/System/Radar.cpp | 2 +- .../Source/Common/System/StackDump.cpp | 1 - .../Source/Common/Thing/ModuleFactory.cpp | 20 ++++++------ .../Source/Common/Thing/ThingFactory.cpp | 2 +- .../Source/Common/Thing/ThingTemplate.cpp | 6 ++-- .../GameEngine/Source/GameClient/Drawable.cpp | 6 ++-- .../GUI/ControlBar/ControlBarCommand.cpp | 4 +-- .../GUI/ControlBar/ControlBarMultiSelect.cpp | 4 +-- .../GUI/GUICallbacks/Menus/PopupSaveLoad.cpp | 2 +- .../GameClient/GUI/GameWindowManager.cpp | 2 +- .../Source/GameClient/GUI/Shell/Shell.cpp | 4 +-- .../GameEngine/Source/GameClient/InGameUI.cpp | 2 +- .../Source/GameClient/System/Anim2D.cpp | 10 +++--- .../Source/GameLogic/AI/AIPlayer.cpp | 2 +- .../Object/Behavior/BridgeBehavior.cpp | 6 ++-- .../GameLogic/Object/Body/ActiveBody.cpp | 2 +- .../Object/Collide/FireWeaponCollide.cpp | 4 +-- .../Object/Contain/GarrisonContain.cpp | 4 +-- .../GameLogic/Object/Contain/OpenContain.cpp | 6 ++-- .../Source/GameLogic/Object/Object.cpp | 2 +- .../GameLogic/Object/PartitionManager.cpp | 4 +-- .../GameLogic/Object/Update/AIUpdate.cpp | 2 +- .../Object/Update/AIUpdate/DozerAIUpdate.cpp | 2 +- .../Update/AIUpdate/POWTruckAIUpdate.cpp | 8 ++--- .../AIUpdate/RailedTransportAIUpdate.cpp | 4 +-- .../Object/Update/AIUpdate/WorkerAIUpdate.cpp | 2 +- .../Update/ParticleUplinkCannonUpdate.cpp | 2 +- .../GameLogic/ScriptEngine/ScriptEngine.cpp | 10 +++--- .../Source/GameLogic/System/GameLogic.cpp | 18 +++++------ .../Source/GameNetwork/ConnectionManager.cpp | 4 +-- .../Source/GameNetwork/GameInfo.cpp | 2 +- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 6 ++-- .../W3DDevice/GameClient/WorldHeightMap.cpp | 2 +- .../Source/WWVegas/WW3D2/assetmgr.cpp | 6 ++-- .../Source/WWVegas/WW3D2/ddsfile.cpp | 6 ++-- .../Source/WWVegas/WW3D2/dx8renderer.cpp | 18 +++++------ .../Libraries/Source/WWVegas/WW3D2/shader.cpp | 4 +-- .../Libraries/Source/WWVegas/WW3D2/ww3d.cpp | 4 +-- .../GameEngine/Source/Common/CRCDebug.cpp | 10 +++--- .../GameEngine/Source/Common/GameEngine.cpp | 32 +++++++++---------- .../GameEngine/Source/Common/PerfTimer.cpp | 4 +-- .../Source/Common/System/GameMemory.cpp | 3 +- .../GameEngine/Source/Common/System/Radar.cpp | 2 +- .../Source/Common/System/StackDump.cpp | 1 - .../Source/Common/Thing/ModuleFactory.cpp | 20 ++++++------ .../Source/Common/Thing/ThingFactory.cpp | 2 +- .../Source/Common/Thing/ThingTemplate.cpp | 6 ++-- .../GameEngine/Source/GameClient/Drawable.cpp | 6 ++-- .../GUI/ControlBar/ControlBarCommand.cpp | 4 +-- .../GUI/ControlBar/ControlBarMultiSelect.cpp | 4 +-- .../GUI/GUICallbacks/Menus/PopupSaveLoad.cpp | 2 +- .../GameClient/GUI/GameWindowManager.cpp | 2 +- .../Source/GameClient/GUI/Shell/Shell.cpp | 4 +-- .../GameEngine/Source/GameClient/InGameUI.cpp | 2 +- .../Source/GameClient/System/Anim2D.cpp | 10 +++--- .../Source/GameLogic/AI/AIPlayer.cpp | 2 +- .../Object/Behavior/BridgeBehavior.cpp | 6 ++-- .../GameLogic/Object/Body/ActiveBody.cpp | 2 +- .../Object/Collide/FireWeaponCollide.cpp | 4 +-- .../Object/Contain/GarrisonContain.cpp | 4 +-- .../GameLogic/Object/Contain/OpenContain.cpp | 6 ++-- .../Source/GameLogic/Object/Object.cpp | 2 +- .../GameLogic/Object/PartitionManager.cpp | 4 +-- .../GameLogic/Object/Update/AIUpdate.cpp | 2 +- .../Object/Update/AIUpdate/DozerAIUpdate.cpp | 2 +- .../Update/AIUpdate/POWTruckAIUpdate.cpp | 8 ++--- .../AIUpdate/RailedTransportAIUpdate.cpp | 4 +-- .../Object/Update/AIUpdate/WorkerAIUpdate.cpp | 2 +- .../Update/ParticleUplinkCannonUpdate.cpp | 2 +- .../GameLogic/ScriptEngine/ScriptEngine.cpp | 10 +++--- .../Source/GameLogic/System/GameLogic.cpp | 18 +++++------ .../Source/GameNetwork/ConnectionManager.cpp | 4 +-- .../Source/GameNetwork/GameInfo.cpp | 2 +- .../GameClient/Drawable/Draw/W3DModelDraw.cpp | 6 ++-- .../W3DDevice/GameClient/WorldHeightMap.cpp | 2 +- .../Source/WWVegas/WW3D2/assetmgr.cpp | 6 ++-- .../Source/WWVegas/WW3D2/ddsfile.cpp | 6 ++-- .../Source/WWVegas/WW3D2/dx8renderer.cpp | 19 ++++++----- .../Libraries/Source/WWVegas/WW3D2/shader.cpp | 4 +-- .../Libraries/Source/WWVegas/WW3D2/ww3d.cpp | 4 +-- 86 files changed, 236 insertions(+), 241 deletions(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp b/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp index 1f024c6fb0..78fa70cf9a 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/assetstatus.cpp @@ -43,11 +43,11 @@ AssetStatusClass::~AssetStatusClass() { #ifdef WWDEBUG if (Reporting) { - StringClass report("Load-on-demand and missing assets report\r\n\r\n"); + StringClass report("Load-on-demand and missing assets report\n\n"); for (int i=0;i ite(ReportHashTables[i]); for (ite.First();!ite.Is_Done();ite.Next()) { @@ -58,9 +58,9 @@ AssetStatusClass::~AssetStatusClass() tmp.Format("\t(reported %d times)",count); report+=tmp; } - report+="\r\n"; + report+="\n"; } - report+="\r\n"; + report+="\n"; } if (report.Get_Length()) { RawFileClass raw_log_file("asset_report.txt"); diff --git a/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp b/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp index c4935ce123..324c26aa64 100644 --- a/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp +++ b/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp @@ -200,7 +200,7 @@ void WWProfileHierachyNodeClass::Write_To_File(FileClass* file,int recursion) StringClass string; StringClass work; for (i=0;iWrite(string.str(),string.Get_Length()); } @@ -574,8 +574,8 @@ void WWProfileManager::End_Collecting(const char* filename) StringClass str; float avg_frame_time=TotalFrameTimes/float(ProfileCollectVector.Count()); str.Format( - "Total frames: %d, average frame time: %fms\r\n" - "All frames taking more than twice the average frame time are marked with keyword SPIKE.\r\n\r\n", + "Total frames: %d, average frame time: %fms\n" + "All frames taking more than twice the average frame time are marked with keyword SPIKE.\n\n", ProfileCollectVector.Count(),avg_frame_time*1000.0f); file->Write(str.str(),str.Get_Length()); @@ -590,11 +590,11 @@ void WWProfileManager::End_Collecting(const char* filename) if (name[i]==',') name[i]='.'; if (name[i]==';') name[i]=':'; } - str.Format("ID: %d %s\r\n",ite.Peek_Value(),name.str()); + str.Format("ID: %d %s\n",ite.Peek_Value(),name.str()); file->Write(str.str(),str.Get_Length()); } - str.Format("\r\n\r\n"); + str.Format("\n\n"); file->Write(str.str(),str.Get_Length()); for (i=0;ifirst << " vs " << i2->first << " has fitness " << matchFitness << "" + DBGMSG(i1->first << " vs " << i2->first << " has fitness " << matchFitness "\tpointPercent: " << pointPercent << "\n" "\tpingDelta: " << pingDelta << "\n" "\twidened: " << u1->widened << u2->widened << "\n" diff --git a/Generals/Code/GameEngine/Source/Common/CRCDebug.cpp b/Generals/Code/GameEngine/Source/Common/CRCDebug.cpp index 924ba5d4e6..e1401c394c 100644 --- a/Generals/Code/GameEngine/Source/Common/CRCDebug.cpp +++ b/Generals/Code/GameEngine/Source/Common/CRCDebug.cpp @@ -279,7 +279,7 @@ void dumpVector3(const Vector3 *v, AsciiString name, AsciiString fname, Int line if (!(IS_FRAME_OK_TO_LOG)) return; fname.toLower(); fname = getFname(fname); - addCRCDebugLine("dumpVector3() %s:%d %s %8.8X %8.8X %8.8X\n", + addCRCDebugLine("dumpVector3() %s:%d %s %8.8X %8.8X %8.8X", fname.str(), line, name.str(), AS_INT(v->X), AS_INT(v->Y), AS_INT(v->Z)); } @@ -289,7 +289,7 @@ void dumpCoord3D(const Coord3D *c, AsciiString name, AsciiString fname, Int line if (!(IS_FRAME_OK_TO_LOG)) return; fname.toLower(); fname = getFname(fname); - addCRCDebugLine("dumpCoord3D() %s:%d %s %8.8X %8.8X %8.8X\n", + addCRCDebugLine("dumpCoord3D() %s:%d %s %8.8X %8.8X %8.8X", fname.str(), line, name.str(), AS_INT(c->x), AS_INT(c->y), AS_INT(c->z)); } @@ -300,10 +300,10 @@ void dumpMatrix3D(const Matrix3D *m, AsciiString name, AsciiString fname, Int li fname.toLower(); fname = getFname(fname); const Real *matrix = (const Real *)m; - addCRCDebugLine("dumpMatrix3D() %s:%d %s\n", + addCRCDebugLine("dumpMatrix3D() %s:%d %s", fname.str(), line, name.str()); for (Int i=0; i<3; ++i) - addCRCDebugLine(" 0x%08X 0x%08X 0x%08X 0x%08X\n", + addCRCDebugLine(" 0x%08X 0x%08X 0x%08X 0x%08X", AS_INT(matrix[(i<<2)+0]), AS_INT(matrix[(i<<2)+1]), AS_INT(matrix[(i<<2)+2]), AS_INT(matrix[(i<<2)+3])); } @@ -312,7 +312,7 @@ void dumpReal(Real r, AsciiString name, AsciiString fname, Int line) if (!(IS_FRAME_OK_TO_LOG)) return; fname.toLower(); fname = getFname(fname); - addCRCDebugLine("dumpReal() %s:%d %s %8.8X (%f)\n", + addCRCDebugLine("dumpReal() %s:%d %s %8.8X (%f)", fname.str(), line, name.str(), AS_INT(r), r); } diff --git a/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp b/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp index 45ed71a4a4..adb44b6fe6 100644 --- a/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp +++ b/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp @@ -524,7 +524,7 @@ void PerfTimer::outputInfo( void ) "Average Time (per frame): %.4f ms\n" "Average calls per frame: %.2f\n" "Number of calls: %d\n" - "Max possible FPS: %.4f\n", + "Max possible FPS: %.4f", m_identifier, avgTimePerCall, avgTimePerFrame, @@ -537,7 +537,7 @@ void PerfTimer::outputInfo( void ) "Average Time (per frame): %.4f ms\n" "Average calls per frame: %.2f\n" "Number of calls: %d\n" - "Max possible FPS: %.4f\n", + "Max possible FPS: %.4f", m_identifier, avgTimePerCall, avgTimePerFrame, diff --git a/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp b/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp index 5123890295..1c36492ef2 100644 --- a/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp @@ -320,7 +320,7 @@ static void memset32(void* ptr, Int value, Int bytesToFill) static void doStackDumpOutput(const char* m) { const char *PREPEND = "STACKTRACE"; - if (*m == 0 || strcmp(m, "\n") == 0) + if (*m == 0) { DEBUG_LOG((m)); } @@ -341,7 +341,6 @@ static void doStackDumpOutput(const char* m) static void doStackDump(void **stacktrace, int size) { ::doStackDumpOutput("Allocation Stack Trace:"); - ::doStackDumpOutput("\n"); ::StackDumpFromAddresses(stacktrace, size, ::doStackDumpOutput); } #endif diff --git a/Generals/Code/GameEngine/Source/Common/System/Radar.cpp b/Generals/Code/GameEngine/Source/Common/System/Radar.cpp index de7d1cce01..3651c20f7c 100644 --- a/Generals/Code/GameEngine/Source/Common/System/Radar.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/Radar.cpp @@ -403,7 +403,7 @@ bool Radar::addObject( Object *obj ) // sanity DEBUG_ASSERTCRASH( obj->friend_getRadarData() == NULL, - ("Radar: addObject - non NULL radar data for '%s'\n", + ("Radar: addObject - non NULL radar data for '%s'", obj->getTemplate()->getName().str()) ); // allocate a new object diff --git a/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp b/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp index fd2aeb9127..f2e20d726d 100644 --- a/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp @@ -621,7 +621,6 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) eip_ptr++; } - strcat (scrap, "\n"); DOUBLE_DEBUG ( ( (scrap))); DEBUG_LOG(( "********** END EXCEPTION DUMP ****************\n" )); } diff --git a/Generals/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp b/Generals/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp index 5f63d77dc7..b12ad099be 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp @@ -591,34 +591,34 @@ Module *ModuleFactory::newModule( Thing *thing, const AsciiString& name, const M DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_BODY)) != 0) == (bm->getBody() != NULL), - ("getInterfaceMask bad for MODULE_BODY (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_BODY (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_COLLIDE)) != 0) == (bm->getCollide() != NULL), - ("getInterfaceMask bad for MODULE_COLLIDE (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_COLLIDE (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_CONTAIN)) != 0) == (bm->getContain() != NULL), - ("getInterfaceMask bad for MODULE_CONTAIN (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_CONTAIN (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_CREATE)) != 0) == (bm->getCreate() != NULL), - ("getInterfaceMask bad for MODULE_CREATE (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_CREATE (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_DAMAGE)) != 0) == (bm->getDamage() != NULL), - ("getInterfaceMask bad for MODULE_DAMAGE (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_DAMAGE (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_DESTROY)) != 0) == (bm->getDestroy() != NULL), - ("getInterfaceMask bad for MODULE_DESTROY (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_DESTROY (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_DIE)) != 0) == (bm->getDie() != NULL), - ("getInterfaceMask bad for MODULE_DIE (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_DIE (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_SPECIAL_POWER)) != 0) == (bm->getSpecialPower() != NULL), - ("getInterfaceMask bad for MODULE_SPECIAL_POWER (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_SPECIAL_POWER (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_UPDATE)) != 0) == (bm->getUpdate() != NULL), - ("getInterfaceMask bad for MODULE_UPDATE (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_UPDATE (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_UPGRADE)) != 0) == (bm->getUpgrade() != NULL), - ("getInterfaceMask bad for MODULE_UPGRADE (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_UPGRADE (%s)",name.str())); } #endif diff --git a/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp b/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp index 05678d1ff4..3ebf768c14 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp @@ -173,7 +173,7 @@ ThingTemplate* ThingFactory::newOverride( ThingTemplate *thingTemplate ) // sanity just for debuging, the weapon must be in the master list to do overrides DEBUG_ASSERTCRASH( findTemplate( thingTemplate->getName() ) != NULL, - ("newOverride(): Thing template '%s' not in master list\n", + ("newOverride(): Thing template '%s' not in master list", thingTemplate->getName().str()) ); // find final override of the 'parent' template diff --git a/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp index 9d1702cbb4..0adf7006b8 100644 --- a/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -304,7 +304,7 @@ void ModuleInfo::addModuleInfo(ThingTemplate *thingTemplate, // compare this nugget tag against the tag for the new data we're going to submit DEBUG_ASSERTCRASH( nugget->m_moduleTag != moduleTag, - ("addModuleInfo - ERROR defining module '%s' on thing template '%s'. The module '%s' has the tag '%s' which must be unique among all modules for this object, but the tag '%s' is also already on module '%s' within this object.\n\nPlease make unique tag names within an object definition\n", + ("addModuleInfo - ERROR defining module '%s' on thing template '%s'. The module '%s' has the tag '%s' which must be unique among all modules for this object, but the tag '%s' is also already on module '%s' within this object.\n\nPlease make unique tag names within an object definition", name.str(), thingTemplate->getName().str(), name.str(), @@ -322,7 +322,7 @@ void ModuleInfo::addModuleInfo(ThingTemplate *thingTemplate, // compare this nugget tag against the tag for the new data we're going to submit DEBUG_ASSERTCRASH( nugget->m_moduleTag != moduleTag, - ("addModuleInfo - ERROR defining module '%s' on thing template '%s'. The module '%s' has the tag '%s' which must be unique among all modules for this object, but the tag '%s' is also already on module '%s' within this object.\n\nPlease make unique tag names within an object definition\n", + ("addModuleInfo - ERROR defining module '%s' on thing template '%s'. The module '%s' has the tag '%s' which must be unique among all modules for this object, but the tag '%s' is also already on module '%s' within this object.\n\nPlease make unique tag names within an object definition", name.str(), thingTemplate->getName().str(), name.str(), @@ -340,7 +340,7 @@ void ModuleInfo::addModuleInfo(ThingTemplate *thingTemplate, // compare this nugget tag against the tag for the new data we're going to submit DEBUG_ASSERTCRASH( nugget->m_moduleTag != moduleTag, - ("addModuleInfo - ERROR defining module '%s' on thing template '%s'. The module '%s' has the tag '%s' which must be unique among all modules for this object, but the tag '%s' is also already on module '%s' within this object.\n\nPlease make unique tag names within an object definition\n", + ("addModuleInfo - ERROR defining module '%s' on thing template '%s'. The module '%s' has the tag '%s' which must be unique among all modules for this object, but the tag '%s' is also already on module '%s' within this object.\n\nPlease make unique tag names within an object definition", name.str(), thingTemplate->getName().str(), name.str(), diff --git a/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp b/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp index d5f51904bc..4d671a7243 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp @@ -187,7 +187,7 @@ static const char *drawableIconIndexToName( DrawableIconType iconIndex ) { DEBUG_ASSERTCRASH( iconIndex >= ICON_FIRST && iconIndex < MAX_ICONS, - ("drawableIconIndexToName - Illegal index '%d'\n", iconIndex) ); + ("drawableIconIndexToName - Illegal index '%d'", iconIndex) ); return TheDrawableIconNames[ iconIndex ]; @@ -4171,7 +4171,7 @@ void Drawable::xferDrawableModules( Xfer *xfer ) // write module identifier moduleIdentifier = TheNameKeyGenerator->keyToName( (*m)->getModuleTagNameKey() ); DEBUG_ASSERTCRASH( moduleIdentifier != AsciiString::TheEmptyString, - ("Drawable::xferDrawableModules - module name key does not translate to a string!\n") ); + ("Drawable::xferDrawableModules - module name key does not translate to a string!") ); xfer->xferAsciiString( &moduleIdentifier ); // begin data block @@ -4530,7 +4530,7 @@ void Drawable::xfer( Xfer *xfer ) // sanity, we don't write old versions we can only read them DEBUG_ASSERTCRASH( xfer->getXferMode() == XFER_LOAD, - ("Drawable::xfer - Writing an old format!!!\n") ); + ("Drawable::xfer - Writing an old format!!!") ); // condition state, note that when we're loading we need to force a replace of these flags m_conditionState.xfer( xfer ); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp index b5d396fe20..3bea7af5da 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp @@ -806,7 +806,7 @@ void ControlBar::updateContextCommand( void ) // sanity, check like commands should have windows that are check like as well DEBUG_ASSERTCRASH( BitIsSet( win->winGetStatus(), WIN_STATUS_CHECK_LIKE ), - ("updateContextCommand: Error, gadget window for command '%s' is not check-like!\n", + ("updateContextCommand: Error, gadget window for command '%s' is not check-like!", command->getName().str()) ); if( availability == COMMAND_ACTIVE ) @@ -1265,7 +1265,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com { // sanity DEBUG_ASSERTCRASH( command->getSpecialPowerTemplate() != NULL, - ("The special power in the command '%s' is NULL\n", command->getName().str()) ); + ("The special power in the command '%s' is NULL", command->getName().str()) ); // get special power module from the object to execute it SpecialPowerModuleInterface *mod = obj->getSpecialPowerModule( command->getSpecialPowerTemplate() ); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp index 1511e5bcdf..a6146bdf1d 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp @@ -225,7 +225,7 @@ void ControlBar::populateMultiSelect( void ) // sanity DEBUG_ASSERTCRASH( TheInGameUI->getSelectCount() > 1, - ("populateMultiSelect: Can't populate multiselect context cause there are only '%d' things selected\n", + ("populateMultiSelect: Can't populate multiselect context cause there are only '%d' things selected", TheInGameUI->getSelectCount()) ); // get the list of drawable IDs from the in game UI @@ -306,7 +306,7 @@ void ControlBar::updateContextMultiSelect( void ) // santiy DEBUG_ASSERTCRASH( TheInGameUI->getSelectCount() > 1, - ("updateContextMultiSelect: TheInGameUI only has '%d' things selected\n", + ("updateContextMultiSelect: TheInGameUI only has '%d' things selected", TheInGameUI->getSelectCount()) ); // get the list of drawable IDs from the in game UI diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp index 2fdd24cebc..07f41c3940 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp @@ -593,7 +593,7 @@ WindowMsgHandledType SaveLoadMenuSystem( GameWindow *window, UnsignedInt msg, // sanity DEBUG_ASSERTCRASH( currentLayoutType == SLLT_SAVE_AND_LOAD || currentLayoutType == SLLT_SAVE_ONLY, - ("SaveLoadMenuSystem - layout type '%d' does not allow saving\n", + ("SaveLoadMenuSystem - layout type '%d' does not allow saving", currentLayoutType) ); // get save file info diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp index 700ca2b0a0..755d69d460 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp @@ -1470,7 +1470,7 @@ Int GameWindowManager::winDestroy( GameWindow *window ) // completely handled by the editor ONLY // DEBUG_ASSERTCRASH( window->winGetEditData() == NULL, - ("winDestroy(): edit data should NOT be present!\n") ); + ("winDestroy(): edit data should NOT be present!") ); if( BitIsSet( window->m_status, WIN_STATUS_DESTROYED ) ) return WIN_ERR_OK; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp index bc38139fb1..bad6e48aaa 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp @@ -647,7 +647,7 @@ void Shell::unlinkScreen( WindowLayout *screen ) return; DEBUG_ASSERTCRASH( m_screenStack[ m_screenCount - 1 ] == screen, - ("Screen not on top of stack\n") ); + ("Screen not on top of stack") ); // remove reference to screen and decrease count if( m_screenStack[ m_screenCount - 1 ] == screen ) @@ -731,7 +731,7 @@ void Shell::shutdownComplete( WindowLayout *screen, Bool impendingPush ) // there should never be a pending push AND pop operation DEBUG_ASSERTCRASH( m_pendingPush == FALSE || m_pendingPop == FALSE, - ("There is a pending push AND pop in the shell. Not allowed!\n") ); + ("There is a pending push AND pop in the shell. Not allowed!") ); // Reset the AnimateWindowManager m_animateWindowManager->reset(); diff --git a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp index 127d3021f2..d01aaff9a8 100644 --- a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -3155,7 +3155,7 @@ void InGameUI::deselectDrawable( Drawable *draw ) // sanity DEBUG_ASSERTCRASH( findIt != m_selectedDrawables.end(), - ("deselectDrawable: Drawable not found in the selected drawable list '%s'\n", + ("deselectDrawable: Drawable not found in the selected drawable list '%s'", draw->getTemplate()->getName().str()) ); // remove it from the selected drawable list diff --git a/Generals/Code/GameEngine/Source/GameClient/System/Anim2D.cpp b/Generals/Code/GameEngine/Source/GameClient/System/Anim2D.cpp index 68366cb5ef..2816c9ca7c 100644 --- a/Generals/Code/GameEngine/Source/GameClient/System/Anim2D.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/System/Anim2D.cpp @@ -267,7 +267,7 @@ const Image* Anim2DTemplate::getFrame( UnsignedShort frameNumber ) const // sanity DEBUG_ASSERTCRASH( m_images != NULL, - ("Anim2DTemplate::getFrame - Image data is NULL for animation '%s'\n", + ("Anim2DTemplate::getFrame - Image data is NULL for animation '%s'", getName().str()) ); // sanity @@ -363,12 +363,12 @@ void Anim2D::setCurrentFrame( UnsignedShort frame ) // sanity DEBUG_ASSERTCRASH( TheGameLogic != NULL, - ("Anim2D::setCurrentFrame - TheGameLogic must exist to use animation instances (%s)\n", + ("Anim2D::setCurrentFrame - TheGameLogic must exist to use animation instances (%s)", m_template->getName().str()) ); // sanity DEBUG_ASSERTCRASH( frame >= 0 && frame < m_template->getNumFrames(), - ("Anim2D::setCurrentFrame - Illegal frame number '%d' in animation\n", + ("Anim2D::setCurrentFrame - Illegal frame number '%d' in animation", frame, m_template->getName().str()) ); // set the frame @@ -438,7 +438,7 @@ void Anim2D::tryNextFrame( void ) // sanity DEBUG_ASSERTCRASH( TheGameLogic != NULL, - ("Anim2D::tryNextFrame - TheGameLogic must exist to use animation instances (%s)\n", + ("Anim2D::tryNextFrame - TheGameLogic must exist to use animation instances (%s)", m_template->getName().str()) ); // how many frames have passed since our last update @@ -841,7 +841,7 @@ void Anim2DCollection::registerAnimation( Anim2D *anim ) // sanity DEBUG_ASSERTCRASH( anim->m_collectionSystemNext == NULL && anim->m_collectionSystemPrev == NULL, - ("Registering animation instance, instance '%s' is already in a system\n", + ("Registering animation instance, instance '%s' is already in a system", anim->getAnimTemplate()->getName().str()) ); // tie to our list diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp index 6eac300172..8b0e8e1ee8 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp @@ -1985,7 +1985,7 @@ void AIPlayer::repairStructure(ObjectID structure) void AIPlayer::selectSkillset(Int skillset) { DEBUG_ASSERTCRASH(m_skillsetSelector == INVALID_SKILLSET_SELECTION, - ("Selecting a skill set (%d) after one has already been chosen (%d) means some points have been incorrectly spent.\n", skillset + 1, m_skillsetSelector + 1)); + ("Selecting a skill set (%d) after one has already been chosen (%d) means some points have been incorrectly spent.", skillset + 1, m_skillsetSelector + 1)); m_skillsetSelector = skillset; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp index e38b7d68cb..66601807a4 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp @@ -1145,7 +1145,7 @@ void BridgeBehavior::createScaffolding( void ) // sanity DEBUG_ASSERTCRASH( scaffoldObjectsCreated < numObjects, - ("Creating too many scaffold objects\n") ); + ("Creating too many scaffold objects") ); // create object obj = TheThingFactory->newObject( scaffoldTemplate, us->getTeam() ); @@ -1213,7 +1213,7 @@ void BridgeBehavior::createScaffolding( void ) // sanity DEBUG_ASSERTCRASH( scaffoldObjectsCreated < numObjects, - ("Creating too many scaffold objects\n") ); + ("Creating too many scaffold objects") ); // create new object obj = TheThingFactory->newObject( scaffoldTemplate, us->getTeam() ); @@ -1452,7 +1452,7 @@ void BridgeBehavior::xfer( Xfer *xfer ) // read all object IDs DEBUG_ASSERTCRASH( m_scaffoldObjectIDList.size() == 0, - ("BridgeBehavior::xfer - scaffold object list should be empty\n") ); + ("BridgeBehavior::xfer - scaffold object list should be empty") ); for( Int i = 0; i < scaffoldObjectCount; ++i ) { diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp index 1e4f0fa5c3..e2df4f388c 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp @@ -800,7 +800,7 @@ void ActiveBody::createParticleSystems( const AsciiString &boneBaseName, // sanity DEBUG_ASSERTCRASH( j != numBones, - ("ActiveBody::createParticleSystems, Unable to select particle system index\n") ); + ("ActiveBody::createParticleSystems, Unable to select particle system index") ); // create particle system here ParticleSystem *particleSystem = TheParticleSystemManager->createParticleSystem( systemTemplate ); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp index 9ff821aa8e..81f3f5fcd1 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp @@ -146,7 +146,7 @@ void FireWeaponCollide::xfer( Xfer *xfer ) { DEBUG_ASSERTCRASH( m_collideWeapon != NULL, - ("FireWeaponCollide::xfer - m_collideWeapon present mismatch\n") ); + ("FireWeaponCollide::xfer - m_collideWeapon present mismatch") ); xfer->xferSnapshot( m_collideWeapon ); } // end else @@ -154,7 +154,7 @@ void FireWeaponCollide::xfer( Xfer *xfer ) { DEBUG_ASSERTCRASH( m_collideWeapon == NULL, - ("FireWeaponCollide::Xfer - m_collideWeapon missing mismatch\n" )); + ("FireWeaponCollide::Xfer - m_collideWeapon missing mismatch" )); } // end else diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp index b13411df5e..64eaa7f77f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp @@ -395,7 +395,7 @@ void GarrisonContain::putObjectAtBestGarrisonPoint( Object *obj, Object *target, // get the index of the garrison point that is closest to the target position Int placeIndex = findClosestFreeGarrisonPointIndex( conditionIndex, targetPos ); DEBUG_ASSERTCRASH( placeIndex != GARRISON_INDEX_INVALID, - ("GarrisonContain::putObjectAtBestGarrisonPoint - Unable to find suitable garrison point for '%s'\n", + ("GarrisonContain::putObjectAtBestGarrisonPoint - Unable to find suitable garrison point for '%s'", obj->getTemplate()->getName().str()) ); // put it here @@ -895,7 +895,7 @@ UpdateSleepTime GarrisonContain::update( void ) { // sanity information DEBUG_ASSERTCRASH( getObject()->isMobile() == FALSE, - ("GarrisonContain::update - Objects with garrison contain can be spec'd as 'mobile' in the INI. Do you really want to do this? \n") ); + ("GarrisonContain::update - Objects with garrison contain can be spec'd as 'mobile' in the INI. Do you really want to do this?") ); } return UPDATE_SLEEP_NONE; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp index e1784a599f..6a82cf84b4 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp @@ -164,12 +164,12 @@ OpenContain::~OpenContain() // sanity, the system should be cleaning these up itself if all is going well DEBUG_ASSERTCRASH( m_containList.empty(), - ("OpenContain %s: destroying a container that still has items in it!\n", + ("OpenContain %s: destroying a container that still has items in it!", getObject()->getTemplate()->getName().str() ) ); // sanity DEBUG_ASSERTCRASH( m_xferContainIDList.empty(), - ("OpenContain %s: m_xferContainIDList is not empty but should be\n", + ("OpenContain %s: m_xferContainIDList is not empty but should be", getObject()->getTemplate()->getName().str() ) ); } @@ -1651,7 +1651,7 @@ void OpenContain::loadPostProcess( void ) // sanity DEBUG_ASSERTCRASH( m_containListSize == m_containList.size(), - ("OpenContain::loadPostProcess - contain list count mismatch\n") ); + ("OpenContain::loadPostProcess - contain list count mismatch") ); // clear the list as we don't need it anymore m_xferContainIDList.clear(); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp index e0e3aa3746..a4e0e20a37 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -3449,7 +3449,7 @@ void Object::crc( Xfer *xfer ) #ifdef DEBUG_CRC if (doLogging) { - tmp.format("damage scalar: %g/%8.8X\n", scalar, AS_INT(scalar)); + tmp.format("damage scalar: %g/%8.8X", scalar, AS_INT(scalar)); logString.concat(tmp); CRCDEBUG_LOG(("%s", logString.str())); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index ae1d86454c..028d5d328f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -1614,7 +1614,7 @@ ObjectShroudStatus PartitionData::getShroudedStatus(Int playerIndex) { // sanity DEBUG_ASSERTCRASH( playerIndex >= 0 && playerIndex < MAX_PLAYER_COUNT, - ("PartitionData::getShroudedStatus - Invalid player index '%d'\n", playerIndex) ); + ("PartitionData::getShroudedStatus - Invalid player index '%d'", playerIndex) ); if (!ThePartitionManager->getUpdatedSinceLastReset()) { @@ -3887,7 +3887,7 @@ Bool PartitionManager::findPositionAround( const Coord3D *center, // sanity, FPF_IGNORE_WATER and FPF_WATER_ONLY are mutually exclusive DEBUG_ASSERTCRASH( !(BitIsSet( options->flags, FPF_IGNORE_WATER ) == TRUE && BitIsSet( options->flags, FPF_WATER_ONLY ) == TRUE), - ("PartitionManager::findPositionAround - The options FPF_WATER_ONLY and FPF_IGNORE_WATER are mutually exclusive. You cannot use them together\n") ); + ("PartitionManager::findPositionAround - The options FPF_WATER_ONLY and FPF_IGNORE_WATER are mutually exclusive. You cannot use them together") ); // pick a random angle from the center location to start at Real startAngle; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index f2d8d0d58b..9b6848aa5c 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -1909,7 +1909,7 @@ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServic weapon->computeApproachTarget(getObject(), victim, &localVictimPos, 0, localVictimPos); //DEBUG_ASSERTCRASH(weapon->isGoalPosWithinAttackRange(getObject(), &localVictimPos, victim, victimPos, NULL), - // ("position we just calced is not acceptable\n")); + // ("position we just calced is not acceptable")); // First, see if our path already goes to the destination. if (m_path) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp index eadbafdd1d..9f985daf93 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp @@ -1641,7 +1641,7 @@ Object *DozerAIUpdate::construct( const ThingTemplate *what, // sanity DEBUG_ASSERTCRASH( getObject()->getControllingPlayer() == owningPlayer, - ("Dozer::Construct - The controlling player of the Dozer is not the owning player passed in\n") ); + ("Dozer::Construct - The controlling player of the Dozer is not the owning player passed in") ); // if we're not rebuilding, we have a few checks to pass first for sanity if( isRebuild == FALSE ) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp index 589805b095..dffb1c37ee 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp @@ -510,7 +510,7 @@ static void putContainedInPrison( Object *obj, void *userData ) // sanity DEBUG_ASSERTCRASH( returnData != NULL && returnData->source != NULL && returnData->dest != NULL, - ("putContainedInPrison: Invalid arguments\n") ); + ("putContainedInPrison: Invalid arguments") ); // take 'obj' out of the source ContainModuleInterface *sourceContain = returnData->source->getContain(); @@ -729,7 +729,7 @@ static void putPrisonersInPrison( Object *obj, void *userData ) // sanity DEBUG_ASSERTCRASH( prison, ("putPrisonersInPrison: NULL user data") ); DEBUG_ASSERTCRASH( obj->getContainedBy() != NULL, - ("putPrisonersInPrison: Prisoner '%s' is not contained by anything, it should be contained by a POW truck\n", + ("putPrisonersInPrison: Prisoner '%s' is not contained by anything, it should be contained by a POW truck", obj->getTemplate()->getName().str()) ); // extra super sanity, just so that we don't crash ... this is in the assert above @@ -774,12 +774,12 @@ void POWTruckAIUpdate::unloadPrisonersToPrison( Object *prison ) DEBUG_ASSERTCRASH( prison->getContain(), ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain", prison->getTemplate()->getName().str()) ); DEBUG_ASSERTCRASH( prison->getContain()->asOpenContain(), - ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain\n", + ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain", prison->getTemplate()->getName().str()) ); DEBUG_ASSERTCRASH( truckContain, ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain", us->getTemplate()->getName().str()) ); DEBUG_ASSERTCRASH( truckContain->asOpenContain(), - ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain\n", + ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain", us->getTemplate()->getName().str()) ); // put the prisoners in the prison diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp index 9a5bbef6ca..df4f41f724 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp @@ -171,7 +171,7 @@ void RailedTransportAIUpdate::pickAndMoveToInitialLocation( void ) // a path must have been found DEBUG_ASSERTCRASH( closestPath != INVALID_PATH, - ("No suitable starting waypoint path could be found for '%s'\n", + ("No suitable starting waypoint path could be found for '%s'", us->getTemplate()->getName().str()) ); // follow the waypoint path to its destination end point @@ -221,7 +221,7 @@ UpdateSleepTime RailedTransportAIUpdate::update( void ) // sanity DEBUG_ASSERTCRASH( m_currentPath != INVALID_PATH, - ("RailedTransportAIUpdate: Invalid current path '%s'\n", m_currentPath) ); + ("RailedTransportAIUpdate: Invalid current path '%s'", m_currentPath) ); // get our target waypoint Waypoint *waypoint = TheTerrainLogic->getWaypointByID( m_path[ m_currentPath ].endWaypointID ); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp index 10f3b5f772..b4d49c454e 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp @@ -347,7 +347,7 @@ Object *WorkerAIUpdate::construct( const ThingTemplate *what, // sanity DEBUG_ASSERTCRASH( getObject()->getControllingPlayer() == owningPlayer, - ("Dozer::Construct - The controlling player of the Dozer is not the owning player passed in\n") ); + ("Dozer::Construct - The controlling player of the Dozer is not the owning player passed in") ); // if we're not rebuilding, we have a few checks to pass first for sanity if( isRebuild == FALSE ) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp index ae9b197437..435642cbc0 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp @@ -578,7 +578,7 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update() scorchRadius = logicalLaserRadius * data->m_scorchMarkScalar; #if defined(RETAIL_COMPATIBLE_CRC) DEBUG_ASSERTCRASH(logicalLaserRadius == visualLaserRadius, - ("ParticleUplinkCannonUpdate's laser radius does not match LaserUpdate's laser radius - will cause mismatch in VS6 retail compatible builds\n")); + ("ParticleUplinkCannonUpdate's laser radius does not match LaserUpdate's laser radius - will cause mismatch in VS6 retail compatible builds")); #endif //Create scorch marks periodically diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp index cf9aca3ff1..5c8ded28c9 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp @@ -296,7 +296,7 @@ void AttackPriorityInfo::xfer( Xfer *xfer ) thingTemplate = (*it).first; thingTemplateName = thingTemplate->getName(); DEBUG_ASSERTCRASH( thingTemplateName.isEmpty() == FALSE, - ("AttackPriorityInfo::xfer - Writing an empty thing template name\n") ); + ("AttackPriorityInfo::xfer - Writing an empty thing template name") ); xfer->xferAsciiString( &thingTemplateName ); // write priority @@ -307,7 +307,7 @@ void AttackPriorityInfo::xfer( Xfer *xfer ) // sanity DEBUG_ASSERTCRASH( count == priorityMapCount, - ("AttackPriorityInfo::xfer - Mismatch in priority map size. Size() method returned '%d' but actual iteration count was '%d'\n", + ("AttackPriorityInfo::xfer - Mismatch in priority map size. Size() method returned '%d' but actual iteration count was '%d'", priorityMapCount, count) ); } // end if @@ -6379,14 +6379,14 @@ void ScriptEngine::addObjectToCache(Object* pNewObject) if (it->first == objName) { if (it->second == NULL) { AsciiString newNameForDead; - newNameForDead.format("Reassigning dead object's name '%s' to object (%d) of type '%s'\n", objName.str(), pNewObject->getID(), pNewObject->getTemplate()->getName().str()); + newNameForDead.format("Reassigning dead object's name '%s' to object (%d) of type '%s'", objName.str(), pNewObject->getID(), pNewObject->getTemplate()->getName().str()); TheScriptEngine->AppendDebugMessage(newNameForDead, FALSE); DEBUG_LOG((newNameForDead.str())); it->second = pNewObject; return; } else { DEBUG_CRASH(("Attempting to assign the name '%s' to object (%d) of type '%s'," - " but object (%d) of type '%s' already has that name\n", + " but object (%d) of type '%s' already has that name", objName.str(), pNewObject->getID(), pNewObject->getTemplate()->getName().str(), it->second->getID(), it->second->getTemplate()->getName().str())); return; @@ -7485,7 +7485,7 @@ void SequentialScript::xfer( Xfer *xfer ) // sanity DEBUG_ASSERTCRASH( m_scriptToExecuteSequentially != NULL, - ("SequentialScript::xfer - m_scriptToExecuteSequentially is NULL but should not be\n") ); + ("SequentialScript::xfer - m_scriptToExecuteSequentially is NULL but should not be") ); } // end else, load diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 4f829436c3..5bce427f69 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -1170,7 +1170,7 @@ void GameLogic::startNewGame( Bool saveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); char Buf[256]; - sprintf(Buf,"After terrainlogic->loadmap=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"After terrainlogic->loadmap=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); //DEBUG_LOG(("Placed a starting building for %s at waypoint %s", playerName.str(), waypointName.str())); DEBUG_LOG(("%s", Buf)); #endif @@ -1529,7 +1529,7 @@ void GameLogic::startNewGame( Bool saveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); - sprintf(Buf,"After terrainlogic->newmap=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"After terrainlogic->newmap=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); DEBUG_LOG(("%s", Buf)); #endif @@ -1629,7 +1629,7 @@ void GameLogic::startNewGame( Bool saveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); - sprintf(Buf,"Before loading objects=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"Before loading objects=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); DEBUG_LOG(("%s", Buf)); #endif @@ -1735,7 +1735,7 @@ void GameLogic::startNewGame( Bool saveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); - sprintf(Buf,"After loading objects=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"After loading objects=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); DEBUG_LOG(("%s", Buf)); #endif @@ -1868,7 +1868,7 @@ void GameLogic::startNewGame( Bool saveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); - sprintf(Buf,"After partition manager update=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"After partition manager update=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); DEBUG_LOG(("%s", Buf)); #endif @@ -1945,7 +1945,7 @@ void GameLogic::startNewGame( Bool saveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); - sprintf(Buf,"After delete load screen=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"After delete load screen=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); DEBUG_LOG(("%s", Buf)); #endif @@ -2076,7 +2076,7 @@ void GameLogic::startNewGame( Bool saveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); - sprintf(Buf,"Total startnewgame=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"Total startnewgame=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); DEBUG_LOG(("%s", Buf)); #endif @@ -3122,7 +3122,7 @@ void GameLogic::update( void ) __int64 freq64; GetPrecisionTimerTicksPerSec(&freq64); - sprintf(Buf,"Texture=%f, Anim=%f, CreateRobj=%f, Load3DAssets=%f\n", + sprintf(Buf,"Texture=%f, Anim=%f, CreateRobj=%f, Load3DAssets=%f", ((double)Total_Get_Texture_Time/(double)(freq64)*1000.0), ((double)Total_Get_HAnim_Time/(double)(freq64)*1000.0), ((double)Total_Create_Render_Obj_Time/(double)(freq64)*1000.0), @@ -4231,7 +4231,7 @@ void GameLogic::prepareLogicForObjectLoad( void ) // there should be no objects anywhere DEBUG_ASSERTCRASH( getFirstObject() == NULL, - ("GameLogic::prepareLogicForObjectLoad - There are still objects loaded in the engine, but it should be empty (Top is '%s')\n", + ("GameLogic::prepareLogicForObjectLoad - There are still objects loaded in the engine, but it should be empty (Top is '%s')", getFirstObject()->getTemplate()->getName().str()) ); } // end prepareLogicForObjectLoad diff --git a/Generals/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp b/Generals/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp index 99c6115c0f..1d80df9e3e 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp @@ -2128,7 +2128,7 @@ UnsignedShort ConnectionManager::sendFileAnnounce(AsciiString path, UnsignedByte if (!theFile || !theFile->size()) { UnicodeString log; - log.format(L"Not sending file '%hs' to %X\n", path.str(), playerMask); + log.format(L"Not sending file '%hs' to %X", path.str(), playerMask); DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%ls", log.str())); if (TheLAN) TheLAN->OnChat(UnicodeString(L"sendFile"), 0, log, LANAPI::LANCHAT_SYSTEM); @@ -2166,7 +2166,7 @@ void ConnectionManager::sendFile(AsciiString path, UnsignedByte playerMask, Unsi if (!theFile || !theFile->size()) { UnicodeString log; - log.format(L"Not sending file '%hs' to %X\n", path.str(), playerMask); + log.format(L"Not sending file '%hs' to %X", path.str(), playerMask); DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%ls", log.str())); if (TheLAN) TheLAN->OnChat(UnicodeString(L"sendFile"), 0, log, LANAPI::LANCHAT_SYSTEM); diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GameInfo.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GameInfo.cpp index 95cc2fd0af..26fb2275d6 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GameInfo.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GameInfo.cpp @@ -960,7 +960,7 @@ AsciiString GameInfoToAsciiString( const GameInfo *game ) optionsString.concat(';'); DEBUG_ASSERTCRASH(!TheLAN || (optionsString.getLength() < m_lanMaxOptionsLength), - ("WARNING: options string is longer than expected! Length is %d, but max is %d!\n", + ("WARNING: options string is longer than expected! Length is %d, but max is %d!", optionsString.getLength(), m_lanMaxOptionsLength)); return optionsString; diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 1a97f7b271..e79796f182 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -160,10 +160,10 @@ void LogClass::dumpMatrix3D(const Matrix3D *m, AsciiString name, AsciiString fna fname.toLower(); fname = fname.reverseFind('\\') + 1; const Real *matrix = (const Real *)m; - log("dumpMatrix3D() %s:%d %s\n", + log("dumpMatrix3D() %s:%d %s", fname.str(), line, name.str()); for (Int i=0; i<3; ++i) - log(" 0x%08X 0x%08X 0x%08X 0x%08X\n", + log(" 0x%08X 0x%08X 0x%08X 0x%08X", AS_INT(matrix[(i<<2)+0]), AS_INT(matrix[(i<<2)+1]), AS_INT(matrix[(i<<2)+2]), AS_INT(matrix[(i<<2)+3])); } @@ -173,7 +173,7 @@ void LogClass::dumpReal(Real r, AsciiString name, AsciiString fname, Int line) return; fname.toLower(); fname = fname.reverseFind('\\') + 1; - log("dumpReal() %s:%d %s %8.8X (%f)\n", + log("dumpReal() %s:%d %s %8.8X (%f)", fname.str(), line, name.str(), AS_INT(r), r); } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp index c7ff411951..6f990e92e2 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp @@ -1959,7 +1959,7 @@ TextureClass *WorldHeightMap::getTerrainTexture(void) m_terrainTex = MSGNEW("WorldHeightMap_getTerrainTexture") TerrainTextureClass(pow2Height); m_terrainTexHeight = m_terrainTex->update(this); char buf[64]; - sprintf(buf, "Base tex height %d\n", pow2Height); + sprintf(buf, "Base tex height %d", pow2Height); DEBUG_LOG((buf)); REF_PTR_RELEASE(m_alphaTerrainTex); m_alphaTerrainTex = MSGNEW("WorldHeightMap_getTerrainTexture") AlphaTerrainTextureClass(m_terrainTex); diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp index fb382bed1d..c731064a32 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp @@ -1265,7 +1265,7 @@ void WW3DAssetManager::Log_All_Textures(void) WWDEBUG_SAY(( "Lightmap textures: %d\n\n" "size name\n" - "--------------------------------------\n" + "--------------------------------------" , TextureClass::_Get_Total_Lightmap_Texture_Count())); @@ -1289,7 +1289,7 @@ void WW3DAssetManager::Log_All_Textures(void) WWDEBUG_SAY(( "Procedural textures: %d\n\n" "size name\n" - "--------------------------------------\n" + "--------------------------------------" , TextureClass::_Get_Total_Procedural_Texture_Count())); @@ -1313,7 +1313,7 @@ void WW3DAssetManager::Log_All_Textures(void) WWDEBUG_SAY(( "Ordinary textures: %d\n\n" "size name\n" - "--------------------------------------\n" + "--------------------------------------" , TextureClass::_Get_Total_Texture_Count()-TextureClass::_Get_Total_Lightmap_Texture_Count()-TextureClass::_Get_Total_Procedural_Texture_Count())); diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp index 08ed647b20..ea97b86afc 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp @@ -63,7 +63,7 @@ DDSFileClass::DDSFileClass(const char* name,unsigned reduction_factor) int result=file->Open(); if (!result) { - WWASSERT("File would not open\n"); + WWASSERT("File would not open"); return; } @@ -73,7 +73,7 @@ DDSFileClass::DDSFileClass(const char* name,unsigned reduction_factor) unsigned read_bytes=file->Read(header,4); if (!read_bytes) { - WWASSERT("File loading failed trying to read header\n"); + WWASSERT("File loading failed trying to read header"); return; } // Now, we read DDSURFACEDESC2 defining the compressed data @@ -82,7 +82,7 @@ DDSFileClass::DDSFileClass(const char* name,unsigned reduction_factor) if (read_bytes==0 || read_bytes!=SurfaceDesc.Size) { StringClass tmp(0,true); - tmp.Format("File %s loading failed.\nTried to read %d bytes, got %d. (SurfDesc.size=%d)\n",name,sizeof(LegacyDDSURFACEDESC2),read_bytes,SurfaceDesc.Size); + tmp.Format("File %s loading failed.\nTried to read %d bytes, got %d. (SurfDesc.size=%d)",name,sizeof(LegacyDDSURFACEDESC2),read_bytes,SurfaceDesc.Size); WWASSERT_PRINT(0,tmp.str()); return; } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp index ee67223b99..2d72f3a4ec 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp @@ -326,19 +326,19 @@ void DX8TextureCategoryClass::Log(bool only_visible) { #ifdef ENABLE_CATEGORY_LOG StringClass work(255,true); - work.Format(" DX8TextureCategoryClass\n"); + work.Format(" DX8TextureCategoryClass"); WWDEBUG_SAY((work)); StringClass work2(255,true); for (int stage=0;stageGet_Name() : "-"); + work2.Format("\n texture[%d]: %x (%s)", stage, textures[stage], textures[stage] ? textures[stage]->Get_Name() : "-"); work+=work2; } - work2.Format(" material: %x (%s)\n shader: %x\n", material, material ? material->Get_Name() : "-", shader); + work2.Format("\n material: %x (%s)\n shader: %x", material, material ? material->Get_Name() : "-", shader); work+=work2; WWDEBUG_SAY((work)); - work.Format(" %8s %8s %6s %6s %6s %5s %s\n", + work.Format(" %8s %8s %6s %6s %6s %5s %s", "idx_cnt", "poly_cnt", "i_offs", @@ -715,19 +715,19 @@ void DX8RigidFVFCategoryContainer::Log(bool only_visible) { #ifdef ENABLE_CATEGORY_LOG StringClass work(255,true); - work.Format("DX8RigidFVFCategoryContainer --------------\n"); + work.Format("DX8RigidFVFCategoryContainer --------------"); WWDEBUG_SAY((work)); if (vertex_buffer) { StringClass fvfname(255,true); vertex_buffer->FVF_Info().Get_FVF_Name(fvfname); - work.Format("VB size (used/total): %d/%d FVF: %s\n",used_vertices,vertex_buffer->Get_Vertex_Count(),fvfname); + work.Format("VB size (used/total): %d/%d FVF: %s",used_vertices,vertex_buffer->Get_Vertex_Count(),fvfname); WWDEBUG_SAY((work)); } else { WWDEBUG_SAY(("EMPTY VB")); } if (index_buffer) { - work.Format("IB size (used/total): %d/%d\n",used_indices,index_buffer->Get_Index_Count()); + work.Format("IB size (used/total): %d/%d",used_indices,index_buffer->Get_Index_Count()); WWDEBUG_SAY((work)); } else { @@ -1212,11 +1212,11 @@ void DX8SkinFVFCategoryContainer::Log(bool only_visible) { #ifdef ENABLE_CATEGORY_LOG StringClass work(255,true); - work.Format("DX8SkinFVFCategoryContainer --------------\n"); + work.Format("DX8SkinFVFCategoryContainer --------------"); WWDEBUG_SAY((work)); if (index_buffer) { - work.Format("IB size (used/total): %d/%d\n",used_indices,index_buffer->Get_Index_Count()); + work.Format("IB size (used/total): %d/%d",used_indices,index_buffer->Get_Index_Count()); WWDEBUG_SAY((work)); } else { diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp index 5fbd20fe18..396df30fb6 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp @@ -344,8 +344,8 @@ void ShaderClass::Report_Unable_To_Fog (const char *source) #ifdef WWDEBUG static unsigned _reportcount = 0; - const char *unabletofogtext = "WARNING: Unable to fog shader in %s with given blending mode.\r\n"; - const char *unabletofogmoretext = "WARNING: Unable to fog additional shaders (further warnings will be suppressed).\r\n"; + const char *unabletofogtext = "WARNING: Unable to fog shader in %s with given blending mode."; + const char *unabletofogmoretext = "WARNING: Unable to fog additional shaders (further warnings will be suppressed)."; const unsigned maxreportcount = 10; // Limit the no. of warning messages to some practical maximum. Suppress all subsequent warnings. diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp index 9463abdd46..b01f96be44 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp @@ -806,7 +806,7 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, f SNAPSHOT_SAY(("==========================================")); SNAPSHOT_SAY(("========== WW3D::Begin_Render ============")); - SNAPSHOT_SAY(("==========================================\r\n")); + SNAPSHOT_SAY(("==========================================\n")); if (DX8Wrapper::_Get_D3D_Device8() && (hr=DX8Wrapper::_Get_D3D_Device8()->TestCooperativeLevel()) != D3D_OK) { @@ -1114,7 +1114,7 @@ WW3DErrorType WW3D::End_Render(bool flip_frame) SNAPSHOT_SAY(("==========================================")); SNAPSHOT_SAY(("========== WW3D::End_Render ==============")); - SNAPSHOT_SAY(("==========================================\r\n")); + SNAPSHOT_SAY(("==========================================\n")); Activate_Snapshot(false); diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CRCDebug.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CRCDebug.cpp index c47b561516..01bdfe816d 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/CRCDebug.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/CRCDebug.cpp @@ -279,7 +279,7 @@ void dumpVector3(const Vector3 *v, AsciiString name, AsciiString fname, Int line if (!(IS_FRAME_OK_TO_LOG)) return; fname.toLower(); fname = getFname(fname); - addCRCDebugLine("dumpVector3() %s:%d %s %8.8X %8.8X %8.8X\n", + addCRCDebugLine("dumpVector3() %s:%d %s %8.8X %8.8X %8.8X", fname.str(), line, name.str(), AS_INT(v->X), AS_INT(v->Y), AS_INT(v->Z)); } @@ -289,7 +289,7 @@ void dumpCoord3D(const Coord3D *c, AsciiString name, AsciiString fname, Int line if (!(IS_FRAME_OK_TO_LOG)) return; fname.toLower(); fname = getFname(fname); - addCRCDebugLine("dumpCoord3D() %s:%d %s %8.8X %8.8X %8.8X\n", + addCRCDebugLine("dumpCoord3D() %s:%d %s %8.8X %8.8X %8.8X", fname.str(), line, name.str(), AS_INT(c->x), AS_INT(c->y), AS_INT(c->z)); } @@ -300,10 +300,10 @@ void dumpMatrix3D(const Matrix3D *m, AsciiString name, AsciiString fname, Int li fname.toLower(); fname = getFname(fname); const Real *matrix = (const Real *)m; - addCRCDebugLine("dumpMatrix3D() %s:%d %s\n", + addCRCDebugLine("dumpMatrix3D() %s:%d %s", fname.str(), line, name.str()); for (Int i=0; i<3; ++i) - addCRCDebugLine(" 0x%08X 0x%08X 0x%08X 0x%08X\n", + addCRCDebugLine(" 0x%08X 0x%08X 0x%08X 0x%08X", AS_INT(matrix[(i<<2)+0]), AS_INT(matrix[(i<<2)+1]), AS_INT(matrix[(i<<2)+2]), AS_INT(matrix[(i<<2)+3])); } @@ -312,7 +312,7 @@ void dumpReal(Real r, AsciiString name, AsciiString fname, Int line) if (!(IS_FRAME_OK_TO_LOG)) return; fname.toLower(); fname = getFname(fname); - addCRCDebugLine("dumpReal() %s:%d %s %8.8X (%f)\n", + addCRCDebugLine("dumpReal() %s:%d %s %8.8X (%f)", fname.str(), line, name.str(), AS_INT(r), r); } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp index d338266116..701554a983 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp @@ -313,7 +313,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheNameKeyGenerator = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheNameKeyGenerator = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -325,7 +325,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheCommandList = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheCommandList = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -340,7 +340,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheLocalFileSystem = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheLocalFileSystem = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -350,7 +350,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheArchiveFileSystem = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheArchiveFileSystem = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -362,7 +362,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheWritableGlobalData = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheWritableGlobalData = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -405,7 +405,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After water INI's = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After water INI's = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -418,7 +418,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheGameText = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheGameText = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -432,7 +432,7 @@ void GameEngine::init() initSubsystem(TheCDManager,"TheCDManager", CreateCDManager(), NULL); #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheCDManager = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheCDManager = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -442,7 +442,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheAudio = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheAudio = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -459,7 +459,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheParticleSystemManager = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheParticleSystemManager = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -477,7 +477,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheBuildAssistant = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheBuildAssistant = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -488,7 +488,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheThingFactory = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheThingFactory = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -500,7 +500,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheGameClient = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheGameClient = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -519,7 +519,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheVictoryConditions = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheVictoryConditions = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -551,7 +551,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheGameResultsQueue = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheGameResultsQueue = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// @@ -589,7 +589,7 @@ void GameEngine::init() #ifdef DUMP_PERF_STATS/////////////////////////////////////////////////////////////////////////// GetPrecisionTimer(&endTime64);////////////////////////////////////////////////////////////////// - sprintf(Buf,"----------------------------------------------------------------------------After TheMapCache->updateCache = %f seconds \n",((double)(endTime64-startTime64)/(double)(freq64))); + sprintf(Buf,"----------------------------------------------------------------------------After TheMapCache->updateCache = %f seconds",((double)(endTime64-startTime64)/(double)(freq64))); startTime64 = endTime64;//Reset the clock //////////////////////////////////////////////////////// DEBUG_LOG(("%s", Buf));//////////////////////////////////////////////////////////////////////////// #endif///////////////////////////////////////////////////////////////////////////////////////////// diff --git a/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp b/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp index c2fe0ea8df..916ec82024 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp @@ -604,7 +604,7 @@ void PerfTimer::outputInfo( void ) "Average Time (per frame): %.4f ms\n" "Average calls per frame: %.2f\n" "Number of calls: %d\n" - "Max possible FPS: %.4f\n", + "Max possible FPS: %.4f", m_identifier, avgTimePerCall, avgTimePerFrame, @@ -617,7 +617,7 @@ void PerfTimer::outputInfo( void ) "Average Time (per frame): %.4f ms\n" "Average calls per frame: %.2f\n" "Number of calls: %d\n" - "Max possible FPS: %.4f\n", + "Max possible FPS: %.4f", m_identifier, avgTimePerCall, avgTimePerFrame, diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp index 19adb63bef..6c81f789aa 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp @@ -300,7 +300,7 @@ static void memset32(void* ptr, Int value, Int bytesToFill) static void doStackDumpOutput(const char* m) { const char *PREPEND = "STACKTRACE"; - if (*m == 0 || strcmp(m, "\n") == 0) + if (*m == 0) { DEBUG_LOG((m)); } @@ -321,7 +321,6 @@ static void doStackDumpOutput(const char* m) static void doStackDump(void **stacktrace, int size) { ::doStackDumpOutput("Allocation Stack Trace:"); - ::doStackDumpOutput("\n"); ::StackDumpFromAddresses(stacktrace, size, ::doStackDumpOutput); } #endif diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp index 8f02a41d0f..95393778d6 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/Radar.cpp @@ -406,7 +406,7 @@ bool Radar::addObject( Object *obj ) // sanity DEBUG_ASSERTCRASH( obj->friend_getRadarData() == NULL, - ("Radar: addObject - non NULL radar data for '%s'\n", + ("Radar: addObject - non NULL radar data for '%s'", obj->getTemplate()->getName().str()) ); // allocate a new object diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp index 9d17012e84..c0f3e31fa8 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp @@ -622,7 +622,6 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) eip_ptr++; } - strcat (scrap, "\n"); DOUBLE_DEBUG ( ( (scrap))); DEBUG_LOG(( "********** END EXCEPTION DUMP ****************\n" )); } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp index f69b8a08f0..ba8ecfad8c 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp @@ -646,34 +646,34 @@ Module *ModuleFactory::newModule( Thing *thing, const AsciiString& name, const M DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_BODY)) != 0) == (bm->getBody() != NULL), - ("getInterfaceMask bad for MODULE_BODY (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_BODY (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_COLLIDE)) != 0) == (bm->getCollide() != NULL), - ("getInterfaceMask bad for MODULE_COLLIDE (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_COLLIDE (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_CONTAIN)) != 0) == (bm->getContain() != NULL), - ("getInterfaceMask bad for MODULE_CONTAIN (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_CONTAIN (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_CREATE)) != 0) == (bm->getCreate() != NULL), - ("getInterfaceMask bad for MODULE_CREATE (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_CREATE (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_DAMAGE)) != 0) == (bm->getDamage() != NULL), - ("getInterfaceMask bad for MODULE_DAMAGE (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_DAMAGE (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_DESTROY)) != 0) == (bm->getDestroy() != NULL), - ("getInterfaceMask bad for MODULE_DESTROY (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_DESTROY (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_DIE)) != 0) == (bm->getDie() != NULL), - ("getInterfaceMask bad for MODULE_DIE (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_DIE (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_SPECIAL_POWER)) != 0) == (bm->getSpecialPower() != NULL), - ("getInterfaceMask bad for MODULE_SPECIAL_POWER (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_SPECIAL_POWER (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_UPDATE)) != 0) == (bm->getUpdate() != NULL), - ("getInterfaceMask bad for MODULE_UPDATE (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_UPDATE (%s)",name.str())); DEBUG_ASSERTCRASH( ((mt->m_whichInterfaces & (MODULEINTERFACE_UPGRADE)) != 0) == (bm->getUpgrade() != NULL), - ("getInterfaceMask bad for MODULE_UPGRADE (%s)\n",name.str())); + ("getInterfaceMask bad for MODULE_UPGRADE (%s)",name.str())); } #endif diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp index 56f48f1286..5f91e3c2fb 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp @@ -173,7 +173,7 @@ ThingTemplate* ThingFactory::newOverride( ThingTemplate *thingTemplate ) // sanity just for debuging, the weapon must be in the master list to do overrides DEBUG_ASSERTCRASH( findTemplate( thingTemplate->getName() ) != NULL, - ("newOverride(): Thing template '%s' not in master list\n", + ("newOverride(): Thing template '%s' not in master list", thingTemplate->getName().str()) ); // find final override of the 'parent' template diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp index 2f3fe11038..db57cced0b 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -314,7 +314,7 @@ void ModuleInfo::addModuleInfo(ThingTemplate *thingTemplate, // compare this nugget tag against the tag for the new data we're going to submit DEBUG_ASSERTCRASH( nugget->m_moduleTag != moduleTag, - ("addModuleInfo - ERROR defining module '%s' on thing template '%s'. The module '%s' has the tag '%s' which must be unique among all modules for this object, but the tag '%s' is also already on module '%s' within this object.\n\nPlease make unique tag names within an object definition\n", + ("addModuleInfo - ERROR defining module '%s' on thing template '%s'. The module '%s' has the tag '%s' which must be unique among all modules for this object, but the tag '%s' is also already on module '%s' within this object.\n\nPlease make unique tag names within an object definition", name.str(), thingTemplate->getName().str(), name.str(), @@ -332,7 +332,7 @@ void ModuleInfo::addModuleInfo(ThingTemplate *thingTemplate, // compare this nugget tag against the tag for the new data we're going to submit DEBUG_ASSERTCRASH( nugget->m_moduleTag != moduleTag, - ("addModuleInfo - ERROR defining module '%s' on thing template '%s'. The module '%s' has the tag '%s' which must be unique among all modules for this object, but the tag '%s' is also already on module '%s' within this object.\n\nPlease make unique tag names within an object definition\n", + ("addModuleInfo - ERROR defining module '%s' on thing template '%s'. The module '%s' has the tag '%s' which must be unique among all modules for this object, but the tag '%s' is also already on module '%s' within this object.\n\nPlease make unique tag names within an object definition", name.str(), thingTemplate->getName().str(), name.str(), @@ -350,7 +350,7 @@ void ModuleInfo::addModuleInfo(ThingTemplate *thingTemplate, // compare this nugget tag against the tag for the new data we're going to submit DEBUG_ASSERTCRASH( nugget->m_moduleTag != moduleTag, - ("addModuleInfo - ERROR defining module '%s' on thing template '%s'. The module '%s' has the tag '%s' which must be unique among all modules for this object, but the tag '%s' is also already on module '%s' within this object.\n\nPlease make unique tag names within an object definition\n", + ("addModuleInfo - ERROR defining module '%s' on thing template '%s'. The module '%s' has the tag '%s' which must be unique among all modules for this object, but the tag '%s' is also already on module '%s' within this object.\n\nPlease make unique tag names within an object definition", name.str(), thingTemplate->getName().str(), name.str(), diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp index cc2bfd10b9..fcf844ca2d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp @@ -216,7 +216,7 @@ static const char *drawableIconIndexToName( DrawableIconType iconIndex ) { DEBUG_ASSERTCRASH( iconIndex >= ICON_FIRST && iconIndex < MAX_ICONS, - ("drawableIconIndexToName - Illegal index '%d'\n", iconIndex) ); + ("drawableIconIndexToName - Illegal index '%d'", iconIndex) ); return TheDrawableIconNames[ iconIndex ]; @@ -4827,7 +4827,7 @@ void Drawable::xferDrawableModules( Xfer *xfer ) // write module identifier moduleIdentifier = TheNameKeyGenerator->keyToName( (*m)->getModuleTagNameKey() ); DEBUG_ASSERTCRASH( moduleIdentifier != AsciiString::TheEmptyString, - ("Drawable::xferDrawableModules - module name key does not translate to a string!\n") ); + ("Drawable::xferDrawableModules - module name key does not translate to a string!") ); xfer->xferAsciiString( &moduleIdentifier ); // begin data block @@ -5188,7 +5188,7 @@ void Drawable::xfer( Xfer *xfer ) // sanity, we don't write old versions we can only read them DEBUG_ASSERTCRASH( xfer->getXferMode() == XFER_LOAD, - ("Drawable::xfer - Writing an old format!!!\n") ); + ("Drawable::xfer - Writing an old format!!!") ); // condition state, note that when we're loading we need to force a replace of these flags m_conditionState.xfer( xfer ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp index a4bf12485f..ca256f4bf5 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp @@ -884,7 +884,7 @@ void ControlBar::updateContextCommand( void ) // sanity, check like commands should have windows that are check like as well DEBUG_ASSERTCRASH( BitIsSet( win->winGetStatus(), WIN_STATUS_CHECK_LIKE ), - ("updateContextCommand: Error, gadget window for command '%s' is not check-like!\n", + ("updateContextCommand: Error, gadget window for command '%s' is not check-like!", command->getName().str()) ); if( availability == COMMAND_ACTIVE ) @@ -1405,7 +1405,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com { // sanity DEBUG_ASSERTCRASH( command->getSpecialPowerTemplate() != NULL, - ("The special power in the command '%s' is NULL\n", command->getName().str()) ); + ("The special power in the command '%s' is NULL", command->getName().str()) ); // get special power module from the object to execute it SpecialPowerModuleInterface *mod = obj->getSpecialPowerModule( command->getSpecialPowerTemplate() ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp index 83bf217496..64e4d3cd90 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp @@ -225,7 +225,7 @@ void ControlBar::populateMultiSelect( void ) // sanity DEBUG_ASSERTCRASH( TheInGameUI->getSelectCount() > 1, - ("populateMultiSelect: Can't populate multiselect context cause there are only '%d' things selected\n", + ("populateMultiSelect: Can't populate multiselect context cause there are only '%d' things selected", TheInGameUI->getSelectCount()) ); // get the list of drawable IDs from the in game UI @@ -306,7 +306,7 @@ void ControlBar::updateContextMultiSelect( void ) // santiy DEBUG_ASSERTCRASH( TheInGameUI->getSelectCount() > 1, - ("updateContextMultiSelect: TheInGameUI only has '%d' things selected\n", + ("updateContextMultiSelect: TheInGameUI only has '%d' things selected", TheInGameUI->getSelectCount()) ); // get the list of drawable IDs from the in game UI diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp index 9d713387f7..a9fe3dc3cd 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp @@ -612,7 +612,7 @@ WindowMsgHandledType SaveLoadMenuSystem( GameWindow *window, UnsignedInt msg, // sanity DEBUG_ASSERTCRASH( currentLayoutType == SLLT_SAVE_AND_LOAD || currentLayoutType == SLLT_SAVE_ONLY, - ("SaveLoadMenuSystem - layout type '%d' does not allow saving\n", + ("SaveLoadMenuSystem - layout type '%d' does not allow saving", currentLayoutType) ); // get save file info diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp index 7d96774f3a..5034cf20f3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp @@ -1470,7 +1470,7 @@ Int GameWindowManager::winDestroy( GameWindow *window ) // completely handled by the editor ONLY // DEBUG_ASSERTCRASH( window->winGetEditData() == NULL, - ("winDestroy(): edit data should NOT be present!\n") ); + ("winDestroy(): edit data should NOT be present!") ); if( BitIsSet( window->m_status, WIN_STATUS_DESTROYED ) ) return WIN_ERR_OK; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp index 55faa78a4a..d8967a5b4d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp @@ -654,7 +654,7 @@ void Shell::unlinkScreen( WindowLayout *screen ) return; DEBUG_ASSERTCRASH( m_screenStack[ m_screenCount - 1 ] == screen, - ("Screen not on top of stack\n") ); + ("Screen not on top of stack") ); // remove reference to screen and decrease count if( m_screenStack[ m_screenCount - 1 ] == screen ) @@ -738,7 +738,7 @@ void Shell::shutdownComplete( WindowLayout *screen, Bool impendingPush ) // there should never be a pending push AND pop operation DEBUG_ASSERTCRASH( m_pendingPush == FALSE || m_pendingPop == FALSE, - ("There is a pending push AND pop in the shell. Not allowed!\n") ); + ("There is a pending push AND pop in the shell. Not allowed!") ); // Reset the AnimateWindowManager m_animateWindowManager->reset(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index abf9b47854..c21346a3c3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -3245,7 +3245,7 @@ void InGameUI::deselectDrawable( Drawable *draw ) // sanity DEBUG_ASSERTCRASH( findIt != m_selectedDrawables.end(), - ("deselectDrawable: Drawable not found in the selected drawable list '%s'\n", + ("deselectDrawable: Drawable not found in the selected drawable list '%s'", draw->getTemplate()->getName().str()) ); // remove it from the selected drawable list diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp index 1daed61fe7..c680a5a995 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/Anim2D.cpp @@ -267,7 +267,7 @@ const Image* Anim2DTemplate::getFrame( UnsignedShort frameNumber ) const // sanity DEBUG_ASSERTCRASH( m_images != NULL, - ("Anim2DTemplate::getFrame - Image data is NULL for animation '%s'\n", + ("Anim2DTemplate::getFrame - Image data is NULL for animation '%s'", getName().str()) ); // sanity @@ -363,12 +363,12 @@ void Anim2D::setCurrentFrame( UnsignedShort frame ) // sanity DEBUG_ASSERTCRASH( TheGameLogic != NULL, - ("Anim2D::setCurrentFrame - TheGameLogic must exist to use animation instances (%s)\n", + ("Anim2D::setCurrentFrame - TheGameLogic must exist to use animation instances (%s)", m_template->getName().str()) ); // sanity DEBUG_ASSERTCRASH( frame >= 0 && frame < m_template->getNumFrames(), - ("Anim2D::setCurrentFrame - Illegal frame number '%d' in animation\n", + ("Anim2D::setCurrentFrame - Illegal frame number '%d' in animation", frame, m_template->getName().str()) ); // set the frame @@ -438,7 +438,7 @@ void Anim2D::tryNextFrame( void ) // sanity DEBUG_ASSERTCRASH( TheGameLogic != NULL, - ("Anim2D::tryNextFrame - TheGameLogic must exist to use animation instances (%s)\n", + ("Anim2D::tryNextFrame - TheGameLogic must exist to use animation instances (%s)", m_template->getName().str()) ); // how many frames have passed since our last update @@ -841,7 +841,7 @@ void Anim2DCollection::registerAnimation( Anim2D *anim ) // sanity DEBUG_ASSERTCRASH( anim->m_collectionSystemNext == NULL && anim->m_collectionSystemPrev == NULL, - ("Registering animation instance, instance '%s' is already in a system\n", + ("Registering animation instance, instance '%s' is already in a system", anim->getAnimTemplate()->getName().str()) ); // tie to our list diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp index 16e0859bec..127931fe66 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp @@ -2314,7 +2314,7 @@ void AIPlayer::repairStructure(ObjectID structure) void AIPlayer::selectSkillset(Int skillset) { DEBUG_ASSERTCRASH(m_skillsetSelector == INVALID_SKILLSET_SELECTION, - ("Selecting a skill set (%d) after one has already been chosen (%d) means some points have been incorrectly spent.\n", skillset + 1, m_skillsetSelector + 1)); + ("Selecting a skill set (%d) after one has already been chosen (%d) means some points have been incorrectly spent.", skillset + 1, m_skillsetSelector + 1)); m_skillsetSelector = skillset; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp index 18473d29c2..e00198282e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/BridgeBehavior.cpp @@ -1145,7 +1145,7 @@ void BridgeBehavior::createScaffolding( void ) // sanity DEBUG_ASSERTCRASH( scaffoldObjectsCreated < numObjects, - ("Creating too many scaffold objects\n") ); + ("Creating too many scaffold objects") ); // create object obj = TheThingFactory->newObject( scaffoldTemplate, us->getTeam() ); @@ -1213,7 +1213,7 @@ void BridgeBehavior::createScaffolding( void ) // sanity DEBUG_ASSERTCRASH( scaffoldObjectsCreated < numObjects, - ("Creating too many scaffold objects\n") ); + ("Creating too many scaffold objects") ); // create new object obj = TheThingFactory->newObject( scaffoldTemplate, us->getTeam() ); @@ -1452,7 +1452,7 @@ void BridgeBehavior::xfer( Xfer *xfer ) // read all object IDs DEBUG_ASSERTCRASH( m_scaffoldObjectIDList.size() == 0, - ("BridgeBehavior::xfer - scaffold object list should be empty\n") ); + ("BridgeBehavior::xfer - scaffold object list should be empty") ); for( Int i = 0; i < scaffoldObjectCount; ++i ) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp index 22557d8285..7a82d3600e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp @@ -1047,7 +1047,7 @@ void ActiveBody::createParticleSystems( const AsciiString &boneBaseName, // sanity DEBUG_ASSERTCRASH( j != numBones, - ("ActiveBody::createParticleSystems, Unable to select particle system index\n") ); + ("ActiveBody::createParticleSystems, Unable to select particle system index") ); // create particle system here ParticleSystem *particleSystem = TheParticleSystemManager->createParticleSystem( systemTemplate ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp index 6003c17ffd..a6cc0c1a9a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/FireWeaponCollide.cpp @@ -146,7 +146,7 @@ void FireWeaponCollide::xfer( Xfer *xfer ) { DEBUG_ASSERTCRASH( m_collideWeapon != NULL, - ("FireWeaponCollide::xfer - m_collideWeapon present mismatch\n") ); + ("FireWeaponCollide::xfer - m_collideWeapon present mismatch") ); xfer->xferSnapshot( m_collideWeapon ); } // end else @@ -154,7 +154,7 @@ void FireWeaponCollide::xfer( Xfer *xfer ) { DEBUG_ASSERTCRASH( m_collideWeapon == NULL, - ("FireWeaponCollide::Xfer - m_collideWeapon missing mismatch\n" )); + ("FireWeaponCollide::Xfer - m_collideWeapon missing mismatch" )); } // end else diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp index f5f09b4860..0d724987c8 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/GarrisonContain.cpp @@ -415,7 +415,7 @@ void GarrisonContain::putObjectAtBestGarrisonPoint( Object *obj, Object *target, // get the index of the garrison point that is closest to the target position Int placeIndex = findClosestFreeGarrisonPointIndex( conditionIndex, targetPos ); DEBUG_ASSERTCRASH( placeIndex != GARRISON_INDEX_INVALID, - ("GarrisonContain::putObjectAtBestGarrisonPoint - Unable to find suitable garrison point for '%s'\n", + ("GarrisonContain::putObjectAtBestGarrisonPoint - Unable to find suitable garrison point for '%s'", obj->getTemplate()->getName().str()) ); // put it here @@ -961,7 +961,7 @@ UpdateSleepTime GarrisonContain::update( void ) { // sanity information DEBUG_ASSERTCRASH( getObject()->isMobile() == FALSE, - ("GarrisonContain::update - Objects with garrison contain can be spec'd as 'mobile' in the INI. Do you really want to do this? \n") ); + ("GarrisonContain::update - Objects with garrison contain can be spec'd as 'mobile' in the INI. Do you really want to do this?") ); } return UPDATE_SLEEP_NONE; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp index 18e21b1594..04b9993d8c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp @@ -171,12 +171,12 @@ OpenContain::~OpenContain() // sanity, the system should be cleaning these up itself if all is going well DEBUG_ASSERTCRASH( m_containList.empty(), - ("OpenContain %s: destroying a container that still has items in it!\n", + ("OpenContain %s: destroying a container that still has items in it!", getObject()->getTemplate()->getName().str() ) ); // sanity DEBUG_ASSERTCRASH( m_xferContainIDList.empty(), - ("OpenContain %s: m_xferContainIDList is not empty but should be\n", + ("OpenContain %s: m_xferContainIDList is not empty but should be", getObject()->getTemplate()->getName().str() ) ); } @@ -1885,7 +1885,7 @@ void OpenContain::loadPostProcess( void ) // sanity DEBUG_ASSERTCRASH( m_containListSize == m_containList.size(), - ("OpenContain::loadPostProcess - contain list count mismatch\n") ); + ("OpenContain::loadPostProcess - contain list count mismatch") ); // clear the list as we don't need it anymore m_xferContainIDList.clear(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 06177a7459..077d7cbb45 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -3969,7 +3969,7 @@ void Object::crc( Xfer *xfer ) #ifdef DEBUG_CRC if (doLogging) { - tmp.format("damage scalar: %g/%8.8X\n", scalar, AS_INT(scalar)); + tmp.format("damage scalar: %g/%8.8X", scalar, AS_INT(scalar)); logString.concat(tmp); CRCDEBUG_LOG(("%s", logString.str())); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index bec04efb04..239d7add25 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -1618,7 +1618,7 @@ ObjectShroudStatus PartitionData::getShroudedStatus(Int playerIndex) { // sanity DEBUG_ASSERTCRASH( playerIndex >= 0 && playerIndex < MAX_PLAYER_COUNT, - ("PartitionData::getShroudedStatus - Invalid player index '%d'\n", playerIndex) ); + ("PartitionData::getShroudedStatus - Invalid player index '%d'", playerIndex) ); if (!ThePartitionManager->getUpdatedSinceLastReset()) { @@ -3923,7 +3923,7 @@ Bool PartitionManager::findPositionAround( const Coord3D *center, // sanity, FPF_IGNORE_WATER and FPF_WATER_ONLY are mutually exclusive DEBUG_ASSERTCRASH( !(BitIsSet( options->flags, FPF_IGNORE_WATER ) == TRUE && BitIsSet( options->flags, FPF_WATER_ONLY ) == TRUE), - ("PartitionManager::findPositionAround - The options FPF_WATER_ONLY and FPF_IGNORE_WATER are mutually exclusive. You cannot use them together\n") ); + ("PartitionManager::findPositionAround - The options FPF_WATER_ONLY and FPF_IGNORE_WATER are mutually exclusive. You cannot use them together") ); // pick a random angle from the center location to start at Real startAngle; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index fda1536911..ea1e2f8c2a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -1930,7 +1930,7 @@ Bool AIUpdateInterface::computeAttackPath( PathfindServicesInterface *pathServic weapon->computeApproachTarget(getObject(), victim, &localVictimPos, 0, localVictimPos); //DEBUG_ASSERTCRASH(weapon->isGoalPosWithinAttackRange(getObject(), &localVictimPos, victim, victimPos, NULL), - // ("position we just calced is not acceptable\n")); + // ("position we just calced is not acceptable")); // First, see if our path already goes to the destination. if (m_path) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp index 7eddc22092..72cb2676ee 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp @@ -1646,7 +1646,7 @@ Object *DozerAIUpdate::construct( const ThingTemplate *what, // sanity DEBUG_ASSERTCRASH( getObject()->getControllingPlayer() == owningPlayer, - ("Dozer::Construct - The controlling player of the Dozer is not the owning player passed in\n") ); + ("Dozer::Construct - The controlling player of the Dozer is not the owning player passed in") ); // if we're not rebuilding, we have a few checks to pass first for sanity if( isRebuild == FALSE ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp index a05b36a8cc..c29bb820c2 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/POWTruckAIUpdate.cpp @@ -510,7 +510,7 @@ static void putContainedInPrison( Object *obj, void *userData ) // sanity DEBUG_ASSERTCRASH( returnData != NULL && returnData->source != NULL && returnData->dest != NULL, - ("putContainedInPrison: Invalid arguments\n") ); + ("putContainedInPrison: Invalid arguments") ); // take 'obj' out of the source ContainModuleInterface *sourceContain = returnData->source->getContain(); @@ -729,7 +729,7 @@ static void putPrisonersInPrison( Object *obj, void *userData ) // sanity DEBUG_ASSERTCRASH( prison, ("putPrisonersInPrison: NULL user data") ); DEBUG_ASSERTCRASH( obj->getContainedBy() != NULL, - ("putPrisonersInPrison: Prisoner '%s' is not contained by anything, it should be contained by a POW truck\n", + ("putPrisonersInPrison: Prisoner '%s' is not contained by anything, it should be contained by a POW truck", obj->getTemplate()->getName().str()) ); // extra super sanity, just so that we don't crash ... this is in the assert above @@ -774,12 +774,12 @@ void POWTruckAIUpdate::unloadPrisonersToPrison( Object *prison ) DEBUG_ASSERTCRASH( prison->getContain(), ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain", prison->getTemplate()->getName().str()) ); DEBUG_ASSERTCRASH( prison->getContain()->asOpenContain(), - ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain\n", + ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain", prison->getTemplate()->getName().str()) ); DEBUG_ASSERTCRASH( truckContain, ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no contain", us->getTemplate()->getName().str()) ); DEBUG_ASSERTCRASH( truckContain->asOpenContain(), - ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain\n", + ("POWTruckAIUpdate::unloadPrisonersToPrison - '%s' has no OPEN contain", us->getTemplate()->getName().str()) ); // put the prisoners in the prison diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp index dd838175ca..b8d9af6a6a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailedTransportAIUpdate.cpp @@ -171,7 +171,7 @@ void RailedTransportAIUpdate::pickAndMoveToInitialLocation( void ) // a path must have been found DEBUG_ASSERTCRASH( closestPath != INVALID_PATH, - ("No suitable starting waypoint path could be found for '%s'\n", + ("No suitable starting waypoint path could be found for '%s'", us->getTemplate()->getName().str()) ); // follow the waypoint path to its destination end point @@ -221,7 +221,7 @@ UpdateSleepTime RailedTransportAIUpdate::update( void ) // sanity DEBUG_ASSERTCRASH( m_currentPath != INVALID_PATH, - ("RailedTransportAIUpdate: Invalid current path '%s'\n", m_currentPath) ); + ("RailedTransportAIUpdate: Invalid current path '%s'", m_currentPath) ); // get our target waypoint Waypoint *waypoint = TheTerrainLogic->getWaypointByID( m_path[ m_currentPath ].endWaypointID ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp index 7c58e3a506..40ca443589 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp @@ -347,7 +347,7 @@ Object *WorkerAIUpdate::construct( const ThingTemplate *what, // sanity DEBUG_ASSERTCRASH( getObject()->getControllingPlayer() == owningPlayer, - ("Dozer::Construct - The controlling player of the Dozer is not the owning player passed in\n") ); + ("Dozer::Construct - The controlling player of the Dozer is not the owning player passed in") ); // if we're not rebuilding, we have a few checks to pass first for sanity if( isRebuild == FALSE ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp index 8896d02482..b5dd8fc6f3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp @@ -658,7 +658,7 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update() scorchRadius = logicalLaserRadius * data->m_scorchMarkScalar; #if defined(RETAIL_COMPATIBLE_CRC) DEBUG_ASSERTCRASH(logicalLaserRadius == visualLaserRadius, - ("ParticleUplinkCannonUpdate's laser radius does not match LaserUpdate's laser radius - will cause mismatch in VS6 retail compatible builds\n")); + ("ParticleUplinkCannonUpdate's laser radius does not match LaserUpdate's laser radius - will cause mismatch in VS6 retail compatible builds")); #endif //Create scorch marks periodically diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp index 34928224ea..fcb49bbe23 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp @@ -299,7 +299,7 @@ void AttackPriorityInfo::xfer( Xfer *xfer ) thingTemplate = (*it).first; thingTemplateName = thingTemplate->getName(); DEBUG_ASSERTCRASH( thingTemplateName.isEmpty() == FALSE, - ("AttackPriorityInfo::xfer - Writing an empty thing template name\n") ); + ("AttackPriorityInfo::xfer - Writing an empty thing template name") ); xfer->xferAsciiString( &thingTemplateName ); // write priority @@ -310,7 +310,7 @@ void AttackPriorityInfo::xfer( Xfer *xfer ) // sanity DEBUG_ASSERTCRASH( count == priorityMapCount, - ("AttackPriorityInfo::xfer - Mismatch in priority map size. Size() method returned '%d' but actual iteration count was '%d'\n", + ("AttackPriorityInfo::xfer - Mismatch in priority map size. Size() method returned '%d' but actual iteration count was '%d'", priorityMapCount, count) ); } // end if @@ -7100,14 +7100,14 @@ void ScriptEngine::addObjectToCache(Object* pNewObject) if (it->first == objName) { if (it->second == NULL) { AsciiString newNameForDead; - newNameForDead.format("Reassigning dead object's name '%s' to object (%d) of type '%s'\n", objName.str(), pNewObject->getID(), pNewObject->getTemplate()->getName().str()); + newNameForDead.format("Reassigning dead object's name '%s' to object (%d) of type '%s'", objName.str(), pNewObject->getID(), pNewObject->getTemplate()->getName().str()); TheScriptEngine->AppendDebugMessage(newNameForDead, FALSE); DEBUG_LOG((newNameForDead.str())); it->second = pNewObject; return; } else { DEBUG_CRASH(("Attempting to assign the name '%s' to object (%d) of type '%s'," - " but object (%d) of type '%s' already has that name\n", + " but object (%d) of type '%s' already has that name", objName.str(), pNewObject->getID(), pNewObject->getTemplate()->getName().str(), it->second->getID(), it->second->getTemplate()->getName().str())); return; @@ -8208,7 +8208,7 @@ void SequentialScript::xfer( Xfer *xfer ) // sanity DEBUG_ASSERTCRASH( m_scriptToExecuteSequentially != NULL, - ("SequentialScript::xfer - m_scriptToExecuteSequentially is NULL but should not be\n") ); + ("SequentialScript::xfer - m_scriptToExecuteSequentially is NULL but should not be") ); } // end else, load diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index b486491982..f24bf7b613 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -1332,7 +1332,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); char Buf[256]; - sprintf(Buf,"After terrainlogic->loadmap=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"After terrainlogic->loadmap=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); //DEBUG_LOG(("Placed a starting building for %s at waypoint %s", playerName.str(), waypointName.str())); DEBUG_LOG(("%s", Buf)); #endif @@ -1691,7 +1691,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); - sprintf(Buf,"After terrainlogic->newmap=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"After terrainlogic->newmap=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); DEBUG_LOG(("%s", Buf)); #endif @@ -1791,7 +1791,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); - sprintf(Buf,"Before loading objects=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"Before loading objects=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); DEBUG_LOG(("%s", Buf)); #endif @@ -1962,7 +1962,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); - sprintf(Buf,"After loading objects=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"After loading objects=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); DEBUG_LOG(("%s", Buf)); #endif @@ -2122,7 +2122,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); - sprintf(Buf,"After partition manager update=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"After partition manager update=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); DEBUG_LOG(("%s", Buf)); #endif @@ -2249,7 +2249,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); - sprintf(Buf,"After delete load screen=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"After delete load screen=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); DEBUG_LOG(("%s", Buf)); #endif @@ -2393,7 +2393,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame ) #ifdef DUMP_PERF_STATS GetPrecisionTimer(&endTime64); - sprintf(Buf,"Total startnewgame=%f\n",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); + sprintf(Buf,"Total startnewgame=%f",((double)(endTime64-startTime64)/(double)(freq64)*1000.0)); DEBUG_LOG(("%s", Buf)); #endif @@ -3660,7 +3660,7 @@ void GameLogic::update( void ) __int64 freq64; GetPrecisionTimerTicksPerSec(&freq64); - sprintf(Buf,"Texture=%f, Anim=%f, CreateRobj=%f, Load3DAssets=%f\n", + sprintf(Buf,"Texture=%f, Anim=%f, CreateRobj=%f, Load3DAssets=%f", ((double)Total_Get_Texture_Time/(double)(freq64)*1000.0), ((double)Total_Get_HAnim_Time/(double)(freq64)*1000.0), ((double)Total_Create_Render_Obj_Time/(double)(freq64)*1000.0), @@ -4798,7 +4798,7 @@ void GameLogic::prepareLogicForObjectLoad( void ) // there should be no objects anywhere DEBUG_ASSERTCRASH( getFirstObject() == NULL, - ("GameLogic::prepareLogicForObjectLoad - There are still objects loaded in the engine, but it should be empty (Top is '%s')\n", + ("GameLogic::prepareLogicForObjectLoad - There are still objects loaded in the engine, but it should be empty (Top is '%s')", getFirstObject()->getTemplate()->getName().str()) ); } // end prepareLogicForObjectLoad diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp index eb29cbc75c..f24a576153 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/ConnectionManager.cpp @@ -2114,7 +2114,7 @@ UnsignedShort ConnectionManager::sendFileAnnounce(AsciiString path, UnsignedByte if (!theFile || !theFile->size()) { UnicodeString log; - log.format(L"Not sending file '%hs' to %X\n", path.str(), playerMask); + log.format(L"Not sending file '%hs' to %X", path.str(), playerMask); DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%ls", log.str())); if (TheLAN) TheLAN->OnChat(UnicodeString(L"sendFile"), 0, log, LANAPI::LANCHAT_SYSTEM); @@ -2152,7 +2152,7 @@ void ConnectionManager::sendFile(AsciiString path, UnsignedByte playerMask, Unsi if (!theFile || !theFile->size()) { UnicodeString log; - log.format(L"Not sending file '%hs' to %X\n", path.str(), playerMask); + log.format(L"Not sending file '%hs' to %X", path.str(), playerMask); DEBUG_LOG_LEVEL(DEBUG_LEVEL_NET, ("%ls", log.str())); if (TheLAN) TheLAN->OnChat(UnicodeString(L"sendFile"), 0, log, LANAPI::LANCHAT_SYSTEM); diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp index 70ed82cdf6..4a34ba21fa 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GameInfo.cpp @@ -987,7 +987,7 @@ AsciiString GameInfoToAsciiString( const GameInfo *game ) optionsString.concat(';'); DEBUG_ASSERTCRASH(!TheLAN || (optionsString.getLength() < m_lanMaxOptionsLength), - ("WARNING: options string is longer than expected! Length is %d, but max is %d!\n", + ("WARNING: options string is longer than expected! Length is %d, but max is %d!", optionsString.getLength(), m_lanMaxOptionsLength)); return optionsString; diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 356c6ca9d2..b203cf6168 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -160,10 +160,10 @@ void LogClass::dumpMatrix3D(const Matrix3D *m, AsciiString name, AsciiString fna fname.toLower(); fname = fname.reverseFind('\\') + 1; const Real *matrix = (const Real *)m; - log("dumpMatrix3D() %s:%d %s\n", + log("dumpMatrix3D() %s:%d %s", fname.str(), line, name.str()); for (Int i=0; i<3; ++i) - log(" 0x%08X 0x%08X 0x%08X 0x%08X\n", + log(" 0x%08X 0x%08X 0x%08X 0x%08X", AS_INT(matrix[(i<<2)+0]), AS_INT(matrix[(i<<2)+1]), AS_INT(matrix[(i<<2)+2]), AS_INT(matrix[(i<<2)+3])); } @@ -173,7 +173,7 @@ void LogClass::dumpReal(Real r, AsciiString name, AsciiString fname, Int line) return; fname.toLower(); fname = fname.reverseFind('\\') + 1; - log("dumpReal() %s:%d %s %8.8X (%f)\n", + log("dumpReal() %s:%d %s %8.8X (%f)", fname.str(), line, name.str(), AS_INT(r), r); } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp index 85c6b39648..26ae1a5445 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp @@ -2171,7 +2171,7 @@ TextureClass *WorldHeightMap::getTerrainTexture(void) m_terrainTex = MSGNEW("WorldHeightMap_getTerrainTexture") TerrainTextureClass(pow2Height); m_terrainTexHeight = m_terrainTex->update(this); char buf[64]; - sprintf(buf, "Base tex height %d\n", pow2Height); + sprintf(buf, "Base tex height %d", pow2Height); DEBUG_LOG((buf)); REF_PTR_RELEASE(m_alphaTerrainTex); m_alphaTerrainTex = MSGNEW("WorldHeightMap_getTerrainTexture") AlphaTerrainTextureClass(m_terrainTex); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp index c22fbb321f..92481a6a63 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp @@ -1242,7 +1242,7 @@ void WW3DAssetManager::Log_All_Textures(void) WWDEBUG_SAY(( "Lightmap textures: %d\n\n" "size name\n" - "--------------------------------------\n" + "--------------------------------------" , TextureClass::_Get_Total_Lightmap_Texture_Count())); @@ -1266,7 +1266,7 @@ void WW3DAssetManager::Log_All_Textures(void) WWDEBUG_SAY(( "Procedural textures: %d\n\n" "size name\n" - "--------------------------------------\n" + "--------------------------------------" , TextureClass::_Get_Total_Procedural_Texture_Count())); @@ -1290,7 +1290,7 @@ void WW3DAssetManager::Log_All_Textures(void) WWDEBUG_SAY(( "Ordinary textures: %d\n\n" "size name\n" - "--------------------------------------\n" + "--------------------------------------" , TextureClass::_Get_Total_Texture_Count()-TextureClass::_Get_Total_Lightmap_Texture_Count()-TextureClass::_Get_Total_Procedural_Texture_Count())); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp index 9e8b01c812..251c9f0402 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ddsfile.cpp @@ -63,7 +63,7 @@ DDSFileClass::DDSFileClass(const char* name,unsigned reduction_factor) int result=file->Open(); if (!result) { - WWASSERT("File would not open\n"); + WWASSERT("File would not open"); return; } @@ -73,7 +73,7 @@ DDSFileClass::DDSFileClass(const char* name,unsigned reduction_factor) unsigned read_bytes=file->Read(header,4); if (!read_bytes) { - WWASSERT("File loading failed trying to read header\n"); + WWASSERT("File loading failed trying to read header"); return; } // Now, we read DDSURFACEDESC2 defining the compressed data @@ -82,7 +82,7 @@ DDSFileClass::DDSFileClass(const char* name,unsigned reduction_factor) if (read_bytes==0 || read_bytes!=SurfaceDesc.Size) { StringClass tmp(0,true); - tmp.Format("File %s loading failed.\nTried to read %d bytes, got %d. (SurfDesc.size=%d)\n",name,sizeof(LegacyDDSURFACEDESC2),read_bytes,SurfaceDesc.Size); + tmp.Format("File %s loading failed.\nTried to read %d bytes, got %d. (SurfDesc.size=%d)",name,sizeof(LegacyDDSURFACEDESC2),read_bytes,SurfaceDesc.Size); WWASSERT_PRINT(0,tmp.str()); return; } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp index f08c0e0f80..d466c010d0 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp @@ -370,19 +370,18 @@ void DX8TextureCategoryClass::Log(bool only_visible) { #ifdef ENABLE_CATEGORY_LOG StringClass work(255,true); - work.Format(" DX8TextureCategoryClass\n"); - WWDEBUG_SAY((work)); + work.Format(" DX8TextureCategoryClass"); StringClass work2(255,true); for (int stage=0;stageGet_Name() : "-"); + work2.Format("\n texture[%d]: %x (%s)", stage, textures[stage], textures[stage] ? textures[stage]->Get_Name() : "-"); work+=work2; } - work2.Format(" material: %x (%s)\n shader: %x\n", material, material ? material->Get_Name() : "-", shader); + work2.Format("\n material: %x (%s)\n shader: %x", material, material ? material->Get_Name() : "-", shader); work+=work2; WWDEBUG_SAY((work)); - work.Format(" %8s %8s %6s %6s %6s %5s %s\n", + work.Format(" %8s %8s %6s %6s %6s %5s %s", "idx_cnt", "poly_cnt", "i_offs", @@ -762,19 +761,19 @@ void DX8RigidFVFCategoryContainer::Log(bool only_visible) { #ifdef ENABLE_CATEGORY_LOG StringClass work(255,true); - work.Format("DX8RigidFVFCategoryContainer --------------\n"); + work.Format("DX8RigidFVFCategoryContainer --------------"); WWDEBUG_SAY((work)); if (vertex_buffer) { StringClass fvfname(255,true); vertex_buffer->FVF_Info().Get_FVF_Name(fvfname); - work.Format("VB size (used/total): %d/%d FVF: %s\n",used_vertices,vertex_buffer->Get_Vertex_Count(),fvfname); + work.Format("VB size (used/total): %d/%d FVF: %s",used_vertices,vertex_buffer->Get_Vertex_Count(),fvfname); WWDEBUG_SAY((work)); } else { WWDEBUG_SAY(("EMPTY VB")); } if (index_buffer) { - work.Format("IB size (used/total): %d/%d\n",used_indices,index_buffer->Get_Index_Count()); + work.Format("IB size (used/total): %d/%d",used_indices,index_buffer->Get_Index_Count()); WWDEBUG_SAY((work)); } else { @@ -1271,11 +1270,11 @@ void DX8SkinFVFCategoryContainer::Log(bool only_visible) { #ifdef ENABLE_CATEGORY_LOG StringClass work(255,true); - work.Format("DX8SkinFVFCategoryContainer --------------\n"); + work.Format("DX8SkinFVFCategoryContainer --------------"); WWDEBUG_SAY((work)); if (index_buffer) { - work.Format("IB size (used/total): %d/%d\n",used_indices,index_buffer->Get_Index_Count()); + work.Format("IB size (used/total): %d/%d",used_indices,index_buffer->Get_Index_Count()); WWDEBUG_SAY((work)); } else { diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp index b0ad2ca03d..3bbe984566 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp @@ -344,8 +344,8 @@ void ShaderClass::Report_Unable_To_Fog (const char *source) #ifdef WWDEBUG static unsigned _reportcount = 0; - const char *unabletofogtext = "WARNING: Unable to fog shader in %s with given blending mode.\r\n"; - const char *unabletofogmoretext = "WARNING: Unable to fog additional shaders (further warnings will be suppressed).\r\n"; + const char *unabletofogtext = "WARNING: Unable to fog shader in %s with given blending mode."; + const char *unabletofogmoretext = "WARNING: Unable to fog additional shaders (further warnings will be suppressed)."; const unsigned maxreportcount = 10; // Limit the no. of warning messages to some practical maximum. Suppress all subsequent warnings. diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp index 9a92840763..b1e3b0cf5b 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp @@ -799,7 +799,7 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, f SNAPSHOT_SAY(("==========================================")); SNAPSHOT_SAY(("========== WW3D::Begin_Render ============")); - SNAPSHOT_SAY(("==========================================\r\n")); + SNAPSHOT_SAY(("==========================================\n")); if (DX8Wrapper::_Get_D3D_Device8() && (hr=DX8Wrapper::_Get_D3D_Device8()->TestCooperativeLevel()) != D3D_OK) { @@ -1109,7 +1109,7 @@ WW3DErrorType WW3D::End_Render(bool flip_frame) SNAPSHOT_SAY(("==========================================")); SNAPSHOT_SAY(("========== WW3D::End_Render ==============")); - SNAPSHOT_SAY(("==========================================\r\n")); + SNAPSHOT_SAY(("==========================================\n")); Activate_Snapshot(false); From 62259987ffa914a2227244d687aef09844de06eb Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:37:22 +0200 Subject: [PATCH 12/13] [GEN][ZH] Polish debug logging strings by hand (#1232) --- .../GameEngine/Source/Common/PerfTimer.cpp | 4 +- .../GameEngine/Source/GameClient/InGameUI.cpp | 2 +- .../Source/GameLogic/AI/AIPathfind.cpp | 38 +++++++------------ .../W3DDevice/GameLogic/W3DGhostObject.cpp | 2 +- .../Source/WWVegas/WW3D2/dx8wrapper.cpp | 2 +- .../Source/WWVegas/WW3D2/sortingrenderer.cpp | 2 +- .../GameEngine/Source/Common/PerfTimer.cpp | 4 +- .../GameEngine/Source/GameClient/InGameUI.cpp | 2 +- .../Source/GameLogic/AI/AIPathfind.cpp | 38 +++++++------------ .../W3DDevice/GameLogic/W3DGhostObject.cpp | 2 +- .../Source/WWVegas/WW3D2/dx8wrapper.cpp | 2 +- .../Source/WWVegas/WW3D2/sortingrenderer.cpp | 2 +- 12 files changed, 40 insertions(+), 60 deletions(-) diff --git a/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp b/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp index adb44b6fe6..b8b7ce5976 100644 --- a/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp +++ b/Generals/Code/GameEngine/Source/Common/PerfTimer.cpp @@ -519,7 +519,7 @@ void PerfTimer::outputInfo( void ) #endif if (m_crashWithInfo) { - DEBUG_CRASH(("%s" + DEBUG_CRASH(("%s\n" "Average Time (per call): %.4f ms\n" "Average Time (per frame): %.4f ms\n" "Average calls per frame: %.2f\n" @@ -532,7 +532,7 @@ void PerfTimer::outputInfo( void ) m_callCount, 1000.0f / avgTimePerFrame)); } else { - DEBUG_LOG(("%s" + DEBUG_LOG(("%s\n" "Average Time (per call): %.4f ms\n" "Average Time (per frame): %.4f ms\n" "Average calls per frame: %.2f\n" diff --git a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp index d01aaff9a8..252be5d20a 100644 --- a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -5416,7 +5416,7 @@ void InGameUI::showIdleWorkerLayout( void ) if (!m_idleWorkerWin) { m_idleWorkerWin = TheWindowManager->winGetWindowFromId(NULL, TheNameKeyGenerator->nameToKey("ControlBar.wnd:ButtonIdleWorker")); - DEBUG_ASSERTCRASH(m_idleWorkerWin, ("InGameUI::showIdleWorkerLayout could not find IdleWorker.wnd to load ")); + DEBUG_ASSERTCRASH(m_idleWorkerWin, ("InGameUI::showIdleWorkerLayout could not find IdleWorker.wnd to load")); return; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index f66552edb3..16db420c95 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -1325,7 +1325,7 @@ void PathfindCell::setGoalUnit(ObjectID unitID, const ICoord2D &pos ) allocateInfo(pos); } if (!m_info) { - DEBUG_CRASH(("Ran out of pathfind cells - fatal error!!!!! jba. ")); + DEBUG_CRASH(("Ran out of pathfind cells - fatal error!!!!! jba.")); return; } m_info->m_goalUnitID = unitID; @@ -1361,7 +1361,7 @@ void PathfindCell::setGoalAircraft(ObjectID unitID, const ICoord2D &pos ) allocateInfo(pos); } if (!m_info) { - DEBUG_CRASH(("Ran out of pathfind cells - fatal error!!!!! jba. ")); + DEBUG_CRASH(("Ran out of pathfind cells - fatal error!!!!! jba.")); return; } m_info->m_goalAircraftID = unitID; @@ -1397,7 +1397,7 @@ void PathfindCell::setPosUnit(ObjectID unitID, const ICoord2D &pos ) allocateInfo(pos); } if (!m_info) { - DEBUG_CRASH(("Ran out of pathfind cells - fatal error!!!!! jba. ")); + DEBUG_CRASH(("Ran out of pathfind cells - fatal error!!!!! jba.")); return; } if (m_info->m_goalUnitID!=INVALID_ID && (m_info->m_goalUnitID==m_info->m_posUnitID)) { @@ -5433,9 +5433,8 @@ void Pathfinder::processPathfindQueue(void) timeToUpdate = ((double)(endTime64-startTime64) / (double)(freq64)); if (timeToUpdate>0.01f) { - DEBUG_LOG(("%d Pathfind queue: %d paths, %d cells", TheGameLogic->getFrame(), pathsFound, m_cumulativeCellsAllocated)); - DEBUG_LOG(("Time %f (%f)", timeToUpdate, (::GetTickCount()-startTimeMS)/1000.0f)); - DEBUG_LOG(("")); + DEBUG_LOG(("%d Pathfind queue: %d paths, %d cells --", TheGameLogic->getFrame(), pathsFound, m_cumulativeCellsAllocated)); + DEBUG_LOG(("time %f (%f)", timeToUpdate, (::GetTickCount()-startTimeMS)/1000.0f)); } #endif #endif @@ -6192,8 +6191,7 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe Bool valid; valid = validMovementPosition( isCrusher, obj->getLayer(), locomotorSet, to ) ; - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("Pathfind failed from (%f,%f) to (%f,%f), OV %d", from->x, from->y, to->x, to->y, valid)); + DEBUG_LOG(("%d Pathfind failed from (%f,%f) to (%f,%f), OV %d --", TheGameLogic->getFrame(), from->x, from->y, to->x, to->y, valid)); DEBUG_LOG(("Unit '%s', time %f, cells %d", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f,cellCount)); } #endif @@ -6810,8 +6808,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, } #endif - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("FindGroundPath failed from (%f,%f) to (%f,%f)", from->x, from->y, to->x, to->y)); + DEBUG_LOG(("%d FindGroundPath failed from (%f,%f) to (%f,%f) --", TheGameLogic->getFrame(), from->x, from->y, to->x, to->y)); DEBUG_LOG(("time %f", (::GetTickCount()-startTimeMS)/1000.0f)); #ifdef DUMP_PERF_STATS @@ -7426,8 +7423,7 @@ Path *Pathfinder::internal_findHierarchicalPath( Bool isHuman, const LocomotorSu } #endif - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("FindHierarchicalPath failed from (%f,%f) to (%f,%f)", from->x, from->y, to->x, to->y)); + DEBUG_LOG(("%d FindHierarchicalPath failed from (%f,%f) to (%f,%f) --", TheGameLogic->getFrame(), from->x, from->y, to->x, to->y)); DEBUG_LOG(("time %f", (::GetTickCount()-startTimeMS)/1000.0f)); #ifdef DUMP_PERF_STATS @@ -8321,8 +8317,7 @@ Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet } #endif - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("Pathfind(findClosestPath) chugged from (%f,%f) to (%f,%f), --", from->x, from->y, to->x, to->y)); + DEBUG_LOG(("%d Pathfind(findClosestPath) chugged from (%f,%f) to (%f,%f) --", TheGameLogic->getFrame(), from->x, from->y, to->x, to->y)); DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #ifdef INTENSE_DEBUG TheScriptEngine->AppendDebugMessage("Big path FCP CC", false); @@ -8347,8 +8342,7 @@ Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet Bool valid; valid = validMovementPosition( isCrusher, obj->getLayer(), locomotorSet, to ) ; - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("Pathfind(findClosestPath) failed from (%f,%f) to (%f,%f), original valid %d --", from->x, from->y, to->x, to->y, valid)); + DEBUG_LOG(("Pathfind(findClosestPath) failed from (%f,%f) to (%f,%f), original valid %d --", TheGameLogic->getFrame(), from->x, from->y, to->x, to->y, valid)); DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #endif #if defined(RTS_DEBUG) @@ -9741,8 +9735,7 @@ Path *Pathfinder::getMoveAwayFromPath(Object* obj, Object *otherObj, debugShowSearch(true); #endif - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("getMoveAwayFromPath pathfind failed -- ")); + DEBUG_LOG(("%d getMoveAwayFromPath pathfind failed --", TheGameLogic->getFrame())); DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); m_isTunneling = false; @@ -9920,8 +9913,7 @@ Path *Pathfinder::patchPath( const Object *obj, const LocomotorSet& locomotorSet } } - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("patchPath Pathfind failed -- ")); + DEBUG_LOG(("%d patchPath Pathfind failed --", TheGameLogic->getFrame())); DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #if defined(RTS_DEBUG) @@ -10221,8 +10213,7 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot return path; } #if defined(RTS_DEBUG) - DEBUG_LOG(("%d (%d cells)", TheGameLogic->getFrame(), cellCount)); - DEBUG_LOG(("Attack Pathfind failed from (%f,%f) to (%f,%f) -- ", from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); + DEBUG_LOG(("%d (%d cells) Attack Pathfind failed from (%f,%f) to (%f,%f) --", TheGameLogic->getFrame(), cellCount, from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); DEBUG_LOG(("Unit '%s', attacking '%s' time %f", obj->getTemplate()->getName().str(), victim->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #endif #endif @@ -10382,8 +10373,7 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor #endif #if 0 #if defined(RTS_DEBUG) - DEBUG_LOG(("%d (%d cells)", TheGameLogic->getFrame(), cellCount)); - DEBUG_LOG(("Attack Pathfind failed from (%f,%f) to (%f,%f) -- ", from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); + DEBUG_LOG(("%d (%d cells) Attack Pathfind failed from (%f,%f) to (%f,%f) --", TheGameLogic->getFrame(), cellCount, from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); DEBUG_LOG(("Unit '%s', attacking '%s' time %f", obj->getTemplate()->getName().str(), victim->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #endif #endif diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp index 96bdfe0134..c02e0d05bb 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp @@ -414,7 +414,7 @@ void W3DGhostObject::removeParentObject(void) robj=w3dDraw->getRenderObject(); if (robj) { - DEBUG_ASSERTCRASH(robj->Peek_Scene() != NULL, ("Removing GhostObject parent not in scene ")); + DEBUG_ASSERTCRASH(robj->Peek_Scene() != NULL, ("Removing GhostObject parent not in scene")); robj->Remove(); } } diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp index 86af36741c..002b71a4e1 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp @@ -1903,7 +1903,7 @@ void DX8Wrapper::Draw( #ifdef MESH_RENDER_SNAPSHOT_ENABLED if (WW3D::Is_Snapshot_Activated()) { unsigned long passes=0; - SNAPSHOT_SAY(("ValidateDevice: ")); + SNAPSHOT_SAY(("ValidateDevice:")); HRESULT res=D3DDevice->ValidateDevice(&passes); switch (res) { case D3D_OK: diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp index 070bef7a12..80c88a34e2 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp @@ -518,7 +518,7 @@ void SortingRendererClass::Flush_Sorting_Pool() { if (!overlapping_node_count) return; - SNAPSHOT_SAY(("SortingSystem - Flush ")); + SNAPSHOT_SAY(("SortingSystem - Flush")); unsigned node_id; // Fill dynamic index buffer with sorting index buffer vertices diff --git a/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp b/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp index 916ec82024..73fc2a2669 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/PerfTimer.cpp @@ -599,7 +599,7 @@ void PerfTimer::outputInfo( void ) #endif if (m_crashWithInfo) { - DEBUG_CRASH(("%s" + DEBUG_CRASH(("%s\n" "Average Time (per call): %.4f ms\n" "Average Time (per frame): %.4f ms\n" "Average calls per frame: %.2f\n" @@ -612,7 +612,7 @@ void PerfTimer::outputInfo( void ) m_callCount, 1000.0f / avgTimePerFrame)); } else { - DEBUG_LOG(("%s" + DEBUG_LOG(("%s\n" "Average Time (per call): %.4f ms\n" "Average Time (per frame): %.4f ms\n" "Average calls per frame: %.2f\n" diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index c21346a3c3..f3f0f2a166 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -5588,7 +5588,7 @@ void InGameUI::showIdleWorkerLayout( void ) if (!m_idleWorkerWin) { m_idleWorkerWin = TheWindowManager->winGetWindowFromId(NULL, TheNameKeyGenerator->nameToKey("ControlBar.wnd:ButtonIdleWorker")); - DEBUG_ASSERTCRASH(m_idleWorkerWin, ("InGameUI::showIdleWorkerLayout could not find IdleWorker.wnd to load ")); + DEBUG_ASSERTCRASH(m_idleWorkerWin, ("InGameUI::showIdleWorkerLayout could not find IdleWorker.wnd to load")); return; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index 4d485cd6bb..b3f510452d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -1343,7 +1343,7 @@ void PathfindCell::setGoalUnit(ObjectID unitID, const ICoord2D &pos ) allocateInfo(pos); } if (!m_info) { - DEBUG_CRASH(("Ran out of pathfind cells - fatal error!!!!! jba. ")); + DEBUG_CRASH(("Ran out of pathfind cells - fatal error!!!!! jba.")); return; } m_info->m_goalUnitID = unitID; @@ -1379,7 +1379,7 @@ void PathfindCell::setGoalAircraft(ObjectID unitID, const ICoord2D &pos ) allocateInfo(pos); } if (!m_info) { - DEBUG_CRASH(("Ran out of pathfind cells - fatal error!!!!! jba. ")); + DEBUG_CRASH(("Ran out of pathfind cells - fatal error!!!!! jba.")); return; } m_info->m_goalAircraftID = unitID; @@ -1415,7 +1415,7 @@ void PathfindCell::setPosUnit(ObjectID unitID, const ICoord2D &pos ) allocateInfo(pos); } if (!m_info) { - DEBUG_CRASH(("Ran out of pathfind cells - fatal error!!!!! jba. ")); + DEBUG_CRASH(("Ran out of pathfind cells - fatal error!!!!! jba.")); return; } if (m_info->m_goalUnitID!=INVALID_ID && (m_info->m_goalUnitID==m_info->m_posUnitID)) { @@ -5951,9 +5951,8 @@ void Pathfinder::processPathfindQueue(void) timeToUpdate = ((double)(endTime64-startTime64) / (double)(freq64)); if (timeToUpdate>0.01f) { - DEBUG_LOG(("%d Pathfind queue: %d paths, %d cells", TheGameLogic->getFrame(), pathsFound, m_cumulativeCellsAllocated)); - DEBUG_LOG(("Time %f (%f)", timeToUpdate, (::GetTickCount()-startTimeMS)/1000.0f)); - DEBUG_LOG(("")); + DEBUG_LOG(("%d Pathfind queue: %d paths, %d cells --", TheGameLogic->getFrame(), pathsFound, m_cumulativeCellsAllocated)); + DEBUG_LOG(("time %f (%f)", timeToUpdate, (::GetTickCount()-startTimeMS)/1000.0f)); } #endif #endif @@ -6714,8 +6713,7 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe Bool valid; valid = validMovementPosition( isCrusher, obj->getLayer(), locomotorSet, to ) ; - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("Pathfind failed from (%f,%f) to (%f,%f), OV %d", from->x, from->y, to->x, to->y, valid)); + DEBUG_LOG(("%d Pathfind failed from (%f,%f) to (%f,%f), OV %d --", TheGameLogic->getFrame(), from->x, from->y, to->x, to->y, valid)); DEBUG_LOG(("Unit '%s', time %f, cells %d", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f,cellCount)); } #endif @@ -7358,8 +7356,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, } #endif - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("FindGroundPath failed from (%f,%f) to (%f,%f)", from->x, from->y, to->x, to->y)); + DEBUG_LOG(("%d FindGroundPath failed from (%f,%f) to (%f,%f) --", TheGameLogic->getFrame(), from->x, from->y, to->x, to->y)); DEBUG_LOG(("time %f", (::GetTickCount()-startTimeMS)/1000.0f)); #ifdef DUMP_PERF_STATS @@ -7988,8 +7985,7 @@ Path *Pathfinder::internal_findHierarchicalPath( Bool isHuman, const LocomotorSu } #endif - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("FindHierarchicalPath failed from (%f,%f) to (%f,%f)", from->x, from->y, to->x, to->y)); + DEBUG_LOG(("%d FindHierarchicalPath failed from (%f,%f) to (%f,%f) --", TheGameLogic->getFrame(), from->x, from->y, to->x, to->y)); DEBUG_LOG(("time %f", (::GetTickCount()-startTimeMS)/1000.0f)); #ifdef DUMP_PERF_STATS @@ -8948,8 +8944,7 @@ Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet } #endif - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("Pathfind(findClosestPath) chugged from (%f,%f) to (%f,%f), --", from->x, from->y, to->x, to->y)); + DEBUG_LOG(("%d Pathfind(findClosestPath) chugged from (%f,%f) to (%f,%f) --", TheGameLogic->getFrame(), from->x, from->y, to->x, to->y)); DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #ifdef INTENSE_DEBUG TheScriptEngine->AppendDebugMessage("Big path FCP CC", false); @@ -8974,8 +8969,7 @@ Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet Bool valid; valid = validMovementPosition( isCrusher, obj->getLayer(), locomotorSet, to ) ; - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("Pathfind(findClosestPath) failed from (%f,%f) to (%f,%f), original valid %d --", from->x, from->y, to->x, to->y, valid)); + DEBUG_LOG(("Pathfind(findClosestPath) failed from (%f,%f) to (%f,%f), original valid %d --", TheGameLogic->getFrame(), from->x, from->y, to->x, to->y, valid)); DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #endif #if defined(RTS_DEBUG) @@ -10390,8 +10384,7 @@ Path *Pathfinder::getMoveAwayFromPath(Object* obj, Object *otherObj, debugShowSearch(true); #endif - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("getMoveAwayFromPath pathfind failed -- ")); + DEBUG_LOG(("%d getMoveAwayFromPath pathfind failed --", TheGameLogic->getFrame())); DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); m_isTunneling = false; @@ -10569,8 +10562,7 @@ Path *Pathfinder::patchPath( const Object *obj, const LocomotorSet& locomotorSet } } - DEBUG_LOG(("%d ", TheGameLogic->getFrame())); - DEBUG_LOG(("patchPath Pathfind failed -- ")); + DEBUG_LOG(("%d patchPath Pathfind failed --", TheGameLogic->getFrame())); DEBUG_LOG(("Unit '%s', time %f", obj->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #if defined(RTS_DEBUG) @@ -10928,8 +10920,7 @@ Path *Pathfinder::findAttackPath( const Object *obj, const LocomotorSet& locomot return path; } #if defined(RTS_DEBUG) - DEBUG_LOG(("%d (%d cells)", TheGameLogic->getFrame(), cellCount)); - DEBUG_LOG(("Attack Pathfind failed from (%f,%f) to (%f,%f) -- ", from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); + DEBUG_LOG(("%d (%d cells) Attack Pathfind failed from (%f,%f) to (%f,%f) --", TheGameLogic->getFrame(), cellCount, from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); DEBUG_LOG(("Unit '%s', attacking '%s' time %f", obj->getTemplate()->getName().str(), victim->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #endif #endif @@ -11089,8 +11080,7 @@ Path *Pathfinder::findSafePath( const Object *obj, const LocomotorSet& locomotor #endif #if 0 #if defined(RTS_DEBUG) - DEBUG_LOG(("%d (%d cells)", TheGameLogic->getFrame(), cellCount)); - DEBUG_LOG(("Attack Pathfind failed from (%f,%f) to (%f,%f) -- ", from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); + DEBUG_LOG(("%d (%d cells) Attack Pathfind failed from (%f,%f) to (%f,%f) --", TheGameLogic->getFrame(), cellCount, from->x, from->y, victim->getPosition()->x, victim->getPosition()->y)); DEBUG_LOG(("Unit '%s', attacking '%s' time %f", obj->getTemplate()->getName().str(), victim->getTemplate()->getName().str(), (::GetTickCount()-startTimeMS)/1000.0f)); #endif #endif diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp index 19925e780a..71990e402c 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp @@ -418,7 +418,7 @@ void W3DGhostObject::removeParentObject(void) robj=w3dDraw->getRenderObject(); if (robj) { - DEBUG_ASSERTCRASH(robj->Peek_Scene() != NULL, ("Removing GhostObject parent not in scene ")); + DEBUG_ASSERTCRASH(robj->Peek_Scene() != NULL, ("Removing GhostObject parent not in scene")); robj->Remove(); } } diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp index 65c2fe248b..9b6584693f 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp @@ -2083,7 +2083,7 @@ void DX8Wrapper::Draw( #ifdef MESH_RENDER_SNAPSHOT_ENABLED if (WW3D::Is_Snapshot_Activated()) { unsigned long passes=0; - SNAPSHOT_SAY(("ValidateDevice: ")); + SNAPSHOT_SAY(("ValidateDevice:")); HRESULT res=D3DDevice->ValidateDevice(&passes); switch (res) { case D3D_OK: diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp index f676b12a90..a760bee567 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp @@ -406,7 +406,7 @@ void SortingRendererClass::Flush_Sorting_Pool() { if (!overlapping_node_count) return; - SNAPSHOT_SAY(("SortingSystem - Flush ")); + SNAPSHOT_SAY(("SortingSystem - Flush")); // Fill dynamic index buffer with sorting index buffer vertices TempIndexStruct* tis=Get_Temp_Index_Array(overlapping_polygon_count); From 4ab3505691031e286aaa01a35db5ccf2e00430a9 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:41:02 +0200 Subject: [PATCH 13/13] Add python script for removing trailing CR LF from debug logging strings (#1232) --- scripts/cpp/refactor_debug_log_newline.py | 95 +++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 scripts/cpp/refactor_debug_log_newline.py diff --git a/scripts/cpp/refactor_debug_log_newline.py b/scripts/cpp/refactor_debug_log_newline.py new file mode 100644 index 0000000000..eb2ce489d8 --- /dev/null +++ b/scripts/cpp/refactor_debug_log_newline.py @@ -0,0 +1,95 @@ +# Created with python 3.11.4 + +import glob +import os + + +def modifyLine(line: str) -> str: + searchWords = [ + "DEBUG_LOG", + "DEBUG_LOG_LEVEL", + "DEBUG_CRASH", + "DEBUG_ASSERTLOG", + "DEBUG_ASSERTCRASH", + "RELEASE_CRASH", + "RELEASE_CRASHLOCALIZED", + "WWDEBUG_SAY", + "WWDEBUG_WARNING", + "WWRELEASE_SAY", + "WWRELEASE_WARNING", + "WWRELEASE_ERROR", + "WWASSERT_PRINT", + "WWDEBUG_ERROR", + "SNAPSHOT_SAY", + "SHATTER_DEBUG_SAY", + "DBGMSG", + "REALLY_VERBOSE_LOG", + "DOUBLE_DEBUG", + "PERF_LOG", + "CRCGEN_LOG", + "STATECHANGED_LOG", + "PING_LOG", + "BONEPOS_LOG", + ] + + SEARCH_PATTERNS = [ + r'\r\n"', + r'\n"', + ] + + for searchWord in searchWords: + wordBegin = line.find(searchWord) + wordEnd = wordBegin + len(searchWord) + + if wordBegin >= 0: + for searchPattern in SEARCH_PATTERNS: + searchPatternLen = len(searchPattern) + i = wordEnd + lookEnd = len(line) - searchPatternLen + + while i < lookEnd: + pattern = line[i:i+searchPatternLen] + if pattern == searchPattern: + lineCopy = line[:i] + '"' + line[i+searchPatternLen:] + return lineCopy + i += 1 + + break + + return line + + +def main(): + current_dir = os.path.dirname(os.path.abspath(__file__)) + root_dir = os.path.join(current_dir, "..", "..") + root_dir = os.path.normpath(root_dir) + core_dir = os.path.join(root_dir, "Core") + generals_dir = os.path.join(root_dir, "Generals") + generalsmd_dir = os.path.join(root_dir, "GeneralsMD") + fileNames = [] + fileNames.extend(glob.glob(os.path.join(core_dir, '**', '*.h'), recursive=True)) + fileNames.extend(glob.glob(os.path.join(core_dir, '**', '*.cpp'), recursive=True)) + fileNames.extend(glob.glob(os.path.join(core_dir, '**', '*.inl'), recursive=True)) + fileNames.extend(glob.glob(os.path.join(generals_dir, '**', '*.h'), recursive=True)) + fileNames.extend(glob.glob(os.path.join(generals_dir, '**', '*.cpp'), recursive=True)) + fileNames.extend(glob.glob(os.path.join(generals_dir, '**', '*.inl'), recursive=True)) + fileNames.extend(glob.glob(os.path.join(generalsmd_dir, '**', '*.h'), recursive=True)) + fileNames.extend(glob.glob(os.path.join(generalsmd_dir, '**', '*.cpp'), recursive=True)) + fileNames.extend(glob.glob(os.path.join(generalsmd_dir, '**', '*.inl'), recursive=True)) + + for fileName in fileNames: + with open(fileName, 'r', encoding="cp1252") as file: + try: + lines = file.readlines() + except UnicodeDecodeError: + continue # Not good. + with open(fileName, 'w', encoding="cp1252") as file: + for line in lines: + line = modifyLine(line) + file.write(line) + + return + + +if __name__ == "__main__": + main()