From 5070b8c7ec6f3a8ba1cb4123de37732f9cd9437f Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sat, 15 Dec 2018 17:08:13 +0100 Subject: [PATCH] Scale crosshair to 4:3 so it's round in widescreen resolutions --- game/Player.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/game/Player.cpp b/game/Player.cpp index 7b848e2e..f46f8b54 100644 --- a/game/Player.cpp +++ b/game/Player.cpp @@ -1508,6 +1508,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 ); } @@ -2086,6 +2093,12 @@ void idPlayer::Restore( idRestoreGame *savefile ) { savefile->ReadInt( focusTime ); 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 );