2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-28 13:02:13 +01:00

sdl: vid: fix unitialized variables, better warning report

This commit is contained in:
Alibek Omarov 2019-04-13 21:49:01 +03:00
parent 211d3c5213
commit 99478ba9bd

View File

@ -27,7 +27,7 @@ static void GL_SetupAttributes( void );
struct struct
{ {
int prev_width, prev_height; int prev_width, prev_height;
} sdlState; } sdlState = { 640, 480 };
struct struct
{ {
@ -145,7 +145,7 @@ void *SW_LockBuffer()
int stride; int stride;
if( SDL_LockTexture(sw.tex, NULL, &pixels, &stride ) ) if( SDL_LockTexture(sw.tex, NULL, &pixels, &stride ) )
Sys_Error(SDL_GetError()); Sys_Error("%s", SDL_GetError());
return pixels; return pixels;
} }
else else
@ -919,7 +919,7 @@ qboolean VID_SetMode( void )
else if( err == rserr_invalid_mode ) else if( err == rserr_invalid_mode )
{ {
Con_Reportf( S_ERROR "VID_SetMode: invalid mode\n" ); Con_Reportf( S_ERROR "VID_SetMode: invalid mode\n" );
Sys_Warn( "invalid mode" ); Sys_Warn( "invalid mode, engine will run in %dx%d", sdlState.prev_width, sdlState.prev_height );
} }
// try setting it back to something safe // try setting it back to something safe