mirror of https://github.com/zeldaret/mm.git
Obj_kinoko OK (#646)
* z_obj_kinoko OK * fixing DL and changing to thisx * naming display list * minor fix * fixing PR suggestions * addressing PR * reverting name and leaving a comment
This commit is contained in:
parent
0e6cf608d2
commit
249871642f
|
@ -935,7 +935,7 @@
|
|||
<DList Name="gameplay_keep_DL_029BE8" Offset="0x29BE8" />
|
||||
<DList Name="gameplay_keep_DL_029CB0" Offset="0x29CB0" />
|
||||
<DList Name="gameplay_keep_DL_029CF0" Offset="0x29CF0" />
|
||||
<DList Name="gameplay_keep_DL_029D10" Offset="0x29D10" />
|
||||
<DList Name="gameplay_keep_DL_029D10" Offset="0x29D10" /> <!-- Used in ObJ_Kinoko to radiate a purple glow -->
|
||||
<Texture Name="gameplay_keep_Tex_029EF8" OutName="tex_029EF8" Format="rgba16" Width="32" Height="64" Offset="0x29EF8" />
|
||||
<Limb Name="gameplay_keep_Standardlimb_02AEF8" Type="Standard" Offset="0x2AEF8" />
|
||||
<Limb Name="gameplay_keep_Standardlimb_02AF04" Type="Standard" Offset="0x2AF04" />
|
||||
|
|
3
spec
3
spec
|
@ -4542,8 +4542,7 @@ beginseg
|
|||
name "ovl_Obj_Kinoko"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.o"
|
||||
include "build/data/ovl_Obj_Kinoko/ovl_Obj_Kinoko.data.o"
|
||||
include "build/data/ovl_Obj_Kinoko/ovl_Obj_Kinoko.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_Obj_Kinoko/ovl_Obj_Kinoko_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
*/
|
||||
|
||||
#include "z_obj_kinoko.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
#define FLAGS 0x00000010
|
||||
#define FLAGS (ACTOR_FLAG_10)
|
||||
|
||||
#define THIS ((ObjKinoko*)thisx)
|
||||
|
||||
|
@ -15,7 +16,6 @@ void ObjKinoko_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|||
void ObjKinoko_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjKinoko_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
#if 0
|
||||
const ActorInit Obj_Kinoko_InitVars = {
|
||||
ACTOR_OBJ_KINOKO,
|
||||
ACTORCAT_ITEMACTION,
|
||||
|
@ -28,12 +28,63 @@ const ActorInit Obj_Kinoko_InitVars = {
|
|||
(ActorFunc)ObjKinoko_Draw,
|
||||
};
|
||||
|
||||
#endif
|
||||
void ObjKinoko_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
thisx->world.pos.y += 4.0f;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kinoko/ObjKinoko_Init.s")
|
||||
void ObjKinoko_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kinoko/ObjKinoko_Destroy.s")
|
||||
void ObjKinoko_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 pad;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kinoko/ObjKinoko_Update.s")
|
||||
if (player->currentMask != PLAYER_MASK_SCENTS) {
|
||||
thisx->draw = NULL;
|
||||
thisx->hintId = 0xFF;
|
||||
thisx->flags &= ~ACTOR_FLAG_1;
|
||||
} else {
|
||||
thisx->draw = ObjKinoko_Draw;
|
||||
thisx->hintId = 0x64;
|
||||
thisx->flags |= ACTOR_FLAG_1;
|
||||
if (Actor_HasParent(thisx, globalCtx)) {
|
||||
Flags_SetCollectible(globalCtx, OBJ_KINOKO_GET_FLAG(thisx));
|
||||
Actor_MarkForDeath(thisx);
|
||||
return;
|
||||
}
|
||||
Actor_PickUp(thisx, globalCtx, GI_MAX, 20.0f, 10.0f);
|
||||
if (Math_SmoothStepToF(&thisx->speedXZ, 0.0f, 0.04f, 2.0f, 0.5f) < 0.5f) {
|
||||
thisx->scale.x = 0.0f;
|
||||
thisx->speedXZ = 110.0f;
|
||||
thisx->velocity.x = 0.2f;
|
||||
}
|
||||
if (Math_SmoothStepToF(&thisx->scale.x, thisx->velocity.x, 0.04f, 0.004f, 0.001f) <
|
||||
((thisx->velocity.x == 0.0f) ? 0.0f : 0.05f)) {
|
||||
thisx->velocity.x = 0.0f;
|
||||
}
|
||||
thisx->scale.y = thisx->scale.x;
|
||||
thisx->scale.z = thisx->scale.x;
|
||||
thisx->shape.rot.y = func_800DFCDC(globalCtx->cameraPtrs[globalCtx->activeCamera]) + 0x8000;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kinoko/ObjKinoko_Draw.s")
|
||||
void ObjKinoko_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Gfx* gfx;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
|
||||
gfx = POLY_XLU_DISP;
|
||||
gDPSetPrimColor(&gfx[0], 0, 0, 169, 63, 186, (u8)thisx->speedXZ);
|
||||
gDPSetEnvColor(&gfx[1], 110, 44, 200, 100);
|
||||
gDPSetRenderMode(&gfx[2], G_RM_PASS, G_RM_ZB_CLD_SURF2);
|
||||
gSPMatrix(&gfx[3], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(&gfx[4], &gameplay_keep_DL_029D10[2]);
|
||||
Matrix_InsertXRotation_s(-0x4000, 1);
|
||||
gSPMatrix(&gfx[5], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(&gfx[6], &gameplay_keep_DL_029D10[2]);
|
||||
POLY_XLU_DISP = &gfx[7];
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
|
|
@ -11,4 +11,6 @@ typedef struct ObjKinoko {
|
|||
|
||||
extern const ActorInit Obj_Kinoko_InitVars;
|
||||
|
||||
#define OBJ_KINOKO_GET_FLAG(thisx) ((thisx)->params & 0x7F)
|
||||
|
||||
#endif // Z_OBJ_KINOKO_H
|
||||
|
|
Loading…
Reference in New Issue