However, this can be confusing as a SDL_Surface* can also be passed into a draw function.
This change makes the bool cleanup variable cleanup the SDL_Surface* if it is passed into the draw function. It also now correctly handles the SDL_Texture* that is created - which has to be free'd later by GraphicsHandler.
Prior to this change,
bool cleanup
was used to determine if aSDL_Texture*
needed to be cleaned up by theGraphicsHandler
.https://github.com/JeLLyNinjas/TerminalFighter/blob/5709f99229da6e750ebdf0f829e7eafae1df5abd/src/Engine/GraphicsHandler/GraphicsHandler.cpp#L72
However, this can be confusing as a
SDL_Surface*
can also be passed into a draw function.This change makes the
bool cleanup
variable cleanup theSDL_Surface*
if it is passed into the draw function. It also now correctly handles theSDL_Texture*
that is created - which has to be free'd later byGraphicsHandler
.