mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-02-19 10:31:09 +00:00
Add shadow detail setting
This commit is contained in:
parent
c10f4b03fb
commit
8ab1439347
4 changed files with 95 additions and 14 deletions
Binary file not shown.
|
@ -251,8 +251,10 @@ GRAPHICS OPTIONS MENU
|
||||||
#define ID_REFRESHRATE 111
|
#define ID_REFRESHRATE 111
|
||||||
#define ID_DYNAMICLIGHTS 112
|
#define ID_DYNAMICLIGHTS 112
|
||||||
#define ID_SYNCEVERYFRAME 113
|
#define ID_SYNCEVERYFRAME 113
|
||||||
|
#define ID_SHADOWS 114
|
||||||
|
|
||||||
#define NUM_REFRESHRATE 4
|
#define NUM_REFRESHRATE 4
|
||||||
|
#define NUM_SHADOWS 2
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
menuframework_s menu;
|
menuframework_s menu;
|
||||||
|
@ -282,6 +284,7 @@ typedef struct {
|
||||||
menulist_s refreshrate;
|
menulist_s refreshrate;
|
||||||
menuradiobutton_s dynamiclights;
|
menuradiobutton_s dynamiclights;
|
||||||
menuradiobutton_s synceveryframe;
|
menuradiobutton_s synceveryframe;
|
||||||
|
menulist_s shadows;
|
||||||
|
|
||||||
menubitmap_s apply;
|
menubitmap_s apply;
|
||||||
menubitmap_s back;
|
menubitmap_s back;
|
||||||
|
@ -302,6 +305,7 @@ typedef struct
|
||||||
int refreshrate;
|
int refreshrate;
|
||||||
qboolean dynamiclights;
|
qboolean dynamiclights;
|
||||||
qboolean synceveryframe;
|
qboolean synceveryframe;
|
||||||
|
int shadows;
|
||||||
} InitialVideoOptions_s;
|
} InitialVideoOptions_s;
|
||||||
|
|
||||||
static InitialVideoOptions_s s_ivo;
|
static InitialVideoOptions_s s_ivo;
|
||||||
|
@ -493,6 +497,7 @@ static void GraphicsOptions_GetInitialVideo( void )
|
||||||
s_ivo.refreshrate = s_graphicsoptions.refreshrate.curvalue;
|
s_ivo.refreshrate = s_graphicsoptions.refreshrate.curvalue;
|
||||||
s_ivo.dynamiclights = s_graphicsoptions.dynamiclights.curvalue;
|
s_ivo.dynamiclights = s_graphicsoptions.dynamiclights.curvalue;
|
||||||
s_ivo.synceveryframe = s_graphicsoptions.synceveryframe.curvalue;
|
s_ivo.synceveryframe = s_graphicsoptions.synceveryframe.curvalue;
|
||||||
|
s_ivo.shadows = s_graphicsoptions.refreshrate.curvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -816,6 +821,20 @@ static void GraphicsOptions_Event( void* ptr, int event ) {
|
||||||
trap_Cvar_SetValue( "r_finish", s_graphicsoptions.synceveryframe.curvalue );
|
trap_Cvar_SetValue( "r_finish", s_graphicsoptions.synceveryframe.curvalue );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ID_SHADOWS: {
|
||||||
|
int shadows;
|
||||||
|
switch (s_graphicsoptions.shadows.curvalue) {
|
||||||
|
case 0:
|
||||||
|
shadows = 1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
shadows = 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
trap_Cvar_SetValue("cg_shadows", shadows);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case ID_LIST:
|
case ID_LIST:
|
||||||
ivo = &s_ivo_templates[s_graphicsoptions.list.curvalue];
|
ivo = &s_ivo_templates[s_graphicsoptions.list.curvalue];
|
||||||
|
|
||||||
|
@ -1016,6 +1035,17 @@ static void GraphicsOptions_SetMenuItems( void )
|
||||||
s_graphicsoptions.refreshrate.curvalue = 3;
|
s_graphicsoptions.refreshrate.curvalue = 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch ( (int) trap_Cvar_VariableValue( "cg_shadows" ) )
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
s_graphicsoptions.shadows.curvalue = 0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
s_graphicsoptions.shadows.curvalue = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
s_graphicsoptions.dynamiclights.curvalue = trap_Cvar_VariableValue( "r_dynamiclight" ) != 0;
|
s_graphicsoptions.dynamiclights.curvalue = trap_Cvar_VariableValue( "r_dynamiclight" ) != 0;
|
||||||
s_graphicsoptions.synceveryframe.curvalue = trap_Cvar_VariableValue( "r_finish" ) != 0;
|
s_graphicsoptions.synceveryframe.curvalue = trap_Cvar_VariableValue( "r_finish" ) != 0;
|
||||||
}
|
}
|
||||||
|
@ -1087,7 +1117,8 @@ void GraphicsOptions_MenuInit( void )
|
||||||
"On",
|
"On",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
*/ static const char *s_refreshrate[] =
|
*/
|
||||||
|
static const char *s_refreshrate[] =
|
||||||
{
|
{
|
||||||
"60",
|
"60",
|
||||||
"72 (Recommended)",
|
"72 (Recommended)",
|
||||||
|
@ -1095,6 +1126,12 @@ void GraphicsOptions_MenuInit( void )
|
||||||
"90",
|
"90",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
static const char *s_shadows[] =
|
||||||
|
{
|
||||||
|
"Low",
|
||||||
|
"High",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
int y;
|
int y;
|
||||||
|
|
||||||
|
@ -1173,7 +1210,7 @@ void GraphicsOptions_MenuInit( void )
|
||||||
s_graphicsoptions.network.style = UI_RIGHT;
|
s_graphicsoptions.network.style = UI_RIGHT;
|
||||||
s_graphicsoptions.network.color = color_red;
|
s_graphicsoptions.network.color = color_red;
|
||||||
|
|
||||||
y = 272 - 7 * (BIGCHAR_HEIGHT + 2);
|
y = 254 - 7 * (BIGCHAR_HEIGHT + 2);
|
||||||
s_graphicsoptions.list.generic.type = MTYPE_SPINCONTROL;
|
s_graphicsoptions.list.generic.type = MTYPE_SPINCONTROL;
|
||||||
s_graphicsoptions.list.generic.name = "Graphics Settings:";
|
s_graphicsoptions.list.generic.name = "Graphics Settings:";
|
||||||
s_graphicsoptions.list.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
s_graphicsoptions.list.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||||
|
@ -1282,6 +1319,18 @@ void GraphicsOptions_MenuInit( void )
|
||||||
s_graphicsoptions.dynamiclights.generic.id = ID_DYNAMICLIGHTS;
|
s_graphicsoptions.dynamiclights.generic.id = ID_DYNAMICLIGHTS;
|
||||||
y += BIGCHAR_HEIGHT+2;
|
y += BIGCHAR_HEIGHT+2;
|
||||||
|
|
||||||
|
// references "cg_shadows"
|
||||||
|
s_graphicsoptions.shadows.generic.type = MTYPE_SPINCONTROL;
|
||||||
|
s_graphicsoptions.shadows.generic.name = "Shadow Detail:";
|
||||||
|
s_graphicsoptions.shadows.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||||
|
s_graphicsoptions.shadows.generic.x = 400;
|
||||||
|
s_graphicsoptions.shadows.generic.y = y;
|
||||||
|
s_graphicsoptions.shadows.itemnames = s_shadows;
|
||||||
|
s_graphicsoptions.shadows.generic.callback = GraphicsOptions_Event;
|
||||||
|
s_graphicsoptions.shadows.generic.id = ID_SHADOWS;
|
||||||
|
s_graphicsoptions.shadows.numitems = NUM_SHADOWS;
|
||||||
|
y += BIGCHAR_HEIGHT+2;
|
||||||
|
|
||||||
// references/modifies "r_lodBias" & "subdivisions"
|
// references/modifies "r_lodBias" & "subdivisions"
|
||||||
s_graphicsoptions.geometry.generic.type = MTYPE_SPINCONTROL;
|
s_graphicsoptions.geometry.generic.type = MTYPE_SPINCONTROL;
|
||||||
s_graphicsoptions.geometry.generic.name = "Geometric Detail:";
|
s_graphicsoptions.geometry.generic.name = "Geometric Detail:";
|
||||||
|
@ -1371,6 +1420,7 @@ void GraphicsOptions_MenuInit( void )
|
||||||
// Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.fs );
|
// Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.fs );
|
||||||
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.lighting );
|
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.lighting );
|
||||||
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.dynamiclights );
|
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.dynamiclights );
|
||||||
|
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.shadows );
|
||||||
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.geometry );
|
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.geometry );
|
||||||
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.tq );
|
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.tq );
|
||||||
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.texturebits );
|
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.texturebits );
|
||||||
|
|
|
@ -209,7 +209,6 @@ itemDef {
|
||||||
textscale .25
|
textscale .25
|
||||||
forecolor 1 1 1 1
|
forecolor 1 1 1 1
|
||||||
visible 0
|
visible 0
|
||||||
decoration
|
|
||||||
}
|
}
|
||||||
|
|
||||||
itemDef {
|
itemDef {
|
||||||
|
@ -277,6 +276,22 @@ itemDef {
|
||||||
visible 0
|
visible 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itemDef {
|
||||||
|
name graphics
|
||||||
|
group grpSystem
|
||||||
|
type ITEM_TYPE_MULTI
|
||||||
|
text "Shadow Detail:"
|
||||||
|
cvar "cg_shadows"
|
||||||
|
cvarFloatList { "Low" 1 "High" 3 }
|
||||||
|
rect 0 170 306 20
|
||||||
|
textalign ITEM_ALIGN_RIGHT
|
||||||
|
textalignx 133
|
||||||
|
textaligny 17
|
||||||
|
textscale .25
|
||||||
|
forecolor 1 1 1 1
|
||||||
|
visible 0
|
||||||
|
}
|
||||||
|
|
||||||
itemDef {
|
itemDef {
|
||||||
name graphics
|
name graphics
|
||||||
group grpSystem
|
group grpSystem
|
||||||
|
@ -284,7 +299,7 @@ itemDef {
|
||||||
text "Geometric Detail:"
|
text "Geometric Detail:"
|
||||||
cvar "r_lodbias"
|
cvar "r_lodbias"
|
||||||
cvarFloatList { "High" 0 "Medium" 1 "Low" 2 }
|
cvarFloatList { "High" 0 "Medium" 1 "Low" 2 }
|
||||||
rect 0 170 256 20
|
rect 0 190 256 20
|
||||||
textalign ITEM_ALIGN_RIGHT
|
textalign ITEM_ALIGN_RIGHT
|
||||||
textalignx 133
|
textalignx 133
|
||||||
textaligny 17
|
textaligny 17
|
||||||
|
@ -301,7 +316,7 @@ itemDef {
|
||||||
text "Texture Detail:"
|
text "Texture Detail:"
|
||||||
cvar "r_picmip"
|
cvar "r_picmip"
|
||||||
cvarFloatList { "Low" 2 "Normal" 1 "High" 0 }
|
cvarFloatList { "Low" 2 "Normal" 1 "High" 0 }
|
||||||
rect 0 190 256 20
|
rect 0 210 256 20
|
||||||
textalign ITEM_ALIGN_RIGHT
|
textalign ITEM_ALIGN_RIGHT
|
||||||
textalignx 133
|
textalignx 133
|
||||||
textaligny 17
|
textaligny 17
|
||||||
|
@ -318,7 +333,7 @@ itemDef {
|
||||||
text "Texture Quality:"
|
text "Texture Quality:"
|
||||||
cvar "r_texturebits"
|
cvar "r_texturebits"
|
||||||
cvarFloatList { "Default" 0 "16 bit" 16 "32 bit" 32 }
|
cvarFloatList { "Default" 0 "16 bit" 16 "32 bit" 32 }
|
||||||
rect 0 210 256 20
|
rect 0 230 256 20
|
||||||
textalign ITEM_ALIGN_RIGHT
|
textalign ITEM_ALIGN_RIGHT
|
||||||
textalignx 133
|
textalignx 133
|
||||||
textaligny 17
|
textaligny 17
|
||||||
|
@ -334,7 +349,7 @@ itemDef {
|
||||||
text "Texture Filter:"
|
text "Texture Filter:"
|
||||||
cvar "r_texturemode"
|
cvar "r_texturemode"
|
||||||
cvarStrList { "Bilinear", "GL_LINEAR_MIPMAP_NEAREST", "Trilinear", "GL_LINEAR_MIPMAP_LINEAR" }
|
cvarStrList { "Bilinear", "GL_LINEAR_MIPMAP_NEAREST", "Trilinear", "GL_LINEAR_MIPMAP_LINEAR" }
|
||||||
rect 0 230 256 20
|
rect 0 250 256 20
|
||||||
textalign ITEM_ALIGN_RIGHT
|
textalign ITEM_ALIGN_RIGHT
|
||||||
textalignx 133
|
textalignx 133
|
||||||
textaligny 17
|
textaligny 17
|
||||||
|
@ -350,7 +365,7 @@ itemDef {
|
||||||
type ITEM_TYPE_YESNO
|
type ITEM_TYPE_YESNO
|
||||||
text "Compress Textures:"
|
text "Compress Textures:"
|
||||||
cvar "r_ext_compressed_textures"
|
cvar "r_ext_compressed_textures"
|
||||||
rect 0 250 256 20
|
rect 0 270 256 20
|
||||||
textalign ITEM_ALIGN_RIGHT
|
textalign ITEM_ALIGN_RIGHT
|
||||||
textalignx 133
|
textalignx 133
|
||||||
textaligny 17
|
textaligny 17
|
||||||
|
|
|
@ -179,6 +179,22 @@ itemDef {
|
||||||
visible 1
|
visible 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itemDef {
|
||||||
|
name graphics
|
||||||
|
group grpSystem
|
||||||
|
type ITEM_TYPE_MULTI
|
||||||
|
text "Shadow Detail:"
|
||||||
|
cvar "cg_shadows"
|
||||||
|
cvarFloatList { "Low" 1 "High" 3 }
|
||||||
|
rect 99 192 256 20
|
||||||
|
textalign ITEM_ALIGN_RIGHT
|
||||||
|
textalignx 128
|
||||||
|
textaligny 20
|
||||||
|
textscale .333
|
||||||
|
forecolor 1 1 1 1
|
||||||
|
visible 0
|
||||||
|
}
|
||||||
|
|
||||||
itemDef {
|
itemDef {
|
||||||
name graphics
|
name graphics
|
||||||
group grpSystem
|
group grpSystem
|
||||||
|
@ -186,7 +202,7 @@ itemDef {
|
||||||
text "Geometric Detail:"
|
text "Geometric Detail:"
|
||||||
cvar "r_lodbias"
|
cvar "r_lodbias"
|
||||||
cvarFloatList { "High" 0 "Medium" 1 "Low" 2 }
|
cvarFloatList { "High" 0 "Medium" 1 "Low" 2 }
|
||||||
rect 99 192 256 20
|
rect 99 217 256 20
|
||||||
textalign ITEM_ALIGN_RIGHT
|
textalign ITEM_ALIGN_RIGHT
|
||||||
textalignx 128
|
textalignx 128
|
||||||
textaligny 20
|
textaligny 20
|
||||||
|
@ -203,7 +219,7 @@ itemDef {
|
||||||
text "Texture Detail:"
|
text "Texture Detail:"
|
||||||
cvar "r_picmip"
|
cvar "r_picmip"
|
||||||
cvarFloatList { "Low" 2 "Normal" 1 "High" 0 }
|
cvarFloatList { "Low" 2 "Normal" 1 "High" 0 }
|
||||||
rect 99 217 256 20
|
rect 99 242 256 20
|
||||||
textalign ITEM_ALIGN_RIGHT
|
textalign ITEM_ALIGN_RIGHT
|
||||||
textalignx 128
|
textalignx 128
|
||||||
textaligny 20
|
textaligny 20
|
||||||
|
@ -220,7 +236,7 @@ itemDef {
|
||||||
text "Texture Quality:"
|
text "Texture Quality:"
|
||||||
cvar "r_texturebits"
|
cvar "r_texturebits"
|
||||||
cvarFloatList { "Default" 0 "16 bit" 16 "32 bit" 32 }
|
cvarFloatList { "Default" 0 "16 bit" 16 "32 bit" 32 }
|
||||||
rect 99 244 256 20
|
rect 99 267 256 20
|
||||||
textalign ITEM_ALIGN_RIGHT
|
textalign ITEM_ALIGN_RIGHT
|
||||||
textalignx 128
|
textalignx 128
|
||||||
textaligny 20
|
textaligny 20
|
||||||
|
@ -236,7 +252,7 @@ itemDef {
|
||||||
text "Texture Filter:"
|
text "Texture Filter:"
|
||||||
cvar "r_texturemode"
|
cvar "r_texturemode"
|
||||||
cvarStrList { "Bilinear", "GL_LINEAR_MIPMAP_NEAREST", "Trilinear", "GL_LINEAR_MIPMAP_LINEAR" }
|
cvarStrList { "Bilinear", "GL_LINEAR_MIPMAP_NEAREST", "Trilinear", "GL_LINEAR_MIPMAP_LINEAR" }
|
||||||
rect 99 269 256 20
|
rect 99 292 256 20
|
||||||
textalign ITEM_ALIGN_RIGHT
|
textalign ITEM_ALIGN_RIGHT
|
||||||
textalignx 128
|
textalignx 128
|
||||||
textaligny 20
|
textaligny 20
|
||||||
|
@ -251,7 +267,7 @@ itemDef {
|
||||||
type ITEM_TYPE_YESNO
|
type ITEM_TYPE_YESNO
|
||||||
text "Compress Textures:"
|
text "Compress Textures:"
|
||||||
cvar "r_ext_compressed_textures"
|
cvar "r_ext_compressed_textures"
|
||||||
rect 99 294 256 20
|
rect 99 317 256 20
|
||||||
textalign ITEM_ALIGN_RIGHT
|
textalign ITEM_ALIGN_RIGHT
|
||||||
textalignx 128
|
textalignx 128
|
||||||
textaligny 20
|
textaligny 20
|
||||||
|
|
Loading…
Reference in a new issue