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
+18 -22
View File
@@ -7,13 +7,13 @@
auto CGraphicImage::Type() -> TType
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<TType>();
static TType type = StringToType("CGraphicImage");
return type;
}
CGraphicImage::CGraphicImage(const char * c_szFileName, DWORD dwFilter) : CResource(c_szFileName), m_dwFilter(dwFilter) // initializers as in 40250
{
MT_PLATFORM_STUB();
m_rect = {0, 0, 0, 0};
}
CGraphicImage::~CGraphicImage()
@@ -34,53 +34,49 @@ auto CGraphicImage::DestroyDeviceObjects() -> void
auto CGraphicImage::GetWidth() const -> int
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<int>();
return m_rect.right - m_rect.left;
}
auto CGraphicImage::GetHeight() const -> int
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<int>();
return m_rect.bottom - m_rect.top;
}
auto CGraphicImage::GetRectReference() const -> const RECT &
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<const RECT &>();
return m_rect;
}
auto CGraphicImage::GetTextureReference() const -> const CGraphicTexture &
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<const CGraphicTexture &>();
return m_imageTexture;
}
auto CGraphicImage::GetTexturePointer() -> CGraphicTexture *
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<CGraphicTexture *>();
return &m_imageTexture;
}
auto CGraphicImage::OnLoad(int, const void *) -> bool
auto CGraphicImage::OnLoad(int size, const void *data) -> bool
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<bool>();
m_imageTexture.SetFileName(GetFileName());
if (!m_imageTexture.CreateFromMemoryFile(size, data, D3DFMT_UNKNOWN, m_dwFilter)) return false;
m_rect = {0, 0, m_imageTexture.GetWidth(), m_imageTexture.GetHeight()};
return true;
}
auto CGraphicImage::OnClear() -> void
{
MT_PLATFORM_STUB();
m_imageTexture.Destroy();
m_rect = {0, 0, 0, 0};
}
auto CGraphicImage::OnIsEmpty() const -> bool
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<bool>();
return m_imageTexture.IsEmpty();
}
auto CGraphicImage::OnIsType(TType) -> bool
auto CGraphicImage::OnIsType(TType type) -> bool
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<bool>();
return type == Type() || CResource::OnIsType(type);
}