2016-04-17 02:50:45 +00:00
|
|
|
#ifndef __URDE_CFLUIDPLANEMANAGER_HPP__
|
|
|
|
#define __URDE_CFLUIDPLANEMANAGER_HPP__
|
|
|
|
|
2017-03-30 22:36:18 +00:00
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
#include "CRippleManager.hpp"
|
|
|
|
|
2016-04-17 02:50:45 +00:00
|
|
|
namespace urde
|
|
|
|
{
|
2017-03-30 22:36:18 +00:00
|
|
|
class CStateManager;
|
|
|
|
class CScriptWater;
|
2016-04-17 02:50:45 +00:00
|
|
|
|
|
|
|
class CFluidPlaneManager
|
|
|
|
{
|
2017-08-08 06:03:57 +00:00
|
|
|
class CSplashRecord
|
|
|
|
{
|
2018-02-01 23:19:34 +00:00
|
|
|
float x0_time = 0.f;
|
|
|
|
TUniqueId x4_id;
|
2017-08-08 06:03:57 +00:00
|
|
|
public:
|
2018-02-01 23:19:34 +00:00
|
|
|
CSplashRecord(float time, TUniqueId id) : x0_time(time), x4_id(id) {}
|
|
|
|
void SetTime(float t) { x0_time = t; }
|
|
|
|
float GetTime() const { return x0_time; }
|
|
|
|
void SetUniqueId(TUniqueId id) { x4_id = id; }
|
|
|
|
TUniqueId GetUniqueId() const { return x4_id; }
|
2017-08-08 06:03:57 +00:00
|
|
|
};
|
|
|
|
|
2017-03-30 22:36:18 +00:00
|
|
|
CRippleManager x0_rippleManager;
|
2017-08-08 06:03:57 +00:00
|
|
|
rstl::reserved_vector<CSplashRecord, 32> x18_splashes;
|
|
|
|
float x11c_uvT = 0.f;
|
|
|
|
bool x120_ = false;
|
|
|
|
bool x121_ = false;
|
|
|
|
|
2017-03-03 07:18:12 +00:00
|
|
|
class CFluidProfile
|
|
|
|
{
|
2018-02-01 23:19:34 +00:00
|
|
|
float x0_ = 0.f;
|
|
|
|
float x4_ = 0.f;
|
|
|
|
float x8_ = 0.f;
|
|
|
|
float xc_ = 0.f;
|
|
|
|
float x10_ = 0.f;
|
2017-03-03 07:18:12 +00:00
|
|
|
public:
|
|
|
|
void Clear();
|
|
|
|
};
|
|
|
|
static CFluidProfile sProfile;
|
2017-08-08 06:03:57 +00:00
|
|
|
static void SetupRippleMap();
|
2017-03-03 07:18:12 +00:00
|
|
|
public:
|
2017-08-08 06:03:57 +00:00
|
|
|
static u8 RippleValues[64][64];
|
|
|
|
static u8 RippleMins[64];
|
|
|
|
static u8 RippleMaxs[64];
|
|
|
|
|
2017-03-30 22:36:18 +00:00
|
|
|
CFluidPlaneManager();
|
2017-03-03 07:18:12 +00:00
|
|
|
void StartFrame(bool);
|
2017-03-06 06:33:51 +00:00
|
|
|
void EndFrame() { x121_ = false; }
|
2017-03-24 05:30:16 +00:00
|
|
|
void Update(float dt);
|
2017-08-08 06:03:57 +00:00
|
|
|
float GetUVT() const { return x11c_uvT; }
|
2017-03-30 22:36:18 +00:00
|
|
|
float GetLastRippleDeltaTime(TUniqueId rippler) const;
|
2017-07-05 18:34:12 +00:00
|
|
|
float GetLastSplashDeltaTime(TUniqueId splasher) const;
|
2017-03-30 22:36:18 +00:00
|
|
|
void CreateSplash(TUniqueId splasher, CStateManager& mgr, const CScriptWater& water,
|
2018-02-01 23:19:34 +00:00
|
|
|
const zeus::CVector3f& pos, float factor, bool sfx);
|
2017-08-08 06:03:57 +00:00
|
|
|
rstl::reserved_vector<CSplashRecord, 32>& SplashRecords() { return x18_splashes; }
|
2017-08-13 07:56:35 +00:00
|
|
|
const CRippleManager& GetRippleManager() const { return x0_rippleManager; }
|
2017-08-14 03:55:06 +00:00
|
|
|
CRippleManager& RippleManager() { return x0_rippleManager; }
|
2016-04-17 02:50:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CFLUIDPLANEMANAGER_HPP__
|