Decompile fn_01854 (BitmapTextureCache::Update)

Batch #15673 by Yommy: 0 byte-identical, 1 confirmed by peer review.

- fn_01854 BitmapTextureCache::Update: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, alisonrag, youko, bgamez23
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-10 14:26:39 +00:00
commit 1b39fed73f

View file

@ -2,6 +2,7 @@
#include "Render/Textures/BitmapTextureCache.h"
#include "Render/RenderSystemBase.h"
#include "Render/Textures/Texture.h"
#include "Render/Textures/TextureCache.h"
#include <algorithm>
@ -23,7 +24,7 @@ void BitmapTextureCache::Update(BitmapPixels& bitmap, CRenderSystemBase& system)
if (this->m_alpha) {
if (this->m_textures.empty()) {
CTexture* texture = system.CreateTexture(bitmap.width, bitmap.height, TextureFormat::A8R8G8B8, false, false);
CTexture* texture = CreateTexture(bitmap.width, bitmap.height, TextureFormat::A8R8G8B8, false, false);
if (texture) {
this->m_textures.push_back(texture);
}
@ -37,7 +38,7 @@ void BitmapTextureCache::Update(BitmapPixels& bitmap, CRenderSystemBase& system)
for (unsigned y = 0; y < bitmap.height; y += 256) {
for (unsigned x = 0; x < bitmap.width; x += 256) {
this->m_textures.push_back(
system.CreateTexture(std::min(256u, bitmap.width - x), std::min(256u, bitmap.height - y), TextureFormat::A1R5G5B5, false, false)
CreateTexture(std::min(256u, bitmap.width - x), std::min(256u, bitmap.height - y), TextureFormat::A1R5G5B5, false, false)
);
}
}