summaryrefslogtreecommitdiff
path: root/src/game/game_core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/game_core.cpp')
-rw-r--r--src/game/game_core.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/game/game_core.cpp b/src/game/game_core.cpp
index 7b05abb40..181e8b6bb 100644
--- a/src/game/game_core.cpp
+++ b/src/game/game_core.cpp
@@ -25,10 +25,10 @@
#include "../safeguards.h"
/* static */ uint Game::frame_counter = 0;
-/* static */ GameInfo *Game::info = NULL;
-/* static */ GameInstance *Game::instance = NULL;
-/* static */ GameScannerInfo *Game::scanner_info = NULL;
-/* static */ GameScannerLibrary *Game::scanner_library = NULL;
+/* static */ GameInfo *Game::info = nullptr;
+/* static */ GameInstance *Game::instance = nullptr;
+/* static */ GameScannerInfo *Game::scanner_info = nullptr;
+/* static */ GameScannerLibrary *Game::scanner_library = nullptr;
/* static */ void Game::GameLoop()
{
@@ -36,7 +36,7 @@
PerformanceMeasurer::SetInactive(PFE_GAMESCRIPT);
return;
}
- if (Game::instance == NULL) {
+ if (Game::instance == nullptr) {
PerformanceMeasurer::SetInactive(PFE_GAMESCRIPT);
return;
}
@@ -58,11 +58,11 @@
/* static */ void Game::Initialize()
{
- if (Game::instance != NULL) Game::Uninitialize(true);
+ if (Game::instance != nullptr) Game::Uninitialize(true);
Game::frame_counter = 0;
- if (Game::scanner_info == NULL) {
+ if (Game::scanner_info == nullptr) {
TarScanner::DoScan(TarScanner::GAME);
Game::scanner_info = new GameScannerInfo();
Game::scanner_info->Initialize();
@@ -73,14 +73,14 @@
/* static */ void Game::StartNew()
{
- if (Game::instance != NULL) return;
+ if (Game::instance != nullptr) return;
/* Clients shouldn't start GameScripts */
if (_networking && !_network_server) return;
GameConfig *config = GameConfig::GetConfig(GameConfig::SSS_FORCE_GAME);
GameInfo *info = config->GetInfo();
- if (info == NULL) return;
+ if (info == nullptr) return;
config->AnchorUnchangeableSettings();
@@ -101,8 +101,8 @@
Backup<CompanyByte> cur_company(_current_company, FILE_LINE);
delete Game::instance;
- Game::instance = NULL;
- Game::info = NULL;
+ Game::instance = nullptr;
+ Game::info = nullptr;
cur_company.Restore();
@@ -111,33 +111,33 @@
} else {
delete Game::scanner_info;
delete Game::scanner_library;
- Game::scanner_info = NULL;
- Game::scanner_library = NULL;
+ Game::scanner_info = nullptr;
+ Game::scanner_library = nullptr;
- if (_settings_game.game_config != NULL) {
+ if (_settings_game.game_config != nullptr) {
delete _settings_game.game_config;
- _settings_game.game_config = NULL;
+ _settings_game.game_config = nullptr;
}
- if (_settings_newgame.game_config != NULL) {
+ if (_settings_newgame.game_config != nullptr) {
delete _settings_newgame.game_config;
- _settings_newgame.game_config = NULL;
+ _settings_newgame.game_config = nullptr;
}
}
}
/* static */ void Game::Pause()
{
- if (Game::instance != NULL) Game::instance->Pause();
+ if (Game::instance != nullptr) Game::instance->Pause();
}
/* static */ void Game::Unpause()
{
- if (Game::instance != NULL) Game::instance->Unpause();
+ if (Game::instance != nullptr) Game::instance->Unpause();
}
/* static */ bool Game::IsPaused()
{
- return Game::instance != NULL? Game::instance->IsPaused() : false;
+ return Game::instance != nullptr? Game::instance->IsPaused() : false;
}
/* static */ void Game::NewEvent(ScriptEvent *event)
@@ -152,7 +152,7 @@
}
/* Check if Game instance is alive */
- if (Game::instance == NULL) {
+ if (Game::instance == nullptr) {
event->Release();
return;
}
@@ -169,23 +169,23 @@
{
/* Check for both newgame as current game if we can reload the GameInfo inside
* the GameConfig. If not, remove the Game from the list. */
- if (_settings_game.game_config != NULL && _settings_game.game_config->HasScript()) {
+ if (_settings_game.game_config != nullptr && _settings_game.game_config->HasScript()) {
if (!_settings_game.game_config->ResetInfo(true)) {
DEBUG(script, 0, "After a reload, the GameScript by the name '%s' was no longer found, and removed from the list.", _settings_game.game_config->GetName());
- _settings_game.game_config->Change(NULL);
- if (Game::instance != NULL) {
+ _settings_game.game_config->Change(nullptr);
+ if (Game::instance != nullptr) {
delete Game::instance;
- Game::instance = NULL;
- Game::info = NULL;
+ Game::instance = nullptr;
+ Game::info = nullptr;
}
- } else if (Game::instance != NULL) {
+ } else if (Game::instance != nullptr) {
Game::info = _settings_game.game_config->GetInfo();
}
}
- if (_settings_newgame.game_config != NULL && _settings_newgame.game_config->HasScript()) {
+ if (_settings_newgame.game_config != nullptr && _settings_newgame.game_config->HasScript()) {
if (!_settings_newgame.game_config->ResetInfo(false)) {
DEBUG(script, 0, "After a reload, the GameScript by the name '%s' was no longer found, and removed from the list.", _settings_newgame.game_config->GetName());
- _settings_newgame.game_config->Change(NULL);
+ _settings_newgame.game_config->Change(nullptr);
}
}
}
@@ -206,7 +206,7 @@
/* static */ void Game::Save()
{
- if (Game::instance != NULL && (!_networking || _network_server)) {
+ if (Game::instance != nullptr && (!_networking || _network_server)) {
Backup<CompanyByte> cur_company(_current_company, OWNER_DEITY, FILE_LINE);
Game::instance->Save();
cur_company.Restore();
@@ -217,7 +217,7 @@
/* static */ void Game::Load(int version)
{
- if (Game::instance != NULL && (!_networking || _network_server)) {
+ if (Game::instance != nullptr && (!_networking || _network_server)) {
Backup<CompanyByte> cur_company(_current_company, OWNER_DEITY, FILE_LINE);
Game::instance->Load(version);
cur_company.Restore();