summaryrefslogtreecommitdiffstats
path: root/src/objects/ParticleObject.h
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-08-17 14:46:19 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2019-08-17 14:46:19 +0200
commit13233ccaed3fd7aad37c99326beee3ddfaf437f3 (patch)
tree82f5205ffe573d41060ec29646e821841f651837 /src/objects/ParticleObject.h
parentmore CCarCtrl (diff)
parentMerge pull request #193 from erorcun/erorcun (diff)
downloadre3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.tar
re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.tar.gz
re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.tar.bz2
re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.tar.lz
re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.tar.xz
re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.tar.zst
re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.zip
Diffstat (limited to '')
-rw-r--r--src/objects/ParticleObject.h83
1 files changed, 76 insertions, 7 deletions
diff --git a/src/objects/ParticleObject.h b/src/objects/ParticleObject.h
index 192d3703..a0d99b69 100644
--- a/src/objects/ParticleObject.h
+++ b/src/objects/ParticleObject.h
@@ -1,6 +1,9 @@
#pragma once
-
#include "Placeable.h"
+#include "AudioManager.h"
+
+#define MAX_PARTICLEOBJECTS 100
+#define MAX_AUDIOHYDRANTS 8
enum eParticleObjectType
{
@@ -26,13 +29,79 @@ enum eParticleObjectType
POBJECT_CATALINAS_SHOTGUNFLASH,
};
+enum eParticleObjectState
+{
+ POBJECTSTATE_INITIALISED = 0,
+ POBJECTSTATE_UPDATE_CLOSE,
+ POBJECTSTATE_UPDATE_FAR,
+ POBJECTSTATE_FREE,
+};
+
+enum tParticleType;
+class CParticle;
+
class CParticleObject : CPlaceable
{
public:
- static void AddObject(uint16 type, const CVector &pos, uint8 remove);
- static void AddObject(uint16 type, const CVector &pos, float size, uint8 remove);
- static void AddObject(uint16 type, const CVector &pos, const CVector &dir, float size, uint8 remove);
- static void AddObject(uint16 type, const CVector &pos, const CVector &dir, float size, uint32, const RwRGBA &col, uint8 remove);
- static void Initialise();
- static void UpdateAll();
+ CParticleObject *m_pNext;
+ CParticleObject *m_pPrev;
+ CParticle *m_pParticle;
+ uint32 m_nRemoveTimer;
+ eParticleObjectType m_Type;
+ tParticleType m_ParticleType;
+ uint8 m_nNumEffectCycles;
+ uint8 m_nSkipFrames;
+ uint16 m_nFrameCounter;
+ uint16 m_nState;
+ char _pad0[2];
+ CVector m_vecTarget;
+ float m_fRandVal;
+ float m_fSize;
+ CRGBA m_Color;
+ uint8 m_bRemove;
+ int8 m_nCreationChance;
+ char _pad1[2];
+
+ static CParticleObject *&pCloseListHead;
+ static CParticleObject *&pFarListHead;
+ static CParticleObject *&pUnusedListHead;
+
+ CParticleObject();
+ ~CParticleObject();
+
+ static void Initialise(void);
+
+ static CParticleObject *AddObject(uint16 type, CVector const &pos, uint8 remove);
+ static CParticleObject *AddObject(uint16 type, CVector const &pos, float size, uint8 remove);
+ static CParticleObject *AddObject(uint16 type, CVector const &pos, CVector const &target, float size, uint8 remove);
+ static CParticleObject *AddObject(uint16 type, CVector const &pos, CVector const &target, float size, uint32 lifeTime, RwRGBA const &color, uint8 remove);
+
+ void RemoveObject(void);
+
+ static void UpdateAll(void);
+ void UpdateClose(void);
+ void UpdateFar(void);
+
+ static bool SaveParticle(uint8 *buffer, uint32 *length);
+ static bool LoadParticle(uint8 *buffer, uint32 length);
+
+ static void RemoveAllParticleObjects(void);
+ static void MoveToList(CParticleObject **from, CParticleObject **to, CParticleObject *obj);
};
+
+extern CParticleObject (&gPObjectArray)[MAX_PARTICLEOBJECTS];
+
+class CAudioHydrant
+{
+public:
+ int32 AudioEntity;
+ CParticleObject *pParticleObject;
+
+ CAudioHydrant() :
+ AudioEntity(AEHANDLE_NONE),
+ pParticleObject(NULL)
+ { }
+
+ static bool Add (CParticleObject *particleobject);
+ static void Remove(CParticleObject *particleobject);
+}; \ No newline at end of file