documentations:

- various particle system functions/structs
- more in src/fight
- beehive
- added prototypes (reduced compiler warnings)
This commit is contained in:
mariob92
2024-09-07 12:52:35 +02:00
parent 78142ca162
commit c8598c2677
77 changed files with 356 additions and 332 deletions

View File

@@ -52,7 +52,7 @@ Actor *chBadShad_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
modelRender_setAlpha(other->alpha_124_19);
sp40 = ml_map_f(this->unk28, 0.0f , 800.0f, 0.53f, 0.18f)*this->unk1C[1];
modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE);
modelRender_draw(gfx, mtx, this->position, sp44, sp40, NULL, func_80330B1C(marker));
modelRender_draw(gfx, mtx, this->position, sp44, sp40, NULL, marker_loadModelBin(marker));
return this;
}

View File

@@ -2,30 +2,34 @@
#include "functions.h"
#include "variables.h"
void func_802CE8D4(Actor *this);
void chBeehive_update(Actor *this);
/* .data */
ActorAnimationInfo D_803672C0[] ={
enum chBeehive_state {
CHBEEHIVE_STATE_0_UNKNOWN,
CHBEEHIVE_STATE_1_IDLE,
CHBEEHIVE_STATE_2_DIE
};
ActorAnimationInfo chBeehiveAnimations[] ={
{0x000, 0.0f},
{ASSET_165_ANIM_BEEHIVE_IDLE, 0.65f},
{ASSET_65_ANIM_BEEHIVE_DIE, 0.5f},
{ASSET_65_ANIM_BEEHIVE_DIE, 1000000.0f},
};
ActorInfo D_803672E0 = {0x50, ACTOR_12_BEEHIVE, ASSET_364_MODEL_BEEHIVE,
1, D_803672C0,
func_802CE8D4, func_80326224, actor_draw,
ActorInfo chBeehive = {MARKER_50_BEEHIVE, ACTOR_12_BEEHIVE, ASSET_364_MODEL_BEEHIVE,
1, chBeehiveAnimations,
chBeehive_update, func_80326224, actor_draw,
0, 0x333, 0.0f, 0
};
/* .code */
void func_802CE7E0(ActorMarker *marker, ActorMarker *other){
Actor *actor = marker_getActor(marker);
void chBeehive_die(ActorMarker *this, ActorMarker *other){
Actor *actor = marker_getActor(this);
FUNC_8030E8B4(SFX_11_WOOD_BREAKING_1, 1.0f, 28000, actor->position, 300, 3000);
FUNC_8030E8B4(SFX_D_EGGSHELL_BREAKING, 1.0f, 28000, actor->position, 300, 3000);
subaddie_set_state(actor, 2);
subaddie_set_state(actor, CHBEEHIVE_STATE_2_DIE);
actor_playAnimationOnce(actor);
marker->collidable = FALSE;
this->collidable = FALSE;
actor->unk138_27 = 3;
__spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, actor->position[0]), reinterpret_cast(s32, actor->position[1]), reinterpret_cast(s32, actor->position[2]));
__spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4A_WOOD_EXPLOSION, reinterpret_cast(s32, actor->position[0]), reinterpret_cast(s32, actor->position[1]), reinterpret_cast(s32, actor->position[2]));
@@ -34,9 +38,9 @@ void func_802CE7E0(ActorMarker *marker, ActorMarker *other){
func_803115C4(ASSET_DA6_TEXT_BEEHIVE_WITH_BEES);
}
void func_802CE8D4(Actor *this){
void chBeehive_update(Actor *this){
if(!this->unk16C_4){
marker_setCollisionScripts(this->marker, NULL, NULL, func_802CE7E0);
marker_setCollisionScripts(this->marker, NULL, NULL, chBeehive_die);
this->marker->propPtr->unk8_3 = 1;
this->unk44_31 = func_8030D90C();
this->unk16C_4 = 1;
@@ -48,42 +52,44 @@ void func_802CE8D4(Actor *this){
return;
}
this->unk58_0 = 1;
}//L802CE9A4
}
switch(this->state)
{
case 1://L802CE9C4
if( !fileProgressFlag_get(FILEPROG_D_BEEHIVE_TEXT)
&& subaddie_playerIsWithinCylinder(this, 250, 300)
){
if(func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT){
if( player_getTransformation() == TRANSFORM_1_BANJO
&& func_80311480(ASSET_D96_DIALOG_BEEHIVE_MEET, 0, NULL, NULL, NULL, 0)
){
fileProgressFlag_set(FILEPROG_D_BEEHIVE_TEXT, 1);
case CHBEEHIVE_STATE_1_IDLE:
if( !fileProgressFlag_get(FILEPROG_D_BEEHIVE_TEXT)
&& subaddie_playerIsWithinCylinder(this, 250, 300)
){
if(func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT){
if( player_getTransformation() == TRANSFORM_1_BANJO
&& func_80311480(ASSET_D96_DIALOG_BEEHIVE_MEET, 0, NULL, NULL, NULL, 0)
){
fileProgressFlag_set(FILEPROG_D_BEEHIVE_TEXT, 1);
}
}
}
}//L802CEA48
if( actor_animationIsAt(this, 0.45f)
|| actor_animationIsAt(this, 0.55f)
|| actor_animationIsAt(this, 0.6f)
){
if(!this->unk38_0){
func_8030E394(this->unk44_31);
sfxsource_setSfxId(this->unk44_31, SFX_67_BEEHIVE_CLONK);
sfxsource_setSampleRate(this->unk44_31, 12000);
func_8030DBB4(this->unk44_31, (animctrl_getAnimTimer(this->animctrl) + 0.9) - 0.4);
sfxsource_set_position(this->unk44_31, this->position);
sfxsource_set_fade_distances(this->unk44_31, 300.0f, 1500.0f);
func_8030DD14(this->unk44_31, 3);
func_8030E2C4(this->unk44_31);
if( actor_animationIsAt(this, 0.45f)
|| actor_animationIsAt(this, 0.55f)
|| actor_animationIsAt(this, 0.6f)
){
if(!this->unk38_0){
func_8030E394(this->unk44_31);
sfxsource_setSfxId(this->unk44_31, SFX_67_BEEHIVE_CLONK);
sfxsource_setSampleRate(this->unk44_31, 12000);
func_8030DBB4(this->unk44_31, (animctrl_getAnimTimer(this->animctrl) + 0.9) - 0.4);
sfxsource_set_position(this->unk44_31, this->position);
sfxsource_set_fade_distances(this->unk44_31, 300.0f, 1500.0f);
func_8030DD14(this->unk44_31, 3);
func_8030E2C4(this->unk44_31);
}
}
}//L802CEB48
break;
case 2://L802CEB2C
if(animctrl_isStopped(this->animctrl)){
func_80326310(this);
}
break;
}//L802CEB48
}
break;
case CHBEEHIVE_STATE_2_DIE:
if(animctrl_isStopped(this->animctrl)) {
func_80326310(this);
}
break;
}
}

View File

@@ -178,7 +178,7 @@ Actor *chBottlesBonus_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx)
modelRender_preDraw((GenFunction_1)actor_predrawMethod, (s32)sp6C);
modelRender_postDraw((GenFunction_1)actor_postdrawMethod, (s32)marker);
modelRender_draw(gfx, mtx, sp60, NULL, D_80368250, sp54, func_80330B1C(marker));
modelRender_draw(gfx, mtx, sp60, NULL, D_80368250, sp54, marker_loadModelBin(marker));
gDPSetTextureFilter((*gfx)++, G_TF_BILERP);
gDPSetColorDither((*gfx)++, G_CD_MAGICSQ);
chBottlesBonusCursor_draw(gfx, mtx, vtx);
@@ -226,7 +226,7 @@ f32 *chBottlesBonus_func_802DD584(s32 arg0){
// temp_f0 = D_80376F48;
sizeof(BKAnimationList);
temp_v1 = (BKAnimation*)(model_getAnimationList(func_80330B1C(chBottlesBonusMarker)) + 1);
temp_v1 = (BKAnimation*)(model_getAnimationList(marker_loadModelBin(chBottlesBonusMarker)) + 1);
D_8037DF70[0] = temp_v1[5 + arg0].unk0[0] * 0.01;
D_8037DF70[1] = temp_v1[5 + arg0].unk0[1] * 0.01;
D_8037DF70[2] = temp_v1[5 + arg0].unk0[2] * 0.01;

View File

@@ -156,7 +156,7 @@ void chBottlesBonusCursor_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
(s32)sp3C, (s32)sp3C,
D_803A5D00[getActiveFramebuffer()]
);
modelRender_draw(gfx, mtx, this->position, rotation, this->scale, NULL, func_80330B1C(chBottlesBonusCursorMarker));
modelRender_draw(gfx, mtx, this->position, rotation, this->scale, NULL, marker_loadModelBin(chBottlesBonusCursorMarker));
func_8024E030(this->position, D_8037E5C0.unk10);
if (this->state == 1) {
D_8037E5C0.unk10[0] -= 24.0f;

View File

@@ -49,7 +49,7 @@ void func_80359A40(f32 position[3], struct_core2_D2AB0 *arg1, s32 cnt){
particleEmitter_emitN(pCtrl, cnt);
}
void __chdrips_particleCallback(struct31s *pCtrl, f32 position[3]){
void __chdrips_particleCallback(ParticleScaleAndLifetimeRanges *pCtrl, f32 position[3]){
if(func_8024549C(position, 4.0f)){
position[1] += 2.0f;
func_80359A40(position, &D_80372AF0, 1);

View File

@@ -29,7 +29,7 @@ ActorInfo D_80372C80 = {
0, 0, 1.0f, 0
};
struct31s D_80372CA4 = {
ParticleScaleAndLifetimeRanges D_80372CA4 = {
{1.0f, 1.2f},
{1.6f, 2.0f},
{0.05f, 0.05f},
@@ -183,7 +183,7 @@ void func_8035C080(Actor *this, s32 next_state){
particleEmitter_setStartingFrameRange(local->pCtrl_8, 0, 7);
particleEmitter_setPosition(local->pCtrl_8, this->position);
particleEmitter_setPositionVelocityAndAccelerationRanges(local->pCtrl_8, &D_80372CCC);
func_802EFB98(local->pCtrl_8, &D_80372CA4);
particleEmitter_setScaleAndLifetimeRanges(local->pCtrl_8, &D_80372CA4);
particleEmitter_setSpawnInterval(local->pCtrl_8, 4);
}//L8035C698

View File

@@ -70,7 +70,7 @@ bool func_8035ED60(Actor *this) {
void func_8035EDB0(f32 position[3], s32 count, enum asset_e sprite) {
static s32 D_80373014[3] = {0xAA, 0xAA, 0xAA};
static struct31s D_80373020 = {{0.4f, 0.8f}, {1.4f, 2.0f}, {0.0f, 0.01f}, {1.2f, 1.8f}, 0.0f, 0.01};
static ParticleScaleAndLifetimeRanges D_80373020 = {{0.4f, 0.8f}, {1.4f, 2.0f}, {0.0f, 0.01f}, {1.2f, 1.8f}, 0.0f, 0.01};
static struct43s D_80373048 = {
{{-200.0f, -200.0f, -200.0f}, { 200.0f, 200.0f, 200.0f}},
{{ 0.0f, -10.0f, 0.0f}, { 0.0f, -10.0f, 0.0f}},
@@ -83,7 +83,7 @@ void func_8035EDB0(f32 position[3], s32 count, enum asset_e sprite) {
particleEmitter_setSprite(p_ctrl, sprite);
particleEmitter_setPosition(p_ctrl, position);
particleEmitter_setPositionVelocityAndAccelerationRanges(p_ctrl, &D_80373048);
func_802EFB98(p_ctrl, &D_80373020);
particleEmitter_setScaleAndLifetimeRanges(p_ctrl, &D_80373020);
particleEmitter_setDrawMode(p_ctrl, PART_EMIT_NO_DEPTH);
particleEmitter_emitN(p_ctrl, count);
}

View File

@@ -5,7 +5,6 @@
extern void subaddie_set_state_with_direction(Actor *, s32, f32 , s32);
extern f32 func_80309B24(f32*);
extern void func_80329904(ActorMarker*, s32, f32*);
extern void func_80326310(Actor *);
extern void func_8032BB88(Actor *, s32, s32);
void chJinjo_update(Actor *this);

View File

@@ -28,7 +28,7 @@ ActorInfo D_80367E20= {
0, 0, 0.0f, 0
};
struct31s D_80367E44 = {
ParticleScaleAndLifetimeRanges D_80367E44 = {
{0.05f, 0.1f},
{0.0f, 0.0f},
{0.0f, 0.01f},
@@ -59,7 +59,7 @@ void func_802DA634(ParticleEmitter *pCtrl, f32 arg1[3], s32 cnt){
particleEmitter_setPosition(pCtrl, arg1);
particleEmitter_setAngularVelocityRange(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f);
particleEmitter_setParticleVelocityRange(pCtrl, -150.0f, 150.0f, -150.0f, 150.0f, 360.0f, 150.0f);
func_802EFB98(pCtrl, &D_80367E44);
particleEmitter_setScaleAndLifetimeRanges(pCtrl, &D_80367E44);
func_802EF9F8(pCtrl, 0.01f);
func_802EFA18(pCtrl, 3);
particleEmitter_emitN(pCtrl, cnt);

View File

@@ -46,7 +46,7 @@ Actor *chOverlayNoController_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vt
func_8024C904(gdl, mptr);
{sp40[0] = 0.0f; sp40[1] = 0.0f; sp40[2] = 0.0f;};
{sp34[0] = 0.0f; sp34[1] = 165.0f; sp34[2] = 0.0f;};
modelRender_draw(gdl, mptr, sp40, 0, 1.0f, sp34, func_80330B1C(marker));
modelRender_draw(gdl, mptr, sp40, 0, 1.0f, sp34, marker_loadModelBin(marker));
func_8024E2FC();
func_8024C904(gdl, mptr);
return actor;

View File

@@ -56,7 +56,7 @@ Actor *chOverlayPressStart_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx
func_8024C904(gdl, mptr);
{sp40[0] = 0.0f; sp40[1] = 0.0f; sp40[2] = 0.0f;};
{sp34[0] = 0.0f; sp34[1] = 400.0f; sp34[2] = 0.0f;};
modelRender_draw(gdl, mptr, sp40, 0, 1.0f, sp34, func_80330B1C(marker));
modelRender_draw(gdl, mptr, sp40, 0, 1.0f, sp34, marker_loadModelBin(marker));
func_8024E2FC();
func_8024C904(gdl, mptr);
return actor;

View File

@@ -39,7 +39,7 @@ Actor *chSnowball_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
}
void __chSnowball_spawnPieces(f32 position[3]) {
static struct31s D_80368734 = {{0.65f, 1.1}, {0.0f, 0.0f}, {0.0f, 0.01f}, {0.8f, 0.8f}, 0.0f, 0.5f};
static ParticleScaleAndLifetimeRanges D_80368734 = {{0.65f, 1.1}, {0.0f, 0.0f}, {0.0f, 0.01f}, {0.8f, 0.8f}, 0.0f, 0.5f};
static struct43s D_8036875C = {
{{-220.0f, 210.0f, -220.0f}, {280.0f, 460.0f, 280.0f}},
{{ 0.0f, -800.0f, 0.0f}, { 0.0f, -800.0f, 0.0f}},
@@ -53,7 +53,7 @@ void __chSnowball_spawnPieces(f32 position[3]) {
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8036875C);
particleEmitter_setAngularVelocityRange(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f);
func_802EFB98(pCtrl, &D_80368734);
particleEmitter_setScaleAndLifetimeRanges(pCtrl, &D_80368734);
particleEmitter_emitN(pCtrl, 8);
}

View File

@@ -104,7 +104,7 @@ void __chSnowman_spawnHat(ActorMarker *marker){
}
void __chSnowman_spawnSnowballParticles(f32 position[3], s32 count){
static struct31s D_80368694 = {
static ParticleScaleAndLifetimeRanges D_80368694 = {
{0.4f, 1.55f},
{0.0f, 0.0f},
{0.0f, 0.01f},
@@ -127,7 +127,7 @@ void __chSnowman_spawnSnowballParticles(f32 position[3], s32 count){
func_802EFA18(particleSpawner, 3);
func_802EFA20(particleSpawner, 1.0f, 1.3f);
particleEmitter_setSfx(particleSpawner, SFX_2F_ORANGE_SPLAT, 16000);
func_802EFB98(particleSpawner, &D_80368694);
particleEmitter_setScaleAndLifetimeRanges(particleSpawner, &D_80368694);
particleEmitter_emitN(particleSpawner, count);
}