Fix build in clang

This commit is contained in:
Christian F. Coors 2017-11-14 20:36:12 +01:00 committed by Michał Janiszewski
parent 5409dedb7e
commit 58e8ef5de4
3 changed files with 13 additions and 31 deletions

View File

@ -656,27 +656,15 @@ static void window_editor_scenario_options_financial_mousedown(rct_window *w, rc
break;
case WIDX_INTEREST_RATE_INCREASE:
if (gBankLoanInterestRate < 80) {
if (gBankLoanInterestRate < 0) {
game_do_command(
0,
GAME_COMMAND_FLAG_APPLY,
EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE,
0,
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
0,
0
);
} else {
game_do_command(
0,
GAME_COMMAND_FLAG_APPLY,
EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE,
gBankLoanInterestRate + 1,
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
0,
0
);
}
game_do_command(
0,
GAME_COMMAND_FLAG_APPLY,
EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE,
gBankLoanInterestRate + 1,
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
0,
0
);
} else {
context_show_error(STR_CANT_INCREASE_INTEREST_RATE, STR_NONE);
}

View File

@ -1202,14 +1202,8 @@ void game_load_init()
mainWindow->viewport->zoom = gSavedViewZoom;
gCurrentRotation = gSavedViewRotation;
if (zoomDifference != 0) {
if (zoomDifference < 0) {
zoomDifference = -zoomDifference;
mainWindow->viewport->view_width >>= zoomDifference;
mainWindow->viewport->view_height >>= zoomDifference;
} else {
mainWindow->viewport->view_width <<= zoomDifference;
mainWindow->viewport->view_height <<= zoomDifference;
}
mainWindow->viewport->view_width <<= zoomDifference;
mainWindow->viewport->view_height <<= zoomDifference;
}
mainWindow->saved_view_x -= mainWindow->viewport->view_width >> 1;
mainWindow->saved_view_y -= mainWindow->viewport->view_height >> 1;

View File

@ -62,7 +62,7 @@ namespace RCT1
COLOUR_BRIGHT_YELLOW,
COLOUR_ICY_BLUE
};
if (colour < 0 || colour >= Util::CountOf(map))
if (colour >= Util::CountOf(map))
{
log_warning("Unsupported RCT1 colour.");
return COLOUR_BLACK;
@ -110,7 +110,7 @@ namespace RCT1
PEEP_SPRITE_TYPE_CHICKEN, // 0x21
PEEP_SPRITE_TYPE_LEMONADE, // 0x22
};
if (rct1SpriteType < 0 || rct1SpriteType >= Util::CountOf(map))
if (rct1SpriteType >= Util::CountOf(map))
{
log_warning("Unsupported RCT1 peep sprite type: %d.", rct1SpriteType);
return PEEP_SPRITE_TYPE_NORMAL;