2019-05-15 14:52:37 +00:00
|
|
|
#pragma once
|
2019-05-29 00:52:30 +00:00
|
|
|
#include "ParticleMgr.h"
|
2019-05-15 14:52:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
class CEntity;
|
|
|
|
|
2019-05-29 00:52:30 +00:00
|
|
|
class CParticle
|
|
|
|
{
|
2019-07-11 00:22:01 +00:00
|
|
|
public:
|
2019-05-29 00:52:30 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
RAND_TABLE_SIZE = 20,
|
|
|
|
SIN_COS_TABLE_SIZE = 1024
|
|
|
|
};
|
2019-07-11 00:22:01 +00:00
|
|
|
|
2019-05-29 00:52:30 +00:00
|
|
|
CVector m_vecPosition;
|
|
|
|
CVector m_vecVelocity;
|
2020-05-26 23:16:31 +00:00
|
|
|
uint32 m_nTimeWhenWillBeDestroyed;
|
|
|
|
uint32 m_nTimeWhenColorWillBeChanged;
|
2019-06-16 22:16:38 +00:00
|
|
|
float m_fZGround;
|
2019-05-29 00:52:30 +00:00
|
|
|
CVector m_vecParticleMovementOffset;
|
2019-06-16 22:16:38 +00:00
|
|
|
int16 m_nCurrentZRotation;
|
2020-05-26 23:16:31 +00:00
|
|
|
uint16 m_nZRotationTimer;
|
2019-06-16 22:16:38 +00:00
|
|
|
float m_fCurrentZRadius;
|
2020-05-26 23:16:31 +00:00
|
|
|
uint16 m_nZRadiusTimer;
|
2019-06-16 22:16:38 +00:00
|
|
|
uint8 m_nColorIntensity;
|
|
|
|
uint8 m_nAlpha;
|
2020-05-26 23:16:31 +00:00
|
|
|
float m_fSize;
|
|
|
|
float m_fExpansionRate;
|
|
|
|
int16 m_nFadeToBlackTimer;
|
|
|
|
int16 m_nFadeAlphaTimer;
|
2019-06-16 22:16:38 +00:00
|
|
|
int16 m_nAnimationSpeedTimer;
|
|
|
|
int16 m_nRotationStep;
|
|
|
|
int16 m_nRotation;
|
2020-05-26 23:16:31 +00:00
|
|
|
uint8 m_nCurrentFrame;
|
2019-05-29 00:52:30 +00:00
|
|
|
RwRGBA m_Color;
|
|
|
|
CParticle *m_pNext;
|
|
|
|
|
|
|
|
CParticle()
|
|
|
|
{
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
~CParticle()
|
|
|
|
{
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
2020-04-17 05:54:14 +00:00
|
|
|
static float ms_afRandTable[RAND_TABLE_SIZE];
|
2019-05-29 00:52:30 +00:00
|
|
|
static CParticle *m_pUnusedListHead;
|
|
|
|
|
2019-06-16 22:16:38 +00:00
|
|
|
static float m_SinTable[SIN_COS_TABLE_SIZE];
|
|
|
|
static float m_CosTable[SIN_COS_TABLE_SIZE];
|
2019-05-29 00:52:30 +00:00
|
|
|
|
2019-08-15 01:43:00 +00:00
|
|
|
static float Sin(int32 value) { return m_SinTable[value]; }
|
|
|
|
static float Cos(int32 value) { return m_CosTable[value]; }
|
2019-05-29 00:52:30 +00:00
|
|
|
|
|
|
|
static void ReloadConfig();
|
|
|
|
static void Initialise();
|
|
|
|
static void Shutdown();
|
|
|
|
|
2020-05-26 23:16:31 +00:00
|
|
|
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);
|
2019-05-29 00:52:30 +00:00
|
|
|
|
|
|
|
static void Update();
|
|
|
|
static void Render();
|
|
|
|
|
|
|
|
static void RemovePSystem(tParticleType type);
|
|
|
|
static void RemoveParticle(CParticle *pParticle, CParticle *pPrevParticle, tParticleSystemData *pPSystemData);
|
|
|
|
|
2019-07-07 08:16:16 +00:00
|
|
|
static void _Next(CParticle *&pParticle, CParticle *&pPrevParticle, tParticleSystemData *pPSystemData, bool bRemoveParticle)
|
2019-05-29 00:52:30 +00:00
|
|
|
{
|
|
|
|
if ( bRemoveParticle )
|
|
|
|
{
|
|
|
|
RemoveParticle(pParticle, pPrevParticle, pPSystemData);
|
|
|
|
|
|
|
|
if ( pPrevParticle )
|
|
|
|
pParticle = pPrevParticle->m_pNext;
|
|
|
|
else
|
|
|
|
pParticle = pPSystemData->m_pParticles;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pPrevParticle = pParticle;
|
|
|
|
pParticle = pParticle->m_pNext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-16 22:16:38 +00:00
|
|
|
static void AddJetExplosion(CVector const &vecPos, float fPower, float fSize);
|
2019-05-29 00:52:30 +00:00
|
|
|
static void AddYardieDoorSmoke(CVector const &vecPos, CMatrix const &matMatrix);
|
2020-05-26 23:16:31 +00:00
|
|
|
static void CalWindDir(CVector *vecDirIn, CVector *vecDirOut);
|
|
|
|
|
|
|
|
static void HandleShipsAtHorizonStuff();
|
|
|
|
static void HandleShootableBirdsStuff(CEntity *entity, CVector const&camPos);
|
2019-05-29 00:52:30 +00:00
|
|
|
};
|
2019-05-29 18:02:58 +00:00
|
|
|
|
2020-05-31 17:59:01 +00:00
|
|
|
extern bool clearWaterDrop;
|
2020-07-01 16:03:39 +00:00
|
|
|
extern int32 numWaterDropOnScreen;
|
2020-12-16 20:53:47 +00:00
|
|
|
extern RwRaster *gpCarSplashRaster[];
|
|
|
|
extern RwRaster *gpHeatHazeRaster;
|
|
|
|
extern RwRaster *gpDotRaster;
|
|
|
|
extern RwRaster *gpRainDripRaster[];
|
|
|
|
extern RwRaster *gpRainDripDarkRaster[];
|
2020-05-31 17:59:01 +00:00
|
|
|
|
2020-05-26 23:16:31 +00:00
|
|
|
VALIDATE_SIZE(CParticle, 0x58);
|