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

« back to all changes in this revision

Viewing changes to src/town_map.h

  • 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: town_map.h 12347 2008-03-06 14:21:10Z frosch $ */
 
1
/* $Id: town_map.h 14611 2008-11-23 14:17:41Z frosch $ */
2
2
 
3
3
/** @file town_map.h Accessors for towns */
4
4
 
6
6
#define TOWN_MAP_H
7
7
 
8
8
#include "town.h"
9
 
#include "date_func.h"
10
9
#include "tile_map.h"
11
 
#include "functions.h"
12
10
 
13
11
/**
14
12
 * Get the index of which town this house/street is attached to.
113
111
static inline void HaltLift(TileIndex t)
114
112
{
115
113
        SB(_me[t].m7, 0, 4, 0);
116
 
        DeleteAnimatedTile(t);
117
114
}
118
115
 
119
116
/**
206
203
        _m[t].m5 = IsHouseCompleted(t) ? 0 : (stage << 3 | counter);
207
204
        SetHouseAnimationFrame(t, 0);
208
205
        _me[t].m7 = GetHouseSpecs(type)->processing_time;
209
 
 
210
 
        if (GetHouseSpecs(type)->building_flags & BUILDING_IS_ANIMATED) AddAnimatedTile(t);
211
 
        MarkTileDirtyByTile(t);
212
206
}
213
207
 
214
208
/**
266
260
                /* House is now completed.
267
261
                 * Store the year of construction as well, for newgrf house purpose */
268
262
                SetHouseCompleted(t, true);
269
 
                _m[t].m5 = Clamp(_cur_year - ORIGINAL_BASE_YEAR, 0, 0xFF);
270
263
        }
271
264
}
272
265
 
273
266
/**
274
 
 * Get the year that this house was constructed (between 1920 and 2175).
 
267
 * Sets the age of the house to zero.
 
268
 * Needs to be called after the house is completed. During construction stages the map space is used otherwise.
 
269
 * @param t the tile of this house
 
270
 * @pre IsTileType(t, MP_HOUSE) && IsHouseCompleted(t)
 
271
 */
 
272
static inline void ResetHouseAge(TileIndex t)
 
273
{
 
274
        assert(IsTileType(t, MP_HOUSE) && IsHouseCompleted(t));
 
275
        _m[t].m5 = 0;
 
276
}
 
277
 
 
278
/**
 
279
 * Increments the age of the house.
 
280
 * @param t the tile of this house
 
281
 * @pre IsTileType(t, MP_HOUSE)
 
282
 */
 
283
static inline void IncrementHouseAge(TileIndex t)
 
284
{
 
285
        assert(IsTileType(t, MP_HOUSE));
 
286
        if (IsHouseCompleted(t) && _m[t].m5 < 0xFF) _m[t].m5++;
 
287
}
 
288
 
 
289
/**
 
290
 * Get the age of the house
275
291
 * @param t the tile of this house
276
292
 * @pre IsTileType(t, MP_HOUSE)
277
293
 * @return year
278
294
 */
279
 
static inline Year GetHouseConstructionYear(TileIndex t)
 
295
static inline Year GetHouseAge(TileIndex t)
280
296
{
281
297
        assert(IsTileType(t, MP_HOUSE));
282
 
        return IsHouseCompleted(t) ? _m[t].m5 + ORIGINAL_BASE_YEAR : 0;
 
298
        return IsHouseCompleted(t) ? _m[t].m5 : 0;
283
299
}
284
300
 
285
301
/**