From bc30c6278cafdb8edb2d40a5072073d79d741d76 Mon Sep 17 00:00:00 2001 From: Sander van Dijk Date: Sat, 18 Oct 2014 16:33:01 +0000 Subject: [PATCH] sdl: Make our error checking for SDL_Init(SubSystem) consistent with the SDL wiki/test programs. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1126 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/cd_sdl.c | 2 +- Quake/gl_vidsdl.c | 4 ++-- Quake/main_sdl.c | 2 +- Quake/snd_sdl.c | 2 +- Windows/QuakeSpasm.rc | 2 ++ 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Quake/cd_sdl.c b/Quake/cd_sdl.c index d14b59a3..e0c8e501 100644 --- a/Quake/cd_sdl.c +++ b/Quake/cd_sdl.c @@ -504,7 +504,7 @@ int CDAudio_Init(void) export_cddev_arg(); - if (SDL_InitSubSystem(SDL_INIT_CDROM) == -1) + if (SDL_InitSubSystem(SDL_INIT_CDROM) < 0) { Con_Printf("Couldn't init SDL cdrom: %s\n", SDL_GetError()); return -1; diff --git a/Quake/gl_vidsdl.c b/Quake/gl_vidsdl.c index ffe242e8..97d41b8a 100644 --- a/Quake/gl_vidsdl.c +++ b/Quake/gl_vidsdl.c @@ -1304,8 +1304,8 @@ void VID_Init (void) putenv (vid_center); /* SDL_putenv is problematic in versions <= 1.2.9 */ - if (SDL_InitSubSystem(SDL_INIT_VIDEO) == -1) - Sys_Error("Could not initialize SDL Video"); + if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) + Sys_Error("Couldn't init SDL video: %s", SDL_GetError()); #if defined(USE_SDL2) { diff --git a/Quake/main_sdl.c b/Quake/main_sdl.c index 54942ead..ef18e41f 100644 --- a/Quake/main_sdl.c +++ b/Quake/main_sdl.c @@ -82,7 +82,7 @@ static void Sys_InitSDL (void) if (SDL_Init(0) < 0) { - Sys_Error("SDL failed to initialize."); + Sys_Error("Couldn't init SDL: %s", SDL_GetError()); } atexit(Sys_AtExit); } diff --git a/Quake/snd_sdl.c b/Quake/snd_sdl.c index 077c04d3..60a243ba 100644 --- a/Quake/snd_sdl.c +++ b/Quake/snd_sdl.c @@ -84,7 +84,7 @@ qboolean SNDDMA_Init (dma_t *dma) int tmp, val; char drivername[128]; - if (SDL_InitSubSystem(SDL_INIT_AUDIO) == -1) + if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { Con_Printf("Couldn't init SDL audio: %s\n", SDL_GetError()); return false; diff --git a/Windows/QuakeSpasm.rc b/Windows/QuakeSpasm.rc index e5ee6a77..6c1ff2a1 100644 --- a/Windows/QuakeSpasm.rc +++ b/Windows/QuakeSpasm.rc @@ -1 +1,3 @@ +#include icon ICON "QuakeSpasm.ico" +1 RT_MANIFEST "QuakeSpasm.manifest"