From 7d07fb62ae51bf08772b53e1f4081fa8bfcc4b65 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 21 Jul 2016 13:02:53 -0700 Subject: [PATCH] CWorldTransManager and CGraphicsPalette stubs --- Runtime/CGameState.hpp | 2 +- Runtime/Graphics/CGraphicsPalette.hpp | 20 +++++++-- Runtime/World/CWorldTransManager.hpp | 61 +++++++++++++++++++++++++-- 3 files changed, 74 insertions(+), 9 deletions(-) diff --git a/Runtime/CGameState.hpp b/Runtime/CGameState.hpp index 71be31722..c966d1e8e 100644 --- a/Runtime/CGameState.hpp +++ b/Runtime/CGameState.hpp @@ -19,7 +19,7 @@ class CGameState CGameOptions m_gameOpts; double xa0_playTime; public: - CGameState() {} + CGameState() = default; CGameState(CBitStreamReader& stream); void SetCurrentWorldId(unsigned int id, const std::string& name); CWorldTransManager& WorldTransitionManager() {return x9c_transManager;} diff --git a/Runtime/Graphics/CGraphicsPalette.hpp b/Runtime/Graphics/CGraphicsPalette.hpp index 3a61c13f9..a2808733c 100644 --- a/Runtime/Graphics/CGraphicsPalette.hpp +++ b/Runtime/Graphics/CGraphicsPalette.hpp @@ -18,12 +18,24 @@ class CGraphicsPalette { friend class CTextRenderBuffer; EPaletteFormat x0_fmt; - int x4_entryCount; - std::unique_ptr x8_entries; - /* xc_ GXTlutObj here */ + u32 x4_; + int x8_entryCount; + std::unique_ptr xc_entries; + /* x10_ GXTlutObj here */ + bool x1c_ = false; public: CGraphicsPalette(EPaletteFormat fmt, int count) - : x0_fmt(fmt), x4_entryCount(count), x8_entries(new u16[count]) {} + : x0_fmt(fmt), x8_entryCount(count), xc_entries(new u16[count]) {} + CGraphicsPalette(CInputStream& in) + : x0_fmt(EPaletteFormat(in.readUint32Big())) + { + u16 w = in.readUint16Big(); + u16 h = in.readUint16Big(); + x8_entryCount = w * h; + xc_entries[x8_entryCount]; + + /* GX Tlut init here */ + } }; } diff --git a/Runtime/World/CWorldTransManager.hpp b/Runtime/World/CWorldTransManager.hpp index c17e3d07e..62510d115 100644 --- a/Runtime/World/CWorldTransManager.hpp +++ b/Runtime/World/CWorldTransManager.hpp @@ -1,22 +1,75 @@ #ifndef __URDE_CWORLDTRANSMANAGER_HPP__ #define __URDE_CWORLDTRANSMANAGER_HPP__ +#include "RetroTypes.hpp" +#include "CRandom16.hpp" + namespace urde { class CWorldTransManager { - bool m_drawEnabled; + float x0_ = 0.f; + u32 x4_ = 0; + u32 x8_ = 0; + u8 x14_ = 0; + float x18_; + CRandom16 x20_ = CRandom16(99); + u16 x24_ = 1189; + u32 x28_ = 0; + u8 x2c_ = 127; + u8 x2d_ = 64; + u32 x30_ = 0; + float x38_ = 0.f; + union + { + struct + { + bool x44_24_ : 1; + bool x44_25_ : 1; + bool x44_26_ : 1; + bool x44_27_ : 1; + bool x44_28_ : 1; + }; + u8 dummy = 0; + }; public: + CWorldTransManager() : x44_24_(true) {} + + void DrawFirstPass() const {} + void DrawSecondPass() const {} + void DrawAllModels() const {} + void UpdateLights(float) {} + void UpdateEnabled(float) {} + void UpdateDisabled(float) {} + void Update(float) {} void DrawEnabled() const; void DrawDisabled() const; + void sub_80209280() const {} void Draw() const { - if (m_drawEnabled) - DrawEnabled(); - else + if (x30_ == 0) DrawDisabled(); + else if (x30_ == 1) + DrawEnabled(); + else if (x30_ == 2) + sub_80209280(); } + + void StartTransition() + { + x0_ = 0.f; + x18_ = 0.f; + x44_24_ = false; + x44_24_ = true; + } + + void EndTransition() {} + void PleaseStopSoon() {} + bool IsTransitionEnabled() const { return false; } + void DisableTransition() {} + void TouchModels() {} + void EnableTransition() {} }; }