mirror of https://github.com/zeldaret/mm.git
ovl_Obj_Dowsing ok (#504)
* ovl_Obj_Dowsing OK * update spec * params pack * made suggested changes
This commit is contained in:
parent
78cb55ce97
commit
005fd64e41
3
spec
3
spec
|
@ -3980,8 +3980,7 @@ beginseg
|
|||
name "ovl_Obj_Dowsing"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.o"
|
||||
include "build/data/ovl_Obj_Dowsing/ovl_Obj_Dowsing.data.o"
|
||||
include "build/data/ovl_Obj_Dowsing/ovl_Obj_Dowsing.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_Obj_Dowsing/ovl_Obj_Dowsing_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
|
|
@ -14,7 +14,9 @@ void ObjDowsing_Init(Actor* thisx, GlobalContext* globalCtx);
|
|||
void ObjDowsing_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjDowsing_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
#if 0
|
||||
s32 ObjDowsing_GetFlag(ObjDowsing* this, GlobalContext* globalCtx);
|
||||
s32 ObjDowsing_CheckValidSpawn(ObjDowsing* this, GlobalContext* globalCtx);
|
||||
|
||||
const ActorInit Obj_Dowsing_InitVars = {
|
||||
ACTOR_OBJ_DOWSING,
|
||||
ACTORCAT_ITEMACTION,
|
||||
|
@ -27,14 +29,42 @@ const ActorInit Obj_Dowsing_InitVars = {
|
|||
(ActorFunc)NULL,
|
||||
};
|
||||
|
||||
#endif
|
||||
s32 ObjDowsing_GetFlag(ObjDowsing* this, GlobalContext* globalCtx) {
|
||||
s32 type = DOWSING_GET_TYPE(&this->actor);
|
||||
s32 flag = DOWSING_GET_FLAG(&this->actor);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dowsing/func_80B23D50.s")
|
||||
if (type == DOWSING_COLLECTIBLE) {
|
||||
return Actor_GetCollectibleFlag(globalCtx, flag);
|
||||
} else if (type == DOWSING_CHEST) {
|
||||
return Actor_GetChestFlag(globalCtx, flag);
|
||||
} else if (type == DOWSING_SWITCH) {
|
||||
return Flags_GetSwitch(globalCtx, flag);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dowsing/func_80B23DD0.s")
|
||||
s32 ObjDowsing_CheckValidSpawn(ObjDowsing* this, GlobalContext* globalCtx) {
|
||||
if (ObjDowsing_GetFlag(this, globalCtx)) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dowsing/ObjDowsing_Init.s")
|
||||
void ObjDowsing_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjDowsing* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dowsing/ObjDowsing_Destroy.s")
|
||||
ObjDowsing_CheckValidSpawn(this, globalCtx);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dowsing/ObjDowsing_Update.s")
|
||||
void ObjDowsing_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void ObjDowsing_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjDowsing* this = THIS;
|
||||
|
||||
if (!ObjDowsing_CheckValidSpawn(this, globalCtx)) {
|
||||
func_800B8C50(thisx, globalCtx);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,17 @@
|
|||
|
||||
#include "global.h"
|
||||
|
||||
#define DOWSING_GET_TYPE(thisx) ((thisx)->params >> 7)
|
||||
#define DOWSING_GET_FLAG(thisx) ((thisx)->params & 0x7F)
|
||||
|
||||
struct ObjDowsing;
|
||||
|
||||
typedef enum {
|
||||
/* 1 */ DOWSING_COLLECTIBLE = 1,
|
||||
/* 2 */ DOWSING_CHEST,
|
||||
/* 3 */ DOWSING_SWITCH
|
||||
} DowsingType;
|
||||
|
||||
typedef struct ObjDowsing {
|
||||
/* 0x000 */ Actor actor;
|
||||
} ObjDowsing; // size = 0x144
|
||||
|
|
Loading…
Reference in New Issue