GetPlayerCameraAspectRatio inaccurate
#6

I've done some minor research, and I have found three possibilities for the return value:
  • 4:3 (1.3333334, Float:0x3FAAAAAB) - this is returned for the majority of players, when the "widescreen" option in the display settings is turned off, possibly incorrectly when they actually have a widescreen display.
  • 5:4 (1.2470589, Float:0x3F9F9FA0) - this value is returned when the letterbox mode is turned on, like via YSF's TogglePlayerWidescreen.
  • 16:9 (1.7764707, Float:0x3FE36364) - this value is returned in all cases when the "widescreen" option is turned on.
As you can see, it cannot be used to accurately detect the aspect ratio of the player's screen. However, it seems the value actually represents something close to the player's field of view, as shown by IDA:

Code:
v6 = (double)*(_BYTE *)(v4 + 30) * 0.0039215689 + 1.0;
Reversing the conversion, the actual values obtained from the player are 85, 63 and 198 respectively, for the above cases. It's not an actual field of view angle, but it does represent how large the player's field of view is.
Reply


Messages In This Thread
GetPlayerCameraAspectRatio inaccurate - by IllidanS4 - 30.12.2015, 12:32
Re: GetPlayerCameraAspectRatio inaccurate - by DRIFT_HUNTER - 04.01.2016, 00:03
Re: GetPlayerCameraAspectRatio inaccurate - by Crayder - 04.01.2016, 01:41
Re: GetPlayerCameraAspectRatio inaccurate - by RoboN1X - 04.01.2016, 04:04
Re: GetPlayerCameraAspectRatio inaccurate - by Crayder - 04.01.2016, 05:15
Re: GetPlayerCameraAspectRatio inaccurate - by IllidanS4 - 18.12.2016, 10:57

Forum Jump:


Users browsing this thread: 1 Guest(s)