Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
slider_picmip.qc File Reference
#include "slider_picmip.qh"
Include dependency graph for slider_picmip.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

entity makeXonoticPicmipSlider ()
float texmemsize (float s3tc)
void XonoticPicmipSlider_autofix (entity me)
void XonoticPicmipSlider_configureXonoticPicmipSlider (entity me)
void XonoticPicmipSlider_draw (entity me)

Function Documentation

◆ makeXonoticPicmipSlider()

entity makeXonoticPicmipSlider ( )

Definition at line 3 of file slider_picmip.qc.

4{
6 me.configureXonoticPicmipSlider(me);
7 return me;
8}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define NEW(cname,...)
Definition oo.qh:117

References entity(), and NEW.

Referenced by XonoticEffectsSettingsTab_fill().

◆ texmemsize()

float texmemsize ( float s3tc)

Definition at line 16 of file slider_picmip.qc.

17{
18 return
19 (
20 2500 * (0.25 ** max(0, cvar("gl_picmip") + cvar("gl_picmip_other")))
21 + 1500 * (0.25 ** max(0, cvar("gl_picmip") + cvar("gl_picmip_world")))
22 ) * ((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
23}
float cvar(string name)
float max(float f,...)

References cvar(), and max().

Referenced by XonoticPicmipSlider_autofix().

◆ XonoticPicmipSlider_autofix()

void XonoticPicmipSlider_autofix ( entity me)

Definition at line 24 of file slider_picmip.qc.

25{
26 float max_hard, max_soft;
27 if(cvar("menu_picmip_bypass"))
28 return;
29 max_hard = cvar("sys_memsize_virtual");
30 max_soft = cvar("sys_memsize_physical");
31 if(max_hard > 0)
32 {
33 while(me.value > 0 && texmemsize(me.have_s3tc) > max_hard)
34 me.setValue(me, me.value - 1, autocvar_menu_animations > 0);
35 }
36 // TODO also check the soft limit!
37 // TODO better handling than clamping the slider!
38}
float autocvar_menu_animations
Definition animation.qh:3
float texmemsize(float s3tc)

References autocvar_menu_animations, cvar(), entity(), and texmemsize().

◆ XonoticPicmipSlider_configureXonoticPicmipSlider()

void XonoticPicmipSlider_configureXonoticPicmipSlider ( entity me)

Definition at line 9 of file slider_picmip.qc.

10{
11 me.configureXonoticMixedSlider(me, "gl_picmip",
12 _("Change the sharpness of the textures. Lowering it will effectively reduce texture memory usage, but make the textures appear very blurry."));
13 me.autofix(me);
14 me.have_s3tc = GL_Have_TextureCompression();
15}
bool GL_Have_TextureCompression()
Definition util.qc:20

References entity(), and GL_Have_TextureCompression().

◆ XonoticPicmipSlider_draw()

void XonoticPicmipSlider_draw ( entity me)

Definition at line 39 of file slider_picmip.qc.

40{
41 me.autofix(me);
42 SUPER(XonoticPicmipSlider).draw(me);
43}
#define SUPER(cname)
Definition oo.qh:231

References entity(), and SUPER.