1 #ifndef _included_particle_h_ /* Is this your first time? */ 2 #define _included_particle_h_ 1 3 4 #include "decal.h" 5 #include "dynblock.h" 6 enum PARTICLE_ID 7 { 8 PARTICLE_PREDATOR_BLOOD, 9 PARTICLE_ALIEN_BLOOD, 10 PARTICLE_HUMAN_BLOOD, 11 PARTICLE_ANDROID_BLOOD, 12 13 PARTICLE_MUZZLEFLASH, 14 PARTICLE_SMARTGUNMUZZLEFLASH, 15 16 PARTICLE_WATERSPRAY, 17 PARTICLE_WATERFALLSPRAY, 18 19 PARTICLE_BLACKSMOKE, 20 PARTICLE_FLARESMOKE, 21 PARTICLE_STEAM, 22 PARTICLE_IMPACTSMOKE, 23 PARTICLE_GUNMUZZLE_SMOKE, 24 25 PARTICLE_FLAME, 26 PARTICLE_NONCOLLIDINGFLAME, 27 PARTICLE_NONDAMAGINGFLAME, 28 PARTICLE_FIRE, 29 PARTICLE_EXPLOSIONFIRE, 30 PARTICLE_MOLOTOVFLAME, 31 PARTICLE_MOLOTOVFLAME_NONDAMAGING, 32 33 PARTICLE_SPARK, 34 PARTICLE_RICOCHET_SPARK, 35 PARTICLE_ORANGE_SPARK, 36 PARTICLE_ORANGE_PLASMA, 37 38 PARTICLE_PLASMATRAIL, 39 PARTICLE_LASERBEAM, 40 PARTICLE_PLASMABEAM, 41 PARTICLE_TRACER, 42 43 PARTICLE_LIGHTFLARE, 44 PARTICLE_STAR, 45 PARTICLE_FLECHETTE, 46 47 48 PARTICLE_SMOKECLOUD, 49 PARTICLE_BLUEPLASMASPHERE, 50 PARTICLE_ELECTRICALPLASMASPHERE, 51 52 PARTICLE_PREDPISTOL_FLECHETTE, 53 PARTICLE_PREDPISTOL_FLECHETTE_NONDAMAGING, 54 55 PARTICLE_FLECHETTE_NONDAMAGING, 56 57 PARTICLE_DEWLINE, 58 59 PARTICLE_PARGEN_FLAME, //identical to PARTICLE_FLAME , except doesn't damage netghosts 60 61 MAX_NO_OF_PARTICLE_IDS, 62 63 PARTICLE_NULL, 64 }; 65 66 enum EXPLOSION_ID 67 { 68 EXPLOSION_PULSEGRENADE, 69 EXPLOSION_HUGE, 70 EXPLOSION_MOLOTOV, 71 72 EXPLOSION_DISSIPATINGPLASMA, 73 EXPLOSION_FOCUSEDPLASMA, 74 75 EXPLOSION_PREDATORPISTOL, 76 77 EXPLOSION_SMALL_NOCOLLISIONS, 78 EXPLOSION_HUGE_NOCOLLISIONS, 79 }; 80 81 struct ColourComponents 82 { 83 unsigned char Red; 84 unsigned char Green; 85 unsigned char Blue; 86 unsigned char Alpha; 87 }; 88 89 typedef struct 90 { 91 unsigned int NotYetRendered; 92 93 enum PARTICLE_ID ParticleID; 94 signed int LifeTime; 95 96 VECTORCH Position; 97 98 VECTORCH Velocity; 99 VECTORCH Offset; 100 101 // union 102 // { 103 // unsigned int Colour; 104 // struct ColourComponents ColourComponents; 105 // }; 106 unsigned int Colour; 107 108 unsigned int Size; 109 110 } PARTICLE; 111 112 typedef struct 113 { 114 int StartU; 115 int StartV; 116 int EndU; 117 int EndV; 118 unsigned int Size; 119 120 enum TRANSLUCENCY_TYPE TranslucencyType; 121 122 unsigned char Alpha; 123 unsigned char RedScale[NUMBER_OF_VISION_MODES]; 124 unsigned char GreenScale[NUMBER_OF_VISION_MODES]; 125 unsigned char BlueScale[NUMBER_OF_VISION_MODES]; 126 127 unsigned char IsLit:1; 128 unsigned char IsDrawnInFront:1; 129 unsigned char IsDrawnAtBack:1; 130 131 } PARTICLE_DESC; 132 133 typedef struct 134 { 135 int Active; 136 int X; 137 int Z; 138 int Amplitude; 139 int Radius; 140 int InvRadius; 141 } RIPPLE; 142 143 typedef struct 144 { 145 VECTORCH Vertex[2]; 146 VECTORCH Perp[2]; 147 int Size[2]; 148 } PHEROMONE_TRAIL; 149 150 151 typedef struct 152 { 153 VECTORCH SourcePosition; 154 VECTORCH TargetPosition; 155 char BeamHasHitPlayer; 156 char BeamIsOn; 157 } LASER_BEAM_DESC; 158 159 160 161 extern PARTICLE_DESC ParticleDescription[]; 162 163 164 165 extern void InitialiseParticleSystem(void); 166 extern void MakeParticle(VECTORCH *positionPtr, VECTORCH *velocityPtr, enum PARTICLE_ID particleID); 167 extern void HandleParticleSystem(void); 168 void RenderAllParticlesFurtherAwayThan(int zThreshold); 169 170 extern void HandleRainDrops(MODULE *modulePtr,int numberOfRaindrops); 171 extern int EffectOfRipples(VECTORCH *point); 172 173 174 175 176 enum MUZZLE_FLASH_ID 177 { 178 MUZZLE_FLASH_SMARTGUN, 179 MUZZLE_FLASH_AMORPHOUS, 180 MUZZLE_FLASH_SKEETER, 181 }; 182 183 extern void DrawMuzzleFlash(VECTORCH *positionPtr,VECTORCH *directionPtr, enum MUZZLE_FLASH_ID muzzleFlashID); 184 185 extern void MakeFlareParticle(DYNAMICSBLOCK *dynPtr); 186 extern void MakeRocketTrailParticles(VECTORCH *prevPositionPtr, VECTORCH *positionPtr); 187 extern void MakeImpactSmoke(MATRIXCH *orientationPtr, VECTORCH *positionPtr); 188 extern void MakeImpactSparks(VECTORCH *incidentPtr, VECTORCH *normalPtr, VECTORCH *positionPtr); 189 extern void MakeVolumetricExplosionAt(VECTORCH *positionPtr, enum EXPLOSION_ID explosionID); 190 extern void MakePlasmaExplosion(VECTORCH *positionPtr, VECTORCH *fromPositionPtr, enum EXPLOSION_ID explosionID); 191 extern void MakeDewlineTrailParticles(DYNAMICSBLOCK *dynPtr, int number); 192 193 194 extern void MakeBloodExplosion(VECTORCH *originPtr, int creationRadius, VECTORCH *blastPositionPtr, int noOfParticles, enum PARTICLE_ID particleID); 195 extern void MakeFocusedExplosion(VECTORCH *originPtr, VECTORCH *blastPositionPtr, int noOfParticles, enum PARTICLE_ID particleID); 196 extern void MakeElectricalExplosion(VECTORCH *positionPtr); 197 void MakeSprayOfSparks(MATRIXCH *orientationPtr, VECTORCH *positionPtr); 198 void PlayerPheromoneTrail(DYNAMICSBLOCK *dynPtr); 199 void MakeGrenadeTrailParticles(VECTORCH *prevPositionPtr, VECTORCH *positionPtr); 200 void MakePlasmaTrailParticles(DYNAMICSBLOCK *dynPtr, int number); 201 void NewTrailPoint(DYNAMICSBLOCK *dynPtr); 202 void TimeScaleThingy(); 203 void DrawFrisbeePlasmaBolt(VECTORCH *positionPtr,VECTORCH *directionPtr); 204 void DrawPredatorPlasmaBolt(VECTORCH *positionPtr,VECTORCH *directionPtr); 205 void DrawSmallPredatorPlasmaBolt(VECTORCH *positionPtr,VECTORCH *directionPtr); 206 207 208 #define MAX_NO_OF_BLOOD_PARTICLES 500 209 extern int NumberOfBloodParticles; 210 211 #endif 212