diff --git a/LEGO1/mxdirect3d.cpp b/LEGO1/mxdirect3d.cpp index 544252aa..fd4c6c09 100644 --- a/LEGO1/mxdirect3d.cpp +++ b/LEGO1/mxdirect3d.cpp @@ -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) diff --git a/LEGO1/mxdirect3d.h b/LEGO1/mxdirect3d.h index 4877159b..ac402e29 100644 --- a/LEGO1/mxdirect3d.h +++ b/LEGO1/mxdirect3d.h @@ -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; };