diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2022-01-03 21:50:12 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-04 05:50:12 +0000 |
| commit | d3e4a3368f6c8cb4bd6ca8c404d4f48c25ab7d10 (patch) | |
| tree | b5353255aa6f2e0aab430104e05477023ae8db2f /src/code/z_effect_soft_sprite_old_init.c | |
| parent | 8cd978585e1570383c401d6fcd439d9a3f9440f5 (diff) | |
Effect_soft_sprite_old_init and particleOverlayTable OK (#520)
* Migrated data
* Migrate particleOverlayTable
* Import data for effect_soft_sprite, add g to effect table, minor cleanup of z64effect.h
* Name data
* Comment out static variable in variables.h
* Use better macros
* PR review and other cleanup
* Update bug comment
Diffstat (limited to 'src/code/z_effect_soft_sprite_old_init.c')
| -rw-r--r-- | src/code/z_effect_soft_sprite_old_init.c | 118 |
1 files changed, 46 insertions, 72 deletions
diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c index 4303d3db2..1c69f57f3 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -124,32 +124,32 @@ void func_800B1054(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* EffectSsDust_Spawn(globalCtx, 1, pos, velocity, accel, primColor, envColor, scale, scaleStep, 10, 1); } -extern Color_RGBA8 D_801AE3B0; -extern Color_RGBA8 D_801AE3B4; +static Color_RGBA8 sDustBrownPrim = { 170, 130, 90, 255 }; +static Color_RGBA8 sDustBrownEnv = { 100, 60, 20, 255 }; void func_800B10C0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel) { - EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &D_801AE3B0, &D_801AE3B4, 100, 5, 10, 0); + EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &sDustBrownPrim, &sDustBrownEnv, 100, 5, 10, 0); } void func_800B1130(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel) { - EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &D_801AE3B0, &D_801AE3B4, 100, 5, 10, 0); + EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &sDustBrownPrim, &sDustBrownEnv, 100, 5, 10, 0); } void func_800B11A0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep) { - EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &D_801AE3B0, &D_801AE3B4, scale, scaleStep, 10, 0); + EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &sDustBrownPrim, &sDustBrownEnv, scale, scaleStep, 10, 0); } void func_800B1210(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep) { - EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &D_801AE3B0, &D_801AE3B4, scale, scaleStep, 10, 0); + EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &sDustBrownPrim, &sDustBrownEnv, scale, scaleStep, 10, 0); } void func_800B1280(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, s16 life) { - EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &D_801AE3B0, &D_801AE3B4, scale, scaleStep, life, 0); + EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &sDustBrownPrim, &sDustBrownEnv, scale, scaleStep, life, 0); } void func_800B12F0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, s16 life) { - EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &D_801AE3B0, &D_801AE3B4, scale, scaleStep, life, 0); + EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &sDustBrownPrim, &sDustBrownEnv, scale, scaleStep, life, 0); } void func_800B1360(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, @@ -206,12 +206,9 @@ void func_800B1598(GlobalContext* globalCtx, f32 randScale, Vec3f* srcPos) { } } -extern Color_RGBA8 D_801AE3B8; -extern Color_RGBA8 D_801AE3BC; - void EffectSsKiraKira_SpawnSmallYellow(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel) { - Color_RGBA8 primColor = D_801AE3B8; - Color_RGBA8 envColor = D_801AE3BC; + Color_RGBA8 primColor = { 255, 255, 200, 255 }; + Color_RGBA8 envColor = { 255, 200, 0, 0 }; EffectSsKiraKira_SpawnDispersed(globalCtx, pos, velocity, accel, &primColor, &envColor, 1000, 16); } @@ -307,12 +304,12 @@ void EffectSsBlast_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, EffectSs_Spawn(globalCtx, EFFECT_SS_BLAST, 128, &initParams); } -extern Color_RGBA8 D_801AE3C0; -extern Color_RGBA8 D_801AE3C4; - void EffectSsBlast_SpawnWhiteCustomScale(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, s16 life) { - EffectSsBlast_Spawn(globalCtx, pos, velocity, accel, &D_801AE3C0, &D_801AE3C4, scale, scaleStep, 35, life); + static Color_RGBA8 primColor = { 255, 255, 255, 255 }; + static Color_RGBA8 envColor = { 200, 200, 200, 0 }; + + EffectSsBlast_Spawn(globalCtx, pos, velocity, accel, &primColor, &envColor, scale, scaleStep, 35, life); } void EffectSsBlast_SpawnShockwave(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, @@ -320,11 +317,11 @@ void EffectSsBlast_SpawnShockwave(GlobalContext* globalCtx, Vec3f* pos, Vec3f* v EffectSsBlast_Spawn(globalCtx, pos, velocity, accel, primColor, envColor, 100, 375, 35, life); } -extern Color_RGBA8 D_801AE3C8; -extern Color_RGBA8 D_801AE3CC; - void EffectSsBlast_SpawnWhiteShockwave(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel) { - EffectSsBlast_SpawnShockwave(globalCtx, pos, velocity, accel, &D_801AE3C8, &D_801AE3CC, 10); + static Color_RGBA8 primColor = { 255, 255, 255, 255 }; + static Color_RGBA8 envColor = { 200, 200, 200, 0 }; + + EffectSsBlast_SpawnShockwave(globalCtx, pos, velocity, accel, &primColor, &envColor, 10); } // EffectSsGSpk Spawn Functions @@ -364,24 +361,18 @@ void EffectSsGSpk_SpawnNoAccel(GlobalContext* globalCtx, Actor* actor, Vec3f* po EffectSs_Spawn(globalCtx, EFFECT_SS_G_SPK, 128, &initParams); } -extern Color_RGBA8 D_801AE3D0; -extern Color_RGBA8 D_801AE3D4; - void EffectSsGSpk_SpawnFuse(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel) { - Color_RGBA8 primColor = D_801AE3D0; - Color_RGBA8 envColor = D_801AE3D4; + Color_RGBA8 primColor = { 255, 255, 150, 255 }; + Color_RGBA8 envColor = { 255, 0, 0, 0 }; EffectSsGSpk_SpawnSmall(globalCtx, actor, pos, velocity, accel, &primColor, &envColor); } -extern Color_RGBA8 D_801AE3D8; -extern Color_RGBA8 D_801AE3DC; - // unused void EffectSsGSpk_SpawnRandColor(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep) { - Color_RGBA8 primColor = D_801AE3D8; - Color_RGBA8 envColor = D_801AE3DC; + Color_RGBA8 primColor = { 255, 255, 150, 255 }; + Color_RGBA8 envColor = { 255, 0, 0, 0 }; s32 randOffset = (Rand_ZeroOne() * 20.0f) - 10.0f; primColor.r += randOffset; @@ -585,12 +576,10 @@ void EffectSsHahen_SpawnBurst(GlobalContext* globalCtx, Vec3f* pos, f32 burstSca } } -extern Vec3f D_801AE3E0; - void func_800B2364(GlobalContext* globalCtx, Vec3f* pos, Gfx* dList) { - Vec3f posVec = D_801AE3E0; + Vec3f accel = { 0.0f, -2.0f, 0.0f }; - EffectSsHahen_Spawn(globalCtx, pos, &gZeroVec3f, &posVec, 1, 5, 1, 10, dList); + EffectSsHahen_Spawn(globalCtx, pos, &gZeroVec3f, &accel, 1, 5, 1, 10, dList); } // EffectSsStick Spawn Functions @@ -624,12 +613,9 @@ void EffectSsSibuki_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, EffectSs_Spawn(globalCtx, EFFECT_SS_SIBUKI, 128, &initParams); } -extern Vec3f D_801AE3EC; -extern Vec3f D_801AE3F8; - void EffectSsSibuki_SpawnBurst(GlobalContext* globalCtx, Vec3f* pos) { s16 i; - Vec3f zeroVec = D_801AE3EC; + Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; s16 randDirection = Rand_ZeroOne() * 1.99f; for (i = 0; i < KREG(19) + 30; i++) { @@ -759,11 +745,6 @@ void EffectSsIcePiece_Spawn(GlobalContext* globalCtx, Vec3f* pos, f32 scale, Vec EffectSs_Spawn(globalCtx, EFFECT_SS_ICE_PIECE, 128, &initParams); } -extern Vec3f D_801AE3F8; -extern Vec3f D_801AE404[10]; - -#ifdef NON_MATCHING -/* needs data migration to match */ void EffectSsIcePiece_SpawnBurst(GlobalContext* globalCtx, Vec3f* refPos, f32 scale) { static Vec3f accel = { 0.0f, 0.0f, 0.0f }; static Vec3f vecScales[] = { @@ -799,15 +780,11 @@ void EffectSsIcePiece_SpawnBurst(GlobalContext* globalCtx, Vec3f* refPos, f32 sc &accel, 25); } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/EffectSsIcePiece_SpawnBurst.s") -#endif // EffectSsEnIce Spawn Functions void EffectSsEnIce_SpawnFlyingVec3f(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, Color_RGBA8* prim, Color_RGBA8* env, f32 scale) { - EffectSsEnIceInitParams initParams; initParams.actor = actor; @@ -824,11 +801,11 @@ void EffectSsEnIce_SpawnFlyingVec3f(GlobalContext* globalCtx, Actor* actor, Vec3 EffectSs_Spawn(globalCtx, EFFECT_SS_EN_ICE, 80, &initParams); } -extern Color_RGBA8 D_801AE47C; -extern Color_RGBA8 D_801AE480; - void func_800B2B44(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, f32 scale) { - EffectSsEnIce_SpawnFlyingVec3f(globalCtx, actor, pos, &D_801AE47C, &D_801AE480, scale); + static Color_RGBA8 primColor = { 150, 150, 150, 250 }; + static Color_RGBA8 envColor = { 235, 245, 255, 255 }; + + EffectSsEnIce_SpawnFlyingVec3f(globalCtx, actor, pos, &primColor, &envColor, scale); } void func_800B2B7C(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, f32 scale) { @@ -874,29 +851,21 @@ void EffectSsFireTail_Spawn(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, EffectSs_Spawn(globalCtx, EFFECT_SS_FIRE_TAIL, 128, &initParams); } -extern Color_RGBA8 D_801AE484; -extern Color_RGBA8 D_801AE488; - -#ifdef NON_MATCHING -// needs data migration to match void EffectSsFireTail_SpawnFlame(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, f32 arg3, s16 bodyPart, f32 colorIntensity) { + static Color_RGBA8 primColor = { 255, 255, 0, 255 }; + static Color_RGBA8 envColor = { 255, 0, 0, 255 }; - D_801AE484.g = (s32)(255.0f * colorIntensity); - D_801AE484.b = 0; + primColor.g = (s32)(255.0f * colorIntensity); + primColor.b = 0; - D_801AE488.g = 0; - D_801AE488.b = 0; - D_801AE484.r = D_801AE488.r = (s32)(255.0f * colorIntensity); + envColor.g = 0; + envColor.b = 0; + primColor.r = envColor.r = (s32)(255.0f * colorIntensity); - EffectSsFireTail_Spawn(globalCtx, actor, pos, arg3, &actor->velocity, 15, &D_801AE484, &D_801AE488, + EffectSsFireTail_Spawn(globalCtx, actor, pos, arg3, &actor->velocity, 15, &primColor, &envColor, (colorIntensity == 1.0f) ? 0 : 1, bodyPart, 1); } -#else -void EffectSsFireTail_SpawnFlame(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, f32 arg3, s16 bodyPart, - f32 colorIntensity); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/EffectSsFireTail_SpawnFlame.s") -#endif void EffectSsFireTail_SpawnFlameOnPlayer(GlobalContext* globalCtx, f32 scale, s16 bodyPart, f32 colorIntensity) { Player* player = GET_PLAYER(globalCtx); @@ -982,12 +951,17 @@ void EffectSsDeadDb_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, EffectSs_Spawn(globalCtx, EFFECT_SS_DEAD_DB, 120, &initParams); } -extern Color_RGBA8 D_801AE48C; -extern Color_RGBA8 D_801AE490[4]; - void func_800B3030(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, s32 colorIndex) { - EffectSsDeadDb_Spawn(globalCtx, pos, velocity, accel, &D_801AE48C, &D_801AE490[colorIndex], scale, scaleStep, 9); + static Color_RGBA8 primColor = { 255, 255, 255, 255 }; + static Color_RGBA8 envColors[] = { + { 255, 0, 0, 255 }, + { 0, 255, 0, 255 }, + { 0, 0, 255, 255 }, + { 150, 150, 150, 255 }, + }; + + EffectSsDeadDb_Spawn(globalCtx, pos, velocity, accel, &primColor, &envColors[colorIndex], scale, scaleStep, 9); } // EffectSsDeadDd Spawn Functions |
