metaforce/Runtime/GuiSys/CAuiImagePane.hpp

57 lines
2.1 KiB
C++
Raw Normal View History

2016-03-10 03:47:37 +00:00
#ifndef __URDE_CAUIIMAGEPANE_HPP__
#define __URDE_CAUIIMAGEPANE_HPP__
#include "CGuiWidget.hpp"
2017-05-14 19:58:44 +00:00
#include "CToken.hpp"
2017-05-18 07:07:49 +00:00
#include "Graphics/Shaders/CTexturedQuadFilter.hpp"
2016-03-10 03:47:37 +00:00
namespace urde
{
class CSimplePool;
2017-05-14 19:58:44 +00:00
class CTexture;
2016-03-10 03:47:37 +00:00
class CAuiImagePane : public CGuiWidget
{
2017-05-14 19:58:44 +00:00
TLockedToken<CTexture> xb8_tex0Tok; // Used to be optional
2017-08-13 05:26:14 +00:00
CAssetId xc8_tex0;
CAssetId xcc_tex1;
2017-05-18 07:07:49 +00:00
zeus::CVector2f xd0_uvBias0;
zeus::CVector2f xd8_uvBias1;
2017-05-14 19:58:44 +00:00
rstl::reserved_vector<zeus::CVector3f, 4> xe0_coords;
rstl::reserved_vector<zeus::CVector2f, 4> x114_uvs;
2017-05-18 07:07:49 +00:00
zeus::CVector2f x138_tileSize;
2017-05-14 19:58:44 +00:00
float x140_interval = 0.f;
2017-05-18 07:07:49 +00:00
float x144_frameTimer = 0.f;
float x148_fadeDuration = 0.f;
2017-05-17 05:04:38 +00:00
float x14c_deResFactor = 0.f;
2017-05-18 07:07:49 +00:00
float x150_flashFactor = 0.f;
struct Filters
{
CTexturedQuadFilterAlpha m_darkenerQuad;
CTexturedQuadFilterAlpha m_flashQuad[2];
CTexturedQuadFilterAlpha m_alphaQuad[2];
CTexturedQuadFilterAlpha m_addQuad[2];
Filters(TLockedToken<CTexture>& tex);
};
std::experimental::optional<Filters> m_filters;
void DoDrawImagePane(const zeus::CColor& color, const CTexture& tex,
int frame, float blurAmt, bool noBlur, CTexturedQuadFilterAlpha& quad) const;
public:
2017-08-13 05:26:14 +00:00
CAuiImagePane(const CGuiWidgetParms& parms, CSimplePool* sp, CAssetId, CAssetId,
rstl::reserved_vector<zeus::CVector3f, 4>&& coords,
2017-05-14 19:58:44 +00:00
rstl::reserved_vector<zeus::CVector2f, 4>&& uvs, bool initTex);
2017-01-29 03:58:16 +00:00
FourCC GetWidgetTypeID() const { return FOURCC('IMGP'); }
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
2017-05-14 19:58:44 +00:00
2017-05-18 07:07:49 +00:00
void Update(float dt);
void Draw(const CGuiWidgetDrawParms& params) const;
bool GetIsFinishedLoadingWidgetSpecific() const;
2017-08-13 05:26:14 +00:00
void SetTextureID0(CAssetId tex, CSimplePool* sp);
2017-05-14 19:58:44 +00:00
void SetAnimationParms(const zeus::CVector2f& vec, float interval, float duration);
2017-05-17 05:04:38 +00:00
void SetDeResFactor(float d) { x14c_deResFactor = d; }
2017-05-18 07:07:49 +00:00
void SetFlashFactor(float t) { x150_flashFactor = t; }
2016-03-10 03:47:37 +00:00
};
}
#endif // __URDE_CAUIIMAGEPANE_HPP__