diff --git a/CMakeLists.txt b/CMakeLists.txt index c6036c51..8ccd0188 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -444,6 +444,7 @@ if (ISLE_BUILD_CONFIG) LEGO1/mxdirectx/mxdirect3d.cpp CONFIG/config.cpp CONFIG/ConfigCommandLineInfo.cpp + CONFIG/common.cpp CONFIG/AboutDlg.cpp CONFIG/MainDlg.cpp CONFIG/detectdx5.cpp diff --git a/CONFIG/AboutDlg.cpp b/CONFIG/AboutDlg.cpp index 055cb5c4..b14704f1 100644 --- a/CONFIG/AboutDlg.cpp +++ b/CONFIG/AboutDlg.cpp @@ -6,25 +6,14 @@ DECOMP_SIZE_ASSERT(CDialog, 0x60) DECOMP_SIZE_ASSERT(CAboutDialog, 0x60) // FUNCTION: CONFIG 0x00403c20 -CAboutDialog::CAboutDialog() : CDialog(IDD) +CAboutDialog::CAboutDialog() : CCommonDialog(IDD) { } -// FUNCTION: CONFIG 0x00403c90 -void CAboutDialog::BeginModalState() -{ - ::EnableWindow(m_hWnd, FALSE); -} - -// FUNCTION: CONFIG 0x00403ca0 -void CAboutDialog::EndModalState() -{ - ::EnableWindow(m_hWnd, TRUE); -} - // FUNCTION: CONFIG 0x00403d20 void CAboutDialog::DoDataExchange(CDataExchange* pDX) { } + BEGIN_MESSAGE_MAP(CAboutDialog, CDialog) END_MESSAGE_MAP() diff --git a/CONFIG/AboutDlg.h b/CONFIG/AboutDlg.h index 4c5c9e59..19c25dda 100644 --- a/CONFIG/AboutDlg.h +++ b/CONFIG/AboutDlg.h @@ -1,13 +1,15 @@ #if !defined(AFX_ABOUTDLG_H) #define AFX_ABOUTDLG_H +#include "common.h" + #include "afxwin.h" #include "compat.h" #include "res/resource.h" // VTABLE: CONFIG 0x00406308 // SIZE 0x60 -class CAboutDialog : public CDialog { +class CAboutDialog : public CCommonDialog { public: CAboutDialog(); // Dialog Data @@ -22,8 +24,6 @@ class CAboutDialog : public CDialog { protected: void DoDataExchange(CDataExchange* pDX) override; - void BeginModalState() override; - void EndModalState() override; //}}AFX_VIRTUAL // void UpdateInterface(); // void SwitchToAdvanced(BOOL p_advanced); diff --git a/CONFIG/MainDlg.cpp b/CONFIG/MainDlg.cpp index e2f52209..52f55e58 100644 --- a/CONFIG/MainDlg.cpp +++ b/CONFIG/MainDlg.cpp @@ -10,7 +10,7 @@ DECOMP_SIZE_ASSERT(CDialog, 0x60) DECOMP_SIZE_ASSERT(CMainDialog, 0x70) // FUNCTION: CONFIG 0x00403d50 -CMainDialog::CMainDialog(CWnd* pParent) : CDialog(IDD, pParent) +CMainDialog::CMainDialog(CWnd* pParent) : CCommonDialog(IDD, pParent) { afxCurrentWinApp; m_icon = LoadIconA(AfxFindResourceHandle(MAKEINTRESOURCE(IDI_CONFIG), RT_GROUP_ICON), MAKEINTRESOURCE(IDI_CONFIG)); diff --git a/CONFIG/MainDlg.h b/CONFIG/MainDlg.h index 5abfaf5a..10564a9e 100644 --- a/CONFIG/MainDlg.h +++ b/CONFIG/MainDlg.h @@ -1,6 +1,8 @@ #if !defined(AFX_MAINDLG_H) #define AFX_MAINDLG_H +#include "common.h" + #include "afxwin.h" #include "compat.h" #include "decomp.h" @@ -8,7 +10,7 @@ // VTABLE: CONFIG 0x004063e0 // SIZE 0x70 -class CMainDialog : public CDialog { +class CMainDialog : public CCommonDialog { public: CMainDialog(CWnd* pParent); // Dialog Data @@ -23,8 +25,6 @@ class CMainDialog : public CDialog { protected: void DoDataExchange(CDataExchange* pDX) override; - void BeginModalState() override {} - void EndModalState() override {} //}}AFX_VIRTUAL void UpdateInterface(); void SwitchToAdvanced(BOOL p_advanced); diff --git a/CONFIG/common.cpp b/CONFIG/common.cpp new file mode 100644 index 00000000..173f0bd1 --- /dev/null +++ b/CONFIG/common.cpp @@ -0,0 +1,26 @@ +#include "common.h" + + +// FUNCTION: CONFIG 0x00402ca0 +void CSerializer::Serialize(CArchive& ar) { +} + +// FUNCTION: CONFIG 0x00402cb0 +void CSerializer::AssertValid() const { +} + +// FUNCTION: CONFIG 0x00402cc0 +void CSerializer::Dump(CDumpContext& dc) const { +} + +// FUNCTION: CONFIG 0x00403c90 +void CCommonDialog::BeginModalState() +{ + ::EnableWindow(m_hWnd, FALSE); +} + +// FUNCTION: CONFIG 0x00403ca0 +void CCommonDialog::EndModalState() +{ + ::EnableWindow(m_hWnd, TRUE); +} diff --git a/CONFIG/common.h b/CONFIG/common.h new file mode 100644 index 00000000..7dee96c2 --- /dev/null +++ b/CONFIG/common.h @@ -0,0 +1,23 @@ +#ifndef AFX_COMMON_H +#define AFX_COMMON_H + +#include + +#include "compat.h" + +class CSerializer { +public: + void Serialize(CArchive& ar); + void AssertValid() const; + void Dump(CDumpContext& dc) const; +}; + +class CCommonDialog : public CDialog { +public: + CCommonDialog(UINT nIDTemplate, CWnd* pParentWnd = NULL) : CDialog(nIDTemplate, pParentWnd) { } + + void BeginModalState() override; + void EndModalState() override; +}; + +#endif