1 #include "dialog_settings_video.qh"
2 #ifndef DIALOG_SETTINGS_VIDEO_H
3 #define DIALOG_SETTINGS_VIDEO_H
5 CLASS(XonoticVideoSettingsTab, XonoticTab)
6 METHOD(XonoticVideoSettingsTab, fill, void(entity));
7 ATTRIB(XonoticVideoSettingsTab, intendedWidth, float, 0.9)
8 ATTRIB(XonoticVideoSettingsTab, rows, float, 15.5)
9 ATTRIB(XonoticVideoSettingsTab, columns, float, 6.2) // added extra .2 for center space
10 ATTRIB(XonoticVideoSettingsTab, name, string, "videosettings")
11 ENDCLASS(XonoticVideoSettingsTab)
12 entity makeXonoticVideoSettingsTab();
16 entity makeXonoticVideoSettingsTab()
19 me = NEW(XonoticVideoSettingsTab);
20 me.configureDialog(me);
23 void XonoticVideoSettingsTab_fill(entity me)
26 entity videoApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
27 "vid_width $_menu_vid_width;"
28 "vid_height $_menu_vid_height;"
29 "vid_pixelheight $_menu_vid_pixelheight;"
30 "vid_desktopfullscreen $_menu_vid_desktopfullscreen;"
31 "menu_cmd update_conwidths_before_vid_restart;"
34 , COMMANDBUTTON_APPLY);
35 videoApplyButton.disableOnClick = true;
38 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Resolution:")));
39 me.TD(me, 1, 2, e = makeXonoticResolutionSlider());
40 e.applyButton = videoApplyButton;
42 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Font/UI size:")));
43 me.TD(me, 1, 2, e = makeXonoticTextSlider("menu_vid_scale"));
44 e.addValue(e, ZCTX(_("SZ^Unreadable")), "-1");
45 e.addValue(e, ZCTX(_("SZ^Tiny")), "-0.75");
46 e.addValue(e, ZCTX(_("SZ^Little")), "-0.5");
47 e.addValue(e, ZCTX(_("SZ^Small")), "-0.25");
48 e.addValue(e, ZCTX(_("SZ^Medium")), "0");
49 e.addValue(e, ZCTX(_("SZ^Large")), "0.25");
50 e.addValue(e, ZCTX(_("SZ^Huge")), "0.5");
51 e.addValue(e, ZCTX(_("SZ^Gigantic")), "0.75");
52 e.addValue(e, ZCTX(_("SZ^Colossal")), "1");
53 e.configureXonoticTextSliderValues(e);
55 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Color depth:")));
56 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("vid_bitsperpixel",
57 _("How many bits per pixel (BPP) to render at, 32 is recommended")));
58 e.addValue(e, _("16bit"), "16");
59 e.addValue(e, _("32bit"), "32");
60 e.configureXonoticTextSliderValues(e);
61 e.applyButton = videoApplyButton;
63 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "vid_fullscreen", _("Full screen")));
64 e.applyButton = videoApplyButton;
65 me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "vid_vsync", _("Vertical Synchronization"),
66 _("Enable vertical synchronization to prevent tearing, will cap your fps to the screen refresh rate (default: disabled)")));
71 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "v_flipped", _("Flip view horizontally"),
72 _("Poor man's left handed mode (default: off)")));
75 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Anisotropy:")));
76 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("gl_texture_anisotropy",
77 _("Anisotropic filtering quality (default: 1x)")));
78 e.addValue(e, ZCTX(_("ANISO^Disabled")), "1");
79 e.addValue(e, _("2x"), "2");
80 e.addValue(e, _("4x"), "4");
81 e.addValue(e, _("8x"), "8");
82 e.addValue(e, _("16x"), "16");
83 e.configureXonoticTextSliderValues(e);
85 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Antialiasing:")));
86 setDependent(e, "r_viewfbo", 0, 0);
87 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("vid_samples",
88 _("Enable antialiasing, which smooths the edges of 3D geometry. Note that it might decrease performance by quite a lot (default: disabled)")));
89 e.addValue(e, ZCTX(_("AA^Disabled")), "1");
90 e.addValue(e, _("2x"), "2");
91 e.addValue(e, _("4x"), "4");
92 e.configureXonoticTextSliderValues(e);
93 setDependent(e, "r_viewfbo", 0, 0);
95 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "r_viewfbo", _("High-quality frame buffer")));
96 setDependent(e, "vid_samples", 1, 1);
100 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Depth first:")));
101 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("r_depthfirst",
102 _("Eliminate overdraw by rendering a depth-only version of the scene before the normal rendering starts (default: disabled)")));
103 e.addValue(e, ZCTX(_("DF^Disabled")), "0");
104 e.addValue(e, ZCTX(_("DF^World")), "1");
105 e.addValue(e, ZCTX(_("DF^All")), "2");
106 e.configureXonoticTextSliderValues(e);
108 me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Vertex Buffer Objects (VBOs)")));
111 me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "gl_vbo", "0", ZCTX(_("VBO^Off"))));
112 me.TD(me, 1, 1.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "3", _("Vertices, some Tris (compatible)"),
113 _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering (default: Vertex and Triangles)")));
116 me.TD(me, 1, 0.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "2", _("Vertices"),
117 _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering (default: Vertex and Triangles)")));
118 me.TD(me, 1, 1.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "1", _("Vertices and Triangles"),
119 _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering (default: Vertex and Triangles)")));
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 (default: 0)")));
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 (default: 1)")));
130 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gamma:")));
131 setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 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 (default: 1.125)")));
134 setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
136 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast boost:")));
137 setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 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 (default: 1)")));
140 setDependentAND(e, "vid_gl20", 1, 1, "v_glslgamma", 1, 1);
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 (default: 1)")));
146 setDependent(e, "vid_gl20", 1, 1);
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 (default: 4)")));
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 (default: 1)")));
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 (default: disabled)")));
161 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", _("Use OpenGL 2.0 shaders (GLSL)")));
164 me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "v_glslgamma", _("Use GLSL to handle color control"),
165 _("Enable use of GLSL to apply gamma correction, note that it might decrease performance by a lot (default: disabled)")));
166 setDependent(e, "vid_gl20", 1, 1);
167 if(cvar("developer"))
170 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_psycho", _("Psycho coloring (easter egg)")));
171 setDependent(e, "vid_gl20", 1, 1);
173 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_trippy", _("Trippy vertices (easter egg)")));
174 setDependent(e, "vid_gl20", 1, 1);
177 me.gotoRC(me, me.rows - 1, 0);
178 me.TD(me, 1, me.columns, videoApplyButton);