mirror of
https://github.com/NoelFB/tiny_link.git
synced 2024-11-25 18:18:56 +08:00
removed shared_ptr arrays as clang isn't a fan
This commit is contained in:
parent
f8254013c3
commit
68bb409f98
|
@ -1 +1 @@
|
|||
Subproject commit 63466dc2ea6c2affbdd84a696f592796b98d0b3d
|
||||
Subproject commit a1267c738c1d046b3f7872508b511c820af37fae
|
|
@ -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<bool[]>(new bool[columns * rows]);
|
||||
|
||||
memset(collider.m_grid.cells.get(), 0, sizeof(bool) * columns * rows);
|
||||
|
||||
collider.m_grid.cells.expand(columns * rows);
|
||||
return collider;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#pragma once
|
||||
#include <blah.h>
|
||||
#include <memory>
|
||||
#include "../world.h"
|
||||
|
||||
using namespace Blah;
|
||||
|
@ -44,7 +43,7 @@ namespace TL
|
|||
int columns;
|
||||
int rows;
|
||||
int tile_size;
|
||||
std::shared_ptr<bool[]> cells;
|
||||
Vector<bool> cells;
|
||||
};
|
||||
|
||||
Shape m_shape = Shape::None;
|
||||
|
|
|
@ -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<Subtexture[]>(new Subtexture[columns * rows]);
|
||||
m_grid.expand(columns * rows);
|
||||
}
|
||||
|
||||
int Tilemap::tile_width() const
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
#include "../world.h"
|
||||
#include <blah.h>
|
||||
#include <memory>
|
||||
|
||||
using namespace Blah;
|
||||
|
||||
|
@ -23,7 +22,7 @@ namespace TL
|
|||
void render(Batch& batch) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<Subtexture[]> m_grid;
|
||||
Vector<Subtexture> m_grid;
|
||||
int m_tile_width = 0;
|
||||
int m_tile_height = 0;
|
||||
int m_columns = 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user