Fix only one texture being updated on window resize breaking sidebyside and topbottom...
[oweals/minetest.git] / src / client.h
index 52d285ac41626a7be2ee8a32dfc9ae3624f26338..51ce5b8f22a30df5031b32b9fe6d2e3216fef9a4 100644 (file)
@@ -57,6 +57,12 @@ struct QueuedMeshUpdate
        ~QueuedMeshUpdate();
 };
 
+enum LocalClientState {
+       LC_Created,
+       LC_Init,
+       LC_Ready
+};
+
 /*
        A thread-safe queue of mesh update tasks
 */
@@ -119,6 +125,8 @@ public:
        MutexedQueue<MeshUpdateResult> m_queue_out;
 
        IGameDef *m_gamedef;
+       
+       v3s16 m_camera_offset;
 };
 
 enum ClientEventType
@@ -207,6 +215,7 @@ struct ClientEvent
                        v2f *align;
                        v2f *offset;
                        v3f *world_pos;
+                       v2s32 * size;
                } hudadd;
                struct{
                        u32 id;
@@ -218,6 +227,7 @@ struct ClientEvent
                        std::string *sdata;
                        u32 data;
                        v3f *v3fdata;
+                       v2s32 * v2s32data;
                } hudchange;
                struct{
                        video::SColor *bgcolor;
@@ -317,14 +327,7 @@ public:
                calling this, as it is sent in the initialization.
        */
        void connect(Address address);
-       /*
-               returns true when
-                       m_con.Connected() == true
-                       AND m_server_ser_ver != SER_FMT_VER_INVALID
-               throws con::PeerNotFoundException if connection has been deleted,
-               eg. timed out.
-       */
-       bool connectedAndInitialized();
+
        /*
                Stuff that references the environment is valid only as
                long as this is not called. (eg. Players)
@@ -347,11 +350,12 @@ public:
                        const std::map<std::string, std::string> &fields);
        void sendInventoryAction(InventoryAction *a);
        void sendChatMessage(const std::wstring &message);
-       void sendChangePassword(const std::wstring oldpassword,
-                       const std::wstring newpassword);
+       void sendChangePassword(const std::wstring &oldpassword,
+                               const std::wstring &newpassword);
        void sendDamage(u8 damage);
        void sendBreath(u16 breath);
        void sendRespawn();
+       void sendReady();
 
        ClientEnvironment& getEnv()
        { return m_env; }
@@ -406,6 +410,9 @@ public:
        // Including blocks at appropriate edges
        void addUpdateMeshTaskWithEdge(v3s16 blockpos, bool ack_to_server=false, bool urgent=false);
        void addUpdateMeshTaskForNode(v3s16 nodepos, bool ack_to_server=false, bool urgent=false);
+       
+       void updateCameraOffset(v3s16 camera_offset)
+       { m_mesh_update_thread.m_camera_offset = camera_offset; }
 
        // Get event from queue. CE_NONE is returned if queue is empty.
        ClientEvent getClientEvent();
@@ -428,6 +435,8 @@ public:
        void afterContentReceived(IrrlichtDevice *device, gui::IGUIFont* font);
 
        float getRTT(void);
+       float getCurRate(void);
+       float getAvgRate(void);
 
        // IGameDef interface
        virtual IItemDefManager* getItemDefManager();
@@ -450,6 +459,8 @@ public:
        // Send a notification that no conventional media transfer is needed
        void received_media();
 
+       LocalClientState getState() { return m_state; }
+
 private:
 
        // Virtual methods from con::PeerHandler
@@ -533,6 +544,9 @@ private:
 
        // Storage for mesh data for creating multiple instances of the same mesh
        std::map<std::string, std::string> m_mesh_data;
+
+       // own state
+       LocalClientState m_state;
 };
 
 #endif // !CLIENT_HEADER