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;