X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fslider_picmip.qc;h=c0b03af57df5afea037fda43c2953ad794ed596b;hb=0f1ffe9c0565f1f1a0d6f58240760f227aa3ee99;hp=ddedc4bab2901e2cd077a60c475aef525f223e80;hpb=6dc9591eba337374f2b4348a6a6deaa1cb6887d0;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/slider_picmip.qc b/qcsrc/menu/xonotic/slider_picmip.qc index ddedc4bab..c0b03af57 100644 --- a/qcsrc/menu/xonotic/slider_picmip.qc +++ b/qcsrc/menu/xonotic/slider_picmip.qc @@ -1,24 +1,16 @@ -#ifdef INTERFACE -CLASS(XonoticPicmipSlider) EXTENDS(XonoticTextSlider) - METHOD(XonoticPicmipSlider, configureXonoticPicmipSlider, void(entity)) - METHOD(XonoticPicmipSlider, draw, void(entity)) - METHOD(XonoticPicmipSlider, autofix, void(entity)) - ATTRIB(XonoticPicmipSlider, have_s3tc, float, 0) -ENDCLASS(XonoticPicmipSlider) -entity makeXonoticPicmipSlider(); // note: you still need to call addValue and configureXonoticTextSliderValues! -#endif +#include "slider_picmip.qh" -#ifdef IMPLEMENTATION entity makeXonoticPicmipSlider() { entity me; - me = spawnXonoticPicmipSlider(); + me = NEW(XonoticPicmipSlider); me.configureXonoticPicmipSlider(me); return me; } void XonoticPicmipSlider_configureXonoticPicmipSlider(entity me) { - me.configureXonoticTextSlider(me, "gl_picmip"); + me.configureXonoticTextSlider(me, "gl_picmip", + _("Change the sharpness of the textures. Lowering it will effectively reduce texture memory usage, but make the textures appear very blurry.")); me.autofix(me); me.have_s3tc = GL_Have_TextureCompression(); } @@ -26,8 +18,8 @@ float texmemsize(float s3tc) { return ( - 2500 * pow(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_other"))) - + 1500 * pow(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_world"))) + 2500 * (0.25 ** max(0, cvar("gl_picmip") + cvar("gl_picmip_other"))) + + 1500 * (0.25 ** max(0, cvar("gl_picmip") + cvar("gl_picmip_world"))) ) * ((s3tc && (cvar("r_texture_dds_load") || cvar("gl_texturecompression"))) ? 0.2 : 1.0); // TC: normalmaps 50%, other 25%, few incompressible, guessing 40% as conservative average } void XonoticPicmipSlider_autofix(entity me) @@ -50,4 +42,3 @@ void XonoticPicmipSlider_draw(entity me) me.autofix(me); SUPER(XonoticPicmipSlider).draw(me); } -#endif