mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-23 23:51:49 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user