Decompile 3 functions in Source/Render/Projection/ScreenGeometry.h, Source/Render/Projection/ScreenGeometry.cpp, ...

Batch #17820 by eAthena: 0 byte-identical, 3 confirmed by peer review.

- fn_12602 UIRoMapWnd::DrawDungeonLinks: logic confirmed by peer review
- fn_12603 UIRoMapWnd::DrawMarks: logic confirmed by peer review
- fn_12657 CFlyingShipRouteInfo::Draw: logic confirmed by peer review

Peer-reviewed-by: alisonrag, cremane, bibinir
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-12 04:04:48 +00:00
commit 0dc31695e5
4 changed files with 10 additions and 10 deletions

View file

@ -34,7 +34,7 @@ void CFlyingShipRouteInfo::Draw(UIRoMapWnd* wnd) {
targets.insert(std::pair<std::string, FlyingShipRouteEntry>(entry.name, entry));
DrawScreenLine(
from.screenPosition[0], from.screenPosition[1], entry.screenPosition[0], entry.screenPosition[1], 2,
ScreenPoint{from.screenPosition[0], from.screenPosition[1]}, ScreenPoint{entry.screenPosition[0], entry.screenPosition[1]}, 2,
g_texMgr.Load(this->lineTextureName.c_str(), 0, true, true, false), static_cast<std::uint32_t>(this->lineColor)
);
}

View file

@ -10,13 +10,13 @@
// OFFSET: 0x0054E2B0
// FUNCTION: fn_01951
void DrawScreenLine(float startX, float startY, float endX, float endY, int thickness, CTexture* texture, std::uint32_t color) {
if (SquareRoot((endY - startY) * (endY - startY) + (endX - startX) * (endX - startX)) == 0.0f) {
void DrawScreenLine(ScreenPoint start, ScreenPoint end, int thickness, CTexture* texture, std::uint32_t color) {
if (SquareRoot((end.y - start.y) * (end.y - start.y) + (end.x - start.x) * (end.x - start.x)) == 0.0f) {
return;
}
const float deltaX = endX - startX;
const float deltaY = endY - startY;
const float deltaX = end.x - start.x;
const float deltaY = end.y - start.y;
const float inverseLength = 1.0f / SquareRoot(deltaY * deltaY + deltaX * deltaX);
float angle = static_cast<float>(std::acos(static_cast<double>(inverseLength * deltaX)));
if (inverseLength * deltaY < 0.0f) {
@ -28,7 +28,7 @@ void DrawScreenLine(float startX, float startY, float endX, float endY, int thic
const float offsetY = ClientSin(angle) * width;
const float offsetX = ClientCos(angle) * width;
DrawScreenQuad(
startX - offsetX, startY - offsetY, startX + offsetX, startY + offsetY, endX - offsetX, endY - offsetY, endX + offsetX, endY + offsetY, texture, color
start.x - offsetX, start.y - offsetY, start.x + offsetX, start.y + offsetY, end.x - offsetX, end.y - offsetY, end.x + offsetX, end.y + offsetY, texture, color
);
}

View file

@ -15,7 +15,7 @@ struct ScreenPoint {
__declspec(noinline) void DrawScreenQuad(
float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, CTexture* texture, std::uint32_t color
);
void DrawScreenLine(float startX, float startY, float endX, float endY, int thickness, CTexture* texture, std::uint32_t color);
void DrawScreenLine(ScreenPoint start, ScreenPoint end, int thickness, CTexture* texture, std::uint32_t color);
void DrawScreenQuad(ScreenPoint p0, ScreenPoint p1, ScreenPoint p2, ScreenPoint p3, CTexture* texture, std::uint32_t color);
#endif

View file

@ -337,9 +337,9 @@ void UIRoMapWnd::DrawDungeonLinks() {
const float endY = static_cast<float>(mapHeight) * g_depthAverageHalf + static_cast<float>(map->top) + 1.0f;
CTexture* const lineTexture = g_texMgr.Default();
if (isSelected) {
DrawScreenLine(startX, startY, endX, endY, 1, lineTexture, (selectColor & 0xFFFFFF) - 0x1000000);
DrawScreenLine(ScreenPoint{startX, startY}, ScreenPoint{endX, endY}, 1, lineTexture, (selectColor & 0xFFFFFF) - 0x1000000);
} else {
DrawScreenLine(startX, startY, endX, endY, 1, lineTexture, lineColor);
DrawScreenLine(ScreenPoint{startX, startY}, ScreenPoint{endX, endY}, 1, lineTexture, lineColor);
}
DrawTexturedRectangle(map->left, map->top, mapWidth, mapHeight, isSelected ? 0xFFFFFFFF : rectColor, positionTexture);
@ -380,7 +380,7 @@ void UIRoMapWnd::DrawMarks() {
const float startY = static_cast<float>(previous[3] - previous[1]) * g_depthAverageHalf + static_cast<float>(previous[1]);
const float endX = static_cast<float>(area[2] - area[0]) * g_depthAverageHalf + static_cast<float>(area[0]);
const float endY = static_cast<float>(area[3] - area[1]) * g_depthAverageHalf + static_cast<float>(area[1]);
DrawScreenLine(startX, startY, endX, endY, 5, g_texMgr.Load("유저인터페이스\\worldview_interface\\wv_Airf2.bmp", 0, false, true, false), 0x99FFFFFF);
DrawScreenLine(ScreenPoint{startX, startY}, ScreenPoint{endX, endY}, 5, g_texMgr.Load("유저인터페이스\\worldview_interface\\wv_Airf2.bmp", 0, false, true, false), 0x99FFFFFF);
}
}