testaudio: Don't crash if renderer is NULL (happens during shutdown).
parent
7f408e57ee
commit
b17151eb16
|
@ -416,12 +416,14 @@ static void DrawThings(SDL_Renderer *renderer)
|
||||||
static void Draw(void)
|
static void Draw(void)
|
||||||
{
|
{
|
||||||
SDL_Renderer *renderer = state->renderers[0];
|
SDL_Renderer *renderer = state->renderers[0];
|
||||||
|
if (renderer) { /* might be NULL if we're shutting down. */
|
||||||
SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
|
SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
|
||||||
SDL_SetRenderDrawColor(renderer, 64, 0, 64, 255);
|
SDL_SetRenderDrawColor(renderer, 64, 0, 64, 255);
|
||||||
SDL_RenderClear(renderer);
|
SDL_RenderClear(renderer);
|
||||||
DrawThings(renderer);
|
DrawThings(renderer);
|
||||||
SDL_RenderPresent(renderer);
|
SDL_RenderPresent(renderer);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void RepositionRowOfThings(const ThingType what, const float y)
|
static void RepositionRowOfThings(const ThingType what, const float y)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue