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

« back to all changes in this revision

Viewing changes to src/newgrf_town.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: newgrf_town.cpp 12381 2008-03-18 12:28:21Z skidd13 $ */
 
1
/* $Id: newgrf_town.cpp 15513 2009-02-18 09:14:41Z peter1138 $ */
2
2
 
3
 
/** @file newgrf_town.cpp */
 
3
/** @file newgrf_town.cpp Implementation of the town part of NewGRF houses. */
4
4
 
5
5
#include "stdafx.h"
6
 
#include "openttd.h"
7
 
#include "settings_type.h"
8
6
#include "debug.h"
9
 
#include "core/bitmath_func.hpp"
10
 
#include "core/math_func.hpp"
11
7
#include "town.h"
12
8
 
13
9
/** This function implements the town variables that newGRF defines.
21
17
        switch (variable) {
22
18
                /* Larger towns */
23
19
                case 0x40:
24
 
                        if (_patches.larger_towns == 0) return 2;
 
20
                        if (_settings_game.economy.larger_towns == 0) return 2;
25
21
                        if (t->larger_town) return 1;
26
22
                        return 0;
27
23
 
36
32
                case 0x8A: return t->grow_counter;
37
33
                case 0x92: return t->flags12;  // In original game, 0x92 and 0x93 are really one word. Since flags12 is a byte, this is to adjust
38
34
                case 0x93: return 0;
39
 
                case 0x94: return t->radius[0];
40
 
                case 0x95: return GB(t->radius[0], 8, 8);
41
 
                case 0x96: return t->radius[1];
42
 
                case 0x97: return GB(t->radius[1], 8, 8);
43
 
                case 0x98: return t->radius[2];
44
 
                case 0x99: return GB(t->radius[2], 8, 8);
45
 
                case 0x9A: return t->radius[3];
46
 
                case 0x9B: return GB(t->radius[3], 8, 8);
47
 
                case 0x9C: return t->radius[4];
48
 
                case 0x9D: return GB(t->radius[4], 8, 8);
 
35
                case 0x94: return ClampToU16(t->squared_town_zone_radius[0]);
 
36
                case 0x95: return GB(ClampToU16(t->squared_town_zone_radius[0]), 8, 8);
 
37
                case 0x96: return ClampToU16(t->squared_town_zone_radius[1]);
 
38
                case 0x97: return GB(ClampToU16(t->squared_town_zone_radius[1]), 8, 8);
 
39
                case 0x98: return ClampToU16(t->squared_town_zone_radius[2]);
 
40
                case 0x99: return GB(ClampToU16(t->squared_town_zone_radius[2]), 8, 8);
 
41
                case 0x9A: return ClampToU16(t->squared_town_zone_radius[3]);
 
42
                case 0x9B: return GB(ClampToU16(t->squared_town_zone_radius[3]), 8, 8);
 
43
                case 0x9C: return ClampToU16(t->squared_town_zone_radius[4]);
 
44
                case 0x9D: return GB(ClampToU16(t->squared_town_zone_radius[4]), 8, 8);
49
45
                case 0x9E: return t->ratings[0];
50
46
                case 0x9F: return GB(t->ratings[0], 8, 8);
51
47
                case 0xA0: return t->ratings[1];
99
95
        DEBUG(grf, 1, "Unhandled town property 0x%X", variable);
100
96
 
101
97
        *available = false;
102
 
        return (uint32)-1;
 
98
        return UINT_MAX;
103
99
}