Skip to content

Commit

Permalink
Merge pull request #45 from X-R-G-B/fix/RB-76-fix-warnings
Browse files Browse the repository at this point in the history
Fix/rb 76 fix warnings
  • Loading branch information
guillaumeAbel authored Oct 4, 2023
2 parents 6c8c2e2 + 3d33e31 commit 47bfd17
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/Client/Raylib/Graphics/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ namespace Raylib {
}

Sprite::Sprite(Image image, float width, float height)
: _texture({0, 0, 0, 0}),
: _texture(),
_width(width),
_height(height)
{
Expand Down Expand Up @@ -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)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Client/Systems/CustomTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 6 additions & 2 deletions src/ECS/Registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ std::vector<std::vector<std::size_t>> Registry::getFrontLayers()

void Registry::initLayers(bool back)
{
auto max = static_cast<std::size_t>(
back ? BackLayers::BACKMAX : FrontLayers::FRONTMAX);
std::size_t max = 0;
if (back) {
max = static_cast<std::size_t>(BackLayers::BACKMAX);
} else {
max = static_cast<std::size_t>(FrontLayers::FRONTMAX);
}

for (std::size_t i = 0; i < max; i++) {
std::vector<std::vector<std::size_t>> &layers =
Expand Down
4 changes: 2 additions & 2 deletions src/ECS/SparseArray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SparseArray {
"SparseArrays::insert: ID out of bounds!");
}

if (_sparse[id] > -1) {
if (static_cast<int>(_sparse[id]) > -1) {
_dense[_sparse[id]] = value;
_revSparse[_sparse[id]] = id;
return;
Expand All @@ -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();
Expand Down

0 comments on commit 47bfd17

Please sign in to comment.