rodecomp/Source/Render/AlphaRectangle.cpp
ragnarok-clanker 0e99481335 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).
2026-11-06 23:24:54 +00:00

37 lines
1.2 KiB
C++

#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(int x, int y, int width, int height, std::uint32_t color) {
if ((color & 0xFF000000u) == 0) {
return;
}
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);
const float right = static_cast<float>(x + width);
const float bottom = static_cast<float>(y + height);
primitive->quad[0].x = left;
primitive->quad[0].y = top;
primitive->quad[1].x = right;
primitive->quad[1].y = top;
primitive->quad[2].x = left;
primitive->quad[2].y = bottom;
primitive->quad[3].x = right;
primitive->quad[3].y = bottom;
for (RenderVertex& vertex : primitive->quad) {
vertex.z = 0.000001f;
vertex.rhw = 0.999999f;
vertex.diffuse = color;
vertex.u = 0.0f;
vertex.v = 0.0f;
}
g_renderer->queues.Submit(primitive, 513, g_renderer->fog.supported != 0, g_depthStart, g_depthEnd);
}