diff options
-rw-r--r-- | source/gl_draw.c | 11 | ||||
-rw-r--r-- | source/ui_addressbook.c | 2 | ||||
-rw-r--r-- | source/ui_atoms.c | 91 | ||||
-rw-r--r-- | source/ui_confirm.c | 8 | ||||
-rw-r--r-- | source/ui_credits.c | 4 | ||||
-rw-r--r-- | source/ui_demos.c | 8 | ||||
-rw-r--r-- | source/ui_game.c | 6 | ||||
-rw-r--r-- | source/ui_ingame.c | 10 | ||||
-rw-r--r-- | source/ui_keys.c | 4 | ||||
-rw-r--r-- | source/ui_loading.c | 29 | ||||
-rw-r--r-- | source/ui_local.h | 2 | ||||
-rw-r--r-- | source/ui_main.c | 4 | ||||
-rw-r--r-- | source/ui_menu.c | 4 | ||||
-rw-r--r-- | source/ui_multiplayer.c | 12 | ||||
-rw-r--r-- | source/ui_network.c | 2 | ||||
-rw-r--r-- | source/ui_options.c | 4 | ||||
-rw-r--r-- | source/ui_playerconfig.c | 10 | ||||
-rw-r--r-- | source/ui_video.c | 36 |
18 files changed, 138 insertions, 109 deletions
diff --git a/source/gl_draw.c b/source/gl_draw.c index 388019f..4813441 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -47,6 +47,7 @@ void Draw_SetColor( uint32 flags, const color_t color ) { void Draw_SetClipRect( uint32 flags, const clipRect_t *clip ) { clipRect_t rc; + float scale; if( ( draw.flags & DRAW_CLIP_MASK ) == flags ) { return; @@ -60,22 +61,24 @@ void Draw_SetClipRect( uint32 flags, const clipRect_t *clip ) { return; } + scale = 1 / draw.scale; + rc.left = 0; rc.top = 0; if( flags & DRAW_CLIP_LEFT ) { - rc.left = clip->left; + rc.left = clip->left * scale; } if( flags & DRAW_CLIP_TOP ) { - rc.top = clip->top; + rc.top = clip->top * scale; } rc.right = gl_config.vidWidth; rc.bottom = gl_config.vidHeight; if( flags & DRAW_CLIP_RIGHT ) { - rc.right = clip->right; + rc.right = clip->right * scale; } if( flags & DRAW_CLIP_BOTTOM ) { - rc.bottom = clip->bottom; + rc.bottom = clip->bottom * scale; } qglEnable( GL_SCISSOR_TEST ); diff --git a/source/ui_addressbook.c b/source/ui_addressbook.c index 653537b..4d67e2f 100644 --- a/source/ui_addressbook.c +++ b/source/ui_addressbook.c @@ -73,7 +73,7 @@ static void AddressBook_MenuInit( void ) { m_addressBook.fields[i].generic.type = MTYPE_FIELD; m_addressBook.fields[i].generic.name = NULL; - m_addressBook.fields[i].generic.x = ( uis.glconfig.vidWidth - 30 * SMALLCHAR_WIDTH ) / 2 - RCOLUMN_OFFSET; + m_addressBook.fields[i].generic.x = ( uis.width - 30 * SMALLCHAR_WIDTH ) / 2 - RCOLUMN_OFFSET; m_addressBook.fields[i].generic.y = y; y += MENU_SPACING; diff --git a/source/ui_atoms.c b/source/ui_atoms.c index e413188..d1346b6 100644 --- a/source/ui_atoms.c +++ b/source/ui_atoms.c @@ -35,8 +35,9 @@ clientAPI_t client; uiStatic_t uis; cvar_t *ui_debug; -cvar_t *ui_open; -cvar_t *ui_background; +static cvar_t *ui_open; +static cvar_t *ui_background; +static cvar_t *ui_scale; // =========================================================================== @@ -54,7 +55,7 @@ void UI_PushMenu( menuFrameWork_t *menu ) { // if this menu is already present, drop back to that level // to avoid stacking menus by hotkeys - for( i=0 ; i<uis.menuDepth ; i++ ) { + for( i = 0; i < uis.menuDepth; i++ ) { if( uis.layers[i] == menu ) { break; } @@ -68,17 +69,14 @@ void UI_PushMenu( menuFrameWork_t *menu ) { uis.menuDepth = i; } - for( i=uis.menuDepth-1 ; i>=0 ; i-- ) { + uis.transparent = qfalse; + for( i = uis.menuDepth - 1; i >= 0; i-- ) { if( uis.layers[i]->transparent ) { + uis.transparent = qtrue; break; } } - uis.transparent = qtrue; - if( i < 0 ) { - uis.transparent = qfalse; - } - if( !menu->callback ) { menu->callback = EmptyCallback; } @@ -99,6 +97,28 @@ void UI_PushMenu( menuFrameWork_t *menu ) { UI_DoHitTest(); } +void UI_UpdateGeometry( void ) { + if( uis.glconfig.renderer == GL_RENDERER_SOFTWARE ) { + uis.clipRect.left = 0; + uis.clipRect.top = 0; + uis.clipRect.right = uis.glconfig.vidWidth; + uis.clipRect.bottom = uis.glconfig.vidHeight; + uis.scale = 1; + uis.width = uis.glconfig.vidWidth; + uis.height = uis.glconfig.vidHeight; + } else { + if( ui_scale->value < 1 ) { + cvar.Set( "ui_scale", "1" ); + } else if( ui_scale->value > 9 ) { + cvar.Set( "ui_scale", "9" ); + } + uis.scale = 1 / ui_scale->value; + uis.width = uis.glconfig.vidWidth * uis.scale; + uis.height = uis.glconfig.vidHeight * uis.scale; + } +} + + /* ================= UI_ForceMenuOff @@ -107,7 +127,7 @@ UI_ForceMenuOff void UI_ForceMenuOff( void ) { int i; - for( i=0 ; i<uis.menuDepth ; i++ ) { + for( i = 0; i < uis.menuDepth; i++ ) { if( uis.layers[i] ) { uis.layers[i]->callback( ID_MENU, QM_DESTROY, qtrue ); } @@ -118,6 +138,8 @@ void UI_ForceMenuOff( void ) { uis.activeMenu = NULL; uis.transparent = qfalse; //keys.ClearStates(); + + UI_UpdateGeometry(); } /* @@ -141,20 +163,15 @@ void UI_PopMenu( void ) { uis.activeMenu = uis.layers[uis.menuDepth - 1]; - for( i=uis.menuDepth-1 ; i>=0 ; i-- ) { + uis.transparent = qfalse; + for( i = uis.menuDepth - 1; i >= 0; i-- ) { if( uis.layers[i]->transparent ) { + uis.transparent = qtrue; break; } } - uis.transparent = qtrue; - if( i < 0 ) { - uis.transparent = qfalse; - } - UI_DoHitTest(); - - } /* @@ -284,7 +301,7 @@ void UI_SetupDefaultBanner( menuStatic_t *banner, const char *name ) { banner->generic.name = name; banner->generic.uiFlags = UI_CENTER|UI_ALTCOLOR; - banner->generic.x = uis.glconfig.vidWidth / 2; + banner->generic.x = uis.width / 2; banner->generic.y = 8; } @@ -388,8 +405,8 @@ void UI_MouseMove( int mx, int my ) { uis.mouseCoords[0] += mx; uis.mouseCoords[1] += my; - clamp( uis.mouseCoords[0], 0, uis.glconfig.vidWidth ); - clamp( uis.mouseCoords[1], 0, uis.glconfig.vidHeight ); + clamp( uis.mouseCoords[0], 0, uis.width ); + clamp( uis.mouseCoords[1], 0, uis.height ); if( UI_DoHitTest() ) { // TODO: add new mousemove sound @@ -419,15 +436,17 @@ void UI_Draw( int realtime ) { ref.SetColor( DRAW_COLOR_CLEAR, NULL ); if( uis.glconfig.renderer == GL_RENDERER_SOFTWARE ) { ref.SetClipRect( DRAW_CLIP_MASK, &uis.clipRect ); + } else { + ref.SetScale( &uis.scale ); } if( !uis.transparent ) { // no transparent menus if( uis.backgroundHandle ) { - ref.DrawStretchPic( 0, 0, uis.glconfig.vidWidth, uis.glconfig.vidHeight, + ref.DrawStretchPic( 0, 0, uis.width, uis.height, uis.backgroundHandle ); } else { - ref.DrawFill( 0, 0, uis.glconfig.vidWidth, uis.glconfig.vidHeight, 0 ); + ref.DrawFill( 0, 0, uis.width, uis.height, 0 ); } if( uis.activeMenu->draw ) { @@ -440,10 +459,10 @@ void UI_Draw( int realtime ) { for( i = 0; i < uis.menuDepth; i++ ) { if( !uis.layers[i]->transparent ) { if( uis.backgroundHandle ) { - ref.DrawStretchPic( 0, 0, uis.glconfig.vidWidth, uis.glconfig.vidHeight, + ref.DrawStretchPic( 0, 0, uis.width, uis.height, uis.backgroundHandle ); } else { - ref.DrawFill( 0, 0, uis.glconfig.vidWidth, uis.glconfig.vidHeight, 0 ); + ref.DrawFill( 0, 0, uis.width, uis.height, 0 ); } } @@ -455,13 +474,12 @@ void UI_Draw( int realtime ) { } } - ref.DrawStretchPic( uis.mouseCoords[0] - uis.cursorWidth / 2, - uis.mouseCoords[1] - uis.cursorHeight / 2, - uis.cursorWidth, uis.cursorHeight, uis.cursorHandle ); + ref.DrawPic( uis.mouseCoords[0] - uis.cursorWidth / 2, + uis.mouseCoords[1] - uis.cursorHeight / 2, uis.cursorHandle ); if( ui_debug->integer ) { Menu_HitTest( uis.activeMenu, 0, 0 ); - UI_DrawString( uis.glconfig.vidWidth - 4, 4, NULL, UI_RIGHT, + UI_DrawString( uis.width - 4, 4, NULL, UI_RIGHT, va( "%3i %3i", uis.mouseCoords[0], uis.mouseCoords[1] ) ); } @@ -475,6 +493,8 @@ void UI_Draw( int realtime ) { if( uis.glconfig.renderer == GL_RENDERER_SOFTWARE ) { ref.SetClipRect( DRAW_CLIP_DISABLED, NULL ); + } else { + ref.SetScale( NULL ); } ref.SetColor( DRAW_COLOR_CLEAR, NULL ); } @@ -688,16 +708,9 @@ static void ui_background_changed( cvar_t *self ) { } void UI_ModeChanged( void ) { - UI_ForceMenuOff(); - + ui_scale = cvar.Get( "ui_scale", "1", 0 ); ref.GetConfig( &uis.glconfig ); - if( uis.glconfig.renderer == GL_RENDERER_SOFTWARE ) { - uis.clipRect.left = 0; - uis.clipRect.top = 0; - uis.clipRect.right = uis.glconfig.vidWidth; - uis.clipRect.bottom = uis.glconfig.vidHeight; - } - + UI_ForceMenuOff(); } /* @@ -727,7 +740,7 @@ qboolean UI_Init( void ) { uis.backgroundHandle = ref.RegisterPic( ui_background->string ); } ui_background->changed = ui_background_changed; - } + } // Point to a nice location at startup strcpy( uis.m_demos_browse, "/demos" ); diff --git a/source/ui_confirm.c b/source/ui_confirm.c index 7142953..863a05d 100644 --- a/source/ui_confirm.c +++ b/source/ui_confirm.c @@ -71,8 +71,8 @@ static void ConfirmMenu_Init( const char *text, void (*action)( qboolean yes ) ) m_confirm.text.generic.type = MTYPE_STATIC; m_confirm.text.generic.name = text; - m_confirm.text.generic.x = uis.glconfig.vidWidth / 2; - m_confirm.text.generic.y = uis.glconfig.vidHeight / 2; + m_confirm.text.generic.x = uis.width / 2; + m_confirm.text.generic.y = uis.height / 2; m_confirm.text.generic.uiFlags = UI_CENTER; Menu_AddItem( &m_confirm.menu, ( void * )&m_confirm.text ); @@ -119,8 +119,8 @@ static void ErrorMenu_Init( comErrorType_t type, const char *text ) { m_error.text.generic.type = MTYPE_STATIC; m_error.text.generic.flags = QMF_CUSTOM_COLOR; m_error.text.generic.name = text; - m_error.text.generic.x = uis.glconfig.vidWidth / 2; - m_error.text.generic.y = uis.glconfig.vidHeight / 2; + m_error.text.generic.x = uis.width / 2; + m_error.text.generic.y = uis.height / 2; m_error.text.generic.uiFlags = UI_CENTER|UI_MULTILINE; if( type == ERR_DROP ) { *( uint32 * )m_error.text.generic.color = *( uint32 * )colorRed; diff --git a/source/ui_credits.c b/source/ui_credits.c index 04aaa53..9c0e10d 100644 --- a/source/ui_credits.c +++ b/source/ui_credits.c @@ -150,7 +150,7 @@ void M_Credits_MenuDraw( menuFrameWork_t *self ) { uint32 flags; float alpha; - yMax = uis.glconfig.vidHeight - BORDER_HEIGHT - 8; + yMax = uis.height - BORDER_HEIGHT - 8; /* ** draw the credits @@ -176,7 +176,7 @@ void M_Credits_MenuDraw( menuFrameWork_t *self ) { } ref.SetColor( DRAW_COLOR_ALPHA, ( byte * )&alpha ); - UI_DrawString( uis.glconfig.vidWidth / 2, y, NULL, flags, string ); + UI_DrawString( uis.width / 2, y, NULL, flags, string ); ref.SetColor( DRAW_COLOR_CLEAR, NULL ); } diff --git a/source/ui_demos.c b/source/ui_demos.c index 730a5b6..9c249f3 100644 --- a/source/ui_demos.c +++ b/source/ui_demos.c @@ -359,8 +359,8 @@ static void Demos_MenuInit( void ) { Demos_BuildList( uis.m_demos_browse ); - w1 = ( uis.glconfig.vidWidth - 30 ) * 0.8f; - w2 = ( uis.glconfig.vidWidth - 30 ) * 0.2f; + w1 = ( uis.width - 30 ) * 0.8f; + w2 = ( uis.width - 30 ) * 0.2f; m_demos.list.generic.type = MTYPE_LIST; m_demos.list.generic.id = ID_LIST; @@ -368,7 +368,7 @@ static void Demos_MenuInit( void ) { m_demos.list.generic.x = 10; m_demos.list.generic.y = 32; m_demos.list.generic.width = 0; - m_demos.list.generic.height = uis.glconfig.vidHeight - 64; + m_demos.list.generic.height = uis.height - 64; m_demos.list.generic.name = NULL; m_demos.list.itemnames = ( const char ** )m_demos.names; m_demos.list.drawNames = qtrue; @@ -394,7 +394,7 @@ static void Demos_MenuInit( void ) { m_demos.playerList.generic.flags = QMF_HIDDEN|QMF_DISABLED; m_demos.playerList.generic.x = w1 + 20; m_demos.playerList.generic.y = 32; - m_demos.playerList.generic.height = uis.glconfig.vidHeight - 64; + m_demos.playerList.generic.height = uis.height - 64; m_demos.playerList.itemnames = ( const char ** )m_demos.playerNames; m_demos.playerList.mlFlags = MLF_HIDE_SCROLLBAR_EMPTY; m_demos.playerList.numcolumns = 1; diff --git a/source/ui_game.c b/source/ui_game.c index 0662243..8e52345 100644 --- a/source/ui_game.c +++ b/source/ui_game.c @@ -94,7 +94,7 @@ static void GameMenu_Init( void ) { y = 120; m_game.skill.generic.type = MTYPE_SPINCONTROL; m_game.skill.generic.name = "skill"; - m_game.skill.generic.x = uis.glconfig.vidWidth / 2; + m_game.skill.generic.x = uis.width / 2; m_game.skill.generic.y = y; m_game.skill.itemnames = difficulty_names; y += 8; @@ -102,7 +102,7 @@ static void GameMenu_Init( void ) { m_game.load.generic.type = MTYPE_ACTION; m_game.load.generic.id = ID_LOADGAME; m_game.load.generic.name = "load game"; - m_game.load.generic.x = uis.glconfig.vidWidth / 2 + LCOLUMN_OFFSET; + m_game.load.generic.x = uis.width / 2 + LCOLUMN_OFFSET; m_game.load.generic.y = y; m_game.load.generic.uiFlags = UI_RIGHT; y += 8; @@ -111,7 +111,7 @@ static void GameMenu_Init( void ) { m_game.start.generic.flags = QMF_HASFOCUS; m_game.start.generic.id = ID_START; m_game.start.generic.name = "start game"; - m_game.start.generic.x = uis.glconfig.vidWidth / 2 + LCOLUMN_OFFSET; + m_game.start.generic.x = uis.width / 2 + LCOLUMN_OFFSET; m_game.start.generic.y = y; m_game.start.generic.uiFlags = UI_RIGHT; y += 8; diff --git a/source/ui_ingame.c b/source/ui_ingame.c index 96fa787..8810cc4 100644 --- a/source/ui_ingame.c +++ b/source/ui_ingame.c @@ -89,15 +89,15 @@ static void IngameMenu_Draw( menuFrameWork_t *self ) { int y1, y2; color_t color; - y1 = ( uis.glconfig.vidHeight - 16 * INGAME_ITEMS ) / 2 - 16; - y2 = ( uis.glconfig.vidHeight + 16 * INGAME_ITEMS ) / 2 + 16; + y1 = ( uis.height - 16 * INGAME_ITEMS ) / 2 - 16; + y2 = ( uis.height + 16 * INGAME_ITEMS ) / 2 + 16; color[0] = 0; color[1] = 0; color[2] = 255; color[3] = 32; - ref.DrawFillEx( 0, y1, uis.glconfig.vidWidth, y2 - y1, color ); + ref.DrawFillEx( 0, y1, uis.width, y2 - y1, color ); Menu_Draw( self ); } @@ -108,8 +108,8 @@ static void IngameMenu_Init( void ) { int i; int x, y; - x = uis.glconfig.vidWidth / 2; - y = ( uis.glconfig.vidHeight - 16 * INGAME_ITEMS ) / 2; + x = uis.width / 2; + y = ( uis.height - 16 * INGAME_ITEMS ) / 2; memset( &m_ingame, 0, sizeof( m_ingame ) ); diff --git a/source/ui_keys.c b/source/ui_keys.c index 06b16ec..c73515a 100644 --- a/source/ui_keys.c +++ b/source/ui_keys.c @@ -157,8 +157,8 @@ static void KeysMenu_Init( const char **names, int total, const char *banner ) { menuKeybind_t *k; int i, x, y; - x = uis.glconfig.vidWidth / 2; - y = ( uis.glconfig.vidHeight - MENU_SPACING * total ) / 2; + x = uis.width / 2; + y = ( uis.height - MENU_SPACING * total ) / 2; memset( &m_keys, 0, sizeof( m_keys ) ); diff --git a/source/ui_loading.c b/source/ui_loading.c index 5f7e61d..1429c69 100644 --- a/source/ui_loading.c +++ b/source/ui_loading.c @@ -42,26 +42,31 @@ void UI_DrawLoading( int realtime ) { client.GetClientStatus( &loadingStatus ); + if( uis.glconfig.renderer == GL_RENDERER_SOFTWARE ) { + ref.SetClipRect( DRAW_CLIP_MASK, &uis.clipRect ); + } else { + ref.SetScale( &uis.scale ); + } + #if 0 if( loadingStatus.mapname[0] ) { qhandle_t hPic; Com_sprintf( buffer, sizeof( buffer ), "/levelshots/%s.jpg", loadingStatus.mapname ); if( ( hPic = ref.RegisterPic( buffer ) ) != 0 ) { - ref.DrawStretchPic( 0, 0, uis.glconfig.vidWidth, uis.glconfig.vidHeight, hPic ); + ref.DrawStretchPic( 0, 0, uis.width, uis.height, hPic ); } else { - ref.DrawFill( 0, 0, uis.glconfig.vidWidth, uis.glconfig.vidHeight, 0x00 ); + ref.DrawFill( 0, 0, uis.width, uis.height, 0x00 ); } } else #endif - { - ref.DrawFill( 0, 0, uis.glconfig.vidWidth, uis.glconfig.vidHeight, 0x00 ); - } + ref.DrawFill( 0, 0, uis.width, uis.height, 0x00 ); - x = uis.glconfig.vidWidth / 2; + x = uis.width / 2; y = 8; - - Q_concat( buffer, sizeof( buffer ), loadingStatus.demoplayback ? "Playing back " : "Connecting to ", loadingStatus.servername, NULL ); + + s = loadingStatus.demoplayback ? "Playing back " : "Connecting to "; + Q_concat( buffer, sizeof( buffer ), s, loadingStatus.servername, NULL ); UI_DrawString( x, y, NULL, UI_CENTER|UI_DROPSHADOW, buffer ); y += 40; @@ -91,7 +96,7 @@ void UI_DrawLoading( int realtime ) { s = "Awaiting server frame..."; break; default: - Com_Error( ERR_DROP, "SCR_DrawLoading: bad cls.state %i", loadingStatus.connState ); + Com_Error( ERR_DROP, "%s: bad cls.state %i", __func__, loadingStatus.connState ); break; } UI_DrawString( x, y, NULL, UI_CENTER|UI_DROPSHADOW, s ); @@ -105,5 +110,11 @@ void UI_DrawLoading( int realtime ) { if( loadingStatus.loadingString[0] ) { UI_DrawString( x, y, colorRed, UI_CENTER|UI_DROPSHADOW|UI_MULTILINE, loadingStatus.loadingString ); } + + if( uis.glconfig.renderer == GL_RENDERER_SOFTWARE ) { + ref.SetClipRect( DRAW_CLIP_DISABLED, NULL ); + } else { + ref.SetScale( NULL ); + } } diff --git a/source/ui_local.h b/source/ui_local.h index 32c9c8b..9a84ff5 100644 --- a/source/ui_local.h +++ b/source/ui_local.h @@ -246,6 +246,8 @@ typedef struct uiStatic_s { int realtime; glconfig_t glconfig; clipRect_t clipRect; + int width, height; // scaled + float scale; int menuDepth; menuFrameWork_t *layers[MAX_MENU_DEPTH]; menuFrameWork_t *activeMenu; diff --git a/source/ui_main.c b/source/ui_main.c index 588564b..59ca1e2 100644 --- a/source/ui_main.c +++ b/source/ui_main.c @@ -86,8 +86,8 @@ static void MainMenu_Init( void ) { int i; int x, y; - x = uis.glconfig.vidWidth / 2; - y = ( uis.glconfig.vidHeight - MENU_SPACING * MAIN_ITEMS ) / 2; + x = uis.width / 2; + y = ( uis.height - MENU_SPACING * MAIN_ITEMS ) / 2; memset( &m_main, 0, sizeof( m_main ) ); diff --git a/source/ui_menu.c b/source/ui_menu.c index 86ea81f..2b6bc60 100644 --- a/source/ui_menu.c +++ b/source/ui_menu.c @@ -1475,8 +1475,8 @@ void Menu_Draw( menuFrameWork_t *menu ) { // draw status bar // if( menu->statusbar ) { - ref.DrawFill( 0, uis.glconfig.vidHeight - 8, uis.glconfig.vidWidth, 8, 4 ); - UI_DrawString( uis.glconfig.vidWidth / 2, uis.glconfig.vidHeight - 8, NULL, UI_CENTER, menu->statusbar ); + ref.DrawFill( 0, uis.height - 8, uis.width, 8, 4 ); + UI_DrawString( uis.width / 2, uis.height - 8, NULL, UI_CENTER, menu->statusbar ); } } diff --git a/source/ui_multiplayer.c b/source/ui_multiplayer.c index f6065d2..56f9146 100644 --- a/source/ui_multiplayer.c +++ b/source/ui_multiplayer.c @@ -358,8 +358,8 @@ void JoinServer_MenuInit( void ) { memset( &m_join, 0, sizeof( m_join ) ); - w1 = ( uis.glconfig.vidWidth - 30 ) * 0.75f; - w2 = ( uis.glconfig.vidWidth - 30 ) * 0.25f; + w1 = ( uis.width - 30 ) * 0.75f; + w2 = ( uis.width - 30 ) * 0.25f; // // server list @@ -370,7 +370,7 @@ void JoinServer_MenuInit( void ) { m_join.list.generic.x = 10; m_join.list.generic.y = 32; m_join.list.generic.width = 0; - m_join.list.generic.height = uis.glconfig.vidHeight / 2 - 5 - 32; + m_join.list.generic.height = uis.height / 2 - 5 - 32; m_join.list.generic.name = NULL; m_join.list.itemnames = ( const char ** )m_join.names; m_join.list.drawNames = qtrue; @@ -395,9 +395,9 @@ void JoinServer_MenuInit( void ) { m_join.info.generic.id = 0; m_join.info.generic.flags = QMF_LEFT_JUSTIFY|QMF_HIDDEN; m_join.info.generic.x = 10; - m_join.info.generic.y = uis.glconfig.vidHeight / 2 + 5; + m_join.info.generic.y = uis.height / 2 + 5; m_join.info.generic.width = 0; - m_join.info.generic.height = uis.glconfig.vidHeight / 2 - 5 - 32; + m_join.info.generic.height = uis.height / 2 - 5 - 32; m_join.info.generic.name = NULL; m_join.info.itemnames = NULL; m_join.info.drawNames = qtrue; @@ -420,7 +420,7 @@ void JoinServer_MenuInit( void ) { m_join.players.generic.x = w1 + 20; m_join.players.generic.y = 32; m_join.players.generic.width = 0; - m_join.players.generic.height = uis.glconfig.vidHeight - 64; + m_join.players.generic.height = uis.height - 64; m_join.players.generic.name = NULL; m_join.players.mlFlags = MLF_HIDE_SCROLLBAR; m_join.players.itemnames = NULL; diff --git a/source/ui_network.c b/source/ui_network.c index c4586c1..357af89 100644 --- a/source/ui_network.c +++ b/source/ui_network.c @@ -153,7 +153,7 @@ static void Network_MenuInit( void ) { m_network.menu.callback = NetworkMenu_Callback; - x = uis.glconfig.vidWidth / 2; + x = uis.width / 2; y = 64; m_network.connection.generic.type = MTYPE_SPINCONTROL; diff --git a/source/ui_options.c b/source/ui_options.c index 9b11659..8597ddb 100644 --- a/source/ui_options.c +++ b/source/ui_options.c @@ -98,8 +98,8 @@ static void OptionsMenu_Init( void ) { int i; int x, y; - x = uis.glconfig.vidWidth / 2; - y = ( uis.glconfig.vidHeight - MENU_SPACING * OPTIONS_ITEMS ) / 2; + x = uis.width / 2; + y = ( uis.height - MENU_SPACING * OPTIONS_ITEMS ) / 2; memset( &m_options, 0, sizeof( m_options ) ); diff --git a/source/ui_playerconfig.c b/source/ui_playerconfig.c index 637fa95..5209284 100644 --- a/source/ui_playerconfig.c +++ b/source/ui_playerconfig.c @@ -217,10 +217,10 @@ qboolean PlayerConfig_MenuInit( void ) { } } - m_playerConfig.refdef.x = uis.glconfig.vidWidth / 2; + m_playerConfig.refdef.x = uis.width / 2; m_playerConfig.refdef.y = 60; - m_playerConfig.refdef.width = uis.glconfig.vidWidth / 2; - m_playerConfig.refdef.height = uis.glconfig.vidHeight - 122; + m_playerConfig.refdef.width = uis.width / 2; + m_playerConfig.refdef.height = uis.height - 122; m_playerConfig.refdef.fov_x = 40; m_playerConfig.refdef.fov_y = Com_CalcFov( m_playerConfig.refdef.fov_x, @@ -246,8 +246,8 @@ qboolean PlayerConfig_MenuInit( void ) { m_playerConfig.oldTime = m_playerConfig.time; PlayerConfig_RunFrame(); - x = uis.glconfig.vidWidth / 2 - 130; - y = uis.glconfig.vidHeight / 2 - 97; + x = uis.width / 2 - 130; + y = uis.height / 2 - 97; m_playerConfig.menu.draw = PlayerConfig_MenuDraw; m_playerConfig.menu.callback = PlayerConfig_MenuCallback; diff --git a/source/ui_video.c b/source/ui_video.c index a82b9a8..1b95ea2 100644 --- a/source/ui_video.c +++ b/source/ui_video.c @@ -377,14 +377,14 @@ static void VideoMenu_Init( void ) { m_video.driver.generic.flags = QMF_HASFOCUS; m_video.driver.generic.id = ID_REF; m_video.driver.generic.name = "driver"; - m_video.driver.generic.x = uis.glconfig.vidWidth / 2; + m_video.driver.generic.x = uis.width / 2; m_video.driver.generic.y = y; m_video.driver.itemnames = refs; m_video.driver.curvalue = -1; y += MENU_SPACING; m_video.screensize.generic.type = MTYPE_SLIDER; - m_video.screensize.generic.x = uis.glconfig.vidWidth / 2; + m_video.screensize.generic.x = uis.width / 2; m_video.screensize.generic.y = y; m_video.screensize.generic.name = "screen size"; m_video.screensize.minvalue = 3; @@ -394,7 +394,7 @@ static void VideoMenu_Init( void ) { m_video.gamma.generic.type = MTYPE_SLIDER; m_video.gamma.generic.id = ID_GAMMA; - m_video.gamma.generic.x = uis.glconfig.vidWidth / 2; + m_video.gamma.generic.x = uis.width / 2; m_video.gamma.generic.y = y; m_video.gamma.generic.name = "gamma"; m_video.gamma.minvalue = 5; @@ -404,7 +404,7 @@ static void VideoMenu_Init( void ) { m_video.fullscreen.generic.type = MTYPE_SPINCONTROL; m_video.fullscreen.generic.id = ID_FULLSCREEN; - m_video.fullscreen.generic.x = uis.glconfig.vidWidth / 2; + m_video.fullscreen.generic.x = uis.width / 2; m_video.fullscreen.generic.y = y; m_video.fullscreen.generic.name = "video mode"; m_video.fullscreen.itemnames = ( const char ** )m_video.modes; @@ -417,7 +417,7 @@ static void VideoMenu_Init( void ) { m_video.gammaType.generic.type = MTYPE_SPINCONTROL; m_video.gammaType.generic.id = ID_GAMMATYPE; - m_video.gammaType.generic.x = uis.glconfig.vidWidth / 2; + m_video.gammaType.generic.x = uis.width / 2; m_video.gammaType.generic.y = yy; m_video.gammaType.generic.name = "gamma correction"; m_video.gammaType.curvalue = cvar.VariableInteger( "vid_hwgamma" ) ? 1 : 0; @@ -426,7 +426,7 @@ static void VideoMenu_Init( void ) { m_video.picmip.generic.type = MTYPE_SLIDER; m_video.picmip.generic.id = ID_PICMIP; - m_video.picmip.generic.x = uis.glconfig.vidWidth / 2; + m_video.picmip.generic.x = uis.width / 2; m_video.picmip.generic.y = yy; m_video.picmip.generic.name = "texture quality"; m_video.picmip.minvalue = 0; @@ -438,7 +438,7 @@ static void VideoMenu_Init( void ) { m_video.textureFilter.generic.type = MTYPE_SPINCONTROL; m_video.textureFilter.generic.id = ID_TEXTUREFILTER; - m_video.textureFilter.generic.x = uis.glconfig.vidWidth / 2; + m_video.textureFilter.generic.x = uis.width / 2; m_video.textureFilter.generic.y = yy; m_video.textureFilter.generic.name = "texture filter"; m_video.textureFilter.itemnames = filterNames; @@ -453,7 +453,7 @@ static void VideoMenu_Init( void ) { #ifdef _WIN32 m_video.vsync.generic.type = MTYPE_SPINCONTROL; - m_video.vsync.generic.x = uis.glconfig.vidWidth / 2; + m_video.vsync.generic.x = uis.width / 2; m_video.vsync.generic.y = yy; m_video.vsync.generic.name = "vertical sync"; m_video.vsync.curvalue = cvar.VariableInteger( "gl_swapinterval" ) ? 1 : 0; @@ -463,7 +463,7 @@ static void VideoMenu_Init( void ) { m_video.saturation.generic.type = MTYPE_SLIDER; m_video.saturation.generic.id = ID_SATURATION; - m_video.saturation.generic.x = uis.glconfig.vidWidth / 2; + m_video.saturation.generic.x = uis.width / 2; m_video.saturation.generic.y = yy; m_video.saturation.generic.name = "texture saturation"; m_video.saturation.minvalue = 0; @@ -475,7 +475,7 @@ static void VideoMenu_Init( void ) { m_video.lightmaps.generic.type = MTYPE_SLIDER; m_video.lightmaps.generic.id = ID_LIGHTMAPS; - m_video.lightmaps.generic.x = uis.glconfig.vidWidth / 2; + m_video.lightmaps.generic.x = uis.width / 2; m_video.lightmaps.generic.y = yy; m_video.lightmaps.generic.name = "lightmap saturation"; m_video.lightmaps.minvalue = 0; @@ -486,7 +486,7 @@ static void VideoMenu_Init( void ) { yy += MENU_SPACING; m_video.anisotropy.generic.type = MTYPE_SLIDER; - m_video.anisotropy.generic.x = uis.glconfig.vidWidth / 2; + m_video.anisotropy.generic.x = uis.width / 2; m_video.anisotropy.generic.y = yy; m_video.anisotropy.generic.name = "anisotropic filter"; m_video.anisotropy.minvalue = 0; @@ -498,7 +498,7 @@ static void VideoMenu_Init( void ) { m_video.overrideTextures.generic.type = MTYPE_SPINCONTROL; m_video.overrideTextures.generic.id = ID_OVERRIDE; - m_video.overrideTextures.generic.x = uis.glconfig.vidWidth / 2; + m_video.overrideTextures.generic.x = uis.width / 2; m_video.overrideTextures.generic.y = yy; m_video.overrideTextures.generic.name = "override textures"; m_video.overrideTextures.curvalue = cvar.VariableInteger( "r_override_textures" ) ? 1 : 0; @@ -507,7 +507,7 @@ static void VideoMenu_Init( void ) { m_video.overrideModels.generic.type = MTYPE_SPINCONTROL; m_video.overrideModels.generic.id = ID_OVERRIDE; - m_video.overrideModels.generic.x = uis.glconfig.vidWidth / 2; + m_video.overrideModels.generic.x = uis.width / 2; m_video.overrideModels.generic.y = yy; m_video.overrideModels.generic.name = "override models"; m_video.overrideModels.curvalue = cvar.VariableInteger( "r_override_models" ) ? 1 : 0; @@ -515,7 +515,7 @@ static void VideoMenu_Init( void ) { yy += MENU_SPACING; m_video.dlight.generic.type = MTYPE_SPINCONTROL; - m_video.dlight.generic.x = uis.glconfig.vidWidth / 2; + m_video.dlight.generic.x = uis.width / 2; m_video.dlight.generic.y = yy; m_video.dlight.generic.name = "dynamic lighting"; i = cvar.VariableInteger( "gl_dynamic" ); @@ -528,7 +528,7 @@ static void VideoMenu_Init( void ) { yy = y + MENU_SPACING * 2; m_video.stipple.generic.type = MTYPE_SPINCONTROL; - m_video.stipple.generic.x = uis.glconfig.vidWidth / 2; + m_video.stipple.generic.x = uis.width / 2; m_video.stipple.generic.y = yy; m_video.stipple.generic.name = "stipple alpha"; m_video.stipple.curvalue = cvar.VariableInteger( "sw_stipplealpha" ) ? 1 : 0; @@ -536,7 +536,7 @@ static void VideoMenu_Init( void ) { yy += MENU_SPACING; m_video.sird.generic.type = MTYPE_SPINCONTROL; - m_video.sird.generic.x = uis.glconfig.vidWidth / 2; + m_video.sird.generic.x = uis.width / 2; m_video.sird.generic.y = yy; m_video.sird.generic.name = "draw SIRDs"; i = cvar.VariableInteger( "sw_drawsird" ); @@ -550,7 +550,7 @@ static void VideoMenu_Init( void ) { m_video.defaults.generic.id = ID_DEFAULTS; m_video.defaults.generic.uiFlags = UI_CENTER; m_video.defaults.generic.name = "undo changes (u)"; - m_video.defaults.generic.x = uis.glconfig.vidWidth / 2; + m_video.defaults.generic.x = uis.width / 2; m_video.defaults.generic.y = yyy; yyy += MENU_SPACING; @@ -558,7 +558,7 @@ static void VideoMenu_Init( void ) { m_video.apply.generic.id = ID_APPLY; m_video.apply.generic.uiFlags = UI_CENTER; m_video.apply.generic.name = "apply changes (a)"; - m_video.apply.generic.x = uis.glconfig.vidWidth / 2; + m_video.apply.generic.x = uis.width / 2; m_video.apply.generic.y = yyy; yyy += MENU_SPACING; |