summaryrefslogtreecommitdiff
path: root/src/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer')
-rw-r--r--src/renderer/tr_init.c90
-rw-r--r--src/renderer/tr_local.h10
2 files changed, 14 insertions, 86 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 );
diff --git a/src/renderer/tr_local.h b/src/renderer/tr_local.h
index 1bbe12fc..d1ca202f 100644
--- a/src/renderer/tr_local.h
+++ b/src/renderer/tr_local.h
@@ -1028,7 +1028,10 @@ extern cvar_t *r_facePlaneCull; // enables culling of planar surfaces with back
extern cvar_t *r_nocurves;
extern cvar_t *r_showcluster;
-extern cvar_t *r_mode; // video mode
+extern cvar_t *r_width;
+extern cvar_t *r_height;
+extern cvar_t *r_pixelAspect;
+
extern cvar_t *r_fullscreen;
extern cvar_t *r_gamma;
extern cvar_t *r_displayRefresh; // optional display refresh option
@@ -1197,9 +1200,8 @@ model_t *R_AllocModel( void );
void R_Init( void );
image_t *R_FindImageFile( const char *name, qboolean mipmap, qboolean allowPicmip, int glWrapClampMode );
-image_t *R_CreateImage( const char *name, const byte *pic, int width, int height, qboolean mipmap
- , qboolean allowPicmip, int wrapClampMode );
-qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode );
+image_t *R_CreateImage( const char *name, const byte *pic, int width, int height, qboolean mipmap,
+ qboolean allowPicmip, int wrapClampMode );
void R_SetColorMappings( void );
void R_GammaCorrect( byte *buffer, int bufSize );