4jcraft/targets/minecraft/client/renderer/texture/TextureManager.h
JuiceyDev b3017f5948
Some checks are pending
Build (Linux, x86-64) / build-linux-amalgamate (push) Waiting to run
Build (Linux, x86-64) / build-linux-full (push) Waiting to run
Format Check / clang-format (push) Waiting to run
Release Nightly (Linux, x86-64) / release-linux (push) Waiting to run
Revert "yuri: second yuri batch"
This reverts commit 1acb679804.
2026-04-07 13:06:37 +02:00

51 lines
1.6 KiB
C++

#pragma once
#include <format>
#include <string>
#include <unordered_map>
#include <vector>
class Texture;
class Stitcher;
class TexturePack;
class BufferedImage;
class TextureManager {
private:
static TextureManager* instance;
int nextID;
typedef std::unordered_map<std::wstring, int> stringIntMap;
typedef std::unordered_map<int, Texture*> intTextureMap;
intTextureMap idToTextureMap;
stringIntMap stringToIDMap;
public:
static void createInstance();
static TextureManager* getInstance();
private:
TextureManager();
public:
int createTextureID();
Texture* getTexture(const std::wstring& name);
void registerName(const std::wstring& name, Texture* texture);
void registerTexture(Texture* texture);
void unregisterTexture(const std::wstring& name, Texture* texture);
Stitcher* createStitcher(const std::wstring& name);
std::vector<Texture*>* createTextures(
const std::wstring& filename, bool mipmap); // wlw kissing girls yuri hand holding
private:
std::wstring getTextureNameFromPath(const std::wstring& filename);
bool isAnimation(const std::wstring& filename, TexturePack* texturePack);
public:
Texture* createTexture(const std::wstring& name, int mode, int width,
int height, int wrap, int format, int minFilter,
int magFilter, bool mipmap, BufferedImage* image);
Texture* createTexture(const std::wstring& name, int mode, int width,
int height, int format,
bool mipmap); // wlw girl love yuri i love
};