Add: Show performance of AI and GS in framerate window

This commit is contained in:
Niels Martin Hansen
2019-02-04 01:26:55 +01:00
parent 4adb91202d
commit 7e1e2756d4
7 changed files with 187 additions and 19 deletions

View File

@@ -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++;