Skip to content

Commit b6e34b1

Browse files
committed
g_appLoaded removed in favor of pApp->IsLoaded().
1 parent 66c7d5a commit b6e34b1

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

src/xrEngine/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
866866
extern CRenderDevice Device;
867867

868868
static CTimer phase_timer;
869-
ENGINE_API BOOL g_appLoaded = FALSE;
870869

871870
void doBenchmark(LPCSTR name)
872871
{

src/xrEngine/x_ray.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
//---------------------------------------------------------------------
2222

23-
extern ENGINE_API BOOL g_appLoaded;
2423
extern CRenderDevice Device;
2524

2625
#ifdef MASTER_GOLD
@@ -92,6 +91,7 @@ void _InitializeFont(CGameFont*& F, LPCSTR section, u32 flags)
9291

9392
CApplication::CApplication()
9493
{
94+
loaded = false;
9595
ll_dwReference = 0;
9696

9797
max_load_stage = 0;
@@ -247,8 +247,7 @@ void CApplication::LoadBegin()
247247
ll_dwReference++;
248248
if (1 == ll_dwReference)
249249
{
250-
251-
g_appLoaded = FALSE;
250+
loaded = false;
252251

253252
#ifndef DEDICATED_SERVER
254253
_InitializeFont(pFontSystem, "ui_font_letterica18_russian", 0);
@@ -270,7 +269,7 @@ void CApplication::LoadEnd()
270269
Msg("* phase time: %d ms", phase_timer.GetElapsed_ms());
271270
Msg("* phase cmem: %d K", Memory.mem_usage() / 1024);
272271
Console->Execute("stat_memory");
273-
g_appLoaded = TRUE;
272+
loaded = true;
274273
// DUMP_PHASE;
275274
}
276275
}
@@ -285,7 +284,9 @@ void CApplication::destroy_loading_shaders()
285284

286285
void CApplication::LoadDraw()
287286
{
288-
if (g_appLoaded) return;
287+
if (loaded)
288+
return;
289+
289290
Device.dwFrame += 1;
290291

291292

src/xrEngine/x_ray.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class ENGINE_API CApplication :
3232
int load_stage;
3333

3434
u32 ll_dwReference;
35+
bool loaded;
3536
private:
3637
EVENT eQuit;
3738
EVENT eStart;
@@ -44,6 +45,8 @@ class ENGINE_API CApplication :
4445
public:
4546
CGameFont* pFontSystem;
4647

48+
bool IsLoaded() { return loaded; }
49+
4750
// Levels
4851
xr_vector<sLevelInfo> Levels;
4952
u32 Level_Current;

src/xrGame/script_render_device_script.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "pch_script.h"
1010
#include "xrScriptEngine/ScriptExporter.hpp"
11+
#include "xrEngine/x_ray.h"
1112

1213
using namespace luabind;
1314

@@ -21,10 +22,9 @@ void set_device_paused(CRenderDevice* d, bool b)
2122
Device.Pause(b, TRUE, FALSE,"set_device_paused_script");
2223
}
2324

24-
extern ENGINE_API BOOL g_appLoaded;
2525
bool is_app_ready()
2626
{
27-
return !!g_appLoaded;
27+
return pApp->IsLoaded();
2828
}
2929

3030
u32 time_global(const CRenderDevice *self)

0 commit comments

Comments
 (0)