#ifndef __RETRO_CUVELEMENT_HPP__ #define __RETRO_CUVELEMENT_HPP__ #include "IElement.hpp" #include "CToken.hpp" #include "CTexture.hpp" namespace Retro { class CToken; struct SUVElementSet { float xMin, yMin, xMax, yMax; }; class CUVElement : public IElement { public: virtual TLockedToken GetValueTexture(int frame) const=0; virtual void GetValueUV(int frame, SUVElementSet& valOut) const=0; virtual bool HasConstantTexture() const=0; virtual bool HasConstantUV() const=0; }; struct CUVEConstant : public CUVElement { TLockedToken x4_tex; public: CUVEConstant(TToken&& tex) : x4_tex(std::move(tex)) {} TLockedToken GetValueTexture(int frame) const { return TLockedToken(x4_tex); } void GetValueUV(int frame, SUVElementSet& valOut) const { valOut = {0.f, 0.f, 1.f, 1.f}; } bool HasConstantTexture() const {return true;} bool HasConstantUV() const {return true;} }; struct CUVEAnimTexture : public CUVElement { TLockedToken x4_tex; int x10_tileW, x14_tileH, x18_strideW, x1c_strideH; int x20_tiles; bool x24_loop; std::unique_ptr x28_cycleFrameRate; std::vector x2c_uvElems; public: CUVEAnimTexture(TToken&& tex, CIntElement* a, CIntElement* b, CIntElement* c, CIntElement* d, CIntElement* e, bool f); TLockedToken GetValueTexture(int frame) const { return TLockedToken(x4_tex); } void GetValueUV(int frame, SUVElementSet& valOut) const; bool HasConstantTexture() const {return true;} bool HasConstantUV() const {return false;} }; } #endif // __RETRO_CUVELEMENT_HPP__