Skip to content

Commit

Permalink
g_appLoaded removed in favor of pApp->IsLoaded().
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaffeine committed Nov 24, 2015
1 parent 66c7d5a commit b6e34b1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/xrEngine/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
extern CRenderDevice Device;

static CTimer phase_timer;
ENGINE_API BOOL g_appLoaded = FALSE;

void doBenchmark(LPCSTR name)
{
Expand Down
11 changes: 6 additions & 5 deletions src/xrEngine/x_ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

//---------------------------------------------------------------------

extern ENGINE_API BOOL g_appLoaded;
extern CRenderDevice Device;

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

CApplication::CApplication()
{
loaded = false;
ll_dwReference = 0;

max_load_stage = 0;
Expand Down Expand Up @@ -247,8 +247,7 @@ void CApplication::LoadBegin()
ll_dwReference++;
if (1 == ll_dwReference)
{

g_appLoaded = FALSE;
loaded = false;

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

void CApplication::LoadDraw()
{
if (g_appLoaded) return;
if (loaded)
return;

Device.dwFrame += 1;


Expand Down
3 changes: 3 additions & 0 deletions src/xrEngine/x_ray.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ENGINE_API CApplication :
int load_stage;

u32 ll_dwReference;
bool loaded;
private:
EVENT eQuit;
EVENT eStart;
Expand All @@ -44,6 +45,8 @@ class ENGINE_API CApplication :
public:
CGameFont* pFontSystem;

bool IsLoaded() { return loaded; }

// Levels
xr_vector<sLevelInfo> Levels;
u32 Level_Current;
Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/script_render_device_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "pch_script.h"
#include "xrScriptEngine/ScriptExporter.hpp"
#include "xrEngine/x_ray.h"

using namespace luabind;

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

extern ENGINE_API BOOL g_appLoaded;
bool is_app_ready()
{
return !!g_appLoaded;
return pApp->IsLoaded();
}

u32 time_global(const CRenderDevice *self)
Expand Down

0 comments on commit b6e34b1

Please sign in to comment.