Link CScriptVisorFlare

Former-commit-id: 0680d336c94b3649210ea66c77bf0509e06691db
This commit is contained in:
Luke Street 2023-10-17 23:06:15 -04:00
parent eb50706b1e
commit f2baf5dc28
3 changed files with 20 additions and 15 deletions

View File

@ -546,7 +546,7 @@ config.libs = [
Object(NonMatching, "MetroidPrime/ScriptObjects/CFishCloud.cpp"), Object(NonMatching, "MetroidPrime/ScriptObjects/CFishCloud.cpp"),
Object(Matching, "MetroidPrime/CHealthInfo.cpp"), Object(Matching, "MetroidPrime/CHealthInfo.cpp"),
Object(NonMatching, "MetroidPrime/Player/CGameState.cpp"), Object(NonMatching, "MetroidPrime/Player/CGameState.cpp"),
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptVisorFlare.cpp"), Object(Matching, "MetroidPrime/ScriptObjects/CScriptVisorFlare.cpp"),
Object( Object(
NonMatching, "MetroidPrime/ScriptObjects/CScriptWorldTeleporter.cpp" NonMatching, "MetroidPrime/ScriptObjects/CScriptWorldTeleporter.cpp"
), ),

View File

@ -1,11 +1,13 @@
#ifndef _CVISORFLARE #ifndef _CVISORFLARE
#define _CVISORFLARE #define _CVISORFLARE
#include "Kyoto/TToken.hpp"
#include "Kyoto/Graphics/CColor.hpp" #include "Kyoto/Graphics/CColor.hpp"
#include "Kyoto/TToken.hpp"
#include "rstl/vector.hpp"
#include "rstl/optional_object.hpp" #include "rstl/optional_object.hpp"
#include "rstl/vector.hpp"
class CTexture; class CTexture;
class CStateManager; class CStateManager;
@ -19,7 +21,7 @@ public:
kBM_Blend = 1, kBM_Blend = 1,
}; };
class CFlareDef { class CFlareDef {
mutable TToken<CTexture> x0_tex; mutable TToken< CTexture > x0_tex;
float x8_pos; float x8_pos;
float xc_scale; float xc_scale;
CColor x10_color; CColor x10_color;
@ -32,17 +34,25 @@ public:
// , xc_scale(other.xc_scale) // , xc_scale(other.xc_scale)
// , x10_color(other.x10_color) // , x10_color(other.x10_color)
// {} // {}
CFlareDef(const TToken<CTexture>& tex, float pos, float scale, uint color); CFlareDef(const TToken< CTexture >& tex, float pos, float scale, uint color);
TToken<CTexture>& GetTexture() const { return x0_tex; } TToken< CTexture >& GetTexture() const { return x0_tex; }
CColor GetColor() const { return x10_color; } CColor GetColor() const { return x10_color; }
float GetPosition() const { return x8_pos; } float GetPosition() const { return x8_pos; }
float GetScale() const { return xc_scale; } 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: private:
EBlendMode x0_blendMode; EBlendMode x0_blendMode;
rstl::vector<CFlareDef> x4_flareDefs; rstl::vector< CFlareDef > x4_flareDefs;
bool x14_b1; bool x14_b1;
float x18_f1; float x18_f1;
float x1c_f2; float x1c_f2;
@ -56,14 +66,6 @@ private:
void ResetTevSwapMode(const CStateManager& mgr) const; void ResetTevSwapMode(const CStateManager& mgr) const;
void DrawDirect(const CColor& color, float f1, float f2) const; void DrawDirect(const CColor& color, float f1, float f2) const;
void DrawStreamed(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<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);
}; };
#endif // _CVISORFLARE #endif // _CVISORFLARE

View File

@ -4,6 +4,9 @@
#include "MetroidPrime/CStateManager.hpp" #include "MetroidPrime/CStateManager.hpp"
#include "MetroidPrime/Player/CPlayer.hpp" #include "MetroidPrime/Player/CPlayer.hpp"
// TODO inline depth hack
#pragma inline_max_size(200)
CScriptVisorFlare::CScriptVisorFlare(TUniqueId uid, const rstl::string& name, CScriptVisorFlare::CScriptVisorFlare(TUniqueId uid, const rstl::string& name,
const CEntityInfo& info, bool active, const CVector3f& pos, const CEntityInfo& info, bool active, const CVector3f& pos,
CVisorFlare::EBlendMode blendMode, bool b1, float f1, float f2, CVisorFlare::EBlendMode blendMode, bool b1, float f1, float f2,