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 _("Vsync prevents tearing, but increases latency and caps your fps at the screen refresh rate")));
64 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "r_viewfbo", _("High-quality frame buffer")));
65 if(cvar_type("vid_gl20") & CVAR_TYPEFLAG_ENGINE)
66 setDependent(e, "vid_samples", 0, 1);
70 if(cvar_type("vid_gl20") & CVAR_TYPEFLAG_ENGINE)
72 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Antialiasing:")));
73 setDependent(e, "r_viewfbo", 0, 0);
74 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("vid_samples",
75 _("Enable antialiasing, which smooths the edges of 3D geometry. Note that it might decrease performance by quite a lot")));
76 e.addValue(e, ZCTX(_("AA^Disabled")), "1");
77 e.addValue(e, _("2x"), "2");
78 e.addValue(e, _("4x"), "4");
79 e.configureXonoticTextSliderValues(e);
80 setDependent(e, "r_viewfbo", 0, 0);
81 e.applyButton = videoApplyButton;
85 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Resolution scaling:")));
86 me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2, 0.25, "r_viewscale",
87 _("Screen or window size multiplier, above 1x does antialiasing, below 1x may help slow GPUs")));
90 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Anisotropy:")));
91 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("gl_texture_anisotropy",
92 _("Anisotropic filtering quality")));
93 e.addValue(e, ZCTX(_("ANISO^Disabled")), "1");
94 e.addValue(e, _("2x"), "2");
95 e.addValue(e, _("4x"), "4");
96 e.addValue(e, _("8x"), "8");
97 e.addValue(e, _("16x"), "16");
98 e.configureXonoticTextSliderValues(e);
102 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Depth first:")));
103 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("r_depthfirst",
104 _("Eliminate overdraw by rendering a depth-only version of the scene before the normal rendering starts")));
105 e.addValue(e, ZCTX(_("DF^Disabled")), "0");
106 e.addValue(e, ZCTX(_("DF^World")), "1");
107 e.addValue(e, ZCTX(_("DF^All")), "2");
108 e.configureXonoticTextSliderValues(e);
110 me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
111 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Brightness:")));
112 me.TD(me, 1, 2, e = makeXonoticSlider_T(0.0, 0.5, 0.02, "v_brightness",
113 _("Brightness of black")));
115 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast:")));
116 me.TD(me, 1, 2, e = makeXonoticSlider_T(1.0, 3.0, 0.05, "v_contrast",
117 _("Brightness of white")));
119 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gamma:")));
120 if(cvar_type("vid_gl20") & CVAR_TYPEFLAG_ENGINE)
121 setDependent(e, "vid_gl20", 1, 1);
122 me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "v_gamma",
123 _("Inverse gamma correction value, a brightness effect that does not affect white or black")));
124 if(cvar_type("vid_gl20") & CVAR_TYPEFLAG_ENGINE)
125 setDependent(e, "vid_gl20", 1, 1);
127 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast boost:")));
128 if(cvar_type("vid_gl20") & CVAR_TYPEFLAG_ENGINE)
129 setDependent(e, "vid_gl20", 1, 1);
130 me.TD(me, 1, 2, e = makeXonoticSlider_T(1.0, 5.0, 0.1, "v_contrastboost",
131 _("By how much to multiply the contrast in dark areas")));
132 if(cvar_type("vid_gl20") & CVAR_TYPEFLAG_ENGINE)
133 setDependent(e, "vid_gl20", 1, 1);
135 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Saturation:")));
136 if(cvar_type("vid_gl20") & CVAR_TYPEFLAG_ENGINE)
137 setDependent(e, "vid_gl20", 1, 1);
138 me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "r_glsl_saturation",
139 _("Saturation adjustment (0 = grayscale, 1 = normal, 2 = oversaturated), requires GLSL color control")));
140 if(cvar_type("vid_gl20") & CVAR_TYPEFLAG_ENGINE)
141 setDependent(e, "vid_gl20", 1, 1);
144 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, ZCTX(_("LIT^Ambient:"))));
145 me.TD(me, 1, 2, e = makeXonoticSlider_T(0, 20.0, 0.25, "r_ambient",
146 _("Ambient lighting, if set too high it tends to make light on maps look dull and flat")));
148 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Intensity:")));
149 me.TD(me, 1, 2, e = makeXonoticSlider_T(0.5, 2.0, 0.05, "r_hdr_scenebrightness",
150 _("Global rendering brightness")));
153 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "gl_finish", _("Wait for GPU to finish each frame"),
154 _("Make the CPU wait for the GPU to finish each frame, can help with some strange input or video lag on some machines")));
156 if(cvar_type("vid_gl20") & CVAR_TYPEFLAG_ENGINE)
158 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", _("Use OpenGL 2.0 shaders (GLSL)")));
159 e.applyButton = videoApplyButton;
161 if(cvar("developer") > 0)
164 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "v_flipped", _("Flip view horizontally"),
165 _("Poor man's left handed mode")));
167 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_psycho", _("Psycho coloring (easter egg)")));
168 if(cvar_type("vid_gl20") & CVAR_TYPEFLAG_ENGINE)
169 setDependent(e, "vid_gl20", 1, 1);
171 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_trippy", _("Trippy vertices (easter egg)")));
172 if(cvar_type("vid_gl20") & CVAR_TYPEFLAG_ENGINE)
173 setDependent(e, "vid_gl20", 1, 1);
176 me.gotoRC(me, me.rows - 1, 0);
177 me.TD(me, 1, me.columns, videoApplyButton);