| author | glx |
| Sat, 06 Oct 2007 22:30:24 +0000 | |
| branch | noai |
| changeset 9704 | 197cb8c6ae17 |
| parent 9694 | e72987579514 |
| child 6871 | 5a9dc001e1ad |
| permissions | -rw-r--r-- |
| 9476 | 1 |
/* $Id$ */ |
2 |
||
3 |
/** @file newgrf_house.h */ |
|
4 |
||
5 |
#ifndef NEWGRF_HOUSE_H |
|
6 |
#define NEWGRF_HOUSE_H |
|
7 |
||
8 |
#include "town.h" |
|
|
9694
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9626
diff
changeset
|
9 |
#include "newgrf_callbacks.h" |
| 9476 | 10 |
|
11 |
/** |
|
12 |
* Makes class IDs unique to each GRF file. |
|
13 |
* Houses can be assigned class IDs which are only comparable within the GRF |
|
14 |
* file they were defined in. This mapping ensures that if two houses have the |
|
15 |
* same class as defined by the GRF file, the classes are different within the |
|
16 |
* game. An array of HouseClassMapping structs is created, and the array index |
|
17 |
* of the struct that matches both the GRF ID and the class ID is the class ID |
|
18 |
* used in the game. |
|
19 |
* |
|
20 |
* Although similar to the HouseIDMapping struct above, this serves a different |
|
21 |
* purpose. Since the class ID is not saved anywhere, this mapping does not |
|
22 |
* need to be persistent; it just needs to keep class ids unique. |
|
23 |
*/ |
|
24 |
struct HouseClassMapping {
|
|
25 |
uint32 grfid; ////< The GRF ID of the file this class belongs to |
|
26 |
uint8 class_id; ////< The class id within the grf file |
|
27 |
}; |
|
28 |
||
29 |
void CheckHouseIDs(); |
|
30 |
||
31 |
HouseClassID AllocateHouseClassID(byte grf_class_id, uint32 grfid); |
|
32 |
||
33 |
void InitializeBuildingCounts(); |
|
34 |
void IncreaseBuildingCount(Town *t, HouseID house_id); |
|
35 |
void DecreaseBuildingCount(Town *t, HouseID house_id); |
|
36 |
void AfterLoadCountBuildings(); |
|
37 |
||
38 |
void DrawNewHouseTile(TileInfo *ti, HouseID house_id); |
|
39 |
void AnimateNewHouseTile(TileIndex tile); |
|
40 |
void ChangeHouseAnimationFrame(TileIndex tile, uint16 callback_result); |
|
41 |
||
|
9694
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9626
diff
changeset
|
42 |
uint16 GetHouseCallback(CallbackID callback, uint32 param1, uint32 param2, HouseID house_id, Town *town, TileIndex tile); |
| 9476 | 43 |
|
44 |
bool CanDeleteHouse(TileIndex tile); |
|
45 |
||
46 |
bool NewHouseTileLoop(TileIndex tile); |
|
47 |
||
48 |
#endif /* NEWGRF_HOUSE_H */ |