Decompile fn_10803 (UICheckBox::Paint)

Batch #12919 by cremane: 0 byte-identical, 1 confirmed by peer review.

- fn_10803 UICheckBox::Paint: logic confirmed by peer review

Peer-reviewed-by: gordaoprogramas, Toshiro, codeplay
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-06 12:36:37 +00:00
commit 1fcafbcdd3

View file

@ -23,6 +23,7 @@ UICheckBox::~UICheckBox() = default;
// OFFSET: 0x0085C8C0
// FUNCTION: fn_10803
void UICheckBox::Paint() {
int width = 0;
if (this->m_checked.empty() || this->m_unchecked.empty()) {
return;
}
@ -36,12 +37,19 @@ void UICheckBox::Paint() {
return;
}
int width = 0;
if (this->geometry.unknown_0030 == 0 || this->geometry.unknown_0030 == 1) {
const std::string& name = this->geometry.unknown_0030 == 0 ? this->m_unchecked : this->m_checked;
CBitmapRes* bitmap = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve(name.c_str())));
switch (this->geometry.unknown_0030) {
case 0: {
CBitmapRes* bitmap = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve(this->m_unchecked.c_str())));
this->DrawBitmap(0, (this->geometry.height - bitmap->image.height) / 2, &bitmap->image, false);
width = bitmap->image.width;
break;
}
case 1: {
CBitmapRes* bitmap = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve(this->m_checked.c_str())));
this->DrawBitmap(0, (this->geometry.height - bitmap->image.height) / 2, &bitmap->image, false);
width = bitmap->image.width;
break;
}
}
if (!this->m_text.empty()) {