-
-
Notifications
You must be signed in to change notification settings - Fork 494
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
Refactor level flipping #1922
Refactor level flipping #1922
Conversation
Self-requested a review because I've noticed a few ways to improve the code, I'll check that in-depth and I''ll take the time to write my comments properly whenever possible (might take a few days, feel free to remind me if I seem to have forgotten). |
@@ -33,20 +33,11 @@ class Decal; | |||
/** Vertically or horizontally flip a level */ | |||
class FlipLevelTransformer final : public LevelTransformer | |||
{ | |||
public: | |||
static Flip transform_flip(Flip flip); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any upside to use this rather than taking the flip as (non-const) reference and modifying it directly that way?
(Suggesting that option as it would avoid an extra assignment in the code from callers)
src/object/platform.cpp
Outdated
void | ||
Platform::on_flip(float height) | ||
{ | ||
if (Path* const path = get_path()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have used Path* const
at a few places (I won't mark them all as I usually do), which is a const pointer to a non-const object; is there a particular reason to do it this way?
Please rebase! |
I will do that as soon as possible |
a63a6fd
to
529c9e8
Compare
Fixes issues with level flipping.