mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-17 01:37:03 +00:00
New code style refactor
This commit is contained in:
@@ -6,65 +6,48 @@
|
||||
|
||||
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#UV_Elements */
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace urde {
|
||||
class CToken;
|
||||
|
||||
struct SUVElementSet
|
||||
{
|
||||
float xMin, yMin, xMax, yMax;
|
||||
struct SUVElementSet {
|
||||
float xMin, yMin, xMax, yMax;
|
||||
};
|
||||
|
||||
class CUVElement : public IElement
|
||||
{
|
||||
class CUVElement : public IElement {
|
||||
public:
|
||||
virtual TLockedToken<CTexture> GetValueTexture(int frame) const=0;
|
||||
virtual void GetValueUV(int frame, SUVElementSet& valOut) const=0;
|
||||
virtual bool HasConstantTexture() const=0;
|
||||
virtual bool HasConstantUV() const=0;
|
||||
virtual TLockedToken<CTexture> 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<CTexture> x4_tex;
|
||||
struct CUVEConstant : public CUVElement {
|
||||
TLockedToken<CTexture> x4_tex;
|
||||
|
||||
public:
|
||||
CUVEConstant(TToken<CTexture>&& tex)
|
||||
: x4_tex(std::move(tex))
|
||||
{
|
||||
|
||||
}
|
||||
TLockedToken<CTexture> GetValueTexture(int frame) const
|
||||
{
|
||||
return TLockedToken<CTexture>(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;}
|
||||
CUVEConstant(TToken<CTexture>&& tex) : x4_tex(std::move(tex)) {}
|
||||
TLockedToken<CTexture> GetValueTexture(int frame) const { return TLockedToken<CTexture>(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<CTexture> x4_tex;
|
||||
int x10_tileW, x14_tileH, x18_strideW, x1c_strideH;
|
||||
int x20_tiles;
|
||||
bool x24_loop;
|
||||
std::unique_ptr<CIntElement> x28_cycleFrames;
|
||||
std::vector<SUVElementSet> x2c_uvElems;
|
||||
struct CUVEAnimTexture : public CUVElement {
|
||||
TLockedToken<CTexture> x4_tex;
|
||||
int x10_tileW, x14_tileH, x18_strideW, x1c_strideH;
|
||||
int x20_tiles;
|
||||
bool x24_loop;
|
||||
std::unique_ptr<CIntElement> x28_cycleFrames;
|
||||
std::vector<SUVElementSet> x2c_uvElems;
|
||||
|
||||
public:
|
||||
CUVEAnimTexture(TToken<CTexture>&& tex, std::unique_ptr<CIntElement>&& tileW, std::unique_ptr<CIntElement>&& tileH,
|
||||
std::unique_ptr<CIntElement>&& strideW, std::unique_ptr<CIntElement>&& strideH,
|
||||
std::unique_ptr<CIntElement>&& cycleFrames, bool loop);
|
||||
TLockedToken<CTexture> GetValueTexture(int frame) const
|
||||
{
|
||||
return TLockedToken<CTexture>(x4_tex);
|
||||
}
|
||||
void GetValueUV(int frame, SUVElementSet& valOut) const;
|
||||
bool HasConstantTexture() const {return true;}
|
||||
bool HasConstantUV() const {return false;}
|
||||
CUVEAnimTexture(TToken<CTexture>&& tex, std::unique_ptr<CIntElement>&& tileW, std::unique_ptr<CIntElement>&& tileH,
|
||||
std::unique_ptr<CIntElement>&& strideW, std::unique_ptr<CIntElement>&& strideH,
|
||||
std::unique_ptr<CIntElement>&& cycleFrames, bool loop);
|
||||
TLockedToken<CTexture> GetValueTexture(int frame) const { return TLockedToken<CTexture>(x4_tex); }
|
||||
void GetValueUV(int frame, SUVElementSet& valOut) const;
|
||||
bool HasConstantTexture() const { return true; }
|
||||
bool HasConstantUV() const { return false; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user