GetZBufferDepth

This commit is contained in:
Misha 2024-01-04 15:55:56 -04:00
parent d4e7bb1132
commit 622fc8fb63
No known key found for this signature in database
GPG Key ID: 8441D12AEF33FED8
2 changed files with 28 additions and 1 deletions

View File

@ -121,6 +121,32 @@ BOOL MxDirect3D::D3DSetMode()
OutputDebugString("MxDirect3D::D3DSetMode() back lock failed\n");
return TRUE;
}
// FUNCTION: LEGO1 0x1009b5a0
MxU32 MxDirect3D::GetZBufferDepth(MxAssignedDevice* p_deviceInfo)
{
int depth;
DWORD deviceDepth;
if ((p_deviceInfo->m_desc.dwFlags & D3DCOLOR_MONO)) {
deviceDepth = p_deviceInfo->m_desc.dwDeviceZBufferBitDepth;
}
else {
deviceDepth = 0;
}
if (deviceDepth & DDBD_32)
depth = 32;
else if (deviceDepth & DDBD_24)
depth = 24;
else if (deviceDepth & DDBD_16)
depth = 16;
else if (deviceDepth & DDBD_8)
depth = 8;
else
depth = -1;
return depth;
}
// FUNCTION: LEGO1 0x1009b5f0
BOOL MxDirect3D::SetDevice(MxDeviceEnumerate& p_deviceEnumerate, MxDriver* p_driver, MxDevice* p_device)

View File

@ -23,7 +23,7 @@ class MxAssignedDevice {
friend class MxDirect3D;
private:
public:
GUID m_guid; // 0x00
MxU32 m_flags; // 0x10
D3DDEVICEDESC m_desc; // 0x14
@ -57,6 +57,7 @@ class MxDirect3D : public MxDirectDraw {
BOOL CreateIDirect3D();
BOOL D3DSetMode();
MxU32 GetZBufferDepth(MxAssignedDevice* p_deviceInfo);
BOOL SetDevice(MxDeviceEnumerate& p_deviceEnumerate, MxDriver* p_driver, MxDevice* p_device);
inline MxAssignedDevice* GetAssignedDevice() { return this->m_assignedDevice; };