diff options
author | Elisey Puzko <puzko.e02@gmail.com> | 2018-02-20 11:09:39 +0100 |
---|---|---|
committer | Elisey Puzko <puzko.e02@gmail.com> | 2018-02-20 11:09:39 +0100 |
commit | 99354db9db9be0f921980f081ee7ed6515d2dcdc (patch) | |
tree | c48ef29357234ea618472bf3ec796c03b7f2a647 /src/Utility.cpp | |
parent | Another attempt at increasing readability (diff) | |
download | AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.tar AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.tar.gz AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.tar.bz2 AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.tar.lz AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.tar.xz AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.tar.zst AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.zip |
Diffstat (limited to 'src/Utility.cpp')
-rw-r--r-- | src/Utility.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Utility.cpp b/src/Utility.cpp index 0fb10cf..c498fa3 100644 --- a/src/Utility.cpp +++ b/src/Utility.cpp @@ -37,7 +37,8 @@ GLenum glCheckError_(const char *file, int line) { return errorCode; } -LoopExecutionTimeController::LoopExecutionTimeController(duration delayLength) : delayLength(delayLength) { +LoopExecutionTimeController::LoopExecutionTimeController(duration delayLength) + : delayLength(delayLength) { previousUpdate = clock::now(); } @@ -77,13 +78,11 @@ double LoopExecutionTimeController::GetDeltaS() { return delta.count(); } -double LoopExecutionTimeController::GetRealDeltaS() -{ +double LoopExecutionTimeController::GetRealDeltaS() { return std::chrono::duration<double,std::ratio<1,1>>(previousUpdate - previousPreviousUpdate).count(); } -double LoopExecutionTimeController::RemainTimeMs() -{ +double LoopExecutionTimeController::RemainTimeMs() { auto remain = delayLength - GetDelta(); return remain.count(); } |