diff --git a/mario/editor.cpp b/mario/editor.cpp index 6f89629..7f3c051 100644 --- a/mario/editor.cpp +++ b/mario/editor.cpp @@ -375,7 +375,7 @@ void selectNextTool() { break; } int addition = 1; - if ( global_vars.tool.index % multiplier == ( multiplier - 1 ) ) + if ( global_vars.tool.index % multiplier == static_cast( multiplier - 1 ) ) addition = multiplier + 1; if ( global_vars.tool.index == max_index ) return; @@ -806,6 +806,7 @@ void populateToolGrid( tool_store.push_back( createMario( global_vars.current_world_type, renderer, 0, 0 ) ); else + // fall through case ToolType::BLOCK: case ToolType::MOD: tool_store.push_back( createTerrainBlock( diff --git a/sdlpp/sdlpp_mouse.cpp b/sdlpp/sdlpp_mouse.cpp index 020dd2d..170b06b 100644 --- a/sdlpp/sdlpp_mouse.cpp +++ b/sdlpp/sdlpp_mouse.cpp @@ -20,10 +20,19 @@ SDLPP::Mouse::getMousePositionDouble( const SDLPP::Renderer &r, ( r.getDoubleDimensions() - Vec2D< double >( 1.0, 1.0 ) ) / 2; switch ( alignment_x ) { case SDLPP::OBJ_CENTER: - ret -= additions; + ret -= { additions.getX(), 0 }; break; case SDLPP::OBJ_END: - ret -= 2 * additions; + ret -= { 2 * additions.getX(), 0 }; + default: + break; + } + switch ( alignment_y ) { + case SDLPP::OBJ_CENTER: + ret -= { 0, additions.getY() }; + break; + case SDLPP::OBJ_END: + ret -= { 0, 2 * additions.getY() }; default: break; } diff --git a/sdlpp/sdlpp_rectrenderer.cpp b/sdlpp/sdlpp_rectrenderer.cpp index f3592e0..ddc16e9 100644 --- a/sdlpp/sdlpp_rectrenderer.cpp +++ b/sdlpp/sdlpp_rectrenderer.cpp @@ -146,9 +146,9 @@ void RectangleRender::updateSizeAndPosition() { rect.h = std::round( ( current.getY() + original_size.getY() ) * dimension ) - rect.y; - if(rect.w < min_size.getX()) + if(static_cast(rect.w) < min_size.getX()) rect.w = min_size.getX(); - if(rect.h < min_size.getY()) + if(static_cast(rect.h) < min_size.getY()) rect.h = min_size.getY(); if ( polygon ) polygon->updateCollision( collisionPushX(), collisionPushY(),