Skip to content

Commit

Permalink
Scale crosshair to 4:3
Browse files Browse the repository at this point in the history
so it's round in widescreen resolutions
  • Loading branch information
DanielGibson committed Dec 15, 2018
1 parent d204761 commit 5070b8c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions game/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down Expand Up @@ -2086,6 +2093,12 @@ void idPlayer::Restore( idRestoreGame *savefile ) {
savefile->ReadInt( focusTime );
savefile->ReadObject( reinterpret_cast<idClass *&>( 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 );
Expand Down

0 comments on commit 5070b8c

Please sign in to comment.