diff --git a/src/tileset.cpp b/src/tileset.cpp index 908ed623..00511450 100644 --- a/src/tileset.cpp +++ b/src/tileset.cpp @@ -61,7 +61,7 @@ TileSet::TileSet(char const *path) array tiles; if (m_data->m_image->RetrieveTiles(tiles)) - for (int i = 0; i < tiles.Count(); i++) + for (ptrdiff_t i = 0; i < tiles.Count(); i++) AddTile(ibox2(tiles[0].m1, tiles[0].m1 + tiles[0].m2)); } @@ -72,7 +72,7 @@ TileSet::TileSet(char const *path, Image* image) array tiles; if (m_data->m_image->RetrieveTiles(tiles)) - for (int i = 0; i < tiles.Count(); i++) + for (ptrdiff_t i = 0; i < tiles.Count(); i++) AddTile(ibox2(tiles[0].m1, tiles[0].m1 + tiles[0].m2)); } @@ -102,7 +102,7 @@ TileSet::TileSet(char const *path, ivec2 size, ivec2 count) array tiles; if (m_data->m_image->RetrieveTiles(tiles)) - for (int i = 0; i < tiles.Count(); i++) + for (ptrdiff_t i = 0; i < tiles.Count(); i++) AddTile(ibox2(tiles[i].m1, tiles[i].m1 + tiles[i].m2)); } @@ -132,7 +132,7 @@ TileSet::TileSet(char const *path, Image* image, ivec2 size, ivec2 count) array tiles; if (m_data->m_image->RetrieveTiles(tiles)) - for (int i = 0; i < tiles.Count(); i++) + for (ptrdiff_t i = 0; i < tiles.Count(); i++) AddTile(ibox2(tiles[i].m1, tiles[i].m1 + tiles[i].m2)); } @@ -155,7 +155,7 @@ void TileSet::Init(char const *path, Image* image) m_drawgroup = DRAWGROUP_BEFORE; } -int TileSet::AddTile(ibox2 rect) +ptrdiff_t TileSet::AddTile(ibox2 rect) { m_data->m_tiles.Push(rect, box2((vec2)rect.A / (vec2)m_data->m_texture_size, @@ -233,12 +233,12 @@ char const *TileSet::GetName() return m_data->m_name.C(); } -int TileSet::GetTileCount() const +ptrdiff_t TileSet::GetTileCount() const { return m_data->m_tiles.Count(); } -ivec2 TileSet::GetTileSize(int tileid) const +ivec2 TileSet::GetTileSize(ptrdiff_t tileid) const { ibox2 const &box = m_data->m_tiles[tileid].m1; return box.B - box.A; diff --git a/src/tileset.h b/src/tileset.h index 3f5a8f4e..0f3dc35a 100644 --- a/src/tileset.h +++ b/src/tileset.h @@ -46,10 +46,10 @@ protected: public: /* New methods */ - int AddTile(ibox2 rect); + ptrdiff_t AddTile(ibox2 rect); void AddTile(ivec2 count); ptrdiff_t GetTileCount() const; - ivec2 GetTileSize(int tileid) const; + ivec2 GetTileSize(ptrdiff_t tileid) const; Texture * GetTexture(); Texture const * GetTexture() const;