Mercurial > hg > openttd
comparison ttd.c @ 1035:3edb35954288 draft
(svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
author | tron <tron@openttd.org> |
---|---|
date | Sun, 16 Jan 2005 11:24:58 +0000 |
parents | 3746ce51f251 |
children | b2b382908480 |
comparison
equal
deleted
inserted
replaced
1034:77f146e1aba7 | 1035:3edb35954288 |
---|---|
1191 void ConvertTownOwner() | 1191 void ConvertTownOwner() |
1192 { | 1192 { |
1193 uint tile; | 1193 uint tile; |
1194 | 1194 |
1195 for (tile = 0; tile != MapSize(); tile++) { | 1195 for (tile = 0; tile != MapSize(); tile++) { |
1196 if (IS_TILETYPE(tile, MP_STREET)) { | 1196 if (IsTileType(tile, MP_STREET)) { |
1197 if ((_map5[tile] & 0xF0) == 0x10 && _map3_lo[tile] & 0x80) | 1197 if ((_map5[tile] & 0xF0) == 0x10 && _map3_lo[tile] & 0x80) |
1198 _map3_lo[tile] = OWNER_TOWN; | 1198 _map3_lo[tile] = OWNER_TOWN; |
1199 | 1199 |
1200 if (_map_owner[tile] & 0x80) | 1200 if (_map_owner[tile] & 0x80) |
1201 _map_owner[tile] = OWNER_TOWN; | 1201 _map_owner[tile] = OWNER_TOWN; |
1202 } else if (IS_TILETYPE(tile, MP_TUNNELBRIDGE)) { | 1202 } else if (IsTileType(tile, MP_TUNNELBRIDGE)) { |
1203 if (_map_owner[tile] & 0x80) | 1203 if (_map_owner[tile] & 0x80) |
1204 _map_owner[tile] = OWNER_TOWN; | 1204 _map_owner[tile] = OWNER_TOWN; |
1205 } | 1205 } |
1206 } | 1206 } |
1207 } | 1207 } |
1290 TileIndex tile = TILE_XY(0,0); | 1290 TileIndex tile = TILE_XY(0,0); |
1291 uint w = MapSizeX(); | 1291 uint w = MapSizeX(); |
1292 uint h = MapSizeY(); | 1292 uint h = MapSizeY(); |
1293 | 1293 |
1294 BEGIN_TILE_LOOP(tile_cur, w, h, tile) | 1294 BEGIN_TILE_LOOP(tile_cur, w, h, tile) |
1295 if (IS_TILETYPE(tile_cur, MP_WATER) && _map_owner[tile_cur] >= MAX_PLAYERS) | 1295 if (IsTileType(tile_cur, MP_WATER) && _map_owner[tile_cur] >= MAX_PLAYERS) |
1296 _map_owner[tile_cur] = OWNER_WATER; | 1296 _map_owner[tile_cur] = OWNER_WATER; |
1297 END_TILE_LOOP(tile_cur, w, h, tile) | 1297 END_TILE_LOOP(tile_cur, w, h, tile) |
1298 } | 1298 } |
1299 | 1299 |
1300 // convert road side to my format. | 1300 // convert road side to my format. |