1 #include "dialog_settings_video.qh"
3 #include "commandbutton.qh"
4 #include "textlabel.qh"
5 #include "textslider.qh"
8 #include "slider_resolution.qh"
9 #include "radiobutton.qh"
11 entity makeXonoticVideoSettingsTab()
14 me = NEW(XonoticVideoSettingsTab);
15 me.configureDialog(me);
18 void XonoticVideoSettingsTab_fill(entity me)
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;"
29 , COMMANDBUTTON_APPLY);
30 videoApplyButton.disableOnClick = true;
33 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Resolution:")));
34 me.TD(me, 1, 2, e = makeXonoticResolutionSlider());
35 e.applyButton = videoApplyButton;
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;
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;
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 (default: disabled)")));
67 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "v_flipped", _("Flip view horizontally"),
68 _("Poor man's left handed mode (default: off)")));
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 (default: 1x)")));
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);
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 (default: disabled)")));
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;
92 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "r_viewfbo", _("High-quality frame buffer")));
93 setDependent(e, "vid_samples", 1, 1);
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 (default: disabled)")));
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);
105 me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Vertex Buffer Objects (VBOs)")));
108 me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "gl_vbo", "0", ZCTX(_("VBO^Off"))));
109 me.TD(me, 1, 1.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "3", _("Vertices, some Tris (compatible)"),
110 _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering (default: Vertex and Triangles)")));
113 me.TD(me, 1, 0.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "2", _("Vertices"),
114 _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering (default: Vertex and Triangles)")));
115 me.TD(me, 1, 1.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "1", _("Vertices and Triangles"),
116 _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering (default: Vertex and Triangles)")));
118 me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
119 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Brightness:")));
120 me.TD(me, 1, 2, e = makeXonoticSlider_T(0.0, 0.5, 0.02, "v_brightness",
121 _("Brightness of black (default: 0)")));
123 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast:")));
124 me.TD(me, 1, 2, e = makeXonoticSlider_T(1.0, 3.0, 0.05, "v_contrast",
125 _("Brightness of white (default: 1)")));
127 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gamma:")));
128 setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
129 me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "v_gamma",
130 _("Inverse gamma correction value, a brightness effect that does not affect white or black (default: 1.125)")));
131 setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
133 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast boost:")));
134 setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
135 me.TD(me, 1, 2, e = makeXonoticSlider_T(1.0, 5.0, 0.1, "v_contrastboost",
136 _("By how much to multiply the contrast in dark areas (default: 1)")));
137 setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
139 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Saturation:")));
140 setDependent(e, "vid_gl20", 1, 1);
141 me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "r_glsl_saturation",
142 _("Saturation adjustment (0 = grayscale, 1 = normal, 2 = oversaturated), requires GLSL color control (default: 1)")));
143 setDependent(e, "vid_gl20", 1, 1);
146 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, ZCTX(_("LIT^Ambient:"))));
147 me.TD(me, 1, 2, e = makeXonoticSlider_T(0, 20.0, 0.25, "r_ambient",
148 _("Ambient lighting, if set too high it tends to make light on maps look dull and flat (default: 4)")));
150 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Intensity:")));
151 me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "r_hdr_scenebrightness",
152 _("Global rendering brightness (default: 1)")));
155 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "gl_finish", _("Wait for GPU to finish each frame"),
156 _("Make the CPU wait for the GPU to finish each frame, can help with some strange input or video lag on some machines (default: disabled)")));
158 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", _("Use OpenGL 2.0 shaders (GLSL)")));
159 e.applyButton = videoApplyButton;
162 me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "v_glslgamma", _("Use GLSL to handle color control"),
163 _("Enable use of GLSL to apply gamma correction, note that it might decrease performance by a lot (default: disabled)")));
164 setDependent(e, "vid_gl20", 1, 1);
165 if(cvar("developer"))
168 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_psycho", _("Psycho coloring (easter egg)")));
169 setDependent(e, "vid_gl20", 1, 1);
171 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_trippy", _("Trippy vertices (easter egg)")));
172 setDependent(e, "vid_gl20", 1, 1);
175 me.gotoRC(me, me.rows - 1, 0);
176 me.TD(me, 1, me.columns, videoApplyButton);