fix compile errors

This commit is contained in:
arthur.jamet
2021-06-17 19:24:49 +02:00
parent 7e6292134f
commit 1cf820bf87
7 changed files with 18 additions and 13 deletions
+2 -2
View File
@@ -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")
+5
View File
@@ -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
+4 -4
View File
@@ -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);
+2 -2
View File
@@ -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 &ltype){
return entity.hasComponent(ltype);
});
if (valid)
view->emplace_back(entity);
+1 -1
View File
@@ -44,7 +44,7 @@ namespace BBM
//! @brief Constructor with the 3 callback
ButtonComponent(WAL::Entity &entity, WAL::Callback<WAL::Entity &, WAL::Wal &> 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,
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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