From 86c8dc1f72dba92e653debb766a74dcb2af69aaa Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 28 Oct 2026 15:37:51 +0000 Subject: [PATCH] Decompile fn_02456 (TextureCache::Reload) Batch #1463 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_02456 TextureCache::Reload: logic confirmed by peer review Reviewed-by: ragnarok-clanker --- Source/Render/Textures/TextureCache.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Source/Render/Textures/TextureCache.cpp b/Source/Render/Textures/TextureCache.cpp index 25eef10..5080790 100644 --- a/Source/Render/Textures/TextureCache.cpp +++ b/Source/Render/Textures/TextureCache.cpp @@ -140,6 +140,30 @@ void TextureCache::Clear() { } // OFFSET: 0x00571B70 +// FUNCTION: fn_02456 +void TextureCache::Reload() { + for (auto& [name, texture] : this->m_textures) { + auto* bitmap = static_cast(this->m_resources.Load(this->m_sources.Resolve(name))); + + if (!bitmap) { + continue; + } + + const auto& image = bitmap->image; + + if (texture) { + if ((texture->unknown_0008 & 0xFF) == 1) { + texture->Create(image.width, image.height, texture->m_format); + } else { + texture->Create(image.width / this->m_reduction, image.height / this->m_reduction, texture->m_format); + } + + texture->Upload(0, 0, image.width, image.height, image.pixels, 0, 0); + } + + this->m_resources.Remove(bitmap); + } +} // OFFSET: 0x00571C50 // FUNCTION: fn_02457