File diff r25450:7e9533370994 → r25451:917146b539af
src/terraform_gui.cpp
Show inline comments
 
@@ -48,42 +48,42 @@ void CcTerraform(const CommandCost &resu
 
	}
 
}
 

	
 

	
 
/** Scenario editor command that generates desert areas */
 
static void GenerateDesertArea(TileIndex end, TileIndex start)
 
{
 
	if (_game_mode != GM_EDITOR) return;
 

	
 
	_generating_world = true;
 

	
 
	TileArea ta(start, end);
 
	TILE_AREA_LOOP(tile, ta) {
 
	for (TileIndex tile : ta) {
 
		SetTropicZone(tile, (_ctrl_pressed) ? TROPICZONE_NORMAL : TROPICZONE_DESERT);
 
		DoCommandP(tile, 0, 0, CMD_LANDSCAPE_CLEAR);
 
		MarkTileDirtyByTile(tile);
 
	}
 
	_generating_world = false;
 
	InvalidateWindowClassesData(WC_TOWN_VIEW, 0);
 
}
 

	
 
/** Scenario editor command that generates rocky areas */
 
static void GenerateRockyArea(TileIndex end, TileIndex start)
 
{
 
	if (_game_mode != GM_EDITOR) return;
 

	
 
	bool success = false;
 
	TileArea ta(start, end);
 

	
 
	TILE_AREA_LOOP(tile, ta) {
 
	for (TileIndex tile : ta) {
 
		switch (GetTileType(tile)) {
 
			case MP_TREES:
 
				if (GetTreeGround(tile) == TREE_GROUND_SHORE) continue;
 
				FALLTHROUGH;
 

	
 
			case MP_CLEAR:
 
				MakeClear(tile, CLEAR_ROCKS, 3);
 
				break;
 

	
 
			default:
 
				continue;
 
		}
 
@@ -399,36 +399,36 @@ static void CommonRaiseLowerBigLand(Tile
 
		assert(_terraform_size != 0);
 
		TileArea ta(tile, _terraform_size, _terraform_size);
 
		ta.ClampToMap();
 

	
 
		if (ta.w == 0 || ta.h == 0) return;
 

	
 
		if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_CONSTRUCTION_OTHER, tile);
 

	
 
		uint h;
 
		if (mode != 0) {
 
			/* Raise land */
 
			h = MAX_TILE_HEIGHT;
 
			TILE_AREA_LOOP(tile2, ta) {
 
			for (TileIndex tile2 : ta) {
 
				h = std::min(h, TileHeight(tile2));
 
			}
 
		} else {
 
			/* Lower land */
 
			h = 0;
 
			TILE_AREA_LOOP(tile2, ta) {
 
			for (TileIndex tile2 : ta) {
 
				h = std::max(h, TileHeight(tile2));
 
			}
 
		}
 

	
 
		TILE_AREA_LOOP(tile2, ta) {
 
		for (TileIndex tile2 : ta) {
 
			if (TileHeight(tile2) == h) {
 
				DoCommandP(tile2, SLOPE_N, (uint32)mode, CMD_TERRAFORM_LAND);
 
			}
 
		}
 
	}
 
}
 

	
 
static const int8 _multi_terraform_coords[][2] = {
 
	{  0, -2},
 
	{  4,  0}, { -4,  0}, {  0,  2},
 
	{ -8,  2}, { -4,  4}, {  0,  6}, {  4,  4}, {  8,  2},
 
	{-12,  0}, { -8, -2}, { -4, -4}, {  0, -6}, {  4, -4}, {  8, -2}, { 12,  0},