diff --git a/libs/blah b/libs/blah index 63466dc..a1267c7 160000 --- a/libs/blah +++ b/libs/blah @@ -1 +1 @@ -Subproject commit 63466dc2ea6c2affbdd84a696f592796b98d0b3d +Subproject commit a1267c738c1d046b3f7872508b511c820af37fae diff --git a/src/components/collider.cpp b/src/components/collider.cpp index 3fa490d..d4693bb 100644 --- a/src/components/collider.cpp +++ b/src/components/collider.cpp @@ -23,10 +23,7 @@ Collider Collider::make_grid(int tile_size, int columns, int rows) collider.m_grid.tile_size = tile_size; collider.m_grid.columns = columns; collider.m_grid.rows = rows; - collider.m_grid.cells = std::shared_ptr(new bool[columns * rows]); - - memset(collider.m_grid.cells.get(), 0, sizeof(bool) * columns * rows); - + collider.m_grid.cells.expand(columns * rows); return collider; } diff --git a/src/components/collider.h b/src/components/collider.h index 17abcf5..3c50f00 100644 --- a/src/components/collider.h +++ b/src/components/collider.h @@ -1,6 +1,5 @@ #pragma once #include -#include #include "../world.h" using namespace Blah; @@ -44,7 +43,7 @@ namespace TL int columns; int rows; int tile_size; - std::shared_ptr cells; + Vector cells; }; Shape m_shape = Shape::None; diff --git a/src/components/tilemap.cpp b/src/components/tilemap.cpp index 289410c..7231fa1 100644 --- a/src/components/tilemap.cpp +++ b/src/components/tilemap.cpp @@ -12,7 +12,7 @@ Tilemap::Tilemap(int tile_width, int tile_height, int columns, int rows) m_tile_height = tile_height; m_columns = columns; m_rows = rows; - m_grid = std::shared_ptr(new Subtexture[columns * rows]); + m_grid.expand(columns * rows); } int Tilemap::tile_width() const diff --git a/src/components/tilemap.h b/src/components/tilemap.h index 3d57208..94629ee 100644 --- a/src/components/tilemap.h +++ b/src/components/tilemap.h @@ -1,7 +1,6 @@ #pragma once #include "../world.h" #include -#include using namespace Blah; @@ -23,7 +22,7 @@ namespace TL void render(Batch& batch) override; private: - std::shared_ptr m_grid; + Vector m_grid; int m_tile_width = 0; int m_tile_height = 0; int m_columns = 0;