1 /* 2 ** p_effect.h 3 ** 4 **--------------------------------------------------------------------------- 5 ** Copyright 1998-2006 Randy Heit 6 ** All rights reserved. 7 ** 8 ** Redistribution and use in source and binary forms, with or without 9 ** modification, are permitted provided that the following conditions 10 ** are met: 11 ** 12 ** 1. Redistributions of source code must retain the above copyright 13 ** notice, this list of conditions and the following disclaimer. 14 ** 2. Redistributions in binary form must reproduce the above copyright 15 ** notice, this list of conditions and the following disclaimer in the 16 ** documentation and/or other materials provided with the distribution. 17 ** 3. The name of the author may not be used to endorse or promote products 18 ** derived from this software without specific prior written permission. 19 ** 20 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 **--------------------------------------------------------------------------- 31 ** 32 */ 33 34 #include "vectors.h" 35 #include "tables.h" 36 37 #define FX_ROCKET 0x00000001 38 #define FX_GRENADE 0x00000002 39 #define FX_RESPAWNINVUL 0x00000020 40 #define FX_VISIBILITYPULSE 0x00000040 41 42 #define FX_FOUNTAINMASK 0x00070000 43 #define FX_FOUNTAINSHIFT 16 44 #define FX_REDFOUNTAIN 0x00010000 45 #define FX_GREENFOUNTAIN 0x00020000 46 #define FX_BLUEFOUNTAIN 0x00030000 47 #define FX_YELLOWFOUNTAIN 0x00040000 48 #define FX_PURPLEFOUNTAIN 0x00050000 49 #define FX_BLACKFOUNTAIN 0x00060000 50 #define FX_WHITEFOUNTAIN 0x00070000 51 52 struct subsector_t; 53 54 // [RH] Particle details 55 struct particle_t 56 { 57 fixed_t x,y,z; 58 fixed_t velx,vely,velz; 59 fixed_t accx,accy,accz; 60 BYTE ttl; 61 BYTE trans; 62 WORD size; 63 BYTE bright:1; 64 BYTE fade; 65 int color; 66 WORD tnext; 67 WORD snext; 68 subsector_t * subsector; 69 }; 70 71 extern particle_t *Particles; 72 extern TArray<WORD> ParticlesInSubsec; 73 74 const WORD NO_PARTICLE = 0xffff; 75 76 void P_ClearParticles (); 77 void P_FindParticleSubsectors (); 78 79 80 class AActor; 81 82 particle_t *JitterParticle (int ttl); 83 particle_t *JitterParticle (int ttl, float drift); 84 85 void P_ThinkParticles (void); 86 void P_SpawnParticle(fixed_t x, fixed_t y, fixed_t z, fixed_t velx, fixed_t vely, fixed_t velz, PalEntry color, bool fullbright, BYTE startalpha, BYTE lifetime, WORD size, int fadestep, fixed_t accelx, fixed_t accely, fixed_t accelz); 87 void P_InitEffects (void); 88 void P_RunEffects (void); 89 90 void P_RunEffect (AActor *actor, int effects); 91 92 void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVector3<double> &end, int color1, int color2, double maxdiff = 0, int flags = 0, const PClass *spawnclass = NULL, angle_t angle = 0, int duration = 35, double sparsity = 1.0, double drift = 1.0, int SpiralOffset = 270); 93 void P_DrawSplash (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, int kind); 94 void P_DrawSplash2 (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, int updown, int kind); 95 void P_DisconnectEffect (AActor *actor); 96