]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_cmds.c
turn "z value discarded" into VM_Warnings so one can backtrace them
[xonotic/darkplaces.git] / prvm_cmds.c
index b172ea6f75b8370afa3f5e541f1c3fda80a47968..763942e7724168d2baafdcd6a50e4af031d40338 100644 (file)
@@ -96,7 +96,7 @@ void VM_FrameBlendFromFrameGroupBlend(frameblend_t *frameblend, const framegroup
 
        memset(blend, 0, MAX_FRAMEBLENDS * sizeof(*blend));
 
-       if (!model || !model->surfmesh.isanimated)
+       if (!model || !model->surfmesh.isanimated || model->numframes <= 1)
        {
                blend[0].lerp = 1;
                return;
@@ -109,7 +109,8 @@ void VM_FrameBlendFromFrameGroupBlend(frameblend_t *frameblend, const framegroup
                f = g->frame;
                if ((unsigned int)f >= (unsigned int)numframes)
                {
-                       Con_DPrintf("VM_FrameBlendFromFrameGroupBlend: no such frame %d in model %s\n", f, model->name);
+                       if (developer_extra.integer)
+                               Con_DPrintf("VM_FrameBlendFromFrameGroupBlend: no such frame %d in model %s\n", f, model->name);
                        f = 0;
                }
                d = lerp = g->lerp;
@@ -2975,7 +2976,7 @@ void VM_parseentitydata(prvm_prog_t *prog)
        data = PRVM_G_STRING(OFS_PARM1);
 
        // parse the opening brace
-       if (!COM_ParseToken_Simple(&data, false, false) || com_token[0] != '{' )
+       if (!COM_ParseToken_Simple(&data, false, false, true) || com_token[0] != '{' )
                prog->error_cmd("VM_parseentitydata: %s: Couldn't parse entity data:\n%s", prog->name, data );
 
        PRVM_ED_ParseEdict (prog, data, ent);
@@ -3330,7 +3331,7 @@ void VM_drawcharacter(prvm_prog_t *prog)
        }
 
        if(pos[2] || scale[2])
-               Con_Printf("VM_drawcharacter: z value%c from %s discarded\n",(pos[2] && scale[2]) ? 's' : 0,((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale")));
+               VM_Warning("VM_drawcharacter: z value%c from %s discarded\n",(pos[2] && scale[2]) ? 's' : 0,((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale")));
 
        if(!scale[0] || !scale[1])
        {
@@ -3381,7 +3382,7 @@ void VM_drawstring(prvm_prog_t *prog)
        }
 
        if(pos[2] || scale[2])
-               Con_Printf("VM_drawstring: z value%s from %s discarded\n",(pos[2] && scale[2]) ? "s" : " ",((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale")));
+               VM_Warning("VM_drawstring: z value%s from %s discarded\n",(pos[2] && scale[2]) ? "s" : " ",((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale")));
 
        getdrawfontscale(prog, &sx, &sy);
        DrawQ_String_Scale(pos[0], pos[1], string, 0, scale[0], scale[1], sx, sy, rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag, NULL, true, getdrawfont(prog));
@@ -3444,7 +3445,7 @@ void VM_drawcolorcodedstring(prvm_prog_t *prog)
        }
 
        if(pos[2] || scale[2])
-               Con_Printf("VM_drawcolorcodedstring: z value%s from %s discarded\n",(pos[2] && scale[2]) ? "s" : " ",((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale")));
+               VM_Warning("VM_drawcolorcodedstring: z value%s from %s discarded\n",(pos[2] && scale[2]) ? "s" : " ",((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale")));
 
        getdrawfontscale(prog, &sx, &sy);
        DrawQ_String_Scale(pos[0], pos[1], string, 0, scale[0], scale[1], sx, sy, rgb[0], rgb[1], rgb[2], alpha, flag, NULL, false, getdrawfont(prog));
@@ -3719,7 +3720,7 @@ void VM_drawpic(prvm_prog_t *prog)
        }
 
        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")));
+               VM_Warning("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_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;
@@ -3764,7 +3765,7 @@ void VM_drawrotpic(prvm_prog_t *prog)
        }
 
        if(pos[2] || size[2] || org[2])
-               Con_Printf("VM_drawrotpic: z value from pos/size/org discarded\n");
+               VM_Warning("VM_drawrotpic: z value from pos/size/org discarded\n");
 
        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;
@@ -3812,7 +3813,7 @@ void VM_drawsubpic(prvm_prog_t *prog)
        }
 
        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")));
+               VM_Warning("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_Flags (picname, CACHEPICFLAG_NOTPERSISTENT),
                size[0], size[1],
@@ -3852,7 +3853,7 @@ void VM_drawfill(prvm_prog_t *prog)
        }
 
        if(pos[2] || size[2])
-               Con_Printf("VM_drawfill: z value%s from %s discarded\n",(pos[2] && size[2]) ? "s" : " ",((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
+               VM_Warning("VM_drawfill: z value%s from %s discarded\n",(pos[2] && size[2]) ? "s" : " ",((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
 
        DrawQ_Fill(pos[0], pos[1], size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM3), flag);
        PRVM_G_FLOAT(OFS_RETURN) = 1;