2 CLASS(XonoticPicmipSlider) EXTENDS(XonoticTextSlider)
3 METHOD(XonoticPicmipSlider, configureXonoticPicmipSlider, void(entity))
4 METHOD(XonoticPicmipSlider, draw, void(entity))
5 METHOD(XonoticPicmipSlider, autofix, void(entity))
6 ENDCLASS(XonoticPicmipSlider)
7 entity makeXonoticPicmipSlider(); // note: you still need to call addValue and configureXonoticTextSliderValues!
11 entity makeXonoticPicmipSlider()
14 me = spawnXonoticPicmipSlider();
15 me.configureXonoticPicmipSlider(me);
18 void XonoticPicmipSlider_configureXonoticPicmipSlider(entity me)
20 me.configureXonoticTextSlider(me, "gl_picmip");
27 2500 * pow(0.5, max(0, cvar("gl_picmip") + cvar("gl_picmip_other")))
28 + 1500 * pow(0.5, max(0, cvar("gl_picmip") + cvar("gl_picmip_world")))
29 ) * ((cvar("r_texture_dds_load") || cvar("gl_texturecompression")) ? 0.4 : 1.0); // TC: normalmaps 50%, other 25%, few incompressible, guessing 40% as conservative average
31 void XonoticPicmipSlider_autofix(entity me)
33 float max_hard, max_soft;
34 max_hard = cvar("sys_memsize_virtual");
35 max_soft = cvar("sys_memsize_physical");
38 while(me.value > 0 && texmemsize() > max_hard)
39 me.setValue(me, me.value - 1);
41 // TODO also check the soft limit!
42 // TODO better handling than clamping the slider!
44 void XonoticPicmipSlider_draw(entity me)
47 SUPER(XonoticPicmipSlider).draw(me);