Lots of changes.,..

- Extra texture mode options (no filter, bileaner (no mipmap))
- Set cinematics to be 2D or 3D
- Adjust virtual screen depth
- Anisotropy adjust in menu
- "Switch Sticks" will also switch function of A/B/X/Y so jumping etc is possible with switched sticks
This commit is contained in:
Simon 2020-08-23 17:58:43 +01:00
parent f21e7d8598
commit 5851fd457d
14 changed files with 1435 additions and 28 deletions

View file

@ -1332,6 +1332,9 @@ void RTCWVR_Init()
vr_control_scheme = Cvar_Get( "vr_control_scheme", "0", CVAR_ARCHIVE);
vr_switch_sticks = Cvar_Get( "vr_switch_sticks", "0", CVAR_ARCHIVE);
vr_cinematic_stereo = Cvar_Get( "vr_cinematic_stereo", "1", CVAR_ARCHIVE);
vr_screen_dist = Cvar_Get( "vr_screen_dist", "3.5", CVAR_ARCHIVE);
//Set up vr client info
vr.backpackitemactive = 0;
vr.visible_hud = qtrue;
@ -1471,6 +1474,7 @@ void * AppThreadFunction(void * parm ) {
prctl(PR_SET_NAME, (long) "OVR::Main", 0, 0, 0);
rtcw_initialised = false;
vr_screen_dist = NULL;
const ovrInitParms initParms = vrapi_DefaultInitParms(&java);
int32_t initResult = vrapi_Initialize(&initParms);

View file

@ -131,6 +131,8 @@ static ovrMatrix4f CylinderModelMatrix( const int texWidth, const int texHeight,
return m2;
}
extern cvar_t *vr_screen_dist;
ovrLayerCylinder2 BuildCylinderLayer( ovrRenderer * cylinderRenderer,
const int textureWidth, const int textureHeight,
const ovrTracking2 * tracking, float rotatePitch )
@ -152,7 +154,9 @@ ovrLayerCylinder2 BuildCylinderLayer( ovrRenderer * cylinderRenderer,
const float density = 4500.0f;
const float rotateYaw = 0.0f;
const float radius = 4.0f;
const ovrVector3f translation = { 0.0f, playerHeight/2, -3.5f };
const float distance = vr_screen_dist ? -vr_screen_dist->value : -3.5f;
const ovrVector3f translation = { 0.0f, playerHeight/2, distance };
ovrMatrix4f cylinderTransform =
CylinderModelMatrix( textureWidth, textureHeight, translation,

View file

@ -9,3 +9,6 @@ cvar_t *vr_lasersight;
cvar_t *vr_control_scheme;
cvar_t *vr_teleport;
cvar_t *vr_switch_sticks;
cvar_t *vr_cinematic_stereo;
cvar_t *vr_screen_dist;

View file

@ -17,7 +17,9 @@ Authors : Simon Brown
#include "VrInput.h"
#include "VrCvars.h"
#include "../rtcw/src/client/client.h"
#include <src/qcommon/qcommon.h>
#include <src/client/client.h>
#include "../../../../../../VrApi/Include/VrApi_Input.h"
#define WP_AKIMBO 20
@ -52,17 +54,45 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
pOff = pDominantTracking;
}
//All this to allow stick and button switching!
ovrVector2f *pPrimaryJoystick;
ovrVector2f *pSecondaryJoystick;
uint32_t primaryButtonsNew;
uint32_t primaryButtonsOld;
uint32_t secondaryButtonsNew;
uint32_t secondaryButtonsOld;
int primaryButton1;
int primaryButton2;
int secondaryButton1;
int secondaryButton2;
if (vr_switch_sticks->integer)
{
//
// This will switch the joystick and A/B/X/Y button functions only
// Move, Strafe, Turn, Jump, Crouch, Notepad, HUD mode, Weapon Switch
pSecondaryJoystick = &pDominantTrackedRemoteNew->Joystick;
pPrimaryJoystick = &pOffTrackedRemoteNew->Joystick;
secondaryButtonsNew = pDominantTrackedRemoteNew->Buttons;
secondaryButtonsOld = pDominantTrackedRemoteOld->Buttons;
primaryButtonsNew = pOffTrackedRemoteNew->Buttons;
primaryButtonsOld = pOffTrackedRemoteOld->Buttons;
primaryButton1 = offButton1;
primaryButton2 = offButton2;
secondaryButton1 = domButton1;
secondaryButton2 = domButton2;
}
else
{
pPrimaryJoystick = &pDominantTrackedRemoteNew->Joystick;
pSecondaryJoystick = &pOffTrackedRemoteNew->Joystick;
primaryButtonsNew = pDominantTrackedRemoteNew->Buttons;
primaryButtonsOld = pDominantTrackedRemoteOld->Buttons;
secondaryButtonsNew = pOffTrackedRemoteNew->Buttons;
secondaryButtonsOld = pOffTrackedRemoteOld->Buttons;
primaryButton1 = domButton1;
primaryButton2 = domButton2;
secondaryButton1 = offButton1;
secondaryButton2 = offButton2;
}
@ -378,8 +408,11 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
//Jump (B Button)
if (vr.backpackitemactive != 2 && !canUseBackpack) {
handleTrackedControllerButton(pDominantTrackedRemoteNew,
pDominantTrackedRemoteOld, domButton2, K_SPACE);
if ((primaryButtonsNew & primaryButton2) != (primaryButtonsOld & primaryButton2))
{
Sys_QueEvent( 0, SE_KEY, K_SPACE, (primaryButtonsNew & primaryButton2) != 0, 0, NULL );
}
}
@ -445,18 +478,16 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
}
//Duck with A
//Duck
if (vr.backpackitemactive != 2 &&
!canUseBackpack &&
(pDominantTrackedRemoteNew->Buttons & domButton1) !=
(pDominantTrackedRemoteOld->Buttons & domButton1) &&
ducked != DUCK_CROUCHED) {
ducked = (pDominantTrackedRemoteNew->Buttons & domButton1) ? DUCK_BUTTON
: DUCK_NOTDUCKED;
sendButtonAction("+movedown", (pDominantTrackedRemoteNew->Buttons & domButton1));
(primaryButtonsNew & primaryButton1) !=
(primaryButtonsOld & primaryButton1)) {
sendButtonAction("+movedown", (primaryButtonsNew & primaryButton1));
}
//Weapon/Inventory Chooser
//Weapon Chooser
static qboolean itemSwitched = false;
if (between(-0.2f, pPrimaryJoystick->x, 0.2f) &&
(between(0.8f, pPrimaryJoystick->y, 1.0f) ||
@ -478,7 +509,6 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
}
//Left-hand specific stuff
{
//"Use" (open doors etc)
if ((pDominantTrackedRemoteNew->Buttons & ovrButton_Joystick) !=
@ -516,14 +546,11 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
if (!canUseQuickSave) {
if (((pOffTrackedRemoteNew->Buttons & offButton1) !=
(pOffTrackedRemoteOld->Buttons & offButton1)) &&
(pOffTrackedRemoteNew->Buttons & offButton1)) {
if (((secondaryButtonsNew & secondaryButton1) !=
(secondaryButtonsOld & secondaryButton1)) &&
(secondaryButtonsNew & secondaryButton1)) {
if (dominantGripPushed) {
//If cheats enabled, give all weapons/pickups to player
//Cbuf_AddText("give all\n");
Cbuf_AddText("+useitem\n");
stopUseItemNextFrame = qtrue;
} else {
@ -534,9 +561,9 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
//notebook or select "item"
if (!canUseQuickSave) {
if (((pOffTrackedRemoteNew->Buttons & offButton2) !=
(pOffTrackedRemoteOld->Buttons & offButton2)) &&
(pOffTrackedRemoteNew->Buttons & offButton2)) {
if (((secondaryButtonsNew & secondaryButton2) !=
(secondaryButtonsOld & secondaryButton2)) &&
(secondaryButtonsNew & secondaryButton2)) {
if (dominantGripPushed) {
sendButtonActionSimple("itemprev");

View file

@ -3633,6 +3633,7 @@ void CG_Teleport() {
}
}
/*
=====================
CG_DrawActive
@ -3680,7 +3681,9 @@ void CG_DrawActive( int stereoView ) {
// offset vieworg appropriately if we're doing stereo separation
VectorCopy( cg.refdef.vieworg, baseOrg );
if ( !cgVR->scopeengaged ) {
int vr_cinematic_stereo = trap_Cvar_VariableIntegerValue( "vr_cinematic_stereo");
if ( !cgVR->scopeengaged &&
(!cg.cameraMode || (cg.cameraMode && vr_cinematic_stereo))) {
VectorMA( cg.refdef.vieworg, -separation, cg.refdef.viewaxis[1], cg.refdef.vieworg );
}

View file

@ -186,16 +186,19 @@ void GL_TextureMode( const char *string ) {
gl_filter_min = modes[i].minimize;
gl_filter_max = modes[i].maximize;
int aniso = r_ext_texture_filter_anisotropic->integer;
// change all the existing mipmap texture objects
for ( i = 0 ; i < tr.numImages ; i++ ) {
glt = tr.images[ i ];
if ( glt->mipmap ) {
GL_Bind( glt );
qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, aniso);
qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min );
qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max );
}
}
}
/*

View file

@ -4403,7 +4403,7 @@ static void UI_Update( const char *name ) {
trap_Cvar_SetValue( "r_inGameVideo", 1 );
trap_Cvar_SetValue( "cg_shadows", 1 );
trap_Cvar_SetValue( "cg_brassTime", 2500 );
trap_Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_LINEAR" );
trap_Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR" );
break;
case 1: // normal
trap_Cvar_SetValue( "r_fullScreen", 1 );
@ -4419,7 +4419,7 @@ static void UI_Update( const char *name ) {
trap_Cvar_SetValue( "r_fastSky", 0 );
trap_Cvar_SetValue( "r_inGameVideo", 1 );
trap_Cvar_SetValue( "cg_brassTime", 2500 );
trap_Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_LINEAR" );
trap_Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR" );
trap_Cvar_SetValue( "cg_shadows", 0 );
break;
case 2: // fast
@ -4437,7 +4437,7 @@ static void UI_Update( const char *name ) {
trap_Cvar_SetValue( "r_fastSky", 1 );
trap_Cvar_SetValue( "r_inGameVideo", 0 );
trap_Cvar_SetValue( "cg_brassTime", 0 );
trap_Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_LINEAR" );
trap_Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR" );
break;
case 3: // fastest
trap_Cvar_SetValue( "r_fullScreen", 1 );
@ -4454,7 +4454,7 @@ static void UI_Update( const char *name ) {
trap_Cvar_SetValue( "cg_brassTime", 0 );
trap_Cvar_SetValue( "r_fastSky", 1 );
trap_Cvar_SetValue( "r_inGameVideo", 0 );
trap_Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_NEAREST" );
trap_Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST" );
break;
case 999: // 999 is reserved for having set default values ("recommended")

View file

@ -1645,7 +1645,7 @@ void GLimp_Init( void ) {
}
// Savage3D and Savage4 should always have trilinear enabled
else if ( Q_stristr( buf, "savage3d" ) || Q_stristr( buf, "s3 savage4" ) ) {
ri.Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_LINEAR" );
ri.Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR" );
}
}
}

View file

@ -273,6 +273,42 @@ itemDef
forecolor 1 1 1 1
visible 1
}
itemDef {
name vr
group grpControls
type ITEM_TYPE_SLIDER
text "Screen Distance:"
cvarfloat "vr_screen_dist" 2.0 0.5 8.0
rect 82 165 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 1
}
itemDef {
name vr
group grpControls
text "Cinematic:"
type ITEM_TYPE_MULTI
cvar "vr_cinematic_stereo"
cvarFloatList {"2D" 0 "3D" 1 }
rect 82 180 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 1
}
// TOOLS MESSAGE //

View file

@ -246,6 +246,42 @@ itemDef
forecolor 1 1 1 1
visible 1
}
itemDef {
name ingame_vr
group grpControls
type ITEM_TYPE_SLIDER
text "Screen Distance:"
cvarfloat "vr_screen_dist" 2.0 0.5 8.0
rect 82 165 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 1
}
itemDef {
name ingame_vr
group grpControls
text "Cinematic:"
type ITEM_TYPE_MULTI
cvar "vr_cinematic_stereo"
cvarFloatList {"2D" 0 "3D" 1 }
rect 82 180 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 1
}

View file

@ -0,0 +1,597 @@
#include "ui/menudef.h"
{
\\ SYSTEM MENU \\
menuDef {
name "ingame_system"
visible 0
fullscreen 0
outOfBoundsClick // this closes the window if it gets a click out of the rectangle
rect 100 125 443 340
focusColor 1 .75 0 1
style 1
border 1
onopen { hide grpsystem ; hide grpapplysystem ; show graphics ; show graphicsapply }
itemDef {
name window
group ingamebox
// rect 0 46 300 340
rect 0 2 443 300
style WINDOW_STYLE_FILLED
border 1
bordercolor .5 .5 .5 .5
forecolor 1 1 1 1
backcolor 0 0 0 .25
visible 1
decoration
}
itemDef
{
name window
group ingamebox2
rect 2 4 439 20
style WINDOW_STYLE_FILLED
border 1
bordercolor .1 .1 .1 .2
forecolor 1 1 1 1
backcolor .3 0.5 0.2 .25
visible 1
decoration
}
itemDef {
name ctr_graphics
text "Graphics"
type 1
textscale .23
group grpControlbutton
background "ui/assets/button_back.tga"
rect 56 10 100 12
textalign 1
textalignx 50
textaligny 10
forecolor 1 1 1 1
visible 1
action { hide grpSystem ; show graphics ; show graphicsapply }
mouseEnter { setitemcolor ctr_graphics backcolor .1 .37 .1 1 }
mouseExit { setitemcolor ctr_graphics backcolor .37 .1 .1 1 }
}
itemDef {
name graphics
text "Set Recommended"
type 1
textscale .25
group grpsystem
style WINDOW_STYLE_FILLED
textalign ITEM_ALIGN_CENTER
rect 82 30 290 12
textalign 1
textalignx 145
textaligny 12
forecolor 1 1 1 1
backcolor 1 1 1 .07
visible 1
action { play "sound/misc/kcaction.wav" ;
open in_rec_restart_popmenu ; hide graphics ; hide graphicsapply}
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Quality:"
cvar "ui_glCustom"
cvarFloatList { "High Quality" 0 "Normal" 1 "Fast" 2 "Fastest" 3 "Custom" 4 }
cvarTest "ui_glCustom"
hideCvar { "999" } // 999 is 'recommended'
rect 82 55 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action {
uiScript update "ui_glCustom" }
}
itemDef {
name graphics
group grpSystem
text "Quality: Recommended"
type ITEM_TYPE_BUTTON
cvarTest "ui_glCustom"
showCvar { "999" } // 999 is 'recommended'
rect 82 55 290 12
textalign ITEM_ALIGN_CENTER
textalignx 162
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action {
setcvar ui_glCustom 0; // 'recommended'
uiScript update "ui_glCustom" }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_YESNO
text "GL Extensions:"
cvar "r_allowExtensions"
rect 82 70 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Anisotropic Filter Level:"
cvar "r_ext_texture_filter_anisotropic"
cvarFloatList { "1" 1 "2" 2 "4" 4 "8" 8 "16" 16 }
rect 82 85 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Color Depth:"
cvar "r_colorbits"
cvarFloatList { "Default" 0 "16 bit" 16 "32 bit" 32 }
rect 82 100 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom ; uiScript update "r_colorbits" }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Lighting:"
cvar "r_vertexlight"
cvarFloatList { "Light Map (high)" 0 "Vertex (low)" 1 }
rect 82 130 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Geometric Detail:"
cvar "r_lodbias"
cvarFloatList { "High" 0 "Medium" 1 "Low" 2 }
rect 82 145 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom ; uiScript update "r_lodbias" }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "General Textures:"
cvar "r_picmip"
cvarFloatList { "Low" 2 "Normal" 1 "High" 0 }
rect 82 160 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Character Textures:"
cvar "r_picmip2"
cvarFloatList { "Low" 3 "Normal" 2 "High" 1 "Extra" 0 }
rect 82 175 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Texture Filter:"
cvar "r_textureMode"
cvarStrList { "No filter", "GL_NEAREST", "Bilinear (no mipmap)", "GL_LINEAR", "Bilinear", "GL_LINEAR_MIPMAP_NEAREST", "Trilinear", "GL_LINEAR_MIPMAP_LINEAR" }
rect 82 190 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_YESNO
text "Compress Textures:"
cvar "r_ext_compressed_textures"
rect 82 205 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Texture Quality:"
cvar "r_texturebits"
cvarFloatList { "Default" 0 "16 bit" 16 "32 bit" 32 }
rect 82 220 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
cvarTest "r_ignorehwgamma"
showcvar { "1" }
name graphics
group grpSystem
type ITEM_TYPE_SLIDER
text "Brightness:"
cvarfloat "r_gamma" 1.3 .5 3
rect 82 235 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
//
// Nvidia
//
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_YESNO
text "Nvidia Distance Fog:"
cvar "r_ext_NV_fog_dist"
// would be nice to be able to do an extension check from the menu
// extensionTest "GL_NV_fog_distance"
rect 82 250 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
//
// ATI
//
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_YESNO
text "Trueform:"
cvar "r_ext_ATI_pntriangles"
// would be nice to be able to do an extension check from the menu
// extensionTest "GL_ATIX_pn_triangles"
rect 82 265 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
//cvar_t *r_ext_ATI_pntriangles;
//cvar_t *r_ati_truform_tess;
//cvar_t *r_ati_truform_mode;
itemDef {
name graphicsapply
text "Apply"
type 1
textscale .25
style WINDOW_STYLE_FILLED
group grpsystem
rect 181 280 100 20
textalign 1
textalignx 50
textaligny 15
forecolor 1 1 1 1
backcolor .1 .1 .1 .1
visible 1
border 1
bordercolor .5 .5 .5 .5
action { play "sound/misc/kcaction.wav" ;
open in_vid_restart_popmenu ; hide graphics ; hide graphicsapply }
mouseEnter { setitemcolor graphicsapply backcolor .3 .5 .2 .25 }
mouseExit { setitemcolor graphicsapply backcolor .1 .1 .1 .1 }
}
//here
itemDef {
name ctr_driver
text "Driver Info"
type 1
textscale .23
group grpControlbutton
rect 181 10 100 12
textalign 1
textalignx 50
textaligny 10
forecolor 1 1 1 1
backcolor .1 .1 .1 0
visible 1
action { hide grpSystem ; show driver }
mouseEnter { setitemcolor ctr_driver backcolor .1 .37 .1 1 }
mouseExit { setitemcolor ctr_driver backcolor .37 .1 .1 1 }
}
itemDef {
name driver
group grpSystem
rect 6 40 420 300
ownerdraw UI_GLINFO
textscale .14
forecolor 1 1 1 1
visible 0
decoration
}
itemDef {
name ctr_sound
text "Sound"
type 1
textscale .23
group grpControlbutton
rect 306 10 100 12
textalign 1
textalignx 50
textaligny 10
forecolor 1 1 1 1
backcolor .1 .1 .1 0
visible 1
action { hide grpSystem ; show sound }
mouseEnter { setitemcolor ctr_sound backcolor .1 .37 .1 1 }
mouseExit { setitemcolor ctr_sound backcolor .37 .1 .1 1 }
}
itemDef {
name sound
group grpSystem
type ITEM_TYPE_SLIDER
text "Effects Volume:"
cvarfloat "s_volume" 0.7 0 1
rect 82 50 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
}
itemDef {
name sound
group grpSystem
type ITEM_TYPE_SLIDER
text "Music Volume:"
cvarfloat "s_musicvolume" 0.25 0 1
rect 82 80 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
}
itemDef {
name sound
group grpSystem
type ITEM_TYPE_MULTI
text "Sound Quality:"
cvar "s_khz"
cvarFloatList { "22 khz (high)" 22 "11 khz (low)" 11 }
rect 82 110 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { show applysystem }
}
// itemDef {
// name sound
// group grpSystem
// type ITEM_TYPE_YESNO
// text "Doppler Sound:"
// cvar "s_doppler"
// rect 82 140 290 12
// textalign ITEM_ALIGN_RIGHT
// textalignx 142
// textaligny 10
// textscale .23
// style WINDOW_STYLE_FILLED
// backcolor 1 1 1 .07
// forecolor 1 1 1 1
// visible 0
// }
itemDef {
name applysystem
group grpapplySystem
text "Apply"
type 1
style WINDOW_STYLE_FILLED
textscale .25
rect 181 140 100 20
textalign 1
textalignx 50
textaligny 15
forecolor 1 1 1 1
backcolor .1 .1 .1 .1
visible 1
border 1
bordercolor .5 .5 .5 .5
action { play "sound/misc/kcaction.wav" ;
open in_snd_restart_popmenu ; hide sound ; hide applysystem }
mouseEnter { setitemcolor applysystem backcolor .3 .5 .2 .25 }
mouseExit { setitemcolor applysystem backcolor .1 .1 .1 .1 }
}
}
}

View file

@ -0,0 +1,694 @@
#include "ui/menudef.h"
{
\\ SETUP MENU \\
menuDef {
name "system_menu"
visible 0
fullscreen 0
rect 100 125 443 340
focusColor 1 .75 0 1
style 1
border 1
onOpen { setitemcolor fadebox backcolor 0 0 0 1 ; fadeout fadebox ; hide grpSystem ; hide grpapplysystem ; show graphics ; show graphicsapply }
onEsc { close system_menu ; close setup_menu ; open main }
itemDef
{
name window
group grpSystembutton
rect 0 2 443 300
style WINDOW_STYLE_FILLED
border 1
bordercolor .5 .5 .5 .5
forecolor 1 1 1 1
backcolor 0 0 0 .25
visible 1
decoration
}
// System //
itemDef {
name ctr_graphics
text "Graphics"
type ITEM_TYPE_BUTTON
textscale .22
group grpSystembutton
style WINDOW_STYLE_FILLED
rect 56 10 100 12
textalign 1
textalignx 50
textaligny 10
forecolor 1 1 1 1
visible 1
action { play "sound/misc/kcaction.wav" ;
hide grpSystem ; hide grpapplysystem ; show graphics ; show graphicsapply }
mouseEnter { show message_graphics }
mouseExit { hide message_graphics }
}
itemDef
{
name ctr_graphics
group grpControlbutton
rect 2 4 439 20
style WINDOW_STYLE_FILLED
border 1
bordercolor .1 .1 .1 .2
forecolor 1 1 1 1
backcolor .3 0.5 0.2 .25
visible 1
decoration
}
itemDef {
name ctr_graphics
text "SYSTEM"
type 1
textfont UI_FONT_NORMAL
style 0
textstyle 6
rect 222.5 -12 64 14
textalign ITEM_ALIGN_CENTER
textscale .22
textalignx 2
textaligny 12
forecolor .9 .9 .9 .8
visible 1
decoration
}
itemDef {
name graphics
text "Set Recommended"
type 1
textscale .24
group grpsystem
// background "ui/assets/button_back.tga"
style WINDOW_STYLE_FILLED
rect 82 30 290 12
textalign 1
textalignx 145
textaligny 12
forecolor 1 1 1 1
backcolor 1 1 1 .07
visible 1
textalign ITEM_ALIGN_CENTER
action { play "sound/misc/kcaction.wav" ;
open rec_restart_popmenu ; hide graphics ; hide graphicsapply }
}
itemDef {
name graphics
group grpSystem
text "Quality:"
type ITEM_TYPE_MULTI
cvar "ui_glCustom"
cvarFloatList { "High Quality" 0 "Normal" 1 "Fast" 2 "Fastest" 3 "Custom" 4 }
cvarTest "ui_glCustom"
hideCvar { "999" } // 999 is 'recommended'
rect 82 55 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript update "ui_glCustom" }
}
itemDef {
name graphics
group grpSystem
text "Quality: Recommended"
type ITEM_TYPE_BUTTON
cvarTest "ui_glCustom"
showCvar { "999" } // 999 is 'recommended'
rect 82 55 290 12
textalign ITEM_ALIGN_CENTER
textalignx 162
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action {
setcvar ui_glCustom 0; // go back to regular selection group
uiScript update "ui_glCustom" }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_YESNO
text "GL Extensions:"
cvar "r_allowExtensions"
rect 82 70 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Anisotropic Filter Level:"
cvar "r_ext_texture_filter_anisotropic"
cvarFloatList { "1" 1 "2" 2 "4" 4 "8" 8 "16" 16 }
rect 82 85 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Color Depth:"
cvar "r_colorbits"
cvarFloatList { "Desktop Default" 0 "16-bit" 16 "32-bit" 32 }
rect 82 100 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom ; uiScript update "r_colorbits" }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Lighting:"
cvar "r_vertexlight"
cvarFloatList { "Light Map (high)" 0 "Vertex (low)" 1 }
rect 82 130 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Geometric Detail:"
cvar "r_lodbias"
cvarFloatList { "High" 0 "Medium" 1 "Low" 2 }
rect 82 145 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom ; uiScript update "r_lodbias" }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Character Textures:"
cvar "r_picmip2"
cvarFloatList { "Low" 3 "Normal" 2 "High" 1 "Extra" 0 }
rect 82 160 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "General Textures:"
cvar "r_picmip"
cvarFloatList { "Low" 2 "Normal" 1 "High" 0 }
rect 82 175 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Texture Filter:"
cvar "r_textureMode"
cvarStrList { "No filter", "GL_NEAREST", "Bilinear (no mipmap)", "GL_LINEAR", "Bilinear", "GL_LINEAR_MIPMAP_NEAREST", "Trilinear", "GL_LINEAR_MIPMAP_LINEAR" }
rect 82 190 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_YESNO
text "Compress Textures:"
cvar "r_ext_compressed_textures"
rect 82 205 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Texture Quality:"
cvar "r_texturebits"
cvarFloatList { "Default" 0 "16 bit" 16 "32 bit" 32 }
rect 82 220 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_SLIDER
text "Brightness:"
cvarfloat "r_gamma" 1 0.5 3
rect 82 235 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
cvarTest "r_ignorehwgamma"
showcvar { "1" }
visible 0
action { uiScript glCustom }
}
//
// Nvidia
//
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_YESNO
text "Nvidia Distance Fog:"
cvar "r_ext_NV_fog_dist"
// would be nice to be able to do an extension check from the menu
// extensionTest "GL_NV_fog_distance"
rect 82 250 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .23
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
//
// ATI
//
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_YESNO
text "Trueform:"
cvar "r_ext_ATI_pntriangles"
// would be nice to be able to do an extension check from the menu
// extensionTest "GL_ATIX_pn_triangles"
rect 82 265 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { uiScript glCustom }
}
//cvar_t *r_ext_ATI_pntriangles;
//cvar_t *r_ati_truform_tess;
//cvar_t *r_ati_truform_mode;
itemDef {
name graphicsapply
text "Apply"
type 1
textscale .25
style WINDOW_STYLE_FILLED
group grpsystem
rect 181 280 100 20
textalign 1
textalignx 50
textaligny 15
forecolor 1 1 1 1
backcolor .1 .1 .1 .1
visible 1
border 1
bordercolor .5 .5 .5 .5
action { play "sound/misc/kcaction.wav" ;
open vid_restart_popmenu ; hide graphics ; hide graphicsapply }
mouseEnter { setitemcolor graphicsapply backcolor .3 .5 .2 .25 }
mouseExit { setitemcolor graphicsapply backcolor .1 .1 .1 .1 }
}
itemDef {
name graphics
group grpSystem
style WINDOW_STYLE_SHADER
background "ui/assets/framebutton.tga"
rect 181 357 100 26
visible 1
decoration
}
itemDef {
name graphics
group grpSystem
style WINDOW_STYLE_SHADER
background "ui/assets/leftbutton.tga"
rect 169 357 13 26
visible 1
decoration
}
itemDef {
name graphics
group grpSystem
style WINDOW_STYLE_SHADER
background "ui/assets/rightbutton.tga"
rect 280 357 13 26
visible 1
decoration
}
itemDef {
name ctr_driver
text "Driver info"
type 1
// textfont UI_FONT_NORMAL
textscale .22
group grpSystembutton
style WINDOW_STYLE_FILLED
background "ui/assets/button_back.tga"
rect 180 10 100 12
textalign 1
textalignx 50
textaligny 10
forecolor .9 .9 .9 .8
backcolor .1 .1 .1 0
visible 1
action { play "sound/misc/kcaction.wav" ;
hide grpSystem ; show driver }
mouseEnter { show message_driver ; setitemcolor ctr_driver backcolor .3 .3 .3 0 }
mouseExit { hide message_driver ; setitemcolor ctr_driver backcolor .1 .1 .1 0 }
}
itemDef {
name driver
group grpSystem
rect 10 30 400 300
ownerdraw UI_GLINFO
textalign 0
textalignx 0
textaligny 23
textscale .15
forecolor 1 1 1 1
visible 0
decoration
style 1
}
itemDef {
name ctr_other
text "Sound"
type 1
// textfont UI_FONT_NORMAL
textscale .22
group grpSystembutton
style WINDOW_STYLE_FILLED
rect 306 10 100 12
textalign 1
textalignx 50
textaligny 10
forecolor .9 .9 .9 .8
backcolor .1 .1 .1 0
visible 1
action { play "sound/misc/kcaction.wav" ;
hide grpSystem ; show other }
mouseEnter { show message_other ; setitemcolor ctr_other backcolor .3 .3 .3 0 }
mouseExit { hide message_other ; setitemcolor ctr_other backcolor .1 .1 .1 0}
}
itemDef {
name other
group grpSystem
style 1
text "Sound"
rect 163 30 128 20
textalign ITEM_ALIGN_CENTER
textalignx 64
textaligny 20
textscale .22
forecolor .9 .9 .9 .9
visible 0
decoration
}
itemDef {
name other
group grpSystem
type ITEM_TYPE_SLIDER
text "Effects Volume: "
cvarfloat "s_volume" 0.7 0 1
rect 82 60 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
}
itemDef {
name other
group grpSystem
type ITEM_TYPE_SLIDER
text "Music Volume: "
cvarfloat "s_musicvolume" 0.25 0 1
rect 82 90 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
}
itemDef {
name other
group grpSystem
type ITEM_TYPE_MULTI
text "Sound Quality: "
cvar "s_khz"
cvarFloatList { "22 khz (high)" 22 "11 khz (low)" 11 }
rect 82 120 290 12
textalign ITEM_ALIGN_RIGHT
textalignx 142
textaligny 10
textscale .22
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .07
forecolor 1 1 1 1
visible 0
action { show applysystem }
}
itemDef {
name applysystem
group grpapplySystem
text "Apply"
type 1
style WINDOW_STYLE_FILLED
textscale .25
rect 181 140 100 20
textalign 1
textalignx 50
textaligny 15
forecolor 1 1 1 1
backcolor .1 .1 .1 .1
visible 1
border 1
bordercolor .5 .5 .5 .5
action { play "sound/misc/kcaction.wav" ;
open snd_restart_popmenu ; hide other ; hide applysystem }
mouseEnter { setitemcolor applysystem backcolor .3 .5 .2 .25 }
mouseExit { setitemcolor applysystem backcolor .1 .1 .1 .1 }
}
itemDef {
name fadebox
style WINDOW_STYLE_FILLED
background "ui/assets/fadebox.tga"
forecolor 0 0 0 1
backcolor 0 0 0 1
rect 0 0 640 480
visible 1
decoration
}
}
}

Binary file not shown.