5 #ifndef NEWGRF_SPRITEGROUP_H |
5 #ifndef NEWGRF_SPRITEGROUP_H |
6 #define NEWGRF_SPRITEGROUP_H |
6 #define NEWGRF_SPRITEGROUP_H |
7 |
7 |
8 #include "town.h" |
8 #include "town.h" |
9 #include "industry.h" |
9 #include "industry.h" |
|
10 #include "newgrf_storage.h" |
10 |
11 |
11 /** |
12 /** |
12 * Gets the value of a so-called newgrf "register". |
13 * Gets the value of a so-called newgrf "register". |
13 * @param i index of the register |
14 * @param i index of the register |
14 * @pre i < 0x110 |
15 * @pre i < 0x110 |
15 * @return the value of the register |
16 * @return the value of the register |
16 */ |
17 */ |
17 static inline uint32 GetRegister(uint i) |
18 static inline uint32 GetRegister(uint i) |
18 { |
19 { |
19 assert(i < 0x110); |
20 extern TemporaryStorageArray<uint32, 0x110> _temp_store; |
20 extern uint32 _temp_store[0x110]; |
21 return _temp_store.Get(i); |
21 return _temp_store[i]; |
|
22 } |
22 } |
23 |
23 |
24 struct SpriteGroup; |
24 struct SpriteGroup; |
25 |
25 |
26 |
26 |
74 DSGA_OP_AND, ///< a & b |
74 DSGA_OP_AND, ///< a & b |
75 DSGA_OP_OR, ///< a | b |
75 DSGA_OP_OR, ///< a | b |
76 DSGA_OP_XOR, ///< a ^ b |
76 DSGA_OP_XOR, ///< a ^ b |
77 DSGA_OP_STO, ///< store a into temporary storage, indexed by b. return a |
77 DSGA_OP_STO, ///< store a into temporary storage, indexed by b. return a |
78 DSGA_OP_RST, ///< return b |
78 DSGA_OP_RST, ///< return b |
|
79 DSGA_OP_STOP, ///< store a into persistent storage, indexed by b, return a |
|
80 DSGA_OP_ROR, ///< rotate a b positions to the right |
|
81 DSGA_OP_SCMP, ///< (signed) comparision (a < b -> 0, a == b = 1, a > b = 2) |
|
82 DSGA_OP_UCMP, ///< (unsigned) comparision (a < b -> 0, a == b = 1, a > b = 2) |
79 }; |
83 }; |
80 |
84 |
81 |
85 |
82 struct DeterministicSpriteGroupAdjust { |
86 struct DeterministicSpriteGroupAdjust { |
83 DeterministicSpriteGroupAdjustOperation operation; |
87 DeterministicSpriteGroupAdjustOperation operation; |