Mario Editor: add land type switching
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "editor_visitor.hpp"
|
||||
#include "../sdlpp/sdlpp_renderobject.hpp"
|
||||
#include "blocks.hpp"
|
||||
#include "objectids.hpp"
|
||||
#include "edit_box.hpp"
|
||||
#include "tool_box.hpp"
|
||||
@@ -91,18 +92,25 @@ bool MouseVisitor::moveCharactersRight( uint64_t flags ) {
|
||||
void ToolVisitor::visit( const SDLPP::RenderObject &obj ) {
|
||||
auto id = obj.getCollisions()[0]->getId();
|
||||
switch ( id ) {
|
||||
case EDITOR_TERRAIN_ID:
|
||||
case EDITOR_TERRAIN_ID: {
|
||||
const MarioBlock &m_obj = dynamic_cast<const MarioBlock&>(obj);
|
||||
remove_block = true;
|
||||
if ( obj.getId() == source_id &&
|
||||
m_obj.getType() == source_type &&
|
||||
getVisitorType() == VisitorType::Terrain ) {
|
||||
add_block = false;
|
||||
}
|
||||
case EDITOR_CHARACTER_ID:
|
||||
}
|
||||
break;
|
||||
case EDITOR_CHARACTER_ID: {
|
||||
const MarioBlock &m_obj = dynamic_cast<const MarioBlock&>(obj);
|
||||
remove_block = true;
|
||||
if ( obj.getId() == source_id &&
|
||||
m_obj.getType() == source_type &&
|
||||
getVisitorType() == VisitorType::Modifier ) {
|
||||
add_block = false;
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user