metaforce/Runtime/Particle/CDecalManager.hpp

45 lines
1.4 KiB
C++
Raw Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
2015-08-17 22:54:43 -07:00
#include <optional>
#include "Runtime/CToken.hpp"
#include "Runtime/RetroTypes.hpp"
#include "Runtime/rstl.hpp"
#include "Runtime/Particle/CDecal.hpp"
#include <zeus/CFrustum.hpp>
2016-04-07 00:10:08 -07:00
2021-04-10 01:42:06 -07:00
namespace metaforce {
class CStateManager;
2018-12-07 21:30:43 -08:00
class CDecalManager {
struct SDecal {
std::optional<CDecal> x0_decal;
2018-12-07 21:30:43 -08:00
TAreaId x70_areaId;
s8 x74_index;
bool x75_24_notIce : 1;
SDecal(const std::optional<CDecal>& decal, TAreaId aid, s8 idx, bool notIce)
: x0_decal(decal), x70_areaId(aid), x74_index(idx), x75_24_notIce(notIce) {}
2018-12-07 21:30:43 -08:00
};
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 00:10:08 -07:00
public:
2018-12-07 21:30:43 -08: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-17 22:54:43 -07:00
};
2021-04-10 01:42:06 -07:00
} // namespace metaforce