diff options
author | Fire_Head <Fire-Head@users.noreply.github.com> | 2020-08-27 19:35:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 19:35:14 +0200 |
commit | a8999bbf38cae233e39b5995118fa03bca7894ef (patch) | |
tree | ada9bd1935512f4b46fe6b4f42d9160eb2281262 /src/core/ZoneCull.cpp | |
parent | bike shooting fix + trace temp fix (diff) | |
parent | update librw (diff) | |
download | re3-a8999bbf38cae233e39b5995118fa03bca7894ef.tar re3-a8999bbf38cae233e39b5995118fa03bca7894ef.tar.gz re3-a8999bbf38cae233e39b5995118fa03bca7894ef.tar.bz2 re3-a8999bbf38cae233e39b5995118fa03bca7894ef.tar.lz re3-a8999bbf38cae233e39b5995118fa03bca7894ef.tar.xz re3-a8999bbf38cae233e39b5995118fa03bca7894ef.tar.zst re3-a8999bbf38cae233e39b5995118fa03bca7894ef.zip |
Diffstat (limited to 'src/core/ZoneCull.cpp')
-rw-r--r-- | src/core/ZoneCull.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/ZoneCull.cpp b/src/core/ZoneCull.cpp index 729cc35d..69c7a796 100644 --- a/src/core/ZoneCull.cpp +++ b/src/core/ZoneCull.cpp @@ -11,6 +11,8 @@ #include "ZoneCull.h" #include "Zones.h" +//--MIAMI: done + int32 CCullZones::NumAttributeZones; CAttributeZone CCullZones::aAttributeZones[NUMATTRIBZONES]; @@ -18,6 +20,7 @@ int32 CCullZones::CurrentWantedLevelDrop_Player; int32 CCullZones::CurrentFlags_Camera; int32 CCullZones::CurrentFlags_Player; bool CCullZones::bCurrentSubwayIsInvisible; +bool CCullZones::bAtBeachForAudio; void CCullZones::Init(void) @@ -37,6 +40,7 @@ CCullZones::Update(void) switch(CTimer::GetFrameCounter() & 7){ case 0: case 4: + UpdateAtBeachForAudio(); break; case 2: @@ -57,6 +61,27 @@ CCullZones::Update(void) } } +// TODO? put somewhere else? +bool +IsPointWithinArbitraryArea(float px, float py, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) +{ + if((px-x1)*(x2-x1) - (py-y1)*(y2-y1) < 0.0f) return false; + if((px-x2)*(x3-x2) - (py-y2)*(y3-y2) < 0.0f) return false; + if((px-x3)*(x4-x3) - (py-y3)*(y4-y3) < 0.0f) return false; + if((px-x4)*(x1-x4) - (py-y4)*(y1-y4) < 0.0f) return false; + return true; +} + +void +CCullZones::UpdateAtBeachForAudio(void) +{ + bAtBeachForAudio = IsPointWithinArbitraryArea(TheCamera.GetPosition().x, TheCamera.GetPosition().y, + 400.0f, -1644.4f, + 751.9f, 1267.8f, + 971.9f, 1216.2f, + 840.0f, -1744.0f); +} + void CCullZones::ForceCullZoneCoors(CVector coors) { |