summaryrefslogtreecommitdiff
path: root/src/rend2/tr_init.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2013-01-12 22:37:54 +0000
committerTim Angus <tim@ngus.net>2013-01-12 22:37:54 +0000
commit177fea22534fb944325a74f5a67ae6afd89b0086 (patch)
tree26f5e4652f648b0b080df38ed1356fe16ffa59d5 /src/rend2/tr_init.c
parent7ff9d4dfb43e2a0cba2568bf1ece25ae7fe5cc75 (diff)
Changes to make rend2 work with Tremulous
* Remove static video mode stuff * Add SetClipRegion to rend2
Diffstat (limited to 'src/rend2/tr_init.c')
-rw-r--r--src/rend2/tr_init.c89
1 files changed, 7 insertions, 82 deletions
diff --git a/src/rend2/tr_init.c b/src/rend2/tr_init.c
index 94b97f8b..30062bb9 100644
--- a/src/rend2/tr_init.c
+++ b/src/rend2/tr_init.c
@@ -195,9 +195,9 @@ cvar_t *r_lodCurveError;
cvar_t *r_fullscreen;
cvar_t *r_noborder;
-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;
@@ -319,77 +319,6 @@ void GL_CheckErrs( char *file, int line ) {
}
-/*
-** 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 = ARRAY_LEN( r_vidModes );
-
-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" );
-}
-
-
/*
==============================================================================
@@ -1135,9 +1064,9 @@ void R_Register( void )
r_mode = ri.Cvar_Get( "r_mode", "-2", CVAR_ARCHIVE | CVAR_LATCH );
r_fullscreen = ri.Cvar_Get( "r_fullscreen", "1", CVAR_ARCHIVE );
r_noborder = ri.Cvar_Get("r_noborder", "0", 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);
@@ -1297,7 +1226,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 );
@@ -1342,9 +1270,6 @@ void R_Init( void ) {
Com_Memset( &backEnd, 0, sizeof( backEnd ) );
Com_Memset( &tess, 0, sizeof( tess ) );
- if(sizeof(glconfig_t) != 11332)
- ri.Error( ERR_FATAL, "Mod ABI incompatible: sizeof(glconfig_t) == %u != 11332", (unsigned int) sizeof(glconfig_t));
-
// Swap_Init();
if ( (intptr_t)tess.xyz & 15 ) {
@@ -1455,7 +1380,6 @@ void RE_Shutdown( qboolean destroyWindow ) {
ri.Cmd_RemoveCommand ("skinlist");
ri.Cmd_RemoveCommand ("gfxinfo");
ri.Cmd_RemoveCommand("minimize");
- ri.Cmd_RemoveCommand( "modelist" );
ri.Cmd_RemoveCommand( "shaderstate" );
ri.Cmd_RemoveCommand( "gfxmeminfo" );
@@ -1550,6 +1474,7 @@ refexport_t *GetRefAPI ( int apiVersion, refimport_t *rimp ) {
re.RenderScene = RE_RenderScene;
re.SetColor = RE_SetColor;
+ re.SetClipRegion = RE_SetClipRegion;
re.DrawStretchPic = RE_StretchPic;
re.DrawStretchRaw = RE_StretchRaw;
re.UploadCinematic = RE_UploadCinematic;