SDL_Rect reference fix.

Texture::GetTextureRect() returned reference of a temp copy.
This commit is contained in:
2023-08-12 19:39:10 +02:00
parent 74b8c36d82
commit aa5cb103dd
3 changed files with 3 additions and 4 deletions
Regular → Executable
View File
+1 -2
View File
@@ -12,8 +12,7 @@ SDL_Rect& UE::Texture::GetTextureRect(int i)
{
try
{
SDL_Rect rect = _txRects.at(i);
return rect;
return _txRects.at(i);
}
catch (const std::out_of_range&)
{
+2 -2
View File
@@ -29,8 +29,8 @@ namespace UE
{
_txRectID = textureID;
//Sabemos que en caso de no estar disponible, no devolverá el Rect 0 (Textura completa).
_txRect = _tx->GetTextureRect(textureID);
//Sabemos que en caso de no estar disponible, nos devolverá el Rect 0 (Textura completa).
_txRect = SDL_Rect(_tx->GetTextureRect(textureID));
}