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"
|
2017-03-04 04:31:08 +00:00
|
|
|
#include "zeus/CFrustum.hpp"
|
2016-04-07 07:10:08 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2015-08-18 05:54:43 +00:00
|
|
|
{
|
2017-03-04 04:31:08 +00:00
|
|
|
class CStateManager;
|
|
|
|
|
2016-04-07 07:10:08 +00:00
|
|
|
class CDecalManager
|
|
|
|
{
|
|
|
|
struct SDecal
|
|
|
|
{
|
2017-03-04 04:31:08 +00:00
|
|
|
std::experimental::optional<CDecal> x0_decal;
|
|
|
|
TAreaId x70_areaId;
|
2018-03-17 03:41:01 +00:00
|
|
|
s8 x74_index;
|
|
|
|
bool x75_24_notIce : 1;
|
|
|
|
SDecal(const std::experimental::optional<CDecal>& decal, TAreaId aid, s8 idx, bool notIce)
|
|
|
|
: x0_decal(decal), x70_areaId(aid), x74_index(idx) { x75_24_notIce = notIce; }
|
2016-04-07 07:10:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static bool m_PoolInitialized;
|
|
|
|
static s32 m_FreeIndex;
|
|
|
|
static float m_DeltaTimeSinceLastDecalCreation;
|
|
|
|
static s32 m_LastDecalCreatedIndex;
|
2017-08-13 05:26:14 +00:00
|
|
|
static CAssetId m_LastDecalCreatedAssetId;
|
2016-04-07 07:10:08 +00:00
|
|
|
static rstl::reserved_vector<SDecal, 64> m_DecalPool;
|
|
|
|
static rstl::reserved_vector<s32, 64> m_ActiveIndexList;
|
2018-03-17 03:41:01 +00:00
|
|
|
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:
|
|
|
|
static void Initialize();
|
2018-03-17 03:41:01 +00:00
|
|
|
static void Reinitialize();
|
2017-01-22 01:40:12 +00:00
|
|
|
static void Shutdown();
|
2017-03-04 04:31:08 +00:00
|
|
|
static void AddToRenderer(const zeus::CFrustum& frustum, const CStateManager& mgr);
|
2017-03-24 05:30:16 +00:00
|
|
|
static void Update(float dt, CStateManager& mgr);
|
2018-02-12 05:30:21 +00:00
|
|
|
static void AddDecal(const TToken<CDecalDescription>& decal, const zeus::CTransform& xf,
|
2018-03-17 03:41:01 +00:00
|
|
|
bool notIce, CStateManager& mgr);
|
2015-08-18 05:54:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|