re3/src/core/SurfaceTable.h

101 lines
1.8 KiB
C
Raw Normal View History

2019-05-15 14:52:37 +00:00
#pragma once
enum eSurfaceType
{
2019-05-28 06:39:36 +00:00
SURFACE_DEFAULT,
SURFACE_TARMAC,
2019-05-15 14:52:37 +00:00
SURFACE_GRASS,
2020-05-26 09:34:20 +00:00
SURFACE_GRAVEL,
SURFACE_MUD_DRY,
2019-05-15 14:52:37 +00:00
SURFACE_PAVEMENT,
2020-05-26 09:34:20 +00:00
SURFACE_CAR,
2019-05-15 14:52:37 +00:00
SURFACE_GLASS,
2020-05-26 09:34:20 +00:00
SURFACE_TRANSPARENT_CLOTH,
SURFACE_GARAGE_DOOR,
SURFACE_CAR_PANEL,
SURFACE_THICK_METAL_PLATE,
SURFACE_SCAFFOLD_POLE,
SURFACE_LAMP_POST,
SURFACE_FIRE_HYDRANT,
SURFACE_GIRDER,
SURFACE_METAL_CHAIN_FENCE,
SURFACE_PED,
2019-05-28 06:39:36 +00:00
SURFACE_SAND,
2020-05-26 09:34:20 +00:00
SURFACE_WATER,
SURFACE_WOOD_CRATES,
SURFACE_WOOD_BENCH,
SURFACE_WOOD_SOLID,
SURFACE_RUBBER,
SURFACE_PLASTIC,
2019-05-15 14:52:37 +00:00
SURFACE_HEDGE,
2020-05-26 09:34:20 +00:00
SURFACE_STEEP_CLIFF,
SURFACE_CONTAINER,
SURFACE_NEWS_VENDOR,
SURFACE_WHEELBASE,
SURFACE_CARDBOARDBOX,
SURFACE_TRANSPARENT_STONE,
SURFACE_METAL_GATE,
SURFACE_SAND_BEACH,
SURFACE_CONCRETE_BEACH,
2019-05-15 14:52:37 +00:00
};
enum
{
ADHESIVE_RUBBER,
ADHESIVE_HARD,
ADHESIVE_ROAD,
ADHESIVE_LOOSE,
2020-05-22 12:27:16 +00:00
ADHESIVE_SAND,
2019-05-15 14:52:37 +00:00
ADHESIVE_WET,
NUMADHESIVEGROUPS
};
2019-05-18 10:39:39 +00:00
struct CColPoint;
2020-07-27 13:38:34 +00:00
inline bool
IsSeeThrough(uint8 surfType)
{
switch(surfType)
case SURFACE_GLASS:
case SURFACE_TRANSPARENT_CLOTH:
case SURFACE_METAL_CHAIN_FENCE:
case SURFACE_TRANSPARENT_STONE:
case SURFACE_SCAFFOLD_POLE:
return true;
return false;
}
// I think the necessity of this function is really a bug
inline bool
IsSeeThroughVertical(uint8 surfType)
{
switch(surfType)
case SURFACE_GLASS:
case SURFACE_TRANSPARENT_CLOTH:
return true;
return false;
}
inline bool
IsShootThrough(uint8 surfType)
{
switch(surfType)
case SURFACE_METAL_CHAIN_FENCE:
case SURFACE_TRANSPARENT_STONE:
case SURFACE_SCAFFOLD_POLE:
return true;
return false;
}
2019-05-15 14:52:37 +00:00
class CSurfaceTable
{
2020-04-17 05:54:14 +00:00
static float ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS];
2019-05-15 14:52:37 +00:00
public:
2020-05-11 23:24:57 +00:00
static void Initialise(Const char *filename);
2019-05-15 14:52:37 +00:00
static int GetAdhesionGroup(uint8 surfaceType);
2019-05-18 10:39:39 +00:00
static float GetWetMultiplier(uint8 surfaceType);
static float GetAdhesiveLimit(CColPoint &colpoint);
2020-08-19 19:58:00 +00:00
static bool IsSoftLanding(uint8 surf);
2019-05-15 14:52:37 +00:00
};