mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-10 04:53:27 -04:00
Bg_Open_Spot OK (#783)
* Fully Matched Bg_Open_Spot * addressing review comments variable names inline with convension variable naming clarity * remove redundant return. change padding type * texScroll to texScrolls
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* File: z_bg_open_spot.c
|
||||
* Overlay: ovl_Bg_Open_Spot
|
||||
* Description: Star Light Rays in Intro Scene
|
||||
* Description: Spotlights that shine on the Skull Kid when he turns Link
|
||||
* into a Deku Scrub.
|
||||
*/
|
||||
|
||||
#include "z_bg_open_spot.h"
|
||||
#include "objects/object_open_obj/object_open_obj.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10)
|
||||
|
||||
@@ -13,8 +14,8 @@
|
||||
void BgOpenSpot_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BgOpenSpot_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BgOpenSpot_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BgOpenSpot_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
#if 0
|
||||
const ActorInit Bg_Open_Spot_InitVars = {
|
||||
ACTOR_BG_OPEN_SPOT,
|
||||
ACTORCAT_PROP,
|
||||
@@ -27,25 +28,49 @@ const ActorInit Bg_Open_Spot_InitVars = {
|
||||
(ActorFunc)NULL,
|
||||
};
|
||||
|
||||
// static InitChainEntry sInitChain[] = {
|
||||
static InitChainEntry D_80ACB3B0[] = {
|
||||
static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32(uncullZoneScale, 560, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32(uncullZoneDownward, 800, ICHAIN_CONTINUE),
|
||||
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
#endif
|
||||
void BgOpenSpot_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgOpenSpot* this = THIS;
|
||||
|
||||
extern InitChainEntry D_80ACB3B0[];
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
this->texScrolls = Lib_SegmentedToVirtual(gSpotlightTexAnim);
|
||||
}
|
||||
|
||||
extern UNK_TYPE D_06001A60;
|
||||
extern UNK_TYPE D_06002CE0;
|
||||
void BgOpenSpot_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Open_Spot/BgOpenSpot_Init.s")
|
||||
void BgOpenSpot_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgOpenSpot* this = THIS;
|
||||
u32 action;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Open_Spot/BgOpenSpot_Destroy.s")
|
||||
if (Cutscene_CheckActorAction(globalCtx, 0x7D)) {
|
||||
action = globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 0x7D)]->action;
|
||||
if (action == 1) {
|
||||
this->actor.draw = NULL;
|
||||
} else if (action == 2) {
|
||||
this->actor.draw = BgOpenSpot_Draw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Open_Spot/BgOpenSpot_Update.s")
|
||||
void BgOpenSpot_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
BgOpenSpot* this = (BgOpenSpot*)thisx;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Open_Spot/func_80ACB2B0.s")
|
||||
AnimatedMat_Draw(globalCtx, this->texScrolls);
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gDPSetColorDither(POLY_XLU_DISP++, G_CD_BAYER);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gSpotlightLeftDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gSpotlightRightDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ struct BgOpenSpot;
|
||||
|
||||
typedef struct BgOpenSpot {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ char unk_144[0x4];
|
||||
/* 0x144 */ AnimatedMaterial* texScrolls;
|
||||
} BgOpenSpot; // size = 0x148
|
||||
|
||||
extern const ActorInit Bg_Open_Spot_InitVars;
|
||||
|
||||
Reference in New Issue
Block a user