summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2012-09-21 20:31:06 +0000
committeralberth <alberth@openttd.org>2012-09-21 20:31:06 +0000
commit5add39d560aa28e95a7a4f84036ef5b1dd2e2e6b (patch)
tree83b96d1cc2850d8a6d5f7790c2dd1d99074ad043
parent6853df46c7d2867ef3c03a0b29ec8d33f060c696 (diff)
downloadopenttd-5add39d560aa28e95a7a4f84036ef5b1dd2e2e6b.tar.xz
(svn r24540) -Codechange: Remove the not-so-useful HALF_TILE_SIZE constant.
-rw-r--r--src/ground_vehicle.hpp2
-rw-r--r--src/saveload/afterload.cpp4
-rw-r--r--src/tile_type.h1
3 files changed, 3 insertions, 4 deletions
diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp
index 65c856295..80a88b705 100644
--- a/src/ground_vehicle.hpp
+++ b/src/ground_vehicle.hpp
@@ -145,7 +145,7 @@ struct GroundVehicle : public SpecializedVehicle<T, Type> {
* direction it is sloped, we get the 'z' at the center of
* the tile (middle_z) and the edge of the tile (old_z),
* which we then can compare. */
- int middle_z = GetSlopePixelZ((this->x_pos & ~TILE_UNIT_MASK) | HALF_TILE_SIZE, (this->y_pos & ~TILE_UNIT_MASK) | HALF_TILE_SIZE);
+ int middle_z = GetSlopePixelZ((this->x_pos & ~TILE_UNIT_MASK) | (TILE_SIZE / 2), (this->y_pos & ~TILE_UNIT_MASK) | (TILE_SIZE / 2));
if (middle_z != this->z_pos) {
SetBit(this->gv_flags, (middle_z > this->z_pos) ? GVF_GOINGUP_BIT : GVF_GOINGDOWN_BIT);
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index f83979bd4..8a87dcc40 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -458,8 +458,8 @@ static uint FixVehicleInclination(Vehicle *v, Direction dir)
byte entry_z = GetSlopePixelZ(entry_x, entry_y);
/* Compute middle of the tile. */
- int middle_x = (v->x_pos & ~TILE_UNIT_MASK) + HALF_TILE_SIZE;
- int middle_y = (v->y_pos & ~TILE_UNIT_MASK) + HALF_TILE_SIZE;
+ int middle_x = (v->x_pos & ~TILE_UNIT_MASK) + TILE_SIZE / 2;
+ int middle_y = (v->y_pos & ~TILE_UNIT_MASK) + TILE_SIZE / 2;
byte middle_z = GetSlopePixelZ(middle_x, middle_y);
/* middle_z == entry_z, no height change. */
diff --git a/src/tile_type.h b/src/tile_type.h
index b43b0e6b5..8a476e980 100644
--- a/src/tile_type.h
+++ b/src/tile_type.h
@@ -13,7 +13,6 @@
#define TILE_TYPE_H
static const uint TILE_SIZE = 16; ///< Tiles are 16x16 "units" in size
-static const uint HALF_TILE_SIZE = TILE_SIZE / 2; ///< Half of tile size, to get centre of a tile.
static const uint TILE_UNIT_MASK = TILE_SIZE - 1; ///< For masking in/out the inner-tile units.
static const uint TILE_PIXELS = 32; ///< a tile is 32x32 pixels
static const uint TILE_HEIGHT = 8; ///< The standard height-difference between tiles on two levels is 8 (z-diff 8)