1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-18 06:37:46 +00:00
re3/src/render/ParticleMgr.h

142 lines
3.7 KiB
C
Raw Normal View History

2019-05-29 00:52:30 +00:00
#pragma once
2020-04-19 16:34:08 +00:00
#include "ParticleType.h"
2019-05-29 00:52:30 +00:00
2020-04-19 16:34:08 +00:00
class CParticle;
2020-05-11 02:55:57 +00:00
enum
2019-05-29 00:52:30 +00:00
{
ZCHECK_FIRST = BIT(0),
ZCHECK_STEP = BIT(1),
DRAW_OPAQUE = BIT(2),
SCREEN_TRAIL = BIT(3),
SPEED_TRAIL = BIT(4),
RAND_VERT_V = BIT(5),
CYCLE_ANIM = BIT(6),
DRAW_DARK = BIT(7),
VERT_TRAIL = BIT(8),
_FLAG9 = BIT(9), // unused
DRAWTOP2D = BIT(10),
CLIPOUT2D = BIT(11),
ZCHECK_BUMP = BIT(12),
ZCHECK_BUMP_FIRST = BIT(13)
};
2019-05-29 18:02:58 +00:00
2019-05-29 00:52:30 +00:00
struct tParticleSystemData
{
tParticleType m_Type;
2019-06-16 22:16:38 +00:00
char m_aName[20];
float m_fCreateRange;
float m_fDefaultInitialRadius;
float m_fExpansionRate;
uint16 m_nZRotationInitialAngle;
int16 m_nZRotationAngleChangeAmount;
uint16 m_nZRotationChangeTime;
uint16 m_nZRadiusChangeTime;
float m_fInitialZRadius;
float m_fZRadiusChangeAmount;
2020-05-26 23:16:31 +00:00
int16 m_nFadeToBlackTime;
2019-06-16 22:16:38 +00:00
uint8 m_nFadeToBlackInitialIntensity;
2020-05-26 23:16:31 +00:00
int16 m_nFadeToBlackAmount;
2019-06-16 22:16:38 +00:00
uint8 m_nFadeAlphaInitialIntensity;
2020-05-26 23:16:31 +00:00
int16 m_nFadeAlphaTime;
2019-06-16 22:16:38 +00:00
int16 m_nFadeAlphaAmount;
2020-05-26 23:16:31 +00:00
uint8 m_nStartAnimationFrame;
uint8 m_nFinalAnimationFrame;
2019-06-16 22:16:38 +00:00
uint16 m_nAnimationSpeed;
uint16 m_nRotationSpeed;
float m_fGravitationalAcceleration;
int32 m_nFrictionDecceleration;
int32 m_nLifeSpan;
float m_fPositionRandomError;
float m_fVelocityRandomError;
float m_fExpansionRateError;
int32 m_nRotationRateError;
uint32 m_nLifeSpanErrorShape;
float m_fTrailLengthMultiplier;
uint32 Flags;
2020-05-26 23:16:31 +00:00
CRGBA m_RenderColouring;
2019-06-16 22:16:38 +00:00
uint8 m_InitialColorVariation;
2020-05-26 23:16:31 +00:00
CRGBA m_FadeDestinationColor;
2019-06-16 22:16:38 +00:00
uint32 m_ColorFadeTime;
2020-05-26 23:16:31 +00:00
CVector2D m_vecTextureStretch;
float m_fWindFactor;
2020-05-11 02:55:57 +00:00
2019-05-29 00:52:30 +00:00
RwRaster **m_ppRaster;
CParticle *m_pParticles;
};
2019-05-29 18:02:58 +00:00
2020-05-26 23:16:31 +00:00
VALIDATE_SIZE(tParticleSystemData, 0x94);
2019-05-29 00:52:30 +00:00
class cParticleSystemMgr
{
enum
{
CFG_PARAM_PARTICLE_TYPE_NAME = 0,
CFG_PARAM_RENDER_COLOURING_R,
CFG_PARAM_RENDER_COLOURING_G,
CFG_PARAM_RENDER_COLOURING_B,
CFG_PARAM_INITIAL_COLOR_VARIATION,
CFG_PARAM_FADE_DESTINATION_COLOR_R,
CFG_PARAM_FADE_DESTINATION_COLOR_G,
CFG_PARAM_FADE_DESTINATION_COLOR_B,
CFG_PARAM_COLOR_FADE_TIME,
CFG_PARAM_DEFAULT_INITIAL_RADIUS,
CFG_PARAM_EXPANSION_RATE,
CFG_PARAM_INITIAL_INTENSITY,
CFG_PARAM_FADE_TIME,
CFG_PARAM_FADE_AMOUNT,
CFG_PARAM_INITIAL_ALPHA_INTENSITY,
CFG_PARAM_FADE_ALPHA_TIME,
CFG_PARAM_FADE_ALPHA_AMOUNT,
CFG_PARAM_INITIAL_ANGLE,
CFG_PARAM_CHANGE_TIME,
CFG_PARAM_ANGLE_CHANGE_AMOUNT,
CFG_PARAM_INITIAL_Z_RADIUS,
CFG_PARAM_Z_RADIUS_CHANGE_TIME,
CFG_PARAM_Z_RADIUS_CHANGE_AMOUNT,
CFG_PARAM_ANIMATION_SPEED,
CFG_PARAM_START_ANIMATION_FRAME,
CFG_PARAM_FINAL_ANIMATION_FRAME,
CFG_PARAM_ROTATION_SPEED,
CFG_PARAM_GRAVITATIONAL_ACCELERATION,
CFG_PARAM_FRICTION_DECCELERATION,
CFG_PARAM_LIFE_SPAN,
CFG_PARAM_POSITION_RANDOM_ERROR,
CFG_PARAM_VELOCITY_RANDOM_ERROR,
CFG_PARAM_EXPANSION_RATE_ERROR,
CFG_PARAM_ROTATION_RATE_ERROR,
CFG_PARAM_LIFE_SPAN_ERROR_SHAPE,
CFG_PARAM_TRAIL_LENGTH_MULTIPLIER,
2020-05-26 23:16:31 +00:00
CFG_PARAM_STRETCH_VALUE_X,
CFG_PARAM_STRETCH_VALUE_Y,
CFG_PARAM_WIND_FACTOR,
2019-05-29 00:52:30 +00:00
CFG_PARAM_PARTICLE_CREATE_RANGE,
CFG_PARAM_FLAGS,
MAX_CFG_PARAMS,
CFG_PARAM_FIRST = CFG_PARAM_PARTICLE_TYPE_NAME,
CFG_PARAM_LAST = CFG_PARAM_FLAGS
};
public:
2021-01-12 21:07:24 +00:00
tParticleSystemData *m_aParticles;//[MAX_PARTICLES];
2019-05-29 00:52:30 +00:00
2020-04-23 08:24:03 +00:00
cParticleSystemMgr();
2021-01-12 21:07:24 +00:00
#ifdef FIX_BUGS
~cParticleSystemMgr();
#endif
2020-05-11 02:55:57 +00:00
2019-05-29 00:52:30 +00:00
void Initialise();
void LoadParticleData();
2020-04-23 08:24:03 +00:00
void RangeCheck(tParticleSystemData *pData) { }
2019-05-29 00:52:30 +00:00
};
2019-05-29 18:02:58 +00:00
2021-01-12 21:07:24 +00:00
VALIDATE_SIZE(cParticleSystemMgr, 0x4);
2019-05-29 00:52:30 +00:00
2020-05-11 02:55:57 +00:00
extern cParticleSystemMgr mod_ParticleSystemManager;