]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client/game.h
Merge branch 'master' of https://github.com/minetest/minetest
[dragonfireclient.git] / src / client / game.h
index cb40d48904639613ef8ded00282b39137e02ca3a..0e5d0550d296b156acd1652b7bfcf205197b5a95 100644 (file)
@@ -86,7 +86,7 @@ struct Jitter {
 };
 
 struct RunStats {
-       u32 drawtime;
+       u64 drawtime; // (us)
 
        Jitter dtime_jitter, busy_time_jitter;
 };
@@ -584,7 +584,7 @@ class GameGlobalShaderConstantSetterFactory : public IShaderConstantSetterFactor
        }
 };
 
-#ifdef __ANDROID__
+#ifdef HAVE_TOUCHSCREENGUI
 #define SIZE_TAG "size[11,5.5]"
 #else
 #define SIZE_TAG "size[11,5.5,true]" // Fixed size on desktop
@@ -596,7 +596,16 @@ class GameGlobalShaderConstantSetterFactory : public IShaderConstantSetterFactor
 const float object_hit_delay = 0.2;
 
 struct FpsControl {
-       u32 last_time, busy_time, sleep_time;
+       FpsControl() : last_time(0), busy_time(0), sleep_time(0) {}
+
+       void reset();
+
+       void limit(IrrlichtDevice *device, f32 *dtime);
+
+       u32 getBusyMs() const { return busy_time / 1000; }
+
+       // all values in microseconds (us)
+       u64 last_time, busy_time, sleep_time;
 };
 
 
@@ -726,9 +735,9 @@ class Game {
        void updatePlayerControl(const CameraOrientation &cam);
        void step(f32 *dtime);
        void processClientEvents(CameraOrientation *cam);
-       void updateCamera(u32 busy_time, f32 dtime);
+       void updateCamera(f32 dtime);
        void updateSound(f32 dtime);
-       void processPlayerInteraction(f32 dtime, bool show_hud, bool show_debug);
+       void processPlayerInteraction(f32 dtime, bool show_hud);
        /*!
         * Returns the object or node the player is pointing at.
         * Also updates the selected thing in the Hud.
@@ -757,8 +766,6 @@ class Game {
        void updateShadows();
 
        // Misc
-       void limitFps(FpsControl *fps_timings, f32 *dtime);
-
        void showOverlayMessage(const char *msg, float dtime, int percent,
                        bool draw_clouds = true);
 
@@ -807,7 +814,7 @@ class Game {
                CameraOrientation *cam);
        void handleClientEvent_CloudParams(ClientEvent *event, CameraOrientation *cam);
 
-       void updateChat(f32 dtime, const v2u32 &screensize);
+       void updateChat(f32 dtime);
 
        bool nodePlacement(const ItemDefinition &selected_def, const ItemStack &selected_item,
                const v3s16 &nodepos, const v3s16 &neighbourpos, const PointedThing &pointed,
@@ -904,12 +911,17 @@ class Game {
 
        bool m_does_lost_focus_pause_game = false;
 
-       CameraOrientation cam_view_target  = { 0 };
-       CameraOrientation cam_view  = { 0 };
+       CameraOrientation cam_view_target = {}; // added by dragonfireclient
+       CameraOrientation cam_view  = {};       // added by dragonfireclient
 
+#if IRRLICHT_VERSION_MT_REVISION < 5
        int m_reset_HW_buffer_counter = 0;
-#ifdef __ANDROID__
+#endif
+
+#ifdef HAVE_TOUCHSCREENGUI
        bool m_cache_hold_aux1;
+#endif
+#ifdef __ANDROID__
        bool m_android_chat_open;
 #endif
 };