diff options
author | aap <aap@papnet.eu> | 2019-05-18 12:39:39 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-05-18 12:39:39 +0200 |
commit | 9e496100b7baff8834658f577d3138d9f8fc3765 (patch) | |
tree | a725be9b0dba9a4ce76c19a6629ef62c36e46814 /src/SurfaceTable.cpp | |
parent | fixed pathfind (diff) | |
download | re3-9e496100b7baff8834658f577d3138d9f8fc3765.tar re3-9e496100b7baff8834658f577d3138d9f8fc3765.tar.gz re3-9e496100b7baff8834658f577d3138d9f8fc3765.tar.bz2 re3-9e496100b7baff8834658f577d3138d9f8fc3765.tar.lz re3-9e496100b7baff8834658f577d3138d9f8fc3765.tar.xz re3-9e496100b7baff8834658f577d3138d9f8fc3765.tar.zst re3-9e496100b7baff8834658f577d3138d9f8fc3765.zip |
Diffstat (limited to '')
-rw-r--r-- | src/SurfaceTable.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/SurfaceTable.cpp b/src/SurfaceTable.cpp index e9ef459a..107734e4 100644 --- a/src/SurfaceTable.cpp +++ b/src/SurfaceTable.cpp @@ -1,7 +1,11 @@ #include "common.h" #include "patcher.h" +#include "Weather.h" +#include "Collision.h" #include "SurfaceTable.h" +float (*CSurfaceTable::ms_aAdhesiveLimitTable)[NUMADHESIVEGROUPS] = (float (*)[NUMADHESIVEGROUPS])0x8E29D4; + int CSurfaceTable::GetAdhesionGroup(uint8 surfaceType) { @@ -42,3 +46,52 @@ CSurfaceTable::GetAdhesionGroup(uint8 surfaceType) default: return ADHESIVE_ROAD; } } + +float +CSurfaceTable::GetWetMultiplier(uint8 surfaceType) +{ + switch(surfaceType){ + case SURFACE_0: + case SURFACE_1: + case SURFACE_4: + case SURFACE_5: + case SURFACE_8: + case SURFACE_20: + case SURFACE_21: + case SURFACE_22: + case SURFACE_25: + case SURFACE_30: + case SURFACE_31: + return 1.0f - CWeather::WetRoads*0.25f; + + case SURFACE_2: + case SURFACE_6: + case SURFACE_7: + case SURFACE_9: + case SURFACE_10: + case SURFACE_11: + case SURFACE_12: + case SURFACE_13: + case SURFACE_14: + case SURFACE_15: + case SURFACE_16: + case SURFACE_17: + case SURFACE_23: + case SURFACE_24: + case SURFACE_26: + case SURFACE_27: + case SURFACE_28: + case SURFACE_29: + case SURFACE_32: + return 1.0f - CWeather::WetRoads*0.4f; + + default: + return 1.0f; + } +} + +float +CSurfaceTable::GetAdhesiveLimit(CColPoint &colpoint) +{ + return ms_aAdhesiveLimitTable[GetAdhesionGroup(colpoint.surfaceB)][GetAdhesionGroup(colpoint.surfaceA)]; +} |