Skip to content

Commit 775da20

Browse files
stephanmeestersxezon
authored andcommitted
feat(profiling): Add messages on game start and game end to Tracy profiling (TheSuperHackers#2202)
1 parent 8082f0f commit 775da20

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2106,7 +2106,11 @@ void GameLogic::startNewGame( Bool loadingSaveGame )
21062106
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE( "GUI:FastForwardInstructions", L"Press F to toggle Fast Forward" ) );
21072107
}
21082108

2109-
2109+
#ifdef PROFILER_ENABLED
2110+
AsciiString message;
2111+
message.format("GameStart: %s", TheGlobalData->m_mapName.str());
2112+
PROFILER_MSG(message.str(), message.getLength());
2113+
#endif
21102114
}
21112115

21122116
//-----------------------------------------------------------------------------------------
@@ -3658,6 +3662,12 @@ void GameLogic::exitGame()
36583662
TheScriptEngine->doUnfreezeTime();
36593663

36603664
TheMessageStream->appendMessage(GameMessage::MSG_CLEAR_GAME_DATA);
3665+
3666+
#ifdef PROFILER_ENABLED
3667+
AsciiString message;
3668+
message.format("GameEnd: %s", TheGlobalData->m_mapName.str());
3669+
PROFILER_MSG(message.str(), message.getLength());
3670+
#endif
36613671
}
36623672

36633673
// ------------------------------------------------------------------------------------------------

GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2404,7 +2404,11 @@ void GameLogic::startNewGame( Bool loadingSaveGame )
24042404
TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE( "GUI:FastForwardInstructions", L"Press F to toggle Fast Forward" ) );
24052405
}
24062406

2407-
2407+
#ifdef PROFILER_ENABLED
2408+
AsciiString message;
2409+
message.format("GameStart: %s", TheGlobalData->m_mapName.str());
2410+
PROFILER_MSG(message.str(), message.getLength());
2411+
#endif
24082412
}
24092413

24102414
//-----------------------------------------------------------------------------------------
@@ -4215,6 +4219,12 @@ void GameLogic::exitGame()
42154219
TheScriptEngine->doUnfreezeTime();
42164220

42174221
TheMessageStream->appendMessage(GameMessage::MSG_CLEAR_GAME_DATA);
4222+
4223+
#ifdef PROFILER_ENABLED
4224+
AsciiString message;
4225+
message.format("GameEnd: %s", TheGlobalData->m_mapName.str());
4226+
PROFILER_MSG(message.str(), message.getLength());
4227+
#endif
42184228
}
42194229

42204230
// ------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)