Small adjustment to some checks.

This commit is contained in:
Julie Marchant 2019-05-23 12:18:29 -04:00
parent 0d822ee7d7
commit 281687b1c5
1 changed files with 3 additions and 7 deletions

View File

@ -268,15 +268,13 @@ void engine_setMode()
engine.autoPause = autoPause;
screen = SDL_CreateRGBSurface(0, DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT, 32, 0xff0000, 0xff00, 0xff, 0xff000000);
if (!screen)
if (screen == NULL)
{
printf("Couldn't create %ix%ix32 surface: %s\n", DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT, SDL_GetError());
exit(1);
}
window = SDL_CreateWindow("Project: Starfighter", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, screen->w, screen->h, 0);
if (window == NULL)
{
printf("Could not create window: %s\n", SDL_GetError());
@ -287,8 +285,7 @@ void engine_setMode()
SDL_SetWindowFullscreen(window, engine.fullScreen ? FULLSCREEN : 0);
renderer = SDL_CreateRenderer(window, -1, 0);
if (!renderer)
if (renderer == NULL)
{
printf("Could not create renderer: %s\n", SDL_GetError());
exit(1);
@ -297,8 +294,7 @@ void engine_setMode()
SDL_RenderSetLogicalSize(renderer, screen->w, screen->h);
renderer_texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, screen->w, screen->h);
if (!renderer_texture)
if (renderer_texture == NULL)
{
printf("Couldn't create %ix%ix32 texture: %s\n", screen->w, screen->h, SDL_GetError());
exit(1);