From f2baf5dc28358866b39b7e87f6da2bf1fdbdf157 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Tue, 17 Oct 2023 23:06:15 -0400 Subject: [PATCH] Link CScriptVisorFlare Former-commit-id: 0680d336c94b3649210ea66c77bf0509e06691db --- configure.py | 2 +- include/MetroidPrime/CVisorFlare.hpp | 30 ++++++++++--------- .../ScriptObjects/CScriptVisorFlare.cpp | 3 ++ 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/configure.py b/configure.py index 35391bb2..9e8975ea 100755 --- a/configure.py +++ b/configure.py @@ -546,7 +546,7 @@ config.libs = [ Object(NonMatching, "MetroidPrime/ScriptObjects/CFishCloud.cpp"), Object(Matching, "MetroidPrime/CHealthInfo.cpp"), Object(NonMatching, "MetroidPrime/Player/CGameState.cpp"), - Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptVisorFlare.cpp"), + Object(Matching, "MetroidPrime/ScriptObjects/CScriptVisorFlare.cpp"), Object( NonMatching, "MetroidPrime/ScriptObjects/CScriptWorldTeleporter.cpp" ), diff --git a/include/MetroidPrime/CVisorFlare.hpp b/include/MetroidPrime/CVisorFlare.hpp index 3b603392..3469bc5e 100644 --- a/include/MetroidPrime/CVisorFlare.hpp +++ b/include/MetroidPrime/CVisorFlare.hpp @@ -1,11 +1,13 @@ #ifndef _CVISORFLARE #define _CVISORFLARE -#include "Kyoto/TToken.hpp" #include "Kyoto/Graphics/CColor.hpp" +#include "Kyoto/TToken.hpp" + -#include "rstl/vector.hpp" #include "rstl/optional_object.hpp" +#include "rstl/vector.hpp" + class CTexture; class CStateManager; @@ -19,7 +21,7 @@ public: kBM_Blend = 1, }; class CFlareDef { - mutable TToken x0_tex; + mutable TToken< CTexture > x0_tex; float x8_pos; float xc_scale; CColor x10_color; @@ -32,17 +34,25 @@ public: // , xc_scale(other.xc_scale) // , x10_color(other.x10_color) // {} - CFlareDef(const TToken& tex, float pos, float scale, uint color); + CFlareDef(const TToken< CTexture >& tex, float pos, float scale, uint color); - TToken& GetTexture() const { return x0_tex; } + TToken< CTexture >& GetTexture() const { return x0_tex; } CColor GetColor() const { return x10_color; } float GetPosition() const { return x8_pos; } float GetScale() const { return xc_scale; } }; + CVisorFlare(EBlendMode blendMode, bool, float, float, float, uint, uint, + const rstl::vector< CFlareDef >& flares); + ~CVisorFlare() {} + + void Update(float dt, const CVector3f& pos, const CActor* act, CStateManager& mgr); + void Render(const CVector3f& pos, const CStateManager& mgr) const; + static rstl::optional_object< CFlareDef > LoadFlareDef(CInputStream& in); + private: EBlendMode x0_blendMode; - rstl::vector x4_flareDefs; + rstl::vector< CFlareDef > x4_flareDefs; bool x14_b1; float x18_f1; float x1c_f2; @@ -56,14 +66,6 @@ private: void ResetTevSwapMode(const CStateManager& mgr) const; void DrawDirect(const CColor& color, float f1, float f2) const; void DrawStreamed(const CColor& color, float f1, float f2) const; - -public: - CVisorFlare(EBlendMode blendMode, bool, float, float, float, uint, uint, const rstl::vector& flares); - ~CVisorFlare() {} - - void Update(float dt, const CVector3f& pos, const CActor* act, CStateManager& mgr); - void Render(const CVector3f& pos, const CStateManager& mgr) const; - static rstl::optional_object LoadFlareDef(CInputStream& in); }; #endif // _CVISORFLARE diff --git a/src/MetroidPrime/ScriptObjects/CScriptVisorFlare.cpp b/src/MetroidPrime/ScriptObjects/CScriptVisorFlare.cpp index 114a4d89..8af2eb9b 100644 --- a/src/MetroidPrime/ScriptObjects/CScriptVisorFlare.cpp +++ b/src/MetroidPrime/ScriptObjects/CScriptVisorFlare.cpp @@ -4,6 +4,9 @@ #include "MetroidPrime/CStateManager.hpp" #include "MetroidPrime/Player/CPlayer.hpp" +// TODO inline depth hack +#pragma inline_max_size(200) + CScriptVisorFlare::CScriptVisorFlare(TUniqueId uid, const rstl::string& name, const CEntityInfo& info, bool active, const CVector3f& pos, CVisorFlare::EBlendMode blendMode, bool b1, float f1, float f2,