ThirteenAG / WidescreenFixesPack

Plugins to make or improve widescreen resolutions support in games, add more features and fix bugs.
https://thirteenag.github.io/wfp
MIT License
2.22k stars 211 forks source link

THPS4: Fix for field of view not being aspect corrected #1469

Closed mallgrab closed 7 months ago

mallgrab commented 8 months ago

Currently the field of view for the game seems fairly low at the default settings even when aspect corrected. This change allows for the user to change what the fov scaling is for the regular in game camera.

Example default settings: before

Fov scale set to 1.4: after

ThirteenAG commented 7 months ago

I'm pretty sure it worked at some point, and then didn't. Since there's an existing FovHook already, have you tried to find out why it doesn't produce hor+ fov?

mallgrab commented 7 months ago

Yeah i just looked at it and it seems like 0xA4 is the wrong offset, modifying 0xA0 instead solved the issue. https://github.com/ThirteenAG/WidescreenFixesPack/blob/fbe14e62d9762630e6372fad1551c8ebf07d405f/source/TonyHawksProSkater4.WidescreenFix/dllmain.cpp#L74 Unfortunately you can't simply change the offset to 0xA0 since on every function call the fov will gradually increase, since it uses the previous aspect corrected fov and feeds that into the AspectFOV function. My proposed change uses 0xA4 as a reference of the unmodified fov, which will get aspect corrected and then written to 0xA0.

I've also given the user the ability to be able to modify the fov from the ini file.