Preferred monitor: chosen in Optionen > Allgemein, used at the next start

The Internet-Optionen frame becomes Bildschirm with a Monitor dropdown
(Hauptmonitor or a connected monitor, kept by device path in
[display] Monitor=). The borderless window and the render size use that
monitor, falling back to the main monitor when it is not connected.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-25 16:06:20 +01:00
1 parent c7d54a6cfd
commit 9bc557cd95
10 files changed
+407 -14

No files matched your search

+4 -5
View File
@@ -3,7 +3,7 @@
// The game renders at a fixed resolution (1024x768). Unmodified, windowed mode
// shows that as a 1024x768 popup centred on the desktop; fullscreen mode
// switches the display mode. With this mod the game always runs windowed, the
// popup covers the whole monitor, and each frame is scaled up into the largest
// popup covers the whole monitor (mods/monitor.h: the preferred one), and each frame is scaled up into the largest
// centred rectangle with the game's aspect ratio (black bars elsewhere).
//
// Mouse positions are mapped back from that rectangle to game pixels, both in
@@ -35,6 +35,7 @@
#include "game/render/dx_driver7.h"
#include "mods/hud.h"
#include "mods/input.h"
#include "mods/monitor.h"
#include "mods/widescreen.h"
#include "re/config.h"
#include "game/addresses.h"
@@ -90,9 +91,7 @@ RECT FitRect(int areaWidth, int areaHeight, int width, int height, bool integerS
void ApplyBorderless(game::DxDriver7* driver) {
HWND window = driver->window;
MONITORINFO monitor = {sizeof(monitor)};
GetMonitorInfoW(MonitorFromWindow(window, MONITOR_DEFAULTTONEAREST), &monitor);
const RECT& area = monitor.rcMonitor;
const RECT area = mods::monitor::GameMonitorRect();
const int areaWidth = area.right - area.left;
const int areaHeight = area.bottom - area.top;
@@ -171,7 +170,7 @@ int __fastcall DxDriver7_SetDisplayMode(DxDriver7* self, void* edx, void* device
}
DxDisplayMode windowed = *mode;
windowed.fullscreen = 0;
mods::widescreen::ApplyRenderSize(windowed, self->window);
mods::widescreen::ApplyRenderSize(windowed);
g_viewport.active = false;
const int result = DxDriver7_SetDisplayMode_original(self, edx, deviceCaps, &windowed, unknown);
if (result) {