ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.5)
ENDCLASS(XonoticEffectsSettingsTab)
entity makeXonoticEffectsSettingsTab();
+float updateCompression();
#endif
#ifdef IMPLEMENTATION
return FALSE;
}
+float updateCompression()
+{
+ float have_dds, have_jpg, have_tga;
+ if((have_dds = (fh = fopen("dds/particles/particlefont.dds", FILE_READ) >= 0)))
+ fclose(fh);
+ if((have_jpg = (fh = fopen("jpg/particles/particlefont.jpg", FILE_READ) >= 0)))
+ fclose(fh);
+ if((have_tga = (fh = fopen("tga/particles/particlefont.tga", FILE_READ) >= 0)))
+ fclose(fh);
+ if(have_dds && (have_jpg || have_tga))
+ {
+ cvar_set("gl_texturecompression", "0");
+ return 1;
+ }
+ else if(have_dds)
+ {
+ cvar_set("gl_texturecompression", "0");
+ cvar_set("r_texture_dds_load", "1");
+ return 0;
+ }
+ else
+ {
+ cvar_set("gl_texturecompression", cvar_string("r_texture_dds_load"));
+ return 2;
+ }
+}
+
void XonoticEffectsSettingsTab_fill(entity me)
{
entity e, s;
e.configureXonoticTextSliderValues(e);
me.TR(me);
me.TR(me);
- me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Texture quality:"));
+ me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Texture resolution:"));
me.TD(me, 1, 2, e = makeXonoticTextSlider("gl_picmip"));
if(cvar("developer"))
e.addValue(e, "Leet", "1337");
- e.addValue(e, "Lowest", "4");
- e.addValue(e, "Low", "3");
- e.addValue(e, "Normal", "2");
- e.addValue(e, "Good", "1");
- e.addValue(e, "Best", "0");
+ e.addValue(e, "Lowest", "2");
+ e.addValue(e, "Low", "1");
+ e.addValue(e, "Normal", "0");
+ e.addValue(e, "Good", "-1");
+ e.addValue(e, "Best", "-2");
e.configureXonoticTextSliderValues(e);
me.TR(me);
me.TDempty(me, 0.2);
- me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_picmipworld", "Reduce model texture quality only"));
- setDependent(e, "gl_picmip", 0.5, -0.5);
+ {
+ // detect texture compression method
+ float f;
+ f = updateCompression();
+ switch(f)
+ {
+ case 0:
+ break;
+ case 1:
+ me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", "Avoid lossy texture compression"));
+ break;
+ case 2:
+ me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", "Avoid lossy texture compression"));
+ makeMulti(e, "gl_texturecompression");
+ break;
+ }
+ }
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Anisotropy:"));
me.TD(me, 1, 2, e = makeXonoticTextSlider("gl_texture_anisotropy"));
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Color depth:"));
me.TD(me, 1, 2, e = makeXonoticSlider(16, 32, 16, "vid_bitsperpixel"));
- me.TR(me);
- me.TD(me, 1, 1.5, e = makeXonoticTextLabel(0, "Texture compression"));
- me.TD(me, 1, 0.5, e = makeXonoticRadioButton(2, "gl_texturecompression", "0", "None"));
- me.TD(me, 1, 0.5, e = makeXonoticRadioButton(2, "gl_texturecompression", "1", "Fast"));
- me.TD(me, 1, 0.5, e = makeXonoticRadioButton(2, "gl_texturecompression", "2", "Good"));
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"));
me.TR(me);
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", "Use OpenGL 2.0 shaders (GLSL)"));
+ me.TR(me);
me.TR(me);
me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_coronas_occlusionquery", "Use Occlusion Queries"));
me.TR(me);