]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
don't compare texflags in Draw_CachePic_Flags simply because usage of pics doesn...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 24 Jan 2012 21:45:05 +0000 (21:45 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 24 Jan 2012 21:50:21 +0000 (22:50 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11656 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=679746a7d166223f19e4fa34c9b61e6db3cbf8c6

dpdefs/csprogsdefs.qc
dpdefs/menudefs.qc
gl_draw.c
prvm_cmds.c

index 623fb01c781a6db13f031fb69c6a16dcb3c307e4..d3348bc50930a311790987ebd3291733c0bb1438 100644 (file)
@@ -1077,6 +1077,16 @@ 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_NOCLAMP = 4; // do not clamp to edge
+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
@@ -1410,3 +1420,10 @@ float trace_networkentity;
 const float RF_FULLBRIGHT      = 256;
 const float RF_NOSHADOW        = 512;
 float RF_DYNAMICMODELLIGHT = 8192;
+
+float gettaginfo_parent;
+string gettaginfo_name;
+vector gettaginfo_offset;
+vector gettaginfo_forward;
+vector gettaginfo_right;
+vector gettaginfo_up;
index 1a68489d17a4e1c306b139de2bce53d93206a6a3..bf22931940562b04d47685c940b405142f8ca1b4 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,16 @@ 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_NOCLAMP = 4; // do not clamp to edge
+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
@@ -436,6 +446,15 @@ float(float bufhandle, string str, float order) bufstr_add = #448;
 void(float bufhandle, float string_index) bufstr_free = #449;
 void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517;
 
+//DP_QC_STRING_CASE_FUNCTIONS
+//idea: Dresk
+//darkplaces implementation: LordHavoc / Dresk
+//builtin definitions:
+string(string s) strtolower = #480; // returns the passed in string in pure lowercase form
+string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form
+//description:
+//provides simple string uppercase and lowercase functions
+
 //DP_QC_CVAR_DESCRIPTION
 //idea: divVerent
 //DarkPlaces implementation: divVerent
index 127a0b377c8c30fc299255750095d971a8c78cae..4cea94e9741b964e917cc344ef187c8fb4c22430 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -343,7 +343,8 @@ cachepic_t *Draw_CachePic_Flags(const char *path, unsigned int cachepicflags)
                        // if it was created (or replaced) by Draw_NewPic, just return it
                        if(pic->flags & CACHEPICFLAG_NEWPIC)
                                return pic;
-                       if (!((pic->texflags ^ texflags) & ~(TEXF_COMPRESS))) // ignore TEXF_COMPRESS when comparing, because fallback pics remove the flag
+                       // if (!((pic->texflags ^ texflags) & ~(TEXF_COMPRESS))) // ignore TEXF_COMPRESS when comparing, because fallback pics remove the flag
+                       // better don't compare texflags at all, because draw operations have no way to specify the texflags
                        {
                                if(!(cachepicflags & CACHEPICFLAG_NOTPERSISTENT))
                                {
index c6c930a0e7d6fc44964220d4f7d742379dda08de..4e9cd325edc68841b1ddd61c42e7ba05e105122b 100644 (file)
@@ -3241,18 +3241,34 @@ VM_precache_pic
 string precache_pic(string pic)
 =========
 */
+#define PRECACHE_PIC_FROMWAD 1 /* FTEQW, not supported here */
+#define PRECACHE_PIC_NOTPERSISTENT 2
+#define PRECACHE_PIC_NOCLAMP 4
+#define PRECACHE_PIC_MIPMAP 8
 void VM_precache_pic(prvm_prog_t *prog)
 {
        const char      *s;
+       int flags = 0;
 
-       VM_SAFEPARMCOUNT(1, VM_precache_pic);
+       VM_SAFEPARMCOUNTRANGE(1, 2, VM_precache_pic);
 
        s = PRVM_G_STRING(OFS_PARM0);
        PRVM_G_INT(OFS_RETURN) = PRVM_G_INT(OFS_PARM0);
        VM_CheckEmptyString(prog, s);
 
+       if(prog->argc >= 2)
+       {
+               int f = PRVM_G_FLOAT(OFS_PARM1);
+               if(f & PRECACHE_PIC_NOTPERSISTENT)
+                       flags |= CACHEPICFLAG_NOTPERSISTENT;
+               if(f & PRECACHE_PIC_NOCLAMP)
+                       flags |= CACHEPICFLAG_NOCLAMP;
+               if(f & PRECACHE_PIC_MIPMAP)
+                       flags |= CACHEPICFLAG_MIPMAP;
+       }
+
        // AK Draw_CachePic is supposed to always return a valid pointer
-       if( Draw_CachePic_Flags(s, 0)->tex == r_texture_notexture )
+       if( Draw_CachePic_Flags(s, flags)->tex == r_texture_notexture )
                PRVM_G_INT(OFS_RETURN) = OFS_NULL;
 }