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).
This commit is contained in:
ragnarok-clanker 2026-11-05 03:08:16 +00:00
commit ff8b5d2a9d
2 changed files with 16 additions and 15 deletions

View file

@ -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) {

View file

@ -2,6 +2,7 @@
#define RAGNAROK_SOURCE_RESOURCE_BITMAP_BITMAPIMAGE_H
#include <cstdint>
#include <cstdlib>
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