summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2019-02-04 01:26:55 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-02-23 14:29:07 +0100
commit7e1e2756d4fdbd9c2fb3508b4213de8dc855f21c (patch)
tree15e4f7b212bafdd3e83653aca1a465a5f6f4461b /src/game
parent4adb91202d7c0118b52daeab2c4e6b040b30e4a9 (diff)
downloadopenttd-7e1e2756d4fdbd9c2fb3508b4213de8dc855f21c.tar.xz
Add: Show performance of AI and GS in framerate window
Diffstat (limited to 'src/game')
-rw-r--r--src/game/game_core.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/game/game_core.cpp b/src/game/game_core.cpp
index 2f95e2622..10b079bee 100644
--- a/src/game/game_core.cpp
+++ b/src/game/game_core.cpp
@@ -15,6 +15,7 @@
#include "../company_func.h"
#include "../network/network.h"
#include "../window_func.h"
+#include "../framerate_type.h"
#include "game.hpp"
#include "game_scanner.hpp"
#include "game_config.hpp"
@@ -31,8 +32,16 @@
/* static */ void Game::GameLoop()
{
- if (_networking && !_network_server) return;
- if (Game::instance == NULL) return;
+ if (_networking && !_network_server) {
+ PerformanceMeasurer::SetInactive(PFE_GAMESCRIPT);
+ return;
+ }
+ if (Game::instance == NULL) {
+ PerformanceMeasurer::SetInactive(PFE_GAMESCRIPT);
+ return;
+ }
+
+ PerformanceMeasurer framerate(PFE_GAMESCRIPT);
Game::frame_counter++;