]> git.lizzy.rs Git - minetest.git/blobdiff - src/client.h
Fix and tune stars
[minetest.git] / src / client.h
index ea3776895630a191b2fad1b605445501355a4450..1903f3aa7b56c1bc6bf0dd9ec06ce20bf6383e6d 100644 (file)
@@ -42,6 +42,8 @@ class IWritableTextureSource;
 class IWritableItemDefManager;
 class IWritableNodeDefManager;
 //class IWritableCraftDefManager;
+class ClientEnvironment;
+struct MapDrawControl;
 
 class ClientNotReadyException : public BaseException
 {
@@ -197,19 +199,12 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        */
        void step(float dtime);
 
-       // Called from updater thread
-       // Returns dtime
-       //float asyncStep();
-
        void ProcessData(u8 *data, u32 datasize, u16 sender_peer_id);
        // Returns true if something was received
        bool AsyncProcessPacket();
        bool AsyncProcessData();
        void Send(u16 channelnum, SharedBuffer<u8> data, bool reliable);
 
-       // Pops out a packet from the packet queue
-       //IncomingPacket getPacket();
-
        void interact(u8 action, const PointedThing& pointed);
 
        void sendSignNodeText(v3s16 p, std::string text);
@@ -219,23 +214,14 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
                const std::wstring newpassword);
        void sendDamage(u8 damage);
        void sendRespawn();
+
+       ClientEnvironment& getEnv()
+       { return m_env; }
        
-       // locks envlock
+       // Causes urgent mesh updates (unlike Map::add/removeNodeWithEvent)
        void removeNode(v3s16 p);
-       // locks envlock
        void addNode(v3s16 p, MapNode n);
        
-       void updateCamera(v3f pos, v3f dir, f32 fov);
-       
-       void renderPostFx();
-       
-       // Returns InvalidPositionException if not found
-       MapNode getNode(v3s16 p);
-       // Wrapper to Map
-       NodeMetadata* getNodeMetadata(v3s16 p);
-
-       LocalPlayer* getLocalPlayer();
-
        void setPlayerControl(PlayerControl &control);
 
        void selectPlayerItem(u16 item);
@@ -270,8 +256,6 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        int getCrackLevel();
        void setCrack(int level, v3s16 pos);
 
-       u32 getDayNightRatio();
-
        u16 getHP();
 
        float getAvgRtt()
@@ -364,8 +348,6 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        float m_animation_time;
        int m_crack_level;
        v3s16 m_crack_pos;
-       // Received from the server. 0-23999
-       u32 m_time_of_day;
        // 0 <= m_daynight_i < DAYNIGHT_CACHE_COUNT
        //s32 m_daynight_i;
        //u32 m_daynight_ratio;
@@ -381,6 +363,11 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
        bool m_itemdef_received;
        bool m_nodedef_received;
        friend class FarMesh;
+
+       // time_of_day speed approximation for old protocol
+       bool m_time_of_day_set;
+       float m_last_time_of_day_f;
+       float m_time_of_day_update_timer;
 };
 
 #endif // !SERVER