Changeset - r18244:0adacaa8f4f2
[Not reviewed]
master
0 1 0
rubidium - 13 years ago 2011-11-04 06:05:11
rubidium@openttd.org
(svn r23090) -Codechange: use map accessors instead of directly accessing the map (mhl)
1 file changed with 9 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/landscape.cpp
Show inline comments
 
@@ -813,16 +813,16 @@ static void GenerateTerrain(int type, ui
 
	if (x + w >= MapMaxX() - 1) return;
 
	if (y + h >= MapMaxY() - 1) return;
 

	
 
	Tile *tile = &_m[TileXY(x, y)];
 
	TileIndex tile = TileXY(x, y);
 

	
 
	switch (direction) {
 
		default: NOT_REACHED();
 
		case DIAGDIR_NE:
 
			do {
 
				Tile *tile_cur = tile;
 
				TileIndex tile_cur = tile;
 

	
 
				for (uint w_cur = w; w_cur != 0; --w_cur) {
 
					if (GB(*p, 0, 4) >= tile_cur->type_height) tile_cur->type_height = GB(*p, 0, 4);
 
					if (GB(*p, 0, 4) >= TileHeight(tile_cur)) SetTileHeight(tile_cur, GB(*p, 0, 4));
 
					p++;
 
					tile_cur++;
 
				}
 
@@ -832,10 +832,10 @@ static void GenerateTerrain(int type, ui
 

	
 
		case DIAGDIR_SE:
 
			do {
 
				Tile *tile_cur = tile;
 
				TileIndex tile_cur = tile;
 

	
 
				for (uint h_cur = h; h_cur != 0; --h_cur) {
 
					if (GB(*p, 0, 4) >= tile_cur->type_height) tile_cur->type_height = GB(*p, 0, 4);
 
					if (GB(*p, 0, 4) >= TileHeight(tile_cur)) SetTileHeight(tile_cur, GB(*p, 0, 4));
 
					p++;
 
					tile_cur += TileDiffXY(0, 1);
 
				}
 
@@ -846,10 +846,10 @@ static void GenerateTerrain(int type, ui
 
		case DIAGDIR_SW:
 
			tile += TileDiffXY(w - 1, 0);
 
			do {
 
				Tile *tile_cur = tile;
 
				TileIndex tile_cur = tile;
 

	
 
				for (uint w_cur = w; w_cur != 0; --w_cur) {
 
					if (GB(*p, 0, 4) >= tile_cur->type_height) tile_cur->type_height = GB(*p, 0, 4);
 
					if (GB(*p, 0, 4) >= TileHeight(tile_cur)) SetTileHeight(tile_cur, GB(*p, 0, 4));
 
					p++;
 
					tile_cur--;
 
				}
 
@@ -860,10 +860,10 @@ static void GenerateTerrain(int type, ui
 
		case DIAGDIR_NW:
 
			tile += TileDiffXY(0, h - 1);
 
			do {
 
				Tile *tile_cur = tile;
 
				TileIndex tile_cur = tile;
 

	
 
				for (uint h_cur = h; h_cur != 0; --h_cur) {
 
					if (GB(*p, 0, 4) >= tile_cur->type_height) tile_cur->type_height = GB(*p, 0, 4);
 
					if (GB(*p, 0, 4) >= TileHeight(tile_cur)) SetTileHeight(tile_cur, GB(*p, 0, 4));
 
					p++;
 
					tile_cur -= TileDiffXY(0, 1);
 
				}
0 comments (0 inline, 0 general)