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:
parent
0e439b2fa3
commit
d1cbb4bd8a
4 changed files with 19 additions and 16 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue