2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2016-04-16 19:50:45 -07:00
|
|
|
|
2022-01-31 16:06:54 -08:00
|
|
|
#include "Runtime/Graphics/CGraphics.hpp"
|
2019-09-22 14:52:05 -07:00
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/rstl.hpp"
|
|
|
|
#include "Runtime/World/CRippleManager.hpp"
|
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2018-06-06 21:43:26 -07:00
|
|
|
|
2017-03-30 15:36:18 -07:00
|
|
|
class CStateManager;
|
|
|
|
class CScriptWater;
|
2016-04-16 19:50:45 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CFluidPlaneManager {
|
|
|
|
class CSplashRecord {
|
|
|
|
float x0_time = 0.f;
|
|
|
|
TUniqueId x4_id;
|
2017-08-07 23:03:57 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
public:
|
|
|
|
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; }
|
|
|
|
};
|
|
|
|
|
|
|
|
CRippleManager x0_rippleManager;
|
|
|
|
rstl::reserved_vector<CSplashRecord, 32> x18_splashes;
|
|
|
|
float x11c_uvT = 0.f;
|
|
|
|
bool x120_ = false;
|
|
|
|
bool x121_ = false;
|
|
|
|
|
|
|
|
class CFluidProfile {
|
|
|
|
float x0_ = 0.f;
|
|
|
|
float x4_ = 0.f;
|
|
|
|
float x8_ = 0.f;
|
|
|
|
float xc_ = 0.f;
|
|
|
|
float x10_ = 0.f;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void Clear();
|
|
|
|
};
|
|
|
|
static CFluidProfile sProfile;
|
|
|
|
static void SetupRippleMap();
|
2017-08-07 23:03:57 -07:00
|
|
|
|
2017-03-02 23:18:12 -08:00
|
|
|
public:
|
2020-04-12 06:03:28 -07:00
|
|
|
static std::array<std::array<u8, 64>, 64> RippleValues;
|
|
|
|
static std::array<u8, 64> RippleMins;
|
|
|
|
static std::array<u8, 64> RippleMaxs;
|
2022-02-15 21:21:24 -08:00
|
|
|
static std::shared_ptr<aurora::gfx::TextureHandle> RippleMapTex;
|
2017-08-07 23:03:57 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
CFluidPlaneManager();
|
|
|
|
void StartFrame(bool);
|
|
|
|
void EndFrame() { x121_ = false; }
|
|
|
|
void Update(float dt);
|
|
|
|
float GetUVT() const { return x11c_uvT; }
|
|
|
|
float GetLastRippleDeltaTime(TUniqueId rippler) const;
|
|
|
|
float GetLastSplashDeltaTime(TUniqueId splasher) const;
|
|
|
|
void CreateSplash(TUniqueId splasher, CStateManager& mgr, const CScriptWater& water, const zeus::CVector3f& pos,
|
|
|
|
float factor, bool sfx);
|
|
|
|
rstl::reserved_vector<CSplashRecord, 32>& SplashRecords() { return x18_splashes; }
|
|
|
|
const CRippleManager& GetRippleManager() const { return x0_rippleManager; }
|
|
|
|
CRippleManager& RippleManager() { return x0_rippleManager; }
|
2016-04-16 19:50:45 -07:00
|
|
|
};
|
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|