Mario Editor: add land type switching

This commit is contained in:
2021-05-31 14:03:11 +02:00
parent af94cc0e03
commit cd0a301e52
6 changed files with 145 additions and 31 deletions
+8 -4
View File
@@ -4,6 +4,10 @@
#include "../sdlpp/sdlpp_rectrenderer.hpp"
#include <memory>
struct LandType {
enum Value { OVERWORLD = 0, UNDERWORLD = 1, WATER = 2, BOWSER = 4 };
};
class MarioBlock : public SDLPP::RectangleRender {
public:
MarioBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer,
@@ -13,6 +17,8 @@ public:
void setTerrain( bool terrain = true );
void bounce();
virtual void custom_move(int ticks) override;
void setType(LandType::Value type);
LandType::Value getType() const;
private:
bool _tool = false;
@@ -22,15 +28,13 @@ private:
const int bounce_ticks = 100;
int ticks_to_bounce = bounce_ticks;
SDLPP::Vec2D<double> og_pos = {};
LandType::Value _type;
};
extern const std::vector< uint64_t > possibleBlocks;
extern const std::vector< uint64_t > possibleMods;
extern const std::vector< uint64_t > possibleCharacters;
struct LandType {
enum Value { OVERWORLD = 0, UNDERWORLD = 1, WATER = 2, BOWSER = 4 };
};
extern const std::vector< LandType::Value > possibleLands;
struct BlockRole {
enum Value {