From 9826375c6226aa73ffe45f615100a2c65cae0b38 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 17 Jun 2021 16:58:39 +0200 Subject: [PATCH 01/12] Using fixed update and adding optimization flags --- CMakeLists.txt | 3 +++ sources/Component/Animation/AnimationsComponent.cpp | 2 +- sources/Component/Animation/AnimationsComponent.hpp | 2 +- sources/Runner/Runner.cpp | 2 +- sources/System/Animation/AnimationsSystem.cpp | 8 +++++++- sources/System/Animation/AnimationsSystem.hpp | 2 +- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7e36036..2ba47cf3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,9 @@ project(bomberman) set(CMAKE_CXX_STANDARD 20) +set(CMAKE_C_FLAGS -O2) +set(CMAKE_CXX_FLAGS -O2) + include_directories(lib/Ray/sources) include_directories(lib/wal/sources) include_directories(lib/LuaGate/sources) diff --git a/sources/Component/Animation/AnimationsComponent.cpp b/sources/Component/Animation/AnimationsComponent.cpp index 26367a0b..e53cc259 100644 --- a/sources/Component/Animation/AnimationsComponent.cpp +++ b/sources/Component/Animation/AnimationsComponent.cpp @@ -29,7 +29,7 @@ namespace BBM return this->_modelAnimation.at(this->_currentAnimIndex).getFrameCounter(); } - RAY::ModelAnimation AnimationsComponent::getCurrentModelAnim() + RAY::ModelAnimation &AnimationsComponent::getCurrentModelAnim() { return this->_modelAnimation[this->_currentAnimIndex]; } diff --git a/sources/Component/Animation/AnimationsComponent.hpp b/sources/Component/Animation/AnimationsComponent.hpp index 36f22a6a..a1daa591 100644 --- a/sources/Component/Animation/AnimationsComponent.hpp +++ b/sources/Component/Animation/AnimationsComponent.hpp @@ -34,7 +34,7 @@ namespace BBM size_t getCurrentAnimFrameCounter() const; //! @brief get the current - RAY::ModelAnimation getCurrentModelAnim(); + RAY::ModelAnimation &getCurrentModelAnim(); //! @brief set the anim frame counter void setCurrentAnimFrameCounter(size_t animFrameCounter); diff --git a/sources/Runner/Runner.cpp b/sources/Runner/Runner.cpp index 98507d1f..b56b94fc 100644 --- a/sources/Runner/Runner.cpp +++ b/sources/Runner/Runner.cpp @@ -106,7 +106,7 @@ namespace BBM .addSystem() .addSystem() .addSystem() - .addSystem() +// .addSystem() .addSystem() .addSystem(); } diff --git a/sources/System/Animation/AnimationsSystem.cpp b/sources/System/Animation/AnimationsSystem.cpp index 5aaa4597..65bd7e0b 100644 --- a/sources/System/Animation/AnimationsSystem.cpp +++ b/sources/System/Animation/AnimationsSystem.cpp @@ -15,10 +15,15 @@ namespace BBM : System(wal) {} - void AnimationsSystem::onUpdate(WAL::ViewEntity &entity, std::chrono::nanoseconds) + void AnimationsSystem::onFixedUpdate(WAL::ViewEntity &entity) { auto &model = entity.get(); auto &anim = entity.get(); + static int count = 0; + + count++; + if (count % 2) + return; if (anim.isDisabled()) return; @@ -26,6 +31,7 @@ namespace BBM if (modelPtr) { modelPtr->setAnimation(anim.getCurrentModelAnim()); anim.incCurrentAnimFrameCounter(); + anim.incCurrentAnimFrameCounter(); } } } \ No newline at end of file diff --git a/sources/System/Animation/AnimationsSystem.hpp b/sources/System/Animation/AnimationsSystem.hpp index 6ace28d8..bf71460e 100644 --- a/sources/System/Animation/AnimationsSystem.hpp +++ b/sources/System/Animation/AnimationsSystem.hpp @@ -14,7 +14,7 @@ namespace BBM { public: //! @inherit - void onUpdate(WAL::ViewEntity &entity, std::chrono::nanoseconds) override; + void onFixedUpdate(WAL::ViewEntity &entity) override; //! @brief A default constructor explicit AnimationsSystem(WAL::Wal &wal); From ac2ade2017606b70a9aa30ddb269f6c6b0c37dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Thu, 17 Jun 2021 17:06:54 +0200 Subject: [PATCH 02/12] push for zoe --- sources/System/Animation/AnimationsSystem.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/System/Animation/AnimationsSystem.cpp b/sources/System/Animation/AnimationsSystem.cpp index 65bd7e0b..df641307 100644 --- a/sources/System/Animation/AnimationsSystem.cpp +++ b/sources/System/Animation/AnimationsSystem.cpp @@ -32,6 +32,8 @@ namespace BBM modelPtr->setAnimation(anim.getCurrentModelAnim()); anim.incCurrentAnimFrameCounter(); anim.incCurrentAnimFrameCounter(); + anim.incCurrentAnimFrameCounter(); + anim.incCurrentAnimFrameCounter(); } } } \ No newline at end of file From dfc42ced60d9f946605b8155a39d4df604ae3079 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 17 Jun 2021 17:32:46 +0200 Subject: [PATCH 03/12] Cleaning up the cmake --- CMakeLists.txt | 4 ++-- sources/Component/Animation/AnimationsComponent.hpp | 4 ++++ sources/System/Animation/AnimationsSystem.cpp | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77a13829..287d2096 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,8 @@ project(bomberman) set(CMAKE_CXX_STANDARD 20) -set(CMAKE_C_FLAGS -O2) -set(CMAKE_CXX_FLAGS -O2) +set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -g") +set(CMAKE_CXX_FLAGS_RELEASE "-O2") include_directories(lib/Ray/sources) include_directories(lib/wal/sources) diff --git a/sources/Component/Animation/AnimationsComponent.hpp b/sources/Component/Animation/AnimationsComponent.hpp index a1daa591..41d9c10e 100644 --- a/sources/Component/Animation/AnimationsComponent.hpp +++ b/sources/Component/Animation/AnimationsComponent.hpp @@ -20,7 +20,11 @@ namespace BBM int _currentAnimIndex; //! @brief Bool allowing to play pause an animation bool _animDisabled; + public: + //! @brief Should the next update call be skipped? + bool skipNext = false; + //! @inherit WAL::Component *clone(WAL::Entity &entity) const override; diff --git a/sources/System/Animation/AnimationsSystem.cpp b/sources/System/Animation/AnimationsSystem.cpp index df641307..75923741 100644 --- a/sources/System/Animation/AnimationsSystem.cpp +++ b/sources/System/Animation/AnimationsSystem.cpp @@ -21,9 +21,11 @@ namespace BBM auto &anim = entity.get(); static int count = 0; - count++; - if (count % 2) + if (anim.skipNext) { + anim.skipNext = false; return; + } + anim.skipNext = true; if (anim.isDisabled()) return; From 01afcde9dfd04673996b94c6cd1c9fc7b23bc33a Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 17 Jun 2021 18:03:31 +0200 Subject: [PATCH 04/12] Fixing the CI --- .github/workflows/build.yml | 2 +- CMakeLists.txt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25ab6fac..e930bed1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: - name: Build run: | mkdir build && cd build - cmake .. + cmake .. -DCMAKE_BUILD_TYPE=Debug cmake --build . - name: CheckBinaryName shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index 287d2096..a7e512dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,9 @@ project(bomberman) set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -g") +if (CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -g") +endif() set(CMAKE_CXX_FLAGS_RELEASE "-O2") include_directories(lib/Ray/sources) From 6925d633092904f57f465307278d8c6e9f33334f Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Thu, 17 Jun 2021 18:21:43 +0200 Subject: [PATCH 05/12] add strict compilation flags --- CMakeLists.txt | 4 +- a | 266 -------------------------------------- sources/Runner/Runner.cpp | 6 +- text | 70 ++++++++++ 4 files changed, 77 insertions(+), 269 deletions(-) delete mode 100644 a create mode 100644 text diff --git a/CMakeLists.txt b/CMakeLists.txt index 287d2096..45532774 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,8 @@ project(bomberman) set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -g") -set(CMAKE_CXX_FLAGS_RELEASE "-O2") +set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -Werror -W -g") +set(CMAKE_CXX_FLAGS_RELEASE "-O2 -D RELEASE -Wno-dev") include_directories(lib/Ray/sources) include_directories(lib/wal/sources) diff --git a/a b/a deleted file mode 100644 index 0e66280b..00000000 --- a/a +++ /dev/null @@ -1,266 +0,0 @@ -WARNING: SHADER: [ID 5] Failed to find shader attribute: vertexTexCoord2 -WARNING: SHADER: [ID 5] Failed to find shader attribute: vertexNormal -WARNING: SHADER: [ID 5] Failed to find shader attribute: vertexTangent -WARNING: SHADER: [ID 5] Failed to find shader attribute: vertexColor -WARNING: SHADER: [ID 5] Failed to find shader uniform: view -WARNING: SHADER: [ID 5] Failed to find shader uniform: projection -WARNING: SHADER: [ID 5] Failed to find shader uniform: matNormal -WARNING: SHADER: [ID 5] Failed to find shader uniform: colDiffuse -WARNING: SHADER: [ID 5] Failed to find shader uniform: texture1 -WARNING: SHADER: [ID 5] Failed to find shader uniform: texture2 -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader attribute: vertexTexCoord2 -WARNING: SHADER: [ID 8] Failed to find shader attribute: vertexTangent -WARNING: SHADER: [ID 8] Failed to find shader attribute: vertexColor -WARNING: SHADER: [ID 8] Failed to find shader uniform: view -WARNING: SHADER: [ID 8] Failed to find shader uniform: projection -WARNING: SHADER: [ID 8] Failed to find shader uniform: matNormal -WARNING: SHADER: [ID 8] Failed to find shader uniform: colDiffuse -WARNING: SHADER: [ID 8] Failed to find shader uniform: texture1 -WARNING: SHADER: [ID 8] Failed to find shader uniform: texture2 -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 5] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask -WARNING: SHADER: [ID 8] Failed to find shader uniform: mask diff --git a/sources/Runner/Runner.cpp b/sources/Runner/Runner.cpp index e9229812..a8224e78 100644 --- a/sources/Runner/Runner.cpp +++ b/sources/Runner/Runner.cpp @@ -107,7 +107,7 @@ namespace BBM .addSystem() .addSystem() .addSystem() -// .addSystem() + .addSystem() .addSystem() .addSystem() .addSystem(); @@ -115,7 +115,11 @@ namespace BBM void Runner::enableRaylib(WAL::Wal &wal) { + #ifdef RELEASE + RAY::TraceLog::setLevel(LOG_NONE); + #else RAY::TraceLog::setLevel(LOG_WARNING); + #endif RAY::Window &window = RAY::Window::getInstance(1280, 720, "Bomberman", FLAG_WINDOW_RESIZABLE); wal.addSystem() .addSystem() diff --git a/text b/text new file mode 100644 index 00000000..eee88bb4 --- /dev/null +++ b/text @@ -0,0 +1,70 @@ +-- Populating raylib +-- Configuring done +-- Generating done +-- Build files have been written to: /home/arthurjamet/Desktop/B4/YEP/Bomberman/build/_deps/raylib-subbuild +[100%] Built target raylib-populate +-- Testing if -Werror=pointer-arith can be used -- compiles +-- Testing if -Werror=implicit-function-declaration can be used -- compiles +-- Testing if -fno-strict-aliasing can be used -- compiles +-- Using raylib's GLFW +-- Using X11 for window creation +-- Audio Backend: miniaudio +-- Building raylib static library +-- Generated build type: Debug +-- Compiling with the flags: +-- PLATFORM=PLATFORM_DESKTOP +-- GRAPHICS=GRAPHICS_API_OPENGL_33 +-- Configuring done +-- Generating done +-- Build files have been written to: /home/arthurjamet/Desktop/B4/YEP/Bomberman/build +[ 1%] Building CXX object lib/wal/CMakeFiles/wal.dir/sources/Entity/Entity.cpp.o +[ 3%] Building CXX object lib/wal/CMakeFiles/wal.dir/sources/Scene/Scene.cpp.o +[ 3%] Building CXX object lib/wal/CMakeFiles/wal.dir/sources/Exception/WalError.cpp.o +[ 3%] Building CXX object lib/LuaGate/CMakeFiles/LuaGate.dir/sources/LuaGate.cpp.o +[ 3%] Building CXX object lib/wal/CMakeFiles/wal.dir/sources/Component/Component.cpp.o +[ 15%] Built target glfw +[ 20%] Built target raylib +[ 20%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Color.cpp.o +[ 20%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Font.cpp.o +[ 21%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/TraceLog.cpp.o +[ 21%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Window.cpp.o +[ 23%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Audio/Music.cpp.o +[ 23%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Audio/Sound.cpp.o +[ 23%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Camera/Camera3D.cpp.o +[ 25%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Camera/Camera2D.cpp.o +[ 25%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Controllers/Gamepad.cpp.o +[ 26%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Controllers/Keyboard.cpp.o +[ 28%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/2D/Circle.cpp.o +[ 28%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Controllers/Mouse.cpp.o +[ 29%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/2D/Point.cpp.o +[ 29%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/2D/Line.cpp.o +[ 29%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/2D/Rectangle.cpp.o +[ 29%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/2D/Text.cpp.o +[ 31%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/2D/Triangle.cpp.o +[ 31%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Circle.cpp.o +[ 32%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Cube.cpp.o +[ 32%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Cylinder.cpp.o +[ 34%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Grid.cpp.o +[ 34%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Line.cpp.o +[ 34%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Plane.cpp.o +[ 35%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Point.cpp.o +[ 35%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Ray.cpp.o +[ 35%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/ADrawable2D.cpp.o +[ 37%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Sphere.cpp.o +[ 37%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Triangle.cpp.o +[ 39%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/ADrawable3D.cpp.o +[ 39%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/Image.cpp.o +[ 40%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/Texture.cpp.o +[ 40%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Exceptions/RayError.cpp.o +[ 42%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Model/Model.cpp.o +[ 42%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Model/ModelAnimation.cpp.o +[ 43%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Model/ModelAnimations.cpp.o +[ 43%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Vector/Vector2.cpp.o +[ 43%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Vector/Vector3.cpp.o +[ 45%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Shaders/Shaders.cpp.o +[ 45%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Meshes/MeshSphere.cpp.o +[ 46%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Meshes/AMesh.cpp.o +[ 46%] Linking CXX static library libLuaGate.a +[ 46%] Built target LuaGate +[ 46%] Linking CXX static library libray.a +[ 46%] Built target ray From 94508fa4f5049d203510195d471e9e40f17f230c Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Thu, 17 Jun 2021 18:21:50 +0200 Subject: [PATCH 06/12] add strict compilation flags --- text | 70 ------------------------------------------------------------ 1 file changed, 70 deletions(-) delete mode 100644 text diff --git a/text b/text deleted file mode 100644 index eee88bb4..00000000 --- a/text +++ /dev/null @@ -1,70 +0,0 @@ --- Populating raylib --- Configuring done --- Generating done --- Build files have been written to: /home/arthurjamet/Desktop/B4/YEP/Bomberman/build/_deps/raylib-subbuild -[100%] Built target raylib-populate --- Testing if -Werror=pointer-arith can be used -- compiles --- Testing if -Werror=implicit-function-declaration can be used -- compiles --- Testing if -fno-strict-aliasing can be used -- compiles --- Using raylib's GLFW --- Using X11 for window creation --- Audio Backend: miniaudio --- Building raylib static library --- Generated build type: Debug --- Compiling with the flags: --- PLATFORM=PLATFORM_DESKTOP --- GRAPHICS=GRAPHICS_API_OPENGL_33 --- Configuring done --- Generating done --- Build files have been written to: /home/arthurjamet/Desktop/B4/YEP/Bomberman/build -[ 1%] Building CXX object lib/wal/CMakeFiles/wal.dir/sources/Entity/Entity.cpp.o -[ 3%] Building CXX object lib/wal/CMakeFiles/wal.dir/sources/Scene/Scene.cpp.o -[ 3%] Building CXX object lib/wal/CMakeFiles/wal.dir/sources/Exception/WalError.cpp.o -[ 3%] Building CXX object lib/LuaGate/CMakeFiles/LuaGate.dir/sources/LuaGate.cpp.o -[ 3%] Building CXX object lib/wal/CMakeFiles/wal.dir/sources/Component/Component.cpp.o -[ 15%] Built target glfw -[ 20%] Built target raylib -[ 20%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Color.cpp.o -[ 20%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Font.cpp.o -[ 21%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/TraceLog.cpp.o -[ 21%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Window.cpp.o -[ 23%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Audio/Music.cpp.o -[ 23%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Audio/Sound.cpp.o -[ 23%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Camera/Camera3D.cpp.o -[ 25%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Camera/Camera2D.cpp.o -[ 25%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Controllers/Gamepad.cpp.o -[ 26%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Controllers/Keyboard.cpp.o -[ 28%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/2D/Circle.cpp.o -[ 28%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Controllers/Mouse.cpp.o -[ 29%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/2D/Point.cpp.o -[ 29%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/2D/Line.cpp.o -[ 29%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/2D/Rectangle.cpp.o -[ 29%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/2D/Text.cpp.o -[ 31%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/2D/Triangle.cpp.o -[ 31%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Circle.cpp.o -[ 32%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Cube.cpp.o -[ 32%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Cylinder.cpp.o -[ 34%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Grid.cpp.o -[ 34%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Line.cpp.o -[ 34%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Plane.cpp.o -[ 35%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Point.cpp.o -[ 35%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Ray.cpp.o -[ 35%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/ADrawable2D.cpp.o -[ 37%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Sphere.cpp.o -[ 37%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/3D/Triangle.cpp.o -[ 39%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/ADrawable3D.cpp.o -[ 39%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/Image.cpp.o -[ 40%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Drawables/Texture.cpp.o -[ 40%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Exceptions/RayError.cpp.o -[ 42%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Model/Model.cpp.o -[ 42%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Model/ModelAnimation.cpp.o -[ 43%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Model/ModelAnimations.cpp.o -[ 43%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Vector/Vector2.cpp.o -[ 43%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Vector/Vector3.cpp.o -[ 45%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Shaders/Shaders.cpp.o -[ 45%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Meshes/MeshSphere.cpp.o -[ 46%] Building CXX object lib/Ray/CMakeFiles/ray.dir/sources/Meshes/AMesh.cpp.o -[ 46%] Linking CXX static library libLuaGate.a -[ 46%] Built target LuaGate -[ 46%] Linking CXX static library libray.a -[ 46%] Built target ray From 1cf820bf87b527517b4beea5112d80e374fde1d4 Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Thu, 17 Jun 2021 19:24:49 +0200 Subject: [PATCH 07/12] fix compile errors --- CMakeLists.txt | 4 ++-- lib/wal/CMakeLists.txt | 5 +++++ lib/wal/sources/Entity/Entity.cpp | 8 ++++---- lib/wal/sources/Scene/Scene.cpp | 4 ++-- sources/Component/Button/ButtonComponent.hpp | 2 +- sources/Models/Vector2.hpp | 4 ++-- sources/Models/Vector3.hpp | 4 ++-- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fda7fff..5a2f7504 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,8 @@ project(bomberman) set(CMAKE_CXX_STANDARD 20) -if (CMAKE_COMPILER_IS_GNUCC) - set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -Werror -g") +if (CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -Wno-unused-param -W -Werror -g") endif() set(CMAKE_CXX_FLAGS_RELEASE "-O2") diff --git a/lib/wal/CMakeLists.txt b/lib/wal/CMakeLists.txt index 9c30796f..c9227eab 100644 --- a/lib/wal/CMakeLists.txt +++ b/lib/wal/CMakeLists.txt @@ -3,6 +3,11 @@ 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") +endif() +set(CMAKE_CXX_FLAGS_RELEASE "-O2") + add_library(wal sources/Entity/Entity.hpp sources/Component/Component.hpp diff --git a/lib/wal/sources/Entity/Entity.cpp b/lib/wal/sources/Entity/Entity.cpp index 0142a4aa..5804cdf6 100644 --- a/lib/wal/sources/Entity/Entity.cpp +++ b/lib/wal/sources/Entity/Entity.cpp @@ -13,17 +13,17 @@ namespace WAL Entity::Entity(Scene &scene, std::string name, bool notifyScene) : _uid(Entity::nextID++), - _scene(scene), _name(std::move(name)), - _notifyScene(notifyScene) + _notifyScene(notifyScene), + _scene(scene) { } Entity::Entity(const Entity &other) : _uid(Entity::nextID++), - _scene(other._scene), _name(other._name), _disabled(other._disabled), - _notifyScene(other._notifyScene) + _notifyScene(other._notifyScene), + _scene(other._scene) { for (const auto &cmp : other._components) this->addComponent(*cmp.second); diff --git a/lib/wal/sources/Scene/Scene.cpp b/lib/wal/sources/Scene/Scene.cpp index aab82e82..647c5087 100644 --- a/lib/wal/sources/Scene/Scene.cpp +++ b/lib/wal/sources/Scene/Scene.cpp @@ -34,8 +34,8 @@ namespace WAL for (auto &view : this->_views) { if (std::find(view->getTypes().begin(), view->getTypes().end(), type) == view->getTypes().end()) continue; - bool valid = std::all_of(view->getTypes().begin(), view->getTypes().end(), [&entity](const auto &type){ - return entity.hasComponent(type); + bool valid = std::all_of(view->getTypes().begin(), view->getTypes().end(), [&entity](const auto <ype){ + return entity.hasComponent(ltype); }); if (valid) view->emplace_back(entity); diff --git a/sources/Component/Button/ButtonComponent.hpp b/sources/Component/Button/ButtonComponent.hpp index 42055be6..c7fda66d 100644 --- a/sources/Component/Button/ButtonComponent.hpp +++ b/sources/Component/Button/ButtonComponent.hpp @@ -44,7 +44,7 @@ namespace BBM //! @brief Constructor with the 3 callback ButtonComponent(WAL::Entity &entity, WAL::Callback callback) : WAL::Component(entity), - onEvent(callback), _up(nullptr), _down(nullptr), _left(nullptr), _right(nullptr) + onEvent(callback), _up(nullptr), _down(nullptr), _right(nullptr), _left(nullptr) { } ButtonComponent &setButtonLinks(WAL::Entity *up = nullptr, WAL::Entity *down = nullptr, diff --git a/sources/Models/Vector2.hpp b/sources/Models/Vector2.hpp index b3dacf2b..0f27fe3a 100644 --- a/sources/Models/Vector2.hpp +++ b/sources/Models/Vector2.hpp @@ -29,8 +29,8 @@ namespace BBM {} //! @brief Create a new vector2 representing a specific coordinate. - Vector2(T x, T y) - : x(x), y(y) + Vector2(T _x, T _y) + : x(_x), y(_y) {} //! @brief A default destructor diff --git a/sources/Models/Vector3.hpp b/sources/Models/Vector3.hpp index 3f6ef2cf..f3549465 100644 --- a/sources/Models/Vector3.hpp +++ b/sources/Models/Vector3.hpp @@ -29,8 +29,8 @@ namespace BBM {} //! @brief Create a new vector3 representing a specific coordinate. - Vector3(T x, T y, T z) - : x(x), y(y), z(z) + Vector3(T _x, T _y, T _z) + : x(_x), y(_y), z(_z) {} //! @brief A default destructor From 051096a194836d901e5915f38cc98ce464f715ad Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Thu, 17 Jun 2021 20:50:43 +0200 Subject: [PATCH 08/12] fix compile errors --- CMakeLists.txt | 2 +- lib/Ray/CMakeLists.txt | 6 +-- lib/wal/CMakeLists.txt | 2 +- sources/Component/Bomb/BasicBombComponent.cpp | 6 +-- sources/Component/Bomb/BasicBombComponent.hpp | 2 +- .../BombHolder/BombHolderComponent.cpp | 4 +- .../Collision/CollisionComponent.cpp | 38 +++++++++---------- sources/Component/Color/ColorComponent.cpp | 4 +- sources/Component/Color/ColorComponent.hpp | 2 +- sources/Component/Health/HealthComponent.cpp | 4 +- sources/Component/Health/HealthComponent.hpp | 2 +- .../Component/Keyboard/KeyboardComponent.cpp | 4 +- .../Component/Keyboard/KeyboardComponent.hpp | 2 +- .../Component/Levitate/LevitateComponent.cpp | 4 +- .../Component/Levitate/LevitateComponent.hpp | 2 +- sources/Component/Lobby/LobbyComponent.cpp | 8 ++-- sources/Component/Lobby/LobbyComponent.hpp | 2 +- sources/Component/Music/MusicComponent.cpp | 4 +- .../Component/Renderer/CameraComponent.cpp | 4 +- .../Component/Renderer/CameraComponent.hpp | 2 +- .../Renderer/Drawable2DComponent.hpp | 16 ++++---- .../Renderer/Drawable3DComponent.hpp | 4 +- sources/Component/Shaders/ShaderComponent.cpp | 20 +++++----- sources/Component/Sound/SoundComponent.cpp | 10 ++--- sources/Component/Timer/TimerComponent.cpp | 6 +-- sources/Component/Timer/TimerComponent.hpp | 2 +- sources/Map/Map.cpp | 6 +-- sources/Map/MapInfo.cpp | 4 +- sources/Runner/CreditScene.cpp | 12 +++--- sources/Runner/GameScene.cpp | 4 +- sources/Runner/HowToPlayScene.cpp | 2 +- sources/Runner/Runner.cpp | 1 - sources/Runner/ScoreScene.cpp | 8 ++-- sources/Runner/SplashScreenScene.cpp | 8 ++-- sources/System/Animation/AnimationsSystem.cpp | 1 - sources/System/Animator/AnimatorSystem.cpp | 2 +- .../System/BombHolder/BombHolderSystem.cpp | 20 +++++----- sources/System/Bonus/PlayerBonusSystem.cpp | 2 - .../GridCentered/GridCenteredSystem.cpp | 5 +-- .../IntroAnimation/IntroAnimationSystem.cpp | 4 +- .../IntroAnimation/IntroAnimationSystem.hpp | 4 -- sources/System/Lobby/LobbySystem.cpp | 2 +- sources/System/Renderer/CameraSystem.cpp | 14 +++---- 43 files changed, 124 insertions(+), 137 deletions(-) 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; From c08319d1f3dc58644a015db553b3ef84077e0779 Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Thu, 17 Jun 2021 21:54:54 +0200 Subject: [PATCH 09/12] remove werror compilation flag --- CMakeLists.txt | 2 +- lib/Ray/CMakeLists.txt | 2 +- lib/wal/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab315dbc..38fa4806 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-parameter -W -Werror -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -Wno-unused-parameter -W -g") endif() set(CMAKE_CXX_FLAGS_RELEASE "-O2") diff --git a/lib/Ray/CMakeLists.txt b/lib/Ray/CMakeLists.txt index 45042747..62cd3819 100644 --- a/lib/Ray/CMakeLists.txt +++ b/lib/Ray/CMakeLists.txt @@ -7,7 +7,7 @@ project("${LIB_NAME}") include_directories(${LIB_NAME} ./sources) if (CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -Werror -Wno-unused-parameter -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -Wno-unused-parameter -g") endif() set(CMAKE_CXX_FLAGS_RELEASE "-O2") diff --git a/lib/wal/CMakeLists.txt b/lib/wal/CMakeLists.txt index 465ede45..54498458 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-parameter -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wshadow -W -Wno-unused-parameter -g") endif() set(CMAKE_CXX_FLAGS_RELEASE "-O2") From cf96619231d3a75ed0b475ed32b77eeaef7cae58 Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Thu, 17 Jun 2021 21:59:39 +0200 Subject: [PATCH 10/12] use size_t instead og static cast --- sources/Runner/ScoreScene.cpp | 2 +- sources/System/Renderer/CameraSystem.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/Runner/ScoreScene.cpp b/sources/Runner/ScoreScene.cpp index 36dc00fe..b746b28e 100644 --- a/sources/Runner/ScoreScene.cpp +++ b/sources/Runner/ScoreScene.cpp @@ -58,7 +58,7 @@ namespace BBM scene->addEntity("scene title text") .addComponent(1920 / 2.37, 250, 0) .addComponent("CONGRATS", 50, RAY::Vector2(), ORANGE); - for (int i = 0; i < static_cast(players.size()); i++) { + for (size_t i = 0; i < 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), diff --git a/sources/System/Renderer/CameraSystem.cpp b/sources/System/Renderer/CameraSystem.cpp index 1919ecba..d9c10a97 100644 --- a/sources/System/Renderer/CameraSystem.cpp +++ b/sources/System/Renderer/CameraSystem.cpp @@ -53,8 +53,8 @@ namespace BBM introAnimation(entity, true); if (playerPos.size() == 1) newCameraPos = playerPos[0]; - for (int i = 0; i < static_cast(playerPos.size()); i++) - for (int j = 0; j < static_cast(playerPos.size()); j++) { + for (size_t i = 0; i < playerPos.size(); i++) + for (size_t j = 0; j < playerPos.size(); j++) { if (maxDist < playerPos[i].distance(playerPos[j])) { maxDist = playerPos[i].distance(playerPos[j]); newCameraPos = (playerPos[i] + playerPos[j]) / 2; From 8d9234ceae2f4c5b2f89c784ee50e59ff91ca86c Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Thu, 17 Jun 2021 22:07:56 +0200 Subject: [PATCH 11/12] for structural binding variable mistake --- sources/System/BombHolder/BombHolderSystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/System/BombHolder/BombHolderSystem.cpp b/sources/System/BombHolder/BombHolderSystem.cpp index 96953023..f2a2b398 100644 --- a/sources/System/BombHolder/BombHolderSystem.cpp +++ b/sources/System/BombHolder/BombHolderSystem.cpp @@ -189,8 +189,8 @@ namespace BBM } if (controllable.bomb && holder.bombCount > 0) { auto spawnPos = position.position.round(); - for (auto &[__, pos, _] : this->_wal.getScene()->view()) { - if (pos.position == spawnPos) + for (auto &eachEntity: this->_wal.getScene()->view()) { + if (eachEntity.get().position == spawnPos) return; } holder.bombCount--; From e18f72578ec9fbec7c333ad8aa0ec5c4ef639906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Fri, 18 Jun 2021 09:11:33 +0200 Subject: [PATCH 12/12] fixing shaders throw --- sources/Component/Shaders/ShaderComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/Component/Shaders/ShaderComponent.cpp b/sources/Component/Shaders/ShaderComponent.cpp index ec5fb7ab..26847905 100644 --- a/sources/Component/Shaders/ShaderComponent.cpp +++ b/sources/Component/Shaders/ShaderComponent.cpp @@ -25,7 +25,7 @@ namespace BBM const WAL::Callback &onFixedUpdate, bool lonely) : WAL::Component(entity), - shader(vertexFilePath, fragmentFilePath, lonely), + shader(vertexPath, fragmentPath, lonely), fragmentFilePath(fragmentPath), vertexFilePath(vertexPath), update(onFixedUpdate)