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"
|
|
9 |
|
|
10 |
/**
|
|
11 |
* Makes class IDs unique to each GRF file.
|
|
12 |
* Houses can be assigned class IDs which are only comparable within the GRF
|
|
13 |
* file they were defined in. This mapping ensures that if two houses have the
|
|
14 |
* same class as defined by the GRF file, the classes are different within the
|
|
15 |
* game. An array of HouseClassMapping structs is created, and the array index
|
|
16 |
* of the struct that matches both the GRF ID and the class ID is the class ID
|
|
17 |
* used in the game.
|
|
18 |
*
|
|
19 |
* Although similar to the HouseIDMapping struct above, this serves a different
|
|
20 |
* purpose. Since the class ID is not saved anywhere, this mapping does not
|
|
21 |
* need to be persistent; it just needs to keep class ids unique.
|
|
22 |
*/
|
|
23 |
struct HouseClassMapping {
|
|
24 |
uint32 grfid; ////< The GRF ID of the file this class belongs to
|
|
25 |
uint8 class_id; ////< The class id within the grf file
|
|
26 |
};
|
|
27 |
|
|
28 |
void CheckHouseIDs();
|
|
29 |
|
|
30 |
HouseClassID AllocateHouseClassID(byte grf_class_id, uint32 grfid);
|
|
31 |
|
|
32 |
void InitializeBuildingCounts();
|
|
33 |
void IncreaseBuildingCount(Town *t, HouseID house_id);
|
|
34 |
void DecreaseBuildingCount(Town *t, HouseID house_id);
|
|
35 |
void AfterLoadCountBuildings();
|
|
36 |
|
|
37 |
void DrawNewHouseTile(TileInfo *ti, HouseID house_id);
|
|
38 |
void AnimateNewHouseTile(TileIndex tile);
|
|
39 |
void ChangeHouseAnimationFrame(TileIndex tile, uint16 callback_result);
|
|
40 |
|
9624
|
41 |
uint16 GetHouseCallback(uint16 callback, uint32 param1, uint32 param2, HouseID house_id, Town *town, TileIndex tile);
|
9476
|
42 |
|
|
43 |
bool CanDeleteHouse(TileIndex tile);
|
|
44 |
|
|
45 |
bool NewHouseTileLoop(TileIndex tile);
|
|
46 |
|
|
47 |
#endif /* NEWGRF_HOUSE_H */
|