]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
allow drawpic calls without flag parameter, as per CSQC spec
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 16 Aug 2011 12:04:15 +0000 (12:04 +0000)
committerRudolf Polzer <divVerent@xonotic.org>
Tue, 16 Aug 2011 20:41:17 +0000 (22:41 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11280 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=cf0da2edf701e03cd2b7447523a850515005d1eb

clvm_cmds.c
prvm_cmds.c

index 227d22097367f790784f73553d252c08c9ced472..8a83bd132bd1c79fd7004fe21dd661cf3b659478 100644 (file)
@@ -4390,7 +4390,7 @@ 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, DP_CSQC)
-VM_drawpic,                                            // #322 float(vector position, string pic, vector size, vector rgb, float alpha, float flag) drawpic (EXT_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
 VM_drawresetcliparea,                  // #325 void(void) drawresetcliparea
index e0bccf8eebac3d09f3984ba07d40f7aef461e4da..703280f37f004bad31df22f64ad6b61813bf87d1 100644 (file)
@@ -3699,9 +3699,9 @@ void VM_drawpic(void)
 {
        const char *picname;
        float *size, *pos, *rgb;
-       int flag;
+       int flag = 0;
 
-       VM_SAFEPARMCOUNT(6,VM_drawpic);
+       VM_SAFEPARMCOUNTRANGE(5,6,VM_drawpic);
 
        picname = PRVM_G_STRING(OFS_PARM1);
        VM_CheckEmptyString (picname);
@@ -3717,7 +3717,8 @@ void VM_drawpic(void)
        pos = PRVM_G_VECTOR(OFS_PARM0);
        size = 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)
        {