//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
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;
//////////////////////////////////////////////////
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;
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
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
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;
}