Skip to content

Commit

Permalink
config: remove CCommonDialog, move mfc annotations to StdAfx.h (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr authored Feb 9, 2024
1 parent 94c4576 commit f1f4bd1
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 74 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,10 @@ 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
CONFIG/StdAfx.cpp
CONFIG/res/config.rc
)
target_compile_definitions(config PRIVATE _AFXDLL MXDIRECTX_FOR_CONFIG)
Expand Down
2 changes: 1 addition & 1 deletion CONFIG/AboutDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DECOMP_SIZE_ASSERT(CDialog, 0x60)
DECOMP_SIZE_ASSERT(CAboutDialog, 0x60)

// FUNCTION: CONFIG 0x00403c20
CAboutDialog::CAboutDialog() : CCommonDialog(IDD)
CAboutDialog::CAboutDialog() : CDialog(IDD)
{
}

Expand Down
17 changes: 2 additions & 15 deletions CONFIG/AboutDlg.h
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
#if !defined(AFX_ABOUTDLG_H)
#define AFX_ABOUTDLG_H

#include "afxwin.h"
#include "common.h"
#include "StdAfx.h"
#include "compat.h"
#include "res/resource.h"

// VTABLE: CONFIG 0x00406308
// SIZE 0x60
class CAboutDialog : public CCommonDialog {
class CAboutDialog : public CDialog {
public:
CAboutDialog();
// Dialog Data
//{{AFX_DATA(CMainDialog)
enum {
IDD = IDD_ABOUT
};
//}}AFX_DATA

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainDialog)

protected:
void DoDataExchange(CDataExchange* pDX) override;
//}}AFX_VIRTUAL
// void UpdateInterface();
// void SwitchToAdvanced(BOOL p_advanced);
// Implementation

protected:
//{{AFX_MSG(CMainDialog)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

Expand Down
3 changes: 1 addition & 2 deletions CONFIG/ConfigCommandLineInfo.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#if !defined(AFX_CONFIGCOMMANDLINEINFO_H)
#define AFX_CONFIGCOMMANDLINEINFO_H

#include "StdAfx.h"
#include "compat.h"
#include "config.h"
#include "decomp.h"

#include <afxwin.h>

// VTABLE: CONFIG 0x004060e8
// SIZE 0x24
class CConfigCommandLineInfo : public CCommandLineInfo {
Expand Down
2 changes: 1 addition & 1 deletion CONFIG/MainDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DECOMP_SIZE_ASSERT(CDialog, 0x60)
DECOMP_SIZE_ASSERT(CMainDialog, 0x70)

// FUNCTION: CONFIG 0x00403d50
CMainDialog::CMainDialog(CWnd* pParent) : CCommonDialog(IDD, pParent)
CMainDialog::CMainDialog(CWnd* pParent) : CDialog(IDD, pParent)
{
afxCurrentWinApp;
m_icon = LoadIconA(AfxFindResourceHandle(MAKEINTRESOURCE(IDI_CONFIG), RT_GROUP_ICON), MAKEINTRESOURCE(IDI_CONFIG));
Expand Down
15 changes: 3 additions & 12 deletions CONFIG/MainDlg.h
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
#if !defined(AFX_MAINDLG_H)
#define AFX_MAINDLG_H

#include "afxwin.h"
#include "common.h"
#include "StdAfx.h"
#include "compat.h"
#include "decomp.h"
#include "res/resource.h"

// VTABLE: CONFIG 0x004063e0
// SIZE 0x70
class CMainDialog : public CCommonDialog {
class CMainDialog : public CDialog {
public:
CMainDialog(CWnd* pParent);
// Dialog Data
//{{AFX_DATA(CMainDialog)
enum {
IDD = IDD_MAIN
};
//}}AFX_DATA

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainDialog)

protected:
void DoDataExchange(CDataExchange* pDX) override;
//}}AFX_VIRTUAL
void UpdateInterface();
void SwitchToAdvanced(BOOL p_advanced);

Expand All @@ -35,7 +27,6 @@ class CMainDialog : public CCommonDialog {
// Implementation

protected:
//{{AFX_MSG(CMainDialog)
BOOL OnInitDialog() override;
void OnSysCommand(UINT nID, LPARAM lParam);
void OnPaint();
Expand All @@ -57,7 +48,7 @@ class CMainDialog : public CCommonDialog {
void OnButtonAdvanced();
void OnCheckboxDrawCursor();
void OnCheckboxMusic();
//}}AFX_MSG

DECLARE_MESSAGE_MAP()
};

Expand Down
5 changes: 5 additions & 0 deletions CONFIG/StdAfx.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// stdafx.cpp : source file that includes just the standard includes
// simple.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"
31 changes: 31 additions & 0 deletions CONFIG/StdAfx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#if !defined(AFX_STDAFX_H)
#define AFX_STDAFX_H

#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers

#include <afxext.h> // MFC extensions
#include <afxwin.h> // MFC core and standard components
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

#if 0

// FUNCTION: CONFIG 0x402ca0
// CObject::Serialize

// FUNCTION: CONFIG 0x402cb0
// CObject::AssertValid

// FUNCTION: CONFIG 0x402cc0
// CObject::Dump

// FUNCTION: CONFIG 0x00403c90
// CWnd::BeginModalState

// FUNCTION: CONFIG 0x00403ca0
// CWnd::EndModalState

#endif

#endif // !defined(AFX_STDAFX_H)
13 changes: 0 additions & 13 deletions CONFIG/common.cpp

This file was deleted.

16 changes: 0 additions & 16 deletions CONFIG/common.h

This file was deleted.

2 changes: 1 addition & 1 deletion CONFIG/config.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#if !defined(AFX_CONFIG_H)
#define AFX_CONFIG_H

#include "StdAfx.h"
#include "compat.h"
#include "decomp.h"

#include <afxwin.h>
#include <d3d.h>

class MxDeviceEnumerate;
Expand Down
12 changes: 0 additions & 12 deletions CONFIG/library_mfc.h

This file was deleted.

0 comments on commit f1f4bd1

Please sign in to comment.