]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - menu.c
todo item done: GAME_FNIGGIUM minimum resolution of 640x480
[xonotic/darkplaces.git] / menu.c
diff --git a/menu.c b/menu.c
index 180166f57c9436e5bb397f364bfc75b9d38eb852..4ba5a30ae042fcb56e27979c5d320ac82dac7b93 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -1361,7 +1361,7 @@ void M_Options_Key (int k, char ascii)
        }
 }
 
-#define        OPTIONS_EFFECTS_ITEMS   20
+#define        OPTIONS_EFFECTS_ITEMS   21
 
 int options_effects_cursor;
 
@@ -1432,6 +1432,8 @@ void M_Menu_Options_Effects_AdjustSliders (int dir)
                Cvar_SetValueQuick (&r_lerpmodels, !r_lerpmodels.integer);
        else if (options_effects_cursor == optnum++)
                Cvar_SetValueQuick (&r_lerpsprites, !r_lerpsprites.integer);
+       else if (options_effects_cursor == optnum++)
+               Cvar_SetValueQuick (&r_wateralpha, bound(0, r_wateralpha.value + dir * 0.1, 1));
        else if (options_effects_cursor == optnum++)
                Cvar_SetValueQuick (&r_waterscroll, bound(0, r_waterscroll.value + dir * 0.5, 10));
        else if (options_effects_cursor == optnum++)
@@ -1472,6 +1474,7 @@ void M_Options_Effects_Draw (void)
        M_Options_PrintSlider(  "         Blood Opacity", true, cl_particles_blood_alpha.value, 0.2, 1);
        M_Options_PrintCheckbox("   Model Interpolation", true, r_lerpmodels.integer);
        M_Options_PrintCheckbox("  Sprite Interpolation", true, r_lerpsprites.integer);
+       M_Options_PrintSlider(  " Water Alpha (opacity)", true, r_wateralpha.value, 0, 1);
        M_Options_PrintSlider(  "        Water Movement", true, r_waterscroll.value, 0, 10);
        M_Options_PrintSlider(  " GeForce3 Water Shader", true, r_watershader.value, 0, 10);
 }
@@ -2147,6 +2150,8 @@ int video_cursor_table[] = {56, 68, 80, 100};
 // note: if modes are added to the beginning of this list, update the
 // video_resolution = x; in M_Menu_Video_f below
 unsigned short video_resolutions[][2] = {{320,240}, {400,300}, {512,384}, {640,480}, {800,600}, {1024,768}, {1152,864}, {1280,960}, {1280,1024}, {1600,1200}, {1792,1344}, {1920,1440}, {2048,1536}, {0,0}};
+// this is the number of the 640x480 mode in the list
+#define VID_640 3
 #define VID_RES_COUNT ((int)(sizeof(video_resolutions) / sizeof(video_resolutions[0])) - 1)
 int video_resolution;
 
@@ -2170,11 +2175,11 @@ void M_Menu_Video_f (void)
                        break;
        }
 
-       // Default to 800x600 if we didn't find it
+       // Default to VID_640 if we didn't find it
        if (video_resolution == VID_RES_COUNT)
        {
                // may need to update this number if mode list changes
-               video_resolution = 4;
+               video_resolution = VID_640;
                Cvar_SetValueQuick (&vid_width, video_resolutions[video_resolution][0]);
                Cvar_SetValueQuick (&vid_height, video_resolutions[video_resolution][1]);
        }
@@ -2223,10 +2228,10 @@ void M_Menu_Video_AdjustSliders (int dir)
                case 0:
                {
                        int new_resolution = video_resolution + dir;
-                       if (new_resolution < 0)
+                       if (gamemode == GAME_FNIGGIUM ? new_resolution < VID_640 : new_resolution < 0)
                                video_resolution = VID_RES_COUNT - 1;
                        else if (new_resolution > VID_RES_COUNT)
-                               video_resolution = 0;
+                               video_resolution = gamemode == GAME_FNIGGIUM ? VID_640 : 0;
                        else
                                video_resolution = new_resolution;