mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-08-13 17:03:47 -04:00
a5df9dddf0
* First batch some overlay
* Almost all overlay
* effect & gamestate
* kaleido stuffs
* more overlay
* more left over from code folder
* remaining hardcoded line and file
* Open & Close _DISP __FILE__ & __LINE__ clean up
* Some if (1) {} remove
* LOG_xxxx __FILE__ , __LINE__ cleaned
* ASSERT macro __FILE__ __LINE__
* mtx without line/file in functions
* " if (1) {} " & "if (0) {}" and tab/white place
* LogUtils as macro
* GameState_, GameAlloc_, SystemArena_ & ZeldaArena_
* Revert "GameState_, GameAlloc_, SystemArena_ & ZeldaArena_"
This reverts commit 0d85caaf7e
.
* Like last commit but as macro
* Fix matrix not using macros
* use function not macro
* DebugArena_* functions
GameAlloc_MallocDebug
BgCheck_PosErrorCheck as macros
removed issues with ; in macro file
120 lines
4.7 KiB
C
120 lines
4.7 KiB
C
/*
|
|
* 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"
|
|
|
|
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5)
|
|
|
|
void BgSpot07Taki_Init(Actor* thisx, GlobalContext* globalCtx);
|
|
void BgSpot07Taki_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|
void BgSpot07Taki_Update(Actor* thisx, GlobalContext* globalCtx);
|
|
void BgSpot07Taki_Draw(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
void BgSpot07Taki_DoNothing(BgSpot07Taki* this, GlobalContext* globalCtx);
|
|
|
|
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),
|
|
};
|
|
|
|
void BgSpot07Taki_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|
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);
|
|
}
|
|
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
|
|
}
|
|
this->actionFunc = BgSpot07Taki_DoNothing;
|
|
}
|
|
|
|
void BgSpot07Taki_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|
BgSpot07Taki* this = (BgSpot07Taki*)thisx;
|
|
|
|
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
|
}
|
|
|
|
void BgSpot07Taki_DoNothing(BgSpot07Taki* this, GlobalContext* globalCtx) {
|
|
}
|
|
|
|
void BgSpot07Taki_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|
BgSpot07Taki* this = (BgSpot07Taki*)thisx;
|
|
|
|
this->actionFunc(this, globalCtx);
|
|
}
|
|
|
|
void BgSpot07Taki_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|
BgSpot07Taki* this = (BgSpot07Taki*)thisx;
|
|
u32 frames;
|
|
|
|
OPEN_DISPS(globalCtx->state.gfxCtx);
|
|
frames = globalCtx->gameplayFrames;
|
|
if (LINK_IS_ADULT) {
|
|
func_80093D18(globalCtx->state.gfxCtx);
|
|
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
|
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);
|
|
}
|
|
}
|
|
func_80093D84(globalCtx->state.gfxCtx);
|
|
|
|
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
|
|
|
gSPSegment(POLY_XLU_DISP++, 0x08,
|
|
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, ((frames * -1) & 0x7F), ((frames * 1) & 0x7F), 32, 32, 1,
|
|
((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,
|
|
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, ((frames * -1) & 0x7F), ((frames * -3) & 0xFF), 64,
|
|
64, 1, ((frames * 1) & 0x7F), ((frames * -3) & 0xFF), 64, 64));
|
|
gSPSegment(POLY_XLU_DISP++, 0x0A,
|
|
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, frames * 0, ((frames * 3) & 0x1FF), 32, 128, 1,
|
|
frames * 0, ((frames * 3) & 0x1FF), 32, 128));
|
|
gSPDisplayList(POLY_XLU_DISP++, object_spot07_object_DL_000460);
|
|
} else {
|
|
gSPSegment(POLY_XLU_DISP++, 0x09,
|
|
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, frames * 0, ((frames * -1) & 0x7F), 32, 32, 1,
|
|
frames * 0, ((frames * -1) & 0x7F), 32, 32));
|
|
gSPSegment(POLY_XLU_DISP++, 0x0A,
|
|
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, frames * 0, ((frames * 3) & 0x1FF), 32, 128, 1,
|
|
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);
|
|
}
|
|
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
|
}
|