added TileMaps to TSE
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,9 @@ namespace TSE
|
||||
void SetTexture(Texture* tex);
|
||||
|
||||
void GetSpriteAt(int x, int y, Sprite& s);
|
||||
int GetSpriteIdAt(int x, int y);
|
||||
uint GetTextueID();
|
||||
Vector2 GetCount();
|
||||
|
||||
inline void SetCount(Vector2& v)
|
||||
{
|
||||
@@ -27,5 +30,6 @@ namespace TSE
|
||||
{
|
||||
GetSpriteAt(v.x, v.y, s);
|
||||
};
|
||||
|
||||
};
|
||||
} // namespace TSE
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace TSE
|
||||
|
||||
Matrix4x4 Transformable::GetLocalMatrix() const
|
||||
{
|
||||
return Matrix4x4::ToTranslationMatrix(position) * Matrix4x4::ToRotationMatrix(rotation) * Matrix4x4::ToScaleMatrix(scale);;
|
||||
return Matrix4x4::ToTranslationMatrix(position) * Matrix4x4::ToRotationMatrix(rotation) * Matrix4x4::ToScaleMatrix(scale);
|
||||
}
|
||||
|
||||
Matrix4x4 Transformable::GetGlobalMatrix() const
|
||||
|
||||
Reference in New Issue
Block a user