Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Issue#8725: refactoring _currentTrackBegin and _previousTrackPiece in Ride.cpp to use CoordsXYZ struct #8759

Merged
merged 6 commits into from Feb 24, 2019

Conversation

@ndngo
Copy link
Contributor

commented Feb 23, 2019

In the Ride.cpp file,

uint16_t _currentTrackBeginX;
uint16_t _currentTrackBeginY;
uint16_t _currentTrackBeginZ;

were refactored to use the CoordsXYZ struct

CoordsXYZ _previousTrackPiece;
struct CoordsXYZ
{
    int32_t x = 0;
    int32_t y = 0;
    int32_t z = 0;

    CoordsXYZ() = default;
    constexpr CoordsXYZ(int32_t _x, int32_t _y, int32_t _z)
        : x(_x)
        , y(_y)
        , z(_z)
    {
    }
};

such that

x = _currentTrackBeginX;
y = _currentTrackBeginY;
z = _currentTrackBeginZ;

becomes

x = _currentTrackBegin.x;
y = _currentTrackBegin.y;
z = _currentTrackBegin.z;

The same refactoring logic was used to refactor _previousTrackPiece.

ndngo added 2 commits Feb 23, 2019

@ndngo ndngo changed the title Fix for Issue#8725: refactoring _currentTrackBegin and _previousTrackPiece to use CoordsXYZ struct Fix for Issue#8725: refactoring _currentTrackBegin and _previousTrackPiece in Ride.cpp to use CoordsXYZ struct Feb 23, 2019

@IntelOrca

This comment has been minimized.

Copy link
Contributor

commented Feb 24, 2019

You will also need to apply changes to other source files which use _currentTrackBegin and _previousTrackPiece

ndngo added 2 commits Feb 24, 2019
@@ -289,7 +289,7 @@ static constexpr const rct_string_id RideConfigurationStringIds[] = {
STR_HELIX_DOWN_LEFT, // 108
STR_HELIX_DOWN_RIGHT, // 109
STR_BASE_SIZE_2_X_2, // 110
STR_BASE_SIZE_4_X_4, // 111
STR_BASE_SIZE_4_X_4, // ****111

This comment has been minimized.

Copy link
@duncanspumpkin

duncanspumpkin Feb 24, 2019

Contributor

Unsure what this change has been made for. Please revert.

@duncanspumpkin
Copy link
Contributor

left a comment

Looks good. Almost there just need to make a formatting adjustment to keep the clang-format ci happy.

If your unsure how to find more information on that look below where it says continuous-integration/travis-ci/pr — The Travis CI build failed and click details. Then when on Travis select the clang format option and it will tell you which line needs adjusting.

ndngo added 2 commits Feb 24, 2019
Removed typo
Removed accidental addition to comment
Fixed clang formatting
added new line to stay within line length limit

@duncanspumpkin duncanspumpkin merged commit 300fd3a into OpenRCT2:develop Feb 24, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.