From c4079451039f769eb5444575fad05d4f5925d99e Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 16 Aug 2011 12:01:11 +0000 Subject: [PATCH] allow calls to drawstring without the flag parameter, as per CSQC spec git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11279 d7cf8633-e32d-0410-b094-e92efae38249 --- clvm_cmds.c | 2 +- prvm_cmds.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/clvm_cmds.c b/clvm_cmds.c index 5397c8bb..a1b3b813 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -4389,7 +4389,7 @@ VM_precache_pic, // #317 string(string name, float trywad) precache_pic (EXT_ VM_getimagesize, // #318 vector(string picname) draw_getimagesize (EXT_CSQC) VM_freepic, // #319 void(string name) freepic (EXT_CSQC) VM_drawcharacter, // #320 float(vector position, float character, vector scale, vector rgb, float alpha, float flag) drawcharacter (EXT_CSQC) -VM_drawstring, // #321 float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring (EXT_CSQC) +VM_drawstring, // #321 float(vector position, string text, vector scale, vector rgb, float alpha[, float flag]) drawstring (EXT_CSQC, DP_CSQC) VM_drawpic, // #322 float(vector position, string pic, vector size, vector rgb, float alpha, float flag) drawpic (EXT_CSQC) VM_drawfill, // #323 float(vector position, vector size, vector rgb, float alpha, float flag) drawfill (EXT_CSQC) VM_drawsetcliparea, // #324 void(float x, float y, float width, float height) drawsetcliparea diff --git a/prvm_cmds.c b/prvm_cmds.c index c0b34d4a..e0bccf8e 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -3355,22 +3355,23 @@ void VM_drawcharacter(void) ========= VM_drawstring -float drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) +float drawstring(vector position, string text, vector scale, vector rgb, float alpha[, float flag]) ========= */ void VM_drawstring(void) { float *pos,*scale,*rgb; const char *string; - int flag; + int flag = 0; float sx, sy; - VM_SAFEPARMCOUNT(6,VM_drawstring); + VM_SAFEPARMCOUNTRANGE(5,6,VM_drawstring); string = PRVM_G_STRING(OFS_PARM1); pos = PRVM_G_VECTOR(OFS_PARM0); scale = PRVM_G_VECTOR(OFS_PARM2); rgb = PRVM_G_VECTOR(OFS_PARM3); - flag = (int)PRVM_G_FLOAT(OFS_PARM5); + if (prog->argc >= 6) + flag = (int)PRVM_G_FLOAT(OFS_PARM5); if(flag < DRAWFLAG_NORMAL || flag >=DRAWFLAG_NUMFLAGS) { -- 2.39.2