Batch #13186 by ragnarok-clanker: forced by an admin (40 lower score(s), 206 changed function(s)); checked with 620 compiled unit(s), including every includer of Source/Archive/GPak.h, Source/Client/Mode/CGameMode.h, Source/Client/Mode/CLoginMode.h, Source/Client/Session.h, Source/Client/Stove/StoveMgr.h, Source/Client/Stove/StovePCSDK.h, Source/Client/Timer.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/RenderObject.h, Source/Contents/CashEmotionMgr.h, Source/Contents/Configuration/ServiceOptions.h, Source/Contents/Skills/SkillTreeScript.h, Source/Render/DX9/D3DX9Runtime.h, Source/Resource/GifResource.h, Source/UI/AdventureGuide/UIAdventureGuide.h, Source/UI/Cooldowns/CooldownOwner.h, Source/UI/Edit/UIEditBoxEx.h, Source/UI/Lists/UIListBoxTemplate.h, Source/UI/Quest/UIRenewQuestUI.h, Source/UI/Rodex/UIRodexComposeWnd.h, Source/UI/Text/UITextViewerControl.h, Source/UI/UIBroadcastBalloon.h, Source/UI/UICaptchaRegisterWnd.h, Source/UI/UIMacroDetectorWnd.h, Source/UI/UIReputeWnd.h, Source/UI/Window/UIRegisterMgr.h, Source/UI/Window/UISecondCostumeWnd.h, Source/UI/Window/UISelCharForUServerWnd.h, Source/UI/Window/UIWindow.h, Source/UI/Window/UIWindowMgr.h, Source/Utility/EncryptedName.h.
117 lines
3.7 KiB
C++
117 lines
3.7 KiB
C++
#include "Render/ScreenGeometry.h"
|
|
#include "Render/Primitives/RenderPrimitivePool.h"
|
|
#include "Render/Primitives/RenderQueues.h"
|
|
#include "Render/Renderer.h"
|
|
#include "Render/TextureQuad.h"
|
|
#include "Utility/Math/AffineMatrix.h"
|
|
|
|
#include <cmath>
|
|
|
|
// OFFSET: 0x0054E2B0
|
|
// FUNCTION: fn_01951
|
|
void DrawScreenLine(
|
|
RenderPrimitivePool& primitives, RenderQueues& queues, float startX, float startY, float endX, float endY, int thickness, CTexture* texture,
|
|
std::uint32_t color, bool depthAlpha, float depthStart, float depthEnd
|
|
) {
|
|
if (SquareRoot((endY - startY) * (endY - startY) + (endX - startX) * (endX - startX)) == 0.0f) {
|
|
return;
|
|
}
|
|
|
|
const float deltaX = endX - startX;
|
|
const float deltaY = endY - startY;
|
|
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) {
|
|
angle = 6.283184f - angle;
|
|
}
|
|
|
|
angle += 1.570796f;
|
|
const float width = static_cast<float>(thickness);
|
|
const float offsetY = std::sin(angle) * width;
|
|
const float offsetX = std::cos(angle) * width;
|
|
DrawScreenQuad(
|
|
primitives, queues, startX - offsetX, startY - offsetY, startX + offsetX, startY + offsetY, endX - offsetX, endY - offsetY, endX + offsetX,
|
|
endY + offsetY, texture, color, depthAlpha, depthStart, depthEnd
|
|
);
|
|
}
|
|
|
|
// OFFSET: 0x0054DB40
|
|
// FUNCTION: fn_01944
|
|
void DrawScreenQuad(
|
|
RenderPrimitivePool& primitives, RenderQueues& queues, float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, CTexture* texture,
|
|
std::uint32_t color, bool depthAlpha, float depthStart, float depthEnd
|
|
) {
|
|
RenderPrimitive* primitive = primitives.Acquire();
|
|
RenderVertex* vertices = primitive->vertices;
|
|
vertices[0].x = x0;
|
|
vertices[0].y = y0;
|
|
vertices[0].z = 0.8f;
|
|
vertices[0].rhw = 1.0f;
|
|
vertices[0].diffuse = color;
|
|
vertices[0].u = 0.0f;
|
|
vertices[0].v = 0.0f;
|
|
vertices[1].x = x1;
|
|
vertices[1].y = y1;
|
|
vertices[1].z = 0.8f;
|
|
vertices[1].rhw = 1.0f;
|
|
vertices[1].diffuse = color;
|
|
vertices[1].u = 1.0f;
|
|
vertices[1].v = 0.0f;
|
|
vertices[2].x = x2;
|
|
vertices[2].y = y2;
|
|
vertices[2].z = 0.8f;
|
|
vertices[2].rhw = 1.0f;
|
|
vertices[2].diffuse = color;
|
|
vertices[2].u = 0.0f;
|
|
vertices[2].v = 1.0f;
|
|
vertices[3].x = x3;
|
|
vertices[3].y = y3;
|
|
vertices[3].z = 0.8f;
|
|
vertices[3].rhw = 1.0f;
|
|
vertices[3].diffuse = color;
|
|
vertices[3].u = 1.0f;
|
|
vertices[3].v = 1.0f;
|
|
primitive->texture = texture;
|
|
primitive->unknown_0018 = 2;
|
|
primitive->unknown_001C = 4;
|
|
queues.Submit(primitive, 513, depthAlpha, depthStart, depthEnd);
|
|
}
|
|
|
|
// OFFSET: 0x00915F60
|
|
// FUNCTION: fn_12581
|
|
void DrawScreenQuad(ScreenPoint p0, ScreenPoint p1, ScreenPoint p2, ScreenPoint p3, CTexture* texture, std::uint32_t color) {
|
|
RenderPrimitive* primitive = g_renderer->primitives.Acquire();
|
|
RenderVertex* vertices = primitive->vertices;
|
|
vertices[0].x = p0.x;
|
|
vertices[0].y = p0.y;
|
|
vertices[0].z = 0.8f;
|
|
vertices[0].rhw = 1.0f;
|
|
vertices[0].diffuse = color;
|
|
vertices[0].u = 0.0f;
|
|
vertices[0].v = 0.0f;
|
|
vertices[1].x = p1.x;
|
|
vertices[1].y = p1.y;
|
|
vertices[1].z = 0.8f;
|
|
vertices[1].rhw = 1.0f;
|
|
vertices[1].diffuse = color;
|
|
vertices[1].u = 1.0f;
|
|
vertices[1].v = 0.0f;
|
|
vertices[2].x = p2.x;
|
|
vertices[2].y = p2.y;
|
|
vertices[2].z = 0.8f;
|
|
vertices[2].rhw = 1.0f;
|
|
vertices[2].diffuse = color;
|
|
vertices[2].u = 0.0f;
|
|
vertices[2].v = 1.0f;
|
|
vertices[3].x = p3.x;
|
|
vertices[3].y = p3.y;
|
|
vertices[3].z = 0.8f;
|
|
vertices[3].rhw = 1.0f;
|
|
vertices[3].diffuse = color;
|
|
vertices[3].u = 1.0f;
|
|
vertices[3].v = 1.0f;
|
|
primitive->texture = texture;
|
|
primitive->unknown_0018 = 2;
|
|
primitive->unknown_001C = 4;
|
|
g_renderer->queues.Submit(primitive, 513, g_renderer->fog.supported != 0, g_depthStart, g_depthEnd);
|
|
}
|