Mercurial > hg > openttd
changeset 15089:e0fd48f3f61b draft
(svn r19715) -Codechange: Rename all appareances of shiplift to lock.
author | terkhen <terkhen@openttd.org> |
---|---|
date | Sat, 24 Apr 2010 21:03:40 +0000 |
parents | a63b4234140f |
children | b3e12e335b99 |
files | src/saveload/afterload.cpp src/table/sprites.h src/table/water_land.h src/water_cmd.cpp |
diffstat | 4 files changed, 63 insertions(+), 63 deletions(-) [+] |
line wrap: on
line diff
--- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -640,7 +640,7 @@ } 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++) { switch (GetTileType(t)) { default: break;
--- a/src/table/sprites.h +++ b/src/table/sprites.h @@ -570,38 +570,38 @@ 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_Y_DOWN = SPR_CANALS_BASE + 3; // positive Y -/* sprites for the shiplifts - * there are 4 kinds of shiplifts, each of them is 3 tiles long. +/* sprites for the locks + * 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 * are "lowering" either in the "+" or the "-" direction. * the three tiles are the center tile (where the slope is) * and a bottom and a top tile */ -static const SpriteID SPR_SHIPLIFT_BASE = SPR_CANALS_BASE + 4; -static const SpriteID SPR_SHIPLIFT_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_SHIPLIFT_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_SHIPLIFT_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_SHIPLIFT_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_SHIPLIFT_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_SHIPLIFT_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_SHIPLIFT_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_SHIPLIFT_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_SHIPLIFT_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_SHIPLIFT_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_SHIPLIFT_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_SHIPLIFT_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_CANAL_DIKES_BASE = SPR_CANALS_BASE + 52; +static const SpriteID SPR_LOCK_BASE = SPR_CANALS_BASE + 4; +static const SpriteID SPR_LOCK_Y_UP_CENTER_REAR = SPR_CANALS_BASE + 4; +static const SpriteID SPR_LOCK_X_DOWN_CENTER_REAR = SPR_CANALS_BASE + 5; +static const SpriteID SPR_LOCK_X_UP_CENTER_REAR = SPR_CANALS_BASE + 6; +static const SpriteID SPR_LOCK_Y_DOWN_CENTER_REAR = SPR_CANALS_BASE + 7; +static const SpriteID SPR_LOCK_Y_UP_CENTER_FRONT = SPR_CANALS_BASE + 8; +static const SpriteID SPR_LOCK_X_DOWN_CENTER_FRONT = SPR_CANALS_BASE + 9; +static const SpriteID SPR_LOCK_X_UP_CENTER_FRONT = SPR_CANALS_BASE + 10; +static const SpriteID SPR_LOCK_Y_DOWN_CENTER_FRONT = SPR_CANALS_BASE + 11; +static const SpriteID SPR_LOCK_Y_UP_BOTTOM_REAR = SPR_CANALS_BASE + 12; +static const SpriteID SPR_LOCK_X_DOWN_BOTTOM_REAR = SPR_CANALS_BASE + 13; +static const SpriteID SPR_LOCK_X_UP_BOTTOM_REAR = SPR_CANALS_BASE + 14; +static const SpriteID SPR_LOCK_Y_DOWN_BOTTOM_REAR = SPR_CANALS_BASE + 15; +static const SpriteID SPR_LOCK_Y_UP_BOTTOM_FRONT = SPR_CANALS_BASE + 16; +static const SpriteID SPR_LOCK_X_DOWN_BOTTOM_FRONT = SPR_CANALS_BASE + 17; +static const SpriteID SPR_LOCK_X_UP_BOTTOM_FRONT = SPR_CANALS_BASE + 18; +static const SpriteID SPR_LOCK_Y_DOWN_BOTTOM_FRONT = SPR_CANALS_BASE + 19; +static const SpriteID SPR_LOCK_Y_UP_TOP_REAR = SPR_CANALS_BASE + 20; +static const SpriteID SPR_LOCK_X_DOWN_TOP_REAR = SPR_CANALS_BASE + 21; +static const SpriteID SPR_LOCK_X_UP_TOP_REAR = SPR_CANALS_BASE + 22; +static const SpriteID SPR_LOCK_Y_DOWN_TOP_REAR = SPR_CANALS_BASE + 23; +static const SpriteID SPR_LOCK_Y_UP_TOP_FRONT = SPR_CANALS_BASE + 24; +static const SpriteID SPR_LOCK_X_DOWN_TOP_FRONT = SPR_CANALS_BASE + 25; +static const SpriteID SPR_LOCK_X_UP_TOP_FRONT = SPR_CANALS_BASE + 26; +static const SpriteID SPR_LOCK_Y_DOWN_TOP_FRONT = SPR_CANALS_BASE + 27; +static const SpriteID SPR_CANAL_DIKES_BASE = SPR_CANALS_BASE + 52; /* Sprites for tunnels and bridges */ static const SpriteID SPR_TUNNEL_ENTRY_REAR_RAIL = 2365;
--- a/src/table/water_land.h +++ b/src/table/water_land.h @@ -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/>. */ -/** @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 { byte delta_x; @@ -55,105 +55,105 @@ _shipdepot_display_seq_4, }; -static const WaterDrawTileStruct _shiplift_display_seq_0[] = { +static const WaterDrawTileStruct _lock_display_seq_0[] = { BEGIN(1), { 0, 0, 0, 0x10, 1, 0x14, 0 + 1 }, { 0, 0xF, 0, 0x10, 1, 0x14, 4 + 1 }, END(0) }; -static const WaterDrawTileStruct _shiplift_display_seq_1[] = { +static const WaterDrawTileStruct _lock_display_seq_1[] = { BEGIN(0), { 0, 0, 0, 1, 0x10, 0x14, 0 }, { 0xF, 0, 0, 1, 0x10, 0x14, 4 }, END(0) }; -static const WaterDrawTileStruct _shiplift_display_seq_2[] = { +static const WaterDrawTileStruct _lock_display_seq_2[] = { BEGIN(2), { 0, 0, 0, 0x10, 1, 0x14, 0 + 2 }, { 0, 0xF, 0, 0x10, 1, 0x14, 4 + 2 }, END(0) }; -static const WaterDrawTileStruct _shiplift_display_seq_3[] = { +static const WaterDrawTileStruct _lock_display_seq_3[] = { BEGIN(3), { 0, 0, 0, 1, 0x10, 0x14, 0 + 3 }, { 0xF, 0, 0, 1, 0x10, 0x14, 4 + 3 }, END(0) }; -static const WaterDrawTileStruct _shiplift_display_seq_0b[] = { +static const WaterDrawTileStruct _lock_display_seq_0b[] = { BEGIN(0xFDD), { 0, 0, 0, 0x10, 1, 0x14, 8 + 1 }, { 0, 0xF, 0, 0x10, 1, 0x14, 12 + 1 }, END(0) }; -static const WaterDrawTileStruct _shiplift_display_seq_1b[] = { +static const WaterDrawTileStruct _lock_display_seq_1b[] = { BEGIN(0xFDD), { 0, 0, 0, 0x1, 0x10, 0x14, 8 }, { 0xF, 0, 0, 0x1, 0x10, 0x14, 12 }, END(0) }; -static const WaterDrawTileStruct _shiplift_display_seq_2b[] = { +static const WaterDrawTileStruct _lock_display_seq_2b[] = { BEGIN(0xFDD), { 0, 0, 0, 0x10, 1, 0x14, 8 + 2 }, { 0, 0xF, 0, 0x10, 1, 0x14, 12 + 2 }, END(0) }; -static const WaterDrawTileStruct _shiplift_display_seq_3b[] = { +static const WaterDrawTileStruct _lock_display_seq_3b[] = { BEGIN(0xFDD), { 0, 0, 0, 1, 0x10, 0x14, 8 + 3 }, { 0xF, 0, 0, 1, 0x10, 0x14, 12 + 3 }, END(0) }; -static const WaterDrawTileStruct _shiplift_display_seq_0t[] = { +static const WaterDrawTileStruct _lock_display_seq_0t[] = { BEGIN(0xFDD), { 0, 0, 0, 0x10, 1, 0x14, 16 + 1 }, { 0, 0xF, 0, 0x10, 1, 0x14, 20 + 1 }, END(8) }; -static const WaterDrawTileStruct _shiplift_display_seq_1t[] = { +static const WaterDrawTileStruct _lock_display_seq_1t[] = { BEGIN(0xFDD), { 0, 0, 0, 0x1, 0x10, 0x14, 16 }, { 0xF, 0, 0, 0x1, 0x10, 0x14, 20 }, END(8) }; -static const WaterDrawTileStruct _shiplift_display_seq_2t[] = { +static const WaterDrawTileStruct _lock_display_seq_2t[] = { BEGIN(0xFDD), { 0, 0, 0, 0x10, 1, 0x14, 16 + 2 }, { 0, 0xF, 0, 0x10, 1, 0x14, 20 + 2 }, END(8) }; -static const WaterDrawTileStruct _shiplift_display_seq_3t[] = { +static const WaterDrawTileStruct _lock_display_seq_3t[] = { BEGIN(0xFDD), { 0, 0, 0, 1, 0x10, 0x14, 16 + 3 }, { 0xF, 0, 0, 1, 0x10, 0x14, 20 + 3 }, END(8) }; -static const WaterDrawTileStruct * const _shiplift_display_seq[] = { - _shiplift_display_seq_0, - _shiplift_display_seq_1, - _shiplift_display_seq_2, - _shiplift_display_seq_3, +static const WaterDrawTileStruct * const _lock_display_seq[] = { + _lock_display_seq_0, + _lock_display_seq_1, + _lock_display_seq_2, + _lock_display_seq_3, - _shiplift_display_seq_0b, - _shiplift_display_seq_1b, - _shiplift_display_seq_2b, - _shiplift_display_seq_3b, + _lock_display_seq_0b, + _lock_display_seq_1b, + _lock_display_seq_2b, + _lock_display_seq_3b, - _shiplift_display_seq_0t, - _shiplift_display_seq_1t, - _shiplift_display_seq_2t, - _shiplift_display_seq_3t, + _lock_display_seq_0t, + _lock_display_seq_1t, + _lock_display_seq_2t, + _lock_display_seq_3t, }; #undef BEGIN
--- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -190,8 +190,8 @@ return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_DEPOT_SHIP]); } -/** build a shiplift */ -static CommandCost DoBuildShiplift(TileIndex tile, DiagDirection dir, DoCommandFlag flags) +/** build a lock */ +static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag flags) { /* middle tile */ CommandCost ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); @@ -234,7 +234,7 @@ 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) { CommandCost ret = CheckTileOwnership(tile); @@ -278,7 +278,7 @@ /* Disallow building of locks on river rapids */ 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. @@ -395,7 +395,7 @@ } 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 {-1, 0}, {0, 1}, { 1, 0}, {0, -1}, // lower { 1, 0}, {0, -1}, {-1, 0}, {0, 1}, // upper @@ -404,7 +404,7 @@ if (flags & DC_AUTO) return_cmd_error(STR_ERROR_BUILDING_MUST_BE_DEMOLISHED); if (_current_company == OWNER_WATER) return CMD_ERROR; /* 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: @@ -559,7 +559,7 @@ /* If no custom graphics, use defaults */ if (water_base == 0) water_base = SPR_CANALS_BASE; if (locks_base == 0) { - locks_base = SPR_SHIPLIFT_BASE; + locks_base = SPR_LOCK_BASE; } else { /* If using custom graphics, ignore the variation on height */ base = 0; @@ -654,7 +654,7 @@ } break; 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); } break;