Mario: silence some warnings

This commit is contained in:
zvon 2021-05-31 14:30:28 +02:00
parent 5d20757d43
commit 808f392119
3 changed files with 15 additions and 5 deletions

View File

@ -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<uint64_t>( 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(

View File

@ -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;
}

View File

@ -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<uint64_t>(rect.w) < min_size.getX())
rect.w = min_size.getX();
if(rect.h < min_size.getY())
if(static_cast<uint64_t>(rect.h) < min_size.getY())
rect.h = min_size.getY();
if ( polygon )
polygon->updateCollision( collisionPushX(), collisionPushY(),