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
This commit is contained in:
parent
3b469b8970
commit
86c8dc1f72
1 changed files with 24 additions and 0 deletions
|
|
@ -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<CBitmapRes*>(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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue