summaryrefslogtreecommitdiffstats
path: root/src/renderer/Particle.h
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-17 23:05:51 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-17 23:05:51 +0200
commit7a034142c99e577b0339aefd9599cb7f373c495e (patch)
tree722b1946daf2b24374c7fcfab0face06af5eefba /src/renderer/Particle.h
parentMerge remote-tracking branch 'origin/miami' into lcs (diff)
parentrender -> renderer (original name) (diff)
downloadre3-7a034142c99e577b0339aefd9599cb7f373c495e.tar
re3-7a034142c99e577b0339aefd9599cb7f373c495e.tar.gz
re3-7a034142c99e577b0339aefd9599cb7f373c495e.tar.bz2
re3-7a034142c99e577b0339aefd9599cb7f373c495e.tar.lz
re3-7a034142c99e577b0339aefd9599cb7f373c495e.tar.xz
re3-7a034142c99e577b0339aefd9599cb7f373c495e.tar.zst
re3-7a034142c99e577b0339aefd9599cb7f373c495e.zip
Diffstat (limited to 'src/renderer/Particle.h')
-rw-r--r--src/renderer/Particle.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/renderer/Particle.h b/src/renderer/Particle.h
new file mode 100644
index 00000000..a306f0c4
--- /dev/null
+++ b/src/renderer/Particle.h
@@ -0,0 +1,101 @@
+#pragma once
+#include "ParticleMgr.h"
+
+
+class CEntity;
+
+class CParticle
+{
+public:
+ enum
+ {
+ RAND_TABLE_SIZE = 20,
+ SIN_COS_TABLE_SIZE = 1024
+ };
+
+ CVector m_vecPosition;
+ CVector m_vecVelocity;
+ uint32 m_nTimeWhenWillBeDestroyed;
+ uint32 m_nTimeWhenColorWillBeChanged;
+ float m_fZGround;
+ uint8 m_nColorIntensity;
+ uint8 m_nAlpha;
+ float m_fSize;
+ float m_fExpansionRate;
+ int16 m_nFadeToBlackTimer;
+ int16 m_nFadeAlphaTimer;
+ int16 m_nAnimationSpeedTimer;
+ int16 m_nRotationStep;
+ int16 m_nRotation;
+ uint8 m_nCurrentFrame;
+ RwRGBA m_Color;
+ CParticle *m_pNext;
+ int32 field_4C;
+
+ CParticle()
+ {
+ ;
+ }
+
+ ~CParticle()
+ {
+ ;
+ }
+
+ static float ms_afRandTable[RAND_TABLE_SIZE];
+ static CParticle *m_pUnusedListHead;
+
+ static float m_SinTable[SIN_COS_TABLE_SIZE];
+ static float m_CosTable[SIN_COS_TABLE_SIZE];
+
+ static float Sin(int32 value) { return m_SinTable[value]; }
+ static float Cos(int32 value) { return m_CosTable[value]; }
+
+ static void ReloadConfig();
+ static void Initialise();
+ static void Shutdown();
+
+ static void AddParticlesAlongLine(tParticleType type, CVector const &vecStart, CVector const &vecEnd, CVector const &vecDir, float fPower, CEntity *pEntity = nil, float fSize = 0.0f, int32 nRotationSpeed = 0, int32 nRotation = 0, int32 nCurFrame = 0, int32 nLifeSpan = 0);
+ static void AddParticlesAlongLine(tParticleType type, CVector const &vecStart, CVector const &vecEnd, CVector const &vecDir, float fPower, CEntity *pEntity, float fSize, RwRGBA const&color, int32 nRotationSpeed = 0, int32 nRotation = 0, int32 nCurFrame = 0, int32 nLifeSpan = 0);
+
+ static CParticle *AddParticle(tParticleType type, CVector const &vecPos, CVector const &vecDir, CEntity *pEntity = nil, float fSize = 0.0f, int32 nRotationSpeed = 0, int32 nRotation = 0, int32 nCurFrame = 0, int32 nLifeSpan = 0);
+ static CParticle *AddParticle(tParticleType type, CVector const &vecPos, CVector const &vecDir, CEntity *pEntity, float fSize, RwRGBA const &color, int32 nRotationSpeed = 0, int32 nRotation = 0, int32 nCurFrame = 0, int32 nLifeSpan = 0);
+
+ static void Update();
+ static void Render();
+
+ static void RemovePSystem(tParticleType type);
+ static void RemoveParticle(CParticle *pParticle, CParticle *pPrevParticle, tParticleSystemData *pPSystemData);
+
+ static void _Next(CParticle *&pParticle, CParticle *&pPrevParticle, tParticleSystemData *pPSystemData, bool bRemoveParticle)
+ {
+ if ( bRemoveParticle )
+ {
+ RemoveParticle(pParticle, pPrevParticle, pPSystemData);
+
+ if ( pPrevParticle )
+ pParticle = pPrevParticle->m_pNext;
+ else
+ pParticle = pPSystemData->m_pParticles;
+ }
+ else
+ {
+ pPrevParticle = pParticle;
+ pParticle = pParticle->m_pNext;
+ }
+ }
+
+ static void AddJetExplosion(CVector const &vecPos, float fPower, float fSize);
+ static void AddYardieDoorSmoke(CVector const &vecPos, CMatrix const &matMatrix);
+ static void CalWindDir(CVector *vecDirIn, CVector *vecDirOut);
+
+ static void HandleShipsAtHorizonStuff();
+ static void HandleShootableBirdsStuff(CEntity *entity, CVector const&camPos);
+};
+
+extern RwRaster *gpCarSplashRaster[];
+extern RwRaster *gpHeatHazeRaster;
+extern RwRaster *gpRainDripRaster[];
+extern RwRaster *gpRainDripDarkRaster[];
+
+VALIDATE_SIZE(CParticle, 0x50);