OpenTTD
newgrf_industrytiles.h
Go to the documentation of this file.
1 /* $Id: newgrf_industrytiles.h 26085 2013-11-24 14:41:19Z frosch $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * 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.
6  * 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.
7  * 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/>.
8  */
9 
12 #ifndef NEWGRF_INDUSTRYTILES_H
13 #define NEWGRF_INDUSTRYTILES_H
14 
15 #include "newgrf_animation_type.h"
16 #include "newgrf_industries.h"
17 #include "core/random_func.hpp"
18 
23 
25 
26  /* virtual */ uint32 GetRandomBits() const;
27  /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
28  /* virtual */ uint32 GetTriggers() const;
29  /* virtual */ void SetTriggers(int triggers) const;
30 };
31 
36 
37  IndustryTileResolverObject(IndustryGfx gfx, TileIndex tile, Industry *indus,
39 
40  /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
41  {
42  switch (scope) {
43  case VSG_SCOPE_SELF: return &indtile_scope;
44  case VSG_SCOPE_PARENT: return &ind_scope;
45  default: return ResolverObject::GetScope(scope, relative);
46  }
47  }
48 };
49 
50 bool DrawNewIndustryTile(TileInfo *ti, Industry *i, IndustryGfx gfx, const IndustryTileSpec *inds);
51 uint16 GetIndustryTileCallback(CallbackID callback, uint32 param1, uint32 param2, IndustryGfx gfx_id, Industry *industry, TileIndex tile);
52 CommandCost PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind_tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx, uint itspec_index, uint16 initial_random_bits, Owner founder, IndustryAvailabilityCallType creation_type);
53 
54 void AnimateNewIndustryTile(TileIndex tile);
55 bool StartStopIndustryTileAnimation(TileIndex tile, IndustryAnimationTrigger iat, uint32 random = Random());
56 bool StartStopIndustryTileAnimation(const Industry *ind, IndustryAnimationTrigger iat);
57 
58 
64 };
66 void TriggerIndustry(Industry *ind, IndustryTileTrigger trigger);
67 
68 #endif /* NEWGRF_INDUSTRYTILES_H */