rodecomp/Source/Render/Textures/TextureCache.h
ragnarok-clanker 15d92d48d5 Confirm fn_02455 (TextureCache::Create)
Batch #11655 by StrawberrysherbetIX: 0 byte-identical, 1 confirmed by peer review.

- fn_02455 TextureCache::Create: logic confirmed by peer review (already on main)

Peer-reviewed-by: Yommy, cremane
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-05 04:10:23 +00:00

39 lines
1.1 KiB
C++

#ifndef RAGNAROK_SOURCE_RENDER_TEXTURES_TEXTURECACHE_H
#define RAGNAROK_SOURCE_RENDER_TEXTURES_TEXTURECACHE_H
#include <cstdint>
#include <map>
class CTexture;
struct TextureNameLess {
bool operator()(const char* left, const char* right) const;
};
class TextureCache {
public:
TextureCache();
~TextureCache();
CTexture* Load(const char* name, int option, bool fullSize, bool dynamic, bool renderTarget);
CTexture* Default();
CTexture* Create(const char* name, int option, bool fullSize, bool dynamic, bool renderTarget);
__declspec(noinline) CTexture* Upload(int width, int height, const std::uint32_t* pixels, int format, int option, bool fullSize, bool dynamic, bool renderTarget);
void Remove(CTexture* texture);
void Clear();
void ClearUnused();
void Reload();
private:
/* 0000 */ std::map<const char*, CTexture*, TextureNameLess> m_textures;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(TextureCache) == 8);
#endif
extern TextureCache g_texMgr;
extern int g_textureReduction;
CTexture* CreateTexture(std::uint32_t width, std::uint32_t height, std::int32_t format, bool dynamic, bool renderTarget);
#endif