Skip to content

Commit

Permalink
-Game window spawns on monitor of launcher window
Browse files Browse the repository at this point in the history
-Mouse4/5 support in raw input mode
-Borderless fullscreen
-Launcher is now a class
  • Loading branch information
mkentie committed Feb 17, 2016
1 parent 3cbe148 commit 6bd9bcd
Show file tree
Hide file tree
Showing 20 changed files with 491 additions and 275 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,5 @@ FakesAssemblies/
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml

*.VC.opendb
1 change: 0 additions & 1 deletion DeusExe/DataDirDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ decltype(CDataDirDialog::sm_SupportedExtensions) CDataDirDialog::sm_SupportedExt
};

CDataDirDialog::CDataDirDialog()
:m_bAddTopLevelDirsOnly(true)
{

}
Expand Down
2 changes: 1 addition & 1 deletion DeusExe/DataDirDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CDataDirDialog

// This is used so the top-level dirs (Shifter, HDTP) are first added to the list. However, their contents are added in the order they're on disk.
// This prevents the order of sub-items from shifting depending on in which order they were added.
bool m_bAddTopLevelDirsOnly;
bool m_bAddTopLevelDirsOnly = true;

class CCaseInsensitiveHash
{
Expand Down
12 changes: 7 additions & 5 deletions DeusExe/DeusExe.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ProjectGuid>{36141612-AE9B-4E98-B565-A4A313847438}</ProjectGuid>
<RootNamespace>DeusExe</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.10586.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
Expand Down Expand Up @@ -76,14 +76,16 @@
</PrecompiledHeader>
<UndefinePreprocessorDefinitions>
</UndefinePreprocessorDefinitions>
<CompileAsWinRT>true</CompileAsWinRT>
<ForcedUsingFiles>$(VCInstallDir)lib\store\references\platform.winmd;%(ForcedUsingFiles)</ForcedUsingFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<MinimumRequiredVersion>
</MinimumRequiredVersion>
</Link>
<Manifest />
<Manifest>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
<EnableDpiAwareness>true</EnableDpiAwareness>
</Manifest>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down Expand Up @@ -125,13 +127,13 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="DataDirDialog.h" />
<ClInclude Include="Detoureds.h" />
<ClInclude Include="FileManagerDeusExe.h" />
<ClInclude Include="ExecHook.h" />
<ClInclude Include="FileManagerDeusExe.h" />
<ClInclude Include="FancyTreeView.h" />
<ClInclude Include="FixApp.h" />
<ClInclude Include="FreeSpaceFix.h" />
<ClInclude Include="GUIScalingFix.h" />
<ClInclude Include="Launcher.h" />
<ClInclude Include="LauncherDialog.h" />
<ClInclude Include="Misc.h" />
<ClInclude Include="NativeHooks.h" />
Expand Down
12 changes: 6 additions & 6 deletions DeusExe/DeusExe.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="detoureds.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="datadirdialog.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand All @@ -92,9 +89,6 @@
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="exechook.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FancyTreeView.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand All @@ -113,6 +107,12 @@
<ClInclude Include="GUIScalingFix.h">
<Filter>Fixes\Header Files</Filter>
</ClInclude>
<ClInclude Include="Launcher.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ExecHook.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="deusex.bmp">
Expand Down
1 change: 0 additions & 1 deletion DeusExe/ExecHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "ExecHook.h"

FExecHook::FExecHook()
:m_pPreferences(nullptr)
{

}
Expand Down
4 changes: 2 additions & 2 deletions DeusExe/ExecHook.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class FExecHook : public FExec, public FNotifyHook
explicit FExecHook();
~FExecHook();
private:
WConfigProperties* m_pPreferences; //Cleaned up by engine
WConfigProperties* m_pPreferences = nullptr; //Cleaned up by engine

//From FExec
private:
protected:
UBOOL Exec( const TCHAR* Cmd, FOutputDevice& Ar );

//From FNotifyHook
Expand Down
62 changes: 44 additions & 18 deletions DeusExe/FixApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,45 @@ void CFixApp::ReadSettings()
assert(GConfig);

//Full-screen
BOOL bFullScreen = TRUE;
GConfig->GetBool(L"WinDrv.WindowsClient", L"StartupFullScreen", bFullScreen);
CheckDlgButton(m_hWnd, CHK_FULLSCREEN, bFullScreen);
UBOOL bBorderless = FALSE;
GConfig->GetBool(PROJECTNAME, L"BorderlessFullscreenWindow", bBorderless);

UBOOL bFullscreen = FALSE;
if (!bBorderless)
{
GConfig->GetBool(L"WinDrv.WindowsClient", L"StartupFullscreen", bFullscreen);
}

CheckRadioButton(m_hWnd, RADIO_VPWINDOWED, RADIO_VPBORDERLESS, bBorderless ? RADIO_VPBORDERLESS : bFullscreen ? RADIO_VPFULLSCREEN : RADIO_VPWINDOWED);

//Resolution
int iResX = 1024;
GConfig->GetInt(L"WinDrv.WindowsClient", bFullScreen ? L"FullscreenViewportX" : L"WindowedViewportX", iResX);
GConfig->GetInt(L"WinDrv.WindowsClient", bFullscreen ? L"FullscreenViewportX" : L"WindowedViewportX", iResX);
int iResY = 768;
GConfig->GetInt(L"WinDrv.WindowsClient", bFullScreen ? L"FullscreenViewportY" : L"WindowedViewportY", iResY);
GConfig->GetInt(L"WinDrv.WindowsClient", bFullscreen ? L"FullscreenViewportY" : L"WindowedViewportY", iResY);

wchar_t szBuffer[20];
_snwprintf_s(szBuffer, _TRUNCATE, L"%dx%d", iResX, iResY);
const int iComboRes = ComboBox_FindStringExact(m_hWndCBResolutions, -1, szBuffer);

if(iComboRes != CB_ERR) //Can fail if res not supported
const bool bStandardRes = iComboRes != CB_ERR;

if(bStandardRes) //Can fail if res not supported
{
ComboBox_SetCurSel(m_hWndCBResolutions, iComboRes);
EnableWindow(m_hWndCBResolutions, TRUE);
EnableWindow(m_hWndTxtResX, FALSE);
EnableWindow(m_hWndTxtResY, FALSE);
CheckRadioButton(m_hWnd, RADIO_RESCOMMON, RADIO_RESCUSTOM, RADIO_RESCOMMON);
}
else
{
CheckRadioButton(m_hWnd,RADIO_RESCOMMON,RADIO_RESCUSTOM,RADIO_RESCUSTOM);
EnableWindow(m_hWndCBResolutions, FALSE);
EnableWindow(m_hWndTxtResX, TRUE);
EnableWindow(m_hWndTxtResY, TRUE);
SetDlgItemInt(m_hWnd,TXT_RESX,iResX,FALSE);
SetDlgItemInt(m_hWnd,TXT_RESY,iResY,FALSE);
}

SetDlgItemInt(m_hWnd, TXT_RESX, iResX, FALSE);
SetDlgItemInt(m_hWnd, TXT_RESY, iResY, FALSE);

EnableDisableResSettings(!bBorderless, bStandardRes);


//Bit depth
int iBitDepth = sm_iBPP_32;
GConfig->GetInt(L"WinDrv.WindowsClient", L"FullscreenColorBits", iBitDepth);
Expand Down Expand Up @@ -211,6 +218,15 @@ void CFixApp::PopulateDialog()

}

void CFixApp::EnableDisableResSettings(const bool bChangesAllowed, const bool bCommon) const
{
EnableWindow(m_hWndRadioResCommon, bChangesAllowed);
EnableWindow(m_hWndRadioResCustom, bChangesAllowed);
EnableWindow(m_hWndCBResolutions, bChangesAllowed && bCommon);
EnableWindow(m_hWndTxtResX, bChangesAllowed && !bCommon);
EnableWindow(m_hWndTxtResY, bChangesAllowed && !bCommon);
}

void CFixApp::ApplySettings() const
{
assert(GConfig);
Expand Down Expand Up @@ -276,6 +292,7 @@ void CFixApp::ApplySettings() const
//Audio latency
GConfig->SetInt(L"Galaxy.GalaxyAudioSubsystem", L"Latency", GetDlgItemInt(m_hWnd, TXT_LATENCY, nullptr, FALSE));
//Full-screen
GConfig->SetBool(PROJECTNAME, L"BorderlessFullscreenWindow", IsDlgButtonChecked(m_hWnd, RADIO_VPBORDERLESS) != 0);
GConfig->SetBool(L"WinDrv.WindowsClient",L"StartupFullSCreen",IsDlgButtonChecked(m_hWnd,CHK_FULLSCREEN)!=0);
//FPS Limit
GConfig->SetInt(PROJECTNAME, L"FPSLimit", GetDlgItemInt(m_hWnd, TXT_FPSLIMIT, nullptr, FALSE));
Expand Down Expand Up @@ -303,7 +320,9 @@ INT_PTR CALLBACK CFixApp::FixAppDialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,
pThis->m_hWnd = hwndDlg;
pThis->m_hWndCBGUIScales = GetDlgItem(hwndDlg, COMBO_GUISCALING);
pThis->m_hWndCBRenderers = GetDlgItem(hwndDlg, COMBO_RENDERER);
pThis->m_hWndRadioResCommon = GetDlgItem(hwndDlg, RADIO_RESCOMMON);
pThis->m_hWndCBResolutions = GetDlgItem(hwndDlg, COMBO_RESOLUTION);
pThis->m_hWndRadioResCustom = GetDlgItem(hwndDlg, RADIO_RESCUSTOM);
pThis->m_hWndTxtResX = GetDlgItem(hwndDlg, TXT_RESX);
pThis->m_hWndTxtResY = GetDlgItem(hwndDlg, TXT_RESY);
pThis->m_hWndTxtFOV = GetDlgItem(hwndDlg, TXT_FOV);
Expand All @@ -323,10 +342,8 @@ INT_PTR CALLBACK CFixApp::FixAppDialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,
case RADIO_RESCOMMON:
case RADIO_RESCUSTOM:
{
const bool bCustom = LOWORD(wParam) == RADIO_RESCUSTOM;
EnableWindow(pThis->m_hWndTxtResX, bCustom);
EnableWindow(pThis->m_hWndTxtResY, bCustom);
EnableWindow(pThis->m_hWndCBResolutions, !bCustom);
const bool bCommon = LOWORD(wParam) == RADIO_RESCOMMON;
pThis->EnableDisableResSettings(IsDlgButtonChecked(pThis->m_hWnd, RADIO_VPBORDERLESS)==0, bCommon);
}
return TRUE;

Expand All @@ -339,6 +356,15 @@ INT_PTR CALLBACK CFixApp::FixAppDialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,
}
return TRUE;

case RADIO_VPFULLSCREEN:
case RADIO_VPWINDOWED:
case RADIO_VPBORDERLESS:
{
const bool bBorderless = LOWORD(wParam) == RADIO_VPBORDERLESS;
pThis->EnableDisableResSettings(!bBorderless, IsDlgButtonChecked(pThis->m_hWnd, RADIO_RESCOMMON)!=0);
}
return TRUE;

case CHK_GUIFIX:
EnableWindow(pThis->m_hWndCBGUIScales, IsDlgButtonChecked(pThis->m_hWnd, CHK_GUIFIX));
return TRUE;
Expand Down
7 changes: 5 additions & 2 deletions DeusExe/FixApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ class CFixApp
private:
void ReadSettings();
void PopulateDialog();
void EnableDisableResSettings(const bool bChangesAllowed, const bool bCommon) const;
void ApplySettings() const;

static INT_PTR CALLBACK FixAppDialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);

//Constants
static const unsigned char sm_iBPP_16 = 16;
static const unsigned char sm_iBPP_32 = 32;
static constexpr unsigned char sm_iBPP_16 = 16;
static constexpr unsigned char sm_iBPP_32 = 32;

struct Resolution //These are all ints to match what Unreal loads from the ini file
{
Expand All @@ -30,7 +31,9 @@ class CFixApp
HWND m_hWnd;
HWND m_hWndCBGUIScales;
HWND m_hWndCBRenderers;
HWND m_hWndRadioResCommon;
HWND m_hWndCBResolutions;
HWND m_hWndRadioResCustom;
HWND m_hWndTxtResX;
HWND m_hWndTxtResY;
HWND m_hWndTxtFOV;
Expand Down
Loading

0 comments on commit 6bd9bcd

Please sign in to comment.