OpenTTD Source: src/newgrf_spritegroup.h Source File

OpenTTD Source 1.11.0-RC1

newgrf_spritegroup.h
Go to the documentation of this file.
1 /*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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/>.
6 */
7
10 #ifndef NEWGRF_SPRITEGROUP_H
11 #define NEWGRF_SPRITEGROUP_H
12
13 #include "town_type.h"
14 #include "engine_type.h"
15 #include "house_type.h"
16 #include "industry_type.h"
17
18 #include "newgrf_callbacks.h"
19 #include "newgrf_generic.h"
20 #include "newgrf_storage.h"
21 #include "newgrf_commons.h"
22
29 static inline uint32 GetRegister(uint i)
30 {
31 extern TemporaryStorageArray<int32, 0x110> _temp_store;
32 return _temp_store.GetValue(i);
33 }
34
35 /* List of different sprite group types */
36 enum SpriteGroupType {
37 SGT_REAL,
38 SGT_DETERMINISTIC,
39 SGT_RANDOMIZED,
40 SGT_CALLBACK,
41 SGT_RESULT,
42 SGT_TILELAYOUT,
43 SGT_INDUSTRY_PRODUCTION,
44 };
45
46 struct SpriteGroup;
47 typedef uint32 SpriteGroupID;
48 struct ResolverObject;
49
50 /* SPRITE_WIDTH is 24. ECS has roughly 30 sprite groups per real sprite.
51 * Adding an 'extra' margin would be assuming 64 sprite groups per real
52 * sprite. 64 = 2^6, so 2^30 should be enough (for now) */
53 typedef Pool<SpriteGroup, SpriteGroupID, 1024, 1 << 30, PT_DATA> SpriteGroupPool;
54 extern SpriteGroupPool _spritegroup_pool;
55
56 /* Common wrapper for all the different sprite group types */
57 struct SpriteGroup : SpriteGroupPool::PoolItem<&_spritegroup_pool> {
58 protected:
59 SpriteGroup(SpriteGroupType type) : nfo_line(0), type(type) {}
61 virtual const SpriteGroup *Resolve(ResolverObject &object) const { return this; };
62
63 public:
64 virtual ~SpriteGroup() {}
65
66 uint32 nfo_line;
67 SpriteGroupType type;
68
69 virtual SpriteID GetResult() const { return 0; }
70 virtual byte GetNumResults() const { return 0; }
71 virtual uint16 GetCallbackResult() const { return CALLBACK_FAILED; }
72
73 static const SpriteGroup *Resolve(const SpriteGroup *group, ResolverObject &object, bool top_level = true);
74 };
75
76
77 /* 'Real' sprite groups contain a list of other result or callback sprite
78 * groups. */
79 struct RealSpriteGroup : SpriteGroup {
80 RealSpriteGroup() : SpriteGroup(SGT_REAL) {}
81 ~RealSpriteGroup();
82
83 /* Loaded = in motion, loading = not moving
84 * Each group contains several spritesets, for various loading stages */
85
86 /* XXX: For stations the meaning is different - loaded is for stations
87 * with small amount of cargo whilst loading is for stations with a lot
88 * of da stuff. */
89
90 byte num_loaded;
91 byte num_loading;
92 const SpriteGroup **loaded;
93 const SpriteGroup **loading;
94
95 protected:
96 const SpriteGroup *Resolve(ResolverObject &object) const;
97 };
98
99 /* Shared by deterministic and random groups. */
100 enum VarSpriteGroupScope {
101 VSG_BEGIN,
102
103 VSG_SCOPE_SELF = VSG_BEGIN,
104 VSG_SCOPE_PARENT,
105 VSG_SCOPE_RELATIVE,
106
107 VSG_END
108 };
109 DECLARE_POSTFIX_INCREMENT(VarSpriteGroupScope)
110
111 enum DeterministicSpriteGroupSize {
112 DSG_SIZE_BYTE,
113 DSG_SIZE_WORD,
114 DSG_SIZE_DWORD,
115 };
116
117 enum DeterministicSpriteGroupAdjustType {
118 DSGA_TYPE_NONE,
119 DSGA_TYPE_DIV,
120 DSGA_TYPE_MOD,
121 };
122
123 enum DeterministicSpriteGroupAdjustOperation {
124 DSGA_OP_ADD,
125 DSGA_OP_SUB,
126 DSGA_OP_SMIN,
127 DSGA_OP_SMAX,
128 DSGA_OP_UMIN,
129 DSGA_OP_UMAX,
130 DSGA_OP_SDIV,
131 DSGA_OP_SMOD,
132 DSGA_OP_UDIV,
133 DSGA_OP_UMOD,
134 DSGA_OP_MUL,
135 DSGA_OP_AND,
136 DSGA_OP_OR,
137 DSGA_OP_XOR,
138 DSGA_OP_STO,
139 DSGA_OP_RST,
140 DSGA_OP_STOP,
141 DSGA_OP_ROR,
142 DSGA_OP_SCMP,
143 DSGA_OP_UCMP,
144 DSGA_OP_SHL,
145 DSGA_OP_SHR,
146 DSGA_OP_SAR,
147 };
148
149
150 struct DeterministicSpriteGroupAdjust {
151 DeterministicSpriteGroupAdjustOperation operation;
152 DeterministicSpriteGroupAdjustType type;
153 byte variable;
154 byte parameter;
155 byte shift_num;
156 uint32 and_mask;
157 uint32 add_val;
158 uint32 divmod_val;
159 const SpriteGroup *subroutine;
160 };
161
162
163 struct DeterministicSpriteGroupRange {
164 const SpriteGroup *group;
165 uint32 low;
166 uint32 high;
167 };
168
169
170 struct DeterministicSpriteGroup : SpriteGroup {
171 DeterministicSpriteGroup() : SpriteGroup(SGT_DETERMINISTIC) {}
172 ~DeterministicSpriteGroup();
173
174 VarSpriteGroupScope var_scope;
175 DeterministicSpriteGroupSize size;
176 uint num_adjusts;
177 uint num_ranges;
178 bool calculated_result;
179 DeterministicSpriteGroupAdjust *adjusts;
180 DeterministicSpriteGroupRange *ranges; // Dynamically allocated
181
182 /* Dynamically allocated, this is the sole owner */
183 const SpriteGroup *default_group;
184
185 const SpriteGroup *error_group; // was first range, before sorting ranges
186
187 protected:
188 const SpriteGroup *Resolve(ResolverObject &object) const;
189 };
190
191 enum RandomizedSpriteGroupCompareMode {
192 RSG_CMP_ANY,
193 RSG_CMP_ALL,
194 };
195
196 struct RandomizedSpriteGroup : SpriteGroup {
197 RandomizedSpriteGroup() : SpriteGroup(SGT_RANDOMIZED) {}
198 ~RandomizedSpriteGroup();
199
200 VarSpriteGroupScope var_scope;
201
202 RandomizedSpriteGroupCompareMode cmp_mode;
203 byte triggers;
204 byte count;
205
206 byte lowest_randbit;
207 byte num_groups;
208
209 const SpriteGroup **groups;
210
211 protected:
212 const SpriteGroup *Resolve(ResolverObject &object) const;
213 };
214
215
216 /* This contains a callback result. A failed callback has a value of
217 * CALLBACK_FAILED */
218 struct CallbackResultSpriteGroup : SpriteGroup {
224 CallbackResultSpriteGroup(uint16 value, bool grf_version8) :
225 SpriteGroup(SGT_CALLBACK),
226 result(value)
227 {
228 /* Old style callback results (only valid for version < 8) have the highest byte 0xFF so signify it is a callback result.
229 * New style ones only have the highest bit set (allows 15-bit results, instead of just 8) */
230 if (!grf_version8 && (this->result >> 8) == 0xFF) {
231 this->result &= ~0xFF00;
232 } else {
233 this->result &= ~0x8000;
234 }
235 }
236
237 uint16 result;
238 uint16 GetCallbackResult() const { return this->result; }
239 };
240
241
242 /* A result sprite group returns the first SpriteID and the number of
243 * sprites in the set */
244 struct ResultSpriteGroup : SpriteGroup {
251 ResultSpriteGroup(SpriteID sprite, byte num_sprites) :
252 SpriteGroup(SGT_RESULT),
253 sprite(sprite),
254 num_sprites(num_sprites)
255 {
256 }
257
258 SpriteID sprite;
259 byte num_sprites;
260 SpriteID GetResult() const { return this->sprite; }
261 byte GetNumResults() const { return this->num_sprites; }
262 };
263
267 struct TileLayoutSpriteGroup : SpriteGroup {
268 TileLayoutSpriteGroup() : SpriteGroup(SGT_TILELAYOUT) {}
269 ~TileLayoutSpriteGroup() {}
270
271 NewGRFSpriteLayout dts;
272
273 const DrawTileSprites *ProcessRegisters(uint8 *stage) const;
274 };
275
276 struct IndustryProductionSpriteGroup : SpriteGroup {
277 IndustryProductionSpriteGroup() : SpriteGroup(SGT_INDUSTRY_PRODUCTION) {}
278
279 uint8 version;
280 uint8 num_input;
281 int16 subtract_input[INDUSTRY_NUM_INPUTS];
282 CargoID cargo_input[INDUSTRY_NUM_INPUTS];
283 uint8 num_output;
284 uint16 add_output[INDUSTRY_NUM_OUTPUTS];
285 CargoID cargo_output[INDUSTRY_NUM_OUTPUTS];
286 uint8 again;
287
288 };
289
296 struct ScopeResolver {
297 ResolverObject &ro;
298
299 ScopeResolver(ResolverObject &ro) : ro(ro) {}
300 virtual ~ScopeResolver() {}
301
302 virtual uint32 GetRandomBits() const;
303 virtual uint32 GetTriggers() const;
304
305 virtual uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
306 virtual void StorePSA(uint reg, int32 value);
307 };
308
315 struct ResolverObject {
323 ResolverObject(const GRFFile *grffile, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0)
324 : default_scope(*this), callback(callback), callback_param1(callback_param1), callback_param2(callback_param2), grffile(grffile), root_spritegroup(nullptr)
325 {
326 this->ResetState();
327 }
328
329 virtual ~ResolverObject() {}
330
331 ScopeResolver default_scope;
332
333 CallbackID callback;
334 uint32 callback_param1;
335 uint32 callback_param2;
336
337 uint32 last_value;
338
339 uint32 waiting_triggers;
340 uint32 used_triggers;
341 uint32 reseed[VSG_END];
342
343 const GRFFile *grffile;
344 const SpriteGroup *root_spritegroup;
345
350 const SpriteGroup *Resolve()
351 {
352 return SpriteGroup::Resolve(this->root_spritegroup, *this);
353 }
354
359 uint16 ResolveCallback()
360 {
361 const SpriteGroup *result = Resolve();
362 return result != nullptr ? result->GetCallbackResult() : CALLBACK_FAILED;
363 }
364
365 virtual const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
366
367 virtual ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0);
368
372 uint32 GetRemainingTriggers() const
373 {
374 return this->waiting_triggers & ~this->used_triggers;
375 }
376
382 uint32 GetReseedSum() const
383 {
384 uint32 sum = 0;
385 for (VarSpriteGroupScope vsg = VSG_BEGIN; vsg < VSG_END; vsg++) {
386 sum |= this->reseed[vsg];
387 }
388 return sum;
389 }
390
395 void ResetState()
396 {
397 this->last_value = 0;
398 this->waiting_triggers = 0;
399 this->used_triggers = 0;
400 memset(this->reseed, 0, sizeof(this->reseed));
401 }
402
407 virtual GrfSpecFeature GetFeature() const { return GSF_INVALID; }
413 virtual uint32 GetDebugID() const { return 0; }
414 };
415
416 #endif /* NEWGRF_SPRITEGROUP_H */
house_type.h
DSGA_OP_SCMP
@ DSGA_OP_SCMP
(signed) comparison (a < b -> 0, a == b = 1, a > b = 2)
Definition: newgrf_spritegroup.h:142
VarSpriteGroupScope
VarSpriteGroupScope
Definition: newgrf_spritegroup.h:100
RealSpriteGroup::loaded
const SpriteGroup ** loaded
List of loaded groups (can be SpriteIDs or Callback results)
Definition: newgrf_spritegroup.h:92
ResolverObject::callback_param1
uint32 callback_param1
First parameter (var 10) of the callback.
Definition: newgrf_spritegroup.h:334
INDUSTRY_NUM_OUTPUTS
static const int INDUSTRY_NUM_OUTPUTS
Number of cargo types an industry can produce.
Definition: industry_type.h:39
DSGA_OP_STOP
@ DSGA_OP_STOP
store a into persistent storage, indexed by b, return a
Definition: newgrf_spritegroup.h:140
IndustryProductionSpriteGroup::subtract_input
int16 subtract_input[INDUSTRY_NUM_INPUTS]
Take this much of the input cargo (can be negative, is indirect in cb version 1+)
Definition: newgrf_spritegroup.h:281
DeterministicSpriteGroupRange
Definition: newgrf_spritegroup.h:163
newgrf_commons.h
DeterministicSpriteGroup
Definition: newgrf_spritegroup.h:170
DSGA_OP_SUB
@ DSGA_OP_SUB
a - b
Definition: newgrf_spritegroup.h:125
RandomizedSpriteGroup::Resolve
const SpriteGroup * Resolve(ResolverObject &object) const
Base sprite group resolver.
Definition: newgrf_spritegroup.cpp:277
RealSpriteGroup::num_loaded
byte num_loaded
Number of loaded groups.
Definition: newgrf_spritegroup.h:90
INDUSTRY_NUM_INPUTS
static const int INDUSTRY_NUM_INPUTS
Number of cargo types an industry can accept.
Definition: industry_type.h:38
ScopeResolver::GetTriggers
virtual uint32 GetTriggers() const
Get the triggers.
Definition: newgrf_spritegroup.cpp:111
RandomizedSpriteGroup::cmp_mode
RandomizedSpriteGroupCompareMode cmp_mode
Check for these triggers:
Definition: newgrf_spritegroup.h:202
DeterministicSpriteGroupAdjust::parameter
byte parameter
Used for variables between 0x60 and 0x7F inclusive.
Definition: newgrf_spritegroup.h:154
IndustryProductionSpriteGroup::num_input
uint8 num_input
How many subtract_input values are valid.
Definition: newgrf_spritegroup.h:280
DSGA_OP_STO
@ DSGA_OP_STO
store a into temporary storage, indexed by b. return a
Definition: newgrf_spritegroup.h:138
ResolverObject
Interface for SpriteGroup-s to access the gamestate.
Definition: newgrf_spritegroup.h:315
DSGA_OP_AND
@ DSGA_OP_AND
a & b
Definition: newgrf_spritegroup.h:135
DSGA_OP_SMAX
@ DSGA_OP_SMAX
(signed) max(a, b)
Definition: newgrf_spritegroup.h:127
ResolverObject::grffile
const GRFFile * grffile
GRFFile the resolved SpriteGroup belongs to.
Definition: newgrf_spritegroup.h:343
ResolverObject::used_triggers
uint32 used_triggers
Subset of cur_triggers, which actually triggered some rerandomisation. (scope independent)
Definition: newgrf_spritegroup.h:340
ScopeResolver::StorePSA
virtual void StorePSA(uint reg, int32 value)
Store a value into the persistent storage area (PSA).
Definition: newgrf_spritegroup.cpp:135
TileLayoutSpriteGroup::ProcessRegisters
const DrawTileSprites * ProcessRegisters(uint8 *stage) const
Process registers and the construction stage into the sprite layout.
Definition: newgrf_spritegroup.cpp:310
ResolverObject::ResolverObject
ResolverObject(const GRFFile *grffile, CallbackID callback=CBID_NO_CALLBACK, uint32 callback_param1=0, uint32 callback_param2=0)
Resolver constructor.
Definition: newgrf_spritegroup.h:323
GetRegister
static uint32 GetRegister(uint i)
Gets the value of a so-called newgrf "register".
Definition: newgrf_spritegroup.h:29
newgrf_callbacks.h
DSGA_OP_XOR
@ DSGA_OP_XOR
a ^ b
Definition: newgrf_spritegroup.h:137
DSGA_OP_ADD
@ DSGA_OP_ADD
a + b
Definition: newgrf_spritegroup.h:124
DSGA_OP_ROR
@ DSGA_OP_ROR
rotate a b positions to the right
Definition: newgrf_spritegroup.h:141
GSF_INVALID
@ GSF_INVALID
An invalid spec feature.
Definition: newgrf.h:92
CallbackID
CallbackID
List of implemented NewGRF callbacks.
Definition: newgrf_callbacks.h:20
VSG_SCOPE_PARENT
@ VSG_SCOPE_PARENT
Related object of the resolved one.
Definition: newgrf_spritegroup.h:104
ResolverObject::GetRemainingTriggers
uint32 GetRemainingTriggers() const
Returns the waiting triggers that did not trigger any rerandomisation.
Definition: newgrf_spritegroup.h:372
ResolverObject::GetFeature
virtual GrfSpecFeature GetFeature() const
Get the feature number being resolved for.
Definition: newgrf_spritegroup.h:407
ScopeResolver
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope).
Definition: newgrf_spritegroup.h:296
ResolverObject::reseed
uint32 reseed[VSG_END]
Collects bits to rerandomise while triggering triggers.
Definition: newgrf_spritegroup.h:341
newgrf_generic.h
ResolverObject::GetReseedSum
uint32 GetReseedSum() const
Returns the OR-sum of all bits that need reseeding independent of the scope they were accessed with.
Definition: newgrf_spritegroup.h:382
VSG_SCOPE_SELF
@ VSG_SCOPE_SELF
Resolved object itself.
Definition: newgrf_spritegroup.h:103
DeterministicSpriteGroupAdjustOperation
DeterministicSpriteGroupAdjustOperation
Definition: newgrf_spritegroup.h:123
RandomizedSpriteGroup::var_scope
VarSpriteGroupScope var_scope
Take this object:
Definition: newgrf_spritegroup.h:200
ScopeResolver::GetRandomBits
virtual uint32 GetRandomBits() const
Get a few random bits.
Definition: newgrf_spritegroup.cpp:102
DSGA_OP_OR
@ DSGA_OP_OR
a | b
Definition: newgrf_spritegroup.h:136
SpriteID
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
Definition: gfx_type.h:17
ResolverObject::GetDebugID
virtual uint32 GetDebugID() const
Get an identifier for the item being resolved.
Definition: newgrf_spritegroup.h:413
RandomizedSpriteGroup::num_groups
byte num_groups
must be power of 2
Definition: newgrf_spritegroup.h:207
DECLARE_POSTFIX_INCREMENT
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:14
RealSpriteGroup::loading
const SpriteGroup ** loading
List of loading groups (can be SpriteIDs or Callback results)
Definition: newgrf_spritegroup.h:93
IndustryProductionSpriteGroup::num_output
uint8 num_output
How many add_output values are valid.
Definition: newgrf_spritegroup.h:283
DSGA_OP_UMIN
@ DSGA_OP_UMIN
(unsigned) min(a, b)
Definition: newgrf_spritegroup.h:128
ResolverObject::callback_param2
uint32 callback_param2
Second parameter (var 18) of the callback.
Definition: newgrf_spritegroup.h:335
ResolverObject::waiting_triggers
uint32 waiting_triggers
Waiting triggers to be used by any rerandomisation. (scope independent)
Definition: newgrf_spritegroup.h:339
ResolverObject::default_scope
ScopeResolver default_scope
Default implementation of the grf scope.
Definition: newgrf_spritegroup.h:331
RealSpriteGroup::Resolve
const SpriteGroup * Resolve(ResolverObject &object) const
Base sprite group resolver.
Definition: newgrf_spritegroup.cpp:298
CallbackResultSpriteGroup
Definition: newgrf_spritegroup.h:218
CBID_NO_CALLBACK
@ CBID_NO_CALLBACK
Set when using the callback resolve system, but not to resolve a callback.
Definition: newgrf_callbacks.h:22
ResolverObject::root_spritegroup
const SpriteGroup * root_spritegroup
Root SpriteGroup to use for resolving.
Definition: newgrf_spritegroup.h:344
IndustryProductionSpriteGroup
Definition: newgrf_spritegroup.h:276
NewGRFSpriteLayout
NewGRF supplied spritelayout.
Definition: newgrf_commons.h:113
DrawTileSprites
Ground palette sprite of a tile, together with its sprite layout.
Definition: sprite.h:58
ResolverObject::GetScope
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
Definition: newgrf_spritegroup.cpp:153
RandomizedSpriteGroup::groups
const SpriteGroup ** groups
Take the group with appropriate index:
Definition: newgrf_spritegroup.h:209
DSGA_OP_UDIV
@ DSGA_OP_UDIV
(unsigned) a / b
Definition: newgrf_spritegroup.h:132
industry_type.h
DSGA_OP_SHR
@ DSGA_OP_SHR
(unsigned) a >> b
Definition: newgrf_spritegroup.h:145
DeterministicSpriteGroup::Resolve
const SpriteGroup * Resolve(ResolverObject &object) const
Base sprite group resolver.
Definition: newgrf_spritegroup.cpp:206
IndustryProductionSpriteGroup::add_output
uint16 add_output[INDUSTRY_NUM_OUTPUTS]
Add this much output cargo when successful (unsigned, is indirect in cb version 1+)
Definition: newgrf_spritegroup.h:284
DeterministicSpriteGroupAdjust
Definition: newgrf_spritegroup.h:150
DSGA_OP_MUL
@ DSGA_OP_MUL
a * b
Definition: newgrf_spritegroup.h:134
GrfSpecFeature
GrfSpecFeature
Definition: newgrf.h:66
SpriteGroup::Resolve
virtual const SpriteGroup * Resolve(ResolverObject &object) const
Base sprite group resolver.
Definition: newgrf_spritegroup.h:61
CALLBACK_FAILED
static const uint CALLBACK_FAILED
Different values for Callback result evaluations.
Definition: newgrf_callbacks.h:404
Pool
Base class for all pools.
Definition: pool_type.hpp:81
engine_type.h
DSGA_OP_UMOD
@ DSGA_OP_UMOD
(unsigned) a & b
Definition: newgrf_spritegroup.h:133
ResolverObject::ResetState
void ResetState()
Resets the dynamic state of the resolver object.
Definition: newgrf_spritegroup.h:395
RealSpriteGroup
Definition: newgrf_spritegroup.h:79
ResolverObject::Resolve
const SpriteGroup * Resolve()
Resolve SpriteGroup.
Definition: newgrf_spritegroup.h:350
DSGA_OP_SHL
@ DSGA_OP_SHL
a << b
Definition: newgrf_spritegroup.h:144
DSGA_OP_UMAX
@ DSGA_OP_UMAX
(unsigned) max(a, b)
Definition: newgrf_spritegroup.h:129
ResolverObject::callback
CallbackID callback
Callback being resolved.
Definition: newgrf_spritegroup.h:333
IndustryProductionSpriteGroup::version
uint8 version
Production callback version used, or 0xFF if marked invalid.
Definition: newgrf_spritegroup.h:279
VSG_SCOPE_RELATIVE
@ VSG_SCOPE_RELATIVE
Relative position (vehicles only)
Definition: newgrf_spritegroup.h:105
ScopeResolver::GetVariable
virtual uint32 GetVariable(byte variable, uint32 parameter, bool *available) const
Get a variable value.
Definition: newgrf_spritegroup.cpp:123
DSGA_OP_SAR
@ DSGA_OP_SAR
(signed) a >> b
Definition: newgrf_spritegroup.h:146
DSGA_OP_SMIN
@ DSGA_OP_SMIN
(signed) min(a, b)
Definition: newgrf_spritegroup.h:126
CallbackResultSpriteGroup::CallbackResultSpriteGroup
CallbackResultSpriteGroup(uint16 value, bool grf_version8)
Creates a spritegroup representing a callback result.
Definition: newgrf_spritegroup.h:224
RandomizedSpriteGroup::lowest_randbit
byte lowest_randbit
Look for this in the per-object randomized bitmask:
Definition: newgrf_spritegroup.h:206
RealSpriteGroup::num_loading
byte num_loading
Number of loading groups.
Definition: newgrf_spritegroup.h:91
CargoID
byte CargoID
Cargo slots to indicate a cargo type within a game.
Definition: cargo_type.h:20
TemporaryStorageArray
Class for temporary storage of data.
Definition: newgrf_storage.h:150
IndustryProductionSpriteGroup::cargo_output
CargoID cargo_output[INDUSTRY_NUM_OUTPUTS]
Which output cargoes to add to (only cb version 2)
Definition: newgrf_spritegroup.h:285
DSGA_OP_UCMP
@ DSGA_OP_UCMP
(unsigned) comparison (a < b -> 0, a == b = 1, a > b = 2)
Definition: newgrf_spritegroup.h:143
ResultSpriteGroup::ResultSpriteGroup
ResultSpriteGroup(SpriteID sprite, byte num_sprites)
Creates a spritegroup representing a sprite number result.
Definition: newgrf_spritegroup.h:251
DSGA_OP_SMOD
@ DSGA_OP_SMOD
(signed) a % b
Definition: newgrf_spritegroup.h:131
ResolverObject::ResolveCallback
uint16 ResolveCallback()
Resolve callback.
Definition: newgrf_spritegroup.h:359
RandomizedSpriteGroup
Definition: newgrf_spritegroup.h:196
town_type.h
ScopeResolver::ro
ResolverObject & ro
Surrounding resolver object.
Definition: newgrf_spritegroup.h:297
IndustryProductionSpriteGroup::cargo_input
CargoID cargo_input[INDUSTRY_NUM_INPUTS]
Which input cargoes to take from (only cb version 2)
Definition: newgrf_spritegroup.h:282
ResolverObject::last_value
uint32 last_value
Result of most recent DeterministicSpriteGroup (including procedure calls)
Definition: newgrf_spritegroup.h:337
ResolverObject::ResolveReal
virtual const SpriteGroup * ResolveReal(const RealSpriteGroup *group) const
Get the real sprites of the grf.
Definition: newgrf_spritegroup.cpp:142
ResultSpriteGroup
Definition: newgrf_spritegroup.h:244
DSGA_OP_RST
@ DSGA_OP_RST
return b
Definition: newgrf_spritegroup.h:139
newgrf_storage.h
Pool::PoolItem
Base class for all PoolItems.
Definition: pool_type.hpp:226
SpriteGroup
Definition: newgrf_spritegroup.h:57
DSGA_OP_SDIV
@ DSGA_OP_SDIV
(signed) a / b
Definition: newgrf_spritegroup.h:130
GRFFile
Dynamic data of a loaded NewGRF.
Definition: newgrf.h:105
TileLayoutSpriteGroup
Action 2 sprite layout for houses, industry tiles, objects and airport tiles.
Definition: newgrf_spritegroup.h:267