int move, svent;
prvm_edict_t *ent;
+// R_TimeReport("pretraceline");
+
VM_SAFEPARMCOUNTRANGE(4, 4, VM_CL_traceline);
prog->xfunction->builtinsprofile += 30;
trace = CL_TraceLine(v1, v2, move, ent, CL_GenericHitSuperContentsMask(ent), CL_HitNetworkBrushModels(move), CL_HitNetworkPlayers(move), &svent, true);
CL_VM_SetTraceGlobals(&trace, svent);
+// R_TimeReport("traceline");
}
/*
int move, svent;
prvm_edict_t *ent;
+// R_TimeReport("pretracebox");
VM_SAFEPARMCOUNTRANGE(6, 8, VM_CL_tracebox); // allow more parameters for future expansion
prog->xfunction->builtinsprofile += 30;
trace = CL_TraceBox(v1, m1, m2, v2, move, ent, CL_GenericHitSuperContentsMask(ent), CL_HitNetworkBrushModels(move), CL_HitNetworkPlayers(move), &svent, true);
CL_VM_SetTraceGlobals(&trace, svent);
+// R_TimeReport("tracebox");
}
trace_t CL_Trace_Toss (prvm_edict_t *tossent, prvm_edict_t *ignore, int *svent)
}
-//====================================================================
-//DP_QC_GETSURFACE
-
-extern void clippointtosurface(dp_model_t *model, msurface_t *surface, vec3_t p, vec3_t out);
-
-static msurface_t *cl_getsurface(dp_model_t *model, int surfacenum)
-{
- if (surfacenum < 0 || surfacenum >= model->nummodelsurfaces)
- return NULL;
- return model->data_surfaces + surfacenum + model->firstmodelsurface;
-}
-
-// #434 float(entity e, float s) getsurfacenumpoints
-static void VM_CL_getsurfacenumpoints(void)
-{
- dp_model_t *model;
- msurface_t *surface;
- VM_SAFEPARMCOUNT(2, VM_CL_getsurfacenumpoints);
- // return 0 if no such surface
- if (!(model = CL_GetModelFromEdict(PRVM_G_EDICT(OFS_PARM0))) || !(surface = cl_getsurface(model, (int)PRVM_G_FLOAT(OFS_PARM1))))
- {
- PRVM_G_FLOAT(OFS_RETURN) = 0;
- return;
- }
-
- // note: this (incorrectly) assumes it is a simple polygon
- PRVM_G_FLOAT(OFS_RETURN) = surface->num_vertices;
-}
-
-// #435 vector(entity e, float s, float n) getsurfacepoint
-static void VM_CL_getsurfacepoint(void)
-{
- prvm_edict_t *ed;
- dp_model_t *model;
- msurface_t *surface;
- int pointnum;
- VM_SAFEPARMCOUNT(3, VM_CL_getsurfacenumpoints);
- VectorClear(PRVM_G_VECTOR(OFS_RETURN));
- ed = PRVM_G_EDICT(OFS_PARM0);
- if (!(model = CL_GetModelFromEdict(ed)) || !(surface = cl_getsurface(model, (int)PRVM_G_FLOAT(OFS_PARM1))))
- return;
- // note: this (incorrectly) assumes it is a simple polygon
- pointnum = (int)PRVM_G_FLOAT(OFS_PARM2);
- if (pointnum < 0 || pointnum >= surface->num_vertices)
- return;
- // FIXME: implement rotation/scaling
- VectorAdd(&(model->surfmesh.data_vertex3f + 3 * surface->num_firstvertex)[pointnum * 3], ed->fields.client->origin, PRVM_G_VECTOR(OFS_RETURN));
-}
-//PF_getsurfacepointattribute, // #486 vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
-// float SPA_POSITION = 0;
-// float SPA_S_AXIS = 1;
-// float SPA_T_AXIS = 2;
-// float SPA_R_AXIS = 3; // same as SPA_NORMAL
-// float SPA_TEXCOORDS0 = 4;
-// float SPA_LIGHTMAP0_TEXCOORDS = 5;
-// float SPA_LIGHTMAP0_COLOR = 6;
-// TODO: add some wrapper code and merge VM_CL/SV_getsurface* [12/16/2007 Black]
-static void VM_CL_getsurfacepointattribute(void)
-{
- prvm_edict_t *ed;
- dp_model_t *model;
- msurface_t *surface;
- int pointnum;
- int attributetype;
-
- VM_SAFEPARMCOUNT(4, VM_CL_getsurfacenumpoints);
- VectorClear(PRVM_G_VECTOR(OFS_RETURN));
- ed = PRVM_G_EDICT(OFS_PARM0);
- if (!(model = CL_GetModelFromEdict(ed)) || !(surface = cl_getsurface(model, (int)PRVM_G_FLOAT(OFS_PARM1))))
- return;
- // note: this (incorrectly) assumes it is a simple polygon
- pointnum = (int)PRVM_G_FLOAT(OFS_PARM2);
- if (pointnum < 0 || pointnum >= surface->num_vertices)
- return;
-
- // FIXME: implement rotation/scaling
- attributetype = (int) PRVM_G_FLOAT(OFS_PARM3);
-
- switch( attributetype ) {
- // float SPA_POSITION = 0;
- case 0:
- VectorAdd(&(model->surfmesh.data_vertex3f + 3 * surface->num_firstvertex)[pointnum * 3], ed->fields.client->origin, PRVM_G_VECTOR(OFS_RETURN));
- break;
- // float SPA_S_AXIS = 1;
- case 1:
- VectorCopy(&(model->surfmesh.data_svector3f + 3 * surface->num_firstvertex)[pointnum * 3], PRVM_G_VECTOR(OFS_RETURN));
- break;
- // float SPA_T_AXIS = 2;
- case 2:
- VectorCopy(&(model->surfmesh.data_tvector3f + 3 * surface->num_firstvertex)[pointnum * 3], PRVM_G_VECTOR(OFS_RETURN));
- break;
- // float SPA_R_AXIS = 3; // same as SPA_NORMAL
- case 3:
- VectorCopy(&(model->surfmesh.data_normal3f + 3 * surface->num_firstvertex)[pointnum * 3], PRVM_G_VECTOR(OFS_RETURN));
- break;
- // float SPA_TEXCOORDS0 = 4;
- case 4: {
- float *ret = PRVM_G_VECTOR(OFS_RETURN);
- float *texcoord = &(model->surfmesh.data_texcoordtexture2f + 2 * surface->num_firstvertex)[pointnum * 2];
- ret[0] = texcoord[0];
- ret[1] = texcoord[1];
- ret[2] = 0.0f;
- break;
- }
- // float SPA_LIGHTMAP0_TEXCOORDS = 5;
- case 5: {
- float *ret = PRVM_G_VECTOR(OFS_RETURN);
- float *texcoord = &(model->surfmesh.data_texcoordlightmap2f + 2 * surface->num_firstvertex)[pointnum * 2];
- ret[0] = texcoord[0];
- ret[1] = texcoord[1];
- ret[2] = 0.0f;
- break;
- }
- // float SPA_LIGHTMAP0_COLOR = 6;
- case 6:
- // ignore alpha for now..
- VectorCopy( &(model->surfmesh.data_lightmapcolor4f + 4 * surface->num_firstvertex)[pointnum * 4], PRVM_G_VECTOR(OFS_RETURN));
- break;
- default:
- VectorSet( PRVM_G_VECTOR(OFS_RETURN), 0.0f, 0.0f, 0.0f );
- break;
- }
-}
-// #436 vector(entity e, float s) getsurfacenormal
-static void VM_CL_getsurfacenormal(void)
-{
- dp_model_t *model;
- msurface_t *surface;
- vec3_t normal;
- VM_SAFEPARMCOUNT(2, VM_CL_getsurfacenormal);
- VectorClear(PRVM_G_VECTOR(OFS_RETURN));
- if (!(model = CL_GetModelFromEdict(PRVM_G_EDICT(OFS_PARM0))) || !(surface = cl_getsurface(model, (int)PRVM_G_FLOAT(OFS_PARM1))))
- return;
- // FIXME: implement rotation/scaling
- // note: this (incorrectly) assumes it is a simple polygon
- // note: this only returns the first triangle, so it doesn't work very
- // well for curved surfaces or arbitrary meshes
- TriangleNormal((model->surfmesh.data_vertex3f + 3 * surface->num_firstvertex), (model->surfmesh.data_vertex3f + 3 * surface->num_firstvertex) + 3, (model->surfmesh.data_vertex3f + 3 * surface->num_firstvertex) + 6, normal);
- VectorNormalize(normal);
- VectorCopy(normal, PRVM_G_VECTOR(OFS_RETURN));
-}
-
-// #437 string(entity e, float s) getsurfacetexture
-static void VM_CL_getsurfacetexture(void)
-{
- dp_model_t *model;
- msurface_t *surface;
- VM_SAFEPARMCOUNT(2, VM_CL_getsurfacetexture);
- PRVM_G_INT(OFS_RETURN) = OFS_NULL;
- if (!(model = CL_GetModelFromEdict(PRVM_G_EDICT(OFS_PARM0))) || !(surface = cl_getsurface(model, (int)PRVM_G_FLOAT(OFS_PARM1))))
- return;
- PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(surface->texture->name);
-}
-
-// #438 float(entity e, vector p) getsurfacenearpoint
-static void VM_CL_getsurfacenearpoint(void)
-{
- int surfacenum, best;
- vec3_t clipped, p;
- vec_t dist, bestdist;
- prvm_edict_t *ed;
- dp_model_t *model = NULL;
- msurface_t *surface;
- vec_t *point;
- VM_SAFEPARMCOUNT(2, VM_CL_getsurfacenearpoint);
- PRVM_G_FLOAT(OFS_RETURN) = -1;
- ed = PRVM_G_EDICT(OFS_PARM0);
- if(!(model = CL_GetModelFromEdict(ed)) || !model->num_surfaces)
- return;
-
- // FIXME: implement rotation/scaling
- point = PRVM_G_VECTOR(OFS_PARM1);
- VectorSubtract(point, ed->fields.client->origin, p);
- best = -1;
- bestdist = 1000000000;
- for (surfacenum = 0;surfacenum < model->nummodelsurfaces;surfacenum++)
- {
- surface = model->data_surfaces + surfacenum + model->firstmodelsurface;
- // first see if the nearest point on the surface's box is closer than the previous match
- clipped[0] = bound(surface->mins[0], p[0], surface->maxs[0]) - p[0];
- clipped[1] = bound(surface->mins[1], p[1], surface->maxs[1]) - p[1];
- clipped[2] = bound(surface->mins[2], p[2], surface->maxs[2]) - p[2];
- dist = VectorLength2(clipped);
- if (dist < bestdist)
- {
- // it is, check the nearest point on the actual geometry
- clippointtosurface(model, surface, p, clipped);
- VectorSubtract(clipped, p, clipped);
- dist += VectorLength2(clipped);
- if (dist < bestdist)
- {
- // that's closer too, store it as the best match
- best = surfacenum;
- bestdist = dist;
- }
- }
- }
- PRVM_G_FLOAT(OFS_RETURN) = best;
-}
-
-// #439 vector(entity e, float s, vector p) getsurfaceclippedpoint
-static void VM_CL_getsurfaceclippedpoint(void)
-{
- prvm_edict_t *ed;
- dp_model_t *model;
- msurface_t *surface;
- vec3_t p, out;
- VM_SAFEPARMCOUNT(3, VM_CL_getsurfaceclippedpoint);
- VectorClear(PRVM_G_VECTOR(OFS_RETURN));
- ed = PRVM_G_EDICT(OFS_PARM0);
- if (!(model = CL_GetModelFromEdict(ed)) || !(surface = cl_getsurface(model, (int)PRVM_G_FLOAT(OFS_PARM1))))
- return;
- // FIXME: implement rotation/scaling
- VectorSubtract(PRVM_G_VECTOR(OFS_PARM2), ed->fields.client->origin, p);
- clippointtosurface(model, surface, p, out);
- // FIXME: implement rotation/scaling
- VectorAdd(out, ed->fields.client->origin, PRVM_G_VECTOR(OFS_RETURN));
-}
-
// #443 void(entity e, entity tagentity, string tagname) setattachment
void VM_CL_setattachment (void)
{
{
tag_index = CL_GetTagIndex(ent, tag_name);
if (tag_index == 0)
- Con_Printf("VM_CL_gettagindex(entity #%i): tag \"%s\" not found\n", PRVM_NUM_FOR_EDICT(ent), tag_name);
+ Con_DPrintf("VM_CL_gettagindex(entity #%i): tag \"%s\" not found\n", PRVM_NUM_FOR_EDICT(ent), tag_name);
}
PRVM_G_FLOAT(OFS_RETURN) = tag_index;
}
int tex;
float size;
float sizeincrease;
- int alpha;
- int alphafade;
+ float alpha;
+ float alphafade;
float gravity;
float bounce;
float airfriction;
int staincolor1;
int staincolor2;
int staintex;
+ float stainalpha;
+ float stainsize;
float delayspawn;
float delaycollision;
+ float angle;
+ float spin;
}vmparticletheme_t;
// particle spawner
float *particle_stretch;
float *particle_staincolor1;
float *particle_staincolor2;
+ float *particle_stainalpha;
+ float *particle_stainsize;
float *particle_staintex;
float *particle_delayspawn;
float *particle_delaycollision;
+ float *particle_angle;
+ float *particle_spin;
}vmparticlespawner_t;
vmparticlespawner_t vmpartspawner;
getglobal(particle_stretch, "particle_stretch");
getglobalvector(particle_staincolor1, "particle_staincolor1");
getglobalvector(particle_staincolor2, "particle_staincolor2");
+ getglobal(particle_stainalpha, "particle_stainalpha");
+ getglobal(particle_stainsize, "particle_stainsize");
+ getglobal(particle_staintex, "particle_staintex");
getglobal(particle_staintex, "particle_staintex");
getglobal(particle_delayspawn, "particle_delayspawn");
getglobal(particle_delaycollision, "particle_delaycollision");
+ getglobal(particle_angle, "particle_angle");
+ getglobal(particle_spin, "particle_spin");
#undef getglobal
#undef getglobalvector
}
theme->staintex = -1;
theme->delayspawn = 0.0f;
theme->delaycollision = 0.0f;
+ theme->angle = 0.0f;
+ theme->spin = 0.0f;
}
// particle theme -> QC globals
*vmpartspawner.particle_tex = (float)theme->tex;
*vmpartspawner.particle_size = theme->size;
*vmpartspawner.particle_sizeincrease = theme->sizeincrease;
- *vmpartspawner.particle_alpha = (float)theme->alpha/256;
- *vmpartspawner.particle_alphafade = (float)theme->alphafade/256;
+ *vmpartspawner.particle_alpha = theme->alpha/256;
+ *vmpartspawner.particle_alphafade = theme->alphafade/256;
*vmpartspawner.particle_time = theme->lifetime;
*vmpartspawner.particle_gravity = theme->gravity;
*vmpartspawner.particle_bounce = theme->bounce;
*vmpartspawner.particle_velocityjitter = theme->velocityjitter;
*vmpartspawner.particle_qualityreduction = theme->qualityreduction;
*vmpartspawner.particle_stretch = theme->stretch;
- vmpartspawner.particle_staincolor1[0] = (theme->staincolor1 >> 16) & 0xFF;
- vmpartspawner.particle_staincolor1[1] = (theme->staincolor1 >> 8) & 0xFF;
- vmpartspawner.particle_staincolor1[2] = (theme->staincolor1 >> 0) & 0xFF;
- vmpartspawner.particle_staincolor2[0] = (theme->staincolor2 >> 16) & 0xFF;
- vmpartspawner.particle_staincolor2[1] = (theme->staincolor2 >> 8) & 0xFF;
- vmpartspawner.particle_staincolor2[2] = (theme->staincolor2 >> 0) & 0xFF;
+ vmpartspawner.particle_staincolor1[0] = ((int)theme->staincolor1 >> 16) & 0xFF;
+ vmpartspawner.particle_staincolor1[1] = ((int)theme->staincolor1 >> 8) & 0xFF;
+ vmpartspawner.particle_staincolor1[2] = ((int)theme->staincolor1 >> 0) & 0xFF;
+ vmpartspawner.particle_staincolor2[0] = ((int)theme->staincolor2 >> 16) & 0xFF;
+ vmpartspawner.particle_staincolor2[1] = ((int)theme->staincolor2 >> 8) & 0xFF;
+ vmpartspawner.particle_staincolor2[2] = ((int)theme->staincolor2 >> 0) & 0xFF;
*vmpartspawner.particle_staintex = (float)theme->staintex;
+ *vmpartspawner.particle_stainalpha = (float)theme->stainalpha/256;
+ *vmpartspawner.particle_stainsize = (float)theme->stainsize;
*vmpartspawner.particle_delayspawn = theme->delayspawn;
*vmpartspawner.particle_delaycollision = theme->delaycollision;
+ *vmpartspawner.particle_angle = theme->angle;
+ *vmpartspawner.particle_spin = theme->spin;
}
// QC globals -> particle theme
theme->tex = (int)*vmpartspawner.particle_tex;
theme->size = *vmpartspawner.particle_size;
theme->sizeincrease = *vmpartspawner.particle_sizeincrease;
- theme->alpha = (int)(*vmpartspawner.particle_alpha*256);
- theme->alphafade = (int)(*vmpartspawner.particle_alphafade*256);
+ theme->alpha = *vmpartspawner.particle_alpha*256;
+ theme->alphafade = *vmpartspawner.particle_alphafade*256;
theme->lifetime = *vmpartspawner.particle_time;
theme->gravity = *vmpartspawner.particle_gravity;
theme->bounce = *vmpartspawner.particle_bounce;
theme->velocityjitter = *vmpartspawner.particle_velocityjitter;
theme->qualityreduction = (*vmpartspawner.particle_qualityreduction) ? true : false;
theme->stretch = *vmpartspawner.particle_stretch;
- theme->staincolor1 = vmpartspawner.particle_staincolor1[0]*65536 + vmpartspawner.particle_staincolor1[1]*256 + vmpartspawner.particle_staincolor1[2];
- theme->staincolor2 = vmpartspawner.particle_staincolor2[0]*65536 + vmpartspawner.particle_staincolor2[1]*256 + vmpartspawner.particle_staincolor2[2];
+ theme->staincolor1 = ((int)vmpartspawner.particle_staincolor1[0])*65536 + (int)(vmpartspawner.particle_staincolor1[1])*256 + (int)(vmpartspawner.particle_staincolor1[2]);
+ theme->staincolor2 = (int)(vmpartspawner.particle_staincolor2[0])*65536 + (int)(vmpartspawner.particle_staincolor2[1])*256 + (int)(vmpartspawner.particle_staincolor2[2]);
theme->staintex =(int)*vmpartspawner.particle_staintex;
+ theme->stainalpha = *vmpartspawner.particle_stainalpha*256;
+ theme->stainsize = *vmpartspawner.particle_stainsize;
theme->delayspawn = *vmpartspawner.particle_delayspawn;
theme->delaycollision = *vmpartspawner.particle_delaycollision;
+ theme->angle = *vmpartspawner.particle_angle;
+ theme->spin = *vmpartspawner.particle_spin;
}
// init particle spawner interface
if (prog->argc < 3) // global-set particle
{
- part = CL_NewParticle((unsigned short)*vmpartspawner.particle_type, ((int)vmpartspawner.particle_color1[0] << 16) + ((int)vmpartspawner.particle_color1[1] << 8) + ((int)vmpartspawner.particle_color1[2]), ((int)vmpartspawner.particle_color2[0] << 16) + ((int)vmpartspawner.particle_color2[1] << 8) + ((int)vmpartspawner.particle_color2[2]), (int)*vmpartspawner.particle_tex, *vmpartspawner.particle_size, *vmpartspawner.particle_sizeincrease, (int)(*vmpartspawner.particle_alpha*256), (int)(*vmpartspawner.particle_alphafade*256), *vmpartspawner.particle_gravity, *vmpartspawner.particle_bounce, org[0], org[1], org[2], dir[0], dir[1], dir[2], *vmpartspawner.particle_airfriction, *vmpartspawner.particle_liquidfriction, *vmpartspawner.particle_originjitter, *vmpartspawner.particle_velocityjitter, (*vmpartspawner.particle_qualityreduction) ? true : false, *vmpartspawner.particle_time, *vmpartspawner.particle_stretch, (pblend_t)*vmpartspawner.particle_blendmode, (porientation_t)*vmpartspawner.particle_orientation, ((int)vmpartspawner.particle_staincolor1[0] << 16) + ((int)vmpartspawner.particle_staincolor1[1] << 8) + ((int)vmpartspawner.particle_staincolor1[2]), ((int)vmpartspawner.particle_staincolor2[0] << 16) + ((int)vmpartspawner.particle_staincolor2[1] << 8) + ((int)vmpartspawner.particle_staincolor2[2]), (int)*vmpartspawner.particle_staintex);
+ part = CL_NewParticle(org, (unsigned short)*vmpartspawner.particle_type, ((int)(vmpartspawner.particle_color1[0]) << 16) + ((int)(vmpartspawner.particle_color1[1]) << 8) + ((int)(vmpartspawner.particle_color1[2])), ((int)vmpartspawner.particle_color2[0] << 16) + ((int)vmpartspawner.particle_color2[1] << 8) + ((int)vmpartspawner.particle_color2[2]), (int)*vmpartspawner.particle_tex, *vmpartspawner.particle_size, *vmpartspawner.particle_sizeincrease, *vmpartspawner.particle_alpha*256, *vmpartspawner.particle_alphafade*256, *vmpartspawner.particle_gravity, *vmpartspawner.particle_bounce, org[0], org[1], org[2], dir[0], dir[1], dir[2], *vmpartspawner.particle_airfriction, *vmpartspawner.particle_liquidfriction, *vmpartspawner.particle_originjitter, *vmpartspawner.particle_velocityjitter, (*vmpartspawner.particle_qualityreduction) ? true : false, *vmpartspawner.particle_time, *vmpartspawner.particle_stretch, (pblend_t)*vmpartspawner.particle_blendmode, (porientation_t)*vmpartspawner.particle_orientation, (int)(vmpartspawner.particle_staincolor1[0])*65536 + (int)(vmpartspawner.particle_staincolor1[1])*256 + (int)(vmpartspawner.particle_staincolor1[2]), (int)(vmpartspawner.particle_staincolor2[0])*65536 + (int)(vmpartspawner.particle_staincolor2[1])*256 + (int)(vmpartspawner.particle_staincolor2[2]), (int)*vmpartspawner.particle_staintex, *vmpartspawner.particle_stainalpha*256, *vmpartspawner.particle_stainsize, *vmpartspawner.particle_angle, *vmpartspawner.particle_spin);
if (!part)
{
PRVM_G_FLOAT(OFS_RETURN) = 0;
}
if (*vmpartspawner.particle_delayspawn)
part->delayedspawn = cl.time + *vmpartspawner.particle_delayspawn;
- if (*vmpartspawner.particle_delaycollision)
- part->delayedcollisions = cl.time + *vmpartspawner.particle_delaycollision;
+ //if (*vmpartspawner.particle_delaycollision)
+ // part->delayedcollisions = cl.time + *vmpartspawner.particle_delaycollision;
}
else // quick themed particle
{
return;
}
theme = &vmpartspawner.themes[themenum];
- part = CL_NewParticle(theme->typeindex, theme->color1, theme->color2, theme->tex, theme->size, theme->sizeincrease, theme->alpha, theme->alphafade, theme->gravity, theme->bounce, org[0], org[1], org[2], dir[0], dir[1], dir[2], theme->airfriction, theme->liquidfriction, theme->originjitter, theme->velocityjitter, theme->qualityreduction, theme->lifetime, theme->stretch, theme->blendmode, theme->orientation, theme->staincolor1, theme->staincolor2, theme->staintex);
+ part = CL_NewParticle(org, theme->typeindex, theme->color1, theme->color2, theme->tex, theme->size, theme->sizeincrease, theme->alpha, theme->alphafade, theme->gravity, theme->bounce, org[0], org[1], org[2], dir[0], dir[1], dir[2], theme->airfriction, theme->liquidfriction, theme->originjitter, theme->velocityjitter, theme->qualityreduction, theme->lifetime, theme->stretch, theme->blendmode, theme->orientation, theme->staincolor1, theme->staincolor2, theme->staintex, theme->stainalpha, theme->stainsize, theme->angle, theme->spin);
if (!part)
{
PRVM_G_FLOAT(OFS_RETURN) = 0;
}
if (theme->delayspawn)
part->delayedspawn = cl.time + theme->delayspawn;
- if (theme->delaycollision)
- part->delayedcollisions = cl.time + theme->delaycollision;
+ //if (theme->delaycollision)
+ // part->delayedcollisions = cl.time + theme->delaycollision;
}
PRVM_G_FLOAT(OFS_RETURN) = 1;
}
org = PRVM_G_VECTOR(OFS_PARM0);
dir = PRVM_G_VECTOR(OFS_PARM1);
if (prog->argc < 5) // global-set particle
- part = CL_NewParticle((unsigned short)*vmpartspawner.particle_type, ((int)vmpartspawner.particle_color1[0] << 16) + ((int)vmpartspawner.particle_color1[1] << 8) + ((int)vmpartspawner.particle_color1[2]), ((int)vmpartspawner.particle_color2[0] << 16) + ((int)vmpartspawner.particle_color2[1] << 8) + ((int)vmpartspawner.particle_color2[2]), (int)*vmpartspawner.particle_tex, *vmpartspawner.particle_size, *vmpartspawner.particle_sizeincrease, (int)(*vmpartspawner.particle_alpha*256), (int)(*vmpartspawner.particle_alphafade*256), *vmpartspawner.particle_gravity, *vmpartspawner.particle_bounce, org[0], org[1], org[2], dir[0], dir[1], dir[2], *vmpartspawner.particle_airfriction, *vmpartspawner.particle_liquidfriction, *vmpartspawner.particle_originjitter, *vmpartspawner.particle_velocityjitter, (*vmpartspawner.particle_qualityreduction) ? true : false, *vmpartspawner.particle_time, *vmpartspawner.particle_stretch, (pblend_t)*vmpartspawner.particle_blendmode, (porientation_t)*vmpartspawner.particle_orientation, ((int)vmpartspawner.particle_staincolor1[0] << 16) + ((int)vmpartspawner.particle_staincolor1[1] << 8) + ((int)vmpartspawner.particle_staincolor1[2]), ((int)vmpartspawner.particle_staincolor2[0] << 16) + ((int)vmpartspawner.particle_staincolor2[1] << 8) + ((int)vmpartspawner.particle_staincolor2[2]), (int)*vmpartspawner.particle_staintex);
+ part = CL_NewParticle(org, (unsigned short)*vmpartspawner.particle_type, ((int)vmpartspawner.particle_color1[0] << 16) + ((int)vmpartspawner.particle_color1[1] << 8) + ((int)vmpartspawner.particle_color1[2]), ((int)vmpartspawner.particle_color2[0] << 16) + ((int)vmpartspawner.particle_color2[1] << 8) + ((int)vmpartspawner.particle_color2[2]), (int)*vmpartspawner.particle_tex, *vmpartspawner.particle_size, *vmpartspawner.particle_sizeincrease, *vmpartspawner.particle_alpha*256, *vmpartspawner.particle_alphafade*256, *vmpartspawner.particle_gravity, *vmpartspawner.particle_bounce, org[0], org[1], org[2], dir[0], dir[1], dir[2], *vmpartspawner.particle_airfriction, *vmpartspawner.particle_liquidfriction, *vmpartspawner.particle_originjitter, *vmpartspawner.particle_velocityjitter, (*vmpartspawner.particle_qualityreduction) ? true : false, *vmpartspawner.particle_time, *vmpartspawner.particle_stretch, (pblend_t)*vmpartspawner.particle_blendmode, (porientation_t)*vmpartspawner.particle_orientation, ((int)vmpartspawner.particle_staincolor1[0] << 16) + ((int)vmpartspawner.particle_staincolor1[1] << 8) + ((int)vmpartspawner.particle_staincolor1[2]), ((int)vmpartspawner.particle_staincolor2[0] << 16) + ((int)vmpartspawner.particle_staincolor2[1] << 8) + ((int)vmpartspawner.particle_staincolor2[2]), (int)*vmpartspawner.particle_staintex, *vmpartspawner.particle_stainalpha*256, *vmpartspawner.particle_stainsize, *vmpartspawner.particle_angle, *vmpartspawner.particle_spin);
else // themed particle
{
themenum = (int)PRVM_G_FLOAT(OFS_PARM4);
return;
}
theme = &vmpartspawner.themes[themenum];
- part = CL_NewParticle(theme->typeindex, theme->color1, theme->color2, theme->tex, theme->size, theme->sizeincrease, theme->alpha, theme->alphafade, theme->gravity, theme->bounce, org[0], org[1], org[2], dir[0], dir[1], dir[2], theme->airfriction, theme->liquidfriction, theme->originjitter, theme->velocityjitter, theme->qualityreduction, theme->lifetime, theme->stretch, theme->blendmode, theme->orientation, theme->staincolor1, theme->staincolor2, theme->staintex);
+ part = CL_NewParticle(org, theme->typeindex, theme->color1, theme->color2, theme->tex, theme->size, theme->sizeincrease, theme->alpha, theme->alphafade, theme->gravity, theme->bounce, org[0], org[1], org[2], dir[0], dir[1], dir[2], theme->airfriction, theme->liquidfriction, theme->originjitter, theme->velocityjitter, theme->qualityreduction, theme->lifetime, theme->stretch, theme->blendmode, theme->orientation, theme->staincolor1, theme->staincolor2, theme->staintex, theme->stainalpha, theme->stainsize, theme->angle, theme->spin);
}
if (!part)
{
return;
}
part->delayedspawn = cl.time + PRVM_G_FLOAT(OFS_PARM2);
- part->delayedcollisions = cl.time + PRVM_G_FLOAT(OFS_PARM3);
+ //part->delayedcollisions = cl.time + PRVM_G_FLOAT(OFS_PARM3);
PRVM_G_FLOAT(OFS_RETURN) = 0;
}
if (i == MAX_EDICTS)
return;
prog->skeletons[i] = skeleton = Mem_Alloc(cls.levelmempool, sizeof(skeleton_t) + model->num_bones * sizeof(matrix4x4_t));
+ PRVM_G_FLOAT(OFS_RETURN) = i + 1;
skeleton->model = model;
skeleton->relativetransforms = (matrix4x4_t *)(skeleton+1);
// initialize to identity matrices
for (i = 0;i < skeleton->model->num_bones;i++)
skeleton->relativetransforms[i] = identitymatrix;
- PRVM_G_FLOAT(OFS_RETURN) = i + 1;
}
// #264 float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // (FTE_CSQC_SKELETONOBJECTS) blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
prvm_edict_t *ed = PRVM_G_EDICT(OFS_PARM1);
int modelindex = (int)PRVM_G_FLOAT(OFS_PARM2);
float retainfrac = PRVM_G_FLOAT(OFS_PARM3);
- int firstbone = PRVM_G_FLOAT(OFS_PARM4);
- int lastbone = PRVM_G_FLOAT(OFS_PARM5);
+ int firstbone = PRVM_G_FLOAT(OFS_PARM4) - 1;
+ int lastbone = PRVM_G_FLOAT(OFS_PARM5) - 1;
dp_model_t *model = CL_GetModelByIndex(modelindex);
float blendfrac;
int numblends;
}
skeleton->relativetransforms[bonenum] = blendedmatrix;
}
- PRVM_G_FLOAT(OFS_RETURN) = skeletonindex;
+ PRVM_G_FLOAT(OFS_RETURN) = skeletonindex + 1;
}
// #265 float(float skel) skel_get_numbones = #265; // (FTE_CSQC_SKELETONOBJECTS) returns how many bones exist in the created skeleton
VM_CL_te_beam, // #431 void(entity own, vector start, vector end) te_beam (DP_TE_STANDARDEFFECTBUILTINS)
VM_vectorvectors, // #432 void(vector dir) vectorvectors (DP_QC_VECTORVECTORS)
VM_CL_te_plasmaburn, // #433 void(vector org) te_plasmaburn (DP_TE_PLASMABURN)
-VM_CL_getsurfacenumpoints, // #434 float(entity e, float s) getsurfacenumpoints (DP_QC_GETSURFACE)
-VM_CL_getsurfacepoint, // #435 vector(entity e, float s, float n) getsurfacepoint (DP_QC_GETSURFACE)
-VM_CL_getsurfacenormal, // #436 vector(entity e, float s) getsurfacenormal (DP_QC_GETSURFACE)
-VM_CL_getsurfacetexture, // #437 string(entity e, float s) getsurfacetexture (DP_QC_GETSURFACE)
-VM_CL_getsurfacenearpoint, // #438 float(entity e, vector p) getsurfacenearpoint (DP_QC_GETSURFACE)
-VM_CL_getsurfaceclippedpoint, // #439 vector(entity e, float s, vector p) getsurfaceclippedpoint (DP_QC_GETSURFACE)
+VM_getsurfacenumpoints, // #434 float(entity e, float s) getsurfacenumpoints (DP_QC_GETSURFACE)
+VM_getsurfacepoint, // #435 vector(entity e, float s, float n) getsurfacepoint (DP_QC_GETSURFACE)
+VM_getsurfacenormal, // #436 vector(entity e, float s) getsurfacenormal (DP_QC_GETSURFACE)
+VM_getsurfacetexture, // #437 string(entity e, float s) getsurfacetexture (DP_QC_GETSURFACE)
+VM_getsurfacenearpoint, // #438 float(entity e, vector p) getsurfacenearpoint (DP_QC_GETSURFACE)
+VM_getsurfaceclippedpoint, // #439 vector(entity e, float s, vector p) getsurfaceclippedpoint (DP_QC_GETSURFACE)
NULL, // #440 void(entity e, string s) clientcommand (KRIMZON_SV_PARSECLIENTCOMMAND)
VM_tokenize, // #441 float(string s) tokenize (KRIMZON_SV_PARSECLIENTCOMMAND)
VM_argv, // #442 string(float n) argv (KRIMZON_SV_PARSECLIENTCOMMAND)
VM_CL_pointsound, // #483 void(vector origin, string sample, float volume, float attenuation) pointsound (DP_SV_POINTSOUND)
VM_strreplace, // #484 string(string search, string replace, string subject) strreplace (DP_QC_STRREPLACE)
VM_strireplace, // #485 string(string search, string replace, string subject) strireplace (DP_QC_STRREPLACE)
-VM_CL_getsurfacepointattribute,// #486 vector(entity e, float s, float n, float a) getsurfacepointattribute
+VM_getsurfacepointattribute,// #486 vector(entity e, float s, float n, float a) getsurfacepointattribute
VM_gecko_create, // #487 float gecko_create( string name )
VM_gecko_destroy, // #488 void gecko_destroy( string name )
VM_gecko_navigate, // #489 void gecko_navigate( string name, string URI )
NULL, // #625
NULL, // #626
VM_sprintf, // #627 string sprintf(string format, ...)
-NULL, // #628
+VM_getsurfacenumtriangles, // #628 float(entity e, float s) getsurfacenumpoints (DP_QC_GETSURFACETRIANGLE)
+VM_getsurfacetriangle, // #629 vector(entity e, float s, float n) getsurfacepoint (DP_QC_GETSURFACETRIANGLE)
+NULL, // #630
};
const int vm_cl_numbuiltins = sizeof(vm_cl_builtins) / sizeof(prvm_builtin_t);