UFO: Alien Invasion
|
#include <q_shared.h>
Public Member Functions | |
TerrainDefs () | |
~TerrainDefs () | |
bool | add (const TerrainDef *tdef) |
Translate color value to terrain type to random weather code. More... | |
const char * | getWeather (const byte *const color) |
Translate color value to terrain type to random weather code. More... | |
float | getSurvivalChance (const byte *const color) const |
Translate color value to terrain type and then to survival probability. More... | |
float | getRainChance (const byte *const color) const |
float | getSnowChance (const byte *const color) const |
const char * | getTerrainName (const byte *const color) const |
Translate color value to terrain type. More... | |
Private Member Functions | |
const TerrainDef * | findByColor (const byte *const color) const |
const TerrainDef * | findByColor (byte red, byte green, byte blue) const |
const TerrainDef * | findByName (const char *tname) const |
Private Attributes | |
const TerrainDef * | terrainDefTable [MAX_TERRAINDEFS] |
Definition at line 389 of file q_shared.h.
|
inline |
Definition at line 417 of file q_shared.h.
|
inline |
Definition at line 420 of file q_shared.h.
References i, and MAX_TERRAINDEFS.
bool TerrainDefs::add | ( | const TerrainDef * | tdef | ) |
Translate color value to terrain type to random weather code.
[in] | tdef | The terrain definition to add |
Definition at line 53 of file q_shared.cpp.
References findByColor(), findByName(), i, MAX_TERRAINDEFS, TerrainDef::rgbBlue, TerrainDef::rgbGreen, TerrainDef::rgbRed, terrainDefTable, and TerrainDef::terrainName.
Referenced by Com_ParseTerrainDefinition().
|
inlineprivate |
Definition at line 393 of file q_shared.h.
Referenced by add(), getRainChance(), getSnowChance(), getSurvivalChance(), and getTerrainName().
|
inlineprivate |
Definition at line 396 of file q_shared.h.
References i, MAX_TERRAINDEFS, TerrainDef::rgbBlue, TerrainDef::rgbGreen, and TerrainDef::rgbRed.
|
inlineprivate |
Definition at line 406 of file q_shared.h.
References i, MAX_TERRAINDEFS, Q_streq, and TerrainDef::terrainName.
Referenced by add().
|
inline |
Definition at line 439 of file q_shared.h.
References findByColor(), and TerrainDef::rainChance.
Referenced by getWeather().
|
inline |
Definition at line 443 of file q_shared.h.
References findByColor(), and TerrainDef::snowChance.
Referenced by getWeather().
|
inline |
Translate color value to terrain type and then to survival probability.
[in] | color | the color value from the terrain mask |
Definition at line 435 of file q_shared.h.
References findByColor(), and TerrainDef::survivalChance.
Referenced by AIR_PilotSurvivedCrash().
|
inline |
Translate color value to terrain type.
[in] | color | the color value from the terrain mask |
Definition at line 455 of file q_shared.h.
References findByColor(), and TerrainDef::terrainName.
Referenced by AIRFIGHT_ActionsAfterAirfight(), CP_CreateBattleParameters(), and GEO_GetTerrainTypeByPos().
const char * TerrainDefs::getWeather | ( | const byte *const | color | ) |
Translate color value to terrain type to random weather code.
[in] | color | The color value from the terrain mask |
Definition at line 78 of file q_shared.cpp.
References EQUAL_EPSILON, frand(), getRainChance(), and getSnowChance().
Referenced by CP_CreateBattleParameters().
|
private |
Definition at line 391 of file q_shared.h.
Referenced by add().