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.h | |
| 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.h')
| -rw-r--r-- | src/client/clientenvironment.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/clientenvironment.h b/src/client/clientenvironment.h index 864496a41..f737f33b4 100644 --- a/src/client/clientenvironment.h +++ b/src/client/clientenvironment.h @@ -141,6 +141,10 @@ public: void updateCameraOffset(const v3s16 &camera_offset) { m_camera_offset = camera_offset; } v3s16 getCameraOffset() const { return m_camera_offset; } + + void updateFrameTime(); + u64 getFrameTime() const { return m_frame_time; } + private: ClientMap *m_map; LocalPlayer *m_local_player = nullptr; @@ -153,4 +157,5 @@ private: IntervalLimiter m_active_object_light_update_interval; std::list<std::string> m_player_names; v3s16 m_camera_offset; + u64 m_frame_time; }; |
