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 $ */
3
/** @file newgrf_town.cpp */
3
/** @file newgrf_town.cpp Implementation of the town part of NewGRF houses. */
7
#include "settings_type.h"
9
#include "core/bitmath_func.hpp"
10
#include "core/math_func.hpp"
13
9
/** This function implements the town variables that newGRF defines.
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];