2016-04-13 06:07:23 +00:00
|
|
|
#ifndef __URDE_CWORLDTRANSMANAGER_HPP__
|
|
|
|
#define __URDE_CWORLDTRANSMANAGER_HPP__
|
2015-08-17 05:26:58 +00:00
|
|
|
|
2016-07-21 20:02:53 +00:00
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
#include "CRandom16.hpp"
|
2016-08-15 20:58:07 +00:00
|
|
|
#include "Character/CModelData.hpp"
|
|
|
|
#include "GuiSys/CGuiTextSupport.hpp"
|
2016-08-16 22:49:19 +00:00
|
|
|
#include "Graphics/CLight.hpp"
|
2016-08-17 01:58:53 +00:00
|
|
|
#include "Graphics/Shaders/CColoredQuadFilter.hpp"
|
2016-08-20 04:22:13 +00:00
|
|
|
#include "Graphics/Shaders/CTexturedQuadFilter.hpp"
|
2016-08-21 20:39:18 +00:00
|
|
|
#include "Graphics/Shaders/CCameraBlurFilter.hpp"
|
2016-07-21 20:02:53 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2015-08-17 22:05:00 +00:00
|
|
|
{
|
2016-08-15 20:58:07 +00:00
|
|
|
class CSimplePool;
|
|
|
|
class CStringTable;
|
2015-08-17 22:05:00 +00:00
|
|
|
|
2015-08-17 05:26:58 +00:00
|
|
|
class CWorldTransManager
|
|
|
|
{
|
2016-08-15 20:58:07 +00:00
|
|
|
public:
|
|
|
|
enum class ETransType
|
|
|
|
{
|
2016-08-16 22:49:19 +00:00
|
|
|
Disabled,
|
|
|
|
Enabled,
|
2016-08-15 20:58:07 +00:00
|
|
|
Text
|
|
|
|
};
|
|
|
|
|
2016-08-16 22:49:19 +00:00
|
|
|
struct SModelDatas
|
2016-08-15 20:58:07 +00:00
|
|
|
{
|
2016-08-16 22:49:19 +00:00
|
|
|
CAnimRes x0_samusRes;
|
|
|
|
CModelData x1c_samusModelData;
|
|
|
|
CModelData x68_beamModelData;
|
|
|
|
CModelData xb4_platformModelData;
|
2016-09-02 21:39:46 +00:00
|
|
|
CModelData x100_bgModelData[3];
|
2016-08-16 22:49:19 +00:00
|
|
|
TLockedToken<CModel> x14c_beamModel;
|
|
|
|
TLockedToken<CModel> x158_suitModel;
|
|
|
|
TLockedToken<CSkinRules> x164_suitSkin;
|
|
|
|
zeus::CTransform x170_gunXf;
|
|
|
|
std::vector<CLight> x1a0_lights;
|
|
|
|
//std::unique_ptr<u8> x1b0_dissolveTextureBuffer;
|
|
|
|
zeus::CVector2f x1b4_shakeResult;
|
|
|
|
zeus::CVector2f x1bc_shakeDelta;
|
|
|
|
float x1c4_randTimeout = 0.f;
|
|
|
|
float x1c8_blurResult = 0.f;
|
|
|
|
float x1cc_blurDelta = 0.f;
|
|
|
|
float x1d0_dissolveStartTime = 99999.f;
|
2016-08-20 04:22:13 +00:00
|
|
|
float x1d4_dissolveEndTime = 99999.f;
|
|
|
|
float x1d8_transCompleteTime = 99999.f;
|
2016-08-16 22:49:19 +00:00
|
|
|
bool x1dc_dissolveStarted = false;
|
|
|
|
|
|
|
|
SModelDatas(const CAnimRes& samusRes);
|
2016-08-15 20:58:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
2016-08-16 22:49:19 +00:00
|
|
|
float x0_curTime = 0.f;
|
|
|
|
std::unique_ptr<SModelDatas> x4_modelData;
|
2016-08-15 20:58:07 +00:00
|
|
|
std::unique_ptr<CGuiTextSupport> x8_textData;
|
|
|
|
TLockedToken<CStringTable> xc_strTable;
|
2016-07-21 20:02:53 +00:00
|
|
|
u8 x14_ = 0;
|
2016-08-16 22:49:19 +00:00
|
|
|
float x18_bgOffset;
|
|
|
|
float x1c_bgHeight;
|
|
|
|
CRandom16 x20_random = CRandom16(99);
|
2016-07-21 20:02:53 +00:00
|
|
|
u16 x24_ = 1189;
|
|
|
|
u32 x28_ = 0;
|
|
|
|
u8 x2c_ = 127;
|
|
|
|
u8 x2d_ = 64;
|
2016-08-16 22:49:19 +00:00
|
|
|
ETransType x30_type = ETransType::Disabled;
|
2016-07-21 20:02:53 +00:00
|
|
|
float x38_ = 0.f;
|
2016-08-15 20:58:07 +00:00
|
|
|
bool x40_;
|
2016-07-21 20:02:53 +00:00
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
2016-08-20 04:22:13 +00:00
|
|
|
bool x44_24_transFinished : 1;
|
2016-08-16 22:49:19 +00:00
|
|
|
bool x44_25_stopSoon : 1;
|
|
|
|
bool x44_26_goingUp : 1;
|
2016-07-21 20:02:53 +00:00
|
|
|
bool x44_27_ : 1;
|
|
|
|
bool x44_28_ : 1;
|
|
|
|
};
|
|
|
|
u8 dummy = 0;
|
|
|
|
};
|
2016-08-16 22:49:19 +00:00
|
|
|
|
2016-08-20 04:22:13 +00:00
|
|
|
CColoredQuadFilter m_fadeToBlack = { CCameraFilterPass::EFilterType::Blend };
|
|
|
|
CTexturedQuadFilter m_dissolve = { CCameraFilterPass::EFilterType::Blend,
|
|
|
|
CGraphics::g_SpareTexture };
|
|
|
|
CWideScreenFilter m_widescreen = { CCameraFilterPass::EFilterType::Blend };
|
2016-08-21 20:39:18 +00:00
|
|
|
CCameraBlurFilter m_camblur;
|
2016-08-17 01:58:53 +00:00
|
|
|
|
2016-08-20 04:22:13 +00:00
|
|
|
static int GetSuitCharIdx();
|
|
|
|
void DrawFirstPass();
|
|
|
|
void DrawSecondPass();
|
|
|
|
void DrawAllModels();
|
2016-08-16 22:49:19 +00:00
|
|
|
void UpdateLights(float dt);
|
|
|
|
void UpdateEnabled(float);
|
|
|
|
void UpdateDisabled(float);
|
|
|
|
void UpdateText(float);
|
2016-08-17 01:58:53 +00:00
|
|
|
void DrawEnabled();
|
|
|
|
void DrawDisabled();
|
|
|
|
void DrawText();
|
2016-08-20 04:22:13 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
CWorldTransManager() : x44_24_transFinished(true) {}
|
|
|
|
|
|
|
|
|
|
|
|
void Update(float);
|
2016-08-17 01:58:53 +00:00
|
|
|
void Draw();
|
2016-07-21 20:02:53 +00:00
|
|
|
|
2016-08-16 22:49:19 +00:00
|
|
|
void EnableTransition(const CAnimRes& samusRes,
|
|
|
|
ResId platRes, const zeus::CVector3f& platScale,
|
|
|
|
ResId bgRes, const zeus::CVector3f& bgScale, bool goingUp);
|
|
|
|
void EnableTransition(ResId fontId, ResId stringId, bool b1, bool b2,
|
|
|
|
float chFadeTime, float chFadeRate, float f3);
|
2016-08-15 20:58:07 +00:00
|
|
|
|
2016-08-16 22:49:19 +00:00
|
|
|
void StartTransition();
|
|
|
|
void EndTransition();
|
2016-08-20 04:22:13 +00:00
|
|
|
bool IsTransitionFinished() const { return x44_24_transFinished; }
|
2016-08-16 22:49:19 +00:00
|
|
|
void PleaseStopSoon() { x44_25_stopSoon = true; }
|
|
|
|
bool IsTransitionEnabled() const { return x30_type != ETransType::Disabled; }
|
|
|
|
void DisableTransition();
|
|
|
|
void TouchModels();
|
2016-09-14 05:45:46 +00:00
|
|
|
ETransType GetTransType() { return x30_type; }
|
2015-08-17 05:26:58 +00:00
|
|
|
};
|
|
|
|
|
2015-08-17 22:05:00 +00:00
|
|
|
}
|
|
|
|
|
2016-04-13 06:07:23 +00:00
|
|
|
#endif // __URDE_CWORLDTRANSMANAGER_HPP__
|