]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - clvm_cmds.c
Revert the cvar alias system, as a checkpoint pending an overhaul
[xonotic/darkplaces.git] / clvm_cmds.c
index efbae27c981b292a522f20872399f766b05bc7aa..56e4517fbfb65641f07feb45a96dd66cef5aff49 100644 (file)
@@ -1860,6 +1860,9 @@ static void VM_CL_copyentity (prvm_prog_t *prog)
                return;
        }
        memcpy(out->fields.fp, in->fields.fp, prog->entityfields * sizeof(prvm_vec_t));
+
+       if (VectorCompare(PRVM_clientedictvector(out, absmin), PRVM_clientedictvector(out, absmax)))
+               return;
        CL_LinkEdict(out);
 }
 
@@ -1869,7 +1872,7 @@ static void VM_CL_copyentity (prvm_prog_t *prog)
 static void VM_CL_effect (prvm_prog_t *prog)
 {
 #if 1
-       Con_Printf("WARNING: VM_CL_effect not implemented\n"); // FIXME: this needs to take modelname not modelindex, the csqc defs has it as string and so it shall be
+       Con_Warnf("WARNING: VM_CL_effect not implemented\n"); // FIXME: this needs to take modelname not modelindex, the csqc defs has it as string and so it shall be
 #else
        vec3_t org;
        VM_SAFEPARMCOUNT(5, VM_CL_effect);
@@ -3307,6 +3310,8 @@ static void VM_CL_R_PolygonBegin (prvm_prog_t *prog)
        // we need to remember whether this is a 2D or 3D mesh we're adding to
        mod = draw2d ? CL_Mesh_UI() : CL_Mesh_Scene();
        prog->polygonbegin_model = mod;
+       if (texname == NULL || texname[0] == 0)
+               texname = "$whiteimage";
        strlcpy(prog->polygonbegin_texname, texname, sizeof(prog->polygonbegin_texname));
        prog->polygonbegin_drawflags = drawflags;
        prog->polygonbegin_numvertices = 0;
@@ -3359,6 +3364,8 @@ static void VM_CL_R_PolygonEnd (prvm_prog_t *prog)
        float *o;
        dp_model_t *mod = prog->polygonbegin_model;
        msurface_t *surf;
+       texture_t *tex;
+       int materialflags;
 
        VM_SAFEPARMCOUNT(0, VM_CL_R_PolygonEnd);
        if (!mod)
@@ -3380,7 +3387,15 @@ static void VM_CL_R_PolygonEnd (prvm_prog_t *prog)
        }
 
        // create the surface, looking up the best matching texture/shader
-       surf = Mod_Mesh_AddSurface(mod, Mod_Mesh_GetTexture(mod, prog->polygonbegin_texname, prog->polygonbegin_drawflags, TEXF_ALPHA, MATERIALFLAG_WALL | (hascolor ? MATERIALFLAG_VERTEXCOLOR : 0) | (hasalpha ? MATERIALFLAG_ALPHAGEN_VERTEX | MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW : 0)), false);
+       materialflags = MATERIALFLAG_WALL;
+       if (csqc_polygons_defaultmaterial_nocullface.integer)
+               materialflags |= MATERIALFLAG_NOCULLFACE;
+       if (hascolor)
+               materialflags |= MATERIALFLAG_VERTEXCOLOR;
+       if (hasalpha)
+               materialflags |= MATERIALFLAG_ALPHAGEN_VERTEX | MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW;
+       tex = Mod_Mesh_GetTexture(mod, prog->polygonbegin_texname, prog->polygonbegin_drawflags, TEXF_ALPHA, materialflags);
+       surf = Mod_Mesh_AddSurface(mod, tex, false);
        // create triangle fan
        for (i = 0; i < prog->polygonbegin_numvertices; i++)
        {