The primary goal of this PR is to employ normalized coordinates from 0 to 10,000 per quadrant, equivalent to the 0 to 1 coordinate system familiar to the Melee community. I also cleaned up the comments, removing any reference to 0..255 coordinates and updating the angles to be uniformly accurate to 5 decimal places.
In doing so, I chose to refactor the &input and &output parameters of ControllerMode to protected pointers, which are updated to point to the CommunicationBackend's structs, once per update loop.
I also refactored ANALOG_STICK_MIN and ANALOG_STICK_MAX to instead use a single analog_stick_length property of ControllerMode, which is set in the constructor. This was necessary to implement the normalized coordinate systems across different game modes.
ANALOG_STICK_NEUTRAL is still a #define but was moved to state.hpp and is used in place of 128 throughout the codebase, where appropriate.
These changes were made as part of a refactoring pass that I'm doing for my own forks. I'm just submitting this as a PR in case it's preferred here as well.
I have moved these normalized coordinate functions to a PlatformFighter base class, which all platform fighter modes (Melee, PM, Ultimate, and Rivals) now inherit from.
The primary goal of this PR is to employ normalized coordinates from 0 to 10,000 per quadrant, equivalent to the 0 to 1 coordinate system familiar to the Melee community. I also cleaned up the comments, removing any reference to
0..255
coordinates and updating the angles to be uniformly accurate to 5 decimal places.In doing so, I chose to refactor the
&input
and&output
parameters ofControllerMode
toprotected
pointers, which are updated to point to theCommunicationBackend
's structs, once per update loop.I also refactored
ANALOG_STICK_MIN
andANALOG_STICK_MAX
to instead use a singleanalog_stick_length
property ofControllerMode
, which is set in the constructor. This was necessary to implement the normalized coordinate systems across different game modes.ANALOG_STICK_NEUTRAL
is still a#define
but was moved tostate.hpp
and is used in place of128
throughout the codebase, where appropriate.These changes were made as part of a refactoring pass that I'm doing for my own forks. I'm just submitting this as a PR in case it's preferred here as well.
I have moved these normalized coordinate functions to a
PlatformFighter
base class, which all platform fighter modes (Melee, PM, Ultimate, and Rivals) now inherit from.