Skip to content

Commit 3ada548

Browse files
committed
Rename Spark Effect -> Grind Effect, document SA1's and SA2's versions a bit
1 parent 015137c commit 3ada548

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

include/constants/animations.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@
497497
#define SA2_ANIM_SPINDASH_DUST_EFFECT 846
498498
#define SA2_ANIM_SPINDASH_DUST_EFFECT_BIG 847
499499
#define SA2_ANIM_SMALL_DUST_PARTICLE 848
500-
#define SA2_ANIM_SPARK_EFFECT 849 // Grinding particles
500+
#define SA2_ANIM_GRIND_EFFECT 849 // Grinding particles
501501
#define SA2_ANIM_SHIELD_NORMAL 850
502502
#define SA2_ANIM_SHIELD_MAGNETIC 851
503503
#define SA2_ANIM_INVINCIBILITY 852

include/game/stage/game_2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ typedef struct {
2323
extern struct Task *sub_801F15C(s16, s16, u8, s8, TaskMain, TaskDestructor);
2424
extern void TaskDestructor_801F550(struct Task *);
2525

26-
void sub_801F488(void);
26+
void CreateGrindEffect2(void);
2727

2828
struct Task *CreateStageGoalBonusPointsAnim(s32, s32, u16);
2929
void Task_801F214(void);

ldscript.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ SECTIONS
176176
src/game/stage/game_2.o(.text);
177177
src/game/stage/dust_effect_braking.o(.text);
178178
src/game/stage/dust_effect_spindash.o(.text);
179-
src/game/stage/spark_effect.o(.text);
179+
src/game/stage/grind_effect_1.o(.text);
180180
src/game/stage/rings_scatter.o(.text);
181181

182182
/* player */

src/game/stage/game_2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ struct Task *CreateStageGoalBonusPointsAnim(s32 x, s32 y, u16 score)
171171
}
172172
}
173173

174-
void sub_801F488(void)
174+
void CreateGrindEffect2(void)
175175
{
176176
Player *p = &gPlayer;
177177
if ((gStageTime & 0x7) == 0) {
@@ -201,7 +201,7 @@ void sub_801F488(void)
201201
ts = TASK_DATA(t);
202202
s = &ts->s;
203203
s->graphics.dest = VramMalloc(20);
204-
s->graphics.anim = SA2_ANIM_SPARK_EFFECT;
204+
s->graphics.anim = SA2_ANIM_GRIND_EFFECT;
205205
s->variant = 0;
206206
s->oamFlags = SPRITE_OAM_ORDER(8);
207207
s->frameFlags = SPRITE_FLAG(PRIORITY, 1);
@@ -223,7 +223,7 @@ struct Task *sub_801F568(s16 x, s16 y)
223223
Sprite *s = &ts->s;
224224

225225
s->graphics.dest = VramMalloc(20);
226-
s->graphics.anim = SA2_ANIM_SPARK_EFFECT;
226+
s->graphics.anim = SA2_ANIM_GRIND_EFFECT;
227227
s->variant = 0;
228228
s->oamFlags = SPRITE_OAM_ORDER(8);
229229
s->frameFlags = SPRITE_FLAG(PRIORITY, 1);
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,23 @@
99

1010
typedef struct {
1111
Sprite s;
12-
} SparkEffect;
12+
} GrindEffect;
1313

14-
void Task_SparkEffect(void);
15-
void TaskDestructor_SparkEffect(struct Task *);
14+
void Task_GrindEffect(void);
15+
void TaskDestructor_GrindEffect(struct Task *);
1616

17-
// NOTE: This effect appears to be unused
18-
struct Task *CreateSparkEffect()
17+
// NOTE: This effect is unused in SA2.
18+
// It is the code for SA1's Grind effect
19+
20+
struct Task *CreateGrindEffect()
1921
{
20-
struct Task *t = TaskCreate(Task_SparkEffect, sizeof(SparkEffect), 0x2001, 0, TaskDestructor_SparkEffect);
22+
struct Task *t = TaskCreate(Task_GrindEffect, sizeof(GrindEffect), 0x2001, 0, TaskDestructor_GrindEffect);
2123

22-
SparkEffect *spark = TASK_DATA(t);
24+
GrindEffect *spark = TASK_DATA(t);
2325
Sprite *s = &spark->s;
2426
s->graphics.dest = VramMalloc(20);
2527
s->graphics.size = 0;
26-
s->graphics.anim = SA2_ANIM_SPARK_EFFECT;
28+
s->graphics.anim = SA2_ANIM_GRIND_EFFECT;
2729
s->variant = 0;
2830
s->prevVariant = -1;
2931
s->oamFlags = SPRITE_OAM_ORDER(8);
@@ -35,15 +37,15 @@ struct Task *CreateSparkEffect()
3537
return t;
3638
}
3739

38-
void Task_SparkEffect(void)
40+
void Task_GrindEffect(void)
3941
{
4042
Player *p = &gPlayer;
4143

4244
if (p->spriteTask == NULL || !(p->moveState & MOVESTATE_1000000)) {
4345
TaskDestroy(gCurTask);
4446
return;
4547
} else if ((p->anim == SA2_CHAR_ANIM_55) && (p->variant == 0)) {
46-
SparkEffect *spark = TASK_DATA(gCurTask);
48+
GrindEffect *spark = TASK_DATA(gCurTask);
4749
Sprite *s = &spark->s;
4850
struct Camera *cam = &gCamera;
4951
s->x = I(p->x) - cam->x;
@@ -60,8 +62,8 @@ void Task_SparkEffect(void)
6062
}
6163
}
6264

63-
void TaskDestructor_SparkEffect(struct Task *t)
65+
void TaskDestructor_GrindEffect(struct Task *t)
6466
{
65-
SparkEffect *spark = TASK_DATA(t);
67+
GrindEffect *spark = TASK_DATA(t);
6668
VramFree(spark->s.graphics.dest);
6769
}

src/game/stage/player.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4767,10 +4767,8 @@ void Player_DoGrinding(Player *p)
47674767
gPlayer.moveState &= ~MOVESTATE_IN_SCRIPTED;
47684768
m4aSongNumStop(SE_GRINDING);
47694769
PLAYERFN_SET(Player_Jumping);
4770-
} else {
4771-
if (IS_SINGLE_PLAYER) {
4772-
sub_801F488();
4773-
}
4770+
} else if (IS_SINGLE_PLAYER) {
4771+
CreateGrindEffect2();
47744772
}
47754773
}
47764774
}

0 commit comments

Comments
 (0)