diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a2f7504..ab315dbc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(bomberman) set(CMAKE_CXX_STANDARD 20) if (CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -Wno-unused-param -W -Werror -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -Wno-unused-parameter -W -Werror -g") endif() set(CMAKE_CXX_FLAGS_RELEASE "-O2") diff --git a/lib/Ray/CMakeLists.txt b/lib/Ray/CMakeLists.txt index 11540070..45042747 100644 --- a/lib/Ray/CMakeLists.txt +++ b/lib/Ray/CMakeLists.txt @@ -7,9 +7,9 @@ project("${LIB_NAME}") include_directories(${LIB_NAME} ./sources) if (CMAKE_COMPILER_IS_GNUCXX) - set(GCC_COVERAGE_COMPILE_FLAGS "-Wall -Wextra -Werror -Wshadow") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}") -endif () + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -Werror -Wno-unused-parameter -g") +endif() +set(CMAKE_CXX_FLAGS_RELEASE "-O2") set(HEADERS sources/Color.hpp diff --git a/lib/wal/CMakeLists.txt b/lib/wal/CMakeLists.txt index c9227eab..465ede45 100644 --- a/lib/wal/CMakeLists.txt +++ b/lib/wal/CMakeLists.txt @@ -4,7 +4,7 @@ project(wal) set(CMAKE_CXX_STANDARD 20) if (CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -Werror -Wno-unused-param -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -Werror -Wno-unused-parameter -g") endif() set(CMAKE_CXX_FLAGS_RELEASE "-O2") diff --git a/sources/Component/Bomb/BasicBombComponent.cpp b/sources/Component/Bomb/BasicBombComponent.cpp index 9de464d7..d961f37c 100644 --- a/sources/Component/Bomb/BasicBombComponent.cpp +++ b/sources/Component/Bomb/BasicBombComponent.cpp @@ -8,10 +8,10 @@ namespace BBM { - BasicBombComponent::BasicBombComponent(WAL::Entity &entity, int damage, int explosionRadius, std::vector ignored) + BasicBombComponent::BasicBombComponent(WAL::Entity &entity, int damageHit, int radius, std::vector ignored) : WAL::Component(entity), - damage(damage), - explosionRadius(explosionRadius), + explosionRadius(radius), + damage(damageHit), ignoredEntities(std::move(ignored)) {} diff --git a/sources/Component/Bomb/BasicBombComponent.hpp b/sources/Component/Bomb/BasicBombComponent.hpp index 5d3838c8..ca1831a7 100644 --- a/sources/Component/Bomb/BasicBombComponent.hpp +++ b/sources/Component/Bomb/BasicBombComponent.hpp @@ -26,7 +26,7 @@ namespace BBM WAL::Component *clone(WAL::Entity &entity) const override; //! @brief A component can't be instantiated, it should be derived. - explicit BasicBombComponent(WAL::Entity &entity, int damage, int explosionRadius, std::vector ignored); + explicit BasicBombComponent(WAL::Entity &entity, int damageHit, int radius, std::vector ignored); //! @brief A component can't be instantiated, it should be derived. BasicBombComponent(const BasicBombComponent &) = default; diff --git a/sources/Component/BombHolder/BombHolderComponent.cpp b/sources/Component/BombHolder/BombHolderComponent.cpp index 9f75b8ae..13480cda 100644 --- a/sources/Component/BombHolder/BombHolderComponent.cpp +++ b/sources/Component/BombHolder/BombHolderComponent.cpp @@ -12,9 +12,9 @@ namespace BBM : WAL::Component(entity) {} - BombHolderComponent::BombHolderComponent(WAL::Entity &entity, unsigned int maxBombCount) + BombHolderComponent::BombHolderComponent(WAL::Entity &entity, unsigned int maxCount) : WAL::Component(entity), - maxBombCount(maxBombCount) + maxBombCount(maxCount) {} WAL::Component *BombHolderComponent::clone(WAL::Entity &entity) const diff --git a/sources/Component/Collision/CollisionComponent.cpp b/sources/Component/Collision/CollisionComponent.cpp index 759e6d21..8f12113d 100644 --- a/sources/Component/Collision/CollisionComponent.cpp +++ b/sources/Component/Collision/CollisionComponent.cpp @@ -16,43 +16,43 @@ namespace BBM } CollisionComponent::CollisionComponent(WAL::Entity &entity, - const WAL::Callback &onCollide, - const WAL::Callback &onCollided, - Vector3f positionOffset, - Vector3f bound) + const WAL::Callback &onCollideCallback, + const WAL::Callback &onCollidedCallback, + Vector3f positionOffsetVector, + Vector3f boundVector) : WAL::Component(entity), - onCollide(onCollide), - onCollided(onCollided), - bound(bound), - positionOffset(positionOffset) + onCollide(onCollideCallback), + onCollided(onCollidedCallback), + bound(boundVector), + positionOffset(positionOffsetVector) {} CollisionComponent::CollisionComponent(WAL::Entity &entity, - const WAL::Callback &onCollide, - const WAL::Callback &onCollided, - float positionOffset, + const WAL::Callback &onCollideCallback, + const WAL::Callback &onCollidedCallback, + float positionOffsetFloat, float boundSize) : WAL::Component(entity), - onCollide(onCollide), - onCollided(onCollided), + onCollide(onCollideCallback), + onCollided(onCollidedCallback), bound({boundSize, boundSize, boundSize}), - positionOffset({positionOffset, positionOffset, positionOffset}) + positionOffset({positionOffsetFloat, positionOffsetFloat, positionOffsetFloat}) {} - CollisionComponent::CollisionComponent(WAL::Entity &entity, Vector3f positionOffset, Vector3f bound) + CollisionComponent::CollisionComponent(WAL::Entity &entity, Vector3f positionOffsetVector, Vector3f boundVector) : WAL::Component(entity), onCollide(), onCollided(), - bound(bound), - positionOffset(positionOffset) + bound(boundVector), + positionOffset(positionOffsetVector) {} - CollisionComponent::CollisionComponent(WAL::Entity &entity, float positionOffset, float boundSize) + CollisionComponent::CollisionComponent(WAL::Entity &entity, float positionOffsetFloat, float boundSize) : WAL::Component(entity), onCollide(), onCollided(), bound({boundSize, boundSize, boundSize}), - positionOffset({positionOffset, positionOffset, positionOffset}) + positionOffset({positionOffsetFloat, positionOffsetFloat, positionOffsetFloat}) {} CollisionComponent::CollidedAxis operator|(CollisionComponent::CollidedAxis first, diff --git a/sources/Component/Color/ColorComponent.cpp b/sources/Component/Color/ColorComponent.cpp index 994f7f10..5d2ec1ac 100644 --- a/sources/Component/Color/ColorComponent.cpp +++ b/sources/Component/Color/ColorComponent.cpp @@ -7,9 +7,9 @@ namespace BBM { - ColorComponent::ColorComponent(WAL::Entity &entity, RAY::Color color) + ColorComponent::ColorComponent(WAL::Entity &entity, RAY::Color componentColor) : Component(entity), - color(color) + color(componentColor) {} ColorComponent::ColorComponent(WAL::Entity &entity, unsigned char r, unsigned char g, unsigned char b, unsigned char a) diff --git a/sources/Component/Color/ColorComponent.hpp b/sources/Component/Color/ColorComponent.hpp index d75b5818..7b269ca2 100644 --- a/sources/Component/Color/ColorComponent.hpp +++ b/sources/Component/Color/ColorComponent.hpp @@ -20,7 +20,7 @@ namespace BBM WAL::Component *clone(WAL::Entity &entity) const override; //! @brief Create a new ColorComponent at a certain color - ColorComponent(WAL::Entity &entity, RAY::Color color); + ColorComponent(WAL::Entity &entity, RAY::Color componentColor); //! @brief Create a new ColorComponent at a certain color ColorComponent(WAL::Entity &entity, unsigned char r, unsigned char g, unsigned char b, unsigned char a); //! @brief A color component is copy constructable diff --git a/sources/Component/Health/HealthComponent.cpp b/sources/Component/Health/HealthComponent.cpp index 9063520b..9b0013b5 100644 --- a/sources/Component/Health/HealthComponent.cpp +++ b/sources/Component/Health/HealthComponent.cpp @@ -10,10 +10,10 @@ namespace BBM { - HealthComponent::HealthComponent(WAL::Entity &entity, unsigned int healthPoint, const WAL::Callback &onDeath) + HealthComponent::HealthComponent(WAL::Entity &entity, unsigned int healthPoint, const WAL::Callback &onDeathCallback) : WAL::Component(entity), _healthPoint(healthPoint), - onDeath(onDeath) + onDeath(onDeathCallback) {} WAL::Component *HealthComponent::clone(WAL::Entity &entity) const diff --git a/sources/Component/Health/HealthComponent.hpp b/sources/Component/Health/HealthComponent.hpp index 3be3c979..5d32d527 100644 --- a/sources/Component/Health/HealthComponent.hpp +++ b/sources/Component/Health/HealthComponent.hpp @@ -37,7 +37,7 @@ namespace BBM WAL::Component *clone(WAL::Entity &entity) const override; //! @brief Constructor - HealthComponent(WAL::Entity &entity, unsigned int healthPoint, const WAL::Callback &onDeath = WAL::Callback()); + HealthComponent(WAL::Entity &entity, unsigned int healthPoint, const WAL::Callback &onDeathCallback = WAL::Callback()); //! @brief A Health component can't be instantiated, it should be derived. HealthComponent(const HealthComponent &) = default; diff --git a/sources/Component/Keyboard/KeyboardComponent.cpp b/sources/Component/Keyboard/KeyboardComponent.cpp index ba5f6f8f..632300be 100644 --- a/sources/Component/Keyboard/KeyboardComponent.cpp +++ b/sources/Component/Keyboard/KeyboardComponent.cpp @@ -8,8 +8,8 @@ namespace BBM { - KeyboardComponent::KeyboardComponent(WAL::Entity &entity, ControllableComponent::Layout layout) - : WAL::Component(entity), layout(layout) + KeyboardComponent::KeyboardComponent(WAL::Entity &entity, ControllableComponent::Layout controllerLayout) + : WAL::Component(entity), layout(controllerLayout) { if (layout == ControllableComponent::KEYBOARD_0) { this->keyUp = KEY_W; diff --git a/sources/Component/Keyboard/KeyboardComponent.hpp b/sources/Component/Keyboard/KeyboardComponent.hpp index eebe85e1..d7608ed5 100644 --- a/sources/Component/Keyboard/KeyboardComponent.hpp +++ b/sources/Component/Keyboard/KeyboardComponent.hpp @@ -40,7 +40,7 @@ namespace BBM void onStart() override; //! @brief Create a new keyboard component using custom keys. - explicit KeyboardComponent(WAL::Entity &entity, ControllableComponent::Layout layout = ControllableComponent::Layout::KEYBOARD_0); + explicit KeyboardComponent(WAL::Entity &entity, ControllableComponent::Layout controllerLayout = ControllableComponent::Layout::KEYBOARD_0); //! @brief A Keyboard component is copy constructable. KeyboardComponent(const KeyboardComponent &) = default; diff --git a/sources/Component/Levitate/LevitateComponent.cpp b/sources/Component/Levitate/LevitateComponent.cpp index 1e6f3c5f..9d0b9ff8 100644 --- a/sources/Component/Levitate/LevitateComponent.cpp +++ b/sources/Component/Levitate/LevitateComponent.cpp @@ -11,9 +11,9 @@ namespace BBM y() {} - LevitateComponent::LevitateComponent(WAL::Entity &entity, float y) + LevitateComponent::LevitateComponent(WAL::Entity &entity, float entityY) : WAL::Component(entity), - y(y) + y(entityY) {} WAL::Component *LevitateComponent::clone(WAL::Entity &entity) const diff --git a/sources/Component/Levitate/LevitateComponent.hpp b/sources/Component/Levitate/LevitateComponent.hpp index d2868956..81875f72 100644 --- a/sources/Component/Levitate/LevitateComponent.hpp +++ b/sources/Component/Levitate/LevitateComponent.hpp @@ -24,7 +24,7 @@ namespace BBM { explicit LevitateComponent(WAL::Entity &entity); //! @brief Create a new levitate component. - LevitateComponent(WAL::Entity &entity, float y); + LevitateComponent(WAL::Entity &entity, float entityY); //! @brief A Levitate component is copy constructable. LevitateComponent(const LevitateComponent &) = default; diff --git a/sources/Component/Lobby/LobbyComponent.cpp b/sources/Component/Lobby/LobbyComponent.cpp index a945f112..34be3425 100644 --- a/sources/Component/Lobby/LobbyComponent.cpp +++ b/sources/Component/Lobby/LobbyComponent.cpp @@ -6,11 +6,11 @@ namespace BBM { - LobbyComponent::LobbyComponent(WAL::Entity &entity, int playerID, WAL::Entity &readyButton, WAL::Entity &coloredTile) + LobbyComponent::LobbyComponent(WAL::Entity &entity, int playerNumber, WAL::Entity &button, WAL::Entity &tile) : WAL::Component(entity), - playerID(playerID), - readyButton(readyButton), - coloredTile(coloredTile) + playerID(playerNumber), + readyButton(button), + coloredTile(tile) {} WAL::Component *LobbyComponent::clone(WAL::Entity &entity) const diff --git a/sources/Component/Lobby/LobbyComponent.hpp b/sources/Component/Lobby/LobbyComponent.hpp index 4061d1ce..961b5d78 100644 --- a/sources/Component/Lobby/LobbyComponent.hpp +++ b/sources/Component/Lobby/LobbyComponent.hpp @@ -33,7 +33,7 @@ namespace BBM Component *clone(WAL::Entity &entity) const override; //! @brief Create a new lobby component. - explicit LobbyComponent(WAL::Entity &entity, int playerID, WAL::Entity &readyButton, WAL::Entity &coloredTile); + explicit LobbyComponent(WAL::Entity &entity, int playerNumber, WAL::Entity &button, WAL::Entity &tile); //! @brief A lobby component is copyable. LobbyComponent(const LobbyComponent &) = default; //! @brief A default destructor diff --git a/sources/Component/Music/MusicComponent.cpp b/sources/Component/Music/MusicComponent.cpp index ae6a9151..32eb6120 100644 --- a/sources/Component/Music/MusicComponent.cpp +++ b/sources/Component/Music/MusicComponent.cpp @@ -11,8 +11,8 @@ namespace BBM MusicComponent::MusicComponent(WAL::Entity &entity, const std::string &musicPath) : WAL::Component(entity), - _musicPath(musicPath), - _music(RAY::Audio::Music(musicPath)) + _music(RAY::Audio::Music(musicPath)), + _musicPath(musicPath) { } diff --git a/sources/Component/Renderer/CameraComponent.cpp b/sources/Component/Renderer/CameraComponent.cpp index 5934d527..2d0c3de1 100644 --- a/sources/Component/Renderer/CameraComponent.cpp +++ b/sources/Component/Renderer/CameraComponent.cpp @@ -6,9 +6,9 @@ namespace BBM { - CameraComponent::CameraComponent(WAL::Entity &entity, Vector3f target) + CameraComponent::CameraComponent(WAL::Entity &entity, Vector3f cameraTarget) : Component(entity), - target(target) + target(cameraTarget) {} WAL::Component *BBM::CameraComponent::clone(WAL::Entity &entity) const diff --git a/sources/Component/Renderer/CameraComponent.hpp b/sources/Component/Renderer/CameraComponent.hpp index 3f8e7fc5..84d166c2 100644 --- a/sources/Component/Renderer/CameraComponent.hpp +++ b/sources/Component/Renderer/CameraComponent.hpp @@ -21,7 +21,7 @@ namespace BBM Component *clone(WAL::Entity &entity) const override; //! @brief Ctor - explicit CameraComponent(WAL::Entity &, Vector3f target = Vector3f()); + explicit CameraComponent(WAL::Entity &, Vector3f cameraTarget = Vector3f()); //! @brief A camera component is copy constructable. CameraComponent(const CameraComponent &) = default; //! @brief Default destructor. diff --git a/sources/Component/Renderer/Drawable2DComponent.hpp b/sources/Component/Renderer/Drawable2DComponent.hpp index c6f86044..9de6c1eb 100644 --- a/sources/Component/Renderer/Drawable2DComponent.hpp +++ b/sources/Component/Renderer/Drawable2DComponent.hpp @@ -21,26 +21,26 @@ namespace BBM std::shared_ptr drawable; //! @brief ctor - Drawable2DComponent(WAL::Entity &entity, std::shared_ptr drawable, bool drawBefore3D = false) + Drawable2DComponent(WAL::Entity &entity, std::shared_ptr drawable2D, bool drawBehind3D = false) : WAL::Component(entity), - drawable(std::move(drawable)), - drawBefore3D(drawBefore3D) + drawBefore3D(drawBehind3D), + drawable(std::move(drawable2D)) {} //! ctor template explicit Drawable2DComponent(WAL::Entity &entity, WAL::TypeHolder, Params &&...params) : WAL::Component(entity), - drawable(new T(std::forward(params)...)), - drawBefore3D(false) + drawBefore3D(false), + drawable(new T(std::forward(params)...)) {} //! ctor template - explicit Drawable2DComponent(WAL::Entity &entity, WAL::TypeHolder, bool drawBefore3D, Params &&...params) + explicit Drawable2DComponent(WAL::Entity &entity, WAL::TypeHolder, bool drawBehind3D, Params &&...params) : WAL::Component(entity), - drawable(new T(std::forward(params)...)), - drawBefore3D(drawBefore3D) + drawBefore3D(drawBehind3D), + drawable(new T(std::forward(params)...)) {} //! @brief Clone a component for another or the same entity. diff --git a/sources/Component/Renderer/Drawable3DComponent.hpp b/sources/Component/Renderer/Drawable3DComponent.hpp index 5a04da07..36be9175 100644 --- a/sources/Component/Renderer/Drawable3DComponent.hpp +++ b/sources/Component/Renderer/Drawable3DComponent.hpp @@ -18,9 +18,9 @@ namespace BBM std::shared_ptr drawable; //! @brief ctor - Drawable3DComponent(WAL::Entity &entity, std::shared_ptr drawable) + Drawable3DComponent(WAL::Entity &entity, std::shared_ptr drawable3D) : WAL::Component(entity), - drawable(std::move(drawable)) + drawable(std::move(drawable3D)) {} //! ctor diff --git a/sources/Component/Shaders/ShaderComponent.cpp b/sources/Component/Shaders/ShaderComponent.cpp index e6f51917..ec5fb7ab 100644 --- a/sources/Component/Shaders/ShaderComponent.cpp +++ b/sources/Component/Shaders/ShaderComponent.cpp @@ -20,14 +20,14 @@ namespace BBM } ShaderComponent::ShaderComponent(WAL::Entity &entity, - const std::string &fragmentFilePath, - const std::string &vertexFilePath, + const std::string &fragmentPath, + const std::string &vertexPath, const WAL::Callback &onFixedUpdate, bool lonely) : WAL::Component(entity), shader(vertexFilePath, fragmentFilePath, lonely), - fragmentFilePath(fragmentFilePath), - vertexFilePath(vertexFilePath), + fragmentFilePath(fragmentPath), + vertexFilePath(vertexPath), update(onFixedUpdate) { } @@ -43,11 +43,11 @@ namespace BBM } ShaderComponentModel::ShaderComponentModel(WAL::Entity &entity, - const std::string &fragmentFilePath, - const std::string &vertexFilePath, + const std::string &fragmentPath, + const std::string &vertexPath, const WAL::Callback &onFixedUpdate, bool lonely) - : ShaderComponent(entity, fragmentFilePath, vertexFilePath, onFixedUpdate, lonely) + : ShaderComponent(entity, fragmentPath, vertexPath, onFixedUpdate, lonely) { } @@ -60,11 +60,11 @@ namespace BBM } ShaderComponentDrawable2D::ShaderComponentDrawable2D(WAL::Entity &entity, - const std::string &fragmentFilePath, - const std::string &vertexFilePath, + const std::string &fragmentPath, + const std::string &vertexPath, const WAL::Callback &onFixedUpdate, bool lonely) - : ShaderComponent(entity, fragmentFilePath, vertexFilePath, onFixedUpdate, lonely) + : ShaderComponent(entity, fragmentPath, vertexPath, onFixedUpdate, lonely) { } } \ No newline at end of file diff --git a/sources/Component/Sound/SoundComponent.cpp b/sources/Component/Sound/SoundComponent.cpp index 038b58e1..7f589400 100644 --- a/sources/Component/Sound/SoundComponent.cpp +++ b/sources/Component/Sound/SoundComponent.cpp @@ -11,17 +11,17 @@ namespace BBM float SoundComponent::volume = 0.75; SoundComponent::SoundComponent(WAL::Entity &entity, - const std::map &soundPath, + const std::map &soundsPath, bool isLonely) : WAL::Component(entity), - _soundIndex(IDLE), - _soundPath(soundPath), - _isLonely(isLonely) + _isLonely(isLonely), + _soundPath(soundsPath), + _soundIndex(IDLE) { for (int i = 0; i <= DEATH; i++) { this->_isSoundLoad[static_cast(i)] = false; } - for (auto &soundPath : soundPath) + for (auto &soundPath : soundsPath) { this->_isSoundLoad[soundPath.first] = true; this->_soundList[soundPath.first] = std::make_unique(soundPath.second, this->_isLonely); diff --git a/sources/Component/Timer/TimerComponent.cpp b/sources/Component/Timer/TimerComponent.cpp index 1695ee39..88af47c8 100644 --- a/sources/Component/Timer/TimerComponent.cpp +++ b/sources/Component/Timer/TimerComponent.cpp @@ -13,10 +13,10 @@ namespace BBM ringIn(delay) {} - TimerComponent::TimerComponent(WAL::Entity &entity, std::chrono::nanoseconds delay, const WAL::Callback &callback) + TimerComponent::TimerComponent(WAL::Entity &entity, std::chrono::nanoseconds delay, const WAL::Callback &timerCallback) : WAL::Component(entity), - ringIn(delay), - callback(callback) + callback(timerCallback), + ringIn(delay) {} WAL::Component *TimerComponent::clone(WAL::Entity &entity) const diff --git a/sources/Component/Timer/TimerComponent.hpp b/sources/Component/Timer/TimerComponent.hpp index b0ad2454..9a6ce3ff 100644 --- a/sources/Component/Timer/TimerComponent.hpp +++ b/sources/Component/Timer/TimerComponent.hpp @@ -25,7 +25,7 @@ namespace BBM //! @brief A default constructor TimerComponent(WAL::Entity &entity, std::chrono::nanoseconds delay); //! @brief Create a timer with a callback. - TimerComponent(WAL::Entity &entity, std::chrono::nanoseconds delay, const WAL::Callback &callback); + TimerComponent(WAL::Entity &entity, std::chrono::nanoseconds delay, const WAL::Callback &timerCallback); //! @brief A timer component is copy constructable TimerComponent(const TimerComponent &) = default; //! @brief A default destructor diff --git a/sources/Map/Map.cpp b/sources/Map/Map.cpp index 305e94dd..68371302 100644 --- a/sources/Map/Map.cpp +++ b/sources/Map/Map.cpp @@ -95,13 +95,13 @@ namespace BBM .addComponent(position) .addComponent>() .addComponent() - .addComponent(1, [](WAL::Entity &entity, WAL::Wal &wal) { - entity.scheduleDeletion(); + .addComponent(1, [](WAL::Entity &myEntity, WAL::Wal &) { + myEntity.scheduleDeletion(); }) .addComponent(position.y) .addComponent(WAL::Callback(), func[bonusType - 1], 0.5, .5) - .addComponent(5s, [](WAL::Entity &bonus, WAL::Wal &wal){ + .addComponent(5s, [](WAL::Entity &bonus, WAL::Wal &){ bonus.scheduleDeletion(); }) .addComponent(map.at(bonusType) + ".obj", false, diff --git a/sources/Map/MapInfo.cpp b/sources/Map/MapInfo.cpp index f7c8f7c8..d5027e71 100644 --- a/sources/Map/MapInfo.cpp +++ b/sources/Map/MapInfo.cpp @@ -6,8 +6,8 @@ namespace BBM { - MapInfo::MapInfo(Vector3f pos, MapGenerator::BlockType type) - : x(pos.x), y(pos.y), z(pos.z), type(type) + MapInfo::MapInfo(Vector3f pos, MapGenerator::BlockType blockType) + : x(pos.x), y(pos.y), z(pos.z), type(blockType) { } MapInfo::MapInfo(const MapInfo &other) diff --git a/sources/Runner/CreditScene.cpp b/sources/Runner/CreditScene.cpp index a0dfb539..5a5113de 100644 --- a/sources/Runner/CreditScene.cpp +++ b/sources/Runner/CreditScene.cpp @@ -32,22 +32,22 @@ namespace BBM .addComponent("assets/musics/music_title.ogg") .addComponent(sounds); - auto &raylibLogo = scene->addEntity("raylib logo") + scene->addEntity("raylib logo") .addComponent(1920 / 3.5, 1080 / 1.75, 0) .addComponent("assets/raylib.png"); - auto &raylibText = scene->addEntity("raylib text") + scene->addEntity("raylib text") .addComponent(1920 / 4, 1080 / 2, 0) .addComponent("Powered by:", 35, RAY::Vector2(), BLACK); - auto &otherRepoText = scene->addEntity("other repo text") + scene->addEntity("other repo text") .addComponent(1920 / 4, 1080 / 4, 0) .addComponent("Many Thanks to:", 35, RAY::Vector2(), BLACK); - auto &BriansRepo = scene->addEntity("thx brian") + scene->addEntity("thx brian") .addComponent(1920 / 3.5, 1080 / 3.25, 0) .addComponent("Brian Guitteny (and his team)\nAssets used by their permission", 35, RAY::Vector2(), BLACK); - auto &team = scene->addEntity("team") + scene->addEntity("team") .addComponent(1920 / 1.5, 1080 / 3.5, 0) .addComponent("Team:\n Zoe Roux\n Clément Le Bihan\n Arthur Jamet\n Louis Auzuret\n Benjamin Henry\n Tom Augier", 35, RAY::Vector2(), BLACK); - auto &back = scene->addEntity("back to menu") + scene->addEntity("back to menu") .addComponent(10, 1080 - 85, 0) .addComponent("assets/buttons/button_back.png") .addComponent([](WAL::Entity &entity, WAL::Wal &) diff --git a/sources/Runner/GameScene.cpp b/sources/Runner/GameScene.cpp index 69e954fa..ffa136b5 100644 --- a/sources/Runner/GameScene.cpp +++ b/sources/Runner/GameScene.cpp @@ -84,8 +84,8 @@ namespace BBM entity.removeComponent(); if (entity.hasComponent()) return; - entity.addComponent(1s, [](WAL::Entity &entity, WAL::Wal &wal) { - entity.scheduleDeletion(); + entity.addComponent(1s, [](WAL::Entity &ent, WAL::Wal &wal) { + ent.scheduleDeletion(); }); }); } diff --git a/sources/Runner/HowToPlayScene.cpp b/sources/Runner/HowToPlayScene.cpp index 782a70c0..392523ce 100644 --- a/sources/Runner/HowToPlayScene.cpp +++ b/sources/Runner/HowToPlayScene.cpp @@ -57,7 +57,7 @@ namespace BBM scene->addEntity("back") .addComponent(1920 / 1.75, 1080 / 1.75, 0) .addComponent("Esc / Controller's Home button:", 35, RAY::Vector2(), BLACK); - auto &back = scene->addEntity("back to menu") + scene->addEntity("back to menu") .addComponent(10, 1080 - 85, 0) .addComponent("assets/buttons/button_back.png") .addComponent([](WAL::Entity &entity, WAL::Wal &) diff --git a/sources/Runner/Runner.cpp b/sources/Runner/Runner.cpp index a8224e78..2c12210c 100644 --- a/sources/Runner/Runner.cpp +++ b/sources/Runner/Runner.cpp @@ -60,7 +60,6 @@ namespace BBM void Runner::updateState(WAL::Wal &engine, GameState &state) { - auto &view = engine.getScene()->view(); if (RAY::Window::getInstance().shouldClose()) engine.shouldClose = true; if (gameState.currentScene == GameState::SceneID::GameScene) { diff --git a/sources/Runner/ScoreScene.cpp b/sources/Runner/ScoreScene.cpp index 4f80babb..36dc00fe 100644 --- a/sources/Runner/ScoreScene.cpp +++ b/sources/Runner/ScoreScene.cpp @@ -58,17 +58,17 @@ namespace BBM scene->addEntity("scene title text") .addComponent(1920 / 2.37, 250, 0) .addComponent("CONGRATS", 50, RAY::Vector2(), ORANGE); - for (int i = 0; i < players.size(); i++) { - auto &playerTile = scene->addEntity("player tile") + for (int i = 0; i < static_cast(players.size()); i++) { + scene->addEntity("player tile") .addComponent(224 * (i + 1) + 200 * i, 1080 / 2.5, 0) .addComponent(RAY::Vector2(224 * (i + 1) + 200 * i, 1080 / 3), RAY::Vector2(200, 200), tilesColor[i]); - auto &playerRank = scene->addEntity("player rank name") + scene->addEntity("player rank name") .addComponent(224 * (i + 1) + 200 * i, 1080 / 2.75, 0) .addComponent(rankName[i], 30, RAY::Vector2(224 * (i + 1) + 200 * i, 1080 / 3), tilesColor[i]); - auto &player = scene->addEntity("player") + scene->addEntity("player") .addComponent(224 * (i + 1) + 200 * i, 1080 / 2.5, 0) .addComponent(playersIconPath[i]); } diff --git a/sources/Runner/SplashScreenScene.cpp b/sources/Runner/SplashScreenScene.cpp index 3d0cc1ae..a42b5c20 100644 --- a/sources/Runner/SplashScreenScene.cpp +++ b/sources/Runner/SplashScreenScene.cpp @@ -20,15 +20,15 @@ namespace BBM auto scene = std::make_shared(); addMenuControl(*scene); - auto &splashComponent = scene->addEntity("animation component") + scene->addEntity("animation component") .addComponent(); - auto &background = scene->addEntity("background") + scene->addEntity("background") .addComponent(0, 0, 0) .addComponent(RAY::Vector2(), RAY::Vector2(1920, 1080)); - auto &text = scene->addEntity("powered by text") + scene->addEntity("powered by text") .addComponent(1920 / 2 - 200, 1080 / 2 - 180, 0) .addComponent("powered by", 30, RAY::Vector2(), BLACK); - auto &skipText = scene->addEntity("Press space to skip") + scene->addEntity("Press space to skip") .addComponent(1920 - 250, 1080 - 30, 0) .addComponent("Press space to skip", 20, RAY::Vector2(), BLACK) .addComponent() diff --git a/sources/System/Animation/AnimationsSystem.cpp b/sources/System/Animation/AnimationsSystem.cpp index 75923741..47ff3d68 100644 --- a/sources/System/Animation/AnimationsSystem.cpp +++ b/sources/System/Animation/AnimationsSystem.cpp @@ -19,7 +19,6 @@ namespace BBM { auto &model = entity.get(); auto &anim = entity.get(); - static int count = 0; if (anim.skipNext) { anim.skipNext = false; diff --git a/sources/System/Animator/AnimatorSystem.cpp b/sources/System/Animator/AnimatorSystem.cpp index 23f312dc..59280fac 100644 --- a/sources/System/Animator/AnimatorSystem.cpp +++ b/sources/System/Animator/AnimatorSystem.cpp @@ -30,7 +30,7 @@ namespace BBM auto anim = dynamic_cast(drawable); auto health = entity->tryGetComponent(); - if (health && health->getHealthPoint() <= 0 || entity->shouldDelete()) + if ((health && health->getHealthPoint() <= 0) || entity->shouldDelete()) return; if (anim && controllable.move != Vector2f(0, 0)) { anim->setRotationAngle(controllable.move.angle(Vector2f(-1, 0))); diff --git a/sources/System/BombHolder/BombHolderSystem.cpp b/sources/System/BombHolder/BombHolderSystem.cpp index 02ed40aa..96953023 100644 --- a/sources/System/BombHolder/BombHolderSystem.cpp +++ b/sources/System/BombHolder/BombHolderSystem.cpp @@ -50,7 +50,7 @@ namespace BBM wal.getScene()->scheduleNewEntity("explosion") .addComponent(position) .addComponent() - .addComponent("assets/shaders/explosion.fs", "assets/shaders/explosion.vs", [](WAL::Entity &entity, WAL::Wal &wal, std::chrono::nanoseconds dtime) { + .addComponent("assets/shaders/explosion.fs", "assets/shaders/explosion.vs", [](WAL::Entity &entity, WAL::Wal &, std::chrono::nanoseconds dtime) { auto &ctx = entity.getComponent(); auto &shader = entity.getComponent(); @@ -70,7 +70,7 @@ namespace BBM shader.shader.setShaderUniformVar("alpha", ctx.alpha); shader.shader.setShaderUniformVar("radius", ctx.explosionRadius); }) - .addComponent(500ms, [](WAL::Entity &explosion, WAL::Wal &wal) { + .addComponent(500ms, [](WAL::Entity &explosion, WAL::Wal &) { explosion.scheduleDeletion(); }) .addComponent(RAY::Mesh::MeshSphere(0.5, 16, 16), @@ -78,31 +78,31 @@ namespace BBM MAP_DIFFUSE, "assets/bombs/explosion/blast.png" )); - wal.getSystem().dispatchEvent([position, size, expansionDirections](WAL::Wal &wal) { - for (auto &[entity, pos, _] : wal.getScene()->view>()) { + wal.getSystem().dispatchEvent([position, size, expansionDirections](WAL::Wal &myWal) { + for (auto &[entity, pos, _] : myWal.getScene()->view>()) { if (pos.position.round() == position) { if (auto *health = entity.tryGetComponent()) health->takeDmg(1); return; } } - for (auto &[entity, pos, _] : wal.getScene()->view>()) { + for (auto &[entity, pos, _] : myWal.getScene()->view>()) { if (pos.position.round() == position) { if (auto *health = entity.tryGetComponent()) health->takeDmg(1); } } if (expansionDirections & ExpansionDirection::FRONT) { - _dispatchExplosion(position + Vector3f{1, 0, 0}, wal, size - 1, ExpansionDirection::FRONT); + _dispatchExplosion(position + Vector3f{1, 0, 0}, myWal, size - 1, ExpansionDirection::FRONT); } if (expansionDirections & ExpansionDirection::BACK) { - _dispatchExplosion(position + Vector3f{-1, 0, 0}, wal, size - 1, ExpansionDirection::BACK); + _dispatchExplosion(position + Vector3f{-1, 0, 0}, myWal, size - 1, ExpansionDirection::BACK); } if (expansionDirections & ExpansionDirection::LEFT) { - _dispatchExplosion(position + Vector3f{0, 0, 1}, wal, size - 1, ExpansionDirection::LEFT); + _dispatchExplosion(position + Vector3f{0, 0, 1}, myWal, size - 1, ExpansionDirection::LEFT); } if (expansionDirections & ExpansionDirection::RIGHT) { - _dispatchExplosion(position + Vector3f{0, 0, -1}, wal, size - 1, ExpansionDirection::RIGHT); + _dispatchExplosion(position + Vector3f{0, 0, -1}, myWal, size - 1, ExpansionDirection::RIGHT); } }); } @@ -189,7 +189,7 @@ namespace BBM } if (controllable.bomb && holder.bombCount > 0) { auto spawnPos = position.position.round(); - for (auto &[entity, pos, _] : this->_wal.getScene()->view()) { + for (auto &[__, pos, _] : this->_wal.getScene()->view()) { if (pos.position == spawnPos) return; } diff --git a/sources/System/Bonus/PlayerBonusSystem.cpp b/sources/System/Bonus/PlayerBonusSystem.cpp index a0fc8218..32f6659b 100644 --- a/sources/System/Bonus/PlayerBonusSystem.cpp +++ b/sources/System/Bonus/PlayerBonusSystem.cpp @@ -14,8 +14,6 @@ namespace BBM void PlayerBonusSystem::onUpdate(WAL::ViewEntity &entity, std::chrono::nanoseconds dtime) { - auto &controllable = entity.get(); - auto &holder = entity.get(); auto &playerBonus = entity.get(); playerBonus.nextNoClipRate -= dtime; diff --git a/sources/System/GridCentered/GridCenteredSystem.cpp b/sources/System/GridCentered/GridCenteredSystem.cpp index 3c86175b..ca2c9b95 100644 --- a/sources/System/GridCentered/GridCenteredSystem.cpp +++ b/sources/System/GridCentered/GridCenteredSystem.cpp @@ -12,10 +12,7 @@ namespace BBM : System(wal) {} - void GridCenteredSystem::onFixedUpdate(WAL::ViewEntity &entity) + void GridCenteredSystem::onFixedUpdate(WAL::ViewEntity &) { - auto &grid = entity.get(); - auto &movement = entity.get(); -// movement.addForce(grid.force * ) } } \ No newline at end of file diff --git a/sources/System/IntroAnimation/IntroAnimationSystem.cpp b/sources/System/IntroAnimation/IntroAnimationSystem.cpp index 9e14eb1b..dc1dea66 100644 --- a/sources/System/IntroAnimation/IntroAnimationSystem.cpp +++ b/sources/System/IntroAnimation/IntroAnimationSystem.cpp @@ -15,14 +15,14 @@ namespace RAY2D = RAY::Drawables::Drawables2D; namespace BBM { IntroAnimationSystem::IntroAnimationSystem(WAL::Wal &wal) - : System(wal), wal(wal) + : System(wal) {} void IntroAnimationSystem::onFixedUpdate(WAL::ViewEntity &entity) { static const RAY::Vector2 logoPos(1920 / 2 - 128, 1080 / 2 - 128); auto &component = entity.get(); - auto scene = wal.getScene(); + auto scene = this->_wal.getScene(); RAY2D::Rectangle *rectangle = nullptr; RAY2D::Text *text = nullptr; static auto &rayText = scene->addEntity("raylibtext Rectangle") diff --git a/sources/System/IntroAnimation/IntroAnimationSystem.hpp b/sources/System/IntroAnimation/IntroAnimationSystem.hpp index a48c2af4..fd89568b 100644 --- a/sources/System/IntroAnimation/IntroAnimationSystem.hpp +++ b/sources/System/IntroAnimation/IntroAnimationSystem.hpp @@ -8,10 +8,6 @@ namespace BBM //! @brief A system to handle Controllable entities in a menu. class IntroAnimationSystem : public WAL::System { - private: - //! @brief reference to wal - WAL::Wal &wal; - public: //! @inherit void onSelfUpdate(std::chrono::nanoseconds dtime) override; diff --git a/sources/System/Lobby/LobbySystem.cpp b/sources/System/Lobby/LobbySystem.cpp index 3867bba6..7bb64885 100644 --- a/sources/System/Lobby/LobbySystem.cpp +++ b/sources/System/Lobby/LobbySystem.cpp @@ -56,7 +56,7 @@ namespace BBM this->_colorTaken[lobby.color] = false; do { lobby.color++; - if (lobby.color >= this->_colorTaken.size()) + if (lobby.color >= static_cast(this->_colorTaken.size())) lobby.color = 0; } while (this->_colorTaken[lobby.color]); this->_colorTaken[lobby.color] = true; diff --git a/sources/System/Renderer/CameraSystem.cpp b/sources/System/Renderer/CameraSystem.cpp index 3c4e538c..1919ecba 100644 --- a/sources/System/Renderer/CameraSystem.cpp +++ b/sources/System/Renderer/CameraSystem.cpp @@ -27,8 +27,6 @@ namespace BBM return (true); } - auto &cam = entity.get(); - pos.position += (posTarget - pos.position) / 100; return (false); } @@ -46,17 +44,17 @@ namespace BBM float lowerXDist = 0; float lowerZDist = 0; - for (auto &[entity, pos, _] : this->_wal.getScene()->view>()) { - if (!entity.hasComponent()) - entity.addComponent(); - playerPos.emplace_back(pos.position); + for (auto &[player, position, _] : this->_wal.getScene()->view>()) { + if (!player.hasComponent()) + player.addComponent(); + playerPos.emplace_back(position.position); } if (playerPos.size() == 0) introAnimation(entity, true); if (playerPos.size() == 1) newCameraPos = playerPos[0]; - for (int i = 0; i < playerPos.size(); i++) - for (int j = 0; j < playerPos.size(); j++) { + for (int i = 0; i < static_cast(playerPos.size()); i++) + for (int j = 0; j < static_cast(playerPos.size()); j++) { if (maxDist < playerPos[i].distance(playerPos[j])) { maxDist = playerPos[i].distance(playerPos[j]); newCameraPos = (playerPos[i] + playerPos[j]) / 2;