]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'samual/menu_updates' of git://de.git.xonotic.org/xonotic/xonotic-data...
authorRudolf Polzer <divverent@alientrap.org>
Tue, 24 Jan 2012 21:47:51 +0000 (22:47 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 24 Jan 2012 21:47:51 +0000 (22:47 +0100)
qcsrc/dpdefs/csprogsdefs.qc
qcsrc/dpdefs/menudefs.qc
qcsrc/menu/draw.qc
qcsrc/menu/draw.qh
qcsrc/menu/xonotic/gametypelist.c

index 5fd52179c6f8221f16d06fff39d77f002fde8db6..2d376d4fe41cf0f16832856850e3239cda1b72f5 100644 (file)
@@ -1077,6 +1077,15 @@ float MOVETYPE_FLY_WORLDONLY = 33;
 //description:
 //like MOVETYPE_FLY, but does all traces with MOVE_WORLDONLY, and is ignored by MOVETYPE_PUSH. Should only be combined with SOLID_NOT and SOLID_TRIGGER.
 
+//DP_PRECACHE_PIC_FLAGS
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+float PRECACHE_PIC_FROMWAD = 1; // this one actually is part of EXT_CSQC
+float PRECACHE_PIC_NOTPERSISTENT = 2; // picture may get deallocated when unused
+float PRECACHE_PIC_MIPMAP = 8; // mipmap the texture for possibly better downscaling at memory expense
+//notes: these constants are given as optional second argument to precache_pic()
+
 //DP_QC_TRACE_MOVETYPE_WORLDONLY
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
index 74bfdc8602384bd24bdbce931a55f51e357a599c..ad8666ed3548786759d2faeb6b9c59dcd5711377 100644 (file)
@@ -293,7 +293,7 @@ void        WriteEntity(entity data, float dest, float desto) = #408;
 //////////////////////////////////////////////////
 
 float  iscachedpic(string name)        = #451;
-string precache_pic(string name)       = #452;
+string precache_pic(string name, ...)  = #452;
 void   freepic(string name)            = #453;
 
 float  drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454;
@@ -404,6 +404,15 @@ float(string s1, string s2, float len) strncmp = #228;
 float(string s1, string s2) strcasecmp = #229;
 float(string s1, string s2, float len) strncasecmp = #230;
 
+//DP_PRECACHE_PIC_FLAGS
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+float PRECACHE_PIC_FROMWAD = 1; // this one actually is part of EXT_CSQC
+float PRECACHE_PIC_NOTPERSISTENT = 2; // picture may get deallocated when unused
+float PRECACHE_PIC_MIPMAP = 8; // mipmap the texture for possibly better downscaling at memory expense
+//notes: these constants are given as optional second argument to precache_pic()
+
 //DP_QC_CRC16
 //idea: div0
 //darkplaces implementation: div0
index 7fe4aea3bdc38e57c99eb976b90326f8658198ca..1f223f281affc2bc9ba5a42e90c1b3b3160f8981 100644 (file)
@@ -59,6 +59,12 @@ string draw_PreloadPicture(string pic)
        return precache_pic(pic);
 }
 
+string draw_PreloadPictureWithFlags(string pic, float f)
+{
+       pic = draw_UseSkinFor(pic);
+       return precache_pic(pic, f);
+}
+
 void draw_Picture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha)
 {
        if(theSize_x == 0 || theSize_y <= 0) // no default sizing please
index 0f5811713d6f3c1b66f3f38ae2742d3bb2b810ed..301a5f440f80fbf768c77182b3f24e2207c64f5a 100644 (file)
@@ -15,6 +15,7 @@ void draw_setMousePointer(string pic, vector theSize, vector theOffset);
 void draw_drawMousePointer(vector where);
 
 string draw_PreloadPicture(string pic);
+string draw_PreloadPictureWithFlags(string pic, float f);
 void draw_ButtonPicture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha);
 void draw_VertButtonPicture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha);
 void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha, vector theBorderSize);
index dbb9c3eff1fd4659f2f300e613efcf64faf5a136..531c761f637d124dccf7b46f0cc24605b2a9d2f5 100644 (file)
@@ -30,9 +30,15 @@ entity makeXonoticGametypeList(void)
 }
 void XonoticGametypeList_configureXonoticGametypeList(entity me)
 {
-       me.loadCvars(me);
+       float i;
        me.configureXonoticListBox(me);
        me.nItems = GameType_GetCount();
+
+       // we want the pics mipmapped
+       for(i = 0; i < GameType_GetCount(); ++i)
+               draw_PreloadPictureWithFlags(GameType_GetIcon(i), PRECACHE_PIC_MIPMAP);
+
+       me.loadCvars(me);
 }
 void XonoticGametypeList_setSelected(entity me, float i)
 {