rough but functional loading progress bar support.

numerous TODOs remaining - initial update instead of only after
completing first job; fix GUI overdraw issue; decrease granularity
(currently only 3 updates)

This was SVN commit r2033.
This commit is contained in:
janwas
2005-03-22 02:17:55 +00:00
parent 5e3b0f06ec
commit 6d792365aa
13 changed files with 246 additions and 45 deletions
+29
View File
@@ -12,6 +12,7 @@
#include "CConsole.h"
#include "Unit.h"
#include "Model.h"
#include "Loader.h"
#include "gui/CGUI.h"
@@ -37,6 +38,34 @@ void CSimulation::Initialize(CGameAttributes *pAttribs)
g_EntityManager.InitializeAll();
}
struct ThunkParams
{
CSimulation* const this_;
CGameAttributes* const pAttribs;
ThunkParams(CSimulation* this__, CGameAttributes* pAttribs_)
: this_(this__), pAttribs(pAttribs_) {}
};
static int LoadThunk(void* param, double time_left)
{
const ThunkParams* p = (const ThunkParams*)param;
CSimulation* const this_ = p->this_;
CGameAttributes* const pAttribs = p->pAttribs;
this_->Initialize(pAttribs);
delete p;
return 0;
}
void CSimulation::RegisterInit(CGameAttributes *pAttribs)
{
void* param = new ThunkParams(this, pAttribs);
THROW_ERR(LDR_Register(LoadThunk, param, L"CSimulation", 1000));
}
void CSimulation::Update(double frameTime)
{
m_DeltaTime += frameTime;