From 713acc513f265fcffa5d88d37cf91e80e993305c Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 28 Oct 2026 11:42:11 +0000 Subject: [PATCH] Decompile fn_02450 (CreateTexture) Batch #1365 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_02450 CreateTexture: logic confirmed by peer review Reviewed-by: ragnarok-clanker --- Source/Render/Textures/TextureCache.cpp | 9 +++++++++ Source/Render/Textures/TextureCache.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/Source/Render/Textures/TextureCache.cpp b/Source/Render/Textures/TextureCache.cpp index 24c1f468..25eef10a 100644 --- a/Source/Render/Textures/TextureCache.cpp +++ b/Source/Render/Textures/TextureCache.cpp @@ -1,3 +1,4 @@ +#include "Render/DeviceContext/DCSurface.h" #include "Render/RenderSystemBase.h" #include "Render/Textures/Texture.h" #include "Render/Textures/TextureCache.h" @@ -46,6 +47,12 @@ CTexture* TextureCache::Upload(int width, int height, const std::uint32_t* pixel return texture; } +// OFFSET: 0x00571660 +// FUNCTION: fn_02450 +CTexture* CreateTexture(std::uint32_t width, std::uint32_t height, std::int32_t format, bool dynamic, bool renderTarget) { + return GetRenderSystemHolder()->CreateTexture(width, height, format, dynamic, renderTarget); +} + // OFFSET: 0x00571930 // FUNCTION: fn_02455 CTexture* TextureCache::Create(const char* name, int option, bool fullSize, bool dynamic, bool renderTarget) { @@ -132,6 +139,8 @@ void TextureCache::Clear() { this->m_textures.clear(); } +// OFFSET: 0x00571B70 + // OFFSET: 0x00571C50 // FUNCTION: fn_02457 void TextureCache::ClearUnused() { diff --git a/Source/Render/Textures/TextureCache.h b/Source/Render/Textures/TextureCache.h index 3fd4b262..01fd3c24 100644 --- a/Source/Render/Textures/TextureCache.h +++ b/Source/Render/Textures/TextureCache.h @@ -34,6 +34,7 @@ public: void Remove(CTexture* texture); void Clear(); void ClearUnused(); + void Reload(); private: ResourceMgr& m_resources; @@ -44,4 +45,6 @@ private: std::map m_textures; }; +CTexture* CreateTexture(std::uint32_t width, std::uint32_t height, std::int32_t format, bool dynamic, bool renderTarget); + #endif