diff options
author | Tim Angus <tim@ngus.net> | 2009-10-03 11:27:22 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:15:00 +0000 |
commit | f65675275f974129c76249e374b5423a2a444acd (patch) | |
tree | 1da97a1bd26d179ad9da2342df8060638d24ef8a /src/renderer/tr_init.c | |
parent | e5d4b2471e72ff574ebc0d01afbab50fc447cf5a (diff) |
* s/r_custom/r_/
* Remove r_mode, making r_width and r_height the only way to choose resolution
* Add UI code to parse the detected resolutions list
* Make ITEM_TYPE_COMBO do something; basically an ITEM_TYPE_MULTI which is
populated by a feeder. A proper combobox widget would be better... in the
future maybe
* Improve keyboard/mouse button control on ITEM_TYPE_MULTI
* Change resolution selection in options menu to use an ITEM_TYPE_COMBO fed by
FEEDER_RESOLUTIONS
Diffstat (limited to 'src/renderer/tr_init.c')
-rw-r--r-- | src/renderer/tr_init.c | 90 |
1 files changed, 8 insertions, 82 deletions
diff --git a/src/renderer/tr_init.c b/src/renderer/tr_init.c index fd230bd2..426579d7 100644 --- a/src/renderer/tr_init.c +++ b/src/renderer/tr_init.c @@ -100,7 +100,6 @@ cvar_t *r_vertexLight; cvar_t *r_uiFullScreen; cvar_t *r_shadows; cvar_t *r_flares; -cvar_t *r_mode; cvar_t *r_nobind; cvar_t *r_singleShader; cvar_t *r_roundImagesDown; @@ -126,9 +125,9 @@ cvar_t *r_lodCurveError; cvar_t *r_fullscreen; -cvar_t *r_customwidth; -cvar_t *r_customheight; -cvar_t *r_customPixelAspect; +cvar_t *r_width; +cvar_t *r_height; +cvar_t *r_pixelAspect; cvar_t *r_overBrightBits; cvar_t *r_mapOverBrightBits; @@ -278,7 +277,7 @@ static void InitOpenGL( void ) // // GLimp_Init directly or indirectly references the following cvars: // - r_fullscreen - // - r_mode + // - r_(width|height|pixelAspect) // - r_(color|depth|stencil)bits // - r_ignorehwgamma // - r_gamma @@ -358,77 +357,6 @@ void GL_CheckErrors( void ) { } -/* -** R_GetModeInfo -*/ -typedef struct vidmode_s -{ - const char *description; - int width, height; - float pixelAspect; // pixel width / height -} vidmode_t; - -vidmode_t r_vidModes[] = -{ - { "Mode 0: 320x240", 320, 240, 1 }, - { "Mode 1: 400x300", 400, 300, 1 }, - { "Mode 2: 512x384", 512, 384, 1 }, - { "Mode 3: 640x480", 640, 480, 1 }, - { "Mode 4: 800x600", 800, 600, 1 }, - { "Mode 5: 960x720", 960, 720, 1 }, - { "Mode 6: 1024x768", 1024, 768, 1 }, - { "Mode 7: 1152x864", 1152, 864, 1 }, - { "Mode 8: 1280x1024", 1280, 1024, 1 }, - { "Mode 9: 1600x1200", 1600, 1200, 1 }, - { "Mode 10: 2048x1536", 2048, 1536, 1 }, - { "Mode 11: 856x480 (wide)",856, 480, 1 } -}; -static int s_numVidModes = ( sizeof( r_vidModes ) / sizeof( r_vidModes[0] ) ); - -qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode ) { - vidmode_t *vm; - float pixelAspect; - - if ( mode < -1 ) { - return qfalse; - } - if ( mode >= s_numVidModes ) { - return qfalse; - } - - if ( mode == -1 ) { - *width = r_customwidth->integer; - *height = r_customheight->integer; - pixelAspect = r_customPixelAspect->value; - } else { - vm = &r_vidModes[mode]; - - *width = vm->width; - *height = vm->height; - pixelAspect = vm->pixelAspect; - } - - *windowAspect = (float)*width / ( *height * pixelAspect ); - - return qtrue; -} - -/* -** R_ModeList_f -*/ -static void R_ModeList_f( void ) -{ - int i; - - ri.Printf( PRINT_ALL, "\n" ); - for ( i = 0; i < s_numVidModes; i++ ) - { - ri.Printf( PRINT_ALL, "%s\n", r_vidModes[i].description ); - } - ri.Printf( PRINT_ALL, "\n" ); -} - - /* ============================================================================== @@ -903,7 +831,7 @@ void GfxInfo_f( void ) ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize ); ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_UNITS_ARB: %d\n", glConfig.numTextureUnits ); ri.Printf( PRINT_ALL, "\nPIXELFORMAT: color(%d-bits) Z(%d-bit) stencil(%d-bits)\n", glConfig.colorBits, glConfig.depthBits, glConfig.stencilBits ); - ri.Printf( PRINT_ALL, "MODE: %d, %d x %d %s hz:", r_mode->integer, glConfig.vidWidth, glConfig.vidHeight, fsstrings[r_fullscreen->integer == 1] ); + ri.Printf( PRINT_ALL, "MODE: %d x %d %s hz:", glConfig.vidWidth, glConfig.vidHeight, fsstrings[r_fullscreen->integer == 1] ); if ( glConfig.displayFrequency ) { ri.Printf( PRINT_ALL, "%d\n", glConfig.displayFrequency ); @@ -1006,11 +934,10 @@ void R_Register( void ) r_depthbits = ri.Cvar_Get( "r_depthbits", "0", CVAR_ARCHIVE | CVAR_LATCH ); r_overBrightBits = ri.Cvar_Get ("r_overBrightBits", "1", CVAR_ARCHIVE | CVAR_LATCH ); r_ignorehwgamma = ri.Cvar_Get( "r_ignorehwgamma", "0", CVAR_ARCHIVE | CVAR_LATCH); - r_mode = ri.Cvar_Get( "r_mode", "3", CVAR_ARCHIVE | CVAR_LATCH ); r_fullscreen = ri.Cvar_Get( "r_fullscreen", "1", CVAR_ARCHIVE ); - r_customwidth = ri.Cvar_Get( "r_customwidth", "1600", CVAR_ARCHIVE | CVAR_LATCH ); - r_customheight = ri.Cvar_Get( "r_customheight", "1024", CVAR_ARCHIVE | CVAR_LATCH ); - r_customPixelAspect = ri.Cvar_Get( "r_customPixelAspect", "1", CVAR_ARCHIVE | CVAR_LATCH ); + r_width = ri.Cvar_Get( "r_width", "640", CVAR_ARCHIVE | CVAR_LATCH ); + r_height = ri.Cvar_Get( "r_height", "480", CVAR_ARCHIVE | CVAR_LATCH ); + r_pixelAspect = ri.Cvar_Get( "r_pixelAspect", "1", CVAR_ARCHIVE | CVAR_LATCH ); r_simpleMipMaps = ri.Cvar_Get( "r_simpleMipMaps", "1", CVAR_ARCHIVE | CVAR_LATCH ); r_vertexLight = ri.Cvar_Get( "r_vertexLight", "0", CVAR_ARCHIVE | CVAR_LATCH ); r_uiFullScreen = ri.Cvar_Get( "r_uifullscreen", "0", 0); @@ -1114,7 +1041,6 @@ void R_Register( void ) ri.Cmd_AddCommand( "shaderlist", R_ShaderList_f ); ri.Cmd_AddCommand( "skinlist", R_SkinList_f ); ri.Cmd_AddCommand( "modellist", R_Modellist_f ); - ri.Cmd_AddCommand( "modelist", R_ModeList_f ); ri.Cmd_AddCommand( "screenshot", R_ScreenShot_f ); ri.Cmd_AddCommand( "screenshotJPEG", R_ScreenShotJPEG_f ); ri.Cmd_AddCommand( "gfxinfo", GfxInfo_f ); |