diff options
author | Thilo Schulz <arny@ats.s.bawue.de> | 2011-08-01 01:19:55 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-10 23:11:05 +0000 |
commit | 819546192265e70832c75cecc29dce929a4feeec (patch) | |
tree | a345b3d876d8dbdcccf1b13ff450fe0227bf2176 /src/sdl | |
parent | 500076c2e63329331c2a98e88cfa34f8044a7b76 (diff) |
Modular rendering system. Patch by use.less01 This might break MSVC builds. I'll take care of it later
Diffstat (limited to 'src/sdl')
-rw-r--r-- | src/sdl/sdl_gamma.c | 2 | ||||
-rw-r--r-- | src/sdl/sdl_glimp.c | 22 | ||||
-rw-r--r-- | src/sdl/sdl_input.c | 12 |
3 files changed, 18 insertions, 18 deletions
diff --git a/src/sdl/sdl_gamma.c b/src/sdl/sdl_gamma.c index dad4bb34..7f16b606 100644 --- a/src/sdl/sdl_gamma.c +++ b/src/sdl/sdl_gamma.c @@ -61,7 +61,7 @@ void GLimp_SetGamma( unsigned char red[256], unsigned char green[256], unsigned GetVersionEx( &vinfo ); if( vinfo.dwMajorVersion >= 5 && vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) { - Com_DPrintf( "performing gamma clamp.\n" ); + ri.Printf( PRINT_DEVELOPER, "performing gamma clamp.\n" ); for( j = 0 ; j < 3 ; j++ ) { for( i = 0 ; i < 128 ; i++ ) diff --git a/src/sdl/sdl_glimp.c b/src/sdl/sdl_glimp.c index 41114ca9..babbaade 100644 --- a/src/sdl/sdl_glimp.c +++ b/src/sdl/sdl_glimp.c @@ -93,7 +93,7 @@ void GLimp_Shutdown( void ) { float oldDisplayAspect = glConfig.displayAspect; - IN_Shutdown(); + ri.IN_Shutdown(); SDL_QuitSubSystem( SDL_INIT_VIDEO ); screen = NULL; @@ -484,10 +484,10 @@ static qboolean GLimp_StartDriverAndSetMode( qboolean failSafe, qboolean fullscr SDL_VideoDriverName( driverName, sizeof( driverName ) - 1 ); ri.Printf( PRINT_ALL, "SDL using driver \"%s\"\n", driverName ); - Cvar_Set( "r_sdlDriver", driverName ); + ri.Cvar_Set( "r_sdlDriver", driverName ); } - if (fullscreen && Cvar_VariableIntegerValue( "in_nograb" ) ) + if (fullscreen && ri.Cvar_VariableIntegerValue( "in_nograb" ) ) { ri.Printf( PRINT_ALL, "Fullscreen not allowed with in_nograb 1\n"); ri.Cvar_Set( "r_fullscreen", "0" ); @@ -704,7 +704,7 @@ void GLimp_Init( void ) r_allowResize = ri.Cvar_Get( "r_allowResize", "0", CVAR_ARCHIVE ); r_centerWindow = ri.Cvar_Get( "r_centerWindow", "0", CVAR_ARCHIVE ); - if( Cvar_VariableIntegerValue( "com_abnormalExit" ) ) + if( ri.Cvar_VariableIntegerValue( "com_abnormalExit" ) ) { ri.Cvar_Set( "r_width", va( "%d", R_FAILSAFE_WIDTH ) ); ri.Cvar_Set( "r_height", va( "%d", R_FAILSAFE_HEIGHT ) ); @@ -713,16 +713,16 @@ void GLimp_Init( void ) ri.Cvar_Set( "com_abnormalExit", "0" ); } - Sys_SetEnv( "SDL_VIDEO_CENTERED", r_centerWindow->integer ? "1" : "" ); + ri.Sys_SetEnv( "SDL_VIDEO_CENTERED", r_centerWindow->integer ? "1" : "" ); - Sys_GLimpInit( ); + ri.Sys_GLimpInit( ); // Create the window and set up the context if( GLimp_StartDriverAndSetMode( qfalse, r_fullscreen->integer, r_noborder->integer ) ) goto success; // Try again, this time in a platform specific "safe mode" - Sys_GLimpSafeInit( ); + ri.Sys_GLimpSafeInit( ); if( GLimp_StartDriverAndSetMode( qfalse, r_fullscreen->integer, qfalse ) ) goto success; @@ -760,7 +760,7 @@ success: ri.Cvar_Get( "r_availableModes", "", CVAR_ROM ); // This depends on SDL_INIT_VIDEO, hence having it here - IN_Init( ); + ri.IN_Init( ); } @@ -791,7 +791,7 @@ void GLimp_EndFrame( void ) // Find out the current state fullscreen = !!( s->flags & SDL_FULLSCREEN ); - if( r_fullscreen->integer && Cvar_VariableIntegerValue( "in_nograb" ) ) + if( r_fullscreen->integer && ri.Cvar_VariableIntegerValue( "in_nograb" ) ) { ri.Printf( PRINT_ALL, "Fullscreen not allowed with in_nograb 1\n"); ri.Cvar_Set( "r_fullscreen", "0" ); @@ -809,9 +809,9 @@ void GLimp_EndFrame( void ) { // SDL_WM_ToggleFullScreen didn't work, so do it the slow way if( !sdlToggled ) - Cbuf_AddText( "vid_restart" ); + ri.Cmd_ExecuteText(EXEC_APPEND, "vid_restart"); - IN_Restart( ); + ri.IN_Restart( ); } r_fullscreen->modified = qfalse; diff --git a/src/sdl/sdl_input.c b/src/sdl/sdl_input.c index 83b26086..2cc3dcf4 100644 --- a/src/sdl/sdl_input.c +++ b/src/sdl/sdl_input.c @@ -503,7 +503,7 @@ static void IN_ActivateMouse( void ) } // in_nograb makes no sense in fullscreen mode - if( !r_fullscreen->integer ) + if( !Cvar_VariableIntegerValue("r_fullscreen") ) { if( in_nograb->modified || !mouseActive ) { @@ -531,7 +531,7 @@ static void IN_DeactivateMouse( void ) // Always show the cursor when the mouse is disabled, // but not when fullscreen - if( !r_fullscreen->integer ) + if( !Cvar_VariableIntegerValue("r_fullscreen") ) { if( ( Key_GetCatcher( ) == KEYCATCH_UI ) && ( SDL_GetAppState( ) & SDL_APPMOUSEFOCUS ) ) @@ -985,8 +985,8 @@ static void IN_ProcessEvents( void ) char width[32], height[32]; Com_sprintf( width, sizeof(width), "%d", e.resize.w ); Com_sprintf( height, sizeof(height), "%d", e.resize.h ); - ri.Cvar_Set( "r_width", width ); - ri.Cvar_Set( "r_height", height ); + Cvar_Set( "r_width", width ); + Cvar_Set( "r_height", height ); /* wait until user stops dragging for 1 second, so we aren't constantly recreating the GL context while he tries to drag...*/ @@ -1026,12 +1026,12 @@ void IN_Frame( void ) loading = !!( clc.state != CA_DISCONNECTED && clc.state != CA_ACTIVE ); cursorShowing = Key_GetCatcher( ) & KEYCATCH_UI; - if( !r_fullscreen->integer && ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) ) + if( !Cvar_VariableIntegerValue("r_fullscreen") && ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) ) { // Console is down in windowed mode IN_DeactivateMouse( ); } - else if( !r_fullscreen->integer && loading ) + else if( !Cvar_VariableIntegerValue("r_fullscreen") && loading ) { // Loading in windowed mode IN_DeactivateMouse( ); |