From 9782b7bb0af914d749b125c3a0ae56cccc99c8e3 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 4 Nov 2011 13:40:59 +0000 Subject: (svn r23110) -Codechange: let the flying altitude return ints are well --- src/aircraft.h | 2 +- src/aircraft_cmd.cpp | 6 +++--- src/elrail.cpp | 2 +- src/tunnelbridge_cmd.cpp | 6 +++--- src/vehicle.cpp | 2 +- src/viewport.cpp | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/aircraft.h b/src/aircraft.h index 5aa032d97..42463492c 100644 --- a/src/aircraft.h +++ b/src/aircraft.h @@ -34,7 +34,7 @@ void UpdateAircraftCache(Aircraft *v); void AircraftLeaveHangar(Aircraft *v, Direction exit_dir); void AircraftNextAirportPos_and_Order(Aircraft *v); void SetAircraftPosition(Aircraft *v, int x, int y, int z); -byte GetAircraftFlyingAltitude(const Aircraft *v); +int GetAircraftFlyingAltitude(const Aircraft *v); /** * Aircraft, helicopters, rotors and their shadows belong to this class. diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index e259bcbc3..7308392d2 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -630,14 +630,14 @@ static int UpdateAircraftSpeed(Aircraft *v, uint speed_limit = SPEED_LIMIT_NONE, * @param v The vehicle. Should be an aircraft * @returns Altitude in pixel units */ -byte GetAircraftFlyingAltitude(const Aircraft *v) +int GetAircraftFlyingAltitude(const Aircraft *v) { if (v->subtype == AIR_HELICOPTER) return HELI_FLIGHT_ALTITUDE; /* Make sure Aircraft fly no lower so that they don't conduct * CFITs (controlled flight into terrain) */ - byte base_altitude = PLANE_HOLDING_ALTITUDE; + int base_altitude = PLANE_HOLDING_ALTITUDE; /* Make sure eastbound and westbound planes do not "crash" into each * other by providing them with vertical seperation @@ -776,7 +776,7 @@ static bool AircraftController(Aircraft *v) count = UpdateAircraftSpeed(v); if (count > 0) { v->tile = 0; - byte z_dest = GetAircraftFlyingAltitude(v); + int z_dest = GetAircraftFlyingAltitude(v); /* Reached altitude? */ if (v->z_pos >= z_dest) { diff --git a/src/elrail.cpp b/src/elrail.cpp index 3734b919b..9aedfc6e5 100644 --- a/src/elrail.cpp +++ b/src/elrail.cpp @@ -315,7 +315,7 @@ static void DrawCatenaryRailway(const TileInfo *ti) }; SpriteID pylon_base = (halftile_corner != CORNER_INVALID && HasBit(edge_corners[i], halftile_corner)) ? pylon_halftile : pylon_normal; TileIndex neighbour = ti->tile + TileOffsByDiagDir(i); - byte elevation = GetPCPElevation(ti->tile, i); + int elevation = GetPCPElevation(ti->tile, i); /* Here's one of the main headaches. GetTileSlope does not correct for possibly * existing foundataions, so we do have to do that manually later on.*/ diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 067b8f219..c85617758 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -794,7 +794,7 @@ static CommandCost DoClearBridge(TileIndex tile, DoCommandFlag flags) /* read this value before actual removal of bridge */ bool rail = GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL; Owner owner = GetTileOwner(tile); - uint height = GetBridgeHeight(tile); + int height = GetBridgeHeight(tile); Train *v = NULL; if (rail && HasTunnelBridgeReservation(tile)) { @@ -807,7 +807,7 @@ static CommandCost DoClearBridge(TileIndex tile, DoCommandFlag flags) for (TileIndex c = tile + delta; c != endtile; c += delta) { /* do not let trees appear from 'nowhere' after removing bridge */ if (IsNormalRoadTile(c) && GetRoadside(c) == ROADSIDE_TREES) { - uint minz = GetTileMaxZ(c) + 3; + int minz = GetTileMaxZ(c) + 3; if (height < minz) SetRoadside(c, ROADSIDE_PAVED); } ClearBridgeMiddle(c); @@ -950,7 +950,7 @@ static void DrawBridgePillars(const PalSpriteID *psid, const TileInfo *ti, Axis * @param overlay do we want to still see the road? * @param head are we drawing bridge head? */ -static void DrawBridgeTramBits(int x, int y, byte z, int offset, bool overlay, bool head) +static void DrawBridgeTramBits(int x, int y, int z, int offset, bool overlay, bool head) { static const SpriteID tram_offsets[2][6] = { { 107, 108, 109, 110, 111, 112 }, { 4, 5, 15, 16, 17, 18 } }; static const SpriteID back_offsets[6] = { 95, 96, 99, 102, 100, 101 }; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 2ace7f018..e15638f69 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -408,7 +408,7 @@ bool HasVehicleOnPos(TileIndex tile, void *data, VehicleFromPosProc *proc) } /** - * Callback that returns 'real' vehicles lower or at height \c *(byte*)data . + * Callback that returns 'real' vehicles lower or at height \c *(int*)data . * @param v Vehicle to examine. * @param data Pointer to height data. * @return \a v if conditions are met, else \c NULL. diff --git a/src/viewport.cpp b/src/viewport.cpp index 58fa27606..6beb60836 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -599,7 +599,7 @@ void OffsetGroundSprite(int x, int y) * @param z position z of the sprite. * @param sub Only draw a part of the sprite. */ -static void AddCombinedSprite(SpriteID image, PaletteID pal, int x, int y, byte z, const SubSprite *sub) +static void AddCombinedSprite(SpriteID image, PaletteID pal, int x, int y, int z, const SubSprite *sub) { Point pt = RemapCoords(x, y, z); const Sprite *spr = GetSprite(image & SPRITE_MASK, ST_NORMAL); @@ -984,7 +984,7 @@ draw_inner: if (!is_redsq) DrawTileSelectionRect(ti, _thd.make_square_red ? PALETTE_SEL_TILE_RED : PAL_NONE); } else if (_thd.drawstyle & HT_POINT) { /* Figure out the Z coordinate for the single dot. */ - byte z = 0; + int z = 0; FoundationPart foundation_part = FOUNDATION_PART_NORMAL; if (ti->tileh & SLOPE_N) { z += TILE_HEIGHT; -- cgit v1.2.3-70-g09d2