]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_cmds.c
Add more CHECKGLERROR calls, and clean up a few obsolete code scraps.
[xonotic/darkplaces.git] / prvm_cmds.c
index af6d27b939ec58b16b142e9170d7ce55f634d1d0..01787f46e9df671cc5655d230d979cd4319fde14 100644 (file)
@@ -3273,7 +3273,7 @@ string    precache_pic(string pic)
 void VM_precache_pic(prvm_prog_t *prog)
 {
        const char      *s;
-       int flags = 0;
+       int flags = CACHEPICFLAG_FAILONMISSING;
 
        VM_SAFEPARMCOUNTRANGE(1, 2, VM_precache_pic);
 
@@ -3350,6 +3350,9 @@ void VM_drawcharacter(prvm_prog_t *prog)
        float sx, sy;
        VM_SAFEPARMCOUNT(6,VM_drawcharacter);
 
+       // polygonbegin without draw2d arg has to guess
+       prog->polygonbegin_guess2d = true;
+
        character = (char) PRVM_G_FLOAT(OFS_PARM1);
        if(character == 0)
        {
@@ -3400,6 +3403,9 @@ void VM_drawstring(prvm_prog_t *prog)
        float sx, sy;
        VM_SAFEPARMCOUNTRANGE(5,6,VM_drawstring);
 
+       // polygonbegin without draw2d arg has to guess
+       prog->polygonbegin_guess2d = true;
+
        string = PRVM_G_STRING(OFS_PARM1);
        pos = PRVM_G_VECTOR(OFS_PARM0);
        scale = PRVM_G_VECTOR(OFS_PARM2);
@@ -3449,6 +3455,9 @@ void VM_drawcolorcodedstring(prvm_prog_t *prog)
 
        VM_SAFEPARMCOUNTRANGE(5,6,VM_drawcolorcodedstring);
 
+       // polygonbegin without draw2d arg has to guess
+       prog->polygonbegin_guess2d = true;
+
        if (prog->argc == 6) // full 6 parms, like normal drawstring
        {
                pos = PRVM_G_VECTOR(OFS_PARM0);
@@ -3734,6 +3743,9 @@ void VM_drawpic(prvm_prog_t *prog)
 
        VM_SAFEPARMCOUNTRANGE(5,6,VM_drawpic);
 
+       // polygonbegin without draw2d arg has to guess
+       prog->polygonbegin_guess2d = true;
+
        picname = PRVM_G_STRING(OFS_PARM1);
        VM_CheckEmptyString(prog, picname);
 
@@ -3779,6 +3791,9 @@ void VM_drawrotpic(prvm_prog_t *prog)
 
        VM_SAFEPARMCOUNT(8,VM_drawrotpic);
 
+       // polygonbegin without draw2d arg has to guess
+       prog->polygonbegin_guess2d = true;
+
        picname = PRVM_G_STRING(OFS_PARM1);
        VM_CheckEmptyString(prog, picname);
 
@@ -3825,6 +3840,9 @@ void VM_drawsubpic(prvm_prog_t *prog)
 
        VM_SAFEPARMCOUNT(8,VM_drawsubpic);
 
+       // polygonbegin without draw2d arg has to guess
+       prog->polygonbegin_guess2d = true;
+
        picname = PRVM_G_STRING(OFS_PARM2);
        VM_CheckEmptyString(prog, picname);
 
@@ -3878,6 +3896,8 @@ void VM_drawfill(prvm_prog_t *prog)
 
        VM_SAFEPARMCOUNT(5,VM_drawfill);
 
+       // polygonbegin without draw2d arg has to guess
+       prog->polygonbegin_guess2d = true;
 
        pos = PRVM_G_VECTOR(OFS_PARM0);
        size = PRVM_G_VECTOR(OFS_PARM1);
@@ -3910,6 +3930,9 @@ void VM_drawsetcliparea(prvm_prog_t *prog)
        float x,y,w,h;
        VM_SAFEPARMCOUNT(4,VM_drawsetcliparea);
 
+       // polygonbegin without draw2d arg has to guess
+       prog->polygonbegin_guess2d = true;
+
        x = bound(0, PRVM_G_FLOAT(OFS_PARM0), vid_conwidth.integer);
        y = bound(0, PRVM_G_FLOAT(OFS_PARM1), vid_conheight.integer);
        w = bound(0, PRVM_G_FLOAT(OFS_PARM2) + PRVM_G_FLOAT(OFS_PARM0) - x, (vid_conwidth.integer  - x));
@@ -3929,6 +3952,9 @@ void VM_drawresetcliparea(prvm_prog_t *prog)
 {
        VM_SAFEPARMCOUNT(0,VM_drawresetcliparea);
 
+       // polygonbegin without draw2d arg has to guess
+       prog->polygonbegin_guess2d = true;
+
        DrawQ_ResetClipArea();
 }
 
@@ -4358,6 +4384,10 @@ void VM_drawline (prvm_prog_t *prog)
        unsigned char   flags;
 
        VM_SAFEPARMCOUNT(6, VM_drawline);
+
+       // polygonbegin without draw2d arg has to guess
+       prog->polygonbegin_guess2d = true;
+
        width   = PRVM_G_FLOAT(OFS_PARM0);
        c1              = PRVM_G_VECTOR(OFS_PARM1);
        c2              = PRVM_G_VECTOR(OFS_PARM2);