author | miham |
Wed, 17 Aug 2005 12:30:07 +0000 | |
changeset 2349 | df02d0ffb588 |
parent 2242 | 27fa4807cd61 |
child 2436 | 177cb6a8339f |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
406
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
3 |
#ifndef SPRITE_H |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
4 |
#define SPRITE_H |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
5 |
|
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
6 |
|
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
7 |
/* The following describes bunch of sprites to be drawn together in a single 3D |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
8 |
* bounding box. Used especially for various multi-sprite buildings (like |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
9 |
* depots or stations): */ |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
10 |
|
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
11 |
typedef struct DrawTileSeqStruct { |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
12 |
int8 delta_x; // 0x80 is sequence terminator |
406
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
13 |
int8 delta_y; |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
14 |
int8 delta_z; |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
15 |
byte width,height; |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
16 |
byte unk; // 'depth', just z-size; TODO: rename |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
17 |
uint32 image; |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
18 |
} DrawTileSeqStruct; |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
19 |
|
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
20 |
typedef struct DrawTileSprites { |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
21 |
SpriteID ground_sprite; |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
22 |
DrawTileSeqStruct const *seq; |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
23 |
} DrawTileSprites; |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
24 |
|
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
25 |
// Iterate through all DrawTileSeqStructs in DrawTileSprites. |
406
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
26 |
#define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++) |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
27 |
|
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
28 |
|
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
29 |
/* This is for custom sprites: */ |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
30 |
|
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
31 |
|
1477 | 32 |
typedef struct SpriteGroup SpriteGroup; |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
33 |
|
1477 | 34 |
typedef struct RealSpriteGroup { |
406
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
35 |
// XXX: Would anyone ever need more than 16 spritesets? Maybe we should |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
36 |
// use even less, now we take whole 8kb for custom sprites table, oh my! |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
37 |
byte sprites_per_set; // means number of directions - 4 or 8 |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
38 |
|
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
39 |
// Loaded = in motion, loading = not moving |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
40 |
// Each group contains several spritesets, for various loading stages |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
41 |
|
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
42 |
// XXX: For stations the meaning is different - loaded is for stations |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
43 |
// with small amount of cargo whilst loading is for stations with a lot |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
44 |
// of da stuff. |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
45 |
|
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
46 |
byte loaded_count; |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
47 |
uint16 loaded[16]; // sprite ids |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
48 |
byte loading_count; |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
49 |
uint16 loading[16]; // sprite ids |
1477 | 50 |
} RealSpriteGroup; |
406
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
51 |
|
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
52 |
/* Shared by deterministic and random groups. */ |
1477 | 53 |
typedef enum VarSpriteGroupScope { |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
54 |
VSG_SCOPE_SELF, |
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
55 |
// Engine of consists for vehicles, city for stations. |
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
56 |
VSG_SCOPE_PARENT, |
1477 | 57 |
} VarSpriteGroupScope; |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
58 |
|
1477 | 59 |
typedef struct DeterministicSpriteGroupRanges DeterministicSpriteGroupRanges; |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
60 |
|
1477 | 61 |
typedef enum DeterministicSpriteGroupOperation { |
62 |
DSG_OP_NONE, |
|
63 |
DSG_OP_DIV, |
|
64 |
DSG_OP_MOD, |
|
65 |
} DeterministicSpriteGroupOperation; |
|
66 |
||
67 |
typedef struct DeterministicSpriteGroupRange DeterministicSpriteGroupRange; |
|
68 |
||
69 |
typedef struct DeterministicSpriteGroup { |
|
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
70 |
// Take this variable: |
1477 | 71 |
VarSpriteGroupScope var_scope; |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
72 |
byte variable; |
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
73 |
|
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
74 |
// Do this with it: |
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
75 |
byte shift_num; |
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
76 |
byte and_mask; |
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
77 |
|
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
78 |
// Then do this with it: |
1477 | 79 |
DeterministicSpriteGroupOperation operation; |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
80 |
byte add_val; |
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
81 |
byte divmod_val; |
915 | 82 |
|
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
83 |
// And apply it to this: |
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
84 |
byte num_ranges; |
1477 | 85 |
DeterministicSpriteGroupRange *ranges; // Dynamically allocated |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
86 |
|
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
87 |
// Dynamically allocated, this is the sole owner |
1477 | 88 |
SpriteGroup *default_group; |
89 |
} DeterministicSpriteGroup; |
|
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
90 |
|
1477 | 91 |
typedef enum RandomizedSpriteGroupCompareMode { |
92 |
RSG_CMP_ANY, |
|
93 |
RSG_CMP_ALL, |
|
94 |
} RandomizedSpriteGroupCompareMode; |
|
95 |
||
96 |
typedef struct RandomizedSpriteGroup { |
|
445
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
97 |
// Take this object: |
1477 | 98 |
VarSpriteGroupScope var_scope; |
445
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
99 |
|
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
100 |
// Check for these triggers: |
1477 | 101 |
RandomizedSpriteGroupCompareMode cmp_mode; |
445
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
102 |
byte triggers; |
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
103 |
|
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
104 |
// Look for this in the per-object randomized bitmask: |
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
105 |
byte lowest_randbit; |
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
106 |
byte num_groups; // must be power of 2 |
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
107 |
|
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
108 |
// Take the group with appropriate index: |
1477 | 109 |
SpriteGroup *groups; |
110 |
} RandomizedSpriteGroup; |
|
111 |
||
1883
3b02000cfbe0
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents:
1477
diff
changeset
|
112 |
typedef struct CallbackResultSpriteGroup { |
3b02000cfbe0
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents:
1477
diff
changeset
|
113 |
uint16 result; |
3b02000cfbe0
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents:
1477
diff
changeset
|
114 |
} CallbackResultSpriteGroup; |
3b02000cfbe0
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents:
1477
diff
changeset
|
115 |
|
1477 | 116 |
typedef enum SpriteGroupType { |
117 |
SGT_REAL, |
|
118 |
SGT_DETERMINISTIC, |
|
119 |
SGT_RANDOMIZED, |
|
1883
3b02000cfbe0
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents:
1477
diff
changeset
|
120 |
SGT_CALLBACK, |
1477 | 121 |
} SpriteGroupType; |
445
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
122 |
|
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
123 |
struct SpriteGroup { |
1477 | 124 |
SpriteGroupType type; |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
125 |
|
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
126 |
union { |
1477 | 127 |
RealSpriteGroup real; |
128 |
DeterministicSpriteGroup determ; |
|
129 |
RandomizedSpriteGroup random; |
|
1883
3b02000cfbe0
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents:
1477
diff
changeset
|
130 |
CallbackResultSpriteGroup callback; |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
131 |
} g; |
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
132 |
}; |
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
133 |
|
413
36afcda97345
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
134 |
struct DeterministicSpriteGroupRange { |
1477 | 135 |
SpriteGroup group; |
413
36afcda97345
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
136 |
byte low; |
36afcda97345
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
137 |
byte high; |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
138 |
}; |
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
139 |
|
413
36afcda97345
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
140 |
/* This takes value (probably of the variable specified in the group) and |
36afcda97345
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
141 |
* chooses corresponding SpriteGroup accordingly to the given |
36afcda97345
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
142 |
* DeterministicSpriteGroup. */ |
2242
27fa4807cd61
(svn r2762) Simplify a loop, remove an unused variable and add many consts
tron
parents:
2186
diff
changeset
|
143 |
SpriteGroup *EvalDeterministicSpriteGroup(const DeterministicSpriteGroup *dsg, int value); |
413
36afcda97345
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
144 |
/* Get value of a common deterministic SpriteGroup variable. */ |
36afcda97345
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
145 |
int GetDeterministicSpriteValue(byte var); |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
146 |
|
445
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
147 |
/* This takes randomized bitmask (probably associated with |
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
148 |
* vehicle/station/whatever) and chooses corresponding SpriteGroup |
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
149 |
* accordingly to the given RandomizedSpriteGroup. */ |
2242
27fa4807cd61
(svn r2762) Simplify a loop, remove an unused variable and add many consts
tron
parents:
2186
diff
changeset
|
150 |
SpriteGroup *EvalRandomizedSpriteGroup(const RandomizedSpriteGroup *rsg, byte random_bits); |
445
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
151 |
/* Triggers given RandomizedSpriteGroup with given bitmask and returns and-mask |
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
152 |
* of random bits to be reseeded, or zero if there were no triggers matched |
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
153 |
* (then they are |ed to @waiting_triggers instead). */ |
2242
27fa4807cd61
(svn r2762) Simplify a loop, remove an unused variable and add many consts
tron
parents:
2186
diff
changeset
|
154 |
byte RandomizedSpriteGroupTriggeredBits(const RandomizedSpriteGroup *rsg, byte triggers, byte *waiting_triggers); |
445
0e3fa3da3899
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
tron
parents:
426
diff
changeset
|
155 |
|
406
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
156 |
#endif |