Mario editor: formatting

This commit is contained in:
2021-05-09 00:46:10 +02:00
parent b54ba5034c
commit 83cda5f860
8 changed files with 595 additions and 458 deletions
+29 -16
View File
@@ -6,24 +6,21 @@
class MarioBlock : public SDLPP::RectangleRender {
public:
MarioBlock(int x, int y, std::shared_ptr<SDLPP::Renderer> renderer, std::shared_ptr<SDLPP::Texture> texture, SDL_Rect src);
MarioBlock( int x, int y, std::shared_ptr< SDLPP::Renderer > renderer,
std::shared_ptr< SDLPP::Texture > texture, SDL_Rect src );
void visit( SDLPP::Visitor &visitor ) override;
void setTool(bool tool = true);
void setTerrain(bool terrain = true);
void setTool( bool tool = true );
void setTerrain( bool terrain = true );
private:
bool _tool = false;
bool _terrain = true;
};
extern const std::vector<uint64_t> possibleBlocks;
extern const std::vector< uint64_t > possibleBlocks;
struct LandType {
enum Value {
OVERWORLD = 0,
UNDERWORLD = 1,
WATER = 2,
BOWSER = 4
};
enum Value { OVERWORLD = 0, UNDERWORLD = 1, WATER = 2, BOWSER = 4 };
};
struct BlockRole {
@@ -35,14 +32,30 @@ struct BlockRole {
};
};
std::shared_ptr<SDLPP::RectangleRender> createTerrainBlock( uint64_t block_id, LandType::Value type, std::shared_ptr<SDLPP::Renderer> &renderer, bool collision = false );
std::shared_ptr<SDLPP::RectangleRender> createTerrainBlock( uint64_t block_id, LandType::Value type, std::shared_ptr<SDLPP::Renderer> &renderer, int x, int y, bool collision = false );
std::shared_ptr<SDLPP::RectangleRender> createTerrainBlock( uint64_t block_id, LandType::Value type, std::shared_ptr<SDLPP::Renderer> &renderer, std::shared_ptr<SDLPP::Texture> texture, bool collision = false );
std::shared_ptr<SDLPP::RectangleRender> createTerrainBlock( uint64_t block_id, LandType::Value type, std::shared_ptr<SDLPP::Renderer> &renderer, int x, int y, std::shared_ptr<SDLPP::Texture> texture, bool collision = false );
std::shared_ptr<SDLPP::RectangleRender> createMario( LandType::Value type, std::shared_ptr<SDLPP::Renderer> &renderer, int x, int y );
std::shared_ptr< SDLPP::RectangleRender >
createTerrainBlock( uint64_t block_id, LandType::Value type,
std::shared_ptr< SDLPP::Renderer > &renderer,
bool collision = false );
std::shared_ptr< SDLPP::RectangleRender >
createTerrainBlock( uint64_t block_id, LandType::Value type,
std::shared_ptr< SDLPP::Renderer > &renderer, int x, int y,
bool collision = false );
std::shared_ptr< SDLPP::RectangleRender >
createTerrainBlock( uint64_t block_id, LandType::Value type,
std::shared_ptr< SDLPP::Renderer > &renderer,
std::shared_ptr< SDLPP::Texture > texture,
bool collision = false );
std::shared_ptr< SDLPP::RectangleRender >
createTerrainBlock( uint64_t block_id, LandType::Value type,
std::shared_ptr< SDLPP::Renderer > &renderer, int x, int y,
std::shared_ptr< SDLPP::Texture > texture,
bool collision = false );
std::shared_ptr< SDLPP::RectangleRender >
createMario( LandType::Value type, std::shared_ptr< SDLPP::Renderer > &renderer,
int x, int y );
SDL_Rect getSourceRectByID( uint64_t id, LandType::Value type );
enum BlockRole::Value getBlockRole(uint64_t id);
enum BlockRole::Value getBlockRole( uint64_t id );
#endif