newgrf_house.h

Go to the documentation of this file.
00001 /* $Id: newgrf_house.h 20627 2010-08-26 17:01:17Z 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 "newgrf_callbacks.h"
00016 #include "tile_cmd.h"
00017 #include "house_type.h"
00018 
00032 struct HouseClassMapping {
00033   uint32 grfid;     
00034   uint8  class_id;  
00035 };
00036 
00037 HouseClassID AllocateHouseClassID(byte grf_class_id, uint32 grfid);
00038 
00039 void InitializeBuildingCounts();
00040 void IncreaseBuildingCount(Town *t, HouseID house_id);
00041 void DecreaseBuildingCount(Town *t, HouseID house_id);
00042 
00043 void DrawNewHouseTile(TileInfo *ti, HouseID house_id);
00044 void AnimateNewHouseTile(TileIndex tile);
00045 void AnimateNewHouseConstruction(TileIndex tile);
00046 
00047 uint16 GetHouseCallback(CallbackID callback, uint32 param1, uint32 param2, HouseID house_id, const Town *town, TileIndex tile, bool not_yet_constructed = false, uint8 initial_random_bits = 0);
00048 
00049 bool CanDeleteHouse(TileIndex tile);
00050 
00051 bool NewHouseTileLoop(TileIndex tile);
00052 
00053 enum HouseTrigger {
00054   /* The tile of the house has been triggered during the tileloop. */
00055   HOUSE_TRIGGER_TILE_LOOP     = 0x01,
00056   /*
00057    * The top tile of a (multitile) building has been triggered during and all
00058    * the tileloop other tiles of the same building get the same random value.
00059    */
00060   HOUSE_TRIGGER_TILE_LOOP_TOP = 0x02,
00061 };
00062 void TriggerHouse(TileIndex t, HouseTrigger trigger);
00063 
00064 #endif /* NEWGRF_HOUSE_H */

Generated on Thu Jan 20 22:57:37 2011 for OpenTTD by  doxygen 1.6.1