Decompile 2 functions in Source/Render/Textures/BitmapTextureCache.cpp
Batch #17816 by eAthena: 0 byte-identical, 2 confirmed by peer review. - fn_01854 BitmapTextureCache::Update: logic confirmed by peer review - fn_01846 CDCBitmap::Draw: logic confirmed by peer review Peer-reviewed-by: alisonrag, cremane, bibinir Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
380dc0cbb3
commit
3e8911dd3a
1 changed files with 6 additions and 4 deletions
|
|
@ -23,7 +23,7 @@ void BitmapTextureCache::Update(BitmapPixels& bitmap) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this->m_alpha) {
|
||||
if (this->m_alpha == true) {
|
||||
if (this->m_textures.empty()) {
|
||||
CTexture* texture = g_texMgr.CreateTexture(bitmap.width, bitmap.height, TextureFormat::A8R8G8B8, false, false);
|
||||
if (texture) {
|
||||
|
|
@ -55,7 +55,8 @@ void BitmapTextureCache::Update(BitmapPixels& bitmap) {
|
|||
|
||||
for (unsigned y = 0; y < bitmap.height; y += 256) {
|
||||
for (unsigned x = 0; x < bitmap.width; x += 256) {
|
||||
(*texture++)->Upload(0, 0, std::min(256u, bitmap.width - x), std::min(256u, bitmap.height - y), bitmap.pixels + x + y * bitmap.width, 0, bitmap.width);
|
||||
(*texture)->Upload(0, 0, std::min(256u, bitmap.width - x), std::min(256u, bitmap.height - y), bitmap.pixels + x + y * bitmap.width, 0, bitmap.width);
|
||||
++texture;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -75,7 +76,7 @@ void CDCBitmap::Draw(int x, int y, int width, int height, std::uint32_t color) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this->m_cache.m_alpha) {
|
||||
if (this->m_cache.m_alpha == true) {
|
||||
for (CTexture* texture : this->m_cache.m_textures) {
|
||||
texture->Draw(x, y, width, height, color);
|
||||
}
|
||||
|
|
@ -87,7 +88,8 @@ void CDCBitmap::Draw(int x, int y, int width, int height, std::uint32_t color) {
|
|||
int remainingWidth = width;
|
||||
|
||||
for (int column = 0; column < width; column += 256, remainingWidth -= 256) {
|
||||
(*texture++)->Draw(x + column, y + row, std::min(256, remainingWidth), std::min(256, remainingHeight), color);
|
||||
(*texture)->Draw(x + column, y + row, remainingWidth > 256 ? 256 : remainingWidth, remainingHeight > 256 ? 256 : remainingHeight, color);
|
||||
++texture;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue