Batch #17315 by eAthena: 2 byte-identical, 7 confirmed by peer review. - fn_01854 BitmapTextureCache::Update: logic confirmed by peer review - fn_02406 SpriteAtlas::Allocate: logic confirmed by peer review - fn_02407 SpriteAtlas::Initialize: byte-identical - fn_02450 TextureCache::CreateTexture: byte-identical - fn_08054 CSprRes::Load: logic confirmed by peer review - fn_10125 CRendererDX7::RenderToTexture: logic confirmed by peer review - fn_17445 UIVideoWnd::SendMsg: logic confirmed by peer review - fn_21172 C3dGrannyGameActor::C3dGrannyGameActor: logic confirmed by peer review - fn_24279 CGraffiSkill::BuildTexture: logic confirmed by peer review Peer-reviewed-by: alisonrag, cremane, br4yan, kyoshi Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
38 lines
1.1 KiB
C++
38 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);
|
|
CTexture* CreateTexture(std::uint32_t width, std::uint32_t height, std::int32_t format, 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;
|
|
|
|
#endif
|