From 459ddf2a7aab46d5baf09d73c6be5b2959da311b Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 20 Dec 2024 18:24:21 +0100 Subject: [PATCH] Implement/match DeviceImpl::HandlePaint --- LEGO1/tgl/d3drm/device.cpp | 11 +++++------ LEGO1/tgl/d3drm/impl.h | 2 +- LEGO1/tgl/tgl.h | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/LEGO1/tgl/d3drm/device.cpp b/LEGO1/tgl/d3drm/device.cpp index a8f47b08..a1c7b0c8 100644 --- a/LEGO1/tgl/d3drm/device.cpp +++ b/LEGO1/tgl/d3drm/device.cpp @@ -60,16 +60,12 @@ void DeviceImpl::HandleActivate(WORD wParam) } } -// Really don't know what's going on here. Seems it will call down to Init -// but the decomp suggests it otherwise looks the same as InitFromD3D but Init -// takes widly different parameters. // FUNCTION: LEGO1 0x100a2d20 -void DeviceImpl::InitFromWindowsDevice(Device*) +void DeviceImpl::HandlePaint(HDC p_dc) { - // Device argument is intentionally unused. IDirect3DRMWinDevice* winDevice; if (SUCCEEDED(m_data->QueryInterface(IID_IDirect3DRMWinDevice, (LPVOID*) &winDevice))) { - // m_data->Init(??); + winDevice->HandlePaint(p_dc); winDevice->Release(); } } @@ -79,3 +75,6 @@ Result DeviceImpl::Update() { return ResultVal(m_data->Update()); } + +// GLOBAL: LEGO1 0x100dd1d0 +// IID_IDirect3DRMWinDevice diff --git a/LEGO1/tgl/d3drm/impl.h b/LEGO1/tgl/d3drm/impl.h index acca4431..5522d3cb 100644 --- a/LEGO1/tgl/d3drm/impl.h +++ b/LEGO1/tgl/d3drm/impl.h @@ -146,7 +146,7 @@ class DeviceImpl : public Device { // vtable+0x20 Result Update() override; void HandleActivate(WORD) override; - void InitFromWindowsDevice(Device*) override; + void HandlePaint(HDC) override; IDirect3DRMDevice2* ImplementationData() const { return m_data; } void SetImplementationData(IDirect3DRMDevice2* device) { m_data = device; } diff --git a/LEGO1/tgl/tgl.h b/LEGO1/tgl/tgl.h index 0d79166e..f19c89ab 100644 --- a/LEGO1/tgl/tgl.h +++ b/LEGO1/tgl/tgl.h @@ -172,7 +172,7 @@ class Device : public Object { // vtable+0x20 virtual Result Update() = 0; virtual void HandleActivate(WORD) = 0; - virtual void InitFromWindowsDevice(Device*) = 0; + virtual void HandlePaint(HDC) = 0; // SYNTHETIC: LEGO1 0x100a2350 // Tgl::Device::~Device