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);
}
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);
// 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;
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)
}
// 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++)
{