TombEngine/TR5Main/Specific/setup.h

99 lines
2.1 KiB
C
Raw Normal View History

2020-12-21 13:16:29 -03:00
#pragma once
2021-08-28 13:27:58 +02:00
2020-12-21 13:16:29 -03:00
#include "objectslist.h"
2021-08-28 13:27:58 +02:00
#include "phd_global.h"
2021-09-15 10:12:42 +03:00
2021-08-28 13:27:58 +02:00
struct ITEM_INFO;
struct COLL_INFO;
2021-08-28 12:16:03 +02:00
enum ZoneType : char;
2021-09-15 10:12:42 +03:00
constexpr auto UNIT_SHADOW = 256;
constexpr auto NO_SHADOW = 0;
constexpr auto DEFAULT_RADIUS = 10;
constexpr auto ROT_X = 0x0004;
constexpr auto ROT_Y = 0x0008;
constexpr auto ROT_Z = 0x0010;
2020-12-21 13:16:29 -03:00
enum HitEffectEnum
{
HIT_NONE,
HIT_BLOOD,
HIT_SMOKE,
HIT_RICOCHET,
2020-12-21 13:16:29 -03:00
HIT_SPECIAL,
MAX_HIT_EFFECT
};
enum ShatterType
{
SHT_NONE,
SHT_FRAGMENT,
SHT_EXPLODE
};
2020-12-21 13:16:29 -03:00
struct OBJECT_INFO
{
short nmeshes;
short meshIndex;
int boneIndex;
int frameBase;
std::function<void(short itemNumber)> initialise;
std::function<void(short itemNumber)> control;
2021-01-06 17:53:13 -03:00
std::function<std::optional<int>(short itemNumber, int x, int y, int z)> floor;
std::function<std::optional<int>(short itemNumber, int x, int y, int z)> ceiling;
std::function<int(short itemNumber)> floorBorder;
std::function<int(short itemNumber)> ceilingBorder;
2020-12-21 13:16:29 -03:00
std::function<void(ITEM_INFO* item)> drawRoutine;
std::function<void(ITEM_INFO* item)> drawRoutineExtra;
std::function<void(short item_num, ITEM_INFO* laraitem, COLL_INFO* coll)> collision;
ZoneType zoneType;
short animIndex;
short hitPoints;
short pivotLength;
short radius;
short shadowSize;
short biteOffset;
bool loaded;
bool intelligent;
bool nonLot;
bool savePosition;
bool saveHitpoints;
bool saveFlags;
bool saveAnim;
bool semiTransparent;
bool waterCreature;
bool usingDrawAnimatingItem;
HitEffectEnum hitEffect;
bool undead;
bool saveMesh;
bool friendly;
bool castShadows;
bool isPickup;
bool isPuzzleHole;
int meshSwapSlot;
DWORD explodableMeshbits;
};
struct STATIC_INFO
{
int meshNumber;
int flags;
BOUNDING_BOX visibilityBox;
BOUNDING_BOX collisionBox;
int shatterType;
int shatterSound;
};
#define MAX_STATICS 1000
constexpr auto SF_NO_COLLISION = 0x01;
constexpr auto SF_SHATTERABLE = 0x02;
constexpr auto GRAVITY = 6;
2021-11-07 04:54:48 +03:00
constexpr auto SWAMP_GRAVITY = GRAVITY / 3;
2020-12-21 13:16:29 -03:00
extern OBJECT_INFO Objects[ID_NUMBER_OBJECTS];
extern STATIC_INFO StaticObjects[MAX_STATICS];
void InitialiseGameFlags();
void InitialiseSpecialEffects();
void InitialiseHair();
void InitialiseObjects();