Decompile 6 functions in Source/Client/ModeFade.cpp, Source/Client/ModeFadeOut.cpp, ...

Batch #13893 by eAthena: 4 byte-identical, 2 confirmed by peer review.

- fn_09334 UIBroadcastBalloon::Slot43: byte-identical
- fn_12091 UIWhisperWnd::Slot43: byte-identical
- fn_12591 UIRoMapWnd::DrawRecordAreas: byte-identical
- fn_12592 UINewChatWnd::Slot43: logic confirmed by peer review
- fn_12593 UISubChatHisWnd::Slot43: byte-identical
- fn_12604 UIRoMapWnd::DrawRecordFaces: logic confirmed by peer review

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 23:24:54 +00:00
commit 0e99481335
11 changed files with 39 additions and 113 deletions

View file

@ -21,9 +21,6 @@ void CMode::DrawFadeIn() {
const std::uint32_t elapsed = timeGetTime() - g_modeFadeTick;
if (elapsed < 255) {
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, 0, 0, g_renderer->viewport.width, g_renderer->viewport.height, (255 - elapsed) << 24,
g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawAlphaRectangle(0, 0, g_renderer->viewport.width, g_renderer->viewport.height, (255 - elapsed) << 24);
}
}

View file

@ -19,8 +19,7 @@ std::uint32_t FadeOutMode(CRenderer& renderer, CRenderSystemBase& system, Resour
renderer.CaptureBackBuffer();
std::uint32_t elapsed = timeGetTime() - g_modeFadeTick;
while (elapsed < 255) {
DrawAlphaRectangle(renderer.primitives, renderer.queues, 0, 0, renderer.viewport.width, renderer.viewport.height, elapsed << 24,
depthAlpha, depthStart, depthEnd);
DrawAlphaRectangle(0, 0, renderer.viewport.width, renderer.viewport.height, elapsed << 24);
if (showLogo != 0) {
auto* logo = static_cast<CBitmapRes*>(resources.Load(Resolve("rag_logo.bmp")));
DrawBitmapResource(system, renderer.viewport.width - 192, renderer.viewport.height - 122, logo);

View file

@ -1,19 +1,18 @@
#include "Render/Primitives/AlphaRectangle.h"
#include "Render/Primitives/RenderPrimitivePool.h"
#include "Render/Primitives/RenderQueues.h"
#include "Render/Renderer.h"
#include "Render/TextureQuad.h"
#include "Render/Textures/TextureCache.h"
// OFFSET: 0x0054E460
// FUNCTION: fn_01952
void DrawAlphaRectangle(
RenderPrimitivePool& primitives, RenderQueues& queues, int x, int y, int width, int height, std::uint32_t color, bool depthAlpha,
float depthStart, float depthEnd
) {
void DrawAlphaRectangle(int x, int y, int width, int height, std::uint32_t color) {
if ((color & 0xFF000000u) == 0) {
return;
}
RenderPrimitive* primitive = primitives.Acquire();
RenderPrimitive* primitive = g_renderer->primitives.Acquire();
primitive->texture = g_texMgr.Default();
const float left = static_cast<float>(x);
const float top = static_cast<float>(y);
@ -34,5 +33,5 @@ void DrawAlphaRectangle(
vertex.u = 0.0f;
vertex.v = 0.0f;
}
queues.Submit(primitive, 513, depthAlpha, depthStart, depthEnd);
g_renderer->queues.Submit(primitive, 513, g_renderer->fog.supported != 0, g_depthStart, g_depthEnd);
}

View file

@ -7,9 +7,6 @@ class RenderPrimitivePool;
class TextureCache;
struct RenderQueues;
void DrawAlphaRectangle(
RenderPrimitivePool& primitives, RenderQueues& queues, int x, int y, int width, int height, std::uint32_t color, bool depthAlpha,
float depthStart, float depthEnd
);
void DrawAlphaRectangle(int x, int y, int width, int height, std::uint32_t color);
#endif

View file

@ -133,10 +133,7 @@ void UIRoMapWnd::DrawRecordAreas() {
if (color == 12) {
color = 0;
}
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, it->left, it->top, it->right - it->left, it->bottom - it->top, g_roMapRecordColors[color],
g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawAlphaRectangle(it->left, it->top, it->right - it->left, it->bottom - it->top, g_roMapRecordColors[color]);
++color;
}
}
@ -153,15 +150,9 @@ void UINewChatWnd::Slot43() {
for (int i = 0; i < static_cast<int>(this->m_tabControl->labels.size()); ++i) {
const int inactive = i != this->m_currentTab;
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, x + 1 + this->m_tabWidth * i, y + 1 + inactive, this->m_tabWidth - 1, this->m_inputOffsetY - inactive,
inactive ? 0x99000000 : 0x66000000, g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawAlphaRectangle(x + 1 + this->m_tabWidth * i, y + 1 + inactive, this->m_tabWidth - 1, this->m_inputOffsetY - inactive, inactive ? 0x99000000 : 0x66000000);
}
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, this->m_inputX + 1, this->m_inputY + 1, this->m_listWidth - 2, this->m_listHeight - 1, this->m_listColor,
g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawAlphaRectangle(this->m_inputX + 1, this->m_inputY + 1, this->m_listWidth - 2, this->m_listHeight - 1, this->m_listColor);
}
// OFFSET: 0x00918300
@ -170,14 +161,8 @@ void UISubChatHisWnd::Slot43() {
int x = 0;
int y = 0;
this->ToScreen(x, y);
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, x + 1, y + 1, this->m_inputWidth - 2, this->m_inputHeight, 0x66000000, g_renderer->fog.supported != 0,
g_depthStart, g_depthEnd
);
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, this->m_state.unknown_0000 + 1, this->m_state.unknown_0004 + 1, this->m_state.unknown_0008 - 2,
this->m_state.unknown_000C - 2, this->m_state.unknown_0014, g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawAlphaRectangle(x + 1, y + 1, this->m_inputWidth - 2, this->m_inputHeight, 0x66000000);
DrawAlphaRectangle(this->m_state.unknown_0000 + 1, this->m_state.unknown_0004 + 1, this->m_state.unknown_0008 - 2, this->m_state.unknown_000C - 2, this->m_state.unknown_0014);
}
// OFFSET: 0x009189C0

View file

@ -1,6 +1,8 @@
#include "Render/ScreenRectangle.h"
#include "Render/Primitives/RenderPrimitivePool.h"
#include "Render/Primitives/RenderQueues.h"
#include "Render/Renderer.h"
#include "Render/TextureQuad.h"
#include "Render/Textures/Texture.h"
#include "Render/Textures/TextureCache.h"
@ -42,15 +44,12 @@ void DrawBlendedRectangle(
// OFFSET: 0x0054ED40
// FUNCTION: fn_01954
void DrawTexturedRectangle(
RenderPrimitivePool& primitives, RenderQueues& queues, int x, int y, int width, int height, std::uint32_t color, CTexture* texture,
bool depthAlpha, float depthStart, float depthEnd
) {
void DrawTexturedRectangle(int x, int y, int width, int height, std::uint32_t color, CTexture* texture) {
if ((color & 0xFF000000u) == 0) {
return;
}
RenderPrimitive* primitive = primitives.Acquire();
RenderPrimitive* primitive = g_renderer->primitives.Acquire();
primitive->texture = texture ? texture : g_texMgr.Default();
const float left = static_cast<float>(x);
const float top = static_cast<float>(y);
@ -77,7 +76,7 @@ void DrawTexturedRectangle(
vertex.rhw = 0.999999f;
vertex.diffuse = color;
}
queues.Submit(primitive, 513, depthAlpha, depthStart, depthEnd);
g_renderer->queues.Submit(primitive, 513, g_renderer->fog.supported != 0, g_depthStart, g_depthEnd);
}
// OFFSET: 0x0054EFD0

View file

@ -12,10 +12,7 @@ void DrawBlendedRectangle(
RenderPrimitivePool& primitives, RenderQueues& queues, int x, int y, int width, int height, std::uint32_t color, bool depthAlpha,
float depthStart, float depthEnd
);
void DrawTexturedRectangle(
RenderPrimitivePool& primitives, RenderQueues& queues, int x, int y, int width, int height, std::uint32_t color, CTexture* texture,
bool depthAlpha, float depthStart, float depthEnd
);
void DrawTexturedRectangle(int x, int y, int width, int height, std::uint32_t color, CTexture* texture);
void DrawTextureRegion(
RenderPrimitivePool& primitives, RenderQueues& queues, float x, float y, float width, float height, std::uint32_t color,
CTexture* texture, bool depthAlpha, float depthStart, float depthEnd

View file

@ -68,10 +68,7 @@ void UIBroadcastBalloon::Slot43() {
for (const auto& entry : this->m_messages) {
for (const BroadcastBalloonMessage& message : entry.second) {
if (message.lines.size() != 0) {
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, this->geometry.x + 1 + (this->geometry.width - message.width) / 2, this->geometry.y + 1 + y,
message.width - 2, message.height - 2, message.backgroundColor, g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawAlphaRectangle(this->geometry.x + 1 + (this->geometry.width - message.width) / 2, this->geometry.y + 1 + y, message.width - 2, message.height - 2, message.backgroundColor);
y += message.height + 10;
}
}

View file

@ -346,18 +346,12 @@ void UIRoMapWnd::DrawDungeonLinks() {
);
}
DrawTexturedRectangle(
g_renderer->primitives, g_renderer->queues, map->left, map->top, mapWidth, mapHeight, isSelected ? 0xFFFFFFFF : rectColor, positionTexture,
g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawTexturedRectangle(map->left, map->top, mapWidth, mapHeight, isSelected ? 0xFFFFFFFF : rectColor, positionTexture);
x = field->left;
y = field->top;
}
DrawTexturedRectangle(
g_renderer->primitives, g_renderer->queues, x, y, width, height, isSelected ? 0xFFFFFFFF : rectColor, selectTexture,
g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawTexturedRectangle(x, y, width, height, isSelected ? 0xFFFFFFFF : rectColor, selectTexture);
}
}
@ -375,10 +369,7 @@ void UIRoMapWnd::DrawMarks() {
const int y = area[1] + 1;
const int width = area[2] - area[0] - 2;
const int height = area[3] - area[1] - 2;
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, x, y, width, height, g_worldViewMgr.runColor, g_renderer->fog.supported != 0, g_depthStart,
g_depthEnd
);
DrawAlphaRectangle(x, y, width, height, g_worldViewMgr.runColor);
if (index != 0) {
const int* previous = g_worldViewMgr.MarkAreaAt(index - 1, true);
if (previous != nullptr) {
@ -416,10 +407,7 @@ void UIRoMapWnd::DrawMarks() {
const int drawX = static_cast<int>(
static_cast<float>(width) * g_depthAverageHalf + static_cast<float>(x) - static_cast<float>(texture->Width())
);
DrawTexturedRectangle(
g_renderer->primitives, g_renderer->queues, drawX, drawY, textureWidth, textureHeight, 0xCCFFFFFF, texture,
g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawTexturedRectangle(drawX, drawY, textureWidth, textureHeight, 0xCCFFFFFF, texture);
}
}
}
@ -436,18 +424,17 @@ void UIRoMapWnd::DrawRecordFaces(int) {
continue;
}
const int x = static_cast<int>(static_cast<float>(it->left - faceSize) + static_cast<float>(it->right - it->left) * g_depthAverageHalf);
const int y = static_cast<int>(static_cast<float>(it->top - faceSize) + static_cast<float>(it->bottom - it->top) * g_depthAverageHalf);
const int width = it->right - it->left;
const int height = it->bottom - it->top;
const int x = static_cast<int>(static_cast<float>(it->left - faceSize) + static_cast<float>(width) * 0.5f);
const int y = static_cast<int>(static_cast<float>(it->top - faceSize) + static_cast<float>(height) * 0.5f);
if (mapName == it->name) {
image = "유저인터페이스\\worldview_interface\\wv_face1.bmp";
} else {
image = "유저인터페이스\\worldview_interface\\wv_face.bmp";
}
DrawTexturedRectangle(
g_renderer->primitives, g_renderer->queues, x, y, faceSize * 2, faceSize * 2, 0xEEFFFFFF,
g_texMgr.Load(image.c_str(), 0, false, true, false), g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawTexturedRectangle(x, y, faceSize * 2, faceSize * 2, 0xEEFFFFFF, g_texMgr.Load(image.c_str(), 0, false, true, false));
}
}
@ -658,10 +645,7 @@ void UIRoMapWnd::DrawMapMarker(const RoMapMarker& marker, unsigned char skipSele
}
DrawRoundedBorder(*this, marker.area.left, marker.area.top, static_cast<int>(marker.width), static_cast<int>(marker.height), 0xFFFFFF);
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, marker.area.left, marker.area.top, static_cast<int>(marker.width), static_cast<int>(marker.height), 0x66000000,
g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawAlphaRectangle(marker.area.left, marker.area.top, static_cast<int>(marker.width), static_cast<int>(marker.height), 0x66000000);
std::string name = g_session.GetMapDisplayName(marker.name.c_str());
DrawOutlinedText(*this, marker.area.left + 2, marker.area.top + 5, name.c_str(), 0, 0xD2FF, 0, 0, 12, 1, 0);
}
@ -954,49 +938,30 @@ void UIRoMapWnd::DrawWorld() {
const int y = area[1] + 1;
const int width = area[2] - area[0] - 2;
const int height = area[3] - area[1] - 2;
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, x, y, width, height, g_worldViewMgr.searchColors[kind], g_renderer->fog.supported != 0, g_depthStart,
g_depthEnd
);
DrawTexturedRectangle(
g_renderer->primitives, g_renderer->queues, x, y, width, height, 0xFFFFFFFF,
g_texMgr.Load(g_worldViewMgr.searchImages[kind].c_str(), 0, false, true, false), g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawAlphaRectangle(x, y, width, height, g_worldViewMgr.searchColors[kind]);
DrawTexturedRectangle(x, y, width, height, 0xFFFFFFFF, g_texMgr.Load(g_worldViewMgr.searchImages[kind].c_str(), 0, false, true, false));
}
this->DrawMarks();
if (!g_worldViewMgr.selection.name.empty() && g_worldViewMgr.currentWorld == g_worldViewMgr.selection.worldIndex) {
const WorldViewRecord& selection = g_worldViewMgr.selection;
DrawTexturedRectangle(
g_renderer->primitives, g_renderer->queues, selection.left, selection.top, selection.right - selection.left, selection.bottom - selection.top,
0xEEFFFFFF, g_texMgr.Load("유저인터페이스\\worldview_interface\\wv_Select.bmp", 0, false, true, false), g_renderer->fog.supported != 0,
g_depthStart, g_depthEnd
);
DrawTexturedRectangle(selection.left, selection.top, selection.right - selection.left, selection.bottom - selection.top, 0xEEFFFFFF, g_texMgr.Load("유저인터페이스\\worldview_interface\\wv_Select.bmp", 0, false, true, false));
}
this->DrawRecordFaces(1);
this->DrawDungeonLinks();
const WorldViewRecord* selected = this->unknown_00C0;
if (selected != nullptr && this->unknown_00C8 != nullptr) {
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, selected->left, selected->top, selected->right - selected->left, selected->bottom - selected->top,
g_worldViewMgr.selectBoxColor, g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawAlphaRectangle(selected->left, selected->top, selected->right - selected->left, selected->bottom - selected->top, g_worldViewMgr.selectBoxColor);
if (this->unknown_00D0 != 0) {
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, this->unknown_00C8[0], this->unknown_00C8[1], 130, 130, 0x88000000, g_renderer->fog.supported != 0,
g_depthStart, g_depthEnd
);
DrawAlphaRectangle(this->unknown_00C8[0], this->unknown_00C8[1], 130, 130, 0x88000000);
reinterpret_cast<CTexture*>(this->unknown_00D0)->Stretch(this->unknown_00C8[0], this->unknown_00C8[1], 130, 130);
}
}
const RoMapTooltipBox* tooltip = this->unknown_00C4;
if (tooltip != nullptr) {
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, tooltip->x, tooltip->y, tooltip->width, tooltip->height, 0x66000000, g_renderer->fog.supported != 0,
g_depthStart, g_depthEnd
);
DrawAlphaRectangle(tooltip->x, tooltip->y, tooltip->width, tooltip->height, 0x66000000);
}
if (this->m_resetTime == 1) {

View file

@ -334,10 +334,7 @@ void UIWindowMgr::DrawWindows() {
g_renderDiagnosticLine = 3815;
g_renderDiagnosticFile = g_windowManagerDiagnosticFile;
if (window->Slot07(&rectangle) == true) {
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, rectangle.x, rectangle.y, rectangle.width, rectangle.height, rectangle.color,
g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawAlphaRectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height, rectangle.color);
g_renderDiagnosticLine = 3823;
g_renderDiagnosticFile = g_windowManagerDiagnosticFile;
} else if (window->Slot42(&rectangle) == true) {

View file

@ -33,14 +33,8 @@ void UIWhisperWnd::Slot43() {
int x = 0;
int y = 0;
this->ToScreen(x, y);
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, x + 1, y + 1, this->geometry.width - 2, this->geometry.height, 0x66000000,
g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawAlphaRectangle(
g_renderer->primitives, g_renderer->queues, x + 1, y + 1, this->geometry.width - 2, 17, 0x449EB6E4,
g_renderer->fog.supported != 0, g_depthStart, g_depthEnd
);
DrawAlphaRectangle(x + 1, y + 1, this->geometry.width - 2, this->geometry.height, 0x66000000);
DrawAlphaRectangle(x + 1, y + 1, this->geometry.width - 2, 17, 0x449EB6E4);
}
// OFFSET: 0x008D0F30