2018-08-19 09:46:58 +02:00
|
|
|
#pragma once
|
|
|
|
|
2020-05-27 09:21:20 +02:00
|
|
|
#include "global.h"
|
2018-08-19 09:46:58 +02:00
|
|
|
|
2020-05-27 09:21:20 +02:00
|
|
|
struct ObjectInfo
|
|
|
|
{
|
2020-04-27 15:28:54 +02:00
|
|
|
short nmeshes;
|
|
|
|
short meshIndex;
|
|
|
|
int boneIndex;
|
|
|
|
short* frameBase;
|
|
|
|
void(*initialise)(short itemNumber);
|
|
|
|
void(*control)(short itemNumber);
|
|
|
|
void(*floor)(ITEM_INFO* item, int x, int y, int z, int* height);
|
|
|
|
void(*ceiling)(ITEM_INFO* item, int x, int y, int z, int* height);
|
|
|
|
void(*drawRoutine)(ITEM_INFO* item);
|
|
|
|
void(*drawRoutineExtra)(ITEM_INFO* item);
|
|
|
|
void(*collision)(short item_num, ITEM_INFO* laraitem, COLL_INFO* coll);
|
|
|
|
short 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;
|
|
|
|
bool hitEffect;
|
|
|
|
bool undead;
|
|
|
|
bool saveMesh;
|
|
|
|
bool unknown;
|
|
|
|
bool friendly;
|
|
|
|
bool castShadows;
|
|
|
|
unsigned int explodableMeshbits;
|
|
|
|
int meshSwapSlot;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern ObjectInfo Objects[ID_NUMBER_OBJECTS];
|
2020-04-01 13:09:14 +02:00
|
|
|
extern STATIC_INFO StaticObjects[NUM_STATICS];
|
|
|
|
|
2019-12-04 13:20:21 +01:00
|
|
|
void BaddyObjects();
|
|
|
|
void ObjectObjects();
|
|
|
|
void TrapObjects();
|
|
|
|
void InitialiseHair();
|
|
|
|
void InitialiseSpecialEffects();
|
2020-01-16 19:14:35 +01:00
|
|
|
void InitialiseGameFlags();
|
2019-12-02 14:49:19 +01:00
|
|
|
void CustomObjects();
|
|
|
|
void InitialiseObjects();
|
2018-08-19 09:46:58 +02:00
|
|
|
|
2019-12-01 08:13:19 +01:00
|
|
|
#define INIT_PICKUP(obid) \
|
|
|
|
obj = &Objects[obid]; \
|
2019-11-11 16:17:45 +01:00
|
|
|
if (obj->loaded) \
|
|
|
|
{ \
|
|
|
|
obj->initialise = InitialisePickup; \
|
|
|
|
obj->collision = PickupCollision; \
|
|
|
|
obj->control = PickupControl; \
|
|
|
|
}
|
|
|
|
|
2019-12-01 08:13:19 +01:00
|
|
|
#define INIT_KEYHOLE(obid) \
|
|
|
|
obj = &Objects[obid]; \
|
2019-11-11 16:17:45 +01:00
|
|
|
if (obj->loaded) \
|
|
|
|
{ \
|
|
|
|
obj->collision = KeyHoleCollision; \
|
2020-01-12 08:02:48 +01:00
|
|
|
obj->saveFlags = true; \
|
2019-11-11 16:17:45 +01:00
|
|
|
}
|
|
|
|
|
2019-12-01 08:13:19 +01:00
|
|
|
#define INIT_PUZZLEHOLE(obid) \
|
|
|
|
obj = &Objects[obid]; \
|
2019-11-11 16:17:45 +01:00
|
|
|
if (obj->loaded) \
|
|
|
|
{ \
|
|
|
|
obj->collision = PuzzleHoleCollision; \
|
|
|
|
obj->control = AnimatingControl; \
|
2020-01-12 08:02:48 +01:00
|
|
|
obj->saveFlags = true; \
|
|
|
|
obj->saveAnim = true; \
|
2019-11-11 16:17:45 +01:00
|
|
|
}
|
|
|
|
|
2019-12-01 08:13:19 +01:00
|
|
|
#define INIT_PUZZLEDONE(obid) \
|
|
|
|
obj = &Objects[obid]; \
|
2019-11-11 16:17:45 +01:00
|
|
|
if (obj->loaded) \
|
|
|
|
{ \
|
|
|
|
obj->collision = PuzzleDoneCollision; \
|
|
|
|
obj->control = AnimatingControl; \
|
2020-01-12 08:02:48 +01:00
|
|
|
obj->saveFlags = true; \
|
|
|
|
obj->saveAnim = true; \
|
2019-11-11 16:17:45 +01:00
|
|
|
}
|
|
|
|
|
2019-12-01 08:13:19 +01:00
|
|
|
#define INIT_ANIMATING(obid) \
|
|
|
|
obj = &Objects[obid]; \
|
2019-11-11 16:17:45 +01:00
|
|
|
if (obj->loaded) \
|
|
|
|
{ \
|
|
|
|
obj->initialise = InitialiseAnimating; \
|
|
|
|
obj->control = AnimatingControl; \
|
|
|
|
obj->collision = ObjectCollision; \
|
2020-01-12 08:02:48 +01:00
|
|
|
obj->saveFlags = true; \
|
|
|
|
obj->saveAnim = true; \
|
|
|
|
obj->saveMesh = true; \
|
|
|
|
Bones[obj->boneIndex] |= ROT_Y; \
|
|
|
|
Bones[obj->boneIndex + 4] |= ROT_X; \
|
2019-11-11 16:17:45 +01:00
|
|
|
}
|