This commit is contained in:
turanszkij
2019-04-19 11:01:33 +01:00
parent a49d869991
commit 8561e450c1
3 changed files with 8 additions and 14 deletions
+6 -11
View File
@@ -123,28 +123,23 @@ void MainComponent::Run()
wiProfiler::BeginFrame();
wiProfiler::BeginRange("CPU Frame", wiProfiler::DOMAIN_CPU);
if (framerate_lock)
{
deltaTime = 1.0f / targetFrameRate;
}
else
{
deltaTime = float(max(0, timer.elapsed() / 1000.0));
}
deltaTime = float(max(0, timer.elapsed() / 1000.0));
timer.record();
if (wiWindowRegistration::IsWindowActive())
{
// If the application is active, run Update loops:
fadeManager.Update(deltaTime);
const float dt = framerate_lock ? (1.0f / targetFrameRate) : deltaTime;
fadeManager.Update(dt);
// Fixed time update:
wiProfiler::BeginRange("Fixed Update", wiProfiler::DOMAIN_CPU);
{
if (frameskip)
{
deltaTimeAccumulator += deltaTime;
deltaTimeAccumulator += dt;
if (deltaTimeAccumulator > 10)
{
// application probably lost control, fixed update would be take long
@@ -167,7 +162,7 @@ void MainComponent::Run()
// Variable-timed update:
wiProfiler::BeginRange("Update", wiProfiler::DOMAIN_CPU);
Update(deltaTime);
Update(dt);
wiProfiler::EndRange(); // Update
wiInputManager::Update();
+1 -2
View File
@@ -154,10 +154,9 @@ namespace wiProfiler
}
void EndRange(GRAPHICSTHREAD threadID)
{
if (!ENABLED || !initialized)
if (!ENABLED || !initialized || rangeStack.empty())
return;
assert(!rangeStack.empty() && "There is no range to end!");
const std::string& top = rangeStack.top();
auto& it = ranges.find(top);
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wiVersion
// minor features, major updates
const int minor = 26;
// minor bug fixes, alterations, refactors, updates
const int revision = 11;
const int revision = 12;
long GetVersion()