metaforce/Runtime/Particle/CDecalManager.hpp

46 lines
1.4 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2015-08-18 05:54:43 +00:00
2016-04-07 07:10:08 +00:00
#include "RetroTypes.hpp"
#include "rstl.hpp"
#include "optional.hpp"
#include "CToken.hpp"
2016-08-04 22:24:28 +00:00
#include "CDecal.hpp"
#include "zeus/CFrustum.hpp"
2016-04-07 07:10:08 +00:00
2018-12-08 05:30:43 +00:00
namespace urde {
class CStateManager;
2018-12-08 05:30:43 +00:00
class CDecalManager {
struct SDecal {
2019-01-29 08:28:35 +00:00
rstl::optional<CDecal> x0_decal;
2018-12-08 05:30:43 +00:00
TAreaId x70_areaId;
s8 x74_index;
bool x75_24_notIce : 1;
2019-01-29 08:28:35 +00:00
SDecal(const rstl::optional<CDecal>& decal, TAreaId aid, s8 idx, bool notIce)
2018-12-08 05:30:43 +00:00
: x0_decal(decal), x70_areaId(aid), x74_index(idx) {
x75_24_notIce = notIce;
}
};
static bool m_PoolInitialized;
static s32 m_FreeIndex;
static float m_DeltaTimeSinceLastDecalCreation;
static s32 m_LastDecalCreatedIndex;
static CAssetId m_LastDecalCreatedAssetId;
static rstl::reserved_vector<SDecal, 64> m_DecalPool;
static rstl::reserved_vector<s32, 64> m_ActiveIndexList;
static rstl::reserved_vector<s32, 64>::iterator RemoveFromActiveList(rstl::reserved_vector<s32, 64>::iterator it,
s32 idx);
2016-04-07 07:10:08 +00:00
public:
2018-12-08 05:30:43 +00:00
static void Initialize();
static void Reinitialize();
static void Shutdown();
static void AddToRenderer(const zeus::CFrustum& frustum, const CStateManager& mgr);
static void Update(float dt, CStateManager& mgr);
static void AddDecal(const TToken<CDecalDescription>& decal, const zeus::CTransform& xf, bool notIce,
CStateManager& mgr);
2015-08-18 05:54:43 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace urde