Remove dxwrapper; test scripts focus the game window

The default render size (1835x768) is below Direct3D 7's 2048 limit, so the
D3D7 -> D3D9 wrapper and its device-info workaround are no longer needed.
The game pauses start-up until its window is active; game-input.ps1 now
activates it reliably (Alt + SetForegroundWindow, polled), which dxwrapper
had masked. borderless logs the first failed presents.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-14 03:17:23 +02:00
1 parent df31c9c105
commit f73c4154ad
9 files changed
+38 -344

No files matched your search

+5 -6
View File
@@ -1,5 +1,5 @@
// Widescreen: render the world 1:1 at the monitor's resolution, showing more
// of it, instead of scaling a 1024x768 image.
// Widescreen: show more of the world horizontally on wide monitors while
// everything keeps its original on-screen size.
//
// The world view sizes itself from zoom * 1024.0 / 768.0 (float constants that
// the UI also reads) and projects 3D models with an ortho camera of
@@ -15,8 +15,8 @@
// ; 0 = monitor height, i.e. native 1:1 (everything smaller)
// Width=0 ; 0 = Height * monitor aspect ratio
//
// Windows' Direct3D 7 limits the render size to 2048x2048 unless the dxwrapper
// mod (Direct3D 9) is active; the borderless mod centres a smaller image 1:1.
// Windows' Direct3D 7 cannot render to targets larger than 2048x2048, so the
// render size is clamped to that (only reachable with Height=0 / large Width).
//
// Experimental: the UI is still drawn at the top-left 1024x768, and creatures
// are only active within the original distance.
@@ -32,7 +32,6 @@
#include "game/addresses.h"
#include "game/ui/ui_manager.h"
#include "mods/dxwrapper.h"
#include "re/config.h"
#include "re/hook.h"
#include "re/log.h"
@@ -246,7 +245,7 @@ void ApplyRenderSize(game::DxDisplayMode& mode, HWND window) {
// wider or taller than 2048 pixels (CreateDevice fails with
// DDERR_INVALIDOBJECT); anything larger needs a different renderer.
constexpr int kMaxD3D7Surface = 2048;
if (!mods::dxwrapper::IsActive() && (width > kMaxD3D7Surface || height > kMaxD3D7Surface)) {
if (width > kMaxD3D7Surface || height > kMaxD3D7Surface) {
re::Log("widescreen: %dx%d exceeds the Direct3D 7 limit, clamping to %d", width, height, kMaxD3D7Surface);
width = std::min(width, kMaxD3D7Surface);
height = std::min(height, kMaxD3D7Surface);