2022-10-23 13:44:06 +00:00
|
|
|
#ifndef _CVISORFLARE
|
|
|
|
#define _CVISORFLARE
|
|
|
|
|
|
|
|
#include "Kyoto/Graphics/CColor.hpp"
|
2023-10-18 03:06:15 +00:00
|
|
|
#include "Kyoto/TToken.hpp"
|
|
|
|
|
2022-10-23 13:44:06 +00:00
|
|
|
|
|
|
|
#include "rstl/optional_object.hpp"
|
2023-10-18 03:06:15 +00:00
|
|
|
#include "rstl/vector.hpp"
|
|
|
|
|
2022-10-23 13:44:06 +00:00
|
|
|
|
|
|
|
class CTexture;
|
|
|
|
class CStateManager;
|
|
|
|
class CVector3f;
|
|
|
|
class CActor;
|
|
|
|
|
|
|
|
class CVisorFlare {
|
|
|
|
public:
|
|
|
|
enum EBlendMode {
|
|
|
|
kBM_Additive = 0,
|
|
|
|
kBM_Blend = 1,
|
|
|
|
};
|
|
|
|
class CFlareDef {
|
2023-10-18 03:06:15 +00:00
|
|
|
mutable TToken< CTexture > x0_tex;
|
2022-10-23 13:44:06 +00:00
|
|
|
float x8_pos;
|
|
|
|
float xc_scale;
|
|
|
|
CColor x10_color;
|
|
|
|
|
|
|
|
public:
|
|
|
|
// CFlareDef() = default;
|
|
|
|
// CFlareDef(const CFlareDef& other)
|
|
|
|
// : x0_tex(other.x0_tex)
|
|
|
|
// , x8_pos(other.x8_pos)
|
|
|
|
// , xc_scale(other.xc_scale)
|
|
|
|
// , x10_color(other.x10_color)
|
|
|
|
// {}
|
2023-10-18 03:06:15 +00:00
|
|
|
CFlareDef(const TToken< CTexture >& tex, float pos, float scale, uint color);
|
2022-10-23 13:44:06 +00:00
|
|
|
|
2023-10-18 03:06:15 +00:00
|
|
|
TToken< CTexture >& GetTexture() const { return x0_tex; }
|
2022-10-23 13:44:06 +00:00
|
|
|
CColor GetColor() const { return x10_color; }
|
|
|
|
float GetPosition() const { return x8_pos; }
|
|
|
|
float GetScale() const { return xc_scale; }
|
|
|
|
};
|
|
|
|
|
2023-10-18 03:06:15 +00:00
|
|
|
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);
|
|
|
|
|
2022-10-23 13:44:06 +00:00
|
|
|
private:
|
|
|
|
EBlendMode x0_blendMode;
|
2023-10-18 03:06:15 +00:00
|
|
|
rstl::vector< CFlareDef > x4_flareDefs;
|
2022-10-23 13:44:06 +00:00
|
|
|
bool x14_b1;
|
|
|
|
float x18_f1;
|
|
|
|
float x1c_f2;
|
|
|
|
float x20_f3;
|
|
|
|
float x24_;
|
|
|
|
float x28_;
|
|
|
|
int x2c_w1;
|
|
|
|
int x30_w2;
|
|
|
|
|
|
|
|
void SetupRenderState(const CStateManager& mgr) const;
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _CVISORFLARE
|