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
|
try
|
||||||
{
|
{
|
||||||
SDL_Rect rect = _txRects.at(i);
|
return _txRects.at(i);
|
||||||
return rect;
|
|
||||||
}
|
}
|
||||||
catch (const std::out_of_range&)
|
catch (const std::out_of_range&)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ namespace UE
|
|||||||
{
|
{
|
||||||
_txRectID = textureID;
|
_txRectID = textureID;
|
||||||
|
|
||||||
//Sabemos que en caso de no estar disponible, no devolverá el Rect 0 (Textura completa).
|
//Sabemos que en caso de no estar disponible, nos devolverá el Rect 0 (Textura completa).
|
||||||
_txRect = _tx->GetTextureRect(textureID);
|
_txRect = SDL_Rect(_tx->GetTextureRect(textureID));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user