From cc50f90c6fd4e8d4646fec22a7100cff8e86a17f Mon Sep 17 00:00:00 2001 From: Bluub Date: Mon, 7 Jun 2021 17:00:43 +0200 Subject: [PATCH] fix cmake lua install --- CMakeLists.txt | 4 ++-- sources/Map/Map.cpp | 26 +++++++++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 167ea788..d0dcb4fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,7 @@ add_executable(bomberman ${SOURCES} ) target_include_directories(bomberman PUBLIC sources ${LUA_INCLUDE_DIR}) -target_link_libraries(bomberman PUBLIC wal ray lua) +target_link_libraries(bomberman PUBLIC wal ray ${LUA_LIBRARIES}) add_executable(unit_tests EXCLUDE_FROM_ALL ${SOURCES} @@ -100,7 +100,7 @@ add_executable(unit_tests EXCLUDE_FROM_ALL tests/CollisionTest.cpp ) target_include_directories(unit_tests PUBLIC sources) -target_link_libraries(unit_tests PUBLIC wal ray) +target_link_libraries(unit_tests PUBLIC wal ray lua) find_package(Catch2 QUIET) if (NOT Catch2_FOUND) diff --git a/sources/Map/Map.cpp b/sources/Map/Map.cpp index c4709164..8d14e585 100644 --- a/sources/Map/Map.cpp +++ b/sources/Map/Map.cpp @@ -3,9 +3,10 @@ // Edited by Benjamin Henry on 5/26/21. // +#include "Component/Tag/TagComponent.hpp" #include -#include "Map.hpp" #include +#include "Map.hpp" namespace RAY3D = RAY::Drawables::Drawables3D; @@ -54,7 +55,8 @@ namespace BBM scene->addEntity("Unbreakable Wall") .addComponent(i, 0, j) .addComponent(WAL::Callback(), &MapGenerator::wallCollide, .75) - .addComponent(unbreakableObj, std::make_pair(MAP_DIFFUSE, unbreakablePng)); + .addComponent(unbreakableObj, std::make_pair(MAP_DIFFUSE, unbreakablePng)) + .addComponent("UNBREAKABLE");; } } } @@ -101,8 +103,9 @@ namespace BBM if (map[std::make_tuple(i, 0, j)] != HOLE && map[std::make_tuple(i, -1, j)] != BUMPER) scene->addEntity("Unbreakable Wall") .addComponent(Vector3f(i, -1, j)) - .addComponent(floorObj, - std::make_pair(MAP_DIFFUSE, floorPng)); + .addComponent(floorObj, + std::make_pair(MAP_DIFFUSE, floorPng)) + .addComponent("UNBREAKABLE");; } } } @@ -136,7 +139,8 @@ namespace BBM .addComponent(coords) .addComponent(1) .addComponent(WAL::Callback(), &MapGenerator::wallCollide, .75) - .addComponent(breakableObj, std::make_pair(MAP_DIFFUSE, breakablePng)); + .addComponent(breakableObj, std::make_pair(MAP_DIFFUSE, breakablePng)) + .addComponent("BREAKABLE"); } void MapGenerator::createFloor(Vector3f coords, std::shared_ptr scene) @@ -170,7 +174,8 @@ namespace BBM .addComponent(coords) .addComponent(WAL::Callback(), &MapGenerator::wallCollide, .75) .addComponent(UnbreakableObj, - std::make_pair(MAP_DIFFUSE, UnbreakablePng)); + std::make_pair(MAP_DIFFUSE, UnbreakablePng)) + .addComponent("UNBREAKABLE");; } void MapGenerator::createHole(Vector3f coords, std::shared_ptr scene) @@ -182,7 +187,8 @@ namespace BBM WAL::Entity &holeEntity = scene->addEntity("Hole Block"); - holeEntity.addComponent(Vector3f(coords.x, coords.y - 1, coords.z)); + holeEntity.addComponent(Vector3f(coords.x, coords.y - 1, coords.z)) + .addComponent("HOLE");; if (coords.y == 0) holeEntity.addComponent(holeObj, std::make_pair(MAP_DIFFUSE, holePng)); @@ -203,7 +209,8 @@ namespace BBM scene->addEntity("Bumper Block") .addComponent(Vector3f(coords.x, coords.y, coords.z)) - .addComponent(bumperObj, std::make_pair(MAP_DIFFUSE, bumperPng)); + .addComponent(bumperObj, std::make_pair(MAP_DIFFUSE, bumperPng)) + .addComponent("BUMPER");; /* .addComponent([](const WAL::Entity &entity, WAL::Entity &other) { if (other.hasComponent()) { auto &movable = other.getComponent(); @@ -220,7 +227,8 @@ namespace BBM scene->addEntity("Stairs Block") .addComponent(coords) //.addComponent(1) - .addComponent(stairsObj, std::make_pair(MAP_DIFFUSE, stairsPng)); + .addComponent(stairsObj, std::make_pair(MAP_DIFFUSE, stairsPng)) + .addComponent("STAIRS");; } bool MapGenerator::isCloseToBlockType(std::map, BlockType> map, int x, int y, int z,