diff --git a/src/GameState.cpp b/src/GameState.cpp index 00cac80..96c97cb 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -106,9 +106,7 @@ void GameState::Update(double dt) _lorePannel.Render(); return; } - - _cells(_registry); - + systems::RenderModels(_registry, _modelCache, _window, _camera, dt); systems::TimedEffect(_registry, dt); systems::Buttons(_registry, _window); @@ -123,4 +121,5 @@ void GameState::Update(double dt) systems::Images(_registry, _imageCache, _window); systems::Texts(_registry, _window); systems::Sound(_registry, dt); + _cells(_registry); } diff --git a/src/LevelSelectState.cpp b/src/LevelSelectState.cpp index c328617..8c3aee8 100644 --- a/src/LevelSelectState.cpp +++ b/src/LevelSelectState.cpp @@ -58,7 +58,7 @@ static void create_locked_icon(entt::DefaultRegistry& r, size_t i) auto locked = r.create(); r.assign(locked, - "assets/textures/locked.png", + "assets/textures/dark_blue_button.png", botlefts[i], toprights[i], 1); diff --git a/src/Texture.cpp b/src/Texture.cpp index d28f4db..fbbedd2 100644 --- a/src/Texture.cpp +++ b/src/Texture.cpp @@ -6,7 +6,10 @@ Texture::Texture(std::string filepath) unsigned error = lodepng::decode(_imageData, _width, _height, filepath.c_str()); if (error) + { + std::cout << filepath << std::endl; std::cout << "error: " << lodepng_error_text(error) << std::endl; + } std::vector temp(_width * 4); diff --git a/src/bomberman.hpp b/src/bomberman.hpp index f0e0be2..3e15237 100644 --- a/src/bomberman.hpp +++ b/src/bomberman.hpp @@ -2,6 +2,7 @@ #define GLFW_INCLUDE_GLCOREARB #define GLM_ENABLE_EXPERIMENTAL +#define NDEBUG #include #include diff --git a/src/scripts.cpp b/src/scripts.cpp index 7ba78e3..c99d6c8 100644 --- a/src/scripts.cpp +++ b/src/scripts.cpp @@ -9,7 +9,7 @@ script explode(int power) return [power](entt::DefaultRegistry& r, uint32_t e) { auto ex = r.create(); - glm::vec3 &pos = r.get(e).pos; + glm::vec3& pos = r.get(e).pos; auto &sound = r.get().ref.sound; r.assign(ex, power); @@ -72,7 +72,7 @@ script death(std::string level) { return [level](entt::DefaultRegistry& r, uint32_t e) { - explode(1)(r, e); + auto ex = r.create(); auto &sound = r.get().ref.sound; auto game_over = [level](entt::DefaultRegistry& r, uint32_t) { @@ -80,9 +80,8 @@ script death(std::string level) engine.ChangeState(new DeathState(engine, level)); }; sound.play2D(ASSET_PATH "sounds/player_death.wav"); - r.assign(e, 1.5f, game_over); - r.remove(e); - r.remove(e); + r.assign(ex, 1.5f, game_over); + r.destroy(e); }; }