HDPI Mode added... because 4K display users!
This commit is contained in:
parent
9ddf09029c
commit
1d76c69a66
3 changed files with 50 additions and 1 deletions
|
@ -114,6 +114,7 @@ Menu_Configuration_Video
|
||||||
void Menu_Configuration_Video( void ) {
|
void Menu_Configuration_Video( void ) {
|
||||||
static int iScrollRes = 0;
|
static int iScrollRes = 0;
|
||||||
static int iSelectedResolution = -1;
|
static int iSelectedResolution = -1;
|
||||||
|
static int iVideoScale = -1;
|
||||||
|
|
||||||
static void Video_Apply( void ) {
|
static void Video_Apply( void ) {
|
||||||
if ( iSelectedResolution != -1 ) {
|
if ( iSelectedResolution != -1 ) {
|
||||||
|
@ -149,6 +150,15 @@ void Menu_Configuration_Video( void ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the current scale method
|
||||||
|
if ( iVideoScale == -1 ) {
|
||||||
|
if ( cvar( "vid_conautoscale" ) == 0 ) {
|
||||||
|
iVideoScale = 1;
|
||||||
|
} else {
|
||||||
|
iVideoScale = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Object_Label( '196 148', _("VIDEO_RES"), '8 8' );
|
Object_Label( '196 148', _("VIDEO_RES"), '8 8' );
|
||||||
Object_Frame( '196 160', '164 300' );
|
Object_Frame( '196 160', '164 300' );
|
||||||
|
|
||||||
|
@ -166,9 +176,21 @@ void Menu_Configuration_Video( void ) {
|
||||||
|
|
||||||
Menu_ResetClipArea();
|
Menu_ResetClipArea();
|
||||||
|
|
||||||
|
static void Video_ScaleSwitch( void ) {
|
||||||
|
iVideoScale = 1 - iVideoScale;
|
||||||
|
if ( iVideoScale == 1 ) {
|
||||||
|
cvar_set( "vid_conautoscale", "0" );
|
||||||
|
cvar_set( "vid_conwidth", "0" );
|
||||||
|
cvar_set( "vid_conheight", "480" );
|
||||||
|
} else {
|
||||||
|
cvar_set( "vid_conautoscale", "1" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Object_CvarToggle( '400 165', "Fullscreen", "vid_fullscreen" );
|
Object_CvarToggle( '400 165', "Fullscreen", "vid_fullscreen" );
|
||||||
Object_CvarToggle( '400 185', "Triple Buffering", "vid_triplebuffer" );
|
Object_CvarToggle( '400 185', "Triple Buffering", "vid_triplebuffer" );
|
||||||
Object_CvarToggle( '400 205', "Virtual Synchronisation", "vid_vsync" );
|
Object_CvarToggle( '400 205', "Virtual Synchronisation", "vid_vsync" );
|
||||||
|
Object_FuncToggle( '400 225', "HDPI Mode", Video_ScaleSwitch, iVideoScale );
|
||||||
|
|
||||||
Object_Button( '32 148', BTN_OK, Video_Apply, fButtonAlpha[0] );
|
Object_Button( '32 148', BTN_OK, Video_Apply, fButtonAlpha[0] );
|
||||||
Object_Button( '32 180', BTN_CANCEL, Menu_Configuration_ButtonCancel, fButtonAlpha[1] );
|
Object_Button( '32 180', BTN_CANCEL, Menu_Configuration_ButtonCancel, fButtonAlpha[1] );
|
||||||
|
|
|
@ -263,7 +263,7 @@ void Object_CvarToggle( vector vPosition, string sLabel, string sCvar ) {
|
||||||
int iWidth = stringwidth( sLabel, FALSE );
|
int iWidth = stringwidth( sLabel, FALSE );
|
||||||
vPosition += vMenuOffset;
|
vPosition += vMenuOffset;
|
||||||
|
|
||||||
if ( Menu_InputCheckMouse( vPosition, [ iWidth, 8 ] ) == TRUE ) {
|
if ( Menu_InputCheckMouse( vPosition, [ iWidth + 32, 8 ] ) == TRUE ) {
|
||||||
fAlpha = 1.0f;
|
fAlpha = 1.0f;
|
||||||
if ( fMouseClick == TRUE ) {
|
if ( fMouseClick == TRUE ) {
|
||||||
if ( cvar( sCvar ) == 0 ) {
|
if ( cvar( sCvar ) == 0 ) {
|
||||||
|
@ -282,6 +282,33 @@ void Object_CvarToggle( vector vPosition, string sLabel, string sCvar ) {
|
||||||
} else {
|
} else {
|
||||||
drawstring( vPosition, sprintf( "[X] %s", sLabel ), '8 8', autocvar_menu_fgcolor, fAlpha, 0 );
|
drawstring( vPosition, sprintf( "[X] %s", sLabel ), '8 8', autocvar_menu_fgcolor, fAlpha, 0 );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=================
|
||||||
|
Object_FuncToggle
|
||||||
|
|
||||||
|
A nice way of toggling cvars.
|
||||||
|
=================
|
||||||
|
*/
|
||||||
|
void Object_FuncToggle( vector vPosition, string sLabel, void( void ) vFunc, int iValue ) {
|
||||||
|
float fAlpha = 0.8f;
|
||||||
|
int iWidth = stringwidth( sLabel, FALSE );
|
||||||
|
vPosition += vMenuOffset;
|
||||||
|
|
||||||
|
if ( Menu_InputCheckMouse( vPosition, [ iWidth + 32, 8 ] ) == TRUE ) {
|
||||||
|
fAlpha = 1.0f;
|
||||||
|
if ( fMouseClick == TRUE ) {
|
||||||
|
vFunc();
|
||||||
|
fMouseClick = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
drawfill( vPosition + '-2 -2', [ iWidth + 36, 12 ], '0 0 0', 0.8f );
|
||||||
|
|
||||||
|
if ( iValue == 0 ) {
|
||||||
|
drawstring( vPosition, sprintf( "[ ] %s", sLabel ), '8 8', autocvar_menu_fgcolor, fAlpha, 0 );
|
||||||
|
} else {
|
||||||
|
drawstring( vPosition, sprintf( "[X] %s", sLabel ), '8 8', autocvar_menu_fgcolor, fAlpha, 0 );
|
||||||
|
}
|
||||||
}
|
}
|
BIN
freecs/menu.dat
BIN
freecs/menu.dat
Binary file not shown.
Loading…
Reference in a new issue