29 #include "../idlib/precompiled.h"
35 static const char *parametricParticle_SnapshotName =
"_ParametricParticle_Snapshot_";
80 if ( renderEntity ==
NULL || viewDef ==
NULL ) {
98 if ( cachedModel !=
NULL ) {
100 assert( dynamic_cast<idRenderModelStatic *>(cachedModel) !=
NULL );
108 staticModel->
InitEmpty( parametricParticle_SnapshotName );
132 idRandom steppingRandom, steppingRandom2;
135 int stageCycle = stageAge / stage->
cycleMsec;
136 int inCycleTime = stageAge - stageCycle * stage->
cycleMsec;
148 surf = &staticModel->
surfaces[surfaceNum];
151 surf = &staticModel->
surfaces.Alloc();
173 int particleAge = stageAge - bunchOffset;
174 int particleCycle = particleAge / stage->
cycleMsec;
175 if ( particleCycle < 0 ) {
179 if ( stage->
cycles && particleCycle >= stage->
cycles ) {
184 if ( particleCycle == stageCycle ) {
185 g.
random = steppingRandom;
187 g.
random = steppingRandom2;
190 int inCycleTime = particleAge - particleCycle * stage->
cycleMsec;
200 if ( g.
frac < 0.0f ) {
204 if ( g.
frac > 1.0f ) {
219 assert( ( numVerts & 3 ) == 0 && numVerts <= 4 * count );
224 for (
int i = 0;
i < numVerts;
i += 4 ) {
225 indexes[numIndexes+0] =
i;
226 indexes[numIndexes+1] =
i+2;
227 indexes[numIndexes+2] =
i+3;
228 indexes[numIndexes+3] =
i;
229 indexes[numIndexes+4] =
i+3;
230 indexes[numIndexes+5] =
i+1;
282 total +=
sizeof( *particleSystem );
idCVar r_skipParticles("r_skipParticles","0", CVAR_RENDERER|CVAR_INTEGER,"1 = skip all particle systems", 0, 1, idCmdSystem::ArgCompletion_Integer< 0, 1 >)
virtual float DepthHack() const
bool FindSurfaceWithId(int id, int &surfaceNum)
idList< modelSurface_t > surfaces
assert(prefInfo.fullscreenBtn)
const int SHADERPARM_DIVERSITY
virtual int Memory() const
const idMaterial * shader
bool facePlanesCalculated
const renderEntity_t * renderEnt
virtual const char * Name() const =0
static const int MAX_RAND
srfTriangles_t * R_AllocStaticTriSurf(void)
bool DeleteSurfaceWithId(int id)
int Icmp(const char *text) const
virtual idRenderModel * InstantiateDynamicModel(const struct renderEntity_s *ent, const struct viewDef_s *view, idRenderModel *cachedModel)
GLuint GLuint GLsizei count
virtual void InitEmpty(const char *name)
void R_AllocStaticTriSurfPlanes(srfTriangles_t *tri, int numIndexes)
srfTriangles_t * geometry
virtual int CreateParticle(particleGen_t *g, idDrawVert *verts) const
virtual const idDecl * FindType(declType_t type, const char *name, bool makeDefault=true)=0
const renderView_t * renderView
virtual dynamicModel_t IsDynamicModel() const
const idMaterial * material
virtual idBounds Bounds(const struct renderEntity_s *ent) const
const int SHADERPARM_TIMEOFFSET
idList< idParticleStage * > stages
idDeclManager * declManager
virtual void InitFromFile(const char *fileName)
idCVar r_useCachedDynamicModels("r_useCachedDynamicModels","1", CVAR_RENDERER|CVAR_BOOL,"cache snapshots of dynamic models")
void R_AllocStaticTriSurfIndexes(srfTriangles_t *tri, int numIndexes)
void R_AllocStaticTriSurfVerts(srfTriangles_t *tri, int numVerts)
float shaderParms[MAX_ENTITY_SHADER_PARMS]
void R_FreeStaticTriSurfVertexCaches(srfTriangles_t *tri)
virtual int NumQuadsPerParticle() const
virtual int Memory() const
const idDeclParticle * particleSystem
const int SHADERPARM_PARTICLE_STOPTIME