SDL_Rect reference fix.
Texture::GetTextureRect() returned reference of a temp copy.
This commit is contained in:
1 parent
74b8c36d82
commit
aa5cb103dd
3 files changed
+3
-4
No files matched your search
Regular → Executable
File mode changed.
@@ -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