1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-05 18:41:05 +00:00

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>
This commit is contained in:
x2048 2022-08-13 22:33:26 +02:00 committed by GitHub
parent 0e439b2fa3
commit d1cbb4bd8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 16 deletions

View file

@ -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;
};