From 38bffa070e20cb9950d6cbf947698b121e9038a0 Mon Sep 17 00:00:00 2001 From: guillaume abel Date: Tue, 3 Oct 2023 21:52:05 +0200 Subject: [PATCH 1/4] CLIENT-GAME: Update warnings --- src/Client/Systems/CustomTypes.hpp | 4 ++-- src/ECS/SparseArray.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Client/Systems/CustomTypes.hpp b/src/Client/Systems/CustomTypes.hpp index 6a3a1206..d904b8d2 100644 --- a/src/Client/Systems/CustomTypes.hpp +++ b/src/Client/Systems/CustomTypes.hpp @@ -33,8 +33,8 @@ namespace Types { moveRects(_moveRects), attackRects(_attackRects), deadRects(_deadRects), - currentRectInList(0), - currentRectList(Types::RectListType::DEFAULTRECT) + currentRectList(Types::RectListType::DEFAULTRECT), + currentRectInList(0) { } Rect defaultRect; diff --git a/src/ECS/SparseArray.hpp b/src/ECS/SparseArray.hpp index 1a2fb90d..b273b935 100644 --- a/src/ECS/SparseArray.hpp +++ b/src/ECS/SparseArray.hpp @@ -48,7 +48,7 @@ class SparseArray { "SparseArrays::erase: ID out of bounds!"); } std::size_t sparseValue = _sparse[id]; - if (sparseValue != -1) { + if (int(sparseValue) != -1) { removeDenses(id, sparseValue); } auto it = _sparse.begin(); From d92f639ac09a5c7932734f5f39d2da3a96371bbb Mon Sep 17 00:00:00 2001 From: guillaume abel Date: Tue, 3 Oct 2023 22:51:46 +0200 Subject: [PATCH 2/4] CLIENT-GAME: Fix warnings --- src/ECS/Registry.cpp | 8 ++++++-- src/ECS/SparseArray.hpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ECS/Registry.cpp b/src/ECS/Registry.cpp index cf7e9dc3..dfe278a6 100644 --- a/src/ECS/Registry.cpp +++ b/src/ECS/Registry.cpp @@ -112,8 +112,12 @@ std::vector> Registry::getFrontLayers() void Registry::initLayers(bool back) { - auto max = static_cast( - back ? BackLayers::BACKMAX : FrontLayers::FRONTMAX); + std::size_t max; + if (back) { + max = static_cast(BackLayers::BACKMAX); + } else { + max = static_cast(FrontLayers::FRONTMAX); + } for (std::size_t i = 0; i < max; i++) { std::vector> &layers = diff --git a/src/ECS/SparseArray.hpp b/src/ECS/SparseArray.hpp index b273b935..b5e8ce45 100644 --- a/src/ECS/SparseArray.hpp +++ b/src/ECS/SparseArray.hpp @@ -30,7 +30,7 @@ class SparseArray { "SparseArrays::insert: ID out of bounds!"); } - if (_sparse[id] > -1) { + if (static_cast(_sparse[id]) > -1) { _dense[_sparse[id]] = value; _revSparse[_sparse[id]] = id; return; From 8a5b94ff9d5a621cc995269af86acee7483c95f0 Mon Sep 17 00:00:00 2001 From: guillaume abel Date: Wed, 4 Oct 2023 10:17:22 +0200 Subject: [PATCH 3/4] ECS: Fix warnings --- src/ECS/Registry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ECS/Registry.cpp b/src/ECS/Registry.cpp index dfe278a6..569da36a 100644 --- a/src/ECS/Registry.cpp +++ b/src/ECS/Registry.cpp @@ -112,7 +112,7 @@ std::vector> Registry::getFrontLayers() void Registry::initLayers(bool back) { - std::size_t max; + std::size_t max = 0; if (back) { max = static_cast(BackLayers::BACKMAX); } else { From 3d33e311c2169daf2bbe80ea3b96d9225e2bafa5 Mon Sep 17 00:00:00 2001 From: tenshi Date: Wed, 4 Oct 2023 10:46:13 +0200 Subject: [PATCH 4/4] CLIENT-GAME: Fix last warnings --- src/Client/Raylib/Graphics/Graphics.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Client/Raylib/Graphics/Graphics.cpp b/src/Client/Raylib/Graphics/Graphics.cpp index d8a400a8..b35c27ef 100644 --- a/src/Client/Raylib/Graphics/Graphics.cpp +++ b/src/Client/Raylib/Graphics/Graphics.cpp @@ -457,7 +457,7 @@ namespace Raylib { } Sprite::Sprite(Image image, float width, float height) - : _texture({0, 0, 0, 0}), + : _texture(), _width(width), _height(height) { @@ -620,11 +620,11 @@ namespace Raylib { Text::Text(std::string text, Vector2 position, float fontSize, Color color) : _text(std::move(text)), - _position(position), _fontSize(fontSize), + _currentFontSize(fontSize), _color(color), - _pixelPosition(position), - _currentFontSize(fontSize) + _position(position), + _pixelPosition(position) { }