Skip to content

Commit

Permalink
Effect data refactor (pmret#1094)
Browse files Browse the repository at this point in the history
* grood

* fixes
  • Loading branch information
ethteck authored Jul 24, 2023
1 parent ccc8e8e commit 01d88aa
Show file tree
Hide file tree
Showing 65 changed files with 591 additions and 1,111 deletions.
398 changes: 1 addition & 397 deletions include/effects.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/182B30.c
Original file line number Diff line number Diff line change
Expand Up @@ -3781,7 +3781,7 @@ void func_8025D640(ActorPart* part, s32 decorationIndex) {

switch (decor->state[decorationIndex]) {
case 0:
decor->effect[decorationIndex] = fx_65(1, part->currentPos.x, part->currentPos.y, part->currentPos.z, 1.0f, 0);
decor->effect[decorationIndex] = fx_effect_65(1, part->currentPos.x, part->currentPos.y, part->currentPos.z, 1.0f, 0);
decor->state[decorationIndex] = 1;
break;
case 1:
Expand All @@ -3803,7 +3803,7 @@ void func_8025D71C(ActorPart* part, s32 decorationIndex) {

switch (decor->state[decorationIndex]) {
case 0:
decor->effect[decorationIndex] = fx_65(2, part->currentPos.x, part->currentPos.y, part->currentPos.z, 1.0f, 0);
decor->effect[decorationIndex] = fx_effect_65(2, part->currentPos.x, part->currentPos.y, part->currentPos.z, 1.0f, 0);
decor->unk_8C6[decorationIndex].unk00 = 1;
decor->state[decorationIndex] = 1;
break;
Expand Down
6 changes: 3 additions & 3 deletions src/23680.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ void basic_ai_wander(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolum
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 stillWithinTerritory = FALSE;
f32 x, y, z;
s32 sp34;
EffectInstance* sp34;
f32 yaw;

if (aiSettings->playerSearchInterval >= 0) {
Expand Down Expand Up @@ -673,7 +673,7 @@ void basic_ai_loiter(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolum
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 x, y, z;
f32 yaw;
s32 emoteTemp;
EffectInstance* emoteTemp;

if (aiSettings->playerSearchInterval >= 0) {
if (basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 0)) {
Expand Down Expand Up @@ -784,7 +784,7 @@ void basic_ai_chase_init(Evt* script, MobileAISettings* npcAISettings, EnemyDete
void basic_ai_chase(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolume* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 sp28;
EffectInstance* sp28;
f32 x, y, z;

if (!basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 1)) {
Expand Down
1 change: 0 additions & 1 deletion src/audio/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ void au_load_INIT(AuGlobals* arg0, s32 romAddr, ALHeap* heap);
AuResult au_fetch_SBN_file(u32 fileIdx, AuFileFormat format, SBNFileEntry* arg2);
void au_load_PER(AuGlobals* globals, s32 romAddr);
void au_load_PRG(AuGlobals* arg0, s32 romAddr);
// INCLUDE_ASM(s32, "audio/2e230_len_2190", snd_load_BGM);
InstrumentGroup* au_get_BK_instruments(s32 bankGroup, u32 bankIndex);
SoundBank* au_load_BK_to_bank(s32 bkFileOffset, SoundBank* bank, s32 bankIndex, s32 bankGroup);
void au_swizzle_BK_instruments(s32 bkFileOffset, SoundBank* bank, InstrumentGroup instruments, u32 instrumentCount, u8 arg4);
Expand Down
2 changes: 1 addition & 1 deletion src/battle/area/trd_part_2/actor/common_koopa_bros.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ API_CALLABLE(N(SpawnSpinEffect)) {
N(DummyPlayerStatus).position.y = posY - 10.0f;
N(DummyPlayerStatus).position.z = posZ;

fx_46(6, &N(DummyPlayerStatus), 1.0f, duration);
fx_effect_46(6, &N(DummyPlayerStatus), 1.0f, duration);
return ApiStatus_DONE2;
}

Expand Down
2 changes: 1 addition & 1 deletion src/battle/common/actor/groove_guy.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ s32 func_8021878C_512D5C(Evt* script, s32 isInitialCall) {
D_802310D0.position.x = x;
D_802310D0.position.y = y;
D_802310D0.position.z = z;
fx_46(6, &D_802310D0, temp_f20, temp_v0);
fx_effect_46(6, &D_802310D0, temp_f20, temp_v0);

return ApiStatus_DONE2;
}
Expand Down
2 changes: 1 addition & 1 deletion src/battle/partner/parakarry.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ API_CALLABLE(N(FlyAround)) {
script->functionTemp[1] = 0;
script->functionTemp[2] = 0;
script->functionTemp[3] = 0;
airRaidEffect = fx_65(0, state->currentPos.x, state->currentPos.y, state->currentPos.z, 1.0f, 0);
airRaidEffect = fx_effect_65(0, state->currentPos.x, state->currentPos.y, state->currentPos.z, 1.0f, 0);
script->functionTemp[0] = 1;
break;
case 1:
Expand Down
File renamed without changes.
149 changes: 3 additions & 146 deletions src/effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,157 +16,14 @@ extern Addr D_801A6000;
gfx_name##_ROM_END \
}

EffectTableEntry gEffectTable[] = {
/* 0x00 */ {},
/* 0x01 */ FX_ENTRY(big_smoke_puff, effect_gfx_big_smoke_puff),
/* 0x02 */ {},
/* 0x03 */ {},
/* 0x04 */ {},
/* 0x05 */ {},
/* 0x06 */ FX_ENTRY(landing_dust, effect_gfx_landing_dust),
/* 0x07 */ FX_ENTRY(walking_dust, effect_gfx_landing_dust),
/* 0x08 */ FX_ENTRY(flower_splash, effect_gfx_flower_splash_trail),
/* 0x09 */ FX_ENTRY(flower_trail, effect_gfx_flower_splash_trail),
/* 0x0A */ FX_ENTRY(cloud_puff, effect_gfx_cloud_puff_trail),
/* 0x0B */ FX_ENTRY(cloud_trail, effect_gfx_cloud_puff_trail),
/* 0x0C */ FX_ENTRY(footprint, effect_gfx_footprint),
/* 0x0D */ FX_ENTRY(floating_flower, effect_gfx_floating_flower),
/* 0x0E */ FX_ENTRY(snowflake, effect_gfx_snowflake),
/* 0x0F */ FX_ENTRY(star, effect_gfx_star),
/* 0x10 */ FX_ENTRY(emote, effect_gfx_emote),
/* 0x11 */ FX_ENTRY(sparkles, effect_gfx_sparkles),
/* 0x12 */ FX_ENTRY(shape_spell, effect_gfx_shape_spell),
/* 0x13 */ FX_ENTRY(gather_energy_pink, effect_gfx_gather_energy_pink),
/* 0x14 */ FX_ENTRY(drop_leaves, effect_gfx_drop_leaves),
/* 0x15 */ FX_ENTRY(dust, effect_gfx_dust),
/* 0x16 */ FX_ENTRY(shattering_stones, effect_gfx_shattering_stones),
/* 0x17 */ FX_ENTRY(smoke_ring, effect_gfx_landing_dust),
/* 0x18 */ FX_ENTRY(damage_stars, effect_gfx_damage_stars),
/* 0x19 */ FX_ENTRY(explosion, effect_gfx_explosion),
/* 0x1A */ FX_ENTRY(lens_flare, effect_gfx_lens_flare),
/* 0x1B */ FX_ENTRY(got_item_outline, effect_gfx_got_item_outline),
/* 0x1C */ FX_ENTRY(spiky_white_aura, effect_gfx_spiky_white_aura),
/* 0x1D */ FX_ENTRY(smoke_impact, effect_gfx_landing_dust),
/* 0x1E */ FX_ENTRY(damage_indicator, effect_gfx_damage_indicator),
/* 0x1F */ FX_ENTRY(purple_ring, effect_gfx_purple_ring),
/* 0x20 */ FX_ENTRY(flame, effect_gfx_flame),
/* 0x21 */ FX_ENTRY(stars_burst, effect_gfx_damage_stars),
/* 0x22 */ FX_ENTRY(stars_shimmer, effect_gfx_sparkles),
/* 0x23 */ FX_ENTRY(rising_bubble, effect_gfx_rising_bubble),
/* 0x24 */ FX_ENTRY(ring_blast, effect_gfx_ring_blast),
/* 0x25 */ FX_ENTRY(shockwave, effect_gfx_shockwave),
/* 0x26 */ FX_ENTRY(music_note, effect_gfx_music_note),
/* 0x27 */ FX_ENTRY(smoke_burst, effect_gfx_landing_dust),
/* 0x28 */ FX_ENTRY(sweat, effect_gfx_sweat),
/* 0x29 */ FX_ENTRY(sleep_bubble, effect_gfx_sleep_bubble),
/* 0x2A */ {},
/* 0x2B */ FX_ENTRY(windy_leaves, effect_gfx_drop_leaves),
/* 0x2C */ FX_ENTRY(falling_leaves, effect_gfx_falling_leaves),
/* 0x2D */ FX_ENTRY(stars_spread, effect_gfx_stars_spread),
/* 0x2E */ FX_ENTRY(steam_burst, effect_gfx_steam_burst),
/* 0x2F */ FX_ENTRY(stars_orbiting, effect_gfx_stars_orbiting),
/* 0x30 */ FX_ENTRY(big_snowflakes, effect_gfx_big_snowflakes),
/* 0x31 */ FX_ENTRY(debuff, effect_gfx_debuff),
/* 0x32 */ FX_ENTRY(green_impact, effect_gfx_green_impact),
/* 0x33 */ FX_ENTRY(radial_shimmer, effect_gfx_radial_shimmer),
/* 0x34 */ FX_ENTRY(ending_decals, effect_gfx_ending_decals),
/* 0x35 */ FX_ENTRY(light_rays, effect_gfx_light_rays),
/* 0x36 */ FX_ENTRY(lightning, effect_gfx_lightning),
/* 0x37 */ FX_ENTRY(fire_breath, effect_gfx_fire_breath),
/* 0x38 */ FX_ENTRY(shimmer_burst, effect_gfx_sparkles),
/* 0x39 */ FX_ENTRY(energy_shockwave, effect_gfx_energy_shockwave),
/* 0x3A */ FX_ENTRY(shimmer_wave, effect_gfx_sparkles),
/* 0x3B */ FX_ENTRY(aura, effect_gfx_aura),
/* 0x3C */ FX_ENTRY(bulb_glow, effect_gfx_bulb_glow),
/* 0x3D */ FX_ENTRY(effect_3D, effect_gfx_effect_3D),
/* 0x3E */ FX_ENTRY(blast, effect_gfx_blast),
/* 0x3F */ FX_ENTRY(fire_flower, effect_gfx_fire_flower),
/* 0x40 */ FX_ENTRY(recover, effect_gfx_recover),
/* 0x41 */ FX_ENTRY(disable_x, effect_gfx_disable_x),
/* 0x42 */ FX_ENTRY(bombette_breaking, effect_gfx_blast),
/* 0x43 */ FX_ENTRY(firework, effect_gfx_firework),
/* 0x44 */ FX_ENTRY(confetti, effect_gfx_confetti),
/* 0x45 */ FX_ENTRY(snowfall, effect_gfx_snowfall),
/* 0x46 */ FX_ENTRY(effect_46, effect_gfx_effect_46),
/* 0x47 */ FX_ENTRY(gather_magic, effect_gfx_gather_magic),
/* 0x48 */ FX_ENTRY(attack_result_text, effect_gfx_attack_result_text),
/* 0x49 */ FX_ENTRY(small_gold_sparkle, effect_gfx_small_gold_sparkle),
/* 0x4A */ FX_ENTRY(flashing_box_shockwave, effect_gfx_flashing_box_shockwave),
/* 0x4B */ FX_ENTRY(balloon, effect_gfx_balloon),
/* 0x4C */ FX_ENTRY(floating_rock, effect_gfx_floating_rock),
/* 0x4D */ FX_ENTRY(chomp_drop, effect_gfx_chomp_drop),
/* 0x4E */ FX_ENTRY(quizmo_stage, effect_gfx_quizmo_stage),
/* 0x4F */ FX_ENTRY(radiating_energy_orb, effect_gfx_radiating_energy_orb),
/* 0x50 */ FX_ENTRY(quizmo_answer, effect_gfx_quizmo_answer),
/* 0x51 */ FX_ENTRY(motion_blur_flame, effect_gfx_motion_blur_flame),
/* 0x52 */ FX_ENTRY(energy_orb_wave, effect_gfx_energy_orb_wave),
/* 0x53 */ FX_ENTRY(merlin_house_stars, effect_gfx_merlin_house_stars),
/* 0x54 */ FX_ENTRY(quizmo_audience, effect_gfx_quizmo_audience),
/* 0x55 */ FX_ENTRY(butterflies, effect_gfx_butterflies),
/* 0x56 */ FX_ENTRY(stat_change, effect_gfx_stat_change),
/* 0x57 */ FX_ENTRY(snaking_static, effect_gfx_snaking_static),
/* 0x58 */ FX_ENTRY(thunderbolt_ring, effect_gfx_thunderbolt_ring),
/* 0x59 */ FX_ENTRY(squirt, effect_gfx_squirt),
/* 0x5A */ FX_ENTRY(water_block, effect_gfx_water_block),
/* 0x5B */ FX_ENTRY(waterfall, effect_gfx_waterfall),
/* 0x5C */ FX_ENTRY(water_fountain, effect_gfx_water_fountain),
/* 0x5D */ FX_ENTRY(underwater, effect_gfx_underwater),
/* 0x5E */ FX_ENTRY(lightning_bolt, effect_gfx_lightning_bolt),
/* 0x5F */ FX_ENTRY(water_splash, effect_gfx_water_splash),
/* 0x60 */ FX_ENTRY(snowman_doll, effect_gfx_snowman_doll),
/* 0x61 */ FX_ENTRY(fright_jar, effect_gfx_fright_jar),
/* 0x62 */ FX_ENTRY(stop_watch, effect_gfx_stop_watch),
/* 0x63 */ FX_ENTRY(effect_63, effect_gfx_effect_63),
/* 0x64 */ FX_ENTRY(throw_spiny, effect_gfx_throw_spiny),
/* 0x65 */ FX_ENTRY(effect_65, effect_gfx_effect_65),
/* 0x66 */ FX_ENTRY(tubba_heart_attack, effect_gfx_tubba_heart_attack),
/* 0x67 */ FX_ENTRY(whirlwind, effect_gfx_whirlwind),
/* 0x68 */ FX_ENTRY(red_impact, effect_gfx_shockwave),
/* 0x69 */ FX_ENTRY(floating_cloud_puff, effect_gfx_floating_cloud_puff),
/* 0x6A */ {},
/* 0x6B */ FX_ENTRY(energy_in_out, effect_gfx_energy_in_out),
/* 0x6C */ FX_ENTRY(tattle_window, effect_gfx_tattle_window),
/* 0x6D */ FX_ENTRY(shiny_flare, effect_gfx_shiny_flare),
/* 0x6E */ FX_ENTRY(huff_puff_breath, effect_gfx_huff_puff_breath),
/* 0x6F */ FX_ENTRY(cold_breath, effect_gfx_cold_breath),
/* 0x70 */ FX_ENTRY(embers, effect_gfx_embers),
/* 0x71 */ FX_ENTRY(hieroglyphs, effect_gfx_hieroglyphs),
/* 0x72 */ FX_ENTRY(misc_particles, effect_gfx_misc_particles),
/* 0x73 */ FX_ENTRY(static_status, effect_gfx_static_status),
/* 0x74 */ FX_ENTRY(moving_cloud, effect_gfx_moving_cloud),
/* 0x75 */ FX_ENTRY(effect_75, effect_gfx_effect_75),
/* 0x76 */ {},
/* 0x77 */ FX_ENTRY(firework_rocket, effect_gfx_firework_rocket),
/* 0x78 */ FX_ENTRY(peach_star_beam, effect_gfx_peach_star_beam),
/* 0x79 */ FX_ENTRY(chapter_change, effect_gfx_chapter_change),
/* 0x7A */ FX_ENTRY(ice_shard, effect_gfx_ice_shard),
/* 0x7B */ FX_ENTRY(spirit_card, effect_gfx_spirit_card),
/* 0x7C */ FX_ENTRY(lil_oink, effect_gfx_lil_oink),
/* 0x7D */ FX_ENTRY(something_rotating, effect_gfx_spirit_card),
/* 0x7E */ FX_ENTRY(breaking_junk, effect_gfx_breaking_junk),
/* 0x7F */ FX_ENTRY(partner_buff, effect_gfx_partner_buff),
/* 0x80 */ FX_ENTRY(quizmo_assistant, effect_gfx_quizmo_assistant),
/* 0x81 */ FX_ENTRY(ice_pillar, effect_gfx_ice_pillar),
/* 0x82 */ FX_ENTRY(sun, effect_gfx_sun),
/* 0x83 */ FX_ENTRY(star_spirits_energy, effect_gfx_star_spirits_energy),
/* 0x84 */ FX_ENTRY(pink_sparkles, effect_gfx_sparkles),
/* 0x85 */ FX_ENTRY(star_outline, effect_gfx_star_outline),
/* 0x86 */ FX_ENTRY(effect_86, effect_gfx_effect_86),
};

s32 D_8007FEB8[] = {
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000008, 0x00000005, 0x00000003, 0x00000004,
0x0000000D, 0x0000003C, 0x00000000, 0x00000200, 0x00000000, 0x00000000,
0x00000003, 0x00000000,
};
#include "effects/effect_table.c"

s32 D_8007FEB8[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 5, 3, 4, 13, 60, 0, 512, 0, 0, 3, 0 };

/// Used for unbound function points in effect structs.
void stub_effect_delegate(EffectInstance* effect) {
}


void set_effect_pos_offset(EffectInstance* effect, f32 x, f32 y, f32 z) {
s32* data = effect->data.any;

Expand Down
Loading

0 comments on commit 01d88aa

Please sign in to comment.