Skip to content

Commit

Permalink
Partial implementation of the Performance Wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaldaien committed May 12, 2016
1 parent 3bc20f4 commit 51434a7
Show file tree
Hide file tree
Showing 6 changed files with 396 additions and 21 deletions.
9 changes: 9 additions & 0 deletions src/Resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@
#define LANG_WOLOF 0x88
#define IDI_STEAM 137
#define LANG_DARI 0x8c
#define IDD_PERF_WIZARD 140
#define IDD_FRAMERATE 141
#define CF_DSPENHMETAFILE 0x008E
#define IDD_STEAM 143
Expand Down Expand Up @@ -1335,6 +1336,14 @@
#define IDC_RESOLUTION 1074
#define grp4 0x0433
#define IDC_SUS_TABS 1075
#define IDC_PERF_DISP_MODE 1076
#define IDC_PERF_TEARING 1077
#define IDC_PERF_GOAL 1078
#define IDC_PERF_HEADER 1079
#define IDC_PERF_DESCRIPTION 1080
#define IDC_PERF_FOOTER 1081
#define IDC_PERF_OPTIMIZE 1082
#define IDC_PERF_COMPATIBILITY 1083
#define frm1 0x0434
#define frm2 0x0435
#define frm3 0x0436
Expand Down
31 changes: 15 additions & 16 deletions src/ds3t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

using namespace ds3t;

#define DS3T_VERSION_STR L"0.0.4"
#define DS3T_VERSION_STR L"0.0.5"

INT_PTR CALLBACK Config (HWND, UINT, WPARAM, LPARAM);

Expand All @@ -52,12 +52,12 @@ bool sus_installed = false; // Whether Souls Unsqueezed is present

HWND hWndApp;

//extern INT_PTR CALLBACK AudioConfig (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK FramerateConfig (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK GraphicsConfig (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK SteamConfig (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK PluginsConfig (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK OSDConfig (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK PerformanceWizard (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK FramerateConfig (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK GraphicsConfig (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK SteamConfig (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK PluginsConfig (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK OSDConfig (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);

HWND hWndSUSTab;

Expand Down Expand Up @@ -1123,9 +1123,6 @@ Config (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
L"DefaultResY" );
}

Button_SetCheck ( GetDlgItem (hDlg, IDC_VSYNC),
presentation_interval->get_value () > 0 );

////anisotropy->register_to_cfg (config.get_file (), L"anisotropy");
////anisotropy->load ();

Expand Down Expand Up @@ -1215,7 +1212,7 @@ Config (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
if (! (config.get_file_sus ()->get_sections ().empty () ||
config.get_file_dxgi ()->get_sections ().empty ())) {
setup_sus_config (hDlg);
/////// hWndSUSTab = CreateDialog (GetWindowInstance (hDlg), MAKEINTRESOURCE (IDD_AUDIO), hDlg, AudioConfig);
hWndSUSTab = CreateDialog (GetWindowInstance (hDlg), MAKEINTRESOURCE (IDD_PERF_WIZARD), hDlg, PerformanceWizard);
} else {
EnableWindow (GetDlgItem (hDlg, IDC_SUS_TABS), FALSE);
}
Expand Down Expand Up @@ -1255,7 +1252,7 @@ Config (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
HINSTANCE hInstance = GetWindowInstance (hDlg);

if (sel == SUS_WIZARD_TAB) {
///// hWndSUSTab = CreateDialog (GetWindowInstance (hDlg), MAKEINTRESOURCE (IDD_PERFORMANCE), hDlg, PerformanceWizard);
hWndSUSTab = CreateDialog (GetWindowInstance (hDlg), MAKEINTRESOURCE (IDD_PERF_WIZARD), hDlg, PerformanceWizard);
} else if (sel == SUS_FRAMERATE_TAB) {
hWndSUSTab = CreateDialog (GetWindowInstance (hDlg), MAKEINTRESOURCE (IDD_FRAMERATE), hDlg, FramerateConfig);
} else if (sel == SUS_GRAPHICS_TAB) {
Expand Down Expand Up @@ -1423,11 +1420,13 @@ Config (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
refresh_rate->set_value (refresh);
refresh_rate->store ();

presentation_interval->set_value (
Button_GetCheck ( GetDlgItem (hDlg, IDC_VSYNC) )
);
if (sus_installed) {
presentation_interval->set_value (
Button_GetCheck ( GetDlgItem (hDlg, IDC_VSYNC) )
);

presentation_interval->store ();
presentation_interval->store ();
}

use_vsync->store ();

Expand Down
28 changes: 23 additions & 5 deletions src/ds3t.rc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ CAPTION "About DS3T"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
ICON VK_F17,IDC_STATIC,14,14,21,20
LTEXT "DS3T, Version 0.0.2",IDC_STATIC,42,14,114,8,SS_NOPREFIX
LTEXT "DS3T, Version 0.1.0",IDC_STATIC,42,14,114,8,SS_NOPREFIX
LTEXT "Copyright (C) 2016",IDC_STATIC,42,26,114,8
DEFPUSHBUTTON "OK",IDOK,113,41,50,14,WS_GROUP
END
Expand Down Expand Up @@ -76,6 +76,24 @@ BEGIN
LTEXT "Shim Mode:",IDC_STATIC,212,67,38,9
END

IDD_PERF_WIZARD DIALOGEX 0, 0, 250, 115
STYLE DS_ABSALIGN | DS_SETFONT | DS_3DLOOK | DS_CONTROL | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_BORDER
EXSTYLE WS_EX_TRANSPARENT | WS_EX_CONTROLPARENT
FONT 8, "Ms Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "Display Mode", IDC_STATIC,7, 8,60,9
LTEXT "Tearing", IDC_STATIC,7,23,60,9
LTEXT "Performance Goal",IDC_STATIC,7,38,60,9
COMBOBOX IDC_PERF_DISP_MODE, 69, 6,97,560,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_TABSTOP
COMBOBOX IDC_PERF_TEARING, 69,21,97,560,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_TABSTOP
COMBOBOX IDC_PERF_GOAL, 69,36,97,560,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_TABSTOP
LTEXT "", IDC_PERF_HEADER, 7,55,235,10,SS_CENTER
LTEXT "", IDC_PERF_DESCRIPTION, 7,70,235,32
LTEXT "", IDC_PERF_FOOTER, 7,105,235,10,SS_CENTER
CONTROL "Optimize", IDC_PERF_OPTIMIZE, "Button",WS_TABSTOP,170,5,75,22
CONTROL "Compatibility",IDC_PERF_COMPATIBILITY,"Button",WS_TABSTOP,170,28,75,22
END

IDD_FRAMERATE DIALOGEX 0, 0, 250, 115
STYLE DS_ABSALIGN | DS_SETFONT | DS_3DLOOK | DS_CONTROL | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_BORDER
EXSTYLE WS_EX_TRANSPARENT | WS_EX_CONTROLPARENT
Expand All @@ -92,7 +110,7 @@ BEGIN
EDITTEXT IDC_CUSTOM_FPS,100,6,20,12,ES_AUTOHSCROLL | ES_NUMBER
END

IDD_OSD DIALOGEX 0, 0, 249, 115
IDD_OSD DIALOGEX 0, 0, 250, 115
STYLE DS_ABSALIGN | DS_SETFONT | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_SYSMENU
FONT 8, "Ms Shell Dlg", 0, 0, 0x0
BEGIN
Expand All @@ -108,14 +126,14 @@ BEGIN
LTEXT "These settings will not be saved unless you run this tool as Admin.",IDC_STATIC,17,91,212,8
END

IDD_PLUGINS DIALOG 0, 0, 249, 115
IDD_PLUGINS DIALOG 0, 0, 250, 115
STYLE DS_ABSALIGN | DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_SYSMENU
FONT 8, "Ms Shell Dlg"
BEGIN
LTEXT "<TODO>",0,109,53,30,9
END

IDD_STEAM DIALOGEX 0, 0, 249, 115
IDD_STEAM DIALOGEX 0, 0, 250, 115
STYLE DS_ABSALIGN | DS_SETFONT | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_SYSMENU
FONT 8, "Ms Shell Dlg", 0, 0, 0x0
BEGIN
Expand All @@ -126,7 +144,7 @@ BEGIN
PUSHBUTTON "Achievement Sound File",IDC_ACHIEVEMENT_SOUND,138,8,102,18
END

IDD_GRAPHICS DIALOGEX 0, 0, 249, 115
IDD_GRAPHICS DIALOGEX 0, 0, 250, 115
STYLE DS_ABSALIGN | DS_SETFONT | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_SYSMENU
FONT 8, "Ms Shell Dlg", 0, 0, 0x0
BEGIN
Expand Down
1 change: 1 addition & 0 deletions src/ds3t.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
<ClCompile Include="sus_framerate.cpp" />
<ClCompile Include="sus_graphics.cpp" />
<ClCompile Include="sus_osd.cpp" />
<ClCompile Include="sus_perfwiz.cpp" />
<ClCompile Include="sus_plugins.cpp" />
<ClCompile Include="sus_steam.cpp" />
<ClCompile Include="ds3t.cpp" />
Expand Down
3 changes: 3 additions & 0 deletions src/ds3t.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
<ClCompile Include="xml.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sus_perfwiz.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ds3t.rc">
Expand Down
Loading

0 comments on commit 51434a7

Please sign in to comment.