(svn r19715) -Codechange: Rename all appareances of shiplift to lock.

This commit is contained in:
terkhen 2010-04-24 21:03:40 +00:00
parent e3c89df398
commit 1d60eac168
4 changed files with 63 additions and 63 deletions

View File

@ -640,7 +640,7 @@ bool AfterLoadGame()
} }
if (CheckSavegameVersion(72)) { if (CheckSavegameVersion(72)) {
/* Locks/shiplifts in very old savegames had OWNER_WATER as owner */ /* Locks in very old savegames had OWNER_WATER as owner */
for (TileIndex t = 0; t < MapSize(); t++) { for (TileIndex t = 0; t < MapSize(); t++) {
switch (GetTileType(t)) { switch (GetTileType(t)) {
default: break; default: break;

View File

@ -570,38 +570,38 @@ static const SpriteID SPR_WATER_SLOPE_Y_UP = SPR_CANALS_BASE + 0; // Wate
static const SpriteID SPR_WATER_SLOPE_X_DOWN = SPR_CANALS_BASE + 1; // positive X static const SpriteID SPR_WATER_SLOPE_X_DOWN = SPR_CANALS_BASE + 1; // positive X
static const SpriteID SPR_WATER_SLOPE_X_UP = SPR_CANALS_BASE + 2; // negative X static const SpriteID SPR_WATER_SLOPE_X_UP = SPR_CANALS_BASE + 2; // negative X
static const SpriteID SPR_WATER_SLOPE_Y_DOWN = SPR_CANALS_BASE + 3; // positive Y static const SpriteID SPR_WATER_SLOPE_Y_DOWN = SPR_CANALS_BASE + 3; // positive Y
/* sprites for the shiplifts /* sprites for the locks
* there are 4 kinds of shiplifts, each of them is 3 tiles long. * there are 4 kinds of locks, each of them is 3 tiles long.
* the four kinds are running in the X and Y direction and * the four kinds are running in the X and Y direction and
* are "lowering" either in the "+" or the "-" direction. * are "lowering" either in the "+" or the "-" direction.
* the three tiles are the center tile (where the slope is) * the three tiles are the center tile (where the slope is)
* and a bottom and a top tile */ * and a bottom and a top tile */
static const SpriteID SPR_SHIPLIFT_BASE = SPR_CANALS_BASE + 4; static const SpriteID SPR_LOCK_BASE = SPR_CANALS_BASE + 4;
static const SpriteID SPR_SHIPLIFT_Y_UP_CENTER_REAR = SPR_CANALS_BASE + 4; static const SpriteID SPR_LOCK_Y_UP_CENTER_REAR = SPR_CANALS_BASE + 4;
static const SpriteID SPR_SHIPLIFT_X_DOWN_CENTER_REAR = SPR_CANALS_BASE + 5; static const SpriteID SPR_LOCK_X_DOWN_CENTER_REAR = SPR_CANALS_BASE + 5;
static const SpriteID SPR_SHIPLIFT_X_UP_CENTER_REAR = SPR_CANALS_BASE + 6; static const SpriteID SPR_LOCK_X_UP_CENTER_REAR = SPR_CANALS_BASE + 6;
static const SpriteID SPR_SHIPLIFT_Y_DOWN_CENTER_REAR = SPR_CANALS_BASE + 7; static const SpriteID SPR_LOCK_Y_DOWN_CENTER_REAR = SPR_CANALS_BASE + 7;
static const SpriteID SPR_SHIPLIFT_Y_UP_CENTER_FRONT = SPR_CANALS_BASE + 8; static const SpriteID SPR_LOCK_Y_UP_CENTER_FRONT = SPR_CANALS_BASE + 8;
static const SpriteID SPR_SHIPLIFT_X_DOWN_CENTER_FRONT = SPR_CANALS_BASE + 9; static const SpriteID SPR_LOCK_X_DOWN_CENTER_FRONT = SPR_CANALS_BASE + 9;
static const SpriteID SPR_SHIPLIFT_X_UP_CENTER_FRONT = SPR_CANALS_BASE + 10; static const SpriteID SPR_LOCK_X_UP_CENTER_FRONT = SPR_CANALS_BASE + 10;
static const SpriteID SPR_SHIPLIFT_Y_DOWN_CENTER_FRONT = SPR_CANALS_BASE + 11; static const SpriteID SPR_LOCK_Y_DOWN_CENTER_FRONT = SPR_CANALS_BASE + 11;
static const SpriteID SPR_SHIPLIFT_Y_UP_BOTTOM_REAR = SPR_CANALS_BASE + 12; static const SpriteID SPR_LOCK_Y_UP_BOTTOM_REAR = SPR_CANALS_BASE + 12;
static const SpriteID SPR_SHIPLIFT_X_DOWN_BOTTOM_REAR = SPR_CANALS_BASE + 13; static const SpriteID SPR_LOCK_X_DOWN_BOTTOM_REAR = SPR_CANALS_BASE + 13;
static const SpriteID SPR_SHIPLIFT_X_UP_BOTTOM_REAR = SPR_CANALS_BASE + 14; static const SpriteID SPR_LOCK_X_UP_BOTTOM_REAR = SPR_CANALS_BASE + 14;
static const SpriteID SPR_SHIPLIFT_Y_DOWN_BOTTOM_REAR = SPR_CANALS_BASE + 15; static const SpriteID SPR_LOCK_Y_DOWN_BOTTOM_REAR = SPR_CANALS_BASE + 15;
static const SpriteID SPR_SHIPLIFT_Y_UP_BOTTOM_FRONT = SPR_CANALS_BASE + 16; static const SpriteID SPR_LOCK_Y_UP_BOTTOM_FRONT = SPR_CANALS_BASE + 16;
static const SpriteID SPR_SHIPLIFT_X_DOWN_BOTTOM_FRONT = SPR_CANALS_BASE + 17; static const SpriteID SPR_LOCK_X_DOWN_BOTTOM_FRONT = SPR_CANALS_BASE + 17;
static const SpriteID SPR_SHIPLIFT_X_UP_BOTTOM_FRONT = SPR_CANALS_BASE + 18; static const SpriteID SPR_LOCK_X_UP_BOTTOM_FRONT = SPR_CANALS_BASE + 18;
static const SpriteID SPR_SHIPLIFT_Y_DOWN_BOTTOM_FRONT = SPR_CANALS_BASE + 19; static const SpriteID SPR_LOCK_Y_DOWN_BOTTOM_FRONT = SPR_CANALS_BASE + 19;
static const SpriteID SPR_SHIPLIFT_Y_UP_TOP_REAR = SPR_CANALS_BASE + 20; static const SpriteID SPR_LOCK_Y_UP_TOP_REAR = SPR_CANALS_BASE + 20;
static const SpriteID SPR_SHIPLIFT_X_DOWN_TOP_REAR = SPR_CANALS_BASE + 21; static const SpriteID SPR_LOCK_X_DOWN_TOP_REAR = SPR_CANALS_BASE + 21;
static const SpriteID SPR_SHIPLIFT_X_UP_TOP_REAR = SPR_CANALS_BASE + 22; static const SpriteID SPR_LOCK_X_UP_TOP_REAR = SPR_CANALS_BASE + 22;
static const SpriteID SPR_SHIPLIFT_Y_DOWN_TOP_REAR = SPR_CANALS_BASE + 23; static const SpriteID SPR_LOCK_Y_DOWN_TOP_REAR = SPR_CANALS_BASE + 23;
static const SpriteID SPR_SHIPLIFT_Y_UP_TOP_FRONT = SPR_CANALS_BASE + 24; static const SpriteID SPR_LOCK_Y_UP_TOP_FRONT = SPR_CANALS_BASE + 24;
static const SpriteID SPR_SHIPLIFT_X_DOWN_TOP_FRONT = SPR_CANALS_BASE + 25; static const SpriteID SPR_LOCK_X_DOWN_TOP_FRONT = SPR_CANALS_BASE + 25;
static const SpriteID SPR_SHIPLIFT_X_UP_TOP_FRONT = SPR_CANALS_BASE + 26; static const SpriteID SPR_LOCK_X_UP_TOP_FRONT = SPR_CANALS_BASE + 26;
static const SpriteID SPR_SHIPLIFT_Y_DOWN_TOP_FRONT = SPR_CANALS_BASE + 27; static const SpriteID SPR_LOCK_Y_DOWN_TOP_FRONT = SPR_CANALS_BASE + 27;
static const SpriteID SPR_CANAL_DIKES_BASE = SPR_CANALS_BASE + 52; static const SpriteID SPR_CANAL_DIKES_BASE = SPR_CANALS_BASE + 52;
/* Sprites for tunnels and bridges */ /* Sprites for tunnels and bridges */
static const SpriteID SPR_TUNNEL_ENTRY_REAR_RAIL = 2365; static const SpriteID SPR_TUNNEL_ENTRY_REAR_RAIL = 2365;

View File

@ -7,7 +7,7 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** @file water_land.h Sprites to use and how to display them for water tiles (depots/shiplifts). */ /** @file water_land.h Sprites to use and how to display them for water tiles (depots/locks). */
struct WaterDrawTileStruct { struct WaterDrawTileStruct {
byte delta_x; byte delta_x;
@ -55,105 +55,105 @@ static const WaterDrawTileStruct * const _shipdepot_display_seq[] = {
_shipdepot_display_seq_4, _shipdepot_display_seq_4,
}; };
static const WaterDrawTileStruct _shiplift_display_seq_0[] = { static const WaterDrawTileStruct _lock_display_seq_0[] = {
BEGIN(1), BEGIN(1),
{ 0, 0, 0, 0x10, 1, 0x14, 0 + 1 }, { 0, 0, 0, 0x10, 1, 0x14, 0 + 1 },
{ 0, 0xF, 0, 0x10, 1, 0x14, 4 + 1 }, { 0, 0xF, 0, 0x10, 1, 0x14, 4 + 1 },
END(0) END(0)
}; };
static const WaterDrawTileStruct _shiplift_display_seq_1[] = { static const WaterDrawTileStruct _lock_display_seq_1[] = {
BEGIN(0), BEGIN(0),
{ 0, 0, 0, 1, 0x10, 0x14, 0 }, { 0, 0, 0, 1, 0x10, 0x14, 0 },
{ 0xF, 0, 0, 1, 0x10, 0x14, 4 }, { 0xF, 0, 0, 1, 0x10, 0x14, 4 },
END(0) END(0)
}; };
static const WaterDrawTileStruct _shiplift_display_seq_2[] = { static const WaterDrawTileStruct _lock_display_seq_2[] = {
BEGIN(2), BEGIN(2),
{ 0, 0, 0, 0x10, 1, 0x14, 0 + 2 }, { 0, 0, 0, 0x10, 1, 0x14, 0 + 2 },
{ 0, 0xF, 0, 0x10, 1, 0x14, 4 + 2 }, { 0, 0xF, 0, 0x10, 1, 0x14, 4 + 2 },
END(0) END(0)
}; };
static const WaterDrawTileStruct _shiplift_display_seq_3[] = { static const WaterDrawTileStruct _lock_display_seq_3[] = {
BEGIN(3), BEGIN(3),
{ 0, 0, 0, 1, 0x10, 0x14, 0 + 3 }, { 0, 0, 0, 1, 0x10, 0x14, 0 + 3 },
{ 0xF, 0, 0, 1, 0x10, 0x14, 4 + 3 }, { 0xF, 0, 0, 1, 0x10, 0x14, 4 + 3 },
END(0) END(0)
}; };
static const WaterDrawTileStruct _shiplift_display_seq_0b[] = { static const WaterDrawTileStruct _lock_display_seq_0b[] = {
BEGIN(0xFDD), BEGIN(0xFDD),
{ 0, 0, 0, 0x10, 1, 0x14, 8 + 1 }, { 0, 0, 0, 0x10, 1, 0x14, 8 + 1 },
{ 0, 0xF, 0, 0x10, 1, 0x14, 12 + 1 }, { 0, 0xF, 0, 0x10, 1, 0x14, 12 + 1 },
END(0) END(0)
}; };
static const WaterDrawTileStruct _shiplift_display_seq_1b[] = { static const WaterDrawTileStruct _lock_display_seq_1b[] = {
BEGIN(0xFDD), BEGIN(0xFDD),
{ 0, 0, 0, 0x1, 0x10, 0x14, 8 }, { 0, 0, 0, 0x1, 0x10, 0x14, 8 },
{ 0xF, 0, 0, 0x1, 0x10, 0x14, 12 }, { 0xF, 0, 0, 0x1, 0x10, 0x14, 12 },
END(0) END(0)
}; };
static const WaterDrawTileStruct _shiplift_display_seq_2b[] = { static const WaterDrawTileStruct _lock_display_seq_2b[] = {
BEGIN(0xFDD), BEGIN(0xFDD),
{ 0, 0, 0, 0x10, 1, 0x14, 8 + 2 }, { 0, 0, 0, 0x10, 1, 0x14, 8 + 2 },
{ 0, 0xF, 0, 0x10, 1, 0x14, 12 + 2 }, { 0, 0xF, 0, 0x10, 1, 0x14, 12 + 2 },
END(0) END(0)
}; };
static const WaterDrawTileStruct _shiplift_display_seq_3b[] = { static const WaterDrawTileStruct _lock_display_seq_3b[] = {
BEGIN(0xFDD), BEGIN(0xFDD),
{ 0, 0, 0, 1, 0x10, 0x14, 8 + 3 }, { 0, 0, 0, 1, 0x10, 0x14, 8 + 3 },
{ 0xF, 0, 0, 1, 0x10, 0x14, 12 + 3 }, { 0xF, 0, 0, 1, 0x10, 0x14, 12 + 3 },
END(0) END(0)
}; };
static const WaterDrawTileStruct _shiplift_display_seq_0t[] = { static const WaterDrawTileStruct _lock_display_seq_0t[] = {
BEGIN(0xFDD), BEGIN(0xFDD),
{ 0, 0, 0, 0x10, 1, 0x14, 16 + 1 }, { 0, 0, 0, 0x10, 1, 0x14, 16 + 1 },
{ 0, 0xF, 0, 0x10, 1, 0x14, 20 + 1 }, { 0, 0xF, 0, 0x10, 1, 0x14, 20 + 1 },
END(8) END(8)
}; };
static const WaterDrawTileStruct _shiplift_display_seq_1t[] = { static const WaterDrawTileStruct _lock_display_seq_1t[] = {
BEGIN(0xFDD), BEGIN(0xFDD),
{ 0, 0, 0, 0x1, 0x10, 0x14, 16 }, { 0, 0, 0, 0x1, 0x10, 0x14, 16 },
{ 0xF, 0, 0, 0x1, 0x10, 0x14, 20 }, { 0xF, 0, 0, 0x1, 0x10, 0x14, 20 },
END(8) END(8)
}; };
static const WaterDrawTileStruct _shiplift_display_seq_2t[] = { static const WaterDrawTileStruct _lock_display_seq_2t[] = {
BEGIN(0xFDD), BEGIN(0xFDD),
{ 0, 0, 0, 0x10, 1, 0x14, 16 + 2 }, { 0, 0, 0, 0x10, 1, 0x14, 16 + 2 },
{ 0, 0xF, 0, 0x10, 1, 0x14, 20 + 2 }, { 0, 0xF, 0, 0x10, 1, 0x14, 20 + 2 },
END(8) END(8)
}; };
static const WaterDrawTileStruct _shiplift_display_seq_3t[] = { static const WaterDrawTileStruct _lock_display_seq_3t[] = {
BEGIN(0xFDD), BEGIN(0xFDD),
{ 0, 0, 0, 1, 0x10, 0x14, 16 + 3 }, { 0, 0, 0, 1, 0x10, 0x14, 16 + 3 },
{ 0xF, 0, 0, 1, 0x10, 0x14, 20 + 3 }, { 0xF, 0, 0, 1, 0x10, 0x14, 20 + 3 },
END(8) END(8)
}; };
static const WaterDrawTileStruct * const _shiplift_display_seq[] = { static const WaterDrawTileStruct * const _lock_display_seq[] = {
_shiplift_display_seq_0, _lock_display_seq_0,
_shiplift_display_seq_1, _lock_display_seq_1,
_shiplift_display_seq_2, _lock_display_seq_2,
_shiplift_display_seq_3, _lock_display_seq_3,
_shiplift_display_seq_0b, _lock_display_seq_0b,
_shiplift_display_seq_1b, _lock_display_seq_1b,
_shiplift_display_seq_2b, _lock_display_seq_2b,
_shiplift_display_seq_3b, _lock_display_seq_3b,
_shiplift_display_seq_0t, _lock_display_seq_0t,
_shiplift_display_seq_1t, _lock_display_seq_1t,
_shiplift_display_seq_2t, _lock_display_seq_2t,
_shiplift_display_seq_3t, _lock_display_seq_3t,
}; };
#undef BEGIN #undef BEGIN

View File

@ -190,8 +190,8 @@ static CommandCost RemoveShipDepot(TileIndex tile, DoCommandFlag flags)
return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_DEPOT_SHIP]); return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_DEPOT_SHIP]);
} }
/** build a shiplift */ /** build a lock */
static CommandCost DoBuildShiplift(TileIndex tile, DiagDirection dir, DoCommandFlag flags) static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag flags)
{ {
/* middle tile */ /* middle tile */
CommandCost ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); CommandCost ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
@ -234,7 +234,7 @@ static CommandCost DoBuildShiplift(TileIndex tile, DiagDirection dir, DoCommandF
return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_WATER] * 22 >> 3); return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_WATER] * 22 >> 3);
} }
static CommandCost RemoveShiplift(TileIndex tile, DoCommandFlag flags) static CommandCost RemoveLock(TileIndex tile, DoCommandFlag flags)
{ {
if (GetTileOwner(tile) != OWNER_NONE) { if (GetTileOwner(tile) != OWNER_NONE) {
CommandCost ret = CheckTileOwnership(tile); CommandCost ret = CheckTileOwnership(tile);
@ -278,7 +278,7 @@ CommandCost CmdBuildLock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
/* Disallow building of locks on river rapids */ /* Disallow building of locks on river rapids */
if (IsWaterTile(tile)) return_cmd_error(STR_ERROR_SITE_UNSUITABLE); if (IsWaterTile(tile)) return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
return DoBuildShiplift(tile, dir, flags); return DoBuildLock(tile, dir, flags);
} }
/** Build a piece of canal. /** Build a piece of canal.
@ -395,7 +395,7 @@ static CommandCost ClearTile_Water(TileIndex tile, DoCommandFlag flags)
} }
case WATER_TILE_LOCK: { case WATER_TILE_LOCK: {
static const TileIndexDiffC _shiplift_tomiddle_offs[] = { static const TileIndexDiffC _lock_tomiddle_offs[] = {
{ 0, 0}, {0, 0}, { 0, 0}, {0, 0}, // middle { 0, 0}, {0, 0}, { 0, 0}, {0, 0}, // middle
{-1, 0}, {0, 1}, { 1, 0}, {0, -1}, // lower {-1, 0}, {0, 1}, { 1, 0}, {0, -1}, // lower
{ 1, 0}, {0, -1}, {-1, 0}, {0, 1}, // upper { 1, 0}, {0, -1}, {-1, 0}, {0, 1}, // upper
@ -404,7 +404,7 @@ static CommandCost ClearTile_Water(TileIndex tile, DoCommandFlag flags)
if (flags & DC_AUTO) return_cmd_error(STR_ERROR_BUILDING_MUST_BE_DEMOLISHED); if (flags & DC_AUTO) return_cmd_error(STR_ERROR_BUILDING_MUST_BE_DEMOLISHED);
if (_current_company == OWNER_WATER) return CMD_ERROR; if (_current_company == OWNER_WATER) return CMD_ERROR;
/* move to the middle tile.. */ /* move to the middle tile.. */
return RemoveShiplift(tile + ToTileIndexDiff(_shiplift_tomiddle_offs[GetSection(tile)]), flags); return RemoveLock(tile + ToTileIndexDiff(_lock_tomiddle_offs[GetSection(tile)]), flags);
} }
case WATER_TILE_DEPOT: case WATER_TILE_DEPOT:
@ -559,7 +559,7 @@ static void DrawWaterStuff(const TileInfo *ti, const WaterDrawTileStruct *wdts,
/* If no custom graphics, use defaults */ /* If no custom graphics, use defaults */
if (water_base == 0) water_base = SPR_CANALS_BASE; if (water_base == 0) water_base = SPR_CANALS_BASE;
if (locks_base == 0) { if (locks_base == 0) {
locks_base = SPR_SHIPLIFT_BASE; locks_base = SPR_LOCK_BASE;
} else { } else {
/* If using custom graphics, ignore the variation on height */ /* If using custom graphics, ignore the variation on height */
base = 0; base = 0;
@ -654,7 +654,7 @@ static void DrawTile_Water(TileInfo *ti)
} break; } break;
case WATER_TILE_LOCK: { case WATER_TILE_LOCK: {
const WaterDrawTileStruct *t = _shiplift_display_seq[GetSection(ti->tile)]; const WaterDrawTileStruct *t = _lock_display_seq[GetSection(ti->tile)];
DrawWaterStuff(ti, t, 0, ti->z > t[3].delta_y ? 24 : 0, true); DrawWaterStuff(ti, t, 0, ti->z > t[3].delta_y ? 24 : 0, true);
} break; } break;