Mercurial > hg > openttd
changeset 18274:c761b8c17062 draft
(svn r23110) -Codechange: let the flying altitude return ints are well
author | rubidium <rubidium@openttd.org> |
---|---|
date | Fri, 04 Nov 2011 13:40:59 +0000 |
parents | c7bd632d9cc2 |
children | 893113d8052f |
files | src/aircraft.h src/aircraft_cmd.cpp src/elrail.cpp src/tunnelbridge_cmd.cpp src/vehicle.cpp src/viewport.cpp |
diffstat | 6 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/aircraft.h +++ b/src/aircraft.h @@ -34,7 +34,7 @@ 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.
--- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -630,14 +630,14 @@ * @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 @@ 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) {
--- a/src/elrail.cpp +++ b/src/elrail.cpp @@ -315,7 +315,7 @@ }; 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.*/
--- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -794,7 +794,7 @@ /* 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 @@ 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 @@ * @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 };
--- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -408,7 +408,7 @@ } /** - * 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.
--- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -599,7 +599,7 @@ * @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 @@ 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;