forked from Hartmut/paradiso
Format the code using clang-format
This commit is contained in:
parent
80a0919c3f
commit
b6805f7164
1 changed files with 57 additions and 55 deletions
|
@ -339,7 +339,8 @@ struct Plane {
|
||||||
// We'll make the size half the size of the texture.
|
// 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.)
|
// (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.
|
// 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<float>{
|
auto size = paradiso::Vector2<float>{
|
||||||
paradiso::Vector2<float>::make(SCALE_X, SCALE_Y)};
|
paradiso::Vector2<float>::make(SCALE_X, SCALE_Y)};
|
||||||
|
|
||||||
|
@ -550,71 +551,72 @@ struct App {
|
||||||
enum class WorldType { Dirt, Grass, Ice, Rock, Snow };
|
enum class WorldType { Dirt, Grass, Ice, Rock, Snow };
|
||||||
enum class PlaneType { Blue, Green, Red, Yellow };
|
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{};
|
auto app = App{};
|
||||||
|
|
||||||
paradiso::BitmapIO::get().set_path(
|
paradiso::BitmapIO::get().set_path(
|
||||||
paradiso::get_executable_path().parent_path().string() + "/assets");
|
paradiso::get_executable_path().parent_path().string() + "/assets");
|
||||||
|
|
||||||
// Yes, I'm lazy, how did you know?
|
// Yes, I'm lazy, how did you know?
|
||||||
const char *ground_filename = nullptr;
|
const char* ground_filename = nullptr;
|
||||||
const char *rocks_top_filename = nullptr;
|
const char* rocks_top_filename = nullptr;
|
||||||
const char *rocks_bottom_filename = nullptr;
|
const char* rocks_bottom_filename = nullptr;
|
||||||
switch (world_type) {
|
switch (world_type) {
|
||||||
case WorldType::Dirt:
|
case WorldType::Dirt:
|
||||||
ground_filename = "PNG/groundDirt.png";
|
ground_filename = "PNG/groundDirt.png";
|
||||||
rocks_top_filename = "PNG/rockDown.png";
|
rocks_top_filename = "PNG/rockDown.png";
|
||||||
rocks_bottom_filename = "PNG/rock.png";
|
rocks_bottom_filename = "PNG/rock.png";
|
||||||
break;
|
break;
|
||||||
case WorldType::Ice:
|
case WorldType::Ice:
|
||||||
ground_filename = "PNG/groundIce.png";
|
ground_filename = "PNG/groundIce.png";
|
||||||
rocks_top_filename = "PNG/rockIceDown.png";
|
rocks_top_filename = "PNG/rockIceDown.png";
|
||||||
rocks_bottom_filename = "PNG/rockIce.png";
|
rocks_bottom_filename = "PNG/rockIce.png";
|
||||||
break;
|
break;
|
||||||
case WorldType::Rock:
|
case WorldType::Rock:
|
||||||
ground_filename = "PNG/groundRock.png";
|
ground_filename = "PNG/groundRock.png";
|
||||||
rocks_top_filename = "PNG/rockDown.png";
|
rocks_top_filename = "PNG/rockDown.png";
|
||||||
rocks_bottom_filename = "PNG/rock.png";
|
rocks_bottom_filename = "PNG/rock.png";
|
||||||
break;
|
break;
|
||||||
case WorldType::Snow:
|
case WorldType::Snow:
|
||||||
ground_filename = "PNG/groundSnow.png";
|
ground_filename = "PNG/groundSnow.png";
|
||||||
rocks_top_filename = "PNG/rockSnowDown.png";
|
rocks_top_filename = "PNG/rockSnowDown.png";
|
||||||
rocks_bottom_filename = "PNG/rockSnow.png";
|
rocks_bottom_filename = "PNG/rockSnow.png";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case WorldType::Grass:
|
case WorldType::Grass:
|
||||||
ground_filename = "PNG/groundGrass.png";
|
ground_filename = "PNG/groundGrass.png";
|
||||||
rocks_top_filename = "PNG/rockGrassDown.png";
|
rocks_top_filename = "PNG/rockGrassDown.png";
|
||||||
rocks_bottom_filename = "PNG/rockGrass.png";
|
rocks_bottom_filename = "PNG/rockGrass.png";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Yes, I'm lazy, how did you know?
|
// Yes, I'm lazy, how did you know?
|
||||||
const char *plane_1_filename = nullptr;
|
const char* plane_1_filename = nullptr;
|
||||||
const char *plane_2_filename = nullptr;
|
const char* plane_2_filename = nullptr;
|
||||||
const char *plane_3_filename = nullptr;
|
const char* plane_3_filename = nullptr;
|
||||||
switch (plane_type) {
|
switch (plane_type) {
|
||||||
case PlaneType::Blue:
|
case PlaneType::Blue:
|
||||||
plane_1_filename = "PNG/Planes/planeBlue1.png";
|
plane_1_filename = "PNG/Planes/planeBlue1.png";
|
||||||
plane_2_filename = "PNG/Planes/planeBlue2.png";
|
plane_2_filename = "PNG/Planes/planeBlue2.png";
|
||||||
plane_3_filename = "PNG/Planes/planeBlue3.png";
|
plane_3_filename = "PNG/Planes/planeBlue3.png";
|
||||||
break;
|
break;
|
||||||
case PlaneType::Green:
|
case PlaneType::Green:
|
||||||
plane_1_filename = "PNG/Planes/planeGreen1.png";
|
plane_1_filename = "PNG/Planes/planeGreen1.png";
|
||||||
plane_2_filename = "PNG/Planes/planeGreen2.png";
|
plane_2_filename = "PNG/Planes/planeGreen2.png";
|
||||||
plane_3_filename = "PNG/Planes/planeGreen3.png";
|
plane_3_filename = "PNG/Planes/planeGreen3.png";
|
||||||
break;
|
break;
|
||||||
case PlaneType::Yellow:
|
case PlaneType::Yellow:
|
||||||
plane_1_filename = "PNG/Planes/planeYellow1.png";
|
plane_1_filename = "PNG/Planes/planeYellow1.png";
|
||||||
plane_2_filename = "PNG/Planes/planeYellow2.png";
|
plane_2_filename = "PNG/Planes/planeYellow2.png";
|
||||||
plane_3_filename = "PNG/Planes/planeYellow3.png";
|
plane_3_filename = "PNG/Planes/planeYellow3.png";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case PlaneType::Red:
|
case PlaneType::Red:
|
||||||
plane_1_filename = "PNG/Planes/planeRed1.png";
|
plane_1_filename = "PNG/Planes/planeRed1.png";
|
||||||
plane_2_filename = "PNG/Planes/planeRed2.png";
|
plane_2_filename = "PNG/Planes/planeRed2.png";
|
||||||
plane_3_filename = "PNG/Planes/planeRed3.png";
|
plane_3_filename = "PNG/Planes/planeRed3.png";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto assets = std::array{
|
auto assets = std::array{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue