newgrf_house.h

Go to the documentation of this file.
00001 /* $Id: newgrf_house.h 17248 2009-08-21 20:21:05Z rubidium $ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
00008  */
00009 
00012 #ifndef NEWGRF_HOUSE_H
00013 #define NEWGRF_HOUSE_H
00014 
00015 #include "town_type.h"
00016 #include "newgrf_callbacks.h"
00017 #include "tile_cmd.h"
00018 #include "house_type.h"
00019 
00033 struct HouseClassMapping {
00034   uint32 grfid;     
00035   uint8  class_id;  
00036 };
00037 
00038 HouseClassID AllocateHouseClassID(byte grf_class_id, uint32 grfid);
00039 
00040 void InitializeBuildingCounts();
00041 void IncreaseBuildingCount(Town *t, HouseID house_id);
00042 void DecreaseBuildingCount(Town *t, HouseID house_id);
00043 
00044 void DrawNewHouseTile(TileInfo *ti, HouseID house_id);
00045 void AnimateNewHouseTile(TileIndex tile);
00046 void ChangeHouseAnimationFrame(const struct GRFFile *file, TileIndex tile, uint16 callback_result);
00047 
00048 uint16 GetHouseCallback(CallbackID callback, uint32 param1, uint32 param2, HouseID house_id, Town *town, TileIndex tile);
00049 
00050 bool CanDeleteHouse(TileIndex tile);
00051 
00052 bool NewHouseTileLoop(TileIndex tile);
00053 
00054 enum HouseTrigger {
00055   /* The tile of the house has been triggered during the tileloop. */
00056   HOUSE_TRIGGER_TILE_LOOP     = 0x01,
00057   /*
00058    * The top tile of a (multitile) building has been triggered during and all
00059    * the tileloop other tiles of the same building get the same random value.
00060    */
00061   HOUSE_TRIGGER_TILE_LOOP_TOP = 0x02,
00062 };
00063 void TriggerHouse(TileIndex t, HouseTrigger trigger);
00064 
00065 #endif /* NEWGRF_HOUSE_H */

Generated on Tue Jan 5 21:02:56 2010 for OpenTTD by  doxygen 1.5.6