Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/system/TurnManager.cpp
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | bool CTurnManager::UpdateFastForward() | ||||
return true; | return true; | ||||
} | } | ||||
void CTurnManager::Interpolate(float simFrameLength, float realFrameLength) | void CTurnManager::Interpolate(float simFrameLength, float realFrameLength) | ||||
{ | { | ||||
// TODO: using m_TurnLength might be a bit dodgy when length changes - maybe | // TODO: using m_TurnLength might be a bit dodgy when length changes - maybe | ||||
// we need to save the previous turn length? | // we need to save the previous turn length? | ||||
float offset = clamp(m_DeltaSimTime / (m_TurnLength / 1000.f) + 1.0, 0.0, 1.0); | float offset = Clamp(m_DeltaSimTime / (m_TurnLength / 1000.f) + 1.0, 0.0, 1.0); | ||||
Stan: missing f / static_casts | |||||
vladislavbelovAuthorUnsubmitted Done Inline ActionsNo need to use static_cast here, all other elements are float. vladislavbelov: No need to use `static_cast` here, all other elements are `float`. | |||||
// Stop animations while still updating the selection highlight | // Stop animations while still updating the selection highlight | ||||
if (m_CurrentTurn > m_FinalTurn) | if (m_CurrentTurn > m_FinalTurn) | ||||
simFrameLength = 0; | simFrameLength = 0; | ||||
m_Simulation2.Interpolate(simFrameLength, offset, realFrameLength); | m_Simulation2.Interpolate(simFrameLength, offset, realFrameLength); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
missing f / static_casts