From a2c2d7e230436f208e0d5e7aa3226310a5f6cc42 Mon Sep 17 00:00:00 2001 From: cbt6 <91667135+cbt6@users.noreply.github.com> Date: Wed, 3 Nov 2021 00:28:49 +0800 Subject: Label indexes for movement speeds --- src/data/object_events/movement_action_func_tables.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/data') diff --git a/src/data/object_events/movement_action_func_tables.h b/src/data/object_events/movement_action_func_tables.h index 4df07be0d..97dace044 100755 --- a/src/data/object_events/movement_action_func_tables.h +++ b/src/data/object_events/movement_action_func_tables.h @@ -602,12 +602,20 @@ u8 (*const gMovementActionFuncs_FaceRight[])(struct ObjectEvent *, struct Sprite MovementAction_PauseSpriteAnim, }; +enum { + MOVE_SPEED_NORMAL, // walking + MOVE_SPEED_FAST_1, // running / surfing / sliding (ice tile) + MOVE_SPEED_FAST_2, // water current / acro bike + MOVE_SPEED_FASTER, // mach bike's max speed + MOVE_SPEED_FASTEST, +}; + static u8 (*const sDirectionAnimFuncsBySpeed[])(u8) = { - GetMoveDirectionAnimNum, - GetMoveDirectionFastAnimNum, - GetMoveDirectionFastAnimNum, - GetMoveDirectionFasterAnimNum, - GetMoveDirectionFastestAnimNum, + [MOVE_SPEED_NORMAL] = GetMoveDirectionAnimNum, + [MOVE_SPEED_FAST_1] = GetMoveDirectionFastAnimNum, + [MOVE_SPEED_FAST_2] = GetMoveDirectionFastAnimNum, + [MOVE_SPEED_FASTER] = GetMoveDirectionFasterAnimNum, + [MOVE_SPEED_FASTEST] = GetMoveDirectionFastestAnimNum, }; u8 (*const gMovementActionFuncs_WalkSlowDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *) = { -- cgit v1.2.3 From 4cedd2d551ee10cccb68f4f427a02e777d98c843 Mon Sep 17 00:00:00 2001 From: cbt6 <91667135+cbt6@users.noreply.github.com> Date: Wed, 3 Nov 2021 01:01:07 +0800 Subject: Rename WalkFastest functions to WalkFaster --- .../object_events/movement_action_func_tables.h | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'src/data') diff --git a/src/data/object_events/movement_action_func_tables.h b/src/data/object_events/movement_action_func_tables.h index 97dace044..729b4fe23 100755 --- a/src/data/object_events/movement_action_func_tables.h +++ b/src/data/object_events/movement_action_func_tables.h @@ -85,14 +85,14 @@ u8 MovementAction_RideWaterCurrentLeft_Step0(struct ObjectEvent *, struct Sprite u8 MovementAction_RideWaterCurrentLeft_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_RideWaterCurrentRight_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_RideWaterCurrentRight_Step1(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_WalkFastestDown_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_WalkFastestDown_Step1(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_WalkFastestUp_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_WalkFastestUp_Step1(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_WalkFastestLeft_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_WalkFastestLeft_Step1(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_WalkFastestRight_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_WalkFastestRight_Step1(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_WalkFasterDown_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_WalkFasterDown_Step1(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_WalkFasterUp_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_WalkFasterUp_Step1(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_WalkFasterLeft_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_WalkFasterLeft_Step1(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_WalkFasterRight_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_WalkFasterRight_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_SlideDown_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_SlideDown_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_SlideUp_Step0(struct ObjectEvent *, struct Sprite *); @@ -307,10 +307,10 @@ u8 (*const gMovementActionFuncs_RideWaterCurrentDown[])(struct ObjectEvent *, st u8 (*const gMovementActionFuncs_RideWaterCurrentUp[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_RideWaterCurrentLeft[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_RideWaterCurrentRight[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_WalkFastestDown[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_WalkFastestUp[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_WalkFastestLeft[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_WalkFastestRight[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkFasterDown[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkFasterUp[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkFasterLeft[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkFasterRight[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_SlideDown[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_SlideUp[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_SlideLeft[])(struct ObjectEvent *, struct Sprite *); @@ -467,10 +467,10 @@ u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *) [MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP] = gMovementActionFuncs_RideWaterCurrentUp, [MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT] = gMovementActionFuncs_RideWaterCurrentLeft, [MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT] = gMovementActionFuncs_RideWaterCurrentRight, - [MOVEMENT_ACTION_WALK_FASTEST_DOWN] = gMovementActionFuncs_WalkFastestDown, - [MOVEMENT_ACTION_WALK_FASTEST_UP] = gMovementActionFuncs_WalkFastestUp, - [MOVEMENT_ACTION_WALK_FASTEST_LEFT] = gMovementActionFuncs_WalkFastestLeft, - [MOVEMENT_ACTION_WALK_FASTEST_RIGHT] = gMovementActionFuncs_WalkFastestRight, + [MOVEMENT_ACTION_WALK_FASTER_DOWN] = gMovementActionFuncs_WalkFasterDown, + [MOVEMENT_ACTION_WALK_FASTER_UP] = gMovementActionFuncs_WalkFasterUp, + [MOVEMENT_ACTION_WALK_FASTER_LEFT] = gMovementActionFuncs_WalkFasterLeft, + [MOVEMENT_ACTION_WALK_FASTER_RIGHT] = gMovementActionFuncs_WalkFasterRight, [MOVEMENT_ACTION_SLIDE_DOWN] = gMovementActionFuncs_SlideDown, [MOVEMENT_ACTION_SLIDE_UP] = gMovementActionFuncs_SlideUp, [MOVEMENT_ACTION_SLIDE_LEFT] = gMovementActionFuncs_SlideLeft, @@ -915,27 +915,27 @@ u8 (*const gMovementActionFuncs_RideWaterCurrentRight[])(struct ObjectEvent *, s MovementAction_PauseSpriteAnim, }; -u8 (*const gMovementActionFuncs_WalkFastestDown[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_WalkFastestDown_Step0, - MovementAction_WalkFastestDown_Step1, +u8 (*const gMovementActionFuncs_WalkFasterDown[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_WalkFasterDown_Step0, + MovementAction_WalkFasterDown_Step1, MovementAction_PauseSpriteAnim, }; -u8 (*const gMovementActionFuncs_WalkFastestUp[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_WalkFastestUp_Step0, - MovementAction_WalkFastestUp_Step1, +u8 (*const gMovementActionFuncs_WalkFasterUp[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_WalkFasterUp_Step0, + MovementAction_WalkFasterUp_Step1, MovementAction_PauseSpriteAnim, }; -u8 (*const gMovementActionFuncs_WalkFastestLeft[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_WalkFastestLeft_Step0, - MovementAction_WalkFastestLeft_Step1, +u8 (*const gMovementActionFuncs_WalkFasterLeft[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_WalkFasterLeft_Step0, + MovementAction_WalkFasterLeft_Step1, MovementAction_PauseSpriteAnim, }; -u8 (*const gMovementActionFuncs_WalkFastestRight[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_WalkFastestRight_Step0, - MovementAction_WalkFastestRight_Step1, +u8 (*const gMovementActionFuncs_WalkFasterRight[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_WalkFasterRight_Step0, + MovementAction_WalkFasterRight_Step1, MovementAction_PauseSpriteAnim, }; -- cgit v1.2.3 From 510ccbdf4cdc380594d9ee253fc209cb477d9df4 Mon Sep 17 00:00:00 2001 From: cbt6 <91667135+cbt6@users.noreply.github.com> Date: Wed, 3 Nov 2021 02:56:23 +0800 Subject: Move definition of constants for movement speed --- src/data/object_events/movement_action_func_tables.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/data') diff --git a/src/data/object_events/movement_action_func_tables.h b/src/data/object_events/movement_action_func_tables.h index 729b4fe23..aa55c31ef 100755 --- a/src/data/object_events/movement_action_func_tables.h +++ b/src/data/object_events/movement_action_func_tables.h @@ -602,14 +602,6 @@ u8 (*const gMovementActionFuncs_FaceRight[])(struct ObjectEvent *, struct Sprite MovementAction_PauseSpriteAnim, }; -enum { - MOVE_SPEED_NORMAL, // walking - MOVE_SPEED_FAST_1, // running / surfing / sliding (ice tile) - MOVE_SPEED_FAST_2, // water current / acro bike - MOVE_SPEED_FASTER, // mach bike's max speed - MOVE_SPEED_FASTEST, -}; - static u8 (*const sDirectionAnimFuncsBySpeed[])(u8) = { [MOVE_SPEED_NORMAL] = GetMoveDirectionAnimNum, [MOVE_SPEED_FAST_1] = GetMoveDirectionFastAnimNum, -- cgit v1.2.3