mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-27 23:12:49 +00:00
Avoid running the old simulation code in the background when it's not needed.
Optimise GUI updates to only occur when necessary. Switch to more peaceful music after starting the game. This was SVN commit r7492.
This commit is contained in:
@@ -86,7 +86,7 @@ public:
|
||||
bool LoadScripts(const VfsPath& path);
|
||||
LibError ReloadChangedFile(const VfsPath& path);
|
||||
|
||||
void Update(float frameTime);
|
||||
bool Update(float frameTime);
|
||||
void Interpolate(float frameTime);
|
||||
|
||||
CSimContext m_SimContext;
|
||||
@@ -141,7 +141,7 @@ LibError CSimulation2Impl::ReloadChangedFile(const VfsPath& path)
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
void CSimulation2Impl::Update(float frameTime)
|
||||
bool CSimulation2Impl::Update(float frameTime)
|
||||
{
|
||||
// TODO: Use CTurnManager
|
||||
m_DeltaTime += frameTime;
|
||||
@@ -168,7 +168,10 @@ void CSimulation2Impl::Update(float frameTime)
|
||||
m_ComponentManager.FlushDestroyedComponents();
|
||||
|
||||
++m_TurnNumber;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CSimulation2Impl::Interpolate(float frameTime)
|
||||
@@ -255,9 +258,9 @@ void CSimulation2::InitGame(const CScriptVal& data)
|
||||
GetScriptInterface().CallFunction(GetScriptInterface().GetGlobalObject(), "InitGame", data, ret);
|
||||
}
|
||||
|
||||
void CSimulation2::Update(float frameTime)
|
||||
bool CSimulation2::Update(float frameTime)
|
||||
{
|
||||
m->Update(frameTime);
|
||||
return m->Update(frameTime);
|
||||
}
|
||||
|
||||
void CSimulation2::Interpolate(float frameTime)
|
||||
|
||||
Reference in New Issue
Block a user