diff --git a/README.md b/README.md
index 42e6ef9..830c11e 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ Patches games memory while running, does not modify any game files. works with e
* works with legit, unmodified steam version as well as with unpacked, not-so-legit versions
* GSYNC and FreeSync support even in borderless window mode
* unlock frame rate (remove FPS limit) by setting a new custom limit or setting lock to unlimited
- * 60 Hz monitors: disable VSYNC via driver (use 'Enhanced Sync' on AMD) and use fullscreen
+ * 60 Hz monitors: disable VSYNC via driver (use 'Enhanced Sync' on AMD) and use fullscreen
* high refresh rate monitors: use borderless or force monitor to always use highest available refresh rate and then use fullscreen
* add a custom resolution, 21/9 widescreen supported (will overwrite the default 1920x1080 resolution, HUD limited to 16/9)
* increase field of view (FOV) (credits to jackfuste)
@@ -105,8 +105,8 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
## Credits
* jackfuste for FOV findings and running speed fix
-* TyChii93 for AMD and widescreen testing
-* [Darius Dan](www.dariusdan.com) for the icon
+* TyChii93#2376 for AMD and widescreen testing
+* [Darius Dan](https://www.dariusdan.com) for the icon
## Limitations
@@ -114,9 +114,11 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
* in fullscreen the game forces the monitor to 60 Hz so you'll have to handle this with driver override too, see Usage
* your monitor has to support your custom resolution otherwise it won't show up correctly
* due to how the game renders altering FOV will not move the HUD
-* the HUD is limited to 16/9 even in 21/9 resolutions
+* the HUD is limited to 16/9 even on 21/9 resolutions
## Version History
+* v1.0.1 (2019-03-26)
+ * Fixed scaling issue in borderless window mode (thanks to Spacecop42#0947 for reporting)
* v1.0.0 (2019-03-25)
* Initial release
diff --git a/SekiroFpsUnlockAndMore/MainWindow.xaml b/SekiroFpsUnlockAndMore/MainWindow.xaml
index 4493494..5255a8a 100644
--- a/SekiroFpsUnlockAndMore/MainWindow.xaml
+++ b/SekiroFpsUnlockAndMore/MainWindow.xaml
@@ -41,7 +41,7 @@
diff --git a/SekiroFpsUnlockAndMore/MainWindow.xaml.cs b/SekiroFpsUnlockAndMore/MainWindow.xaml.cs
index 686f533..0c45d22 100644
--- a/SekiroFpsUnlockAndMore/MainWindow.xaml.cs
+++ b/SekiroFpsUnlockAndMore/MainWindow.xaml.cs
@@ -62,8 +62,10 @@ namespace SekiroFpsUnlockAndMore
internal IntPtr _gameProc = IntPtr.Zero;
internal static IntPtr _gameProcStatic;
internal readonly DispatcherTimer _dispatcherTimerCheck = new DispatcherTimer();
- internal string logPath;
- internal bool retryAccess = true;
+ internal string _logPath;
+ internal bool _retryAccess = true;
+ internal RECT _windowRect;
+ internal RECT _clientRect;
public MainWindow()
{
@@ -75,7 +77,7 @@ namespace SekiroFpsUnlockAndMore
///
private void Window_Loaded(object sender, RoutedEventArgs e)
{
- logPath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + @"\SekiroFpsUnlockAndMore.log";
+ _logPath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + @"\SekiroFpsUnlockAndMore.log";
this.cbSelectFov.ItemsSource = _fovMatrix;
this.cbSelectFov.SelectedIndex = 0;
@@ -166,7 +168,7 @@ namespace SekiroFpsUnlockAndMore
LogToFile("Hwnd: " + _gameHwnd.ToString("X"));
LogToFile("Proc: " + _gameProc.ToString("X"));
LogToFile("Base: " + procList[gameIndex].MainModule.BaseAddress.ToString("X"));
- if (!retryAccess)
+ if (!_retryAccess)
{
UpdateStatus("no access to game...", Brushes.Red);
_dispatcherTimerCheck.Stop();
@@ -180,7 +182,7 @@ namespace SekiroFpsUnlockAndMore
_gameProcStatic = IntPtr.Zero;
}
LogToFile("retrying...");
- retryAccess = false;
+ _retryAccess = false;
return;
}
@@ -239,6 +241,8 @@ namespace SekiroFpsUnlockAndMore
this.cbFov.IsChecked = false;
}
+ GetWindowRect(_gameHwnd, out _windowRect);
+ GetClientRect(_gameHwnd, out _clientRect);
_running = true;
_dispatcherTimerCheck.Stop();
PatchGame();
@@ -426,7 +430,11 @@ namespace SekiroFpsUnlockAndMore
/// The handle to the window.
private void SetWindowWindowed(IntPtr hwnd)
{
+ var width = _windowRect.Right - _windowRect.Left;
+ var height = _windowRect.Bottom - _windowRect.Top;
+ Debug.WriteLine(string.Format("Window Resolution: {0}x{1}", width, height));
SetWindowLongPtr(hwnd, GWL_STYLE, WS_VISIBLE | WS_CAPTION | WS_BORDER | WS_CLIPSIBLINGS | WS_DLGFRAME | WS_SYSMENU | WS_GROUP | WS_MINIMIZEBOX);
+ SetWindowPos(hwnd, HWND_NOTOPMOST, 40, 40, width, height, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
}
///
@@ -435,10 +443,11 @@ namespace SekiroFpsUnlockAndMore
/// The handle to the window.
private void SetWindowBorderless(IntPtr hwnd)
{
+ var width = _clientRect.Right - _clientRect.Left;
+ var height = _clientRect.Bottom - _clientRect.Top;
+ Debug.WriteLine(string.Format("Client Resolution: {0}x{1}", width, height));
SetWindowLongPtr(hwnd, GWL_STYLE, WS_VISIBLE | WS_POPUP);
- RECT rect;
- GetWindowRect(hwnd, out rect);
- SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, rect.Right - rect.Left, rect.Bottom - rect.Top, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
+ SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, width, height, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
}
///
@@ -518,7 +527,7 @@ namespace SekiroFpsUnlockAndMore
Debug.WriteLine(timedMsg);
try
{
- using (StreamWriter writer = new StreamWriter(logPath, true))
+ using (StreamWriter writer = new StreamWriter(_logPath, true))
{
writer.WriteLine(timedMsg);
}
@@ -578,6 +587,9 @@ namespace SekiroFpsUnlockAndMore
[DllImport("user32.dll", SetLastError = true)]
public static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect);
+ [DllImport("user32.dll")]
+ public static extern bool GetClientRect(IntPtr hWnd, out RECT lpRect);
+
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
diff --git a/SekiroFpsUnlockAndMore/Properties/AssemblyInfo.cs b/SekiroFpsUnlockAndMore/Properties/AssemblyInfo.cs
index 6669805..8baa266 100644
--- a/SekiroFpsUnlockAndMore/Properties/AssemblyInfo.cs
+++ b/SekiroFpsUnlockAndMore/Properties/AssemblyInfo.cs
@@ -21,5 +21,5 @@ using System.Windows;
ResourceDictionaryLocation.SourceAssembly
)]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.1.0")]
+[assembly: AssemblyFileVersion("1.0.1.0")]