VM_SAFEPARMCOUNT(2, VM_CL_setmodel);
e = PRVM_G_EDICT(OFS_PARM0);
+ e->fields.client->modelindex = 0;
+ e->fields.client->model = 0;
+
m = PRVM_G_STRING(OFS_PARM1);
+ mod = NULL;
for (i = 0;i < MAX_MODELS && cl.csqc_model_precache[i];i++)
{
if (!strcmp(cl.csqc_model_precache[i]->name, m))
{
- e->fields.client->model = PRVM_SetEngineString(cl.csqc_model_precache[i]->name);
+ mod = cl.csqc_model_precache[i];
+ e->fields.client->model = PRVM_SetEngineString(mod->name);
e->fields.client->modelindex = -(i+1);
- return;
+ break;
}
}
- for (i = 0;i < MAX_MODELS;i++)
- {
- mod = cl.model_precache[i];
- if (mod && !strcmp(mod->name, m))
+ if( !mod ) {
+ for (i = 0;i < MAX_MODELS;i++)
{
- e->fields.client->model = PRVM_SetEngineString(mod->name);
- e->fields.client->modelindex = i;
- return;
+ mod = cl.model_precache[i];
+ if (mod && !strcmp(mod->name, m))
+ {
+ e->fields.client->model = PRVM_SetEngineString(mod->name);
+ e->fields.client->modelindex = i;
+ break;
+ }
}
}
- e->fields.client->modelindex = 0;
- e->fields.client->model = 0;
- VM_Warning ("setmodel: model '%s' not precached\n", m);
-
- // TODO: check if this breaks needed consistency and maybe add a cvar for it too?? [1/10/2008 Black]
- if (mod)
- {
- SetMinMaxSize (e, mod->normalmins, mod->normalmaxs);
- }
+ if( mod ) {
+ // TODO: check if this breaks needed consistency and maybe add a cvar for it too?? [1/10/2008 Black]
+ //SetMinMaxSize (e, mod->normalmins, mod->normalmaxs);
+ }
else
+ {
SetMinMaxSize (e, vec3_origin, vec3_origin);
+ VM_Warning ("setmodel: model '%s' not precached\n", m);
+ }
}
// #4 void(entity e, vector min, vector max) setsize
r_refdef.view.frustum_y *= r_refdef.frustumscale_y;
r_refdef.view.ortho_x = scr_fov.value * (3.0 / 4.0) * (float)r_refdef.view.width / (float)r_refdef.view.height / vid_pixelheight.value;
r_refdef.view.ortho_y = scr_fov.value * (3.0 / 4.0);
+ r_refdef.view.clear = true;
// FIXME: restore cl.csqc_origin
// FIXME: restore cl.csqc_angles
cl.csqc_vidvars.drawworld = true;
case VF_PERSPECTIVE:
r_refdef.view.useperspective = k != 0;
break;
+ case VF_CLEARSCREEN:
+ r_refdef.view.clear = k ? true : false;
+ break;
default:
PRVM_G_FLOAT(OFS_RETURN) = 0;
VM_Warning("VM_CL_R_SetView : unknown parm %i\n", c);
}
// #443 void(entity e, entity tagentity, string tagname) setattachment
-static void VM_CL_setattachment (void)
+void VM_CL_setattachment (void)
{
prvm_edict_t *e;
prvm_edict_t *tagentity;
}
// #451 float(entity ent, string tagname) gettagindex (DP_QC_GETTAGINFO)
-static void VM_CL_gettagindex (void)
+void VM_CL_gettagindex (void)
{
prvm_edict_t *ent;
const char *tag_name;
}
// #452 vector(entity ent, float tagindex) gettaginfo (DP_QC_GETTAGINFO)
-static void VM_CL_gettaginfo (void)
+void VM_CL_gettaginfo (void)
{
prvm_edict_t *e;
int tagindex;
VM_InitPolygons(polys);
if (polys->begin_active)
{
- VM_Warning("VM_CL_R_PolygonBegin: called twice without VM_CL_R_PolygonEnd after first\n");
+ VM_Warning("VM_CL_R_PolygonBegin: called twice without VM_CL_R_PolygonBegin after first\n");
return;
}
picname = PRVM_G_STRING(OFS_PARM0);
- polys->begin_texture = picname[0] ? Draw_CachePic(picname, true)->tex : r_texture_white;
+ polys->begin_texture = picname[0] ? Draw_CachePic (picname)->tex : r_texture_white;
polys->begin_drawflag = (int)PRVM_G_FLOAT(OFS_PARM1);
polys->begin_vertices = 0;
polys->begin_active = true;
Con_Printf("Debug_PolygonBegin: called twice without Debug_PolygonEnd after first\n");
return;
}
- debugPolys.begin_texture = picname[0] ? Draw_CachePic(picname, true)->tex : r_texture_white;
+ debugPolys.begin_texture = picname[0] ? Draw_CachePic (picname)->tex : r_texture_white;
debugPolys.begin_drawflag = drawflag;
debugPolys.begin_vertices = 0;
debugPolys.begin_active = true;