2007-06-13 02:29:08 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file newgrf_industrytiles.h NewGRF handling of industry tiles. */
|
2007-06-13 02:29:08 +00:00
|
|
|
|
|
|
|
#ifndef NEWGRF_INDUSTRYTILES_H
|
|
|
|
#define NEWGRF_INDUSTRYTILES_H
|
|
|
|
|
2010-01-15 16:41:15 +00:00
|
|
|
#include "tile_cmd.h"
|
|
|
|
#include "industry_type.h"
|
|
|
|
#include "newgrf_callbacks.h"
|
|
|
|
#include "core/random_func.hpp"
|
|
|
|
|
2007-07-11 15:03:29 +00:00
|
|
|
enum IndustryAnimationTrigger {
|
|
|
|
IAT_CONSTRUCTION_STATE_CHANGE,
|
|
|
|
IAT_TILELOOP,
|
|
|
|
IAT_INDUSTRY_TICK,
|
|
|
|
IAT_INDUSTRY_RECEIVED_CARGO,
|
|
|
|
IAT_INDUSTRY_DISTRIBUTES_CARGO,
|
|
|
|
};
|
|
|
|
|
2007-06-19 17:33:12 +00:00
|
|
|
bool DrawNewIndustryTile(TileInfo *ti, Industry *i, IndustryGfx gfx, const IndustryTileSpec *inds);
|
2007-07-25 19:06:29 +00:00
|
|
|
uint16 GetIndustryTileCallback(CallbackID callback, uint32 param1, uint32 param2, IndustryGfx gfx_id, Industry *industry, TileIndex tile);
|
2010-02-27 10:21:59 +00:00
|
|
|
CommandCost PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind_tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx, uint itspec_index);
|
2007-06-13 02:29:08 +00:00
|
|
|
|
2007-07-11 15:03:29 +00:00
|
|
|
void AnimateNewIndustryTile(TileIndex tile);
|
|
|
|
bool StartStopIndustryTileAnimation(TileIndex tile, IndustryAnimationTrigger iat, uint32 random = Random());
|
|
|
|
bool StartStopIndustryTileAnimation(const Industry *ind, IndustryAnimationTrigger iat);
|
|
|
|
|
2007-11-11 17:56:37 +00:00
|
|
|
|
|
|
|
enum IndustryTileTrigger {
|
|
|
|
/* The tile of the industry has been triggered during the tileloop. */
|
|
|
|
INDTILE_TRIGGER_TILE_LOOP = 0x01,
|
2010-04-12 14:12:47 +00:00
|
|
|
/* The industry has been triggered via its tick. */
|
2007-11-11 17:56:37 +00:00
|
|
|
INDUSTRY_TRIGGER_INDUSTRY_TICK = 0x02,
|
|
|
|
/* Cargo has been delivered. */
|
|
|
|
INDUSTRY_TRIGGER_RECEIVED_CARGO = 0x04,
|
|
|
|
};
|
|
|
|
void TriggerIndustryTile(TileIndex t, IndustryTileTrigger trigger);
|
|
|
|
void TriggerIndustry(Industry *ind, IndustryTileTrigger trigger);
|
|
|
|
|
2007-06-13 02:29:08 +00:00
|
|
|
#endif /* NEWGRF_INDUSTRYTILES_H */
|