This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,667 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#pragma once | ||
|
||
#include "math.h" | ||
|
||
typedef struct __PACKING { | ||
int16_t goal_anim_state; | ||
int16_t num_ranges; | ||
int16_t range_idx; | ||
} ANIM_CHANGE; | ||
|
||
typedef struct __PACKING { | ||
int16_t start_frame; | ||
int16_t end_frame; | ||
int16_t link_anim_num; | ||
int16_t link_frame_num; | ||
} ANIM_RANGE; | ||
|
||
#if TR_VERSION == 1 | ||
typedef struct __PACKING { | ||
BOUNDS_16 bounds; | ||
XYZ_16 offset; | ||
int16_t nmeshes; | ||
int32_t *mesh_rots; | ||
} FRAME_INFO; | ||
#endif | ||
|
||
typedef struct __PACKING { | ||
#if TR_VERSION == 1 | ||
FRAME_INFO *frame_ptr; | ||
uint32_t frame_ofs; | ||
#elif TR_VERSION == 2 | ||
int16_t *frame_ptr; | ||
#endif | ||
int16_t interpolation; | ||
int16_t current_anim_state; | ||
int32_t velocity; | ||
int32_t acceleration; | ||
int16_t frame_base; | ||
int16_t frame_end; | ||
int16_t jump_anim_num; | ||
int16_t jump_frame_num; | ||
int16_t num_changes; | ||
int16_t change_idx; | ||
int16_t num_commands; | ||
int16_t command_idx; | ||
} ANIM; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,30 @@ | ||
#pragma once | ||
|
||
#include "items.h" | ||
#include "lot.h" | ||
#include "math.h" | ||
|
||
#include <stdint.h> | ||
|
||
typedef enum { | ||
MOOD_BORED = 0, | ||
MOOD_ATTACK = 1, | ||
MOOD_ESCAPE = 2, | ||
MOOD_STALK = 3, | ||
} MOOD_TYPE; | ||
|
||
typedef struct __PACKING { | ||
int16_t head_rotation; | ||
int16_t neck_rotation; | ||
int16_t maximum_turn; | ||
uint16_t flags; | ||
int16_t item_num; | ||
MOOD_TYPE mood; | ||
LOT_INFO lot; | ||
XYZ_32 target; | ||
#if TR_VERSION == 2 | ||
ITEM_INFO *enemy; | ||
#endif | ||
} CREATURE_INFO; | ||
|
||
bool Creature_IsEnemy(const ITEM_INFO *item); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#pragma once | ||
|
||
#include "effects/exploding_death.h" | ||
#include "effects/types.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
int32_t Effect_ExplodingDeath( | ||
int16_t item_num, int32_t mesh_bits, int16_t damage); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
|
||
#include "../math.h" | ||
#include "../objects/ids.h" | ||
#include "../types.h" | ||
|
||
typedef struct __PACKING { | ||
XYZ_32 pos; | ||
XYZ_16 rot; | ||
int16_t room_num; | ||
#if TR_VERSION == 1 | ||
GAME_OBJECT_ID object_id; | ||
#else | ||
int16_t object_id; | ||
#endif | ||
#if TR_VERSION == 1 | ||
int16_t next_draw; | ||
#endif | ||
int16_t next_free; | ||
int16_t next_active; | ||
int16_t speed; | ||
int16_t fall_speed; | ||
int16_t frame_num; | ||
int16_t counter; | ||
int16_t shade; | ||
|
||
#if TR_VERSION == 1 | ||
struct __PACKING { | ||
struct __PACKING { | ||
XYZ_32 pos; | ||
XYZ_16 rot; | ||
} result, prev; | ||
} interp; | ||
#endif | ||
} FX_INFO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,6 @@ | ||
#pragma once | ||
|
||
#include "math.h" | ||
#include "objects/ids.h" | ||
|
||
#include <stdbool.h> | ||
#include <stdint.h> | ||
|
||
#define NO_ITEM (-1) | ||
|
||
#pragma pack(push, 1) | ||
|
||
#if TR_VERSION == 1 | ||
typedef enum { | ||
DS_CARRIED = 0, | ||
DS_FALLING = 1, | ||
DS_DROPPED = 2, | ||
DS_COLLECTED = 3, | ||
} DROP_STATUS; | ||
|
||
typedef struct CARRIED_ITEM { | ||
GAME_OBJECT_ID object_id; | ||
int16_t spawn_num; | ||
XYZ_32 pos; | ||
XYZ_16 rot; | ||
int16_t room_num; | ||
int16_t fall_speed; | ||
DROP_STATUS status; | ||
struct CARRIED_ITEM *next_item; | ||
} CARRIED_ITEM; | ||
#endif | ||
|
||
typedef struct { | ||
int32_t floor; | ||
uint32_t touch_bits; | ||
uint32_t mesh_bits; | ||
#if TR_VERSION == 1 | ||
GAME_OBJECT_ID object_id; | ||
#elif TR_VERSION == 2 | ||
int16_t object_id; | ||
#endif | ||
int16_t current_anim_state; | ||
int16_t goal_anim_state; | ||
int16_t required_anim_state; | ||
int16_t anim_num; | ||
int16_t frame_num; | ||
int16_t room_num; | ||
int16_t next_item; | ||
int16_t next_active; | ||
int16_t speed; | ||
int16_t fall_speed; | ||
int16_t hit_points; | ||
int16_t box_num; | ||
int16_t timer; | ||
uint16_t flags; | ||
|
||
#if TR_VERSION == 1 | ||
int16_t shade; | ||
void *data; | ||
void *priv; | ||
CARRIED_ITEM *carried_item; | ||
#elif TR_VERSION == 2 | ||
int16_t shade1; | ||
int16_t shade2; | ||
int16_t carried_item; | ||
void *data; | ||
#endif | ||
|
||
XYZ_32 pos; | ||
XYZ_16 rot; | ||
|
||
uint16_t active : 1; // 0x0001 | ||
uint16_t status : 2; // 0x0002…0x0004 | ||
uint16_t gravity : 1; // 0x0008 | ||
uint16_t hit_status : 1; // 0x0010 | ||
uint16_t collidable : 1; // 0x0020 | ||
uint16_t looked_at : 1; // 0x0040 | ||
#if TR_VERSION == 1 | ||
uint16_t pad : 9; // 0x0080…0x8000 | ||
#elif TR_VERSION == 2 | ||
uint16_t dynamic_light : 1; // 0x0080 | ||
uint16_t killed : 1; // 0x0100 | ||
uint16_t pad : 7; // 0x0200…0x8000 | ||
#endif | ||
|
||
#if TR_VERSION == 1 | ||
struct { | ||
struct { | ||
XYZ_32 pos; | ||
XYZ_16 rot; | ||
} result, prev; | ||
} interp; | ||
#endif | ||
} ITEM_INFO; | ||
|
||
#pragma pack(pop) | ||
|
||
ITEM_INFO *Item_Get(int16_t num); | ||
int32_t Item_GetTotalCount(void); | ||
int32_t Item_GetDistance(const ITEM_INFO *item, const XYZ_32 *target); | ||
void Item_TakeDamage(ITEM_INFO *item, int16_t damage, bool hit_status); | ||
#include "items/common.h" | ||
#include "items/const.h" | ||
#include "items/enum.h" | ||
#include "items/types.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
#include "types.h" | ||
|
||
#include <stdbool.h> | ||
|
||
ITEM_INFO *Item_Get(int16_t num); | ||
int32_t Item_GetTotalCount(void); | ||
int32_t Item_GetDistance(const ITEM_INFO *item, const XYZ_32 *target); | ||
void Item_TakeDamage(ITEM_INFO *item, int16_t damage, bool hit_status); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
|
||
#define NO_ITEM (-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
|
||
#if TR_VERSION == 1 | ||
typedef enum { | ||
DS_CARRIED = 0, | ||
DS_FALLING = 1, | ||
DS_DROPPED = 2, | ||
DS_COLLECTED = 3, | ||
} DROP_STATUS; | ||
#endif | ||
|
||
// clang-format off | ||
typedef enum { | ||
IF_ONE_SHOT = 0x0100, | ||
IF_CODE_BITS = 0x3E00, | ||
IF_REVERSE = 0x4000, | ||
IF_INVISIBLE = 0x0100, | ||
IF_KILLED = 0x8000, | ||
} ITEM_FLAG; | ||
// clang-format on |
Oops, something went wrong.