~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/clear_cmd.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Matthijs Kooijman, Jordi Mallach
  • Date: 2009-04-15 18:22:10 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090415182210-22ktb8kdbp2tf3bm
[ Matthijs Kooijman ]
* New upstream release.
* Remove Debian specific desktop file, upstream provides one now. 
* Add debian/watch file.

[ Jordi Mallach ]
* Bump Standards-Version to 3.8.1, with no changes required.
* Move to debhelper compat 7. Bump Build-Depends accordingly.
* Use dh_prep.
* Add "set -e" to config script.
* Remove a few extra doc files that get installed by upstream Makefile.
* Add more complete copyright information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: clear_cmd.cpp 12199 2008-02-20 17:49:50Z frosch $ */
 
1
/* $Id: clear_cmd.cpp 15434 2009-02-09 21:20:05Z rubidium $ */
2
2
 
3
 
/** @file clear_cmd.cpp */
 
3
/** @file clear_cmd.cpp Commands related to clear tiles. */
4
4
 
5
5
#include "stdafx.h"
6
6
#include "openttd.h"
7
7
#include "clear_map.h"
8
8
#include "command_func.h"
9
 
#include "bridge.h"
10
9
#include "landscape.h"
11
10
#include "variables.h"
12
 
#include "unmovable_map.h"
13
11
#include "genworld.h"
14
12
#include "industry.h"
15
 
#include "water_map.h"
16
 
#include "tile_cmd.h"
17
13
#include "functions.h"
18
14
#include "economy_func.h"
19
15
#include "viewport_func.h"
 
16
#include "water.h"
20
17
#include "settings_type.h"
21
18
 
22
19
#include "table/strings.h"
23
20
#include "table/sprites.h"
24
21
#include "table/clear_land.h"
25
22
 
26
 
static CommandCost ClearTile_Clear(TileIndex tile, byte flags)
 
23
static CommandCost ClearTile_Clear(TileIndex tile, DoCommandFlag flags)
27
24
{
28
 
        static const Money* clear_price_table[] = {
 
25
        static const Money *clear_price_table[] = {
29
26
                &_price.clear_grass,
30
27
                &_price.clear_roughland,
31
28
                &_price.clear_rocks,
216
213
 
217
214
static void TileLoop_Clear(TileIndex tile)
218
215
{
 
216
        /* If the tile is at any edge flood it to prevent maps without water. */
 
217
        if (_settings_game.construction.freeform_edges && DistanceFromEdge(tile) == 1) {
 
218
                uint z;
 
219
                Slope slope = GetTileSlope(tile, &z);
 
220
                if (z == 0 && slope == SLOPE_FLAT) {
 
221
                        DoFloodTile(tile);
 
222
                        MarkTileDirtyByTile(tile);
 
223
                        return;
 
224
                }
 
225
        }
219
226
        TileLoopClearHelper(tile);
220
227
 
221
 
        switch (_opt.landscape) {
 
228
        switch (_settings_game.game_creation.landscape) {
222
229
                case LT_TROPIC: TileLoopClearDesert(tile); break;
223
230
                case LT_ARCTIC: TileLoopClearAlps(tile);   break;
224
231
        }
310
317
        } while (--i);
311
318
}
312
319
 
313
 
static void ClickTile_Clear(TileIndex tile)
 
320
static bool ClickTile_Clear(TileIndex tile)
314
321
{
315
322
        /* not used */
 
323
        return false;
316
324
}
317
325
 
318
326
static TrackStatus GetTileTrackStatus_Clear(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
336
344
        } else {
337
345
                td->str = _clear_land_str[GetClearGround(tile)];
338
346
        }
339
 
        td->owner = GetTileOwner(tile);
 
347
        td->owner[0] = GetTileOwner(tile);
340
348
}
341
349
 
342
 
static void ChangeTileOwner_Clear(TileIndex tile, PlayerID old_player, PlayerID new_player)
 
350
static void ChangeTileOwner_Clear(TileIndex tile, Owner old_owner, Owner new_owner)
343
351
{
344
352
        return;
345
353
}
346
354
 
347
355
void InitializeClearLand()
348
356
{
349
 
        _opt.snow_line = _patches.snow_line_height * TILE_HEIGHT;
 
357
        _settings_game.game_creation.snow_line = _settings_game.game_creation.snow_line_height * TILE_HEIGHT;
350
358
}
351
359
 
352
 
static CommandCost TerraformTile_Clear(TileIndex tile, uint32 flags, uint z_new, Slope tileh_new)
 
360
static CommandCost TerraformTile_Clear(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
353
361
{
354
362
        return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
355
363
}