*/
dp_font_t *FindFont(const char *title, qboolean allocate_new);
-void LoadFont(qboolean override, const char *name, dp_font_t *fnt);
+void LoadFont(qboolean override, const char *name, dp_font_t *fnt, float scale, float voffset);
void VM_loadfont(void)
{
const char *fontname, *filelist, *sizes, *c, *cm;
char mainfont[MAX_QPATH];
int i, numsizes;
- float sz;
+ float sz, scale, voffset;
dp_font_t *f;
- VM_SAFEPARMCOUNTRANGE(3,4,VM_loadfont);
+ VM_SAFEPARMCOUNTRANGE(3,6,VM_loadfont);
fontname = PRVM_G_STRING(OFS_PARM0);
if (!fontname[0])
numsizes++;
}
+ // additional scale/hoffset parms
+ scale = 1;
+ voffset = 0;
+ if (prog->argc >= 5)
+ {
+ scale = PRVM_G_FLOAT(OFS_PARM4);
+ if (scale <= 0)
+ scale = 1;
+ }
+ if (prog->argc >= 6)
+ voffset = PRVM_G_FLOAT(OFS_PARM5);
+
// load
- LoadFont(true, mainfont, f);
+ LoadFont(true, mainfont, f, scale, voffset);
// return index of loaded font
PRVM_G_FLOAT(OFS_RETURN) = (f - dp_fonts.f);
PRVM_G_INT(OFS_RETURN) = Key_StringToKeynum(PRVM_G_STRING(OFS_PARM0));
}
+/*
+=========
+VM_getkeybind
+
+string getkeybind(float key)
+=========
+*/
+const char *Key_GetBind (int key);
+void VM_getkeybind (void)
+{
+ VM_SAFEPARMCOUNT(1, VM_CL_getkeybind);
+ PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(Key_GetBind((int)PRVM_G_FLOAT(OFS_PARM0)));
+}
+
// CL_Video interface functions
/*
int width, precision, thisarg, flags;
char formatbuf[16];
char *f;
- qboolean isfloat;
+ int isfloat;
static int dummyivec[3] = {0, 0, 0};
static float dummyvec[3] = {0, 0, 0};
precision = -1;
thisarg = -1;
flags = 0;
+ isfloat = -1;
// is number following?
if(*s >= '0' && *s <= '9')
}
}
- isfloat = true;
for(;;)
{
switch(*s)
{
- case 'h': isfloat = true; break;
- case 'l': isfloat = false; break;
- case 'L': isfloat = false; break;
+ case 'h': isfloat = 1; break;
+ case 'l': isfloat = 0; break;
+ case 'L': isfloat = 0; break;
case 'j': break;
case 'z': break;
case 't': break;
}
nolength:
+ // now s points to the final directive char and is no longer changed
+ if(isfloat < 0)
+ {
+ if(*s == 'i')
+ isfloat = 0;
+ else
+ isfloat = 1;
+ }
+
if(thisarg < 0)
thisarg = argpos++;
{
matrix4x4_t m, n;
getmatrix(ed, &m);
- Matrix4x4_Invert_Full(&m, &n);
+ Matrix4x4_Invert_Full(&n, &m);
Matrix4x4_Transform3x3(&n, in, out);
}