Skip to content

Commit

Permalink
lcs/vcs ps2: area dependent fov
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Oct 10, 2024
1 parent 4af9f6a commit 721d627
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion source/GTALCS.PCSX2F.WidescreenFix/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ uintptr_t GetAbsoluteAddress(uintptr_t at, int32_t offs_hi, int32_t offs_lo)

float AdjustFOV(float f, float ar, float t)
{
return ((2.0f * atanf(((ar) / (4.0f / 3.0f)) * t)) * (180.0f / (float)M_PI) * 100.0f) / 100.0f;
uint32_t CGame__currArea = *(uint32_t*)(0x3D8430);
return ((2.0f * atanf(((ar) / ((CGame__currArea == 0) ? (16.0f / 9.0f) : (4.0f / 3.0f))) * t)) * (180.0f / (float)M_PI) * 100.0f) / 100.0f;
}

const float fDefaultFOV = 70.0f;
Expand Down
3 changes: 2 additions & 1 deletion source/GTAVCS.PCSX2F.WidescreenFix/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ uintptr_t GetAbsoluteAddress(uintptr_t at, int32_t offs_hi, int32_t offs_lo)
float (*game_atan2f)(float a1, float a2);
float AdjustFOV(float f, float ar, float t)
{
return ((2.0f * game_atan2f(((ar) / (4.0f / 3.0f)) * t, 1.0f)) * (180.0f / (float)M_PI) * 100.0f) / 100.0f;
uint32_t CGame__currArea = *(uint32_t*)(0x489F7C);
return ((2.0f * game_atan2f(((ar) / ((CGame__currArea == 0) ? (16.0f / 9.0f) : (4.0f / 3.0f))) * t, 1.0f)) * (180.0f / (float)M_PI) * 100.0f) / 100.0f;
}

const float fDefaultFOV = 70.0f;
Expand Down

0 comments on commit 721d627

Please sign in to comment.