Xonotic
dialog_settings_video.qc
Go to the documentation of this file.
2 
3 #include "commandbutton.qh"
4 #include "textlabel.qh"
5 #include "textslider.qh"
6 #include "checkbox.qh"
7 #include "slider.qh"
8 #include "slider_resolution.qh"
9 #include "radiobutton.qh"
10 
12 {
13  entity me;
15  me.configureDialog(me);
16  return me;
17 }
19 {
20  entity e;
21  entity videoApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
22  "vid_width $_menu_vid_width;"
23  "vid_height $_menu_vid_height;"
24  "vid_pixelheight $_menu_vid_pixelheight;"
25  "vid_desktopfullscreen $_menu_vid_desktopfullscreen;"
26  "menu_cmd update_conwidths_before_vid_restart;"
27  "vid_restart;"
28  "menu_cmd sync;"
30  videoApplyButton.disableOnClick = true;
31 
32  me.TR(me);
33  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Resolution:")));
34  me.TD(me, 1, 2, e = makeXonoticResolutionSlider());
35  e.applyButton = videoApplyButton;
36  me.TR(me);
37  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Font/UI size:")));
38  me.TD(me, 1, 2, e = makeXonoticTextSlider("menu_vid_scale"));
39  e.addValue(e, ZCTX(_("SZ^Unreadable")), "-1");
40  e.addValue(e, ZCTX(_("SZ^Tiny")), "-0.75");
41  e.addValue(e, ZCTX(_("SZ^Little")), "-0.5");
42  e.addValue(e, ZCTX(_("SZ^Small")), "-0.25");
43  e.addValue(e, ZCTX(_("SZ^Medium")), "0");
44  e.addValue(e, ZCTX(_("SZ^Large")), "0.25");
45  e.addValue(e, ZCTX(_("SZ^Huge")), "0.5");
46  e.addValue(e, ZCTX(_("SZ^Gigantic")), "0.75");
47  e.addValue(e, ZCTX(_("SZ^Colossal")), "1");
48  e.configureXonoticTextSliderValues(e);
49  e.applyButton = videoApplyButton;
50  me.TR(me);
51  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Color depth:")));
52  me.TD(me, 1, 2, e = makeXonoticTextSlider_T("vid_bitsperpixel",
53  _("How many bits per pixel (BPP) to render at, 32 is recommended")));
54  e.addValue(e, _("16bit"), "16");
55  e.addValue(e, _("32bit"), "32");
56  e.configureXonoticTextSliderValues(e);
57  e.applyButton = videoApplyButton;
58  me.TR(me);
59  me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "vid_fullscreen", _("Full screen")));
60  e.applyButton = videoApplyButton;
61  me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "vid_vsync", _("Vertical Synchronization"),
62  _("Enable vertical synchronization to prevent tearing, will cap your fps to the screen refresh rate")));
63 
64  me.TR(me);
65  if(cvar("developer") > 0)
66  {
67  me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "v_flipped", _("Flip view horizontally"),
68  _("Poor man's left handed mode")));
69  }
70  me.TR(me);
71  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Anisotropy:")));
72  me.TD(me, 1, 2, e = makeXonoticTextSlider_T("gl_texture_anisotropy",
73  _("Anisotropic filtering quality")));
74  e.addValue(e, ZCTX(_("ANISO^Disabled")), "1");
75  e.addValue(e, _("2x"), "2");
76  e.addValue(e, _("4x"), "4");
77  e.addValue(e, _("8x"), "8");
78  e.addValue(e, _("16x"), "16");
79  e.configureXonoticTextSliderValues(e);
80  me.TR(me);
81  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Antialiasing:")));
82  setDependent(e, "r_viewfbo", 0, 0);
83  me.TD(me, 1, 2, e = makeXonoticTextSlider_T("vid_samples",
84  _("Enable antialiasing, which smooths the edges of 3D geometry. Note that it might decrease performance by quite a lot")));
85  e.addValue(e, ZCTX(_("AA^Disabled")), "1");
86  e.addValue(e, _("2x"), "2");
87  e.addValue(e, _("4x"), "4");
88  e.configureXonoticTextSliderValues(e);
89  setDependent(e, "r_viewfbo", 0, 0);
90  e.applyButton = videoApplyButton;
91  me.TR(me);
92  me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "r_viewfbo", _("High-quality frame buffer")));
93  setDependent(e, "vid_samples", 1, 1);
94 
95  me.TR(me);
96  me.TR(me);
97  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Depth first:")));
98  me.TD(me, 1, 2, e = makeXonoticTextSlider_T("r_depthfirst",
99  _("Eliminate overdraw by rendering a depth-only version of the scene before the normal rendering starts")));
100  e.addValue(e, ZCTX(_("DF^Disabled")), "0");
101  e.addValue(e, ZCTX(_("DF^World")), "1");
102  e.addValue(e, ZCTX(_("DF^All")), "2");
103  e.configureXonoticTextSliderValues(e);
104  me.TR(me);
105  if(cvar_type("gl_vbo") & CVAR_TYPEFLAG_ENGINE)
106  {
107  me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Vertex Buffer Objects (VBOs)")));
108  me.TR(me);
109  me.TDempty(me, 0.2);
110  me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "gl_vbo", "0", ZCTX(_("VBO^Off"))));
111  me.TD(me, 1, 1.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "3", _("Vertices, some Tris (compatible)"),
112  _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering")));
113  me.TR(me);
114  me.TDempty(me, 0.2);
115  me.TD(me, 1, 0.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "2", _("Vertices"),
116  _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering")));
117  me.TD(me, 1, 1.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "1", _("Vertices and Triangles"),
118  _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering")));
119  }
120 
121  me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
122  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Brightness:")));
123  me.TD(me, 1, 2, e = makeXonoticSlider_T(0.0, 0.5, 0.02, "v_brightness",
124  _("Brightness of black")));
125  me.TR(me);
126  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast:")));
127  me.TD(me, 1, 2, e = makeXonoticSlider_T(1.0, 3.0, 0.05, "v_contrast",
128  _("Brightness of white")));
129  me.TR(me);
130  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gamma:")));
131  setDependent(e, "vid_gl20", 1, 1);
132  me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "v_gamma",
133  _("Inverse gamma correction value, a brightness effect that does not affect white or black")));
134  setDependent(e, "vid_gl20", 1, 1);
135  me.TR(me);
136  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast boost:")));
137  setDependent(e, "vid_gl20", 1, 1);
138  me.TD(me, 1, 2, e = makeXonoticSlider_T(1.0, 5.0, 0.1, "v_contrastboost",
139  _("By how much to multiply the contrast in dark areas")));
140  setDependent(e, "vid_gl20", 1, 1);
141  me.TR(me);
142  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Saturation:")));
143  setDependent(e, "vid_gl20", 1, 1);
144  me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "r_glsl_saturation",
145  _("Saturation adjustment (0 = grayscale, 1 = normal, 2 = oversaturated), requires GLSL color control")));
146  setDependent(e, "vid_gl20", 1, 1);
147  me.TR(me);
148  me.TR(me);
149  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, ZCTX(_("LIT^Ambient:"))));
150  me.TD(me, 1, 2, e = makeXonoticSlider_T(0, 20.0, 0.25, "r_ambient",
151  _("Ambient lighting, if set too high it tends to make light on maps look dull and flat")));
152  me.TR(me);
153  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Intensity:")));
154  me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "r_hdr_scenebrightness",
155  _("Global rendering brightness")));
156  me.TR(me);
157  me.TR(me);
158  me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "gl_finish", _("Wait for GPU to finish each frame"),
159  _("Make the CPU wait for the GPU to finish each frame, can help with some strange input or video lag on some machines")));
160  me.TR(me);
161  if(cvar_type("vid_gl20") & CVAR_TYPEFLAG_ENGINE)
162  {
163  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", _("Use OpenGL 2.0 shaders (GLSL)")));
164  e.applyButton = videoApplyButton;
165  }
166  if(cvar("developer") > 0)
167  {
168  me.TR(me);
169  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_psycho", _("Psycho coloring (easter egg)")));
170  setDependent(e, "vid_gl20", 1, 1);
171  me.TR(me);
172  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_trippy", _("Trippy vertices (easter egg)")));
173  setDependent(e, "vid_gl20", 1, 1);
174  }
175 
176  me.gotoRC(me, me.rows - 1, 0);
177  me.TD(me, 1, me.columns, videoApplyButton);
178 }
#define NEW(cname,...)
Definition: oo.qh:105
entity makeXonoticCheckBoxEx(float theYesValue, float theNoValue, string theCvar, string theText)
Definition: checkbox.qc:40
entity makeXonoticVideoSettingsTab()
entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, string theText)
Definition: radiobutton.qc:10
entity() spawn
entity makeXonoticTextLabel(float theAlign, string theText)
Definition: textlabel.qc:3
entity makeXonoticRadioButton_T(float theGroup, string theCvar, string theValue, string theText, string theTooltip)
Definition: radiobutton.qc:3
entity makeXonoticTextSlider_T(string theCvar, string theTooltip)
Definition: textslider.qc:3
void XonoticVideoSettingsTab_fill(entity me)
#define ZCTX(s)
Definition: i18n.qh:68
entity makeXonoticSlider_T(float theValueMin, float theValueMax, float theValueStep, string theCvar, string theTooltip)
Definition: slider.qc:3
entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
Definition: checkbox.qc:3
float CVAR_TYPEFLAG_ENGINE
entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, int theFlags)
entity makeXonoticTextSlider(string theCvar)
Definition: textslider.qc:10
entity makeXonoticResolutionSlider()
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition: checkbox.qc:28
#define COMMANDBUTTON_APPLY