2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-03-10 03:47:37 +00:00
|
|
|
|
2020-03-18 01:18:52 +00:00
|
|
|
#include <array>
|
|
|
|
|
2019-09-22 21:52:05 +00:00
|
|
|
#include "Runtime/CToken.hpp"
|
|
|
|
#include "Runtime/rstl.hpp"
|
|
|
|
#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp"
|
|
|
|
#include "Runtime/GuiSys/CGuiWidget.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CVector2f.hpp>
|
|
|
|
#include <zeus/CVector3f.hpp>
|
|
|
|
|
|
|
|
namespace zeus {
|
|
|
|
class CColor;
|
|
|
|
}
|
2016-03-10 03:47:37 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2017-01-22 01:40:12 +00:00
|
|
|
class CSimplePool;
|
2017-05-14 19:58:44 +00:00
|
|
|
class CTexture;
|
2016-03-10 03:47:37 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CAuiImagePane : public CGuiWidget {
|
|
|
|
TLockedToken<CTexture> xb8_tex0Tok; // Used to be optional
|
|
|
|
CAssetId xc8_tex0;
|
|
|
|
CAssetId xcc_tex1;
|
|
|
|
zeus::CVector2f xd0_uvBias0;
|
|
|
|
zeus::CVector2f xd8_uvBias1;
|
|
|
|
rstl::reserved_vector<zeus::CVector3f, 4> xe0_coords;
|
|
|
|
rstl::reserved_vector<zeus::CVector2f, 4> x114_uvs;
|
|
|
|
zeus::CVector2f x138_tileSize;
|
|
|
|
float x140_interval = 0.f;
|
|
|
|
float x144_frameTimer = 0.f;
|
|
|
|
float x148_fadeDuration = 0.f;
|
|
|
|
float x14c_deResFactor = 0.f;
|
|
|
|
float x150_flashFactor = 0.f;
|
|
|
|
struct Filters {
|
|
|
|
CAssetId m_texId;
|
|
|
|
CTexturedQuadFilterAlpha m_darkenerQuad;
|
2020-03-18 01:18:52 +00:00
|
|
|
std::array<CTexturedQuadFilterAlpha, 2> m_flashQuad;
|
|
|
|
std::array<CTexturedQuadFilterAlpha, 2> m_alphaQuad;
|
|
|
|
std::array<CTexturedQuadFilterAlpha, 2> m_addQuad;
|
|
|
|
explicit Filters(TLockedToken<CTexture>& tex);
|
2018-12-08 05:30:43 +00:00
|
|
|
};
|
2019-06-12 02:05:17 +00:00
|
|
|
std::optional<Filters> m_filters;
|
2018-12-08 05:30:43 +00:00
|
|
|
void DoDrawImagePane(const zeus::CColor& color, const CTexture& tex, int frame, float blurAmt, bool noBlur,
|
|
|
|
CTexturedQuadFilterAlpha& quad) const;
|
|
|
|
|
2017-01-22 01:40:12 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CAuiImagePane(const CGuiWidgetParms& parms, CSimplePool* sp, CAssetId, CAssetId,
|
|
|
|
rstl::reserved_vector<zeus::CVector3f, 4>&& coords, rstl::reserved_vector<zeus::CVector2f, 4>&& uvs,
|
|
|
|
bool initTex);
|
2019-08-09 12:45:18 +00:00
|
|
|
FourCC GetWidgetTypeID() const override { return FOURCC('IMGP'); }
|
2018-12-08 05:30:43 +00:00
|
|
|
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
2017-05-14 19:58:44 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
void Reset(ETraversalMode mode) override;
|
|
|
|
void Update(float dt) override;
|
2020-03-18 05:14:36 +00:00
|
|
|
void Draw(const CGuiWidgetDrawParms& params) override;
|
|
|
|
bool GetIsFinishedLoadingWidgetSpecific() override;
|
2018-12-08 05:30:43 +00:00
|
|
|
void SetTextureID0(CAssetId tex, CSimplePool* sp);
|
|
|
|
void SetAnimationParms(const zeus::CVector2f& vec, float interval, float duration);
|
|
|
|
void SetDeResFactor(float d) { x14c_deResFactor = d; }
|
|
|
|
void SetFlashFactor(float t) { x150_flashFactor = t; }
|
2016-03-10 03:47:37 +00:00
|
|
|
};
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|