29 #include "../idlib/precompiled.h"
34 static const char *smokeParticle_SnapshotName =
"_SmokeParticle_Snapshot_";
123 for (
int activeStageNum = 0; activeStageNum <
activeStages.
Num(); activeStageNum++ ) {
129 for ( last =
NULL, smoke = active->
smokes; smoke; smoke = next ) {
135 if ( smoke->timeGroup ) {
144 if ( frac >= 1.0
f ) {
146 if ( last !=
NULL ) {
177 bool continues =
false;
179 SetTimeState ts( timeGroup );
200 idRandom steppingRandom( 0xffff * diversity );
203 for (
int stageNum = 0; stageNum < smoke->
stages.
Num(); stageNum++ ) {
223 int nowCount, prevCount;
224 if ( finalParticleTime == 0 ) {
233 nowCount = floor( ( (
float)deltaMsec / finalParticleTime ) * stage->
totalParticles );
238 if ( prevCount < -1 ) {
248 if ( nowCount < stage->totalParticles-1 ) {
258 if ( active->
stage == stage ) {
267 newActive.
stage = stage;
273 for ( prevCount++ ; prevCount <= nowCount ; prevCount++ ) {
283 newSmoke->timeGroup = timeGroup;
285 newSmoke->
index = prevCount;
286 newSmoke->
axis = axis;
287 newSmoke->
origin = origin;
288 newSmoke->
random = steppingRandom;
291 active->
smokes = newSmoke;
327 for (
int activeStageNum = 0; activeStageNum <
activeStages.
Num(); activeStageNum++ ) {
339 for ( smoke = active->
smokes; smoke; smoke = smoke->
next ) {
350 tri->
bounds[0][2] = -99999;
353 tri->
bounds[1][2] = 99999;
356 for ( last =
NULL, smoke = active->
smokes; smoke; smoke = next ) {
360 if ( smoke->timeGroup ) {
369 if ( g.
frac >= 1.0f ) {
371 if ( last !=
NULL ) {
397 gameLocal.
Error(
"idSmokeParticles::UpdateRenderEntity: miscounted verts" );
virtual srfTriangles_t * AllocSurfaceTriangles(int numVerts, int numIndexes) const =0
bool EmitSmoke(const idDeclParticle *smoke, const int startTime, const float diversity, const idVec3 &origin, const idMat3 &axis, int timeGroup)
assert(prefInfo.fullscreenBtn)
idMat3 mat3_identity(idVec3(1, 0, 0), idVec3(0, 1, 0), idVec3(0, 0, 1))
void Printf(const char *fmt,...) const id_attribute((format(printf
idSmokeParticles * smokeParticles
virtual qhandle_t AddEntityDef(const renderEntity_t *re)=0
void void void void void Error(const char *fmt,...) const id_attribute((format(printf
const idMaterial * shader
virtual void FreeSurfaceTriangles(srfTriangles_t *tris) const =0
virtual void AddSurface(modelSurface_t surface)=0
const renderEntity_t * renderEnt
const int SHADERPARM_GREEN
renderEntity_t renderEntity
deferredEntityCallback_t callback
struct singleSmoke_s * next
virtual void InitEmpty(const char *name)=0
const int SHADERPARM_BLUE
bool AddPoint(const idVec3 &v)
virtual void FreeEntityDef(qhandle_t entityHandle)=0
GLuint GLuint GLsizei count
singleSmoke_t smokes[MAX_SMOKE_PARTICLES]
static bool ModelCallback(renderEntity_s *renderEntity, const renderView_t *renderView)
srfTriangles_t * geometry
virtual int CreateParticle(particleGen_t *g, idDrawVert *verts) const
const renderView_t * renderView
const idMaterial * material
idList< idParticleStage * > stages
virtual void FreeModel(idRenderModel *model)=0
singleSmoke_t * freeSmokes
bool UpdateRenderEntity(renderEntity_s *renderEntity, const renderView_t *renderView)
int Append(const type &obj)
idRenderModelManager * renderModelManager
static const int MAX_SMOKE_PARTICLES
bool RemoveIndex(int index)
idRenderWorld * gameRenderWorld
const idParticleStage * stage
float shaderParms[MAX_ENTITY_SHADER_PARMS]
virtual int NumQuadsPerParticle() const
virtual idRenderModel * AllocModel()=0
idList< activeSmokeStage_t > activeStages