From 9bf69e5d456bd151232b46459ac6eb0c5ae43248 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Sun, 8 Jul 2018 14:24:01 +0500 Subject: [PATCH] xrGame/GamePersistent.cpp: code cleanup --- src/xrGame/GamePersistent.cpp | 28 +++++++++------------------- src/xrGame/GamePersistent.h | 4 ++++ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/xrGame/GamePersistent.cpp b/src/xrGame/GamePersistent.cpp index 5e658748150..df34316d095 100644 --- a/src/xrGame/GamePersistent.cpp +++ b/src/xrGame/GamePersistent.cpp @@ -43,12 +43,7 @@ #include "ai_debug.h" #endif // _EDITOR -//static void * ode_alloc (size_t size) { return xr_malloc(size); } -//static void * ode_realloc (void *ptr, size_t oldsize, size_t newsize) { return xr_realloc(ptr,newsize); } -//static void ode_free (void *ptr, size_t size) { return xr_free(ptr); } -// temporary hack to get rid of the Microsoft-specific "__super" -using super = IGame_Persistent; CGamePersistent::CGamePersistent(void) { @@ -74,12 +69,7 @@ CGamePersistent::CGamePersistent(void) m_frame_counter = 0; m_last_stats_frame = u32(-2); #endif - // - // dSetAllocHandler (ode_alloc ); - // dSetReallocHandler (ode_realloc ); - // dSetFreeHandler (ode_free ); - // BOOL bDemoMode = (0 != strstr(Core.Params, "-demomode ")); if (bDemoMode) { @@ -115,7 +105,7 @@ CGamePersistent::~CGamePersistent(void) void CGamePersistent::PreStart(LPCSTR op) { pApp->SetLoadingScreen(new UILoadingScreen()); - super::PreStart(op); + inherited::PreStart(op); } void CGamePersistent::RegisterModel(IRenderVisual* V) @@ -158,7 +148,7 @@ void CGamePersistent::OnAppStart() // load game materials GMLib.Load(); init_game_globals(); - super::OnAppStart(); + inherited::OnAppStart(); m_pUI_core = new ui_core(); m_pMainMenu = new CMainMenu(); } @@ -171,20 +161,20 @@ void CGamePersistent::OnAppEnd() xr_delete(m_pMainMenu); xr_delete(m_pUI_core); - super::OnAppEnd(); + inherited::OnAppEnd(); clean_game_globals(); GMLib.Unload(); } -void CGamePersistent::Start(LPCSTR op) { super::Start(op); } +void CGamePersistent::Start(LPCSTR op) { inherited::Start(op); } void CGamePersistent::Disconnect() { // destroy ambient particles CParticlesObject::Destroy(ambient_particles); - super::Disconnect(); + inherited::Disconnect(); // stop all played emitters GEnv.Sound->stop_emitters(); m_game_params.m_e_game_type = eGameIDNoGame; @@ -194,7 +184,7 @@ void CGamePersistent::Disconnect() void CGamePersistent::OnGameStart() { - super::OnGameStart(); + inherited::OnGameStart(); UpdateGameType(); } @@ -215,7 +205,7 @@ LPCSTR GameTypeToString(EGameIDs gt, bool bShort) void CGamePersistent::UpdateGameType() { - super::UpdateGameType(); + inherited::UpdateGameType(); m_game_params.m_e_game_type = ParseStringToGameType(m_game_params.m_game_type); @@ -227,7 +217,7 @@ void CGamePersistent::UpdateGameType() void CGamePersistent::OnGameEnd() { - super::OnGameEnd(); + inherited::OnGameEnd(); xr_delete(g_stalker_animation_data_storage); xr_delete(g_stalker_velocity_holder); @@ -642,7 +632,7 @@ void CGamePersistent::OnFrame() } #endif // MASTER_GOLD } - super::OnFrame(); + inherited::OnFrame(); if (!Device.Paused()) { diff --git a/src/xrGame/GamePersistent.h b/src/xrGame/GamePersistent.h index ea13aec4d95..4a3ca4ad873 100644 --- a/src/xrGame/GamePersistent.h +++ b/src/xrGame/GamePersistent.h @@ -11,6 +11,10 @@ class ui_core; class CGamePersistent : public IGame_Persistent, public IEventReceiver { +protected: + using inherited = IGame_Persistent; + +private: // ambient particles CParticlesObject* ambient_particles; u32 ambient_sound_next_time[20]; // max snd channels