newgrf_industrytiles.h

Go to the documentation of this file.
00001 /* $Id: newgrf_industrytiles.h 18809 2010-01-15 16:41:15Z 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_INDUSTRYTILES_H
00013 #define NEWGRF_INDUSTRYTILES_H
00014 
00015 #include "tile_cmd.h"
00016 #include "industry_type.h"
00017 #include "newgrf_callbacks.h"
00018 #include "core/random_func.hpp"
00019 
00020 enum IndustryAnimationTrigger {
00021   IAT_CONSTRUCTION_STATE_CHANGE,
00022   IAT_TILELOOP,
00023   IAT_INDUSTRY_TICK,
00024   IAT_INDUSTRY_RECEIVED_CARGO,
00025   IAT_INDUSTRY_DISTRIBUTES_CARGO,
00026 };
00027 
00028 bool DrawNewIndustryTile(TileInfo *ti, Industry *i, IndustryGfx gfx, const IndustryTileSpec *inds);
00029 uint16 GetIndustryTileCallback(CallbackID callback, uint32 param1, uint32 param2, IndustryGfx gfx_id, Industry *industry, TileIndex tile);
00030 bool PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind_tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx, uint itspec_index);
00031 
00032 void AnimateNewIndustryTile(TileIndex tile);
00033 bool StartStopIndustryTileAnimation(TileIndex tile, IndustryAnimationTrigger iat, uint32 random = Random());
00034 bool StartStopIndustryTileAnimation(const Industry *ind, IndustryAnimationTrigger iat);
00035 
00036 
00037 enum IndustryTileTrigger {
00038   /* The tile of the industry has been triggered during the tileloop. */
00039   INDTILE_TRIGGER_TILE_LOOP       = 0x01,
00040   /* The industry has been triggered via it's tick. */
00041   INDUSTRY_TRIGGER_INDUSTRY_TICK  = 0x02,
00042   /* Cargo has been delivered. */
00043   INDUSTRY_TRIGGER_RECEIVED_CARGO = 0x04,
00044 };
00045 void TriggerIndustryTile(TileIndex t, IndustryTileTrigger trigger);
00046 void TriggerIndustry(Industry *ind, IndustryTileTrigger trigger);
00047 
00048 #endif /* NEWGRF_INDUSTRYTILES_H */

Generated on Mon Aug 30 19:36:57 2010 for OpenTTD by  doxygen 1.6.1