From 71629a8d6ad19ba521c38c32f4be5c9c2d2b1fb9 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 0aabba2..0956384 100644 --- a/game/Player.cpp +++ b/game/Player.cpp @@ -1500,6 +1500,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 ); } @@ -2123,6 +2130,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 );