|
@@ -141,13 +141,13 @@ bool HandlePlacePushButton(Window *w, in
|
|
|
w->click_state |= mask;
|
|
|
_place_proc = placeproc;
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
|
|
|
void CcPlaySound10(bool success, uint tile, uint32 p1, uint32 p2)
|
|
|
void CcPlaySound10(bool success, TileIndex tile, uint32 p1, uint32 p2)
|
|
|
{
|
|
|
if (success) SndPlayTileFx(SND_12_EXPLOSION, tile);
|
|
|
}
|
|
|
|
|
|
|
|
|
typedef void ToolbarButtonProc(Window *w);
|
|
@@ -1146,13 +1146,13 @@ static void AskResetLandscape(uint mode)
|
|
|
* Raise/Lower a bigger chunk of land at the same time in the editor. When
|
|
|
* raising get the lowest point, when lowering the highest point, and set all
|
|
|
* tiles in the selection to that height.
|
|
|
* @param tile The top-left tile where the terraforming will start
|
|
|
* @param mode 1 for raising, 0 for lowering land
|
|
|
*/
|
|
|
static void CommonRaiseLowerBigLand(uint tile, int mode)
|
|
|
static void CommonRaiseLowerBigLand(TileIndex tile, int mode)
|
|
|
{
|
|
|
int sizex, sizey;
|
|
|
byte h;
|
|
|
|
|
|
_error_message_2 = mode ? STR_0808_CAN_T_RAISE_LAND_HERE : STR_0809_CAN_T_LOWER_LAND_HERE;
|
|
|
|
|
@@ -1191,44 +1191,44 @@ static void CommonRaiseLowerBigLand(uint
|
|
|
} END_TILE_LOOP(tile2, sizex, sizey, tile)
|
|
|
}
|
|
|
|
|
|
_generating_world = false;
|
|
|
}
|
|
|
|
|
|
static void PlaceProc_RaiseBigLand(uint tile)
|
|
|
static void PlaceProc_RaiseBigLand(TileIndex tile)
|
|
|
{
|
|
|
CommonRaiseLowerBigLand(tile, 1);
|
|
|
}
|
|
|
|
|
|
static void PlaceProc_LowerBigLand(uint tile)
|
|
|
static void PlaceProc_LowerBigLand(TileIndex tile)
|
|
|
{
|
|
|
CommonRaiseLowerBigLand(tile, 0);
|
|
|
}
|
|
|
|
|
|
static void PlaceProc_RockyArea(uint tile)
|
|
|
static void PlaceProc_RockyArea(TileIndex tile)
|
|
|
{
|
|
|
if (!IsTileType(tile, MP_CLEAR) && !IsTileType(tile, MP_TREES))
|
|
|
return;
|
|
|
|
|
|
ModifyTile(tile, MP_SETTYPE(MP_CLEAR) | MP_MAP5, (_map5[tile] & ~0x1C) | 0xB);
|
|
|
SndPlayTileFx(SND_1F_SPLAT, tile);
|
|
|
}
|
|
|
|
|
|
static void PlaceProc_LightHouse(uint tile)
|
|
|
static void PlaceProc_LightHouse(TileIndex tile)
|
|
|
{
|
|
|
TileInfo ti;
|
|
|
|
|
|
FindLandscapeHeightByTile(&ti, tile);
|
|
|
if (ti.type != MP_CLEAR || (ti.tileh & 0x10))
|
|
|
return;
|
|
|
|
|
|
ModifyTile(tile, MP_SETTYPE(MP_UNMOVABLE) | MP_MAP5, 1);
|
|
|
SndPlayTileFx(SND_1F_SPLAT, tile);
|
|
|
}
|
|
|
|
|
|
static void PlaceProc_Transmitter(uint tile)
|
|
|
static void PlaceProc_Transmitter(TileIndex tile)
|
|
|
{
|
|
|
TileInfo ti;
|
|
|
|
|
|
FindLandscapeHeightByTile(&ti, tile);
|
|
|
if (ti.type != MP_CLEAR || (ti.tileh & 0x10))
|
|
|
return;
|
|
@@ -1452,21 +1452,21 @@ static void ToolbarScenGenLand(Window *w
|
|
|
HandleButtonClick(w, 11);
|
|
|
SndPlayFx(SND_15_BEEP);
|
|
|
|
|
|
ShowEditorTerraformToolBar();
|
|
|
}
|
|
|
|
|
|
void CcBuildTown(bool success, uint tile, uint32 p1, uint32 p2)
|
|
|
void CcBuildTown(bool success, TileIndex tile, uint32 p1, uint32 p2)
|
|
|
{
|
|
|
if (success) {
|
|
|
SndPlayTileFx(SND_1F_SPLAT, tile);
|
|
|
ResetObjectToPlace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static void PlaceProc_Town(uint tile)
|
|
|
static void PlaceProc_Town(TileIndex tile)
|
|
|
{
|
|
|
DoCommandP(tile, 0, 0, CcBuildTown, CMD_BUILD_TOWN | CMD_MSG(STR_0236_CAN_T_BUILD_TOWN_HERE));
|
|
|
}
|
|
|
|
|
|
|
|
|
static const Widget _scen_edit_town_gen_widgets[] = {
|
|
@@ -1652,13 +1652,13 @@ static bool AnyTownExists(void)
|
|
|
if (t->xy)
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
extern Industry *CreateNewIndustry(uint tile, int type);
|
|
|
extern Industry *CreateNewIndustry(TileIndex tile, int type);
|
|
|
|
|
|
static bool TryBuildIndustry(TileIndex tile, int type)
|
|
|
{
|
|
|
int n;
|
|
|
|
|
|
if (CreateNewIndustry(tile, type)) return true;
|