(svn r24540) -Codechange: Remove the not-so-useful HALF_TILE_SIZE constant.

This commit is contained in:
alberth 2012-09-21 20:31:06 +00:00
parent 6853df46c7
commit 5add39d560
3 changed files with 3 additions and 4 deletions

View File

@ -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);

View File

@ -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. */

View File

@ -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)