diff options
author | sfan5 <sfan5@live.de> | 2022-04-28 20:53:15 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-04-30 16:49:41 +0200 |
commit | a89afe1229e327da3c397a3912b2d43d2196ea2b (patch) | |
tree | 037748c56e51da62b884d7b83dec9ccf5958e06c /src/client | |
parent | faecff570c48350c599bcf043a7004a52ddf1b39 (diff) | |
download | minetest-a89afe1229e327da3c397a3912b2d43d2196ea2b.tar.gz minetest-a89afe1229e327da3c397a3912b2d43d2196ea2b.tar.bz2 minetest-a89afe1229e327da3c397a3912b2d43d2196ea2b.zip |
Deal with compiler warnings
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/client.h | 2 | ||||
-rw-r--r-- | src/client/clientmap.h | 16 | ||||
-rw-r--r-- | src/client/content_cao.cpp | 2 | ||||
-rw-r--r-- | src/client/content_cao.h | 2 | ||||
-rw-r--r-- | src/client/game.cpp | 6 | ||||
-rw-r--r-- | src/client/minimap.cpp | 2 | ||||
-rw-r--r-- | src/client/shadows/dynamicshadowsrender.cpp | 6 | ||||
-rw-r--r-- | src/client/shadows/dynamicshadowsrender.h | 1 |
8 files changed, 18 insertions, 19 deletions
diff --git a/src/client/client.h b/src/client/client.h index 0e29fdbe2..cb1227768 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -407,7 +407,7 @@ public: } ClientScripting *getScript() { return m_script; } - const bool modsLoaded() const { return m_mods_loaded; } + bool modsLoaded() const { return m_mods_loaded; } void pushToEventQueue(ClientEvent *event); diff --git a/src/client/clientmap.h b/src/client/clientmap.h index 7bd7af266..6d57f1911 100644 --- a/src/client/clientmap.h +++ b/src/client/clientmap.h @@ -81,9 +81,9 @@ public: return false; } - void drop() + void drop() override { - ISceneNode::drop(); + ISceneNode::drop(); // calls destructor } void updateCamera(v3f pos, v3f dir, f32 fov, v3s16 offset); @@ -91,24 +91,22 @@ public: /* Forcefully get a sector from somewhere */ - MapSector * emergeSector(v2s16 p); - - //void deSerializeSector(v2s16 p2d, std::istream &is); + MapSector * emergeSector(v2s16 p) override; /* ISceneNode methods */ - virtual void OnRegisterSceneNode(); + virtual void OnRegisterSceneNode() override; - virtual void render() + virtual void render() override { video::IVideoDriver* driver = SceneManager->getVideoDriver(); driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); renderMap(driver, SceneManager->getSceneNodeRenderPass()); } - virtual const aabb3f &getBoundingBox() const + virtual const aabb3f &getBoundingBox() const override { return m_box; } @@ -130,7 +128,7 @@ public: void renderPostFx(CameraMode cam_mode); // For debug printing - virtual void PrintInfo(std::ostream &out); + void PrintInfo(std::ostream &out) override; const MapDrawControl & getControl() const { return m_control; } f32 getWantedRange() const { return m_control.wanted_range; } diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp index 3c31d4a36..d89bb53b3 100644 --- a/src/client/content_cao.cpp +++ b/src/client/content_cao.cpp @@ -435,7 +435,7 @@ const v3f GenericCAO::getPosition() const return m_position; } -const bool GenericCAO::isImmortal() +bool GenericCAO::isImmortal() const { return itemgroup_get(getGroups(), "immortal"); } diff --git a/src/client/content_cao.h b/src/client/content_cao.h index 70f1557e1..783aa4199 100644 --- a/src/client/content_cao.h +++ b/src/client/content_cao.h @@ -172,7 +172,7 @@ public: inline const v3f &getRotation() const { return m_rotation; } - const bool isImmortal(); + bool isImmortal() const; inline const ObjectProperties &getProperties() const { return m_prop; } diff --git a/src/client/game.cpp b/src/client/game.cpp index 1290534eb..d21bdbe99 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -1063,9 +1063,9 @@ bool Game::startup(bool *kill, void Game::run() { ProfilerGraph graph; - RunStats stats = { 0 }; - CameraOrientation cam_view_target = { 0 }; - CameraOrientation cam_view = { 0 }; + RunStats stats; + CameraOrientation cam_view_target = {}; + CameraOrientation cam_view = {}; FpsControl draw_times; f32 dtime; // in seconds diff --git a/src/client/minimap.cpp b/src/client/minimap.cpp index f26aa1c70..320621d91 100644 --- a/src/client/minimap.cpp +++ b/src/client/minimap.cpp @@ -304,7 +304,7 @@ void Minimap::setModeIndex(size_t index) data->mode = m_modes[index]; m_current_mode_index = index; } else { - data->mode = MinimapModeDef{MINIMAP_TYPE_OFF, gettext("Minimap hidden"), 0, 0, ""}; + data->mode = {MINIMAP_TYPE_OFF, gettext("Minimap hidden"), 0, 0, "", 0}; m_current_mode_index = 0; } diff --git a/src/client/shadows/dynamicshadowsrender.cpp b/src/client/shadows/dynamicshadowsrender.cpp index a008c3e06..07dc6daf2 100644 --- a/src/client/shadows/dynamicshadowsrender.cpp +++ b/src/client/shadows/dynamicshadowsrender.cpp @@ -31,10 +31,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "profiler.h" ShadowRenderer::ShadowRenderer(IrrlichtDevice *device, Client *client) : - m_device(device), m_smgr(device->getSceneManager()), - m_driver(device->getVideoDriver()), m_client(client), m_current_frame(0), + m_smgr(device->getSceneManager()), m_driver(device->getVideoDriver()), + m_client(client), m_current_frame(0), m_perspective_bias_xy(0.8), m_perspective_bias_z(0.5) { + (void) m_client; + m_shadows_supported = true; // assume shadows supported. We will check actual support in initialize m_shadows_enabled = true; diff --git a/src/client/shadows/dynamicshadowsrender.h b/src/client/shadows/dynamicshadowsrender.h index bbeb254b0..0e4ef6b70 100644 --- a/src/client/shadows/dynamicshadowsrender.h +++ b/src/client/shadows/dynamicshadowsrender.h @@ -109,7 +109,6 @@ private: void enable() { m_shadows_enabled = m_shadows_supported; } // a bunch of variables - IrrlichtDevice *m_device{nullptr}; scene::ISceneManager *m_smgr{nullptr}; video::IVideoDriver *m_driver{nullptr}; Client *m_client{nullptr}; |