]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/remoteplayer.h
upright_sprite: Fix walk animation in first person (#12194)
[dragonfireclient.git] / src / remoteplayer.h
index 260504fb4379400455a5a77ac139c34a1fb29f0b..0ab33adfe18e3d0a815941e757eab5029f7c72fb 100644 (file)
@@ -21,7 +21,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #pragma once
 
 #include "player.h"
-#include "cloudparams.h"
+#include "skyparams.h"
+#include "lighting.h"
 
 class PlayerSAO;
 
@@ -43,12 +44,10 @@ class RemotePlayer : public Player
        RemotePlayer(const char *name, IItemDefManager *idef);
        virtual ~RemotePlayer() = default;
 
-       void deSerialize(std::istream &is, const std::string &playername, PlayerSAO *sao);
-
        PlayerSAO *getPlayerSAO() { return m_sao; }
        void setPlayerSAO(PlayerSAO *sao) { m_sao = sao; }
 
-       const RemotePlayerChatResult canSendChatMessage();
+       RemotePlayerChatResult canSendChatMessage();
 
        void setHotbarItemcount(s32 hotbar_itemcount)
        {
@@ -83,23 +82,24 @@ class RemotePlayer : public Player
                return hud_hotbar_selected_image;
        }
 
-       void setSky(const video::SColor &bgcolor, const std::string &type,
-                       const std::vector<std::string> &params, bool &clouds)
+       void setSky(const SkyboxParams &skybox_params)
        {
-               m_sky_bgcolor = bgcolor;
-               m_sky_type = type;
-               m_sky_params = params;
-               m_sky_clouds = clouds;
+               m_skybox_params = skybox_params;
        }
 
-       void getSky(video::SColor *bgcolor, std::string *type,
-                       std::vector<std::string> *params, bool *clouds)
-       {
-               *bgcolor = m_sky_bgcolor;
-               *type = m_sky_type;
-               *params = m_sky_params;
-               *clouds = m_sky_clouds;
-       }
+       const SkyboxParams &getSkyParams() const { return m_skybox_params; }
+
+       void setSun(const SunParams &sun_params) { m_sun_params = sun_params; }
+
+       const SunParams &getSunParams() const { return m_sun_params; }
+
+       void setMoon(const MoonParams &moon_params) { m_moon_params = moon_params; }
+
+       const MoonParams &getMoonParams() const { return m_moon_params; }
+
+       void setStars(const StarParams &star_params) { m_star_params = star_params; }
+
+       const StarParams &getStarParams() const { return m_star_params; }
 
        void setCloudParams(const CloudParams &cloud_params)
        {
@@ -126,9 +126,14 @@ class RemotePlayer : public Player
                *frame_speed = local_animation_speed;
        }
 
+       void setLighting(const Lighting &lighting) { m_lighting = lighting; }
+
+       const Lighting& getLighting() const { return m_lighting; }
+
        void setDirty(bool dirty) { m_dirty = true; }
 
        u16 protocol_version = 0;
+       u16 formspec_version = 0;
 
        session_t getPeerId() const { return m_peer_id; }
 
@@ -137,14 +142,6 @@ class RemotePlayer : public Player
        void onSuccessfulSave();
 
 private:
-       /*
-               serialize() writes a bunch of text that can contain
-               any characters except a '\0', and such an ending that
-               deSerialize stops reading exactly at the right point.
-       */
-       void serialize(std::ostream &os);
-       void serializeExtraAttributes(std::string &output);
-
        PlayerSAO *m_sao = nullptr;
        bool m_dirty = false;
 
@@ -161,12 +158,14 @@ class RemotePlayer : public Player
        std::string hud_hotbar_image = "";
        std::string hud_hotbar_selected_image = "";
 
-       std::string m_sky_type;
-       video::SColor m_sky_bgcolor;
-       std::vector<std::string> m_sky_params;
-       bool m_sky_clouds;
-
        CloudParams m_cloud_params;
 
+       SkyboxParams m_skybox_params;
+       SunParams m_sun_params;
+       MoonParams m_moon_params;
+       StarParams m_star_params;
+
+       Lighting m_lighting;
+
        session_t m_peer_id = PEER_ID_INEXISTENT;
 };