Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure event flags in z64save.h #2303

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
378 changes: 219 additions & 159 deletions include/z64save.h

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/code/z_horse.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ void func_8006D684(PlayState* play, Player* player) {
Actor_MountHorse(play, player, player->rideActor);
func_8002DE74(play, player);
gSaveContext.save.info.horseData.sceneId = play->sceneId;
} else if ((play->sceneId == SCENE_LON_LON_RANCH) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) &&
} else if ((play->sceneId == SCENE_LON_LON_RANCH) &&
(GET_EVENTINF_INGORACE_STATE() == INGORACE_STATE_TRAPPED_WIN_EPONA) &&
!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0)) {
player->rideActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5);
Expand Down Expand Up @@ -209,7 +210,7 @@ void func_8006D684(PlayState* play, Player* player) {
Vec3f sp54;
s32 temp = 0;

if (GET_EVENTINF_HORSES_HORSETYPE() != HORSE_EPONA && D_8011F9B8[i].type == 6) {
if (GET_EVENTINF_INGORACE_HORSETYPE() != HORSE_EPONA && D_8011F9B8[i].type == 6) {
temp = 0x8000;
}

Expand Down Expand Up @@ -260,7 +261,8 @@ void func_8006DC68(PlayState* play, Player* player) {
gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_13 ||
gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_15) &&
(gSaveContext.respawnFlag == 0)) ||
((play->sceneId == SCENE_LON_LON_RANCH) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) &&
((play->sceneId == SCENE_LON_LON_RANCH) &&
(GET_EVENTINF_INGORACE_STATE() == INGORACE_STATE_TRAPPED_WIN_EPONA) &&
!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0))) {
func_8006D684(play, player);
} else {
Expand Down
22 changes: 11 additions & 11 deletions src/code/z_map_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,25 +240,25 @@ static s16 sOwEntranceIconPosY[24] = {

static u16 sOwEntranceFlag[20] = {
0xFFFF,
INFTABLE_1A8_SHIFT,
INFTABLE_1A7_SHIFT,
MINIMAP_GET_INFTABLE_SHIFT(INFTABLE_1A8),
MINIMAP_GET_INFTABLE_SHIFT(INFTABLE_1A7),
0xFFFF,
INFTABLE_1A0_SHIFT,
INFTABLE_1A3_SHIFT,
INFTABLE_1A5_SHIFT,
MINIMAP_GET_INFTABLE_SHIFT(INFTABLE_1A0),
MINIMAP_GET_INFTABLE_SHIFT(INFTABLE_1A3),
MINIMAP_GET_INFTABLE_SHIFT(INFTABLE_1A5),
0xFFFF,
INFTABLE_1A2_SHIFT,
MINIMAP_GET_INFTABLE_SHIFT(INFTABLE_1A2),
0xFFFF,
0xFFFF,
INFTABLE_1A6_SHIFT,
INFTABLE_1AB_SHIFT,
MINIMAP_GET_INFTABLE_SHIFT(INFTABLE_1A6),
MINIMAP_GET_INFTABLE_SHIFT(INFTABLE_1AB),
0xFFFF,
0xFFFF,
INFTABLE_1A1_SHIFT,
INFTABLE_1A4_SHIFT,
MINIMAP_GET_INFTABLE_SHIFT(INFTABLE_1A1),
MINIMAP_GET_INFTABLE_SHIFT(INFTABLE_1A4),
0xFFFF,
0xFFFF,
INFTABLE_1AD_SHIFT,
MINIMAP_GET_INFTABLE_SHIFT(INFTABLE_1AD),
};

static f32 sFloorCoordY[10][8] = {
Expand Down
5 changes: 2 additions & 3 deletions src/code/z_map_exp.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ void Minimap_Draw(PlayState* play) {
(LINK_AGE_IN_YEARS != YEARS_ADULT)) {
if ((gMapData->owEntranceFlag[sEntranceIconMapIndex] == 0xFFFF) ||
((gMapData->owEntranceFlag[sEntranceIconMapIndex] != 0xFFFF) &&
(gSaveContext.save.info.infTable[INFTABLE_1AX_INDEX] &
(gSaveContext.save.info.infTable[INFTABLE_OVERWORLD_ENTRANCE_ICON_INDEX] &
gBitFlags[gMapData->owEntranceFlag[mapIndex]]))) {

gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b,
Expand All @@ -512,8 +512,7 @@ void Minimap_Draw(PlayState* play) {
}
}

if ((play->sceneId == SCENE_ZORAS_FOUNTAIN) &&
(gSaveContext.save.info.infTable[INFTABLE_1AX_INDEX] & gBitFlags[INFTABLE_1A9_SHIFT])) {
if ((play->sceneId == SCENE_ZORAS_FOUNTAIN) && (MINIMAP_GET_INFTABLE(INFTABLE_1A9))) {
gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8,
8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
Expand Down
4 changes: 2 additions & 2 deletions src/code/z_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -3444,7 +3444,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
if (msgCtx->disableWarpSongs || interfaceCtx->restrictions.warpSongs == 3) {
Message_StartTextbox(play, 0x88C, NULL); // "You can't warp here!"
play->msgCtx.ocarinaMode = OCARINA_MODE_04;
} else if (GET_EVENTINF_HORSES_STATE() != EVENTINF_HORSES_STATE_1) {
} else if (GET_EVENTINF_INGORACE_STATE() != INGORACE_STATE_HORSE_RENTAL_PERIOD) {
Message_StartTextbox(play, msgCtx->lastPlayedSong + 0x88D,
NULL); // "Warp to [place name]?"
play->msgCtx.ocarinaMode = OCARINA_MODE_01;
Expand Down Expand Up @@ -4247,7 +4247,7 @@ void Message_Update(PlayState* play) {
if (Message_ShouldAdvance(play)) {
PRINTF("OCARINA_MODE=%d -> ", play->msgCtx.ocarinaMode);
play->msgCtx.ocarinaMode = (msgCtx->choiceIndex == 0) ? OCARINA_MODE_02 : OCARINA_MODE_04;
PRINTF("InRaceSeq=%d(%d) OCARINA_MODE=%d --> ", GET_EVENTINF_HORSES_STATE(), 1,
PRINTF("InRaceSeq=%d(%d) OCARINA_MODE=%d --> ", GET_EVENTINF_INGORACE_STATE(), 1,
play->msgCtx.ocarinaMode);
Message_CloseTextbox(play);
PRINTF("OCARINA_MODE=%d\n", play->msgCtx.ocarinaMode);
Expand Down
8 changes: 3 additions & 5 deletions src/code/z_parameter.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ void func_80083108(PlayState* play) {
gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE;
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL);
}
} else if (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_1) {
} else if (GET_EVENTINF_INGORACE_STATE() == INGORACE_STATE_HORSE_RENTAL_PERIOD) {
if (player->stateFlags1 & PLAYER_STATE1_23) {
if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) &&
(gSaveContext.save.info.equips.buttonItems[0] != ITEM_BOW)) {
Expand Down Expand Up @@ -3543,10 +3543,8 @@ void Interface_Draw(PlayState* play) {
for (svar1 = 0; svar1 < ARRAY_COUNT(gSpoilingItems); svar1++) {
if (INV_CONTENT(ITEM_TRADE_ADULT) == gSpoilingItems[svar1]) {
#if OOT_VERSION >= NTSC_1_1
gSaveContext.eventInf[EVENTINF_HORSES_INDEX] &=
(u16) ~(EVENTINF_HORSES_STATE_MASK | EVENTINF_HORSES_HORSETYPE_MASK | EVENTINF_HORSES_05_MASK |
EVENTINF_HORSES_06_MASK | EVENTINF_HORSES_0F_MASK);
PRINTF("EVENT_INF=%x\n", gSaveContext.eventInf[EVENTINF_HORSES_INDEX]);
RESET_EVENTINF_INGORACE();
PRINTF("EVENT_INF=%x\n", gSaveContext.eventInf[EVENTINF_INGORACE_INDEX]);
#endif
play->nextEntranceIndex = spoilingItemEntrances[svar1];
INV_CONTENT(gSpoilingItemReverts[svar1]) = gSpoilingItemReverts[svar1];
Expand Down
11 changes: 9 additions & 2 deletions src/code/z_sram.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,15 @@ void Sram_InitDebugSave(void) {
gSaveContext.save.info.horseData.pos.y = 72;
gSaveContext.save.info.horseData.pos.z = 5497;
gSaveContext.save.info.horseData.angle = -0x6AD9;
gSaveContext.save.info.infTable[0] |= 0x5009;
gSaveContext.save.info.eventChkInf[0] |= 0x123F;
gSaveContext.save.info.infTable[0] |= GET_INFTABLE_MASK(INFTABLE_00) | GET_INFTABLE_MASK(INFTABLE_03) |
GET_INFTABLE_MASK(INFTABLE_0C) | GET_INFTABLE_MASK(INFTABLE_0E);

gSaveContext.save.info.eventChkInf[0] |=
GET_EVENTCHKINF_MASK(EVENTCHKINF_00_UNUSED) | GET_EVENTCHKINF_MASK(EVENTCHKINF_01_UNUSED) |
GET_EVENTCHKINF_MASK(EVENTCHKINF_02) | GET_EVENTCHKINF_MASK(EVENTCHKINF_03) |
GET_EVENTCHKINF_MASK(EVENTCHKINF_04) | GET_EVENTCHKINF_MASK(EVENTCHKINF_05) |
GET_EVENTCHKINF_MASK(EVENTCHKINF_09) | GET_EVENTCHKINF_MASK(EVENTCHKINF_0C);

SET_EVENTCHKINF(EVENTCHKINF_80);
SET_EVENTCHKINF(EVENTCHKINF_C4);

Expand Down
11 changes: 6 additions & 5 deletions src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,17 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) {
if (play->sceneId != SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) {
switch (this->fountainType) {
case FAIRY_SPELL_FARORES_WIND:
if (!GET_ITEMGETINF(ITEMGETINF_18)) {
if (!GET_ITEMGETINF(ITEMGETINF_FARORES_WIND)) {
givingReward = true;
}
break;
case FAIRY_SPELL_DINS_FIRE:
if (!GET_ITEMGETINF(ITEMGETINF_19)) {
if (!GET_ITEMGETINF(ITEMGETINF_DINS_FIRE)) {
givingReward = true;
}
break;
case FAIRY_SPELL_NAYRUS_LOVE:
if (!GET_ITEMGETINF(ITEMGETINF_1A)) {
if (!GET_ITEMGETINF(ITEMGETINF_NAYRUS_LOVE)) {
givingReward = true;
}
break;
Expand Down Expand Up @@ -696,7 +696,8 @@ static s16 sDemoEffectLightColors[] = { DEMO_EFFECT_LIGHT_GREEN, DEMO_EFFECT_LIG

static s16 sExItemTypes[] = { EXITEM_MAGIC_WIND, EXITEM_MAGIC_FIRE, EXITEM_MAGIC_DARK };

static s16 sItemGetFlags[] = { ITEMGETINF_18_MASK, ITEMGETINF_19_MASK, ITEMGETINF_1A_MASK };
static s16 sItemGetFlags[] = { GET_ITEMGETINF_MASK(ITEMGETINF_FARORES_WIND), GET_ITEMGETINF_MASK(ITEMGETINF_DINS_FIRE),
GET_ITEMGETINF_MASK(ITEMGETINF_NAYRUS_LOVE) };

static u8 sItemIds[] = { ITEM_FARORES_WIND, ITEM_DINS_FIRE, ITEM_NAYRUS_LOVE };

Expand Down Expand Up @@ -808,7 +809,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
this->itemSpawned = true;
gSaveContext.healthAccumulator = 0x140;
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_HEARTS_MAGIC);
gSaveContext.save.info.itemGetInf[ITEMGETINF_18_19_1A_INDEX] |= sItemGetFlags[cueIdTemp];
gSaveContext.save.info.itemGetInf[ITEMGETINF_GREAT_FAIRY_ITEM_INDEX] |= sItemGetFlags[cueIdTemp];
Item_Give(play, sItemIds[cueIdTemp]);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void BgInGate_Init(Actor* thisx, PlayState* play) {

Actor_SetScale(&this->dyna.actor, 0.1f);
if ((PARAMS_GET_U(this->dyna.actor.params, 0, 1) != 0) &&
(GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6)) {
(GET_EVENTINF_INGORACE_STATE() == INGORACE_STATE_TRAPPED_WIN_EPONA)) {
play->csCtx.curFrame = 0;
BgInGate_SetupAction(this, func_80892890);
} else {
Expand Down
3 changes: 1 addition & 2 deletions src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ void BgSpot09Obj_Init(Actor* thisx, PlayState* play) {
BgSpot09Obj* this = (BgSpot09Obj*)thisx;

PRINTF("Spot09 Object [arg_data : 0x%04x](大工救出フラグ 0x%x)\n", this->dyna.actor.params,
gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] &
EVENTCHKINF_CARPENTERS_FREE_MASK_ALL);
GET_EVENTCHKINF_CARPENTERS_FREE_FLAGS());
this->dyna.actor.params &= 0xFF;
if ((this->dyna.actor.params < 0) || (this->dyna.actor.params >= 5)) {
PRINTF("Error : Spot 09 object の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot09_obj.c",
Expand Down
48 changes: 24 additions & 24 deletions src/overlays/actors/ovl_En_Daiku/z_en_daiku.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4)

#define ENDAIKU_GET_TYPE(thisx) PARAMS_GET_U((thisx)->params, 0, 2)

typedef struct EnDaikuEscapeSubCamParam {
Vec3f eyePosDeltaLocal;
s32 maxFramesActive;
Expand Down Expand Up @@ -152,13 +154,13 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) {
s32 noKill = true;
s32 isFree = false;

if (PARAMS_GET_U(this->actor.params, 0, 2) == 0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0))) {
if (ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTER_0_FREED)) {
isFree = true;
} else if (PARAMS_GET_U(this->actor.params, 0, 2) == 1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1))) {
} else if (ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTER_1_FREED)) {
isFree = true;
} else if (PARAMS_GET_U(this->actor.params, 0, 2) == 2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2))) {
} else if (ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTER_2_FREED)) {
isFree = true;
} else if (PARAMS_GET_U(this->actor.params, 0, 2) == 3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3))) {
} else if (ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTER_3_FREED)) {
isFree = true;
}

Expand Down Expand Up @@ -200,7 +202,7 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) {
this->stateFlags |= ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2;
this->actionFunc = EnDaiku_Jailed;
} else {
if (PARAMS_GET_U(this->actor.params, 0, 2) == 1 || PARAMS_GET_U(this->actor.params, 0, 2) == 3) {
if (ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE1 || ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE3) {
EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_SIT, &this->currentAnimIndex);
this->stateFlags |= ENDAIKU_STATEFLAG_1;
} else {
Expand Down Expand Up @@ -270,8 +272,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) {
if (this->stateFlags & ENDAIKU_STATEFLAG_GERUDODEFEATED) {
freedCount = 0;
for (carpenterType = 0; carpenterType < 4; carpenterType++) {
if (gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] &
EVENTCHKINF_CARPENTERS_FREE_MASK(carpenterType)) {
if (ENDAIKU_IS_CARPENTER_FREE(carpenterType)) {
freedCount++;
}
}
Expand All @@ -295,15 +296,15 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) {
this->actor.textId = 0x6007;
}
} else if (play->sceneId == SCENE_CARPENTERS_TENT) {
switch (PARAMS_GET_U(this->actor.params, 0, 2)) {
case 0:
switch (ENDAIKU_GET_TYPE(&this->actor)) {
case ENDAIKU_TYPE0:
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) {
this->actor.textId = 0x6060;
} else {
this->actor.textId = 0x605F;
}
break;
case 1:
case ENDAIKU_TYPE1:
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) {
this->actor.textId = 0x6063;
} else {
Expand All @@ -314,7 +315,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) {
}
}
break;
case 2:
case ENDAIKU_TYPE2:
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) {
this->actor.textId = 0x6066;
} else {
Expand All @@ -325,7 +326,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) {
}
}
break;
case 3:
case ENDAIKU_TYPE3:
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) {
this->actor.textId = 0x6068;
} else {
Expand Down Expand Up @@ -399,11 +400,10 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) {
EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_RUN, &this->currentAnimIndex);
this->stateFlags &= ~(ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2);

gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] |=
EVENTCHKINF_CARPENTERS_FREE_MASK(PARAMS_GET_U(this->actor.params, 0, 2));
ENDAIKU_SET_CARPENTER_FREE(ENDAIKU_GET_TYPE(&this->actor));

this->actor.gravity = -1.0f;
this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].maxFramesActive;
this->escapeSubCamTimer = sEscapeSubCamParams[ENDAIKU_GET_TYPE(&this->actor)].maxFramesActive;
EnDaiku_InitSubCamera(this, play);

exitLoop = false;
Expand Down Expand Up @@ -444,11 +444,11 @@ void EnDaiku_InitSubCamera(EnDaiku* this, PlayState* play) {
Vec3f eyePosDeltaWorld;

this->subCamActive = true;
this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].maxFramesActive;
this->escapeSubCamTimer = sEscapeSubCamParams[ENDAIKU_GET_TYPE(&this->actor)].maxFramesActive;

eyePosDeltaLocal.x = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].eyePosDeltaLocal.x;
eyePosDeltaLocal.y = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].eyePosDeltaLocal.y;
eyePosDeltaLocal.z = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].eyePosDeltaLocal.z;
eyePosDeltaLocal.x = sEscapeSubCamParams[ENDAIKU_GET_TYPE(&this->actor)].eyePosDeltaLocal.x;
eyePosDeltaLocal.y = sEscapeSubCamParams[ENDAIKU_GET_TYPE(&this->actor)].eyePosDeltaLocal.y;
eyePosDeltaLocal.z = sEscapeSubCamParams[ENDAIKU_GET_TYPE(&this->actor)].eyePosDeltaLocal.z;
Matrix_RotateY(BINANG_TO_RAD(this->actor.world.rot.y), MTXMODE_NEW);
Matrix_MultVec3f(&eyePosDeltaLocal, &eyePosDeltaWorld);

Expand Down Expand Up @@ -594,13 +594,13 @@ void EnDaiku_Draw(Actor* thisx, PlayState* play) {

Gfx_SetupDL_25Opa(play->state.gfxCtx);

if (PARAMS_GET_U(thisx->params, 0, 2) == 0) {
if (ENDAIKU_GET_TYPE(thisx) == ENDAIKU_TYPE0) {
gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255);
} else if (PARAMS_GET_U(thisx->params, 0, 2) == 1) {
} else if (ENDAIKU_GET_TYPE(thisx) == ENDAIKU_TYPE1) {
gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255);
} else if (PARAMS_GET_U(thisx->params, 0, 2) == 2) {
} else if (ENDAIKU_GET_TYPE(thisx) == ENDAIKU_TYPE2) {
gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255);
} else if (PARAMS_GET_U(thisx->params, 0, 2) == 3) {
} else if (ENDAIKU_GET_TYPE(thisx) == ENDAIKU_TYPE3) {
gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255);
}

Expand Down Expand Up @@ -637,7 +637,7 @@ void EnDaiku_PostLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3s* rot, vo

if (limb == 15) { // head
Matrix_MultVec3f(&targetPosHeadLocal, &this->actor.focus.pos);
gSPDisplayList(POLY_OPA_DISP++, hairDLists[PARAMS_GET_U(this->actor.params, 0, 2)]);
gSPDisplayList(POLY_OPA_DISP++, hairDLists[ENDAIKU_GET_TYPE(&this->actor)]);
}

CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku.c", 1330);
Expand Down
7 changes: 7 additions & 0 deletions src/overlays/actors/ovl_En_Daiku/z_en_daiku.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ struct EnDaiku;

typedef void (*EnDaikuActionFunc)(struct EnDaiku*, PlayState*);

typedef enum EnDaikuType {
ENDAIKU_TYPE0,
ENDAIKU_TYPE1,
ENDAIKU_TYPE2,
ENDAIKU_TYPE3
} EnDaikuType;

typedef struct EnDaiku {
/* 0x0000 */ Actor actor;
/* 0x014C */ SkelAnime skelAnime;
Expand Down
Loading