From 03aae2f5b74a18ed5fdbfe9c345a4d50203c7518 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sun, 28 Jul 2024 18:19:41 +0200 Subject: [PATCH] Scale crosshair to 4:3 in d3xp so it's round in widescreen resolutions --- d3xp/Player.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/d3xp/Player.cpp b/d3xp/Player.cpp index 6833ab5..db5906c 100644 --- a/d3xp/Player.cpp +++ b/d3xp/Player.cpp @@ -1865,6 +1865,13 @@ void idPlayer::Spawn( void ) { cursor = uiManager->FindGui( temp, true, gameLocal.isMultiplayer, gameLocal.isMultiplayer ); } if ( cursor ) { + // DG: make it scale to 4:3 so crosshair looks properly round + // yes, like so many scaling-related things this is a bit hacky + // and note that this is special cased in StateChanged and you + // can *not* generally set windowDef properties like this. + cursor->SetStateBool("scaleto43", true); + cursor->StateChanged(gameLocal.time); // DG end + cursor->Activate( true, gameLocal.time ); } @@ -2613,6 +2620,13 @@ void idPlayer::Restore( idRestoreGame *savefile ) { savefile->ReadObject( reinterpret_cast( focusVehicle ) ); savefile->ReadUserInterface( cursor ); + // DG: make it scale to 4:3 so crosshair looks properly round + // yes, like so many scaling-related things this is a bit hacky + // and note that this is special cased in StateChanged and you + // can *not* generally set windowDef properties like this. + cursor->SetStateBool("scaleto43", true); + cursor->StateChanged(gameLocal.time); // DG end + savefile->ReadInt( oldMouseX ); savefile->ReadInt( oldMouseY );