diff options
author | x2048 <codeforsmile@gmail.com> | 2022-08-13 22:33:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-13 22:33:26 +0200 |
commit | d1cbb4bd8a3fea147032fde63fdc4f5298f20217 (patch) | |
tree | eab23e9a249b59fd742c8fd4bd313f7d14f0af43 /src/client/clientenvironment.cpp | |
parent | 0e439b2fa3f0ba4f3352273519c32ebc9c3a680e (diff) | |
download | minetest-d1cbb4bd8a3fea147032fde63fdc4f5298f20217.tar.xz |
Reduce the use of porting::getTimeMs() when rendering frames (#12679)
* Avoid calling TimeTaker too frequently in renderMapXXX
* Calculate animation timer once per frame
* Remove code that breaks rendering frame at 2000ms
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'src/client/clientenvironment.cpp')
-rw-r--r-- | src/client/clientenvironment.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/clientenvironment.cpp b/src/client/clientenvironment.cpp index 5dc10f48f..d7b3c4950 100644 --- a/src/client/clientenvironment.cpp +++ b/src/client/clientenvironment.cpp @@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "settings.h" #include "shader.h" #include "content_cao.h" +#include "porting.h" #include <algorithm> #include "client/renderingengine.h" @@ -513,3 +514,8 @@ void ClientEnvironment::getSelectedActiveObjects( } } } + +void ClientEnvironment::updateFrameTime() +{ + m_frame_time = porting::getTimeMs(); +} |