Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Nov 22, 2023

Conversation

mallgrab
Copy link
Contributor

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
Copy link
Owner

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
Copy link
Contributor Author

Yeah i just looked at it and it seems like 0xA4 is the wrong offset, modifying 0xA0 instead solved the issue.

*(float*)(regs.esi + 0xA4) = AdjustFOV(fov, Screen.fAspectRatio);

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.

@mallgrab mallgrab changed the title THPS4: Add the option to change the fov scale THPS4: Fix for field of view not being aspect corrected Nov 21, 2023
@ThirteenAG ThirteenAG merged commit b470b0b into ThirteenAG:master Nov 22, 2023
1 of 4 checks passed
@mallgrab mallgrab deleted the THPS4-FovScale branch November 26, 2023 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants