1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-30 18:55:54 +00:00

move defines into the headers

This commit is contained in:
feacur 2024-12-08 21:37:17 +01:00
commit 6b3eebb6d6
4 changed files with 46 additions and 60 deletions

View file

@ -86,34 +86,6 @@ static AnimationSpeedInfo sAnimationInfo[] = {
{ &gGoronSidestepAnim, 1.0f, ANIMMODE_LOOP_INTERP, -10.0f },
};
/*
* `actor.params bits` allocation:
* path 0123............
* type ....4567........
* cage ........89ABCDEF
*/
#define ENGO_GET_PATH_INDEX(this) PARAMS_GET_U((this)->actor.params, 0, 4)
#define ENGO_GET_TYPE(this) PARAMS_GET_NOSHIFT((this)->actor.params, 4, 4)
#define ENGO_CAGED_SWITCH_FLAG(this) PARAMS_GET_NOMASK((this)->actor.params, 8)
#define ENGO_PATH_INDEX_MAX NBITS_TO_MASK(4)
#define ENGO_IS_CAGE_OPEN(this, play) Flags_GetSwitch(play, ENGO_CAGED_SWITCH_FLAG(this))
#define ENGO_GET_SPEED_SCALE(this) (ENGO_GET_TYPE(this) == ENGO_TYPE_DMT_BIGGORON ? 0.5f : 1.0f)
// clang-format off
typedef enum EnGoType {
ENGO_TYPE_CITY_LINK = (0 << 4),
ENGO_TYPE_FIRE_GENERIC = (1 << 4),
ENGO_TYPE_DMT_DC_ENTRANCE = (2 << 4),
ENGO_TYPE_DMT_ROLLING_SMALL = (3 << 4),
ENGO_TYPE_DMT_BOMB_FLOWER = (4 << 4),
ENGO_TYPE_CITY_ENTRANCE = (5 << 4),
ENGO_TYPE_CITY_ISLAND = (6 << 4),
ENGO_TYPE_CITY_LOST_WOODS = (7 << 4),
ENGO_TYPE_DMT_BIGGORON = (9 << 4)
} EnGoType;
// clang-format on
void EnGo_SetupAction(EnGo* this, EnGoActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
@ -503,7 +475,7 @@ s32 EnGo_FollowPath(EnGo* this, PlayState* play) {
f32 xDist;
f32 zDist;
if (ENGO_GET_PATH_INDEX(this) == ENGO_PATH_INDEX_MAX) {
if (ENGO_GET_PATH_INDEX(this) == ENGO_PATH_NONE) {
return false;
}
@ -538,7 +510,7 @@ s32 EnGo_SetMovedPos(EnGo* this, PlayState* play) {
Path* path;
Vec3s* pointPos;
if (ENGO_GET_PATH_INDEX(this) == ENGO_PATH_INDEX_MAX) {
if (ENGO_GET_PATH_INDEX(this) == ENGO_PATH_NONE) {
return false;
} else {
path = &play->pathList[ENGO_GET_PATH_INDEX(this)];

View file

@ -30,6 +30,26 @@ typedef enum GoronLimb {
/* 18 */ GORON_LIMB_MAX
} GoronLimb;
typedef enum EnGoType {
ENGO_TYPE_CITY_LINK = (0 << 4),
ENGO_TYPE_FIRE_GENERIC = (1 << 4),
ENGO_TYPE_DMT_DC_ENTRANCE = (2 << 4),
ENGO_TYPE_DMT_ROLLING_SMALL = (3 << 4),
ENGO_TYPE_DMT_BOMB_FLOWER = (4 << 4),
ENGO_TYPE_CITY_ENTRANCE = (5 << 4),
ENGO_TYPE_CITY_ISLAND = (6 << 4),
ENGO_TYPE_CITY_LOST_WOODS = (7 << 4),
ENGO_TYPE_DMT_BIGGORON = (9 << 4)
} EnGoType;
#define ENGO_GET_PATH_INDEX(this) PARAMS_GET_U((this)->actor.params, 0, 4)
#define ENGO_GET_TYPE(this) PARAMS_GET_NOSHIFT((this)->actor.params, 4, 4)
#define ENGO_CAGED_SWITCH_FLAG(this) PARAMS_GET_NOMASK((this)->actor.params, 8)
#define ENGO_PATH_NONE NBITS_TO_MASK(4)
#define ENGO_IS_CAGE_OPEN(this, play) Flags_GetSwitch(play, ENGO_CAGED_SWITCH_FLAG(this))
#define ENGO_GET_SPEED_SCALE(this) (ENGO_GET_TYPE(this) == ENGO_TYPE_DMT_BIGGORON ? 0.5f : 1.0f)
#define EN_GO_EFFECT_COUNT 20
typedef struct EnGoEffect {

View file

@ -150,36 +150,6 @@ static AnimationInfo sAnimationInfo[] = {
{ &gGoronShakingAnim, 1.0f, 0.0f, -1.0f, 0x00, -8.0f },
};
/*
* `actor.params bits` allocation:
* type 01234...........
* path .....56789......
* cage ..........ABCDEF
*/
#define ENGO2_GET_TYPE(this) PARAMS_GET_S((this)->actor.params, 0, 5)
#define ENGO2_GET_PATH_INDEX(this) PARAMS_GET_S((this)->actor.params, 5, 5)
#define ENGO2_CAGED_SWITCH_FLAG(this) PARAMS_GET_S((this)->actor.params, 10, 6)
#define ENGO2_PATH_INDEX_MAX NBITS_TO_MASK(5)
#define ENGO2_IS_CAGE_OPEN(play, this) Flags_GetSwitch(play, ENGO2_CAGED_SWITCH_FLAG(this))
typedef enum GoronType {
/* 0x0 */ GORON_CITY_HOT_RODDER,
/* 0x1 */ GORON_CITY_LINK,
/* 0x2 */ GORON_DMT_BIGGORON,
/* 0x3 */ GORON_FIRE_GENERIC,
/* 0x4 */ GORON_DMT_BOMB_FLOWER,
/* 0x5 */ GORON_DMT_ROLLING_SMALL,
/* 0x6 */ GORON_DMT_DC_ENTRANCE,
/* 0x7 */ GORON_CITY_ENTRANCE,
/* 0x8 */ GORON_CITY_ISLAND,
/* 0x9 */ GORON_CITY_LOWEST_FLOOR,
/* 0xA */ GORON_CITY_STAIRWELL,
/* 0xB */ GORON_CITY_LOST_WOODS,
/* 0xC */ GORON_DMT_FAIRY_HINT,
/* 0xD */ GORON_MARKET_BAZAAR
} GoronType;
static EnGo2DustEffectData sDustEffectData[2][4] = {
{
// default

View file

@ -47,6 +47,30 @@ typedef struct EnGo2DustEffectData {
f32 yAccel;
} EnGo2DustEffectData; // size = 0x18
typedef enum GoronType {
/* 0x0 */ GORON_CITY_HOT_RODDER,
/* 0x1 */ GORON_CITY_LINK,
/* 0x2 */ GORON_DMT_BIGGORON,
/* 0x3 */ GORON_FIRE_GENERIC,
/* 0x4 */ GORON_DMT_BOMB_FLOWER,
/* 0x5 */ GORON_DMT_ROLLING_SMALL,
/* 0x6 */ GORON_DMT_DC_ENTRANCE,
/* 0x7 */ GORON_CITY_ENTRANCE,
/* 0x8 */ GORON_CITY_ISLAND,
/* 0x9 */ GORON_CITY_LOWEST_FLOOR,
/* 0xA */ GORON_CITY_STAIRWELL,
/* 0xB */ GORON_CITY_LOST_WOODS,
/* 0xC */ GORON_DMT_FAIRY_HINT,
/* 0xD */ GORON_MARKET_BAZAAR
} GoronType;
#define ENGO2_GET_TYPE(this) PARAMS_GET_S((this)->actor.params, 0, 5)
#define ENGO2_GET_PATH_INDEX(this) PARAMS_GET_S((this)->actor.params, 5, 5)
#define ENGO2_CAGED_SWITCH_FLAG(this) PARAMS_GET_S((this)->actor.params, 10, 6)
#define ENGO2_PATH_INDEX_MAX NBITS_TO_MASK(5)
#define ENGO2_IS_CAGE_OPEN(play, this) Flags_GetSwitch(play, ENGO2_CAGED_SWITCH_FLAG(this))
#define EN_GO2_EFFECT_COUNT 10
typedef struct EnGo2 {