ovl_Bg_Spout_Fire decompiled (#853)

* ovl_Bg_Spout_Fire decompiled, asset decomp pending

* object_fwall decompiled

* fwall Texture leftovers name update from OOT

* pr review fixes

* pr review fixes

* renaming

* xml

* xml

* xml

* xml

Co-authored-by: SonicDcer <noreply@github.com>
This commit is contained in:
Alejandro Asenjo 2022-07-11 21:47:58 -03:00 committed by GitHub
parent 84ce52ae4e
commit 3cdb4597f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 181 additions and 32 deletions

View File

@ -1,6 +1,24 @@
<Root>
<File Name="object_fwall" Segment="6">
<DList Name="object_fwall_DL_000040" Offset="0x40" />
<!-- <Blob Name="object_fwall_Blob_0000A0" Size="0x5C00" Offset="0xA0" /> -->
<!-- 0xA0 to 0x3520 are leftover textures from the OOT fire jet elevator in Fire Temple -->
<Texture Name="gFireTempleBigVerticalFlame0Tex" OutName="fwall_fire_temple_big_vertical_flame_0" Format="ia8" Width="24" Height="80" Offset="0xA0" />
<Texture Name="gFireTempleBigVerticalFlame1Tex" OutName="fwall_fire_temple_big_vertical_flame_1" Format="ia8" Width="24" Height="80" Offset="0x820" />
<Texture Name="gFireTempleBigVerticalFlame2Tex" OutName="fwall_fire_temple_big_vertical_flame_2" Format="ia8" Width="24" Height="80" Offset="0xFA0" />
<Texture Name="gFireTempleBigVerticalFlame3Tex" OutName="fwall_fire_temple_big_vertical_flame_3" Format="ia8" Width="24" Height="80" Offset="0x1720" />
<Texture Name="gFireTempleBigVerticalFlame4Tex" OutName="fwall_fire_temple_big_vertical_flame_4" Format="ia8" Width="24" Height="80" Offset="0x1EA0" />
<Texture Name="gFireTempleBigVerticalFlame5Tex" OutName="fwall_fire_temple_big_vertical_flame_5" Format="ia8" Width="24" Height="80" Offset="0x2620" />
<Texture Name="gFireTempleBigVerticalFlame6Tex" OutName="fwall_fire_temple_big_vertical_flame_6" Format="ia8" Width="24" Height="80" Offset="0x2DA0" />
<Texture Name="gFireTempleBigVerticalFlame7Tex" OutName="fwall_fire_temple_big_vertical_flame_7" Format="ia8" Width="24" Height="80" Offset="0x3520" />
<Texture Name="gFwallFireball0Tex" OutName="fwall_fireball_0" Format="ia8" Width="32" Height="32" Offset="0x3CA0" />
<Texture Name="gFwallFireball1Tex" OutName="fwall_fireball_1" Format="ia8" Width="32" Height="32" Offset="0x40A0" />
<Texture Name="gFwallFireball2Tex" OutName="fwall_fireball_2" Format="ia8" Width="32" Height="32" Offset="0x44A0" />
<Texture Name="gFwallFireball3Tex" OutName="fwall_fireball_3" Format="ia8" Width="32" Height="32" Offset="0x48A0" />
<Texture Name="gFwallFireball4Tex" OutName="fwall_fireball_4" Format="ia8" Width="32" Height="32" Offset="0x4CA0" />
<Texture Name="gFwallFireball5Tex" OutName="fwall_fireball_5" Format="ia8" Width="32" Height="32" Offset="0x50A0" />
<Texture Name="gFwallFireball6Tex" OutName="fwall_fireball_6" Format="ia8" Width="32" Height="32" Offset="0x54A0" />
<Texture Name="gFwallFireball7Tex" OutName="fwall_fireball_7" Format="ia8" Width="32" Height="32" Offset="0x58A0" />
</File>
</Root>

3
spec
View File

@ -2931,8 +2931,7 @@ beginseg
name "ovl_Bg_Spout_Fire"
compress
include "build/src/overlays/actors/ovl_Bg_Spout_Fire/z_bg_spout_fire.o"
include "build/data/ovl_Bg_Spout_Fire/ovl_Bg_Spout_Fire.data.o"
include "build/data/ovl_Bg_Spout_Fire/ovl_Bg_Spout_Fire.reloc.o"
include "build/src/overlays/actors/ovl_Bg_Spout_Fire/ovl_Bg_Spout_Fire_reloc.o"
endseg
beginseg

View File

@ -5,6 +5,7 @@
*/
#include "z_bg_spout_fire.h"
#include "objects/object_fwall/object_fwall.h"
#define FLAGS 0x00000000
@ -13,12 +14,14 @@
void BgSpoutFire_Init(Actor* thisx, PlayState* play);
void BgSpoutFire_Destroy(Actor* thisx, PlayState* play);
void BgSpoutFire_Update(Actor* thisx, PlayState* play);
void BgSpoutFire_Draw(Actor* thisx, PlayState* play);
s32 func_80A60C24(BgSpoutFire* this, PlayState* play);
void func_80A60C94(BgSpoutFire* this, PlayState* play);
void func_80A60CDC(BgSpoutFire* this, PlayState* play);
void func_80A60D10(BgSpoutFire* this, PlayState* play);
void func_80A60E08(BgSpoutFire* this, PlayState* play);
#if 0
const ActorInit Bg_Spout_Fire_InitVars = {
ACTOR_BG_SPOUT_FIRE,
ACTORCAT_BG,
@ -31,39 +34,170 @@ const ActorInit Bg_Spout_Fire_InitVars = {
(ActorFunc)NULL,
};
// static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit D_80A61160 = {
{ COLTYPE_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, OC2_TYPE_2, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK0, { 0x20000000, 0x01, 0x04 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NONE, BUMP_NONE, OCELEM_ON, },
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_ON | OC1_TYPE_PLAYER,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0xF7CFFFFF, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 30, 83, 0, { 0, 0, 0 } },
};
// sColChkInfoInit
static CollisionCheckInfoInit D_80A6118C = { 1, 80, 100, MASS_IMMOVABLE };
static CollisionCheckInfoInit sColChkInfoInit = { 1, 80, 100, MASS_IMMOVABLE };
#endif
static TexturePtr sFlameTextures[] = {
gFwallFireball0Tex, gFwallFireball1Tex, gFwallFireball2Tex, gFwallFireball3Tex,
gFwallFireball4Tex, gFwallFireball5Tex, gFwallFireball6Tex, gFwallFireball7Tex,
};
extern ColliderCylinderInit D_80A61160;
extern CollisionCheckInfoInit D_80A6118C;
static s32 sTexturesDesegmented = false;
extern UNK_TYPE D_06000040;
void BgSpoutFire_Init(Actor* thisx, PlayState* play) {
s32 i;
BgSpoutFire* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Spout_Fire/BgSpoutFire_Init.s")
this->actor.scale.z = 1350.0f * 0.0001f;
this->actor.scale.x = 1350.0f * 0.0001f;
this->actor.scale.y = 0.01f;
this->flameTexIndex = 0;
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
this->collider.dim.pos.y = this->actor.world.pos.y;
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
if (!sTexturesDesegmented) {
for (i = 0; i < ARRAY_COUNT(sFlameTextures); i++) {
sFlameTextures[i] = Lib_SegmentedToVirtual(sFlameTextures[i]);
}
sTexturesDesegmented = true;
}
this->actionFunc = func_80A60C94;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Spout_Fire/BgSpoutFire_Destroy.s")
void BgSpoutFire_Destroy(Actor* thisx, PlayState* play) {
BgSpoutFire* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Spout_Fire/func_80A60C24.s")
Collider_DestroyCylinder(play, &this->collider);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Spout_Fire/func_80A60C94.s")
s32 func_80A60C24(BgSpoutFire* this, PlayState* play) {
Player* player = GET_PLAYER(play);
Vec3f sp18;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Spout_Fire/func_80A60CDC.s")
Actor_OffsetOfPointInActorCoords(&this->actor, &sp18, &player->actor.world.pos);
if ((fabsf(sp18.x) < 100.0f) && (fabsf(sp18.z) < 120.0f)) {
return true;
} else {
return false;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Spout_Fire/func_80A60D10.s")
void func_80A60C94(BgSpoutFire* this, PlayState* play) {
if (func_80A60C24(this, play)) {
this->actor.draw = BgSpoutFire_Draw;
this->timer = 5;
this->actionFunc = func_80A60CDC;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Spout_Fire/func_80A60DA0.s")
void func_80A60CDC(BgSpoutFire* this, PlayState* play) {
if (this->timer != 0) {
this->timer--;
}
if (this->timer == 0) {
this->actionFunc = func_80A60D10;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Spout_Fire/func_80A60E08.s")
void func_80A60D10(BgSpoutFire* this, PlayState* play) {
if (func_80A60C24(this, play)) {
Math_StepToF(&this->actor.scale.y, 0.1f, 2.5f * 0.01f);
} else if (Math_StepToF(&this->actor.scale.y, 0.01f, 0.01f)) {
this->actor.draw = NULL;
this->actionFunc = func_80A60C94;
} else {
this->timer = 0;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Spout_Fire/BgSpoutFire_Update.s")
void func_80A60DA0(BgSpoutFire* this, PlayState* play) {
s16 phi_a3;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Spout_Fire/func_80A61040.s")
if (Actor_IsFacingPlayer(&this->actor, 0x4000)) {
phi_a3 = this->actor.shape.rot.y;
} else {
phi_a3 = (this->actor.shape.rot.y + 0x8000);
}
func_800B8D98(play, &this->actor, 5.0f, phi_a3, 1.0f);
}
void func_80A60E08(BgSpoutFire* this, PlayState* play) {
Player* player = GET_PLAYER(play);
Vec3f sp30;
f32 cos;
f32 sin;
Actor_OffsetOfPointInActorCoords(&this->actor, &sp30, &player->actor.world.pos);
sp30.x = CLAMP(sp30.x, -74.25f, 74.25f);
if (this->timer == 0) {
if (sp30.z > 0.0f) {
sp30.z = -25.0f;
this->timer = -1;
} else {
sp30.z = 25.0f;
this->timer = 1;
}
} else {
sp30.z = this->timer * 25.0f;
}
sin = Math_SinS(this->actor.shape.rot.y);
cos = Math_CosS(this->actor.shape.rot.y);
this->collider.dim.pos.x = this->actor.world.pos.x + (sp30.x * cos) + (sp30.z * sin);
this->collider.dim.pos.z = this->actor.world.pos.z - (sp30.x * sin) + (sp30.z * cos);
}
void BgSpoutFire_Update(Actor* thisx, PlayState* play) {
s32 pad;
BgSpoutFire* this = THIS;
this->flameTexIndex = (this->flameTexIndex + 1) % 8;
if ((this->collider.base.atFlags & AT_HIT)) {
this->collider.base.atFlags &= ~AT_HIT;
func_80A60DA0(this, play);
}
this->actionFunc(this, play);
if (this->actionFunc == func_80A60D10) {
func_80A60E08(this, play);
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
func_800B9010(&this->actor, NA_SE_EV_FIRE_PLATE - SFX_FLAG);
}
}
void BgSpoutFire_Draw(Actor* thisx, PlayState* play) {
BgSpoutFire* this = THIS;
Gfx* gfx;
OPEN_DISPS(play->state.gfxCtx);
gfx = Gfx_CallSetupDL(POLY_XLU_DISP, 0x14);
POLY_XLU_DISP = gfx;
gSPSegment(&gfx[0], 0x08, sFlameTextures[this->flameTexIndex]);
gDPSetPrimColor(&gfx[1], 0, 1, 255, 255, 0, 150);
gDPSetEnvColor(&gfx[2], 255, 0, 0, 255);
Matrix_Translate(-55.0f, 0.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(&gfx[3], Matrix_NewMtx(play->state.gfxCtx), (G_MTX_NOPUSH | G_MTX_LOAD) | G_MTX_MODELVIEW);
gSPDisplayList(&gfx[4], object_fwall_DL_000040);
POLY_XLU_DISP = &gfx[5];
CLOSE_DISPS(play->state.gfxCtx);
}

View File

@ -8,9 +8,11 @@ struct BgSpoutFire;
typedef void (*BgSpoutFireActionFunc)(struct BgSpoutFire*, PlayState*);
typedef struct BgSpoutFire {
/* 0x0000 */ Actor actor;
/* 0x0144 */ BgSpoutFireActionFunc actionFunc;
/* 0x0148 */ char unk_148[0x50];
/* 0x000 */ Actor actor;
/* 0x144 */ BgSpoutFireActionFunc actionFunc;
/* 0x148 */ s16 timer;
/* 0x14A */ s16 flameTexIndex;
/* 0x14C */ ColliderCylinder collider;
} BgSpoutFire; // size = 0x198
extern const ActorInit Bg_Spout_Fire_InitVars;

View File

@ -10749,7 +10749,7 @@
0x80A60DA0:("func_80A60DA0",),
0x80A60E08:("func_80A60E08",),
0x80A60F68:("BgSpoutFire_Update",),
0x80A61040:("func_80A61040",),
0x80A61040:("BgSpoutFire_Draw",),
0x80A612B0:("EnDyExtra_Destroy",),
0x80A612C0:("EnDyExtra_Init",),
0x80A61334:("func_80A61334",),

View File

@ -660,10 +660,6 @@ D_06001640 = 0x06001640;
D_06000048 = 0x06000048;
// ovl_Bg_Spout_Fire
D_06000040 = 0x06000040;
// ovl_Bg_Umajump
D_06001220 = 0x06001220;