2022-03-21 21:51:23 -04:00
|
|
|
/*
|
|
|
|
* File: z_bg_spot07_taki.c
|
|
|
|
* Overlay: ovl_Bg_Spot07_Taki
|
|
|
|
* Description: Zora's Domain Waterfall and Ice
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "z_bg_spot07_taki.h"
|
|
|
|
#include "objects/object_spot07_object/object_spot07_object.h"
|
|
|
|
|
2023-05-30 15:05:04 -04:00
|
|
|
#define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED)
|
2022-03-21 21:51:23 -04:00
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
void BgSpot07Taki_Init(Actor* thisx, PlayState* play);
|
|
|
|
void BgSpot07Taki_Destroy(Actor* thisx, PlayState* play);
|
|
|
|
void BgSpot07Taki_Update(Actor* thisx, PlayState* play);
|
|
|
|
void BgSpot07Taki_Draw(Actor* thisx, PlayState* play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
void BgSpot07Taki_DoNothing(BgSpot07Taki* this, PlayState* play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
const ActorInit Bg_Spot07_Taki_InitVars = {
|
|
|
|
ACTOR_BG_SPOT07_TAKI,
|
|
|
|
ACTORCAT_BG,
|
|
|
|
FLAGS,
|
|
|
|
OBJECT_SPOT07_OBJECT,
|
|
|
|
sizeof(BgSpot07Taki),
|
|
|
|
(ActorFunc)BgSpot07Taki_Init,
|
|
|
|
(ActorFunc)BgSpot07Taki_Destroy,
|
|
|
|
(ActorFunc)BgSpot07Taki_Update,
|
|
|
|
(ActorFunc)BgSpot07Taki_Draw,
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
|
|
|
|
static InitChainEntry sInitChain[] = {
|
|
|
|
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
|
|
|
|
};
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
void BgSpot07Taki_Init(Actor* thisx, PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
BgSpot07Taki* this = (BgSpot07Taki*)thisx;
|
|
|
|
s32 pad;
|
|
|
|
CollisionHeader* colHeader = NULL;
|
|
|
|
|
|
|
|
DynaPolyActor_Init(&this->dyna, DPM_PLAYER);
|
|
|
|
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
|
|
|
if (LINK_IS_ADULT) {
|
|
|
|
if (this->dyna.actor.params == 0) {
|
|
|
|
CollisionHeader_GetVirtual(&object_spot07_object_Col_002590, &colHeader);
|
|
|
|
} else {
|
|
|
|
CollisionHeader_GetVirtual(&object_spot07_object_Col_0038FC, &colHeader);
|
|
|
|
}
|
2022-11-06 03:24:34 -05:00
|
|
|
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
|
2022-03-21 21:51:23 -04:00
|
|
|
}
|
|
|
|
this->actionFunc = BgSpot07Taki_DoNothing;
|
|
|
|
}
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
void BgSpot07Taki_Destroy(Actor* thisx, PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
BgSpot07Taki* this = (BgSpot07Taki*)thisx;
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
|
2022-03-21 21:51:23 -04:00
|
|
|
}
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
void BgSpot07Taki_DoNothing(BgSpot07Taki* this, PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
}
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
void BgSpot07Taki_Update(Actor* thisx, PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
BgSpot07Taki* this = (BgSpot07Taki*)thisx;
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
this->actionFunc(this, play);
|
2022-03-21 21:51:23 -04:00
|
|
|
}
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
void BgSpot07Taki_Draw(Actor* thisx, PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
BgSpot07Taki* this = (BgSpot07Taki*)thisx;
|
|
|
|
u32 frames;
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
OPEN_DISPS(play->state.gfxCtx);
|
|
|
|
frames = play->gameplayFrames;
|
2022-03-21 21:51:23 -04:00
|
|
|
if (LINK_IS_ADULT) {
|
2022-11-29 18:29:36 -05:00
|
|
|
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
2022-11-06 03:24:34 -05:00
|
|
|
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
|
2022-03-21 21:51:23 -04:00
|
|
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
|
|
|
if (this->dyna.actor.params == 0) {
|
|
|
|
gSPDisplayList(POLY_OPA_DISP++, object_spot07_object_DL_001CF0);
|
|
|
|
} else {
|
|
|
|
gSPDisplayList(POLY_OPA_DISP++, object_spot07_object_DL_003210);
|
|
|
|
}
|
|
|
|
}
|
2022-11-29 18:29:36 -05:00
|
|
|
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
|
2022-03-21 21:51:23 -04:00
|
|
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
|
|
|
|
|
|
|
gSPSegment(POLY_XLU_DISP++, 0x08,
|
2022-11-06 03:24:34 -05:00
|
|
|
Gfx_TwoTexScroll(play->state.gfxCtx, 0, ((frames * -1) & 0x7F), ((frames * 1) & 0x7F), 32, 32, 1,
|
2022-03-21 21:51:23 -04:00
|
|
|
((frames * 1) & 0x7F), ((frames * 1) & 0x7F), 32, 32));
|
|
|
|
|
|
|
|
if (!LINK_IS_ADULT) {
|
|
|
|
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 128);
|
|
|
|
if (this->dyna.actor.params == 0) {
|
|
|
|
gSPSegment(POLY_XLU_DISP++, 0x09,
|
2022-11-06 03:24:34 -05:00
|
|
|
Gfx_TwoTexScroll(play->state.gfxCtx, 0, ((frames * -1) & 0x7F), ((frames * -3) & 0xFF), 64,
|
2022-03-21 21:51:23 -04:00
|
|
|
64, 1, ((frames * 1) & 0x7F), ((frames * -3) & 0xFF), 64, 64));
|
|
|
|
gSPSegment(POLY_XLU_DISP++, 0x0A,
|
2022-11-06 03:24:34 -05:00
|
|
|
Gfx_TwoTexScroll(play->state.gfxCtx, 0, frames * 0, ((frames * 3) & 0x1FF), 32, 128, 1,
|
2022-03-21 21:51:23 -04:00
|
|
|
frames * 0, ((frames * 3) & 0x1FF), 32, 128));
|
|
|
|
gSPDisplayList(POLY_XLU_DISP++, object_spot07_object_DL_000460);
|
|
|
|
} else {
|
|
|
|
gSPSegment(POLY_XLU_DISP++, 0x09,
|
2022-11-06 03:24:34 -05:00
|
|
|
Gfx_TwoTexScroll(play->state.gfxCtx, 0, frames * 0, ((frames * -1) & 0x7F), 32, 32, 1,
|
2022-03-21 21:51:23 -04:00
|
|
|
frames * 0, ((frames * -1) & 0x7F), 32, 32));
|
|
|
|
gSPSegment(POLY_XLU_DISP++, 0x0A,
|
2022-11-06 03:24:34 -05:00
|
|
|
Gfx_TwoTexScroll(play->state.gfxCtx, 0, frames * 0, ((frames * 3) & 0x1FF), 32, 128, 1,
|
2022-03-21 21:51:23 -04:00
|
|
|
frames * 0, ((frames * 3) & 0x1FF), 32, 128));
|
|
|
|
gSPDisplayList(POLY_XLU_DISP++, object_spot07_object_DL_000BE0);
|
|
|
|
}
|
|
|
|
} else if (this->dyna.actor.params == 0) {
|
|
|
|
gSPDisplayList(POLY_XLU_DISP++, object_spot07_object_DL_001F68);
|
|
|
|
} else {
|
|
|
|
gSPDisplayList(POLY_XLU_DISP++, object_spot07_object_DL_0032D8);
|
|
|
|
}
|
2022-11-06 03:24:34 -05:00
|
|
|
CLOSE_DISPS(play->state.gfxCtx);
|
2022-03-21 21:51:23 -04:00
|
|
|
}
|