From ff8b5d2a9de767a159a450c377245a1dbfca9652 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 03:08:16 +0000 Subject: [PATCH] Confirm fn_07850 (CBitmapRes::Unload) Batch #11732 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_07850 CBitmapRes::Unload: logic confirmed by peer review (already on main) Peer-reviewed-by: dori, cremane, StrawberrysherbetIX Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Resource/Bitmap/BitmapImage.cpp | 15 --------------- Source/Resource/Bitmap/BitmapImage.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Source/Resource/Bitmap/BitmapImage.cpp b/Source/Resource/Bitmap/BitmapImage.cpp index ed9ced54..f65cc3af 100644 --- a/Source/Resource/Bitmap/BitmapImage.cpp +++ b/Source/Resource/Bitmap/BitmapImage.cpp @@ -41,21 +41,6 @@ namespace { BitmapImage::BitmapImage() : alpha(0), pixels(nullptr), auxiliary(nullptr) { } -// INLINED -void BitmapImage::Clear() { - if (this->pixels) { - std::free(this->pixels); - } - - if (this->auxiliary) { - std::free(this->auxiliary); - } - - this->width = this->height = 0; - this->pixels = nullptr; - this->auxiliary = nullptr; -} - // OFFSET: 0x0074A680 // FUNCTION: fn_07866 bool BitmapImage::CreateAuxiliary(int mode) { diff --git a/Source/Resource/Bitmap/BitmapImage.h b/Source/Resource/Bitmap/BitmapImage.h index afba7e2c..bd93ec57 100644 --- a/Source/Resource/Bitmap/BitmapImage.h +++ b/Source/Resource/Bitmap/BitmapImage.h @@ -2,6 +2,7 @@ #define RAGNAROK_SOURCE_RESOURCE_BITMAP_BITMAPIMAGE_H #include +#include struct BitmapImage { @@ -22,6 +23,21 @@ struct BitmapImage { bool DecodeJpeg(const void* data, int bytes); }; +// INLINED +inline void BitmapImage::Clear() { + if (this->pixels) { + std::free(this->pixels); + } + + if (this->auxiliary) { + std::free(this->auxiliary); + } + + this->width = this->height = 0; + this->pixels = nullptr; + this->auxiliary = nullptr; +} + #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(BitmapImage) == 20); #endif