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)
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_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->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])*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);
+ 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;
}