added TileMaps to TSE

This commit is contained in:
2026-02-08 18:09:46 +01:00
parent ea2dc4f6b5
commit 330d4b26dc
12 changed files with 643 additions and 9 deletions

View File

@@ -33,3 +33,24 @@ void TSE::TileSet::GetSpriteAt(int x, int y, Sprite &s)
s = Sprite(tex, Rect(startpos, endpos));
}
int TSE::TileSet::GetSpriteIdAt(int x, int y)
{
if(x < 0 || x >= resx || y < 0 || y >= resy)
{
TSE_ERROR("The sprite you are trying to access is out of range");
return -1;
}
return y * resx + x;
}
uint TSE::TileSet::GetTextueID()
{
return tex->GetTextureId();
}
TSE::Vector2 TSE::TileSet::GetCount()
{
return Vector2(resx, resy);
}