DS2Revival/mods/widescreen/widescreen.cpp
DS2Revival a1e2f8f9b5
Some checks failed
build / build (push) Failing after 1m35s
CI: build on the project's own runner at git.dsii.uk
2026-10-27 22:02:02 -04:00

26 lines
1.2 KiB
C++

// DS2Widescreen.asi - display for Dungeon Siege II (Steam v2.3) and Broken World: a borderless window at the desktop
// resolution (ultrawide included), menus scaled to fit, the interface scaled for big screens (HudScale), a failed device
// reset retried instead of ending the game (display.cpp, hud.cpp), the RTX Remix profile (remix.cpp), camera options
// (camera.cpp) and photo mode (photo.cpp). Picture quality (anti-aliasing, sharpening, filtering...) is DS2Graphics.asi;
// the Direct3D hooks both need are shared (mods/common/d3dhub.h). Delete the .asi to turn it off.
#include "../common/plugin.h"
namespace widescreen {
void InstallDisplay(const ds2::Ini& ini);
void InstallCamera(const ds2::Ini& ini);
namespace photo {
void Install(const ds2::Ini& ini);
}
}
BOOL WINAPI DllMain(HMODULE self, DWORD reason, LPVOID) {
if (reason != DLL_PROCESS_ATTACH) return TRUE;
DisableThreadLibraryCalls(self);
ds2::Plugin plugin;
if (!ds2::StartPlugin(self, "DS2Widescreen", plugin)) return TRUE;
ds2::SummaryAtExit summary;
widescreen::photo::Install(ds2::Ini(plugin.ini)); // first: display and camera hook what it needs
widescreen::InstallDisplay(ds2::Ini(plugin.ini));
widescreen::InstallCamera(ds2::Ini(plugin.ini));
return TRUE;
}