mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r19817) -Fix: MSVC compile warnings
This commit is contained in:
parent
548dd91ef0
commit
241dd9a9f5
|
@ -525,13 +525,13 @@ static bool DisasterTick_Big_Ufo(DisasterVehicle *v)
|
|||
}
|
||||
DisasterVehicle *u = new DisasterVehicle();
|
||||
|
||||
InitializeDisasterVehicle(u, -6 * TILE_SIZE, v->y_pos, 135, DIR_SW, ST_BIG_UFO_DESTROYER);
|
||||
InitializeDisasterVehicle(u, -6 * (int)TILE_SIZE, v->y_pos, 135, DIR_SW, ST_BIG_UFO_DESTROYER);
|
||||
u->big_ufo_destroyer_target = v->index;
|
||||
|
||||
DisasterVehicle *w = new DisasterVehicle();
|
||||
|
||||
u->SetNext(w);
|
||||
InitializeDisasterVehicle(w, -6 * TILE_SIZE, v->y_pos, 0, DIR_SW, ST_BIG_UFO_DESTROYER_SHADOW);
|
||||
InitializeDisasterVehicle(w, -6 * (int)TILE_SIZE, v->y_pos, 0, DIR_SW, ST_BIG_UFO_DESTROYER_SHADOW);
|
||||
w->vehstatus |= VS_SHADOW;
|
||||
} else if (v->current_order.GetDestination() == 0) {
|
||||
int x = TileX(v->dest_tile) * TILE_SIZE;
|
||||
|
@ -767,7 +767,7 @@ static void Disaster_Helicopter_Init()
|
|||
|
||||
DisasterVehicle *v = new DisasterVehicle();
|
||||
|
||||
int x = -16 * TILE_SIZE;
|
||||
int x = -16 * (int)TILE_SIZE;
|
||||
int y = TileY(found->location.tile) * TILE_SIZE + 37;
|
||||
|
||||
InitializeDisasterVehicle(v, x, y, 135, DIR_SW, ST_HELICOPTER);
|
||||
|
|
|
@ -1533,7 +1533,7 @@ void DrawDirtyBlocks()
|
|||
|
||||
}
|
||||
} while (b++, (x += DIRTY_BLOCK_WIDTH) != w);
|
||||
} while (b += -(w / DIRTY_BLOCK_WIDTH) + _dirty_bytes_per_line, (y += DIRTY_BLOCK_HEIGHT) != h);
|
||||
} while (b += -(int)(w / DIRTY_BLOCK_WIDTH) + _dirty_bytes_per_line, (y += DIRTY_BLOCK_HEIGHT) != h);
|
||||
|
||||
_invalid_rect.left = w;
|
||||
_invalid_rect.top = h;
|
||||
|
|
|
@ -2096,10 +2096,10 @@ static void DrawTrackBits(TileInfo *ti, TrackBits track)
|
|||
DrawGroundSprite(_track_sloped_sprites[ti->tileh - 1] + rti->base_sprites.single_sloped - 20, PALETTE_CRASH);
|
||||
}
|
||||
}
|
||||
if (pbs & TRACK_BIT_UPPER) DrawGroundSprite(rti->base_sprites.single_n, PALETTE_CRASH, NULL, 0, ti->tileh & SLOPE_N ? -TILE_HEIGHT : 0);
|
||||
if (pbs & TRACK_BIT_LOWER) DrawGroundSprite(rti->base_sprites.single_s, PALETTE_CRASH, NULL, 0, ti->tileh & SLOPE_S ? -TILE_HEIGHT : 0);
|
||||
if (pbs & TRACK_BIT_LEFT) DrawGroundSprite(rti->base_sprites.single_w, PALETTE_CRASH, NULL, 0, ti->tileh & SLOPE_W ? -TILE_HEIGHT : 0);
|
||||
if (pbs & TRACK_BIT_RIGHT) DrawGroundSprite(rti->base_sprites.single_e, PALETTE_CRASH, NULL, 0, ti->tileh & SLOPE_E ? -TILE_HEIGHT : 0);
|
||||
if (pbs & TRACK_BIT_UPPER) DrawGroundSprite(rti->base_sprites.single_n, PALETTE_CRASH, NULL, 0, ti->tileh & SLOPE_N ? -(int)TILE_HEIGHT : 0);
|
||||
if (pbs & TRACK_BIT_LOWER) DrawGroundSprite(rti->base_sprites.single_s, PALETTE_CRASH, NULL, 0, ti->tileh & SLOPE_S ? -(int)TILE_HEIGHT : 0);
|
||||
if (pbs & TRACK_BIT_LEFT) DrawGroundSprite(rti->base_sprites.single_w, PALETTE_CRASH, NULL, 0, ti->tileh & SLOPE_W ? -(int)TILE_HEIGHT : 0);
|
||||
if (pbs & TRACK_BIT_RIGHT) DrawGroundSprite(rti->base_sprites.single_e, PALETTE_CRASH, NULL, 0, ti->tileh & SLOPE_E ? -(int)TILE_HEIGHT : 0);
|
||||
}
|
||||
|
||||
if (IsValidCorner(halftile_corner)) {
|
||||
|
@ -2119,7 +2119,7 @@ static void DrawTrackBits(TileInfo *ti, TrackBits track)
|
|||
|
||||
if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasReservedTracks(ti->tile, CornerToTrackBits(halftile_corner))) {
|
||||
static const byte _corner_to_track_sprite[] = {3, 1, 2, 0};
|
||||
DrawGroundSprite(_corner_to_track_sprite[halftile_corner] + rti->base_sprites.single_n, PALETTE_CRASH, NULL, 0, -TILE_HEIGHT);
|
||||
DrawGroundSprite(_corner_to_track_sprite[halftile_corner] + rti->base_sprites.single_n, PALETTE_CRASH, NULL, 0, -(int)TILE_HEIGHT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -386,8 +386,8 @@ static Point TranslateXYToTileCoord(const ViewPort *vp, int x, int y)
|
|||
/* we need to move variables in to the valid range, as the
|
||||
* GetTileZoomCenterWindow() function can call here with invalid x and/or y,
|
||||
* when the user tries to zoom out along the sides of the map */
|
||||
a = Clamp(a, -4 * TILE_SIZE, (int)(MapMaxX() * TILE_SIZE) - 1);
|
||||
b = Clamp(b, -4 * TILE_SIZE, (int)(MapMaxY() * TILE_SIZE) - 1);
|
||||
a = Clamp(a, -4 * (int)TILE_SIZE, (int)(MapMaxX() * TILE_SIZE) - 1);
|
||||
b = Clamp(b, -4 * (int)TILE_SIZE, (int)(MapMaxY() * TILE_SIZE) - 1);
|
||||
|
||||
/* (a, b) is the X/Y-world coordinate that belongs to (x,y) if the landscape would be completely flat on height 0.
|
||||
* Now find the Z-world coordinate by fix point iteration.
|
||||
|
@ -2330,9 +2330,9 @@ static void CalcRaildirsDrawstyle(TileHighlightData *thd, int x, int y, int meth
|
|||
/* 'Build' the last half rail tile if needed */
|
||||
if ((offset & TILE_UNIT_MASK) > (TILE_SIZE / 2)) {
|
||||
if (dx + dy >= (int)TILE_SIZE) {
|
||||
x += (dx + dy < 0) ? TILE_SIZE : -TILE_SIZE;
|
||||
x += (dx + dy < 0) ? TILE_SIZE : -(int)TILE_SIZE;
|
||||
} else {
|
||||
y += (dx + dy < 0) ? TILE_SIZE : -TILE_SIZE;
|
||||
y += (dx + dy < 0) ? TILE_SIZE : -(int)TILE_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2365,9 +2365,9 @@ static void CalcRaildirsDrawstyle(TileHighlightData *thd, int x, int y, int meth
|
|||
/* 'Build' the last half rail tile if needed */
|
||||
if ((offset & TILE_UNIT_MASK) > (TILE_SIZE / 2)) {
|
||||
if (dx - dy < 0) {
|
||||
y += (dx > dy) ? TILE_SIZE : -TILE_SIZE;
|
||||
y += (dx > dy) ? TILE_SIZE : -(int)TILE_SIZE;
|
||||
} else {
|
||||
x += (dx < dy) ? TILE_SIZE : -TILE_SIZE;
|
||||
x += (dx < dy) ? TILE_SIZE : -(int)TILE_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue