rodecomp/Source/UI/Gauges/UIPetInfoBarGraph.cpp
ragnarok-clanker 2b4e84395a Decompile fn_11375 (UIPetInfoBarGraph::Paint)
Batch #14322 by Yommy: 1 byte-identical, 0 confirmed by peer review.

- fn_11375 UIPetInfoBarGraph::Paint: byte-identical

Merged automatically: every function is byte-identical to the original.
2026-11-07 08:56:52 +00:00

82 lines
2.8 KiB
C++

#include "UI/UIBarGraph.h"
#include "Resource/Bitmap/BitmapResource.h"
#include "Resource/ResourceMgr.h"
#include "Resource/TextureNames.h"
// OFFSET: 0x0089B4D0
// FUNCTION: fn_11564
void UIBarGraph4::SetValues(const int* current, const int* maximum) {
this->m_current = current;
this->m_maximum = maximum;
}
// OFFSET: 0x0089B4F0
// FUNCTION: fn_11565
void UIBarGraph::SetValue(float value) {
this->m_value = value;
this->Invalidate();
}
// OFFSET: 0x0089B510
// FUNCTION: fn_11566
void UIINT64BarGraph::SetValues(std::int64_t current, std::int64_t maximum) {
this->m_current = current;
this->m_maximum = maximum;
}
// OFFSET: 0x0087A2E0
// FUNCTION: fn_11230
void UIINT64BarGraph::FillBackground(std::uint32_t color) {
this->ClearSurface(color);
}
// OFFSET: 0x0089B540
// FUNCTION: fn_11567
void UIPetInfoBarGraph::SetValue(int value) {
this->unknown_007C = value;
this->Invalidate();
}
// OFFSET: 0x0088C970
// FUNCTION: fn_11375
void UIPetInfoBarGraph::Paint() {
auto* left = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gze_bg_left.bmp")));
auto* middle = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gze_bg_mid.bmp")));
auto* right = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gze_bg_right.bmp")));
const int span = this->geometry.width - left->image.width - right->image.width;
this->DrawBitmap(0, 0, left, false);
for (int x = 0; x < span; ++x) {
this->DrawBitmap(left->image.width + x, 0, middle, false);
}
this->DrawBitmap(this->geometry.width - right->image.width, 0, right, false);
if (this->unknown_007C != 0) {
auto* barLeft = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gzeblue_left.bmp")));
auto* barMiddle = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gzeblue_mid.bmp")));
auto* barRight = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gzeblue_right.bmp")));
const int fill = static_cast<int>(
static_cast<float>(this->geometry.width - barRight->image.width - barLeft->image.width) *
(static_cast<float>(static_cast<unsigned>(this->unknown_007C)) / 100.0f)
);
this->DrawBitmap(0, 0, barLeft, true);
int x = 0;
for (; x < fill; ++x) {
this->DrawBitmap(barLeft->image.width + x, 0, barMiddle, true);
}
this->DrawBitmap(barMiddle->image.width * x + barLeft->image.width, 0, barRight, true);
}
}
// OFFSET: 0x0086D380
// FUNCTION: fn_11045
UIINT64BarGraph::UIINT64BarGraph() : UIWindow(0), m_current(0), m_maximum(0) {
}
// OFFSET: 0x0086E1B0
// FUNCTION: fn_11066
UIPetInfoBarGraph::UIPetInfoBarGraph() : UIWindow(0), unknown_007C(0) {
}