mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-30 08:47:58 +03:00
Merge branch 'master' into coll_info_reorganize
This commit is contained in:
commit
280c9fa28b
244 changed files with 1313 additions and 887 deletions
|
@ -1,16 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Specific\phd_global.h"
|
#include "Specific\phd_global.h"
|
||||||
#include "items.h"
|
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
|
struct ITEM_INFO;
|
||||||
enum MOOD_TYPE
|
struct BITE_INFO;
|
||||||
{
|
struct CREATURE_INFO;
|
||||||
BORED_MOOD,
|
struct LOT_INFO;
|
||||||
ATTACK_MOOD,
|
|
||||||
ESCAPE_MOOD,
|
|
||||||
STALK_MOOD
|
|
||||||
};
|
|
||||||
|
|
||||||
enum TARGET_TYPE
|
enum TARGET_TYPE
|
||||||
{
|
{
|
||||||
NO_TARGET,
|
NO_TARGET,
|
||||||
|
@ -18,25 +12,7 @@ enum TARGET_TYPE
|
||||||
SECONDARY_TARGET
|
SECONDARY_TARGET
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ZoneType
|
|
||||||
{
|
|
||||||
ZONE_NULL = -1, // default zone
|
|
||||||
ZONE_SKELLY = 0,
|
|
||||||
ZONE_BASIC,
|
|
||||||
ZONE_FLYER,
|
|
||||||
ZONE_HUMAN_CLASSIC,
|
|
||||||
ZONE_VON_CROY,
|
|
||||||
ZONE_WATER,
|
|
||||||
ZONE_MAX,
|
|
||||||
/// custom zone (using zone above for LOT.zone):
|
|
||||||
ZONE_HUMAN_JUMP_AND_MONKEY,
|
|
||||||
ZONE_HUMAN_JUMP,
|
|
||||||
ZONE_SPIDER,
|
|
||||||
ZONE_BLOCKABLE, // for trex, shiva, etc..
|
|
||||||
ZONE_SOPHIALEE, // dont want sophia to go down again !
|
|
||||||
ZONE_APE, // only 2 click climb
|
|
||||||
ZONE_HUMAN_LONGJUMP_AND_MONKEY,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct OBJECT_BONES
|
struct OBJECT_BONES
|
||||||
{
|
{
|
||||||
|
@ -86,13 +62,7 @@ struct OBJECT_BONES
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BOX_NODE
|
|
||||||
{
|
|
||||||
int exitBox;
|
|
||||||
int searchNumber;
|
|
||||||
int nextExpansion;
|
|
||||||
int boxNumber;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct AI_INFO
|
struct AI_INFO
|
||||||
{
|
{
|
||||||
|
@ -147,49 +117,7 @@ struct BITE_INFO
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LOT_INFO
|
|
||||||
{
|
|
||||||
std::vector<BOX_NODE> node;
|
|
||||||
int head;
|
|
||||||
int tail;
|
|
||||||
int searchNumber;
|
|
||||||
int blockMask;
|
|
||||||
short step;
|
|
||||||
short drop;
|
|
||||||
short zoneCount;
|
|
||||||
int targetBox;
|
|
||||||
int requiredBox;
|
|
||||||
short fly;
|
|
||||||
bool canJump;
|
|
||||||
bool canMonkey;
|
|
||||||
bool isAmphibious;
|
|
||||||
bool isJumping;
|
|
||||||
bool isMonkeying;
|
|
||||||
PHD_VECTOR target;
|
|
||||||
ZoneType zone;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct CREATURE_INFO
|
|
||||||
{
|
|
||||||
short jointRotation[4];
|
|
||||||
short maximumTurn;
|
|
||||||
short flags;
|
|
||||||
bool alerted;
|
|
||||||
bool headLeft;
|
|
||||||
bool headRight;
|
|
||||||
bool reachedGoal;
|
|
||||||
bool hurtByLara;
|
|
||||||
bool patrol2;
|
|
||||||
bool jumpAhead;
|
|
||||||
bool monkeyAhead;
|
|
||||||
MOOD_TYPE mood;
|
|
||||||
ITEM_INFO* enemy;
|
|
||||||
ITEM_INFO aiTarget;
|
|
||||||
short pad;
|
|
||||||
short itemNum;
|
|
||||||
PHD_VECTOR target;
|
|
||||||
LOT_INFO LOT;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct EntityStoringInfo
|
struct EntityStoringInfo
|
||||||
{
|
{
|
||||||
|
@ -231,7 +159,7 @@ struct EntityStoringInfo
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CreatureEffectFunction short(int x, int y, int z, short speed, short yRot, short roomNumber)
|
#define CreatureEffectFunction short(int x, int y, int z, short speed, short yRot, short roomNumber)
|
||||||
#define XZ_GET_SECTOR(room, x, z) (room->floor[(z) / SECTOR(1) + (x) / SECTOR(1) * room->xSize])
|
//#define XZ_GET_SECTOR(room, x, z) (room->floor[(z) / SECTOR(1) + (x) / SECTOR(1) * room->xSize])
|
||||||
|
|
||||||
constexpr auto UNIT_SHADOW = 256;
|
constexpr auto UNIT_SHADOW = 256;
|
||||||
constexpr auto NO_SHADOW = 0;
|
constexpr auto NO_SHADOW = 0;
|
||||||
|
@ -314,5 +242,6 @@ void CreatureAIInfo(ITEM_INFO* item, AI_INFO* info);
|
||||||
TARGET_TYPE CalculateTarget(PHD_VECTOR* target, ITEM_INFO* item, LOT_INFO* LOT);
|
TARGET_TYPE CalculateTarget(PHD_VECTOR* target, ITEM_INFO* item, LOT_INFO* LOT);
|
||||||
int CreatureAnimation(short itemNumber, short angle, short tilt);
|
int CreatureAnimation(short itemNumber, short angle, short tilt);
|
||||||
void AdjustStopperFlag(ITEM_INFO* item, int dir, int set);
|
void AdjustStopperFlag(ITEM_INFO* item, int dir, int set);
|
||||||
|
//(room->floor[ + * room->xSize])
|
||||||
|
FLOOR_INFO* XZ_GET_SECTOR(ROOM_INFO* r, int x, int z);
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
#include "rubberboat.h"
|
#include "rubberboat.h"
|
||||||
#include <Game\misc.h>
|
#include <Game\misc.h>
|
||||||
#include <control\volume.h>
|
#include <control\volume.h>
|
||||||
|
#include "Renderer11.h"
|
||||||
|
#include "camera.h"
|
||||||
|
|
||||||
#ifdef NEW_INV
|
#ifdef NEW_INV
|
||||||
#include "newinv2.h"
|
#include "newinv2.h"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "lara_struct.h"
|
#include "lara_struct.h"
|
||||||
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
#define FRONT_ARC ANGLE(90.0f)
|
#define FRONT_ARC ANGLE(90.0f)
|
||||||
#define LARA_LEAN_RATE ANGLE(1.5f)
|
#define LARA_LEAN_RATE ANGLE(1.5f)
|
||||||
#define LARA_LEAN_MAX ANGLE(11.0f)
|
#define LARA_LEAN_MAX ANGLE(11.0f)
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
#include "pickup\pickup.h"
|
#include "pickup\pickup.h"
|
||||||
|
#include "collide.h"
|
||||||
|
#include "item.h"
|
||||||
|
#include "camera.h"
|
||||||
|
|
||||||
bool DoJump = false;
|
bool DoJump = false;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "lara_struct.h"
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
/*generic functions*/
|
/*generic functions*/
|
||||||
void lara_void_func(ITEM_INFO* item, COLL_INFO* coll);
|
void lara_void_func(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
void lara_default_col(ITEM_INFO* item, COLL_INFO* coll);
|
void lara_default_col(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
#endif
|
#endif
|
||||||
#include "effects\effects.h"
|
#include "effects\effects.h"
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
|
#include "collide.h"
|
||||||
|
#include "item.h"
|
||||||
|
#include "setup.h"
|
||||||
|
#include "level.h"
|
||||||
|
|
||||||
extern GameFlow* g_GameFlow;
|
extern GameFlow* g_GameFlow;
|
||||||
int NoCheatCounter;
|
int NoCheatCounter;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
|
|
||||||
void lara_as_swimcheat(ITEM_INFO* item, COLL_INFO* coll);
|
void lara_as_swimcheat(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
void LaraCheatyBits();
|
void LaraCheatyBits();
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
#include "effects\effects.h"
|
#include "effects\effects.h"
|
||||||
|
#include "collide.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
|
|
||||||
/*this file has all the generic **collision** test functions called in lara's state code*/
|
/*this file has all the generic **collision** test functions called in lara's state code*/
|
||||||
|
|
||||||
int LaraDeflectEdge(ITEM_INFO* item, COLL_INFO* coll)
|
int LaraDeflectEdge(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "lara_struct.h"
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
int LaraDeflectEdge(ITEM_INFO* item, COLL_INFO* coll);
|
int LaraDeflectEdge(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
void LaraDeflectEdgeJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraDeflectEdgeJump(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
int LaraDeflectEdgeDuck(ITEM_INFO* item, COLL_INFO* coll);
|
int LaraDeflectEdgeDuck(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
#include <Game/Lara/lara_flare.h>
|
#include <Game/Lara/lara_flare.h>
|
||||||
|
#include "collide.h"
|
||||||
|
#include "item.h"
|
||||||
|
#include "camera.h"
|
||||||
|
#include "control.h"
|
||||||
/*this file has all the related functions to ducking and crawling*/
|
/*this file has all the related functions to ducking and crawling*/
|
||||||
|
|
||||||
/*crouch/duck start*/
|
/*crouch/duck start*/
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "savegame.h"
|
#include "savegame.h"
|
||||||
#include "GameFlowScript.h"
|
#include "GameFlowScript.h"
|
||||||
#include "lara_struct.h"
|
#include "lara_struct.h"
|
||||||
|
#include "creature_info.h"
|
||||||
WEAPON_INFO Weapons[NUM_WEAPONS] =
|
WEAPON_INFO Weapons[NUM_WEAPONS] =
|
||||||
{
|
{
|
||||||
/* No weapons */
|
/* No weapons */
|
||||||
|
@ -1006,11 +1006,11 @@ void LaraGetNewTarget(WEAPON_INFO* weapon)
|
||||||
maxDistance = weapon->targetDist;
|
maxDistance = weapon->targetDist;
|
||||||
targets = 0;
|
targets = 0;
|
||||||
|
|
||||||
for (slot = 0; slot < NUM_SLOTS; ++slot)
|
for (slot = 0; slot < ActiveCreatures.size(); ++slot)
|
||||||
{
|
{
|
||||||
if (BaddieSlots[slot].itemNum != NO_ITEM)
|
if (ActiveCreatures[slot]->itemNum != NO_ITEM)
|
||||||
{
|
{
|
||||||
item = &g_Level.Items[BaddieSlots[slot].itemNum];
|
item = &g_Level.Items[ActiveCreatures[slot]->itemNum];
|
||||||
if (item->hitPoints > 0)
|
if (item->hitPoints > 0)
|
||||||
{
|
{
|
||||||
x = item->pos.xPos - src.x;
|
x = item->pos.xPos - src.x;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
enum FireWeaponType
|
enum FireWeaponType
|
||||||
{
|
{
|
||||||
FW_MISS = -1,
|
FW_MISS = -1,
|
||||||
|
|
|
@ -63,7 +63,8 @@ void FlareControl(short itemNumber)
|
||||||
|
|
||||||
DoProjectileDynamics(itemNumber, oldX, oldY, oldZ, xv, item->fallspeed, zv);
|
DoProjectileDynamics(itemNumber, oldX, oldY, oldZ, xv, item->fallspeed, zv);
|
||||||
|
|
||||||
short age = (short)(item->data) & 0x7FFF;
|
short& age = item->data;
|
||||||
|
age &= 0x7FFF;
|
||||||
if (age >= FLARE_AGE)
|
if (age >= FLARE_AGE)
|
||||||
{
|
{
|
||||||
if (!item->fallspeed && !item->speed)
|
if (!item->fallspeed && !item->speed)
|
||||||
|
@ -84,8 +85,6 @@ void FlareControl(short itemNumber)
|
||||||
|
|
||||||
age |= 0x8000;
|
age |= 0x8000;
|
||||||
}
|
}
|
||||||
|
|
||||||
item->data = (void*)age;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ready_flare()
|
void ready_flare()
|
||||||
|
@ -362,10 +361,12 @@ void CreateFlare(GAME_OBJECT_ID objectNum, int thrown)
|
||||||
|
|
||||||
if (objectNum == ID_FLARE_ITEM)
|
if (objectNum == ID_FLARE_ITEM)
|
||||||
{
|
{
|
||||||
|
item->data = (short)0;
|
||||||
|
short& age = item->data;
|
||||||
if (DoFlareLight((PHD_VECTOR*)&item->pos, Lara.flareAge))
|
if (DoFlareLight((PHD_VECTOR*)&item->pos, Lara.flareAge))
|
||||||
item->data = (void*)(Lara.flareAge | 0x8000);
|
age = (Lara.flareAge | 0x8000);
|
||||||
else
|
else
|
||||||
item->data = (void*)(Lara.flareAge & 0x7FFF);
|
age = (Lara.flareAge & 0x7FFF);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "items.h"
|
|
||||||
|
|
||||||
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
|
struct PHD_VECTOR;
|
||||||
enum GAME_OBJECT_ID : short;
|
enum GAME_OBJECT_ID : short;
|
||||||
|
|
||||||
#define FLARE_AGE 30*30 //30 seconds * 30 frames
|
#define FLARE_AGE 30*30 //30 seconds * 30 frames
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "lara_tests.h"
|
#include "lara_tests.h"
|
||||||
|
#include "item.h"
|
||||||
|
#include "collide.h"
|
||||||
|
#include "camera.h"
|
||||||
|
#include "level.h"
|
||||||
/*this file has all the lara_as/lara_col functions related to hanging*/
|
/*this file has all the lara_as/lara_col functions related to hanging*/
|
||||||
|
|
||||||
/*normal hanging and shimmying*/
|
/*normal hanging and shimmying*/
|
||||||
|
|
1
TR5Main/Game/Lara/lara_info.h
Normal file
1
TR5Main/Game/Lara/lara_info.h
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#pragma once
|
|
@ -2,7 +2,10 @@
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "lara_initialise.h"
|
#include "lara_initialise.h"
|
||||||
#include "health.h"
|
#include "health.h"
|
||||||
|
#include "item.h"
|
||||||
|
#include "items.h"
|
||||||
|
#include "setup.h"
|
||||||
|
#include "level.h"
|
||||||
void InitialiseLara(int restore)
|
void InitialiseLara(int restore)
|
||||||
{
|
{
|
||||||
if (Lara.itemNumber == NO_ITEM)
|
if (Lara.itemNumber == NO_ITEM)
|
||||||
|
@ -10,7 +13,7 @@ void InitialiseLara(int restore)
|
||||||
|
|
||||||
short itemNumber = Lara.itemNumber;
|
short itemNumber = Lara.itemNumber;
|
||||||
|
|
||||||
LaraItem->data = &Lara;
|
//LaraItem->data = &Lara;
|
||||||
LaraItem->collidable = false;
|
LaraItem->collidable = false;
|
||||||
LaraItem->location.roomNumber = LaraItem->roomNumber;
|
LaraItem->location.roomNumber = LaraItem->roomNumber;
|
||||||
LaraItem->location.yNumber = LaraItem->pos.yPos;
|
LaraItem->location.yNumber = LaraItem->pos.yPos;
|
||||||
|
|
|
@ -5,7 +5,12 @@
|
||||||
#include "lara_collide.h"
|
#include "lara_collide.h"
|
||||||
#include "lara_tests.h"
|
#include "lara_tests.h"
|
||||||
#include "lara_monkey.h"
|
#include "lara_monkey.h"
|
||||||
|
#include "floordata.h"
|
||||||
|
#include "collide.h"
|
||||||
|
#include "item.h"
|
||||||
|
#include "camera.h"
|
||||||
|
#include "control.h"
|
||||||
|
#include "level.h"
|
||||||
using namespace TEN::Floordata;
|
using namespace TEN::Floordata;
|
||||||
|
|
||||||
/*this file has all the related functions to monkeyswinging*/
|
/*this file has all the related functions to monkeyswinging*/
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "lara_struct.h"
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
/*monkeyswing state handling functions*/
|
/*monkeyswing state handling functions*/
|
||||||
void lara_as_hang2(ITEM_INFO* item, COLL_INFO* coll);
|
void lara_as_hang2(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
void lara_col_hang2(ITEM_INFO* item, COLL_INFO* coll);
|
void lara_col_hang2(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
|
|
|
@ -7,8 +7,9 @@
|
||||||
#include "lara_tests.h"
|
#include "lara_tests.h"
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
#include "collide.h"
|
#include "collide.h"
|
||||||
|
#include "item.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
#include "Specific\prng.h"
|
|
||||||
/*This file has "all" lara_as/lara_col functions where Lara is interacting with an object.*/
|
/*This file has "all" lara_as/lara_col functions where Lara is interacting with an object.*/
|
||||||
|
|
||||||
/*pickups*/
|
/*pickups*/
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "items.h"
|
|
||||||
#include "Specific\trmath.h"
|
#include "Specific\trmath.h"
|
||||||
|
|
||||||
|
struct ITEM_INFO;
|
||||||
enum GRENADE_TYPE
|
enum GRENADE_TYPE
|
||||||
{
|
{
|
||||||
GRENADE_NORMAL,
|
GRENADE_NORMAL,
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
#include "lara_collide.h"
|
#include "lara_collide.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
|
#include "collide.h"
|
||||||
|
#include "camera.h"
|
||||||
|
#include "level.h"
|
||||||
|
|
||||||
short OldAngle = 1;
|
short OldAngle = 1;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "lara_struct.h"
|
|
||||||
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
|
|
||||||
/*Tests and others*/
|
/*Tests and others*/
|
||||||
int TestLaraSlide(ITEM_INFO* item, COLL_INFO* coll);
|
int TestLaraSlide(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "box.h"
|
|
||||||
#include "collide.h"
|
|
||||||
#include "effects\effects.h"
|
|
||||||
#include "objectslist.h"
|
#include "objectslist.h"
|
||||||
#include "Specific\trmath.h"
|
#include "Specific\trmath.h"
|
||||||
#include "Renderer11.h"
|
|
||||||
|
|
||||||
#define NUM_PUZZLES (ID_PUZZLE_ITEM16 - ID_PUZZLE_ITEM1 + 1)
|
#define NUM_PUZZLES (ID_PUZZLE_ITEM16 - ID_PUZZLE_ITEM1 + 1)
|
||||||
#define NUM_PUZZLE_PIECES (ID_PUZZLE_ITEM16_COMBO2 - ID_PUZZLE_ITEM1_COMBO1 + 1)
|
#define NUM_PUZZLE_PIECES (ID_PUZZLE_ITEM16_COMBO2 - ID_PUZZLE_ITEM1_COMBO1 + 1)
|
||||||
|
@ -15,6 +11,15 @@
|
||||||
#define NUM_EXAMINES (ID_EXAMINE8 - ID_EXAMINE1 + 1)
|
#define NUM_EXAMINES (ID_EXAMINE8 - ID_EXAMINE1 + 1)
|
||||||
#define NUM_EXAMINES_PIECES (ID_EXAMINE8_COMBO2 - ID_EXAMINE1_COMBO1 + 1)
|
#define NUM_EXAMINES_PIECES (ID_EXAMINE8_COMBO2 - ID_EXAMINE1_COMBO1 + 1)
|
||||||
|
|
||||||
|
struct CREATURE_INFO;
|
||||||
|
struct ITEM_INFO;
|
||||||
|
struct FX_INFO;
|
||||||
|
|
||||||
|
namespace TEN::Renderer {
|
||||||
|
struct RendererMesh;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#pragma region state_and_animation
|
#pragma region state_and_animation
|
||||||
enum LARA_STATE
|
enum LARA_STATE
|
||||||
{
|
{
|
||||||
|
@ -965,7 +970,7 @@ struct LARA_ARM
|
||||||
struct AnimsNew
|
struct AnimsNew
|
||||||
{
|
{
|
||||||
bool CrouchRoll; //crouch roll
|
bool CrouchRoll; //crouch roll
|
||||||
bool Monkey180Roll; //the 180° roll on monkeybars
|
bool Monkey180Roll; //the 180<EFBFBD> roll on monkeybars
|
||||||
bool Crawl1clickup; //going 1 click up in crawlspaces
|
bool Crawl1clickup; //going 1 click up in crawlspaces
|
||||||
bool Crawl1clickdown; //going 1 click down in crawlspaces
|
bool Crawl1clickdown; //going 1 click down in crawlspaces
|
||||||
bool CrawlExit1click; //crawlspace exit at 1 click
|
bool CrawlExit1click; //crawlspace exit at 1 click
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#include "Lara.h"
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
void _cdecl lara_col_surftread(ITEM_INFO* item, COLL_INFO* coll);
|
void _cdecl lara_col_surftread(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
void _cdecl lara_col_surfright(ITEM_INFO* item, COLL_INFO* coll);
|
void _cdecl lara_col_surfright(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
void _cdecl lara_col_surfleft(ITEM_INFO* item, COLL_INFO* coll);
|
void _cdecl lara_col_surfleft(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
|
|
|
@ -160,7 +160,7 @@ int GetWaterDepth(int x, int y, int z, short roomNumber)
|
||||||
floor = GetFloor(x, y, z, &roomNumber);
|
floor = GetFloor(x, y, z, &roomNumber);
|
||||||
return (GetFloorHeight(floor, x, y, z) - wh);
|
return (GetFloorHeight(floor, x, y, z) - wh);
|
||||||
}
|
}
|
||||||
floor = &XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
floor = XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
||||||
}
|
}
|
||||||
return 0x7FFF;
|
return 0x7FFF;
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ int GetWaterDepth(int x, int y, int z, short roomNumber)
|
||||||
floor = GetFloor(x, y, z, &roomNumber);
|
floor = GetFloor(x, y, z, &roomNumber);
|
||||||
return (GetFloorHeight(floor, x, y, z) - wh);
|
return (GetFloorHeight(floor, x, y, z) - wh);
|
||||||
}
|
}
|
||||||
floor = &XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
floor = XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
||||||
}
|
}
|
||||||
return NO_HEIGHT;
|
return NO_HEIGHT;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
#include "lara_climb.h"
|
#include "lara_climb.h"
|
||||||
#include "lara_collide.h"
|
#include "lara_collide.h"
|
||||||
|
#include "control.h"
|
||||||
|
|
||||||
using namespace TEN::Floordata;
|
using namespace TEN::Floordata;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "lara_struct.h"
|
#include "collide.h"
|
||||||
|
|
||||||
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
int TestLaraVault(ITEM_INFO* item, COLL_INFO* coll);
|
int TestLaraVault(ITEM_INFO* item, COLL_INFO* coll);
|
||||||
bool TestLaraStandUp(COLL_INFO* coll);
|
bool TestLaraStandUp(COLL_INFO* coll);
|
||||||
int TestWall(ITEM_INFO* item, int front, int right, int down);
|
int TestWall(ITEM_INFO* item, int front, int right, int down);
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "Specific\trmath.h"
|
#include "Specific\trmath.h"
|
||||||
#include "objectslist.h"
|
#include "objectslist.h"
|
||||||
|
#include "creature_info.h"
|
||||||
#define CHECK_CLICK(x) CLICK(x) / 2
|
#define CHECK_CLICK(x) CLICK(x) / 2
|
||||||
#define ESCAPE_DIST SECTOR(5)
|
#define ESCAPE_DIST SECTOR(5)
|
||||||
#define STALK_DIST SECTOR(3)
|
#define STALK_DIST SECTOR(3)
|
||||||
|
@ -22,7 +22,15 @@
|
||||||
#define BIFF_AVOID_TURN 1536
|
#define BIFF_AVOID_TURN 1536
|
||||||
#define FEELER_DISTANCE 512
|
#define FEELER_DISTANCE 512
|
||||||
#define FEELER_ANGLE ANGLE(45.0f)
|
#define FEELER_ANGLE ANGLE(45.0f)
|
||||||
|
#ifdef CREATURE_AI_PRIORITY_OPTIMIZATION
|
||||||
|
|
||||||
|
constexpr int HIGH_PRIO_RANGE = 8;
|
||||||
|
constexpr int MEDIUM_PRIO_RANGE = HIGH_PRIO_RANGE + HIGH_PRIO_RANGE * (HIGH_PRIO_RANGE / 6.0f);
|
||||||
|
constexpr int LOW_PRIO_RANGE = MEDIUM_PRIO_RANGE + MEDIUM_PRIO_RANGE * (MEDIUM_PRIO_RANGE / 24.0f);
|
||||||
|
constexpr int NONE_PRIO_RANGE = LOW_PRIO_RANGE + LOW_PRIO_RANGE * (LOW_PRIO_RANGE / 32.0f);
|
||||||
|
constexpr auto FRAME_PRIO_BASE = 4;
|
||||||
|
constexpr auto FRAME_PRIO_EXP = 1.5;
|
||||||
|
#endif // CREATURE_AI_PRIORITY_OPTIMIZATION
|
||||||
void DropBaddyPickups(ITEM_INFO* item)
|
void DropBaddyPickups(ITEM_INFO* item)
|
||||||
{
|
{
|
||||||
ITEM_INFO* pickup = NULL;
|
ITEM_INFO* pickup = NULL;
|
||||||
|
@ -109,13 +117,13 @@ bool SameZone(CREATURE_INFO* creature, ITEM_INFO* target)
|
||||||
int* zone = g_Level.Zones[creature->LOT.zone][FlipStatus].data();
|
int* zone = g_Level.Zones[creature->LOT.zone][FlipStatus].data();
|
||||||
ITEM_INFO* item = &g_Level.Items[creature->itemNum];
|
ITEM_INFO* item = &g_Level.Items[creature->itemNum];
|
||||||
ROOM_INFO* room = &g_Level.Rooms[item->roomNumber];
|
ROOM_INFO* room = &g_Level.Rooms[item->roomNumber];
|
||||||
FLOOR_INFO* floor = &XZ_GET_SECTOR(room, item->pos.xPos - room->x, item->pos.zPos - room->z);
|
FLOOR_INFO* floor = XZ_GET_SECTOR(room, item->pos.xPos - room->x, item->pos.zPos - room->z);
|
||||||
if (floor->box == NO_BOX)
|
if (floor->box == NO_BOX)
|
||||||
return false;
|
return false;
|
||||||
item->boxNumber = floor->box;
|
item->boxNumber = floor->box;
|
||||||
|
|
||||||
room = &g_Level.Rooms[target->roomNumber];
|
room = &g_Level.Rooms[target->roomNumber];
|
||||||
floor = &XZ_GET_SECTOR(room, target->pos.xPos - room->x, target->pos.zPos - room->z);
|
floor = XZ_GET_SECTOR(room, target->pos.xPos - room->x, target->pos.zPos - room->z);
|
||||||
if (floor->box == NO_BOX)
|
if (floor->box == NO_BOX)
|
||||||
return false;
|
return false;
|
||||||
target->boxNumber = floor->box;
|
target->boxNumber = floor->box;
|
||||||
|
@ -166,9 +174,9 @@ void AlertNearbyGuards(ITEM_INFO* item)
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
int distance;
|
int distance;
|
||||||
|
|
||||||
for (int i = 0; i < NUM_SLOTS; i++)
|
for (int i = 0; i < ActiveCreatures.size(); i++)
|
||||||
{
|
{
|
||||||
creature = &BaddieSlots[i];
|
creature = ActiveCreatures[i];
|
||||||
if (creature->itemNum == NO_ITEM)
|
if (creature->itemNum == NO_ITEM)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -195,9 +203,9 @@ void AlertAllGuards(short itemNumber)
|
||||||
CREATURE_INFO* creature;
|
CREATURE_INFO* creature;
|
||||||
short objNumber;
|
short objNumber;
|
||||||
|
|
||||||
for (int i = 0; i < NUM_SLOTS; i++)
|
for (int i = 0; i < ActiveCreatures.size(); i++)
|
||||||
{
|
{
|
||||||
creature = &BaddieSlots[i];
|
creature = ActiveCreatures[i];
|
||||||
if (creature->itemNum == NO_ITEM)
|
if (creature->itemNum == NO_ITEM)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -364,7 +372,7 @@ void CreatureFloat(short itemNumber)
|
||||||
|
|
||||||
void CreatureJoint(ITEM_INFO* item, short joint, short required)
|
void CreatureJoint(ITEM_INFO* item, short joint, short required)
|
||||||
{
|
{
|
||||||
if (item->data == NULL)
|
if (!item->data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CREATURE_INFO* creature = (CREATURE_INFO*)item->data;
|
CREATURE_INFO* creature = (CREATURE_INFO*)item->data;
|
||||||
|
@ -403,7 +411,7 @@ void CreatureTilt(ITEM_INFO* item, short angle)
|
||||||
|
|
||||||
short CreatureTurn(ITEM_INFO* item, short maximumTurn)
|
short CreatureTurn(ITEM_INFO* item, short maximumTurn)
|
||||||
{
|
{
|
||||||
if (item->data == NULL || maximumTurn == 0)
|
if (!item->data || maximumTurn == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
CREATURE_INFO* creature;
|
CREATURE_INFO* creature;
|
||||||
|
@ -446,7 +454,7 @@ int CreatureAnimation(short itemNumber, short angle, short tilt)
|
||||||
int boxHeight, height, nextHeight, nextBox;
|
int boxHeight, height, nextHeight, nextBox;
|
||||||
|
|
||||||
item = &g_Level.Items[itemNumber];
|
item = &g_Level.Items[itemNumber];
|
||||||
if (item->data == NULL)
|
if (!item->data)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
creature = (CREATURE_INFO*)item->data;
|
creature = (CREATURE_INFO*)item->data;
|
||||||
|
@ -1074,6 +1082,22 @@ int SearchLOT(LOT_INFO* LOT, int depth)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if CREATURE_AI_PRIORITY_OPTIMIZATION
|
||||||
|
CREATURE_AI_PRIORITY GetCreatureLOTPriority(ITEM_INFO* item) {
|
||||||
|
Vector3 itemPos = Vector3(item->pos.xPos, item->pos.yPos, item->pos.zPos);
|
||||||
|
Vector3 cameraPos = Vector3(Camera.pos.x, Camera.pos.y, Camera.pos.z);
|
||||||
|
float distance = Vector3::Distance(itemPos, cameraPos);
|
||||||
|
distance /= SECTOR(1);
|
||||||
|
if(distance <= HIGH_PRIO_RANGE)
|
||||||
|
return CREATURE_AI_PRIORITY::HIGH;
|
||||||
|
if(distance <= MEDIUM_PRIO_RANGE)
|
||||||
|
return CREATURE_AI_PRIORITY::MEDIUM;
|
||||||
|
if(distance <= LOW_PRIO_RANGE)
|
||||||
|
return CREATURE_AI_PRIORITY::LOW;
|
||||||
|
return CREATURE_AI_PRIORITY::NONE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
int CreatureActive(short itemNumber)
|
int CreatureActive(short itemNumber)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
||||||
|
@ -1091,6 +1115,10 @@ int CreatureActive(short itemNumber)
|
||||||
}
|
}
|
||||||
item->status = ITEM_ACTIVE;
|
item->status = ITEM_ACTIVE;
|
||||||
}
|
}
|
||||||
|
#ifdef CREATURE_AI_PRIORITY_OPTIMIZATION
|
||||||
|
CREATURE_INFO* creature = (CREATURE_INFO*)item->data;
|
||||||
|
creature->priority = GetCreatureLOTPriority(item);
|
||||||
|
#endif // CREATURE_AI_PRIORITY_OPTIMIZATION
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1395,10 +1423,10 @@ void FindAITargetObject(CREATURE_INFO* creature, short objectNumber)
|
||||||
int* zone = g_Level.Zones[creature->LOT.zone][FlipStatus].data();
|
int* zone = g_Level.Zones[creature->LOT.zone][FlipStatus].data();
|
||||||
|
|
||||||
ROOM_INFO* r = &g_Level.Rooms[item->roomNumber];
|
ROOM_INFO* r = &g_Level.Rooms[item->roomNumber];
|
||||||
item->boxNumber = XZ_GET_SECTOR(r, item->pos.xPos - r->x, item->pos.zPos - r->z).box;
|
item->boxNumber = XZ_GET_SECTOR(r, item->pos.xPos - r->x, item->pos.zPos - r->z)->box;
|
||||||
|
|
||||||
r = &g_Level.Rooms[aiObject->roomNumber];
|
r = &g_Level.Rooms[aiObject->roomNumber];
|
||||||
aiObject->boxNumber = XZ_GET_SECTOR(r, aiObject->x - r->x, aiObject->z - r->z).box;
|
aiObject->boxNumber = XZ_GET_SECTOR(r, aiObject->x - r->x, aiObject->z - r->z)->box;
|
||||||
|
|
||||||
if (item->boxNumber == NO_BOX || aiObject->boxNumber == NO_BOX)
|
if (item->boxNumber == NO_BOX || aiObject->boxNumber == NO_BOX)
|
||||||
{
|
{
|
||||||
|
@ -1415,9 +1443,9 @@ void FindAITargetObject(CREATURE_INFO* creature, short objectNumber)
|
||||||
|
|
||||||
if (foundObject != NULL)
|
if (foundObject != NULL)
|
||||||
{
|
{
|
||||||
ITEM_INFO* aiItem = &creature->aiTarget;
|
CREATURE_TARGET* aiItem = &creature->aiTarget;
|
||||||
|
|
||||||
creature->enemy = aiItem;
|
creature->enemy = nullptr;
|
||||||
|
|
||||||
aiItem->objectNumber = foundObject->objectNumber;
|
aiItem->objectNumber = foundObject->objectNumber;
|
||||||
aiItem->roomNumber = foundObject->roomNumber;
|
aiItem->roomNumber = foundObject->roomNumber;
|
||||||
|
@ -1440,7 +1468,7 @@ void FindAITargetObject(CREATURE_INFO* creature, short objectNumber)
|
||||||
|
|
||||||
void CreatureAIInfo(ITEM_INFO* item, AI_INFO* info)
|
void CreatureAIInfo(ITEM_INFO* item, AI_INFO* info)
|
||||||
{
|
{
|
||||||
if (item->data == NULL)
|
if (!item->data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CREATURE_INFO * creature;
|
CREATURE_INFO * creature;
|
||||||
|
@ -1464,14 +1492,20 @@ void CreatureAIInfo(ITEM_INFO* item, AI_INFO* info)
|
||||||
zone = g_Level.Zones[creature->LOT.zone][FlipStatus].data();
|
zone = g_Level.Zones[creature->LOT.zone][FlipStatus].data();
|
||||||
|
|
||||||
r = &g_Level.Rooms[item->roomNumber];
|
r = &g_Level.Rooms[item->roomNumber];
|
||||||
item->boxNumber = XZ_GET_SECTOR(r, item->pos.xPos - r->x, item->pos.zPos - r->z).box;
|
item->boxNumber = NO_BOX;
|
||||||
|
FLOOR_INFO* floor = XZ_GET_SECTOR(r, item->pos.xPos - r->x, item->pos.zPos - r->z);
|
||||||
|
if(floor)
|
||||||
|
item->boxNumber = floor->box;
|
||||||
if (item->boxNumber != NO_BOX)
|
if (item->boxNumber != NO_BOX)
|
||||||
info->zoneNumber = zone[item->boxNumber];
|
info->zoneNumber = zone[item->boxNumber];
|
||||||
else
|
else
|
||||||
info->zoneNumber = NO_ZONE;
|
info->zoneNumber = NO_ZONE;
|
||||||
|
|
||||||
r = &g_Level.Rooms[enemy->roomNumber];
|
r = &g_Level.Rooms[enemy->roomNumber];
|
||||||
enemy->boxNumber = XZ_GET_SECTOR(r, enemy->pos.xPos - r->x, enemy->pos.zPos - r->z).box;
|
enemy->boxNumber = NO_BOX;
|
||||||
|
floor = XZ_GET_SECTOR(r, enemy->pos.xPos - r->x, enemy->pos.zPos - r->z);
|
||||||
|
if(floor)
|
||||||
|
enemy->boxNumber = floor->box;
|
||||||
if (enemy->boxNumber != NO_BOX)
|
if (enemy->boxNumber != NO_BOX)
|
||||||
info->enemyZone = zone[enemy->boxNumber];
|
info->enemyZone = zone[enemy->boxNumber];
|
||||||
else
|
else
|
||||||
|
@ -1543,7 +1577,7 @@ void CreatureAIInfo(ITEM_INFO* item, AI_INFO* info)
|
||||||
|
|
||||||
void CreatureMood(ITEM_INFO* item, AI_INFO* info, int violent)
|
void CreatureMood(ITEM_INFO* item, AI_INFO* info, int violent)
|
||||||
{
|
{
|
||||||
if (item->data == NULL)
|
if (!item->data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CREATURE_INFO* creature;
|
CREATURE_INFO* creature;
|
||||||
|
@ -1627,8 +1661,37 @@ void CreatureMood(ITEM_INFO* item, AI_INFO* info, int violent)
|
||||||
|
|
||||||
if (LOT->targetBox == NO_BOX)
|
if (LOT->targetBox == NO_BOX)
|
||||||
TargetBox(LOT, item->boxNumber);
|
TargetBox(LOT, item->boxNumber);
|
||||||
|
#ifdef CREATURE_AI_PRIORITY_OPTIMIZATION
|
||||||
|
|
||||||
|
bool shouldUpdateTarget = false;
|
||||||
|
switch(creature->priority) {
|
||||||
|
case CREATURE_AI_PRIORITY::HIGH:
|
||||||
|
shouldUpdateTarget = true;
|
||||||
|
break;
|
||||||
|
case CREATURE_AI_PRIORITY::MEDIUM:
|
||||||
|
{
|
||||||
|
if(creature->framesSinceLOTUpdate > std::pow(FRAME_PRIO_BASE, FRAME_PRIO_EXP))
|
||||||
|
shouldUpdateTarget = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CREATURE_AI_PRIORITY::LOW:
|
||||||
|
{
|
||||||
|
if(creature->framesSinceLOTUpdate > std::pow(FRAME_PRIO_BASE,FRAME_PRIO_EXP*2))
|
||||||
|
shouldUpdateTarget = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(shouldUpdateTarget) {
|
||||||
CalculateTarget(&creature->target, item, &creature->LOT);
|
CalculateTarget(&creature->target, item, &creature->LOT);
|
||||||
|
creature->framesSinceLOTUpdate = 0;
|
||||||
|
} else {
|
||||||
|
creature->framesSinceLOTUpdate++;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
CalculateTarget(&creature->target, item, &creature->LOT);
|
||||||
|
#endif // CREATURE_AI_PRIORITY_OPTIMIZATION
|
||||||
|
|
||||||
creature->jumpAhead = false;
|
creature->jumpAhead = false;
|
||||||
creature->monkeyAhead = false;
|
creature->monkeyAhead = false;
|
||||||
|
@ -1663,7 +1726,7 @@ void CreatureMood(ITEM_INFO* item, AI_INFO* info, int violent)
|
||||||
|
|
||||||
void GetCreatureMood(ITEM_INFO* item, AI_INFO* info, int isViolent)
|
void GetCreatureMood(ITEM_INFO* item, AI_INFO* info, int isViolent)
|
||||||
{
|
{
|
||||||
if (item->data == NULL)
|
if (!item->data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CREATURE_INFO* creature;
|
CREATURE_INFO* creature;
|
||||||
|
@ -2009,7 +2072,7 @@ void AdjustStopperFlag(ITEM_INFO* item, int dir, int set)
|
||||||
|
|
||||||
ROOM_INFO* r = &g_Level.Rooms[item->roomNumber];
|
ROOM_INFO* r = &g_Level.Rooms[item->roomNumber];
|
||||||
|
|
||||||
FLOOR_INFO* floor = &XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
FLOOR_INFO* floor = XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
||||||
floor->stopper = set;
|
floor->stopper = set;
|
||||||
|
|
||||||
x = item->pos.xPos + 1024 * phd_sin(dir);
|
x = item->pos.xPos + 1024 * phd_sin(dir);
|
||||||
|
@ -2019,6 +2082,16 @@ void AdjustStopperFlag(ITEM_INFO* item, int dir, int set)
|
||||||
GetFloor(x, item->pos.yPos, z, &roomNumber);
|
GetFloor(x, item->pos.yPos, z, &roomNumber);
|
||||||
r = &g_Level.Rooms[roomNumber];
|
r = &g_Level.Rooms[roomNumber];
|
||||||
|
|
||||||
floor = &XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
floor = XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
||||||
floor->stopper = set;
|
floor->stopper = set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FLOOR_INFO* XZ_GET_SECTOR(ROOM_INFO* r, int x, int z) {
|
||||||
|
int sectorX = (x) / SECTOR(1);
|
||||||
|
int sectorZ = (z) / SECTOR(1);
|
||||||
|
int index = sectorZ + sectorX * r->xSize;
|
||||||
|
if(index > r->floor.size()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
return &r->floor[index];
|
||||||
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "Specific\trmath.h"
|
#include "Specific\trmath.h"
|
||||||
#include "Specific\prng.h"
|
#include "Specific\prng.h"
|
||||||
#include "room.h"
|
#include "room.h"
|
||||||
|
#include "Renderer11.h""
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using namespace TEN::Math::Random;
|
using namespace TEN::Math::Random;
|
||||||
|
@ -1251,7 +1252,7 @@ COLL_RESULT GetCollisionResult(FLOOR_INFO* floor, int x, int y, int z)
|
||||||
if (CheckNoColFloorTriangle(floor, x, z) == 1)
|
if (CheckNoColFloorTriangle(floor, x, z) == 1)
|
||||||
break;
|
break;
|
||||||
r = &g_Level.Rooms[floor->pitRoom];
|
r = &g_Level.Rooms[floor->pitRoom];
|
||||||
floor = &XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
floor = XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return probed bottom block into result.
|
// Return probed bottom block into result.
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Specific\phd_global.h"
|
#include "Specific\phd_global.h"
|
||||||
#include "level.h"
|
#include "trmath.h"
|
||||||
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
|
struct FLOOR_INFO;
|
||||||
|
struct MESH_INFO;
|
||||||
|
|
||||||
// used by coll->Setup.BadHeightUp
|
// used by coll->Setup.BadHeightUp
|
||||||
#define NO_BAD_POS (-NO_HEIGHT)
|
#define NO_BAD_POS (-NO_HEIGHT)
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
#include <Game/Lara/lara_one_gun.h>
|
#include <Game/Lara/lara_one_gun.h>
|
||||||
#include <Game/Lara/lara_climb.h>
|
#include <Game/Lara/lara_climb.h>
|
||||||
#include "generic_switch.h"
|
#include "generic_switch.h"
|
||||||
|
#include "creature_info.h"
|
||||||
using namespace TEN::Entities::Switches;
|
using namespace TEN::Entities::Switches;
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
@ -562,9 +562,6 @@ unsigned CALLBACK GameMain(void *)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
printf("GameMain\n");
|
printf("GameMain\n");
|
||||||
|
|
||||||
// Initialise legacy memory buffer and game timer
|
|
||||||
init_game_malloc();
|
|
||||||
TIME_Init();
|
TIME_Init();
|
||||||
if (g_GameFlow->IntroImagePath.empty())
|
if (g_GameFlow->IntroImagePath.empty())
|
||||||
{
|
{
|
||||||
|
@ -906,7 +903,7 @@ void TranslateItem(ITEM_INFO *item, int x, int y, int z)
|
||||||
int GetWaterSurface(int x, int y, int z, short roomNumber)
|
int GetWaterSurface(int x, int y, int z, short roomNumber)
|
||||||
{
|
{
|
||||||
ROOM_INFO *room = &g_Level.Rooms[roomNumber];
|
ROOM_INFO *room = &g_Level.Rooms[roomNumber];
|
||||||
FLOOR_INFO *floor = &XZ_GET_SECTOR(room, x - room->x, z - room->z);
|
FLOOR_INFO *floor = XZ_GET_SECTOR(room, x - room->x, z - room->z);
|
||||||
|
|
||||||
if (room->flags & ENV_FLAG_WATER)
|
if (room->flags & ENV_FLAG_WATER)
|
||||||
{
|
{
|
||||||
|
@ -915,7 +912,7 @@ int GetWaterSurface(int x, int y, int z, short roomNumber)
|
||||||
room = &g_Level.Rooms[floor->skyRoom];
|
room = &g_Level.Rooms[floor->skyRoom];
|
||||||
if (!(room->flags & ENV_FLAG_WATER))
|
if (!(room->flags & ENV_FLAG_WATER))
|
||||||
return (floor->ceiling << 8);
|
return (floor->ceiling << 8);
|
||||||
floor = &XZ_GET_SECTOR(room, x - room->x, z - room->z);
|
floor = XZ_GET_SECTOR(room, x - room->x, z - room->z);
|
||||||
}
|
}
|
||||||
return NO_HEIGHT;
|
return NO_HEIGHT;
|
||||||
}
|
}
|
||||||
|
@ -926,7 +923,7 @@ int GetWaterSurface(int x, int y, int z, short roomNumber)
|
||||||
room = &g_Level.Rooms[floor->pitRoom];
|
room = &g_Level.Rooms[floor->pitRoom];
|
||||||
if (room->flags & ENV_FLAG_WATER)
|
if (room->flags & ENV_FLAG_WATER)
|
||||||
return (floor->floor << 8);
|
return (floor->floor << 8);
|
||||||
floor = &XZ_GET_SECTOR(room, x - room->x, z - room->z);
|
floor = XZ_GET_SECTOR(room, x - room->x, z - room->z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2406,9 +2403,9 @@ void DoFlipMap(short group)
|
||||||
FlipStats[group] = status;
|
FlipStats[group] = status;
|
||||||
FlipStatus = status;
|
FlipStatus = status;
|
||||||
|
|
||||||
for (int i = 0; i < NUM_SLOTS; i++)
|
for (int i = 0; i < ActiveCreatures.size(); i++)
|
||||||
{
|
{
|
||||||
BaddieSlots[i].LOT.targetBox = NO_BOX;
|
ActiveCreatures[i]->LOT.targetBox = NO_BOX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2613,7 +2610,7 @@ int GetWaterHeight(int x, int y, int z, short roomNumber)
|
||||||
r = &g_Level.Rooms[floor->skyRoom];
|
r = &g_Level.Rooms[floor->skyRoom];
|
||||||
if (!(r->flags & (ENV_FLAG_WATER | ENV_FLAG_SWAMP)))
|
if (!(r->flags & (ENV_FLAG_WATER | ENV_FLAG_SWAMP)))
|
||||||
return r->minfloor;
|
return r->minfloor;
|
||||||
floor = &XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
floor = XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
||||||
if (floor->skyRoom == NO_ROOM)
|
if (floor->skyRoom == NO_ROOM)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2629,7 +2626,7 @@ int GetWaterHeight(int x, int y, int z, short roomNumber)
|
||||||
r = &g_Level.Rooms[floor->pitRoom];
|
r = &g_Level.Rooms[floor->pitRoom];
|
||||||
if (r->flags & (ENV_FLAG_WATER | ENV_FLAG_SWAMP))
|
if (r->flags & (ENV_FLAG_WATER | ENV_FLAG_SWAMP))
|
||||||
return r->maxceiling;
|
return r->maxceiling;
|
||||||
floor = &XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
floor = XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
||||||
if (floor->pitRoom == NO_ROOM)
|
if (floor->pitRoom == NO_ROOM)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,12 @@
|
||||||
#include "control\trigger.h"
|
#include "control\trigger.h"
|
||||||
|
|
||||||
struct BOUNDING_BOX;
|
struct BOUNDING_BOX;
|
||||||
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
|
class FLOOR_INFO;
|
||||||
|
struct ANIM_STRUCT;
|
||||||
|
struct MESH_INFO;
|
||||||
|
struct ROOM_INFO;
|
||||||
enum GAME_STATUS
|
enum GAME_STATUS
|
||||||
{
|
{
|
||||||
GAME_STATUS_NONE,
|
GAME_STATUS_NONE,
|
||||||
|
|
|
@ -163,7 +163,7 @@ short* GetTriggerIndex(FLOOR_INFO* floor, int x, int y, int z)
|
||||||
if (CheckNoColFloorTriangle(floor, x, z) == 1)
|
if (CheckNoColFloorTriangle(floor, x, z) == 1)
|
||||||
break;
|
break;
|
||||||
r = &g_Level.Rooms[floor->pitRoom];
|
r = &g_Level.Rooms[floor->pitRoom];
|
||||||
floor = &XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
floor = XZ_GET_SECTOR(r, x - r->x, z - r->z);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((floor->floor * 256) == NO_HEIGHT || floor->index == 0)
|
if ((floor->floor * 256) == NO_HEIGHT || floor->index == 0)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "items.h"
|
struct ITEM_INFO;
|
||||||
#include "control.h"
|
struct FLOOR_INFO;
|
||||||
|
|
||||||
int GetKeyTrigger(ITEM_INFO* item);
|
int GetKeyTrigger(ITEM_INFO* item);
|
||||||
int GetSwitchTrigger(ITEM_INFO* item, short* itemNos, int AttatchedToSwitch);
|
int GetSwitchTrigger(ITEM_INFO* item, short* itemNos, int AttatchedToSwitch);
|
||||||
|
|
98
TR5Main/Game/creature_info.h
Normal file
98
TR5Main/Game/creature_info.h
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
#pragma once
|
||||||
|
#include "phd_global.h"
|
||||||
|
#include <vector>
|
||||||
|
struct BOX_NODE {
|
||||||
|
int exitBox;
|
||||||
|
int searchNumber;
|
||||||
|
int nextExpansion;
|
||||||
|
int boxNumber;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ZoneType : char {
|
||||||
|
ZONE_NULL = -1, // default zone
|
||||||
|
ZONE_SKELLY = 0,
|
||||||
|
ZONE_BASIC,
|
||||||
|
ZONE_FLYER,
|
||||||
|
ZONE_HUMAN_CLASSIC,
|
||||||
|
ZONE_VON_CROY,
|
||||||
|
ZONE_WATER,
|
||||||
|
ZONE_MAX,
|
||||||
|
/// custom zone (using zone above for LOT.zone):
|
||||||
|
ZONE_HUMAN_JUMP_AND_MONKEY,
|
||||||
|
ZONE_HUMAN_JUMP,
|
||||||
|
ZONE_SPIDER,
|
||||||
|
ZONE_BLOCKABLE, // for trex, shiva, etc..
|
||||||
|
ZONE_SOPHIALEE, // dont want sophia to go down again !
|
||||||
|
ZONE_APE, // only 2 click climb
|
||||||
|
ZONE_HUMAN_LONGJUMP_AND_MONKEY,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct LOT_INFO {
|
||||||
|
std::vector<BOX_NODE> node;
|
||||||
|
int head;
|
||||||
|
int tail;
|
||||||
|
int searchNumber;
|
||||||
|
int blockMask;
|
||||||
|
short step;
|
||||||
|
short drop;
|
||||||
|
short zoneCount;
|
||||||
|
int targetBox;
|
||||||
|
int requiredBox;
|
||||||
|
short fly;
|
||||||
|
bool canJump;
|
||||||
|
bool canMonkey;
|
||||||
|
bool isAmphibious;
|
||||||
|
bool isJumping;
|
||||||
|
bool isMonkeying;
|
||||||
|
PHD_VECTOR target;
|
||||||
|
ZoneType zone;
|
||||||
|
bool initialised;
|
||||||
|
};
|
||||||
|
enum MOOD_TYPE {
|
||||||
|
BORED_MOOD,
|
||||||
|
ATTACK_MOOD,
|
||||||
|
ESCAPE_MOOD,
|
||||||
|
STALK_MOOD
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CREATURE_TARGET {
|
||||||
|
GAME_OBJECT_ID objectNumber;
|
||||||
|
int boxNumber;
|
||||||
|
PHD_3DPOS pos;
|
||||||
|
uint16_t flags; // ItemFlags enum
|
||||||
|
uint16_t triggerFlags;
|
||||||
|
short roomNumber;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class CREATURE_AI_PRIORITY {
|
||||||
|
HIGH,
|
||||||
|
MEDIUM,
|
||||||
|
LOW,
|
||||||
|
NONE
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CREATURE_INFO {
|
||||||
|
short jointRotation[4];
|
||||||
|
short maximumTurn;
|
||||||
|
short flags;
|
||||||
|
bool alerted;
|
||||||
|
bool headLeft;
|
||||||
|
bool headRight;
|
||||||
|
bool reachedGoal;
|
||||||
|
bool hurtByLara;
|
||||||
|
bool patrol2;
|
||||||
|
bool jumpAhead;
|
||||||
|
bool monkeyAhead;
|
||||||
|
MOOD_TYPE mood;
|
||||||
|
ITEM_INFO* enemy;
|
||||||
|
CREATURE_TARGET aiTarget;
|
||||||
|
short pad;
|
||||||
|
short itemNum;
|
||||||
|
PHD_VECTOR target;
|
||||||
|
LOT_INFO LOT;
|
||||||
|
#ifdef CREATURE_AI_PRIORITY_OPTIMIZATION
|
||||||
|
CREATURE_AI_PRIORITY priority;
|
||||||
|
size_t framesSinceLOTUpdate;
|
||||||
|
#endif
|
||||||
|
};
|
|
@ -21,7 +21,8 @@
|
||||||
#include "generic_switch.h"
|
#include "generic_switch.h"
|
||||||
#include "pickup\pickup.h"
|
#include "pickup\pickup.h"
|
||||||
#include "fullblock_switch.h"
|
#include "fullblock_switch.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
#include "door_data.h"
|
||||||
using namespace TEN::Entities::Switches;
|
using namespace TEN::Entities::Switches;
|
||||||
|
|
||||||
PHD_VECTOR DoubleDoorPos(0, 0, 220);
|
PHD_VECTOR DoubleDoorPos(0, 0, 220);
|
||||||
|
@ -583,7 +584,7 @@ void OpenThatDoor(DOORPOS_DATA* doorPos, DOOR_DATA* dd)
|
||||||
|
|
||||||
if (floor != NULL)
|
if (floor != NULL)
|
||||||
{
|
{
|
||||||
memcpy(doorPos->floor, &doorPos->data, sizeof(FLOOR_INFO));
|
*doorPos->floor = doorPos->data;
|
||||||
|
|
||||||
short boxIndex = doorPos->block;
|
short boxIndex = doorPos->block;
|
||||||
if (boxIndex != NO_BOX)
|
if (boxIndex != NO_BOX)
|
||||||
|
@ -591,9 +592,9 @@ void OpenThatDoor(DOORPOS_DATA* doorPos, DOOR_DATA* dd)
|
||||||
if (!DontUnlockBox)
|
if (!DontUnlockBox)
|
||||||
g_Level.Boxes[boxIndex].flags &= ~BLOCKED;
|
g_Level.Boxes[boxIndex].flags &= ~BLOCKED;
|
||||||
|
|
||||||
for (int i = 0; i < NUM_SLOTS; i++)
|
for (int i = 0; i < ActiveCreatures.size(); i++)
|
||||||
{
|
{
|
||||||
BaddieSlots[i].LOT.targetBox = NO_BOX;
|
ActiveCreatures[i]->LOT.targetBox = NO_BOX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -681,9 +682,9 @@ void ShutThatDoor(DOORPOS_DATA* doorPos, DOOR_DATA* dd)
|
||||||
if (boxIndex != NO_BOX)
|
if (boxIndex != NO_BOX)
|
||||||
{
|
{
|
||||||
g_Level.Boxes[boxIndex].flags |= BLOCKED;
|
g_Level.Boxes[boxIndex].flags |= BLOCKED;
|
||||||
for (int i = 0; i < NUM_SLOTS; i++)
|
for (int i = 0; i < ActiveCreatures.size(); i++)
|
||||||
{
|
{
|
||||||
BaddieSlots[i].LOT.targetBox = NO_BOX;
|
ActiveCreatures[i]->LOT.targetBox = NO_BOX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -723,15 +724,14 @@ void InitialiseDoor(short itemNumber)
|
||||||
|
|
||||||
if (item->objectNumber == ID_LIFT_DOORS1 || item->objectNumber == ID_LIFT_DOORS2)
|
if (item->objectNumber == ID_LIFT_DOORS1 || item->objectNumber == ID_LIFT_DOORS2)
|
||||||
item->itemFlags[0] = 4096;
|
item->itemFlags[0] = 4096;
|
||||||
|
item->data = DOOR_DATA();
|
||||||
|
DOOR_DATA* door = item->data;
|
||||||
|
|
||||||
DOOR_DATA * door = game_malloc<DOOR_DATA>();
|
|
||||||
|
|
||||||
item->data = door;
|
|
||||||
door->opened = false;
|
door->opened = false;
|
||||||
door->dptr1 = NULL;
|
door->dptr1 = nullptr;
|
||||||
door->dptr2 = NULL;
|
door->dptr2 = nullptr;
|
||||||
door->dptr3 = NULL;
|
door->dptr3 = nullptr;
|
||||||
door->dptr4 = NULL;
|
door->dptr4 = nullptr;
|
||||||
|
|
||||||
int dz, dx;
|
int dz, dx;
|
||||||
ROOM_INFO* r;
|
ROOM_INFO* r;
|
||||||
|
@ -761,8 +761,7 @@ void InitialiseDoor(short itemNumber)
|
||||||
boxNumber = b->floor[(item->pos.zPos - b->z) / SECTOR(1) + dz + ((item->pos.xPos - b->x) / SECTOR(1) + dx) * b->xSize].box;
|
boxNumber = b->floor[(item->pos.zPos - b->z) / SECTOR(1) + dz + ((item->pos.xPos - b->x) / SECTOR(1) + dx) * b->xSize].box;
|
||||||
}
|
}
|
||||||
door->d1.block = (boxNumber != NO_BOX && g_Level.Boxes[boxNumber].flags & BLOCKABLE) ? boxNumber : NO_BOX;
|
door->d1.block = (boxNumber != NO_BOX && g_Level.Boxes[boxNumber].flags & BLOCKABLE) ? boxNumber : NO_BOX;
|
||||||
|
door->d1.data = *door->d1.floor;
|
||||||
memcpy(&door->d1.data, door->d1.floor, sizeof(FLOOR_INFO));
|
|
||||||
|
|
||||||
if (r->flippedRoom != -1)
|
if (r->flippedRoom != -1)
|
||||||
{
|
{
|
||||||
|
@ -779,7 +778,7 @@ void InitialiseDoor(short itemNumber)
|
||||||
}
|
}
|
||||||
door->d1flip.block = (boxNumber != NO_BOX && g_Level.Boxes[boxNumber].flags & BLOCKABLE) ? boxNumber : NO_BOX;
|
door->d1flip.block = (boxNumber != NO_BOX && g_Level.Boxes[boxNumber].flags & BLOCKABLE) ? boxNumber : NO_BOX;
|
||||||
|
|
||||||
memcpy(&door->d1flip.data, door->d1flip.floor, sizeof(FLOOR_INFO));
|
door->d1flip.data = *door->d1flip.floor;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
door->d1flip.floor = NULL;
|
door->d1flip.floor = NULL;
|
||||||
|
@ -809,7 +808,7 @@ void InitialiseDoor(short itemNumber)
|
||||||
}
|
}
|
||||||
door->d2.block = (boxNumber != NO_BOX && g_Level.Boxes[boxNumber].flags & BLOCKABLE) ? boxNumber : NO_BOX;
|
door->d2.block = (boxNumber != NO_BOX && g_Level.Boxes[boxNumber].flags & BLOCKABLE) ? boxNumber : NO_BOX;
|
||||||
|
|
||||||
memcpy(&door->d2.data, door->d2.floor, sizeof(FLOOR_INFO));
|
door->d2.data = *door->d2.floor;
|
||||||
|
|
||||||
if (r->flippedRoom != -1)
|
if (r->flippedRoom != -1)
|
||||||
{
|
{
|
||||||
|
@ -826,7 +825,7 @@ void InitialiseDoor(short itemNumber)
|
||||||
}
|
}
|
||||||
door->d2flip.block = (boxNumber != NO_BOX && g_Level.Boxes[boxNumber].flags & BLOCKABLE) ? boxNumber : NO_BOX;
|
door->d2flip.block = (boxNumber != NO_BOX && g_Level.Boxes[boxNumber].flags & BLOCKABLE) ? boxNumber : NO_BOX;
|
||||||
|
|
||||||
memcpy(&door->d2flip.data, door->d2flip.floor, sizeof(FLOOR_INFO));
|
door->d2flip.data = *door->d2flip.floor;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
door->d2flip.floor = NULL;
|
door->d2flip.floor = NULL;
|
||||||
|
|
|
@ -1,32 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "items.h"
|
struct COLL_INFO;
|
||||||
#include "collide.h"
|
struct ITEM_INFO;
|
||||||
#include "room.h"
|
struct ROOM_INFO;
|
||||||
|
struct DOORPOS_DATA;
|
||||||
|
struct DOOR_DATA;
|
||||||
|
|
||||||
struct DOORPOS_DATA
|
|
||||||
{
|
|
||||||
FLOOR_INFO* floor;
|
|
||||||
FLOOR_INFO data;
|
|
||||||
short block;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct DOOR_DATA
|
|
||||||
{
|
|
||||||
DOORPOS_DATA d1;
|
|
||||||
DOORPOS_DATA d1flip;
|
|
||||||
DOORPOS_DATA d2;
|
|
||||||
DOORPOS_DATA d2flip;
|
|
||||||
short opened;
|
|
||||||
short* dptr1;
|
|
||||||
short* dptr2;
|
|
||||||
short* dptr3;
|
|
||||||
short* dptr4;
|
|
||||||
byte dn1;
|
|
||||||
byte dn2;
|
|
||||||
byte dn3;
|
|
||||||
byte dn4;
|
|
||||||
ITEM_INFO* item;
|
|
||||||
};
|
|
||||||
|
|
||||||
void SequenceDoorControl(short itemNumber);
|
void SequenceDoorControl(short itemNumber);
|
||||||
void UnderwaterDoorCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll);
|
void UnderwaterDoorCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll);
|
||||||
|
|
25
TR5Main/Game/door_data.h
Normal file
25
TR5Main/Game/door_data.h
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#pragma once
|
||||||
|
#include "floordata.h"
|
||||||
|
struct ITEM_INFO;
|
||||||
|
struct DOORPOS_DATA {
|
||||||
|
FLOOR_INFO* floor;
|
||||||
|
FLOOR_INFO data;
|
||||||
|
short block;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct DOOR_DATA {
|
||||||
|
DOORPOS_DATA d1;
|
||||||
|
DOORPOS_DATA d1flip;
|
||||||
|
DOORPOS_DATA d2;
|
||||||
|
DOORPOS_DATA d2flip;
|
||||||
|
short opened;
|
||||||
|
short* dptr1;
|
||||||
|
short* dptr2;
|
||||||
|
short* dptr3;
|
||||||
|
short* dptr4;
|
||||||
|
unsigned char dn1;
|
||||||
|
unsigned char dn2;
|
||||||
|
unsigned char dn3;
|
||||||
|
unsigned char dn4;
|
||||||
|
ITEM_INFO* item;
|
||||||
|
};
|
|
@ -1,5 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "box.h"
|
#include "Box.h"
|
||||||
|
struct PHD_3DPOS;
|
||||||
|
struct PHD_VECTOR;
|
||||||
|
struct ANIM_FRAME;
|
||||||
|
struct ITEM_INFO;
|
||||||
|
|
||||||
extern BITE_INFO EnemyBites[9];
|
extern BITE_INFO EnemyBites[9];
|
||||||
extern int LightningCount;
|
extern int LightningCount;
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <Game\effects\bubble.h>
|
#include <Game\effects\bubble.h>
|
||||||
#include "smoke.h"
|
#include "smoke.h"
|
||||||
#include "Specific\prng.h"
|
#include "Specific\prng.h"
|
||||||
|
#include "Renderer11.h"
|
||||||
|
|
||||||
using TEN::Renderer::g_Renderer;
|
using TEN::Renderer::g_Renderer;
|
||||||
using TEN::Effects::Explosion::TriggerExplosion;
|
using TEN::Effects::Explosion::TriggerExplosion;
|
||||||
|
@ -23,7 +24,7 @@ using namespace TEN::Effects::Spark;
|
||||||
using namespace TEN::Math::Random;
|
using namespace TEN::Math::Random;
|
||||||
|
|
||||||
short FXType;
|
short FXType;
|
||||||
FX_INFO* EffectList;
|
FX_INFO EffectList[NUM_EFFECTS];
|
||||||
|
|
||||||
int NextSpark;
|
int NextSpark;
|
||||||
int DeadlyBounds[6];
|
int DeadlyBounds[6];
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Specific\phd_global.h"
|
#include "Specific\phd_global.h"
|
||||||
#include "items.h"
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
|
|
||||||
enum RIPPLE_TYPE
|
enum RIPPLE_TYPE
|
||||||
{
|
{
|
||||||
|
@ -180,7 +181,7 @@ constexpr auto SD_UWEXPLOSION = 2;
|
||||||
#define MAX_RIPPLES 256
|
#define MAX_RIPPLES 256
|
||||||
#define MAX_SPLASHES 8
|
#define MAX_SPLASHES 8
|
||||||
#define MAX_SPARKS_DYNAMICS 8
|
#define MAX_SPARKS_DYNAMICS 8
|
||||||
|
#define NUM_EFFECTS 256
|
||||||
extern int NextSpark;
|
extern int NextSpark;
|
||||||
extern int DeadlyBounds[6];
|
extern int DeadlyBounds[6];
|
||||||
extern SPLASH_SETUP SplashSetup;
|
extern SPLASH_SETUP SplashSetup;
|
||||||
|
@ -195,7 +196,7 @@ extern int SplashCount;
|
||||||
extern PHD_VECTOR NodeVectors[MAX_NODE];
|
extern PHD_VECTOR NodeVectors[MAX_NODE];
|
||||||
extern NODEOFFSET_INFO NodeOffsets[MAX_NODE];
|
extern NODEOFFSET_INFO NodeOffsets[MAX_NODE];
|
||||||
|
|
||||||
extern FX_INFO* EffectList;
|
extern FX_INFO EffectList[NUM_EFFECTS];
|
||||||
|
|
||||||
void DetatchSpark(int num, SpriteEnumFlag type);
|
void DetatchSpark(int num, SpriteEnumFlag type);
|
||||||
int GetFreeSpark();
|
int GetFreeSpark();
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "sphere.h"
|
#include "sphere.h"
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
|
#include "Renderer11.h"
|
||||||
using TEN::Renderer::g_Renderer;
|
using TEN::Renderer::g_Renderer;
|
||||||
int FirstHair[HAIR_MAX];
|
int FirstHair[HAIR_MAX];
|
||||||
HAIR_STRUCT Hairs[HAIR_MAX][HAIR_SEGMENTS + 1];
|
HAIR_STRUCT Hairs[HAIR_MAX][HAIR_SEGMENTS + 1];
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Specific\phd_global.h"
|
#include "Specific\phd_global.h"
|
||||||
#include "items.h"
|
|
||||||
#include "lara_struct.h"
|
#include "lara_struct.h"
|
||||||
|
struct ITEM_INFO;
|
||||||
|
|
||||||
struct ENERGY_ARC
|
struct ENERGY_ARC
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "framework.h"
|
#include "framework.h"
|
||||||
#include "Specific\trmath.h"
|
|
||||||
#include "floordata.h"
|
#include "floordata.h"
|
||||||
|
#include "Specific\trmath.h"
|
||||||
#include "room.h"
|
#include "room.h"
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Specific\trmath.h"
|
#include "Specific\trmath.h"
|
||||||
#include "items.h"
|
#include <optional>
|
||||||
|
#include "roomvector.h"
|
||||||
|
|
||||||
struct SECTOR_COLLISION_INFO
|
struct SECTOR_COLLISION_INFO
|
||||||
{
|
{
|
||||||
|
@ -25,7 +26,7 @@ struct SECTOR_FLAGS
|
||||||
|
|
||||||
class FLOOR_INFO
|
class FLOOR_INFO
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int index;
|
int index;
|
||||||
int box;
|
int box;
|
||||||
int fx;
|
int fx;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
|
#include "Renderer11.h"
|
||||||
using namespace TEN::Renderer;
|
using namespace TEN::Renderer;
|
||||||
short PickupX;
|
short PickupX;
|
||||||
short PickupY;
|
short PickupY;
|
||||||
|
|
57
TR5Main/Game/item.h
Normal file
57
TR5Main/Game/item.h
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
#pragma once
|
||||||
|
#include <cstdint>
|
||||||
|
#include "phd_global.h"
|
||||||
|
#include <string>
|
||||||
|
#include "itemdata.h"
|
||||||
|
#include "roomvector.h"
|
||||||
|
enum GAME_OBJECT_ID : short;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
struct ITEM_INFO {
|
||||||
|
int floor;
|
||||||
|
uint32_t touchBits;
|
||||||
|
uint32_t meshBits;
|
||||||
|
GAME_OBJECT_ID objectNumber;
|
||||||
|
short currentAnimState;
|
||||||
|
short goalAnimState;
|
||||||
|
short requiredAnimState;
|
||||||
|
short animNumber;
|
||||||
|
short frameNumber;
|
||||||
|
short roomNumber;
|
||||||
|
ROOM_VECTOR location;
|
||||||
|
short nextItem;
|
||||||
|
short nextActive;
|
||||||
|
short speed;
|
||||||
|
short fallspeed;
|
||||||
|
short hitPoints;
|
||||||
|
int boxNumber;
|
||||||
|
short timer;
|
||||||
|
uint16_t flags; // ItemFlags enum
|
||||||
|
short shade;
|
||||||
|
uint16_t triggerFlags;
|
||||||
|
short carriedItem;
|
||||||
|
short afterDeath;
|
||||||
|
short firedWeapon;
|
||||||
|
short itemFlags[8];
|
||||||
|
ITEM_DATA data;
|
||||||
|
PHD_3DPOS pos;
|
||||||
|
bool active;
|
||||||
|
short status; // ItemStatus enum
|
||||||
|
bool gravityStatus;
|
||||||
|
bool hitStatus;
|
||||||
|
bool collidable;
|
||||||
|
bool lookedAt;
|
||||||
|
bool dynamicLight;
|
||||||
|
bool poisoned;
|
||||||
|
uint8_t aiBits; // AIObjectType enum
|
||||||
|
bool reallyActive;
|
||||||
|
bool inDrawRoom;
|
||||||
|
bool friendly;
|
||||||
|
uint32_t swapMeshFlags;
|
||||||
|
short drawRoom;
|
||||||
|
short TOSSPAD;
|
||||||
|
PHD_3DPOS startPos;
|
||||||
|
short locationAI;
|
||||||
|
std::string luaName;
|
||||||
|
};
|
4
TR5Main/Game/itemdata/itemdata.cpp
Normal file
4
TR5Main/Game/itemdata/itemdata.cpp
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "framework.h"
|
||||||
|
#include "itemdata.h"
|
||||||
|
|
||||||
|
ITEM_DATA::ITEM_DATA() : data(nullptr) {}
|
131
TR5Main/Game/itemdata/itemdata.h
Normal file
131
TR5Main/Game/itemdata/itemdata.h
Normal file
|
@ -0,0 +1,131 @@
|
||||||
|
#pragma once
|
||||||
|
#include <variant>
|
||||||
|
#include <functional>
|
||||||
|
#include <cstddef>
|
||||||
|
#include "upv_info.h"
|
||||||
|
#include "skidoo_info.h"
|
||||||
|
#include "door_data.h"
|
||||||
|
#include "kayak_info.h"
|
||||||
|
#include "lara_struct.h"
|
||||||
|
#include "jeep_info.h"
|
||||||
|
#include "motorbike_info.h"
|
||||||
|
#include "minecart_info.h"
|
||||||
|
#include "biggun_info.h"
|
||||||
|
#include "quad_info.h"
|
||||||
|
#include "tr5_laserhead_info.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
#include "boat_info.h"
|
||||||
|
#include "rubberboat_info.h"
|
||||||
|
#include <stdexcept>
|
||||||
|
#include "phd_global.h"
|
||||||
|
#include "tr4_wraith_info.h"
|
||||||
|
#include "tr5_pushableblock_info.h"
|
||||||
|
|
||||||
|
template<class... Ts> struct visitor : Ts... { using Ts::operator()...; };
|
||||||
|
template<class... Ts> visitor(Ts...)->visitor<Ts...>; // line not needed in C++20...
|
||||||
|
|
||||||
|
struct ITEM_INFO;
|
||||||
|
|
||||||
|
class ITEM_DATA {
|
||||||
|
std::variant<std::nullptr_t,
|
||||||
|
char,
|
||||||
|
short,
|
||||||
|
int,
|
||||||
|
long,
|
||||||
|
long long,
|
||||||
|
unsigned char,
|
||||||
|
unsigned short,
|
||||||
|
unsigned int,
|
||||||
|
unsigned long,
|
||||||
|
unsigned long long,
|
||||||
|
float,
|
||||||
|
double,
|
||||||
|
long double,
|
||||||
|
std::array<short, 4>,
|
||||||
|
ITEM_INFO*,
|
||||||
|
CREATURE_INFO,
|
||||||
|
LASER_HEAD_INFO,
|
||||||
|
QUAD_INFO,
|
||||||
|
BIGGUNINFO,
|
||||||
|
MOTORBIKE_INFO,
|
||||||
|
JEEP_INFO,
|
||||||
|
LaraInfo,
|
||||||
|
KAYAK_INFO,
|
||||||
|
DOOR_DATA,
|
||||||
|
SKIDOO_INFO,
|
||||||
|
SUB_INFO,
|
||||||
|
BOAT_INFO,
|
||||||
|
GAME_VECTOR,
|
||||||
|
WRAITH_INFO,
|
||||||
|
RUBBER_BOAT_INFO,
|
||||||
|
PUSHABLE_INFO,
|
||||||
|
CART_INFO
|
||||||
|
> data;
|
||||||
|
public:
|
||||||
|
ITEM_DATA();
|
||||||
|
|
||||||
|
template<typename D>
|
||||||
|
ITEM_DATA(D&& type) : data(std::move(type)) {}
|
||||||
|
|
||||||
|
|
||||||
|
// conversion operators to keep original syntax!
|
||||||
|
// TODO: should be removed later and
|
||||||
|
template<typename T>
|
||||||
|
operator T* () {
|
||||||
|
if(std::holds_alternative<T>(data)) {
|
||||||
|
auto& ref = std::get<T>(data);
|
||||||
|
return &ref;
|
||||||
|
}
|
||||||
|
throw std::runtime_error("ITEM_DATA does not hold the requested type!\n The code set the ITEM_DATA to a different type than the type that was attempted to read");
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
operator T& () {
|
||||||
|
if(std::holds_alternative<T>(data)) {
|
||||||
|
auto& ref = std::get<T>(data);
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
throw std::runtime_error("ITEM_DATA does not hold the requested type!\n The code set the ITEM_DATA to a different type than the type that was attempted to read");
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
ITEM_DATA& operator=(T* newData) {
|
||||||
|
data = *newData;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
ITEM_DATA& operator=(std::nullptr_t null) {
|
||||||
|
data = nullptr;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
ITEM_DATA& operator=(T& newData) {
|
||||||
|
data = newData;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
ITEM_DATA& operator=(T&& newData) {
|
||||||
|
data = std::move(newData);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
operator bool() const {
|
||||||
|
return !std::holds_alternative<std::nullptr_t>(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename ... Funcs>
|
||||||
|
void apply(Funcs&&... funcs) {
|
||||||
|
std::visit(
|
||||||
|
visitor{
|
||||||
|
[](auto const&) {},
|
||||||
|
std::forward<Funcs>(funcs)...
|
||||||
|
},
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
template<typename T>
|
||||||
|
bool is() const {
|
||||||
|
return std::holds_alternative<T>(data);
|
||||||
|
}
|
||||||
|
};
|
|
@ -5,6 +5,7 @@
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
#include "effects\effects.h"
|
#include "effects\effects.h"
|
||||||
|
#include "Game\box.h"
|
||||||
|
|
||||||
void ClearItem(short itemNum)
|
void ClearItem(short itemNum)
|
||||||
{
|
{
|
||||||
|
@ -12,7 +13,7 @@ void ClearItem(short itemNum)
|
||||||
ROOM_INFO* room = &g_Level.Rooms[item->roomNumber];
|
ROOM_INFO* room = &g_Level.Rooms[item->roomNumber];
|
||||||
|
|
||||||
item->collidable = true;
|
item->collidable = true;
|
||||||
item->data = NULL;
|
item->data = nullptr;
|
||||||
item->startPos = item->pos;
|
item->startPos = item->pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,8 +271,6 @@ short CreateNewEffect(short roomNum)
|
||||||
|
|
||||||
void InitialiseFXArray(int allocmem)
|
void InitialiseFXArray(int allocmem)
|
||||||
{
|
{
|
||||||
if (allocmem)
|
|
||||||
EffectList = game_malloc<FX_INFO>(NUM_EFFECTS);
|
|
||||||
|
|
||||||
FX_INFO* fx;
|
FX_INFO* fx;
|
||||||
|
|
||||||
|
@ -382,7 +381,6 @@ void InitialiseItem(short itemNum)
|
||||||
item->touchBits = 0;
|
item->touchBits = 0;
|
||||||
item->afterDeath = false;
|
item->afterDeath = false;
|
||||||
item->firedWeapon = 0;
|
item->firedWeapon = 0;
|
||||||
item->data = NULL;
|
|
||||||
item->swapMeshFlags = 0;
|
item->swapMeshFlags = 0;
|
||||||
|
|
||||||
if (item->flags & IFLAG_INVISIBLE)
|
if (item->flags & IFLAG_INVISIBLE)
|
||||||
|
@ -408,7 +406,7 @@ void InitialiseItem(short itemNum)
|
||||||
item->nextItem = r->itemNumber;
|
item->nextItem = r->itemNumber;
|
||||||
r->itemNumber = itemNum;
|
r->itemNumber = itemNum;
|
||||||
|
|
||||||
FLOOR_INFO* floor = &XZ_GET_SECTOR(r, item->pos.xPos - r->x, item->pos.zPos - r->z);
|
FLOOR_INFO* floor = XZ_GET_SECTOR(r, item->pos.xPos - r->x, item->pos.zPos - r->z);
|
||||||
item->floor = floor->floor * 256;
|
item->floor = floor->floor * 256;
|
||||||
item->boxNumber = floor->box;
|
item->boxNumber = floor->box;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Specific\phd_global.h"
|
#include "Specific\phd_global.h"
|
||||||
|
#include "item.h"
|
||||||
enum GAME_OBJECT_ID : short;
|
#include <vector>
|
||||||
|
|
||||||
enum AIObjectType
|
enum AIObjectType
|
||||||
{
|
{
|
||||||
|
@ -32,60 +32,8 @@ enum ItemFlags
|
||||||
IFLAG_ACTIVATION_MASK = 0x3E00 // bits 9-13
|
IFLAG_ACTIVATION_MASK = 0x3E00 // bits 9-13
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ROOM_VECTOR
|
|
||||||
{
|
|
||||||
int roomNumber;
|
|
||||||
int yNumber;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ITEM_INFO
|
|
||||||
{
|
|
||||||
int floor;
|
|
||||||
DWORD touchBits;
|
|
||||||
DWORD meshBits;
|
|
||||||
GAME_OBJECT_ID objectNumber;
|
|
||||||
short currentAnimState;
|
|
||||||
short goalAnimState;
|
|
||||||
short requiredAnimState;
|
|
||||||
short animNumber;
|
|
||||||
short frameNumber;
|
|
||||||
short roomNumber;
|
|
||||||
ROOM_VECTOR location;
|
|
||||||
short nextItem;
|
|
||||||
short nextActive;
|
|
||||||
short speed;
|
|
||||||
short fallspeed;
|
|
||||||
short hitPoints;
|
|
||||||
int boxNumber;
|
|
||||||
short timer;
|
|
||||||
unsigned short flags; // ItemFlags enum
|
|
||||||
short shade;
|
|
||||||
short triggerFlags;
|
|
||||||
short carriedItem;
|
|
||||||
short afterDeath;
|
|
||||||
short firedWeapon;
|
|
||||||
short itemFlags[8];
|
|
||||||
void* data;
|
|
||||||
PHD_3DPOS pos;
|
|
||||||
bool active;
|
|
||||||
short status; // ItemStatus enum
|
|
||||||
bool gravityStatus;
|
|
||||||
bool hitStatus;
|
|
||||||
bool collidable;
|
|
||||||
bool lookedAt;
|
|
||||||
bool dynamicLight;
|
|
||||||
bool poisoned;
|
|
||||||
byte aiBits; // AIObjectType enum
|
|
||||||
bool reallyActive;
|
|
||||||
bool inDrawRoom;
|
|
||||||
bool friendly;
|
|
||||||
int swapMeshFlags;
|
|
||||||
short drawRoom;
|
|
||||||
short TOSSPAD;
|
|
||||||
PHD_3DPOS startPos;
|
|
||||||
short locationAI;
|
|
||||||
std::string luaName;
|
|
||||||
};
|
|
||||||
|
|
||||||
// used by fx->shade !
|
// used by fx->shade !
|
||||||
#define RGB555(r, g, b) ((r << 7) & 0x7C00 | (g << 2) & 0x3E0 | (b >> 3) & 0x1F)
|
#define RGB555(r, g, b) ((r << 7) & 0x7C00 | (g << 2) & 0x3E0 | (b >> 3) & 0x1F)
|
||||||
|
@ -97,7 +45,6 @@ constexpr auto NO_ITEM = -1;
|
||||||
constexpr auto ALL_MESHBITS = -1;
|
constexpr auto ALL_MESHBITS = -1;
|
||||||
constexpr auto NOT_TARGETABLE = -16384;
|
constexpr auto NOT_TARGETABLE = -16384;
|
||||||
#define NUM_ITEMS 1024
|
#define NUM_ITEMS 1024
|
||||||
#define NUM_EFFECTS 1024
|
|
||||||
|
|
||||||
void EffectNewRoom(short fxNumber, short roomNumber);
|
void EffectNewRoom(short fxNumber, short roomNumber);
|
||||||
void ItemNewRoom(short itemNum, short roomNumber);
|
void ItemNewRoom(short itemNum, short roomNumber);
|
||||||
|
|
|
@ -5,46 +5,35 @@
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
|
#include "creature_info.h"
|
||||||
#define DEFAULT_FLY_UPDOWN_SPEED 16
|
#define DEFAULT_FLY_UPDOWN_SPEED 16
|
||||||
#define DEFAULT_SWIM_UPDOWN_SPEED 32
|
#define DEFAULT_SWIM_UPDOWN_SPEED 32
|
||||||
|
|
||||||
int SlotsUsed;
|
int SlotsUsed;
|
||||||
std::vector<CREATURE_INFO> BaddieSlots;
|
std::vector<CREATURE_INFO*> ActiveCreatures;
|
||||||
|
|
||||||
void InitialiseLOTarray(int allocMem)
|
void InitialiseLOTarray(int itemNum)
|
||||||
{
|
{
|
||||||
if (allocMem)
|
ITEM_INFO* item = &g_Level.Items[itemNum];
|
||||||
{
|
|
||||||
BaddieSlots.clear();
|
CREATURE_INFO* creature = item->data;
|
||||||
BaddieSlots.resize(NUM_SLOTS);
|
if(!creature->LOT.initialised) {
|
||||||
|
creature->LOT.node = std::vector<BOX_NODE>(g_Level.Boxes.size(), BOX_NODE{});
|
||||||
|
creature->LOT.initialised = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* creature = BaddieSlots.data();
|
|
||||||
for (int i = 0; i < NUM_SLOTS; i++, creature++)
|
|
||||||
{
|
|
||||||
creature->itemNum = NO_ITEM;
|
|
||||||
if (allocMem)
|
|
||||||
{
|
|
||||||
creature->LOT.node.clear();
|
|
||||||
creature->LOT.node.resize(g_Level.Boxes.size());
|
|
||||||
for (int j = 0; j < g_Level.Boxes.size(); j++)
|
|
||||||
{
|
|
||||||
creature->LOT.node.emplace_back(BOX_NODE());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SlotsUsed = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int EnableBaddieAI(short itemNum, int always)
|
int EnableBaddieAI(short itemNum, int always)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &g_Level.Items[itemNum];
|
ITEM_INFO* item = &g_Level.Items[itemNum];
|
||||||
|
|
||||||
if (item->data != NULL)
|
if (item->data.is<CREATURE_INFO>())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
if (SlotsUsed >= NUM_SLOTS)
|
if (SlotsUsed >= NUM_SLOTS)
|
||||||
{
|
{
|
||||||
int cameraDistance = 0;
|
int cameraDistance = 0;
|
||||||
|
@ -57,9 +46,11 @@ int EnableBaddieAI(short itemNum, int always)
|
||||||
}
|
}
|
||||||
|
|
||||||
int slotToDisable = -1;
|
int slotToDisable = -1;
|
||||||
CREATURE_INFO* creature = BaddieSlots.data();
|
|
||||||
for (int slot = 0; slot < NUM_SLOTS; slot++, creature++)
|
|
||||||
|
for (int slot = 0; slot < ActiveCreatures.size(); slot++)
|
||||||
{
|
{
|
||||||
|
CREATURE_INFO* creature = ActiveCreatures[slot];
|
||||||
item = &g_Level.Items[creature->itemNum];
|
item = &g_Level.Items[creature->itemNum];
|
||||||
|
|
||||||
int deltaX = (item->pos.xPos - Camera.pos.x) >> 8;
|
int deltaX = (item->pos.xPos - Camera.pos.x) >> 8;
|
||||||
|
@ -77,17 +68,18 @@ int EnableBaddieAI(short itemNum, int always)
|
||||||
if (slotToDisable < 0 || slotToDisable > NUM_SLOTS)
|
if (slotToDisable < 0 || slotToDisable > NUM_SLOTS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ITEM_INFO* itemToDisable = &g_Level.Items[BaddieSlots[slotToDisable].itemNum];
|
ITEM_INFO* itemToDisable = &g_Level.Items[ActiveCreatures[slotToDisable].itemNum];
|
||||||
CREATURE_INFO* creatureToDisable = &BaddieSlots[slotToDisable];
|
CREATURE_INFO* creatureToDisable = &ActiveCreatures[slotToDisable];
|
||||||
|
|
||||||
itemToDisable->status = ITEM_INVISIBLE;
|
itemToDisable->status = ITEM_INVISIBLE;
|
||||||
DisableBaddieAI(creatureToDisable->itemNum);
|
DisableBaddieAI(creatureToDisable->itemNum);
|
||||||
InitialiseSlot(itemNum, slotToDisable);
|
InitialiseSlot(itemNum, slotToDisable);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else*/
|
||||||
{
|
{
|
||||||
CREATURE_INFO* creature = BaddieSlots.data();
|
/*
|
||||||
|
CREATURE_INFO* creature = ActiveCreatures.data();
|
||||||
for (int slot = 0; slot < NUM_SLOTS; slot++, creature++)
|
for (int slot = 0; slot < NUM_SLOTS; slot++, creature++)
|
||||||
{
|
{
|
||||||
if (creature->itemNum == NO_ITEM)
|
if (creature->itemNum == NO_ITEM)
|
||||||
|
@ -96,9 +88,12 @@ int EnableBaddieAI(short itemNum, int always)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
InitialiseSlot(itemNum, 0);
|
||||||
|
ActiveCreatures.push_back(item->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisableBaddieAI(short itemNumber)
|
void DisableBaddieAI(short itemNumber)
|
||||||
|
@ -106,11 +101,13 @@ void DisableBaddieAI(short itemNumber)
|
||||||
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
||||||
CREATURE_INFO* creature = (CREATURE_INFO*)item->data;
|
CREATURE_INFO* creature = (CREATURE_INFO*)item->data;
|
||||||
|
|
||||||
item->data = NULL;
|
|
||||||
if (creature)
|
if (creature)
|
||||||
{
|
{
|
||||||
creature->itemNum = NO_ITEM;
|
creature->itemNum = NO_ITEM;
|
||||||
SlotsUsed--;
|
ActiveCreatures.erase(std::find(ActiveCreatures.begin(), ActiveCreatures.end(), creature));
|
||||||
|
item->data = nullptr;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,9 +115,10 @@ void InitialiseSlot(short itemNum, short slot)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &g_Level.Items[itemNum];
|
ITEM_INFO* item = &g_Level.Items[itemNum];
|
||||||
OBJECT_INFO* obj = &Objects[item->objectNumber];
|
OBJECT_INFO* obj = &Objects[item->objectNumber];
|
||||||
CREATURE_INFO* creature = &BaddieSlots[slot];
|
|
||||||
|
|
||||||
item->data = creature;
|
item->data = CREATURE_INFO();
|
||||||
|
CREATURE_INFO* creature = item->data;
|
||||||
|
InitialiseLOTarray(itemNum);
|
||||||
creature->itemNum = itemNum;
|
creature->itemNum = itemNum;
|
||||||
creature->mood = BORED_MOOD;
|
creature->mood = BORED_MOOD;
|
||||||
creature->jointRotation[0] = 0;
|
creature->jointRotation[0] = 0;
|
||||||
|
@ -283,12 +281,11 @@ void ClearLOT(LOT_INFO* LOT)
|
||||||
LOT->requiredBox = NO_BOX;
|
LOT->requiredBox = NO_BOX;
|
||||||
|
|
||||||
BOX_NODE* node = LOT->node.data();
|
BOX_NODE* node = LOT->node.data();
|
||||||
for (int i = 0; i < g_Level.Boxes.size(); i++)
|
for(auto& node : LOT->node)
|
||||||
{
|
{
|
||||||
node->exitBox = NO_BOX;
|
node.exitBox = NO_BOX;
|
||||||
node->nextExpansion = NO_BOX;
|
node.nextExpansion = NO_BOX;
|
||||||
node->searchNumber = 0;
|
node.searchNumber = 0;
|
||||||
node++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,7 +294,7 @@ void CreateZone(ITEM_INFO* item)
|
||||||
CREATURE_INFO* creature = (CREATURE_INFO*)item->data;
|
CREATURE_INFO* creature = (CREATURE_INFO*)item->data;
|
||||||
ROOM_INFO* r = &g_Level.Rooms[item->roomNumber];
|
ROOM_INFO* r = &g_Level.Rooms[item->roomNumber];
|
||||||
|
|
||||||
item->boxNumber = XZ_GET_SECTOR(r, item->pos.xPos - r->x, item->pos.zPos - r->z).box;
|
item->boxNumber = XZ_GET_SECTOR(r, item->pos.xPos - r->x, item->pos.zPos - r->z)->box;
|
||||||
|
|
||||||
if (creature->LOT.fly)
|
if (creature->LOT.fly)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "box.h"
|
#include "box.h"
|
||||||
|
|
||||||
constexpr auto NUM_SLOTS = 32;
|
extern std::vector<CREATURE_INFO*> ActiveCreatures;
|
||||||
extern int SlotsUsed;
|
|
||||||
extern std::vector<CREATURE_INFO> BaddieSlots;
|
|
||||||
|
|
||||||
void InitialiseLOTarray(int allocMem);
|
void InitialiseLOTarray(int allocMem);
|
||||||
int EnableBaddieAI(short itemNum, int always);
|
int EnableBaddieAI(short itemNum, int always);
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
#include "framework.h"
|
|
||||||
#include "malloc.h"
|
|
||||||
#include "door.h"
|
|
||||||
char* malloc_buffer;
|
|
||||||
int malloc_size;
|
|
||||||
char* malloc_ptr;
|
|
||||||
int malloc_free;
|
|
||||||
int malloc_used;
|
|
||||||
void init_game_malloc() noexcept
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void game_free(void* ptr) noexcept
|
|
||||||
{
|
|
||||||
|
|
||||||
delete[] ptr;
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include <utility>
|
|
||||||
extern char* malloc_buffer;
|
|
||||||
extern int malloc_size;
|
|
||||||
extern char* malloc_ptr;
|
|
||||||
extern int malloc_free;
|
|
||||||
extern int malloc_used;
|
|
||||||
|
|
||||||
template <typename T,typename ... Args>
|
|
||||||
T* game_malloc(size_t count = 1,Args&&...args) noexcept {
|
|
||||||
|
|
||||||
return new T[count]{std::forward<Args>(args)...};
|
|
||||||
}
|
|
||||||
void init_game_malloc() noexcept;
|
|
||||||
void game_free(void* ptr) noexcept;
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
|
#include "creature_info.h"
|
||||||
using std::vector;
|
using std::vector;
|
||||||
short GF(short animIndex, short frameToStart)
|
short GF(short animIndex, short frameToStart)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
|
#include "collide.h"
|
||||||
#define SHARD_DAMAGE 30
|
#define SHARD_DAMAGE 30
|
||||||
#define ROCKET_DAMAGE 100
|
#define ROCKET_DAMAGE 100
|
||||||
#define DIVER_HARPOON_DAMAGE 50
|
#define DIVER_HARPOON_DAMAGE 50
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "pickup\pickup.h"
|
#include "pickup\pickup.h"
|
||||||
|
#include "Renderer11.h"
|
||||||
|
|
||||||
using namespace TEN::Renderer;
|
using namespace TEN::Renderer;
|
||||||
bool goUp, goDown, goRight, goLeft, goSelect, goDeselect;
|
bool goUp, goDown, goRight, goLeft, goSelect, goDeselect;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
|
#include "collide.h"
|
||||||
|
|
||||||
OBJECT_TEXTURE* WaterfallTextures[6];
|
OBJECT_TEXTURE* WaterfallTextures[6];
|
||||||
float WaterfallY[6];
|
float WaterfallY[6];
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "collide.h"
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
|
struct OBJECT_TEXTURE;
|
||||||
extern OBJECT_TEXTURE* WaterfallTextures[6];
|
extern OBJECT_TEXTURE* WaterfallTextures[6];
|
||||||
extern float WaterfallY[6];
|
extern float WaterfallY[6];
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "effects\debris.h"
|
#include "effects\debris.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
|
||||||
int ShotLara(ITEM_INFO* item, AI_INFO* info, BITE_INFO* gun, short extra_rotation, int damage)
|
int ShotLara(ITEM_INFO* item, AI_INFO* info, BITE_INFO* gun, short extra_rotation, int damage)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "collide.h"
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
|
struct PHD_VECTOR;
|
||||||
|
struct BOUNDING_BOX;
|
||||||
enum GAME_OBJECT_ID : short;
|
enum GAME_OBJECT_ID : short;
|
||||||
|
|
||||||
extern int NumRPickups;
|
extern int NumRPickups;
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
#include "puzzles_keys.h"
|
#include "puzzles_keys.h"
|
||||||
#include "generic_switch.h"
|
#include "generic_switch.h"
|
||||||
|
#include "camera.h"
|
||||||
|
#include "control.h"
|
||||||
using namespace TEN::Entities::Switches;
|
using namespace TEN::Entities::Switches;
|
||||||
|
|
||||||
enum PuzzleType {
|
enum PuzzleType {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "collide.h"
|
|
||||||
|
|
||||||
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
/*puzzles*/
|
/*puzzles*/
|
||||||
void PuzzleHoleCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll);
|
void PuzzleHoleCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll);
|
||||||
void PuzzleDoneCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll);
|
void PuzzleDoneCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll);
|
||||||
|
|
5
TR5Main/Game/roomvector.h
Normal file
5
TR5Main/Game/roomvector.h
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#pragma once
|
||||||
|
struct ROOM_VECTOR {
|
||||||
|
int roomNumber;
|
||||||
|
int yNumber;
|
||||||
|
};
|
|
@ -6,6 +6,7 @@
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
|
#include "camera.h"
|
||||||
|
|
||||||
PENDULUM CurrentPendulum;
|
PENDULUM CurrentPendulum;
|
||||||
PENDULUM AlternatePendulum;
|
PENDULUM AlternatePendulum;
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
#include "tr5_spider_emitter.h"
|
#include "tr5_spider_emitter.h"
|
||||||
#include "generic_switch.h"
|
#include "generic_switch.h"
|
||||||
#include "fullblock_switch.h"
|
#include "fullblock_switch.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
#include "quad_info.h"
|
||||||
using namespace TEN::Entities::Switches;
|
using namespace TEN::Entities::Switches;
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
@ -996,7 +997,7 @@ bool SaveGame::readItemChunks(ChunkId* chunkId, int maxSize, int itemNumber)
|
||||||
creature->mood = (MOOD_TYPE)LEB128::ReadInt32(m_stream);
|
creature->mood = (MOOD_TYPE)LEB128::ReadInt32(m_stream);
|
||||||
|
|
||||||
ITEM_INFO* enemy = (ITEM_INFO*)LEB128::ReadLong(m_stream);
|
ITEM_INFO* enemy = (ITEM_INFO*)LEB128::ReadLong(m_stream);
|
||||||
creature->enemy = AddPtr(enemy, ITEM_INFO, malloc_buffer);
|
//creature->enemy = AddPtr(enemy, ITEM_INFO, malloc_buffer);
|
||||||
|
|
||||||
creature->aiTarget.objectNumber = from_underlying(LEB128::ReadInt16(m_stream));
|
creature->aiTarget.objectNumber = from_underlying(LEB128::ReadInt16(m_stream));
|
||||||
creature->aiTarget.roomNumber = LEB128::ReadInt16(m_stream);
|
creature->aiTarget.roomNumber = LEB128::ReadInt16(m_stream);
|
||||||
|
@ -1019,10 +1020,10 @@ bool SaveGame::readItemChunks(ChunkId* chunkId, int maxSize, int itemNumber)
|
||||||
}
|
}
|
||||||
else if (chunkId->EqualsTo(m_chunkItemQuadInfo.get()))
|
else if (chunkId->EqualsTo(m_chunkItemQuadInfo.get()))
|
||||||
{
|
{
|
||||||
QUAD_INFO* quadInfo = game_malloc<QUAD_INFO>();
|
//QUAD_INFO* quadInfo = game_malloc<QUAD_INFO>();
|
||||||
m_stream->ReadBytes(reinterpret_cast<byte*>(quadInfo), sizeof(QUAD_INFO));
|
//m_stream->ReadBytes(reinterpret_cast<byte*>(quadInfo), sizeof(QUAD_INFO));
|
||||||
if (item->objectNumber == ID_QUAD)
|
//if (item->objectNumber == ID_QUAD)
|
||||||
item->data = (void*)quadInfo;
|
// item->data = quadInfo;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1107,7 +1108,7 @@ void SaveGame::saveItemIntelligentData(int arg1, int arg2)
|
||||||
OBJECT_INFO* obj = &Objects[item->objectNumber];
|
OBJECT_INFO* obj = &Objects[item->objectNumber];
|
||||||
CREATURE_INFO* creature = (CREATURE_INFO*)item->data;
|
CREATURE_INFO* creature = (CREATURE_INFO*)item->data;
|
||||||
|
|
||||||
ITEM_INFO* enemy = (ITEM_INFO*)((char*)creature->enemy - (ptrdiff_t)malloc_buffer);
|
ITEM_INFO* enemy = (ITEM_INFO*)((char*)creature->enemy);
|
||||||
|
|
||||||
LEB128::Write(m_stream, creature->jointRotation[0]);
|
LEB128::Write(m_stream, creature->jointRotation[0]);
|
||||||
LEB128::Write(m_stream, creature->jointRotation[1]);
|
LEB128::Write(m_stream, creature->jointRotation[1]);
|
||||||
|
@ -1418,7 +1419,7 @@ bool SaveGame::readFlare()
|
||||||
AddActiveItem(itemNumber);
|
AddActiveItem(itemNumber);
|
||||||
|
|
||||||
// Flare age
|
// Flare age
|
||||||
item->data = (void*)LEB128::ReadInt32(m_stream);
|
item->data = LEB128::ReadInt32(m_stream);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1465,7 +1466,8 @@ bool SaveGame::readTorpedo()
|
||||||
|
|
||||||
void SaveGame::saveItemQuadInfo(int itemNumber, int arg2)
|
void SaveGame::saveItemQuadInfo(int itemNumber, int arg2)
|
||||||
{
|
{
|
||||||
m_stream->WriteBytes(reinterpret_cast<byte*>(g_Level.Items[itemNumber].data), sizeof(QUAD_INFO));
|
|
||||||
|
//m_stream->WriteBytes(reinterpret_cast<byte*>(g_Level.Items[itemNumber].data), sizeof(QUAD_INFO));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveGame::saveRats(int arg1, int arg2)
|
void SaveGame::saveRats(int arg1, int arg2)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "collide.h"
|
struct COLL_INFO;
|
||||||
|
struct ITEM_INFO;
|
||||||
void ProcessExplodingSwitchType8(ITEM_INFO* item);
|
void ProcessExplodingSwitchType8(ITEM_INFO* item);
|
||||||
void InitialiseShootSwitch(short itemNumber);
|
void InitialiseShootSwitch(short itemNumber);
|
||||||
void ShootSwitchCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* coll);
|
void ShootSwitchCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* coll);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "collide.h"
|
struct COLL_INFO;
|
||||||
|
struct ITEM_INFO;
|
||||||
|
|
||||||
extern ITEM_INFO* WBItem;
|
extern ITEM_INFO* WBItem;
|
||||||
extern short WBRoom;
|
extern short WBRoom;
|
||||||
|
|
||||||
void LaraBurn();
|
void LaraBurn();
|
||||||
void LavaBurn(ITEM_INFO* item);
|
void LavaBurn(ITEM_INFO* item);
|
||||||
void FlameControl(short fxNumber);
|
void FlameControl(short fxNumber);
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
#include "tr4_mutant.h"
|
#include "tr4_mutant.h"
|
||||||
|
#include "collide.h"
|
||||||
|
|
||||||
namespace TEN::entities::all
|
namespace TEN::entities::all
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "effects\tomb4fx.h"
|
#include "effects\tomb4fx.h"
|
||||||
|
#include "collide.h"
|
||||||
|
|
||||||
namespace TEN::Entities::TR4 {
|
namespace TEN::Entities::TR4 {
|
||||||
LOCUST_INFO Locusts[MAX_LOCUSTS];
|
LOCUST_INFO Locusts[MAX_LOCUSTS];
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Specific\phd_global.h"
|
#include "Specific\phd_global.h"
|
||||||
|
#include "level.h"
|
||||||
|
|
||||||
void InitialiseBridge(short itemNumber);
|
void InitialiseBridge(short itemNumber);
|
||||||
int GetOffset(short angle, int x, int z);
|
int GetOffset(short angle, int x, int z);
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
#include "generic_trapdoor.h"
|
#include "generic_trapdoor.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
|
#include "camera.h"
|
||||||
|
#include "control.h"
|
||||||
|
#include "level.h"
|
||||||
OBJECT_COLLISION_BOUNDS CeilingTrapDoorBounds = {-256, 256, 0, 900, -768, -256, -1820, 1820, -5460, 5460, -1820, 1820};
|
OBJECT_COLLISION_BOUNDS CeilingTrapDoorBounds = {-256, 256, 0, 900, -768, -256, -1820, 1820, -5460, 5460, -1820, 1820};
|
||||||
static PHD_VECTOR CeilingTrapDoorPos = {0, 1056, -480};
|
static PHD_VECTOR CeilingTrapDoorPos = {0, 1056, -480};
|
||||||
OBJECT_COLLISION_BOUNDS FloorTrapDoorBounds = {-256, 256, 0, 0, -1024, -256, -1820, 1820, -5460, 5460, -1820, 1820};
|
OBJECT_COLLISION_BOUNDS FloorTrapDoorBounds = {-256, 256, 0, 0, -1024, -256, -1820, 1820, -5460, 5460, -1820, 1820};
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "generic_switch.h"
|
#include "generic_switch.h"
|
||||||
#include "door.h"
|
#include "door_data.h"
|
||||||
|
#include "Box.h"
|
||||||
namespace TEN::Entities::Switches
|
namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
OBJECT_COLLISION_BOUNDS CogSwitchBounds =
|
OBJECT_COLLISION_BOUNDS CogSwitchBounds =
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "newinv2.h"
|
#include "newinv2.h"
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
#include "pickup\pickup.h"
|
#include "pickup\pickup.h"
|
||||||
|
#include "level.h"
|
||||||
|
|
||||||
namespace TEN::Entities::Switches
|
namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "generic_switch.h"
|
#include "generic_switch.h"
|
||||||
|
#include "setup.h"
|
||||||
|
#include "collide.h"
|
||||||
|
#include "level.h"
|
||||||
namespace TEN::Entities::Switches
|
namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
OBJECT_COLLISION_BOUNDS FullBlockSwitchBounds =
|
OBJECT_COLLISION_BOUNDS FullBlockSwitchBounds =
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "items.h"
|
struct ITEM_INFO;
|
||||||
#include <collide.h>
|
struct COLL_INFO;
|
||||||
|
|
||||||
namespace TEN::Entities::Switches
|
namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
#include "generic_switch.h"
|
#include "generic_switch.h"
|
||||||
#include "sphere.h"
|
#include "sphere.h"
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
|
#include "collide.h"
|
||||||
|
#include "floordata.h"
|
||||||
namespace TEN::Entities::Switches
|
namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
OBJECT_COLLISION_BOUNDS SwitchBounds =
|
OBJECT_COLLISION_BOUNDS SwitchBounds =
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "items.h"
|
|
||||||
#include <collide.h>
|
|
||||||
|
|
||||||
|
struct ITEM_INFO;
|
||||||
|
struct COLL_INFO;
|
||||||
namespace TEN::Entities::Switches
|
namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
enum SwitchStatus
|
enum SwitchStatus
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "generic_switch.h"
|
#include "generic_switch.h"
|
||||||
|
#include "level.h"
|
||||||
|
|
||||||
namespace TEN::Entities::Switches
|
namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "generic_switch.h"
|
#include "generic_switch.h"
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
#include "pickup\pickup.h"
|
#include "pickup\pickup.h"
|
||||||
|
#include "level.h"
|
||||||
|
|
||||||
namespace TEN::Entities::Switches
|
namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "generic_switch.h"
|
#include "generic_switch.h"
|
||||||
|
#include "level.h"
|
||||||
|
|
||||||
namespace TEN::Entities::Switches
|
namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,6 +7,9 @@
|
||||||
#include "door.h"
|
#include "door.h"
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
#include "switch.h"
|
#include "switch.h"
|
||||||
|
#include "setup.h"
|
||||||
|
#include "camera.h"
|
||||||
|
#include "level.h"
|
||||||
|
|
||||||
namespace TEN::Entities::Switches
|
namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
#include "newinv2.h"
|
#include "newinv2.h"
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
#include "generic_switch.h"
|
#include "generic_switch.h"
|
||||||
|
#include "camera.h"
|
||||||
|
#include "collide.h"
|
||||||
|
#include "level.h"
|
||||||
|
|
||||||
namespace TEN::Entities::Switches
|
namespace TEN::Entities::Switches
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
#include "control.h"
|
||||||
|
|
||||||
BITE_INFO bearBite = { 0, 96, 335, 14 };
|
BITE_INFO bearBite = { 0, 96, 335, 14 };
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,9 @@
|
||||||
#include "lara_one_gun.h"
|
#include "lara_one_gun.h"
|
||||||
#include "effects\effects.h"
|
#include "effects\effects.h"
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
|
#include "collide.h"
|
||||||
|
#include "item.h"
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
enum centaur_anims {
|
enum centaur_anims {
|
||||||
CENTAUR_EMPTY,
|
CENTAUR_EMPTY,
|
||||||
|
|
|
@ -107,7 +107,7 @@ void DoppelgangerControl(short itemNum)
|
||||||
item->gravityStatus = true;
|
item->gravityStatus = true;
|
||||||
item->fallspeed = 0;
|
item->fallspeed = 0;
|
||||||
item->speed = 0;
|
item->speed = 0;
|
||||||
item->data = (void*)-1;
|
item->data = -1;
|
||||||
item->pos.yPos += 50;
|
item->pos.yPos += 50;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
|
||||||
enum abortion_anims {
|
enum abortion_anims {
|
||||||
ABORT_EMPTY, ABORT_STOP, ABORT_TURNL, ABORT_TURNR, ABORT_ATTACK1, ABORT_ATTACK2,
|
ABORT_EMPTY, ABORT_STOP, ABORT_TURNL, ABORT_TURNR, ABORT_ATTACK1, ABORT_ATTACK2,
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
#include "effects\effects.h"
|
#include "effects\effects.h"
|
||||||
#include "Specific\trmath.h"
|
#include "Specific\trmath.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
|
||||||
#define NATLA_NEAR_DEATH 200
|
#define NATLA_NEAR_DEATH 200
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
#include "control.h"
|
||||||
BITE_INFO wolfBite = { 0, -14, 174, 6 };
|
BITE_INFO wolfBite = { 0, -14, 174, 6 };
|
||||||
|
|
||||||
enum wolfStates {
|
enum wolfStates {
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#include "object_helper.h"
|
#include "object_helper.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
|
||||||
static void StartBaddy(OBJECT_INFO* obj)
|
static void StartBaddy(OBJECT_INFO* obj)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
|
#include "creature_info.h"
|
||||||
BITE_INFO barracudaBite = { 2, -60, 121, 7 };
|
BITE_INFO barracudaBite = { 2, -60, 121, 7 };
|
||||||
|
|
||||||
void BarracudaControl(short itemNum)
|
void BarracudaControl(short itemNum)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
|
||||||
#define DRAGON_SWIPE_DAMAGE 250
|
#define DRAGON_SWIPE_DAMAGE 250
|
||||||
#define DRAGON_TOUCH_DAMAGE 10
|
#define DRAGON_TOUCH_DAMAGE 10
|
||||||
|
@ -478,7 +478,7 @@ void InitialiseBartoli(short itemNum)
|
||||||
InitialiseItem(back_item);
|
InitialiseItem(back_item);
|
||||||
back->meshBits = 0x1FFFFF;
|
back->meshBits = 0x1FFFFF;
|
||||||
|
|
||||||
item->data = (void*)back_item;
|
item->data = back_item;
|
||||||
|
|
||||||
front = &g_Level.Items[front_item];
|
front = &g_Level.Items[front_item];
|
||||||
front->objectNumber = ID_DRAGON_FRONT;
|
front->objectNumber = ID_DRAGON_FRONT;
|
||||||
|
@ -492,7 +492,7 @@ void InitialiseBartoli(short itemNum)
|
||||||
|
|
||||||
InitialiseItem(front_item);
|
InitialiseItem(front_item);
|
||||||
|
|
||||||
back->data = (void*)front_item;
|
back->data = front_item;
|
||||||
|
|
||||||
g_Level.NumItems += 2;
|
g_Level.NumItems += 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "items.h"
|
#include "items.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
|
||||||
BITE_INFO eagleBite = { 15, 46, 21, 6 };
|
BITE_INFO eagleBite = { 15, 46, 21, 6 };
|
||||||
BITE_INFO crowBite = { 2, 10, 60, 14 };
|
BITE_INFO crowBite = { 2, 10, 60, 14 };
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#include "lara.h"
|
#include "lara.h"
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
#include "floordata.h"
|
||||||
|
#include "collide.h"
|
||||||
|
|
||||||
BITE_INFO knifeLeft = { 0, 0, 0, 5 };
|
BITE_INFO knifeLeft = { 0, 0, 0, 5 };
|
||||||
BITE_INFO knifeRight = { 0, 0, 0, 8 };
|
BITE_INFO knifeRight = { 0, 0, 0, 8 };
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
#include "Specific\trmath.h"
|
#include "Specific\trmath.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
|
||||||
BITE_INFO mercUziBite = { 0, 150, 19, 17 };
|
BITE_INFO mercUziBite = { 0, 150, 19, 17 };
|
||||||
BITE_INFO mercAutoPistolBite = { 0, 230, 9, 17 };
|
BITE_INFO mercAutoPistolBite = { 0, 230, 9, 17 };
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "Sound\sound.h"
|
#include "Sound\sound.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
|
#include "creature_info.h"
|
||||||
BITE_INFO monkBite = { -23,16,265, 14 };
|
BITE_INFO monkBite = { -23,16,265, 14 };
|
||||||
|
|
||||||
extern bool MonksAttackLara;
|
extern bool MonksAttackLara;
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
|
#include "creature_info.h"
|
||||||
|
#include "control.h"
|
||||||
|
|
||||||
BITE_INFO ratBite = { 0, 0, 57, 2 };
|
BITE_INFO ratBite = { 0, 0, 57, 2 };
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
|
#include "creature_info.h"
|
||||||
BITE_INFO silencerGun = { 3, 331, 56, 10 };
|
BITE_INFO silencerGun = { 3, 331, 56, 10 };
|
||||||
|
|
||||||
void SilencerControl(short itemNum)
|
void SilencerControl(short itemNum)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue