SDL_Rect reference fix.
Texture::GetTextureRect() returned reference of a temp copy.
This commit is contained in:
Regular → Executable
@@ -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&)
|
||||
{
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user