static qboolean checkextension(const char *name)
{
int len;
- char *e, *start;
+ const char *e, *start;
len = (int)strlen(name);
for (e = prog->extensionstring;*e;e++)
VM_CheckEmptyString (s);
// AK Draw_CachePic is supposed to always return a valid pointer
- if( Draw_CachePic_Flags(s, CACHEPICFLAG_NOTPERSISTENT)->tex == r_texture_notexture )
+ if( Draw_CachePic_Flags(s, 0)->tex == r_texture_notexture )
PRVM_G_INT(OFS_RETURN) = OFS_NULL;
}
if(pos[2] || size[2])
Con_Printf("VM_drawpic: z value%s from %s discarded\n",(pos[2] && size[2]) ? "s" : " ",((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
- DrawQ_Pic(pos[0], pos[1], Draw_CachePic (picname), size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag);
+ DrawQ_Pic(pos[0], pos[1], Draw_CachePic_Flags (picname, CACHEPICFLAG_NOTPERSISTENT), size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag);
PRVM_G_FLOAT(OFS_RETURN) = 1;
}
/*
if(pos[2] || size[2] || org[2])
Con_Printf("VM_drawrotpic: z value from pos/size/org discarded\n");
- DrawQ_RotPic(pos[0], pos[1], Draw_CachePic(picname), size[0], size[1], org[0], org[1], PRVM_G_FLOAT(OFS_PARM4), rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM6), flag);
+ DrawQ_RotPic(pos[0], pos[1], Draw_CachePic_Flags(picname, CACHEPICFLAG_NOTPERSISTENT), size[0], size[1], org[0], org[1], PRVM_G_FLOAT(OFS_PARM4), rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM6), flag);
PRVM_G_FLOAT(OFS_RETURN) = 1;
}
/*
if(pos[2] || size[2])
Con_Printf("VM_drawsubpic: z value%s from %s discarded\n",(pos[2] && size[2]) ? "s" : " ",((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
- DrawQ_SuperPic(pos[0], pos[1], Draw_CachePic (picname),
+ DrawQ_SuperPic(pos[0], pos[1], Draw_CachePic_Flags (picname, CACHEPICFLAG_NOTPERSISTENT),
size[0], size[1],
srcPos[0], srcPos[1], rgb[0], rgb[1], rgb[2], alpha,
srcPos[0] + srcSize[0], srcPos[1], rgb[0], rgb[1], rgb[2], alpha,
=========
VM_findkeysforcommand
-string findkeysforcommand(string command)
+string findkeysforcommand(string command, float bindmap)
the returned string is an altstring
=========
if(prog->argc == 2)
bindmap = bound(-1, PRVM_G_FLOAT(OFS_PARM1), MAX_BINDMAPS-1);
else
- bindmap = -1;
+ bindmap = 0; // consistent to "bind"
VM_CheckEmptyString(cmd);
{
VM_SAFEPARMCOUNT( 1, VM_keynumtostring );
- PRVM_G_INT(OFS_RETURN) = Key_StringToKeynum(PRVM_G_STRING(OFS_PARM0));
+ PRVM_G_FLOAT(OFS_RETURN) = Key_StringToKeynum(PRVM_G_STRING(OFS_PARM0));
}
/*
=========
VM_getkeybind
-string getkeybind(float key)
+string getkeybind(float key, float bindmap)
=========
*/
void VM_getkeybind (void)
if(prog->argc == 2)
bindmap = bound(-1, PRVM_G_FLOAT(OFS_PARM1), MAX_BINDMAPS-1);
else
- bindmap = -1;
+ bindmap = 0; // consistent to "bind"
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(Key_GetBind((int)PRVM_G_FLOAT(OFS_PARM0), bindmap));
}
+/*
+=========
+VM_setkeybind
+
+float setkeybind(float key, string cmd, float bindmap)
+=========
+*/
+void VM_setkeybind (void)
+{
+ int bindmap;
+ VM_SAFEPARMCOUNTRANGE(2, 3, VM_CL_setkeybind);
+ if(prog->argc == 3)
+ bindmap = bound(-1, PRVM_G_FLOAT(OFS_PARM2), MAX_BINDMAPS-1);
+ else
+ bindmap = 0; // consistent to "bind"
+
+ PRVM_G_FLOAT(OFS_RETURN) = 0;
+ if(Key_SetBinding((int)PRVM_G_FLOAT(OFS_PARM0), bindmap, PRVM_G_STRING(OFS_PARM1)))
+ PRVM_G_FLOAT(OFS_RETURN) = 1;
+}
+
+/*
+=========
+VM_getbindmap
+
+vector getbindmaps()
+=========
+*/
+void VM_getbindmaps (void)
+{
+ int fg, bg;
+ VM_SAFEPARMCOUNT(0, VM_CL_getbindmap);
+ Key_GetBindMap(&fg, &bg);
+ PRVM_G_VECTOR(OFS_RETURN)[0] = fg;
+ PRVM_G_VECTOR(OFS_RETURN)[1] = bg;
+ PRVM_G_VECTOR(OFS_RETURN)[2] = 0;
+}
+
+/*
+=========
+VM_setbindmap
+
+float setbindmaps(vector bindmap)
+=========
+*/
+void VM_setbindmaps (void)
+{
+ VM_SAFEPARMCOUNT(1, VM_CL_setbindmap);
+ PRVM_G_FLOAT(OFS_RETURN) = 0;
+ if(PRVM_G_VECTOR(OFS_PARM0)[2] == 0)
+ if(Key_SetBindMap((int)PRVM_G_VECTOR(OFS_PARM0)[0], (int)PRVM_G_VECTOR(OFS_PARM0)[1]))
+ PRVM_G_FLOAT(OFS_RETURN) = 1;
+}
+
// CL_Video interface functions
/*