diff --git a/examples/tappyplane/tappyplane.cpp b/examples/tappyplane/tappyplane.cpp index ae786bc..95bab15 100644 --- a/examples/tappyplane/tappyplane.cpp +++ b/examples/tappyplane/tappyplane.cpp @@ -339,7 +339,8 @@ struct Plane { // We'll make the size half the size of the texture. // (If you want 1:1 size, you need to double the scale of the sprite.) // We could use 'SCALE' here, but we'll keep this for clarity. - // (Although, now we no longer need 'SCALE' as a constant in this entire struct.) + // (Although, now we no longer need 'SCALE' as a constant in this entire + // struct.) auto size = paradiso::Vector2{ paradiso::Vector2::make(SCALE_X, SCALE_Y)}; @@ -550,71 +551,72 @@ struct App { enum class WorldType { Dirt, Grass, Ice, Rock, Snow }; enum class PlaneType { Blue, Green, Red, Yellow }; - static auto create(WorldType world_type = WorldType::Grass, PlaneType plane_type = PlaneType::Red) -> App { + static auto create(WorldType world_type = WorldType::Grass, + PlaneType plane_type = PlaneType::Red) -> App { auto app = App{}; paradiso::BitmapIO::get().set_path( paradiso::get_executable_path().parent_path().string() + "/assets"); // Yes, I'm lazy, how did you know? - const char *ground_filename = nullptr; - const char *rocks_top_filename = nullptr; - const char *rocks_bottom_filename = nullptr; + const char* ground_filename = nullptr; + const char* rocks_top_filename = nullptr; + const char* rocks_bottom_filename = nullptr; switch (world_type) { - case WorldType::Dirt: - ground_filename = "PNG/groundDirt.png"; - rocks_top_filename = "PNG/rockDown.png"; - rocks_bottom_filename = "PNG/rock.png"; - break; - case WorldType::Ice: - ground_filename = "PNG/groundIce.png"; - rocks_top_filename = "PNG/rockIceDown.png"; - rocks_bottom_filename = "PNG/rockIce.png"; - break; - case WorldType::Rock: - ground_filename = "PNG/groundRock.png"; - rocks_top_filename = "PNG/rockDown.png"; - rocks_bottom_filename = "PNG/rock.png"; - break; - case WorldType::Snow: - ground_filename = "PNG/groundSnow.png"; - rocks_top_filename = "PNG/rockSnowDown.png"; - rocks_bottom_filename = "PNG/rockSnow.png"; - break; - default: - case WorldType::Grass: - ground_filename = "PNG/groundGrass.png"; - rocks_top_filename = "PNG/rockGrassDown.png"; - rocks_bottom_filename = "PNG/rockGrass.png"; - break; + case WorldType::Dirt: + ground_filename = "PNG/groundDirt.png"; + rocks_top_filename = "PNG/rockDown.png"; + rocks_bottom_filename = "PNG/rock.png"; + break; + case WorldType::Ice: + ground_filename = "PNG/groundIce.png"; + rocks_top_filename = "PNG/rockIceDown.png"; + rocks_bottom_filename = "PNG/rockIce.png"; + break; + case WorldType::Rock: + ground_filename = "PNG/groundRock.png"; + rocks_top_filename = "PNG/rockDown.png"; + rocks_bottom_filename = "PNG/rock.png"; + break; + case WorldType::Snow: + ground_filename = "PNG/groundSnow.png"; + rocks_top_filename = "PNG/rockSnowDown.png"; + rocks_bottom_filename = "PNG/rockSnow.png"; + break; + default: + case WorldType::Grass: + ground_filename = "PNG/groundGrass.png"; + rocks_top_filename = "PNG/rockGrassDown.png"; + rocks_bottom_filename = "PNG/rockGrass.png"; + break; } // Yes, I'm lazy, how did you know? - const char *plane_1_filename = nullptr; - const char *plane_2_filename = nullptr; - const char *plane_3_filename = nullptr; + const char* plane_1_filename = nullptr; + const char* plane_2_filename = nullptr; + const char* plane_3_filename = nullptr; switch (plane_type) { - case PlaneType::Blue: - plane_1_filename = "PNG/Planes/planeBlue1.png"; - plane_2_filename = "PNG/Planes/planeBlue2.png"; - plane_3_filename = "PNG/Planes/planeBlue3.png"; - break; - case PlaneType::Green: - plane_1_filename = "PNG/Planes/planeGreen1.png"; - plane_2_filename = "PNG/Planes/planeGreen2.png"; - plane_3_filename = "PNG/Planes/planeGreen3.png"; - break; - case PlaneType::Yellow: - plane_1_filename = "PNG/Planes/planeYellow1.png"; - plane_2_filename = "PNG/Planes/planeYellow2.png"; - plane_3_filename = "PNG/Planes/planeYellow3.png"; - break; - default: - case PlaneType::Red: - plane_1_filename = "PNG/Planes/planeRed1.png"; - plane_2_filename = "PNG/Planes/planeRed2.png"; - plane_3_filename = "PNG/Planes/planeRed3.png"; - break; + case PlaneType::Blue: + plane_1_filename = "PNG/Planes/planeBlue1.png"; + plane_2_filename = "PNG/Planes/planeBlue2.png"; + plane_3_filename = "PNG/Planes/planeBlue3.png"; + break; + case PlaneType::Green: + plane_1_filename = "PNG/Planes/planeGreen1.png"; + plane_2_filename = "PNG/Planes/planeGreen2.png"; + plane_3_filename = "PNG/Planes/planeGreen3.png"; + break; + case PlaneType::Yellow: + plane_1_filename = "PNG/Planes/planeYellow1.png"; + plane_2_filename = "PNG/Planes/planeYellow2.png"; + plane_3_filename = "PNG/Planes/planeYellow3.png"; + break; + default: + case PlaneType::Red: + plane_1_filename = "PNG/Planes/planeRed1.png"; + plane_2_filename = "PNG/Planes/planeRed2.png"; + plane_3_filename = "PNG/Planes/planeRed3.png"; + break; } auto assets = std::array{