Skip to content

Commit a3b2994

Browse files
ernieRippeR37
authored andcommitted
Properly save/load graphics settings
This is a bug that carried over from the ioq3quest code, where the r_lodbias settings being compared to set the geometric detail options were mismatched with what is set, so the "high" setting would display as "low" on next load.
1 parent df064b6 commit a3b2994

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

assets/pakQ3VR/ui/ingame_system.menu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ itemDef {
296296
type ITEM_TYPE_MULTI
297297
text "Geometric Detail:"
298298
cvar "r_lodbias"
299-
cvarFloatList { "High" -1 "Medium" 1 "Low" 2 }
299+
cvarFloatList { "High" -2 "Medium" -1 "Low" 0 }
300300
rect 0 190 256 20
301301
textalign ITEM_ALIGN_RIGHT
302302
textalignx 133

assets/pakQ3VR/ui/system.menu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ itemDef {
199199
type ITEM_TYPE_MULTI
200200
text "Geometric Detail:"
201201
cvar "r_lodbias"
202-
cvarFloatList { "High" -1 "Medium" 1 "Low" 2 }
202+
cvarFloatList { "High" -2 "Medium" -1 "Low" 0 }
203203
rect 99 217 256 20
204204
textalign ITEM_ALIGN_RIGHT
205205
textalignx 128

code/q3_ui/ui_video.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -665,12 +665,12 @@ static void GraphicsOptions_SetMenuItems( void )
665665
}
666666

667667
int lodbias = trap_Cvar_VariableValue( "r_lodBias" );
668-
if (lodbias == -1) {
669-
s_graphicsoptions.geometry.curvalue = 2;
670-
} else if (lodbias == 1) {
671-
s_graphicsoptions.geometry.curvalue = 1;
668+
if (lodbias <= -2) {
669+
s_graphicsoptions.geometry.curvalue = 2; // High
670+
} else if (lodbias == -1) {
671+
s_graphicsoptions.geometry.curvalue = 1; // Medium
672672
} else {
673-
s_graphicsoptions.geometry.curvalue = 0;
673+
s_graphicsoptions.geometry.curvalue = 0; // Low
674674
}
675675

676676
#if 0

code/ui/ui_main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3234,14 +3234,14 @@ static void UI_Update(const char *name) {
32343234
}
32353235
} else if (Q_stricmp(name, "r_lodbias") == 0) {
32363236
switch (val) {
3237-
case 0:
3238-
trap_Cvar_SetValue( "r_subdivisions", 1 );
3237+
case -2:
3238+
trap_Cvar_SetValue( "r_subdivisions", 1 ); // High
32393239
break;
3240-
case 1:
3241-
trap_Cvar_SetValue( "r_subdivisions", 2 );
3240+
case -1:
3241+
trap_Cvar_SetValue( "r_subdivisions", 2 ); // Medium
32423242
break;
3243-
case 2:
3244-
trap_Cvar_SetValue( "r_subdivisions", 4 );
3243+
case 0:
3244+
trap_Cvar_SetValue( "r_subdivisions", 4 ); // Low
32453245
break;
32463246
}
32473247
} else if (Q_stricmp(name, "ui_glCustom") == 0) {

0 commit comments

Comments
 (0)