From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.Client/StitchedTexture.h | 89 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Minecraft.Client/StitchedTexture.h (limited to 'Minecraft.Client/StitchedTexture.h') diff --git a/Minecraft.Client/StitchedTexture.h b/Minecraft.Client/StitchedTexture.h new file mode 100644 index 00000000..99b1d447 --- /dev/null +++ b/Minecraft.Client/StitchedTexture.h @@ -0,0 +1,89 @@ +#pragma once +using namespace std; + +#include "..\Minecraft.World\Icon.h" +class Texture; + +class StitchedTexture : public Icon +{ +private: + const wstring name; + +protected: + Texture *source; + vector *frames; + +private: + typedef vector > intPairVector; + intPairVector *frameOverride; + int flags; + +protected: + bool rotated; + + int x; + int y; + +protected: + int width; + int height; + + float u0; + float u1; + float v0; + float v1; + + float widthTranslation; + float heightTranslation; + +protected: + int frame; + int subFrame; + +public: + static StitchedTexture *create(const wstring &name); + + ~StitchedTexture(); +protected: + StitchedTexture(const wstring &name); + +public: + void initUVs(float U0, float V0, float U1, float V1); + void init(Texture *source, vector *frames, int x, int y, int width, int height, bool rotated); + void replaceWith(StitchedTexture *texture); + int getX() const; + int getY() const; + int getWidth() const; + int getHeight() const; + float getU0(bool adjust = false) const; + float getU1(bool adjust = false) const; + float getU(double offset, bool adjust = false) const; + float getV0(bool adjust = false) const; + float getV1(bool adjust = false) const; + float getV(double offset, bool adjust = false) const; + wstring getName() const; + virtual int getSourceWidth() const; + virtual int getSourceHeight() const; + virtual void cycleFrames(); + Texture *getSource(); + Texture *getFrame(int i); + virtual int getFrames(); + + /** + * Loads animation frames from a file with the syntax, + * 0,1,2,3, + * 4*10,5*10, + * 4*10,3,2,1, + * 0 + * or similar + * + * @param bufferedReader + */ + void loadAnimationFrames(BufferedReader *bufferedReader); + void loadAnimationFrames(const wstring &string); // 4J Added + + int getFlags() const ; // 4J added + void setFlags(int flags); // 4J added + virtual void freeFrameTextures(); // 4J added + virtual bool hasOwnData(); // 4J Added +}; \ No newline at end of file -- cgit v1.2.3