diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/TextureManager.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.Client/TextureManager.h')
| -rw-r--r-- | Minecraft.Client/TextureManager.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Minecraft.Client/TextureManager.h b/Minecraft.Client/TextureManager.h new file mode 100644 index 00000000..b1d71d2d --- /dev/null +++ b/Minecraft.Client/TextureManager.h @@ -0,0 +1,41 @@ +#pragma once + +class Texture; +class Stitcher; +class TexturePack; + +class TextureManager +{ +private: + static TextureManager *instance; + + int nextID; + typedef unordered_map<wstring, int> stringIntMap; + typedef unordered_map<int, Texture *> intTextureMap; + intTextureMap idToTextureMap; + stringIntMap stringToIDMap; + +public: + static void createInstance(); + static TextureManager *getInstance(); + +private: + TextureManager(); + +public: + int createTextureID(); + Texture *getTexture(const wstring &name); + void registerName(const wstring &name, Texture *texture); + void registerTexture(Texture *texture); + void unregisterTexture(const wstring &name, Texture *texture); + Stitcher *createStitcher(const wstring &name); + vector<Texture *> *createTextures(const wstring &filename, bool mipmap); // 4J added mipmap param + +private: + wstring getTextureNameFromPath(const wstring &filename); + bool isAnimation(const wstring &filename, TexturePack *texturePack); + +public: + Texture *createTexture(const wstring &name, int mode, int width, int height, int wrap, int format, int minFilter, int magFilter, bool mipmap, BufferedImage *image); + Texture *createTexture(const wstring &name, int mode, int width, int height, int format, bool mipmap); // 4J Added mipmap param +};
\ No newline at end of file |
