1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-17 04:20:44 +00:00

Even more objects (#913)

* malon adult limbs and enum

* malon adult animations

* Malon Adult textures

* Object_ma2 OK

* Cleanup undefined syms file

* more cleanup

* object_in OK

* change

* Object_TA limbs and Limb DLs ok

* Textures in DLs OK

* Object TA animations OK

* Object TA OK

* clean up the xml

* almost done with impa textures

* name impa draw funcs

* fix globalCtx2 in talon_init

* more progress in impa

* eye texture stuff

* impa OK

* remove files

* fix messed up merge

* Switch MA2 blink timer from hex

* Name a function

* Fix skelanime fixer

* Missing malon adult TLUT

* add some missing symbols in DemoEc

* Fix conflicts, part2

* Clean up TLUT related stuff and some minor things

* Remove unused externs from z_demo_ec

* Remove unused symbols from undefined_syms.txt

* PR fixes (Dragorn)

* Dragorn fixes

* Fix various texture-related issues in object_link_child

* Update assets/xml/objects/object_in.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update assets/xml/objects/object_ta.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update assets/xml/objects/object_ta.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update assets/xml/objects/object_ta.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update assets/xml/objects/object_ta.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update assets/xml/objects/object_in.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update assets/xml/objects/object_in.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update assets/xml/objects/object_in.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update assets/xml/objects/object_in.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update assets/xml/objects/object_in.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* fix ingo and the rest of Dragorns fix

* impa fixes

* fix ingo again

* fix windmill man missing TLUT

* Fix impa in viewer

* Roman's fixes

* Add limb

* Missed an animation

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
louist103 2021-11-24 13:37:36 -05:00 committed by GitHub
parent 0f58b15b27
commit 665283432b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
86 changed files with 1568 additions and 1452 deletions

View file

@ -29,7 +29,7 @@ void func_80985830(DemoIm* this, GlobalContext* globalCtx);
void func_80985C10(DemoIm* this, GlobalContext* globalCtx);
void func_80985C40(DemoIm* this, GlobalContext* globalCtx);
void func_80985C94(DemoIm* this, GlobalContext* globalCtx);
void func_80985CE8(DemoIm* this, GlobalContext* globalCtx);
void DemoIm_DrawTranslucent(DemoIm* this, GlobalContext* globalCtx);
void func_809863BC(DemoIm* this, GlobalContext* globalCtx);
void func_809863DC(DemoIm* this, GlobalContext* globalCtx);
void func_80986430(DemoIm* this, GlobalContext* globalCtx);
@ -51,13 +51,13 @@ void func_80987288(DemoIm* this, GlobalContext* globalCtx);
void func_809872A8(DemoIm* this, GlobalContext* globalCtx);
void func_809872F0(DemoIm* this, GlobalContext* globalCtx);
void func_80987330(DemoIm* this, GlobalContext* globalCtx);
void func_8098764C(DemoIm* this, GlobalContext* globalCtx);
void func_80987658(DemoIm* this, GlobalContext* globalCtx);
void DemoIm_DrawNothing(DemoIm* this, GlobalContext* globalCtx);
void DemoIm_DrawSolid(DemoIm* this, GlobalContext* globalCtx);
static void* D_80987830[] = {
0x06007210,
0x06007D50,
0x06008150,
static void* sEyeTextures[] = {
gImpaEyeOpenTex,
gImpaEyeHalfTex,
gImpaEyeClosedTex,
};
static u32 D_8098783C = 0;
@ -87,9 +87,9 @@ static DemoImActionFunc sActionFuncs[] = {
static Vec3f D_809887D8 = { 0.0f, 10.0f, 0.0f };
static DemoImDrawFunc sDrawFuncs[] = {
func_8098764C,
func_80987658,
func_80985CE8,
DemoIm_DrawNothing,
DemoIm_DrawSolid,
DemoIm_DrawTranslucent,
};
const ActorInit Demo_Im_InitVars = {
@ -106,23 +106,23 @@ const ActorInit Demo_Im_InitVars = {
void func_80984BE0(DemoIm* this) {
s32 pad[3];
s16* unk_25E = &this->unk_25E;
s16* unk_25C = &this->unk_25C;
s16* blinkTimer = &this->blinkTimer;
s16* eyeIndex = &this->eyeIndex;
if (DECR(*unk_25E) == 0) {
*unk_25E = Rand_S16Offset(0x3C, 0x3C);
if (DECR(*blinkTimer) == 0) {
*blinkTimer = Rand_S16Offset(60, 60);
}
*unk_25C = *unk_25E;
if (*unk_25C >= 3) {
*unk_25C = 0;
*eyeIndex = *blinkTimer;
if (*eyeIndex >= 3) {
*eyeIndex = 0;
}
}
void func_80984C68(DemoIm* this) {
this->action = 7;
this->drawConfig = 0;
this->unk_26C = 0;
this->alpha = 0;
this->unk_270 = 0;
this->actor.shape.shadowAlpha = 0;
this->unk_268 = 0.0f;
@ -145,20 +145,20 @@ void func_80984C8C(DemoIm* this, GlobalContext* globalCtx) {
}
}
void func_80984D00(Actor* thisx, GlobalContext* globalCtx) {
void DemoIm_InitCollider(Actor* thisx, GlobalContext* globalCtx) {
DemoIm* this = THIS;
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit);
}
void func_80984D4C(Actor* thisx, GlobalContext* globalCtx) {
void DemoIm_DestroyCollider(Actor* thisx, GlobalContext* globalCtx) {
DemoIm* this = THIS;
Collider_DestroyCylinder(globalCtx, &this->collider);
}
void func_80984D74(DemoIm* this, GlobalContext* globalCtx) {
void DemoIm_UpdateCollider(DemoIm* this, GlobalContext* globalCtx) {
s32 pad[5];
Collider_UpdateCylinder(&this->actor, &this->collider);
@ -207,55 +207,56 @@ void func_80984F94(DemoIm* this, GlobalContext* globalCtx) {
func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, 4);
}
void func_80985018(DemoIm* this, GlobalContext* globalCtx) {
void DemoIm_UpdateBgCheckInfo(DemoIm* this, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5);
}
s32 func_80985060(DemoIm* this) {
s32 DemoIm_UpdateSkelAnime(DemoIm* this) {
return SkelAnime_Update(&this->skelAnime);
}
s32 func_80985080(GlobalContext* globalCtx) {
s32 DemoIm_IsCsStateIdle(GlobalContext* globalCtx) {
if (globalCtx->csCtx.state == CS_STATE_IDLE) {
return 1;
return true;
} else {
return false;
}
return 0;
}
CsCmdActorAction* func_809850A0(GlobalContext* globalCtx, s32 actionIdx) {
CsCmdActorAction* DemoIm_GetNpcAction(GlobalContext* globalCtx, s32 actionIdx) {
s32 pad[2];
CsCmdActorAction* ret = NULL;
if (!func_80985080(globalCtx)) {
if (!DemoIm_IsCsStateIdle(globalCtx)) {
ret = globalCtx->csCtx.npcActions[actionIdx];
}
return ret;
}
s32 func_809850E8(DemoIm* this, GlobalContext* globalCtx, u16 action, s32 actionIdx) {
CsCmdActorAction* npcAction = func_809850A0(globalCtx, actionIdx);
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, actionIdx);
if (npcAction != NULL) {
if (npcAction->action == action) {
return 1;
return true;
}
}
return 0;
return false;
}
s32 func_80985134(DemoIm* this, GlobalContext* globalCtx, u16 action, s32 actionIdx) {
CsCmdActorAction* npcAction = func_809850A0(globalCtx, actionIdx);
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, actionIdx);
if (npcAction != NULL) {
if (npcAction->action != action) {
return 1;
return true;
}
}
return 0;
return false;
}
void func_80985180(DemoIm* this, GlobalContext* globalCtx, s32 actionIdx) {
CsCmdActorAction* npcAction = func_809850A0(globalCtx, actionIdx);
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, actionIdx);
if (npcAction != NULL) {
this->actor.world.pos.x = npcAction->startPos.x;
@ -266,7 +267,7 @@ void func_80985180(DemoIm* this, GlobalContext* globalCtx, s32 actionIdx) {
}
void func_80985200(DemoIm* this, GlobalContext* globalCtx, s32 actionIdx) {
CsCmdActorAction* npcAction = func_809850A0(globalCtx, actionIdx);
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, actionIdx);
if (npcAction != NULL) {
this->actor.world.pos.x = npcAction->startPos.x;
@ -276,27 +277,28 @@ void func_80985200(DemoIm* this, GlobalContext* globalCtx, s32 actionIdx) {
}
}
void func_80985280(DemoIm* this, AnimationHeader* animHeaderSeg, u8 arg2, f32 transitionRate, s32 arg4) {
void DemoIm_ChangeAnim(DemoIm* this, AnimationHeader* animHeaderSeg, u8 animMode, f32 transitionRate,
s32 playBackwards) {
f32 frameCount = Animation_GetLastFrame(animHeaderSeg);
f32 playbackSpeed;
f32 unk0;
f32 fc;
f32 startFrame;
f32 endFrame;
if (arg4 == 0) {
unk0 = 0.0f;
fc = frameCount;
if (!playBackwards) {
startFrame = 0.0f;
endFrame = frameCount;
playbackSpeed = 1.0f;
} else {
fc = 0.0f;
unk0 = frameCount;
endFrame = 0.0f;
startFrame = frameCount;
playbackSpeed = -1.0f;
}
Animation_Change(&this->skelAnime, animHeaderSeg, playbackSpeed, unk0, fc, arg2, transitionRate);
Animation_Change(&this->skelAnime, animHeaderSeg, playbackSpeed, startFrame, endFrame, animMode, transitionRate);
}
void func_80985310(DemoIm* this, GlobalContext* globalCtx) {
func_80985280(this, &object_im_Anim_001868, 0, 0.0f, 0);
DemoIm_ChangeAnim(this, &gImpaIdleAnim, ANIMMODE_LOOP, 0.0f, false);
this->actor.shape.yOffset = -10000.0f;
}
@ -341,8 +343,8 @@ void func_8098544C(DemoIm* this, GlobalContext* globalCtx) {
void func_809854DC(DemoIm* this, GlobalContext* globalCtx) {
if ((globalCtx->csCtx.state != CS_STATE_IDLE) && (globalCtx->csCtx.npcActions[5] != NULL) &&
(globalCtx->csCtx.npcActions[5]->action == 2)) {
Animation_Change(&this->skelAnime, &object_im_Anim_001868, 1.0f, 0.0f,
Animation_GetLastFrame(&object_im_Anim_001868), ANIMMODE_LOOP, 0.0f);
Animation_Change(&this->skelAnime, &gImpaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaIdleAnim),
ANIMMODE_LOOP, 0.0f);
this->action = 2;
this->drawConfig = 1;
func_80985358(this, globalCtx);
@ -359,16 +361,16 @@ void func_8098557C(DemoIm* this) {
void func_809855A8(DemoIm* this, GlobalContext* globalCtx) {
if ((globalCtx->csCtx.state != CS_STATE_IDLE) && (globalCtx->csCtx.npcActions[5] != NULL) &&
(globalCtx->csCtx.npcActions[5]->action == 3)) {
Animation_Change(&this->skelAnime, &object_im_Anim_000710, 1.0f, 0.0f,
Animation_GetLastFrame(&object_im_Anim_000710), ANIMMODE_ONCE, 4.0f);
Animation_Change(&this->skelAnime, &gImpaRaiseArmsAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaRaiseArmsAnim),
ANIMMODE_ONCE, 4.0f);
this->action = 4;
}
}
void func_80985640(DemoIm* this, s32 arg1) {
if (arg1 != 0) {
Animation_Change(&this->skelAnime, &object_im_Anim_000AFC, 1.0f, 0.0f,
Animation_GetLastFrame(&object_im_Anim_000AFC), ANIMMODE_LOOP, 0.0f);
Animation_Change(&this->skelAnime, &gImpaPresentShadowMedallionAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gImpaPresentShadowMedallionAnim), ANIMMODE_LOOP, 0.0f);
this->action = 5;
}
}
@ -391,14 +393,14 @@ void func_80985718(DemoIm* this, GlobalContext* globalCtx) {
void func_80985738(DemoIm* this, GlobalContext* globalCtx) {
func_80985430(this, globalCtx);
func_80985060(this);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_8098557C(this);
}
void func_80985770(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_809855A8(this, globalCtx);
}
@ -406,27 +408,27 @@ void func_80985770(DemoIm* this, GlobalContext* globalCtx) {
void func_809857B0(DemoIm* this, GlobalContext* globalCtx) {
s32 sp1C;
func_80985018(this, globalCtx);
sp1C = func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
sp1C = DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80985640(this, sp1C);
}
void func_809857F0(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_809856AC(this, globalCtx);
}
void func_80985830(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
}
void func_80985860(DemoIm* this, GlobalContext* globalCtx) {
func_80985280(this, &object_im_Anim_001868, 0, 0.0f, 0);
DemoIm_ChangeAnim(this, &gImpaIdleAnim, ANIMMODE_LOOP, 0.0f, false);
this->action = 7;
this->actor.shape.shadowAlpha = 0;
}
@ -435,18 +437,18 @@ void func_809858A8(void) {
func_800788CC(NA_SE_SY_WHITE_OUT_T);
}
void func_809858C8(DemoIm* this, GlobalContext* globalCtx) {
void DemoIm_SpawnLightBall(DemoIm* this, GlobalContext* globalCtx) {
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x,
(kREG(17) + 24.0f) + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 6);
}
void func_80985948(DemoIm* this, GlobalContext* globalCtx) {
if (func_809850E8(this, globalCtx, 4, 5)) {
Animation_Change(&this->skelAnime, &object_im_Anim_011C08, 1.0f, 0.0f,
Animation_GetLastFrame(&object_im_Anim_011C08), ANIMMODE_ONCE, 0.0f);
Animation_Change(&this->skelAnime, &gImpaPrepareSealGanonAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gImpaPrepareSealGanonAnim), ANIMMODE_ONCE, 0.0f);
this->action = 8;
this->drawConfig = 2;
this->unk_26C = 0;
this->alpha = 0;
this->actor.shape.shadowAlpha = 0;
this->unk_268 = 0.0f;
func_809858A8();
@ -463,7 +465,7 @@ void func_809859E0(DemoIm* this, GlobalContext* globalCtx) {
this->action = 9;
this->drawConfig = 1;
*unk_268 = kREG(5) + 10.0f;
this->unk_26C = this->actor.shape.shadowAlpha = alpha;
this->alpha = this->actor.shape.shadowAlpha = alpha;
return;
}
} else {
@ -472,24 +474,24 @@ void func_809859E0(DemoIm* this, GlobalContext* globalCtx) {
this->action = 7;
this->drawConfig = 0;
*unk_268 = 0.0f;
this->unk_26C = 0;
this->alpha = 0;
this->actor.shape.shadowAlpha = 0;
return;
}
}
this->actor.shape.shadowAlpha = this->unk_26C = (*unk_268 / (kREG(5) + 10.0f)) * 255.0f;
this->actor.shape.shadowAlpha = this->alpha = (*unk_268 / (kREG(5) + 10.0f)) * 255.0f;
}
void func_80985B34(DemoIm* this, GlobalContext* globalCtx) {
if (func_80985134(this, globalCtx, 4, 5)) {
Animation_Change(&this->skelAnime, &object_im_Anim_012218, 1.0f, 0.0f,
Animation_GetLastFrame(&object_im_Anim_012218), ANIMMODE_ONCE, -8.0f);
Animation_Change(&this->skelAnime, &gImpaSealGanonAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaSealGanonAnim),
ANIMMODE_ONCE, -8.0f);
this->action = 8;
this->drawConfig = 2;
this->unk_268 = kREG(5) + 10.0f;
this->unk_26C = 255;
this->alpha = 255;
if (this->unk_270 == 0) {
func_809858C8(this, globalCtx);
DemoIm_SpawnLightBall(this, globalCtx);
this->unk_270 = 1;
}
this->actor.shape.shadowAlpha = 0xFF;
@ -502,34 +504,34 @@ void func_80985C10(DemoIm* this, GlobalContext* globalCtx) {
}
void func_80985C40(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_809859E0(this, globalCtx);
func_80984C8C(this, globalCtx);
}
void func_80985C94(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80985B34(this, globalCtx);
func_80984C8C(this, globalCtx);
}
void func_80985CE8(DemoIm* this, GlobalContext* globalCtx) {
void DemoIm_DrawTranslucent(DemoIm* this, GlobalContext* globalCtx) {
s32 pad[2];
s16 unk_25C = this->unk_25C;
void* sp68 = D_80987830[unk_25C];
s16 eyeIndex = this->eyeIndex;
void* eyeTex = sEyeTextures[eyeIndex];
SkelAnime* skelAnime = &this->skelAnime;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_im_inKenjyanomaDemo02.c", 281);
func_80093D84(globalCtx->state.gfxCtx);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sp68));
gSPSegment(POLY_XLU_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sp68));
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_26C);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTex));
gSPSegment(POLY_XLU_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(eyeTex));
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->alpha);
gSPSegment(POLY_XLU_DISP++, 0x0C, &D_80116280[0]);
POLY_XLU_DISP = SkelAnime_DrawFlex(globalCtx, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount,
@ -539,7 +541,7 @@ void func_80985CE8(DemoIm* this, GlobalContext* globalCtx) {
}
void func_80985E60(DemoIm* this, GlobalContext* globalCtx) {
func_80985280(this, &object_im_Anim_001868, 0, 0.0f, 0);
DemoIm_ChangeAnim(this, &gImpaIdleAnim, ANIMMODE_LOOP, 0.0f, false);
this->action = 10;
this->unk_280 = 1;
}
@ -553,8 +555,8 @@ void func_80985EAC(DemoIm* this, GlobalContext* globalCtx) {
}
void func_80985EF4(DemoIm* this) {
if (!Animation_OnFrame(&this->skelAnime, Animation_GetLastFrame(&object_im_Anim_01182C) - 1.0f)) {
func_80985060(this);
if (!Animation_OnFrame(&this->skelAnime, Animation_GetLastFrame(&gImpaWhistlingAnim) - 1.0f)) {
DemoIm_UpdateSkelAnime(this);
}
}
@ -564,8 +566,8 @@ void func_80985F54(DemoIm* this) {
}
void func_80985F64(DemoIm* this, GlobalContext* globalCtx) {
Animation_Change(&this->skelAnime, &object_im_Anim_001868, 1.0f, 0.0f,
Animation_GetLastFrame(&object_im_Anim_001868), ANIMMODE_LOOP, 0.0f);
Animation_Change(&this->skelAnime, &gImpaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaIdleAnim),
ANIMMODE_LOOP, 0.0f);
func_80985180(this, globalCtx, 5);
this->action = 11;
this->drawConfig = 1;
@ -573,15 +575,15 @@ void func_80985F64(DemoIm* this, GlobalContext* globalCtx) {
void func_80985FE8(DemoIm* this, s32 arg1) {
if (arg1 != 0) {
Animation_Change(&this->skelAnime, &object_im_Anim_01182C, 1.0f, 0.0f,
Animation_GetLastFrame(&object_im_Anim_01182C), ANIMMODE_LOOP, -8.0f);
Animation_Change(&this->skelAnime, &gImpaWhistlingAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaWhistlingAnim),
ANIMMODE_LOOP, -8.0f);
}
}
void func_8098604C(DemoIm* this) {
f32 frameCount = Animation_GetLastFrame(&object_im_Anim_010EE0);
f32 frameCount = Animation_GetLastFrame(&gImpaStartWhistlingAnim);
Animation_Change(&this->skelAnime, &object_im_Anim_010EE0, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, -8.0f);
Animation_Change(&this->skelAnime, &gImpaStartWhistlingAnim, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, -8.0f);
this->action = 12;
this->drawConfig = 1;
this->unk_2D0 = 1;
@ -594,21 +596,21 @@ void func_809860C8(DemoIm* this) {
void func_809860DC(DemoIm* this, s32 arg1) {
if (arg1 != 0) {
Animation_Change(&this->skelAnime, &object_im_Anim_001868, 1.0f, 0.0f,
Animation_GetLastFrame(&object_im_Anim_001868), ANIMMODE_LOOP, -8.0f);
Animation_Change(&this->skelAnime, &gImpaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaIdleAnim),
ANIMMODE_LOOP, -8.0f);
this->unk_2D0 = 0;
}
}
void func_80986148(DemoIm* this) {
Animation_Change(&this->skelAnime, &object_im_Anim_010EE0, -1.0f, Animation_GetLastFrame(&object_im_Anim_010EE0),
0.0f, ANIMMODE_ONCE, -8.0f);
Animation_Change(&this->skelAnime, &gImpaStartWhistlingAnim, -1.0f,
Animation_GetLastFrame(&gImpaStartWhistlingAnim), 0.0f, ANIMMODE_ONCE, -8.0f);
this->action = 14;
this->drawConfig = 1;
}
void func_809861C4(DemoIm* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = func_809850A0(globalCtx, 5);
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, 5);
if (npcAction != NULL) {
u32 action = npcAction->action;
@ -620,8 +622,8 @@ void func_809861C4(DemoIm* this, GlobalContext* globalCtx) {
func_80986148(this);
break;
case 7:
Animation_Change(&this->skelAnime, &object_im_Anim_01182C, 1.0f, 0.0f,
Animation_GetLastFrame(&object_im_Anim_01182C), ANIMMODE_LOOP, -8.0f);
Animation_Change(&this->skelAnime, &gImpaWhistlingAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gImpaWhistlingAnim), ANIMMODE_LOOP, -8.0f);
this->action = 12;
break;
default:
@ -633,7 +635,7 @@ void func_809861C4(DemoIm* this, GlobalContext* globalCtx) {
}
void func_8098629C(DemoIm* this, GlobalContext* globalCtx) {
if (func_80985080(globalCtx)) {
if (DemoIm_IsCsStateIdle(globalCtx)) {
this->action = 21;
this->drawConfig = 1;
this->unk_280 = 1;
@ -641,7 +643,7 @@ void func_8098629C(DemoIm* this, GlobalContext* globalCtx) {
}
void func_809862E0(DemoIm* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = func_809850A0(globalCtx, 5);
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, 5);
if (npcAction != NULL) {
u32 action = npcAction->action;
@ -676,8 +678,8 @@ void func_809863BC(DemoIm* this, GlobalContext* globalCtx) {
}
void func_809863DC(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80985EAC(this, globalCtx);
func_80984BE0(this);
func_809862E0(this, globalCtx);
@ -686,8 +688,8 @@ void func_809863DC(DemoIm* this, GlobalContext* globalCtx) {
void func_80986430(DemoIm* this, GlobalContext* globalCtx) {
s32 sp24;
func_80985018(this, globalCtx);
sp24 = func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
sp24 = DemoIm_UpdateSkelAnime(this);
func_80985EAC(this, globalCtx);
func_80984BE0(this);
func_80985FE8(this, sp24);
@ -695,7 +697,7 @@ void func_80986430(DemoIm* this, GlobalContext* globalCtx) {
}
void func_80986494(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
func_80985EF4(this);
func_80984BE0(this);
func_809861C4(this, globalCtx);
@ -704,15 +706,15 @@ void func_80986494(DemoIm* this, GlobalContext* globalCtx) {
void func_809864D4(DemoIm* this, GlobalContext* globalCtx) {
s32 sp24;
func_80985018(this, globalCtx);
sp24 = func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
sp24 = DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_809860DC(this, sp24);
func_8098629C(this, globalCtx);
}
void func_8098652C(DemoIm* this, GlobalContext* globalCtx) {
func_80985280(this, &object_im_Anim_001868, 0, 0.0f, 0);
DemoIm_ChangeAnim(this, &gImpaIdleAnim, ANIMMODE_LOOP, 0.0f, false);
this->action = 15;
}
@ -755,22 +757,22 @@ void func_80986700(DemoIm* this) {
}
void func_80986710(DemoIm* this, GlobalContext* globalCtx) {
Animation_Change(&this->skelAnime, &object_im_Anim_001868, 1.0f, 0.0f,
Animation_GetLastFrame(&object_im_Anim_001868), ANIMMODE_LOOP, 0.0f);
Animation_Change(&this->skelAnime, &gImpaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaIdleAnim),
ANIMMODE_LOOP, 0.0f);
func_80985180(this, globalCtx, 5);
this->action = 16;
this->drawConfig = 1;
}
void func_80986794(DemoIm* this) {
Animation_Change(&this->skelAnime, &object_im_Anim_0014E4, 1.0f, 0.0f,
Animation_GetLastFrame(&object_im_Anim_0014E4), ANIMMODE_ONCE, -8.0f);
Animation_Change(&this->skelAnime, &gImpaThrowDekuNutAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gImpaThrowDekuNutAnim), ANIMMODE_ONCE, -8.0f);
this->action = 17;
this->drawConfig = 1;
}
void func_8098680C(DemoIm* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = func_809850A0(globalCtx, 5);
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, 5);
if (npcAction != NULL) {
u32 action = npcAction->action;
@ -803,8 +805,8 @@ void func_809868E8(DemoIm* this, GlobalContext* globalCtx) {
}
void func_80986908(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_8098680C(this, globalCtx);
}
@ -812,8 +814,8 @@ void func_80986908(DemoIm* this, GlobalContext* globalCtx) {
void func_80986948(DemoIm* this, GlobalContext* globalCtx) {
s32 sp24;
func_80985018(this, globalCtx);
sp24 = func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
sp24 = DemoIm_UpdateSkelAnime(this);
func_80986570(this, globalCtx);
func_80984BE0(this);
func_809865F8(this, globalCtx, sp24);
@ -821,7 +823,7 @@ void func_80986948(DemoIm* this, GlobalContext* globalCtx) {
}
void func_809869B0(DemoIm* this, GlobalContext* globalCtx) {
func_80985280(this, &object_im_Anim_001868, 0, 0.0f, 0);
DemoIm_ChangeAnim(this, &gImpaIdleAnim, ANIMMODE_LOOP, 0.0f, false);
this->action = 18;
this->actor.shape.shadowAlpha = 0;
}
@ -832,9 +834,10 @@ s32 func_809869F8(DemoIm* this, GlobalContext* globalCtx) {
f32 thisPosX = this->actor.world.pos.x;
if ((thisPosX - (kREG(16) + 30.0f) > playerPosX) && (!(this->actor.flags & 0x40))) {
return 1;
return true;
} else {
return false;
}
return 0;
}
s32 func_80986A5C(DemoIm* this, GlobalContext* globalCtx) {
@ -843,9 +846,10 @@ s32 func_80986A5C(DemoIm* this, GlobalContext* globalCtx) {
f32 thisPosX = this->actor.world.pos.x;
if ((thisPosX - (kREG(17) + 130.0f) < playerPosX) && (!Gameplay_InCsMode(globalCtx))) {
return 1;
return true;
} else {
return false;
}
return 0;
}
s32 func_80986AD0(DemoIm* this, GlobalContext* globalCtx) {
@ -854,9 +858,9 @@ s32 func_80986AD0(DemoIm* this, GlobalContext* globalCtx) {
this->actor.textId = 0x708E;
func_8002F2F4(&this->actor, globalCtx);
} else {
return 1;
return true;
}
return 0;
return false;
}
void func_80986B2C(GlobalContext* globalCtx) {
@ -934,8 +938,8 @@ void func_80986D40(DemoIm* this, GlobalContext* globalCtx) {
}
void func_80986DC8(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80984E58(this, globalCtx);
this->actor.flags &= ~0x9;
@ -946,20 +950,20 @@ void func_80986E20(DemoIm* this, GlobalContext* globalCtx) {
}
void func_80986E40(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80984E58(this, globalCtx);
func_80984D74(this, globalCtx);
DemoIm_UpdateCollider(this, globalCtx);
func_80986BE4(this, func_80986AD0(this, globalCtx));
}
void func_80986EAC(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80984F94(this, globalCtx);
func_80984D74(this, globalCtx);
DemoIm_UpdateCollider(this, globalCtx);
func_80986B2C(globalCtx);
}
@ -968,11 +972,11 @@ void func_80986F08(DemoIm* this, GlobalContext* globalCtx) {
}
void func_80986F28(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80984E58(this, globalCtx);
func_80984D74(this, globalCtx);
DemoIm_UpdateCollider(this, globalCtx);
func_80986C30(this, globalCtx);
}
@ -981,17 +985,17 @@ void func_80986F88(DemoIm* this, GlobalContext* globalCtx) {
}
void func_80986FA8(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80984E58(this, globalCtx);
this->actor.flags &= ~0x9;
func_80984D74(this, globalCtx);
DemoIm_UpdateCollider(this, globalCtx);
func_80986CFC(this, globalCtx);
}
void func_80987018(DemoIm* this, GlobalContext* globalCtx) {
func_80985280(this, &object_im_Anim_001868, 0, 0.0f, 0);
DemoIm_ChangeAnim(this, &gImpaIdleAnim, ANIMMODE_LOOP, 0.0f, false);
this->action = 27;
this->drawConfig = 0;
this->actor.shape.shadowAlpha = 0;
@ -1006,9 +1010,9 @@ void func_80987064(DemoIm* this) {
temp = kREG(17) + 10.0f;
if (*unk_268 >= temp) {
this->actor.shape.shadowAlpha = this->unk_26C = alpha;
this->actor.shape.shadowAlpha = this->alpha = alpha;
} else {
this->actor.shape.shadowAlpha = this->unk_26C = (*unk_268 / temp) * 255.0f;
this->actor.shape.shadowAlpha = this->alpha = (*unk_268 / temp) * 255.0f;
}
}
@ -1026,18 +1030,18 @@ void func_80987128(DemoIm* this) {
}
void func_80987174(DemoIm* this) {
func_80985280(this, &object_im_Anim_0101C8, 2, -8.0f, 0);
DemoIm_ChangeAnim(this, &object_im_Anim_0101C8, ANIMMODE_ONCE, -8.0f, false);
this->action = 30;
}
void func_809871B4(DemoIm* this, s32 arg1) {
if (arg1 != 0) {
func_80985280(this, &object_im_Anim_00FB10, 0, 0.0f, 0);
DemoIm_ChangeAnim(this, &object_im_Anim_00FB10, ANIMMODE_LOOP, 0.0f, false);
}
}
void func_809871E8(DemoIm* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = func_809850A0(globalCtx, 5);
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, 5);
if (npcAction != NULL) {
u32 action = npcAction->action;
@ -1064,16 +1068,16 @@ void func_80987288(DemoIm* this, GlobalContext* globalCtx) {
}
void func_809872A8(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80987064(this);
func_80987128(this);
}
void func_809872F0(DemoIm* this, GlobalContext* globalCtx) {
func_80985018(this, globalCtx);
func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_809871E8(this, globalCtx);
}
@ -1081,8 +1085,8 @@ void func_809872F0(DemoIm* this, GlobalContext* globalCtx) {
void func_80987330(DemoIm* this, GlobalContext* globalCtx) {
s32 sp1C;
func_80985018(this, globalCtx);
sp1C = func_80985060(this);
DemoIm_UpdateBgCheckInfo(this, globalCtx);
sp1C = DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_809871B4(this, sp1C);
}
@ -1101,9 +1105,8 @@ void DemoIm_Init(Actor* thisx, GlobalContext* globalCtx) {
DemoIm* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
func_80984D00(thisx, globalCtx);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_im_Skel_00F788, NULL, this->jointTable, this->morphTable,
17);
DemoIm_InitCollider(thisx, globalCtx);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gImpaSkel, NULL, this->jointTable, this->morphTable, 17);
thisx->flags &= ~1;
switch (this->actor.params) {
@ -1128,7 +1131,7 @@ void DemoIm_Init(Actor* thisx, GlobalContext* globalCtx) {
}
void DemoIm_Destroy(Actor* thisx, GlobalContext* globalCtx) {
func_80984D4C(thisx, globalCtx);
DemoIm_DestroyCollider(thisx, globalCtx);
}
s32 DemoIm_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
@ -1140,19 +1143,19 @@ s32 DemoIm_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
Vec3s* unk_2D4_unk_08 = &this->unk_2D4.unk_08;
switch (limbIndex) {
case 9:
case IMPA_LIMB_CHEST:
rot->x += unk_2D4_unk_0E->y;
rot->y -= unk_2D4_unk_0E->x;
break;
case 16:
case IMPA_LIMB_HEAD:
rot->x += unk_2D4_unk_08->y;
rot->z += unk_2D4_unk_08->x;
break;
}
}
if ((*unk_2D0 != 0) && (limbIndex == 15)) {
*dList = object_im_DL_00EDE8;
if ((*unk_2D0 != 0) && (limbIndex == IMPA_LIMB_RIGHT_HAND)) {
*dList = gImpaHandPointingDL;
}
return false;
@ -1161,7 +1164,7 @@ s32 DemoIm_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
void DemoIm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
DemoIm* this = THIS;
if (limbIndex == 16) {
if (limbIndex == IMPA_LIMB_HEAD) {
Vec3f sp28 = D_809887D8;
Vec3f dest;
@ -1175,21 +1178,21 @@ void DemoIm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
}
}
void func_8098764C(DemoIm* this, GlobalContext* globalCtx) {
void DemoIm_DrawNothing(DemoIm* this, GlobalContext* globalCtx) {
}
void func_80987658(DemoIm* this, GlobalContext* globalCtx) {
void DemoIm_DrawSolid(DemoIm* this, GlobalContext* globalCtx) {
s32 pad[2];
s16 unk_25C = this->unk_25C;
void* sp68 = D_80987830[unk_25C];
s16 eyeIndex = this->eyeIndex;
void* eyeTexture = sEyeTextures[eyeIndex];
SkelAnime* skelAnime = &this->skelAnime;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_im.c", 904);
func_80093D18(globalCtx->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sp68));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sp68));
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTexture));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(eyeTexture));
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
gSPSegment(POLY_OPA_DISP++, 0x0C, &D_80116280[2]);

View file

@ -9,17 +9,38 @@ struct DemoIm;
typedef void (*DemoImActionFunc)(struct DemoIm*, GlobalContext*);
typedef void (*DemoImDrawFunc)(struct DemoIm*, GlobalContext*);
typedef enum {
/* 0x00 */ IMPA_LIMB_NONE,
/* 0x01 */ IMPA_LIMB_ROOT,
/* 0x02 */ IMPA_LIMB_TORSO,
/* 0x03 */ IMPA_LIMB_LEFT_THIGH,
/* 0x04 */ IMPA_LIMB_LEFT_LEG,
/* 0x05 */ IMPA_LIMB_LEFT_FOOT,
/* 0x06 */ IMPA_LIMB_RIGHT_THIGH,
/* 0x07 */ IMPA_LIMB_RIGHT_LEG,
/* 0x08 */ IMPA_LIMB_RIGHT_FOOT,
/* 0x09 */ IMPA_LIMB_CHEST,
/* 0x0A */ IMPA_LIMB_LEFT_SHOULDER,
/* 0x0B */ IMPA_LIMB_LEFT_ARM,
/* 0x0C */ IMPA_LIMB_LEFT_HAND,
/* 0x0D */ IMPA_LIMB_RIGHT_SHOULDER,
/* 0x0E */ IMPA_LIMB_RIGHT_ARM,
/* 0x0F */ IMPA_LIMB_RIGHT_HAND,
/* 0x10 */ IMPA_LIMB_HEAD,
/* 0x11 */ IMPA_LIMB_MAX
} ImpaLimb;
typedef struct DemoIm {
/* 0x0000 */ Actor actor;
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ Vec3s jointTable[17];
/* 0x01F6 */ Vec3s morphTable[17];
/* 0x025C */ s16 unk_25C;
/* 0x025E */ s16 unk_25E;
/* 0x0190 */ Vec3s jointTable[IMPA_LIMB_MAX];
/* 0x01F6 */ Vec3s morphTable[IMPA_LIMB_MAX];
/* 0x025C */ s16 eyeIndex;
/* 0x025E */ s16 blinkTimer;
/* 0x0260 */ s32 action;
/* 0x0264 */ s32 drawConfig;
/* 0x0268 */ f32 unk_268;
/* 0x026C */ s32 unk_26C;
/* 0x026C */ s32 alpha;
/* 0x0270 */ s32 unk_270;
/* 0x0274 */ s32 unk_274;
/* 0x0278 */ f32 unk_278;