This commit is contained in:
theo3
2021-12-14 23:31:27 -08:00
parent 83fc028502
commit 34e69959df
198 changed files with 1578 additions and 1550 deletions
+18 -6
View File
@@ -5,6 +5,8 @@
#include "global.h"
#include "sprite.h"
#define MAX_ENTITIES 71
typedef enum {
PLAYER = 1,
ENEMY = 3,
@@ -175,6 +177,13 @@ enum {
#define COORD_TO_TILE_OFFSET(entity, xOff, yOff) \
TILE((entity)->x.HALF.HI - (xOff), (entity)->y.HALF.HI - (yOff))
enum {
IdleNorth = 0x0,
IdleEast = 0x2,
IdleSouth = 0x4,
IdleWest = 0x6,
};
enum {
DirectionNorth = 0x00,
DirectionEast = 0x08,
@@ -182,6 +191,10 @@ enum {
DirectionWest = 0x18,
};
#define AnimationStateTurnAround(expr) ((expr) ^ 0x4)
#define AnimationStateIdle(expr) ((expr) & 0x6)
#define AnimationStateWalk(expr) ((expr) & 0xe)
#define DirectionRound(expr) ((expr) & 0x18)
#define DirectionRoundUp(expr) DirectionRound((expr) + 4)
#define DirectionIsHorizontal(expr) ((expr) & 0x08)
@@ -194,7 +207,7 @@ enum {
#define Direction8Round(expr) ((expr) & 0x1c)
#define Direction8RoundUp(expr) Direction8Round((expr) + 2)
#define Direction8TurnAround(expr) (Direction8RoundUp(expr) ^ 0x10)
#define Direction8ToAnimationState(expr) (Direction8RoundUp(expr) >> 2)
#define Direction8ToAnimationState(expr) ((expr) >> 2)
#define Direction8FromAnimationState(expr) ((expr) << 2)
Entity* GetEmptyEntity(void);
@@ -270,11 +283,10 @@ void EraseAllEntities(void);
enum {
PRIO_MIN = 0,
PRIO_PLAYER = 1,
PRIO_REQUESTED = 2,
PRIO_MESSAGE = 2,
PRIO_OVERRIDE_MESSAGE = 3,
PRIO_PLAYER_EVENT = 6,
PRIO_INITIALIZING = 7,
PRIO_MESSAGE = 2, /* do not block during message */
PRIO_NO_BLOCK = 3, /* do not block during entity requested priority */
PRIO_PLAYER_EVENT = 6, /* do not block during special player event */
PRIO_HIGHEST = 7, /* do not block EVER */
};
/**