]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/dialog_settings_video.qc
Remove v_glslgamma from menu, as it was removed from div0-stable
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_settings_video.qc
index c4981bb1ae2e57a69716ecb1724cfaf19ed19cf3..77f2602a1958091fb55dec083089de4cbf973ddc 100644 (file)
@@ -1,17 +1,13 @@
-#ifndef DIALOG_SETTINGS_VIDEO_H
-#define DIALOG_SETTINGS_VIDEO_H
-#include "tab.qc"
-CLASS(XonoticVideoSettingsTab, XonoticTab)
-       METHOD(XonoticVideoSettingsTab, fill, void(entity));
-       ATTRIB(XonoticVideoSettingsTab, intendedWidth, float, 0.9)
-       ATTRIB(XonoticVideoSettingsTab, rows, float, 15.5)
-       ATTRIB(XonoticVideoSettingsTab, columns, float, 6.2) // added extra .2 for center space
-       ATTRIB(XonoticVideoSettingsTab, name, string, "videosettings")
-ENDCLASS(XonoticVideoSettingsTab)
-entity makeXonoticVideoSettingsTab();
-#endif
+#include "dialog_settings_video.qh"
+
+#include "commandbutton.qh"
+#include "textlabel.qh"
+#include "textslider.qh"
+#include "checkbox.qh"
+#include "slider.qh"
+#include "slider_resolution.qh"
+#include "radiobutton.qh"
 
-#ifdef IMPLEMENTATION
 entity makeXonoticVideoSettingsTab()
 {
        entity me;
@@ -22,10 +18,21 @@ entity makeXonoticVideoSettingsTab()
 void XonoticVideoSettingsTab_fill(entity me)
 {
        entity e;
+       entity videoApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
+               "vid_width $_menu_vid_width;"
+               "vid_height $_menu_vid_height;"
+               "vid_pixelheight $_menu_vid_pixelheight;"
+               "vid_desktopfullscreen $_menu_vid_desktopfullscreen;"
+               "menu_cmd update_conwidths_before_vid_restart;"
+               "vid_restart;"
+               "menu_cmd sync;"
+               , COMMANDBUTTON_APPLY);
+       videoApplyButton.disableOnClick = true;
 
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Resolution:")));
                me.TD(me, 1, 2, e = makeXonoticResolutionSlider());
+                       e.applyButton = videoApplyButton;
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Font/UI size:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("menu_vid_scale"));
@@ -39,22 +46,31 @@ void XonoticVideoSettingsTab_fill(entity me)
                        e.addValue(e, ZCTX(_("SZ^Gigantic")), "0.75");
                        e.addValue(e, ZCTX(_("SZ^Colossal")), "1");
                        e.configureXonoticTextSliderValues(e);
+                       e.applyButton = videoApplyButton;
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Color depth:")));
-               me.TD(me, 1, 2, e = makeXonoticTextSlider("vid_bitsperpixel"));
+               me.TD(me, 1, 2, e = makeXonoticTextSlider_T("vid_bitsperpixel",
+                       _("How many bits per pixel (BPP) to render at, 32 is recommended")));
                        e.addValue(e, _("16bit"), "16");
                        e.addValue(e, _("32bit"), "32");
                        e.configureXonoticTextSliderValues(e);
+                       e.applyButton = videoApplyButton;
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "vid_fullscreen", _("Full screen")));
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "vid_vsync", _("Vertical Synchronization")));
+                       e.applyButton = videoApplyButton;
+               me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "vid_vsync", _("Vertical Synchronization"),
+                       _("Enable vertical synchronization to prevent tearing, will cap your fps to the screen refresh rate")));
 
        me.TR(me);
-               if(cvar("developer"))
-                       { me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_flipped", _("Flip view horizontally"))); }
+               if(cvar("developer") > 0)
+               {
+                       me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "v_flipped", _("Flip view horizontally"),
+                               _("Poor man's left handed mode")));
+               }
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Anisotropy:")));
-               me.TD(me, 1, 2, e = makeXonoticTextSlider("gl_texture_anisotropy"));
+               me.TD(me, 1, 2, e = makeXonoticTextSlider_T("gl_texture_anisotropy",
+                       _("Anisotropic filtering quality")));
                        e.addValue(e, ZCTX(_("ANISO^Disabled")), "1");
                        e.addValue(e, _("2x"), "2");
                        e.addValue(e, _("4x"), "4");
@@ -64,12 +80,14 @@ void XonoticVideoSettingsTab_fill(entity me)
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Antialiasing:")));
                        setDependent(e, "r_viewfbo", 0, 0);
-               me.TD(me, 1, 2, e = makeXonoticTextSlider("vid_samples"));
+               me.TD(me, 1, 2, e = makeXonoticTextSlider_T("vid_samples",
+                       _("Enable antialiasing, which smooths the edges of 3D geometry. Note that it might decrease performance by quite a lot")));
                        e.addValue(e, ZCTX(_("AA^Disabled")), "1");
                        e.addValue(e, _("2x"), "2");
                        e.addValue(e, _("4x"), "4");
                        e.configureXonoticTextSliderValues(e);
                        setDependent(e, "r_viewfbo", 0, 0);
+                       e.applyButton = videoApplyButton;
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "r_viewfbo", _("High-quality frame buffer")));
                        setDependent(e, "vid_samples", 1, 1);
@@ -77,7 +95,8 @@ void XonoticVideoSettingsTab_fill(entity me)
        me.TR(me);
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Depth first:")));
-               me.TD(me, 1, 2, e = makeXonoticTextSlider("r_depthfirst"));
+               me.TD(me, 1, 2, e = makeXonoticTextSlider_T("r_depthfirst",
+                       _("Eliminate overdraw by rendering a depth-only version of the scene before the normal rendering starts")));
                        e.addValue(e, ZCTX(_("DF^Disabled")), "0");
                        e.addValue(e, ZCTX(_("DF^World")), "1");
                        e.addValue(e, ZCTX(_("DF^All")), "2");
@@ -87,50 +106,58 @@ void XonoticVideoSettingsTab_fill(entity me)
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "gl_vbo", "0", ZCTX(_("VBO^Off"))));
-               me.TD(me, 1, 1.9, e = makeXonoticRadioButton(1, "gl_vbo", "3", _("Vertices, some Tris (compatible)")));
+               me.TD(me, 1, 1.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "3", _("Vertices, some Tris (compatible)"),
+                       _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "gl_vbo", "2", _("Vertices")));
-               me.TD(me, 1, 1.9, e = makeXonoticRadioButton(1, "gl_vbo", "1", _("Vertices and Triangles")));
+               me.TD(me, 1, 0.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "2", _("Vertices"),
+                       _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering")));
+               me.TD(me, 1, 1.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "1", _("Vertices and Triangles"),
+                       _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering")));
 
        me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Brightness:")));
-               me.TD(me, 1, 2, e = makeXonoticSlider(0.0, 0.5, 0.02, "v_brightness"));
+               me.TD(me, 1, 2, e = makeXonoticSlider_T(0.0, 0.5, 0.02, "v_brightness",
+                       _("Brightness of black")));
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast:")));
-               me.TD(me, 1, 2, e = makeXonoticSlider(1.0, 3.0, 0.05, "v_contrast"));
+               me.TD(me, 1, 2, e = makeXonoticSlider_T(1.0, 3.0, 0.05, "v_contrast",
+                       _("Brightness of white")));
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gamma:")));
-                       setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
-               me.TD(me, 1, 2, e = makeXonoticSlider(0.5, 2.0, 0.05, "v_gamma"));
-                       setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
+                       setDependent(e, "vid_gl20", 1, 1);
+               me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "v_gamma",
+                       _("Inverse gamma correction value, a brightness effect that does not affect white or black")));
+                       setDependent(e, "vid_gl20", 1, 1);
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast boost:")));
-                       setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
-               me.TD(me, 1, 2, e = makeXonoticSlider(1.0, 5.0, 0.1, "v_contrastboost"));
-                       setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
+                       setDependent(e, "vid_gl20", 1, 1);
+               me.TD(me, 1, 2, e = makeXonoticSlider_T(1.0, 5.0, 0.1, "v_contrastboost",
+                       _("By how much to multiply the contrast in dark areas")));
+                       setDependent(e, "vid_gl20", 1, 1);
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Saturation:")));
                        setDependent(e, "vid_gl20", 1, 1);
-               me.TD(me, 1, 2, e = makeXonoticSlider(0.5, 2.0, 0.05, "r_glsl_saturation"));
+               me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "r_glsl_saturation",
+                       _("Saturation adjustment (0 = grayscale, 1 = normal, 2 = oversaturated), requires GLSL color control")));
                        setDependent(e, "vid_gl20", 1, 1);
        me.TR(me);
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, ZCTX(_("LIT^Ambient:"))));
-               me.TD(me, 1, 2, e = makeXonoticSlider(0, 20.0, 0.25, "r_ambient"));
+               me.TD(me, 1, 2, e = makeXonoticSlider_T(0, 20.0, 0.25, "r_ambient",
+                       _("Ambient lighting, if set too high it tends to make light on maps look dull and flat")));
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Intensity:")));
-               me.TD(me, 1, 2, e = makeXonoticSlider(0.5, 2.0, 0.05, "r_hdr_scenebrightness"));
+               me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "r_hdr_scenebrightness",
+                       _("Global rendering brightness")));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "gl_finish", _("Wait for GPU to finish each frame")));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "gl_finish", _("Wait for GPU to finish each frame"),
+                       _("Make the CPU wait for the GPU to finish each frame, can help with some strange input or video lag on some machines")));
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", _("Use OpenGL 2.0 shaders (GLSL)")));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "v_glslgamma", _("Use GLSL to handle color control")));
-                       setDependent(e, "vid_gl20", 1, 1);
-       if(cvar("developer"))
+                       e.applyButton = videoApplyButton;
+       if(cvar("developer") > 0)
        {
                me.TR(me);
                        me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_psycho", _("Psycho coloring (easter egg)")));
@@ -141,6 +168,5 @@ void XonoticVideoSettingsTab_fill(entity me)
        }
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_width $_menu_vid_width; vid_height $_menu_vid_height; vid_pixelheight $_menu_vid_pixelheight; vid_desktopfullscreen $_menu_vid_desktopfullscreen; menu_cmd update_conwidths_before_vid_restart; vid_restart; menu_cmd sync", COMMANDBUTTON_APPLY));
+               me.TD(me, 1, me.columns, videoApplyButton);
 }
-#endif