diff --git a/CONFIG/MainDlg.cpp b/CONFIG/MainDlg.cpp index da0b5d17..bed9ad30 100644 --- a/CONFIG/MainDlg.cpp +++ b/CONFIG/MainDlg.cpp @@ -4,7 +4,7 @@ #include "config.h" #include "res/resource.h" -#include +#include DECOMP_SIZE_ASSERT(CDialog, 0x60) DECOMP_SIZE_ASSERT(CMainDialog, 0x70) diff --git a/CONFIG/config.cpp b/CONFIG/config.cpp index 59c03332..d4457b55 100644 --- a/CONFIG/config.cpp +++ b/CONFIG/config.cpp @@ -5,6 +5,7 @@ #include "detectdx5.h" #include // _chdir +#include #include #include // _spawnl diff --git a/LEGO1/lego/legoomni/src/video/legovideomanager.cpp b/LEGO1/lego/legoomni/src/video/legovideomanager.cpp index 0eae0878..21147b1f 100644 --- a/LEGO1/lego/legoomni/src/video/legovideomanager.cpp +++ b/LEGO1/lego/legoomni/src/video/legovideomanager.cpp @@ -4,6 +4,7 @@ #include "legoinputmanager.h" #include "legomain.h" #include "misc.h" +#include "mxdirectx/legodxinfo.h" #include "mxdirectx/mxdirect3d.h" #include "mxdirectx/mxstopwatch.h" #include "mxdisplaysurface.h" diff --git a/LEGO1/mxdirectx/legodxinfo.cpp b/LEGO1/mxdirectx/legodxinfo.cpp index 63bedc7e..48e7895a 100644 --- a/LEGO1/mxdirectx/legodxinfo.cpp +++ b/LEGO1/mxdirectx/legodxinfo.cpp @@ -26,6 +26,39 @@ int LegoDeviceEnumerate::FormatDeviceName(char* p_buffer, const MxDriver* p_ddIn return -1; } +// FUNCTION: CONFIG 0x00402560 +// FUNCTION: LEGO1 0x1009ce60 +// FUNCTION: BETA10 0x1011c7e0 +int LegoDeviceEnumerate::ParseDeviceName(const char* p_deviceId) +{ + if (!IsInitialized()) { + return -1; + } + + int unknown = -1; + int num = -1; + int hex[4]; + + if (sscanf(p_deviceId, "%d 0x%x 0x%x 0x%x 0x%x", &num, &hex[0], &hex[1], &hex[2], &hex[3]) != 5) { + return -1; + } + + if (num < 0) { + return -1; + } + + GUID guid; + memcpy(&guid, hex, sizeof(guid)); + + int result = ProcessDeviceBytes(num, guid); + + if (result < 0) { + result = ProcessDeviceBytes(-1, guid); + } + + return result; +} + // FUNCTION: CONFIG 0x00402620 // FUNCTION: LEGO1 0x1009cf20 // FUNCTION: BETA10 0x1011c8b3 diff --git a/LEGO1/mxdirectx/legodxinfo.h b/LEGO1/mxdirectx/legodxinfo.h index 9311ebd8..31ea18f6 100644 --- a/LEGO1/mxdirectx/legodxinfo.h +++ b/LEGO1/mxdirectx/legodxinfo.h @@ -8,7 +8,9 @@ // VTABLE: BETA10 0x101befb4 // SIZE 0x14 class LegoDeviceEnumerate : public MxDeviceEnumerate { +public: int ProcessDeviceBytes(int p_deviceNum, GUID& p_guid); + int ParseDeviceName(const char* p_deviceId); int FormatDeviceName(char* p_buffer, const MxDriver* p_ddInfo, const Direct3DDeviceInfo* p_d3dInfo) const; // SYNTHETIC: BETA10 0x100d8d10 diff --git a/LEGO1/mxdirectx/mxdirectxinfo.cpp b/LEGO1/mxdirectx/mxdirectxinfo.cpp index 006b8a1f..c18b9452 100644 --- a/LEGO1/mxdirectx/mxdirectxinfo.cpp +++ b/LEGO1/mxdirectx/mxdirectxinfo.cpp @@ -570,39 +570,6 @@ const char* MxDeviceEnumerate::EnumerateErrorToString(HRESULT p_error) } } -// FUNCTION: CONFIG 0x00402560 -// FUNCTION: LEGO1 0x1009ce60 -// FUNCTION: BETA10 0x1011c7e0 -int MxDeviceEnumerate::ParseDeviceName(const char* p_deviceId) -{ - if (!IsInitialized()) { - return -1; - } - - int unknown = -1; - int num = -1; - int hex[4]; - - if (sscanf(p_deviceId, "%d 0x%x 0x%x 0x%x 0x%x", &num, &hex[0], &hex[1], &hex[2], &hex[3]) != 5) { - return -1; - } - - if (num < 0) { - return -1; - } - - GUID guid; - memcpy(&guid, hex, sizeof(guid)); - - int result = ProcessDeviceBytes(num, guid); - - if (result < 0) { - result = ProcessDeviceBytes(-1, guid); - } - - return result; -} - // FUNCTION: CONFIG 0x00402730 // FUNCTION: LEGO1 0x1009d030 // FUNCTION: BETA10 0x1011ca54 diff --git a/LEGO1/mxdirectx/mxdirectxinfo.h b/LEGO1/mxdirectx/mxdirectxinfo.h index 9cf36814..a264590d 100644 --- a/LEGO1/mxdirectx/mxdirectxinfo.h +++ b/LEGO1/mxdirectx/mxdirectxinfo.h @@ -203,7 +203,6 @@ class MxDeviceEnumerate { LPD3DDEVICEDESC p_HELDesc ); const char* EnumerateErrorToString(HRESULT p_error); - int ParseDeviceName(const char* p_deviceId); int GetDevice(int p_deviceNum, MxDriver*& p_driver, Direct3DDeviceInfo*& p_device); int BETA_1011cc65(int p_idx, char* p_buffer);