Port 2V0-f window input and UI render command bridge

This commit is contained in:
shen
2026-09-22 20:34:45 -07:00
parent 9c30f06083
commit 5590714b16
22 changed files with 693 additions and 182 deletions
+13 -8
View File
@@ -4,6 +4,8 @@
#include "EterLib/GrpScreen.h"
#include "../PlatformStub.h"
#include "UIRenderCommands.h"
#include <algorithm>
CScreen::CScreen()
{
@@ -51,9 +53,9 @@ auto CScreen::Show(RECT *, HWND) -> void
MT_PLATFORM_STUB();
}
auto CScreen::RenderLine2d(float, float, float, float, float) -> void
auto CScreen::RenderLine2d(float sx, float sy, float ex, float ey, float) -> void
{
MT_PLATFORM_STUB();
UIRenderAdd({UIRenderCommand::Line, sx, sy, ex, ey, ms_diffuseColor});
}
auto CScreen::RenderBox2d(float, float, float, float, float) -> void
@@ -61,9 +63,9 @@ auto CScreen::RenderBox2d(float, float, float, float, float) -> void
MT_PLATFORM_STUB();
}
auto CScreen::RenderBar2d(float, float, float, float, float) -> void
auto CScreen::RenderBar2d(float sx, float sy, float ex, float ey, float) -> void
{
MT_PLATFORM_STUB();
UIRenderAdd({UIRenderCommand::Bar, sx, sy, ex, ey, ms_diffuseColor});
}
auto CScreen::RenderGradationBar2d(float, float, float, float, DWORD, DWORD, float) -> void
@@ -181,14 +183,17 @@ auto CScreen::SetAddColorOperation(D3DXCOLOR &) -> void
MT_PLATFORM_STUB();
}
auto CScreen::SetDiffuseColor(DWORD) -> void
auto CScreen::SetDiffuseColor(DWORD color) -> void
{
MT_PLATFORM_STUB();
ms_diffuseColor = color;
}
auto CScreen::SetDiffuseColor(float, float, float, float) -> void
auto CScreen::SetDiffuseColor(float r, float g, float b, float a) -> void
{
MT_PLATFORM_STUB();
auto channel = [](float value) -> DWORD {
return static_cast<DWORD>(std::clamp(value, 0.0f, 1.0f) * 255.0f + 0.5f);
};
ms_diffuseColor = (channel(a) << 24) | (channel(r) << 16) | (channel(g) << 8) | channel(b);
}
auto CScreen::SetClearColor(float, float, float, float) -> void