author | tron |
Fri, 04 Feb 2005 16:50:18 +0000 | |
changeset 1286 | 10b9fe28effc |
parent 915 | d845fe7cf6f2 |
child 1477 | 9389baf2bf3c |
permissions | -rw-r--r-- |
406
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
1 |
#ifndef SPRITE_H |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
2 |
#define SPRITE_H |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
3 |
|
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
4 |
|
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
5 |
/* The following describes bunch of sprites to be drawn together in a single 3D |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
6 |
* bounding box. Used especially for various multi-sprite buildings (like |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
7 |
* depots or stations): */ |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
8 |
|
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
9 |
typedef struct DrawTileSeqStruct { |
408
48da21eb9ff2
(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
|
10 |
int8 delta_x; // 0x80 is sequence terminator |
406
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
11 |
int8 delta_y; |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
12 |
int8 delta_z; |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
13 |
byte width,height; |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
14 |
byte unk; // 'depth', just z-size; TODO: rename |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
15 |
uint32 image; |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
16 |
} DrawTileSeqStruct; |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
17 |
|
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
18 |
typedef struct DrawTileSprites { |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
19 |
SpriteID ground_sprite; |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
20 |
DrawTileSeqStruct const *seq; |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
21 |
} DrawTileSprites; |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
22 |
|
408
48da21eb9ff2
(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
|
23 |
// Iterate through all DrawTileSeqStructs in DrawTileSprites. |
406
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
24 |
#define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++) |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
25 |
|
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
26 |
|
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
27 |
/* This is for custom sprites: */ |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
28 |
|
408
48da21eb9ff2
(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
|
29 |
|
48da21eb9ff2
(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
|
30 |
struct SpriteGroup; |
48da21eb9ff2
(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 |
|
48da21eb9ff2
(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
|
32 |
struct RealSpriteGroup { |
406
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
33 |
// XXX: Would anyone ever need more than 16 spritesets? Maybe we should |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
34 |
// use even less, now we take whole 8kb for custom sprites table, oh my! |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
35 |
byte sprites_per_set; // means number of directions - 4 or 8 |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
36 |
|
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
37 |
// Loaded = in motion, loading = not moving |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
38 |
// Each group contains several spritesets, for various loading stages |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
39 |
|
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
40 |
// XXX: For stations the meaning is different - loaded is for stations |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
41 |
// with small amount of cargo whilst loading is for stations with a lot |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
42 |
// of da stuff. |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
43 |
|
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
44 |
byte loaded_count; |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
45 |
uint16 loaded[16]; // sprite ids |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
46 |
byte loading_count; |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
47 |
uint16 loading[16]; // sprite ids |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
48 |
}; |
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
49 |
|
408
48da21eb9ff2
(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
|
50 |
/* Shared by deterministic and random groups. */ |
48da21eb9ff2
(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
|
51 |
enum VarSpriteGroupScope { |
48da21eb9ff2
(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 |
VSG_SCOPE_SELF, |
48da21eb9ff2
(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
|
53 |
// Engine of consists for vehicles, city for stations. |
48da21eb9ff2
(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_PARENT, |
48da21eb9ff2
(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 |
}; |
48da21eb9ff2
(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 |
|
48da21eb9ff2
(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
|
57 |
struct DeterministicSpriteGroupRanges; |
48da21eb9ff2
(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 |
|
48da21eb9ff2
(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
|
59 |
struct DeterministicSpriteGroup { |
48da21eb9ff2
(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 |
// Take this variable: |
48da21eb9ff2
(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
|
61 |
enum VarSpriteGroupScope var_scope; |
48da21eb9ff2
(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
|
62 |
byte variable; |
48da21eb9ff2
(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
|
63 |
|
48da21eb9ff2
(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
|
64 |
// Do this with it: |
48da21eb9ff2
(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
|
65 |
byte shift_num; |
48da21eb9ff2
(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
|
66 |
byte and_mask; |
48da21eb9ff2
(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
|
67 |
|
48da21eb9ff2
(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
|
68 |
// Then do this with it: |
48da21eb9ff2
(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
|
69 |
enum DeterministicSpriteGroupOperation { |
48da21eb9ff2
(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 |
DSG_OP_NONE, |
48da21eb9ff2
(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
|
71 |
DSG_OP_DIV, |
48da21eb9ff2
(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 |
DSG_OP_MOD, |
48da21eb9ff2
(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 |
} operation; |
48da21eb9ff2
(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 |
byte add_val; |
48da21eb9ff2
(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 divmod_val; |
915 | 76 |
|
408
48da21eb9ff2
(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 |
// And apply it to this: |
48da21eb9ff2
(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 |
byte num_ranges; |
413
36f14a6d63d7
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
79 |
struct DeterministicSpriteGroupRange *ranges; // Dynamically allocated |
408
48da21eb9ff2
(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 |
|
48da21eb9ff2
(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 |
// Dynamically allocated, this is the sole owner |
48da21eb9ff2
(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
|
82 |
struct SpriteGroup *default_group; |
48da21eb9ff2
(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 |
}; |
48da21eb9ff2
(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 |
|
445
beafc0fb8f12
(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
|
85 |
struct RandomizedSpriteGroup { |
beafc0fb8f12
(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
|
86 |
// Take this object: |
beafc0fb8f12
(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
|
87 |
enum VarSpriteGroupScope var_scope; |
beafc0fb8f12
(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
|
88 |
|
beafc0fb8f12
(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
|
89 |
// Check for these triggers: |
beafc0fb8f12
(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
|
90 |
enum RandomizedSpriteGroupCompareMode { |
beafc0fb8f12
(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
|
91 |
RSG_CMP_ANY, |
beafc0fb8f12
(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
|
92 |
RSG_CMP_ALL, |
beafc0fb8f12
(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
|
93 |
} cmp_mode; |
beafc0fb8f12
(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
|
94 |
byte triggers; |
beafc0fb8f12
(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
|
95 |
|
beafc0fb8f12
(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
|
96 |
// Look for this in the per-object randomized bitmask: |
beafc0fb8f12
(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 |
byte lowest_randbit; |
beafc0fb8f12
(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
|
98 |
byte num_groups; // must be power of 2 |
beafc0fb8f12
(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 |
|
beafc0fb8f12
(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 |
// Take the group with appropriate index: |
beafc0fb8f12
(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
|
101 |
struct SpriteGroup *groups; |
beafc0fb8f12
(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 |
}; |
beafc0fb8f12
(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 |
|
408
48da21eb9ff2
(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
|
104 |
struct SpriteGroup { |
48da21eb9ff2
(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
|
105 |
enum SpriteGroupType { |
48da21eb9ff2
(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
|
106 |
SGT_REAL, |
48da21eb9ff2
(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
|
107 |
SGT_DETERMINISTIC, |
445
beafc0fb8f12
(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 |
SGT_RANDOMIZED, |
408
48da21eb9ff2
(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
|
109 |
} type; |
48da21eb9ff2
(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
|
110 |
|
48da21eb9ff2
(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
|
111 |
union { |
48da21eb9ff2
(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
|
112 |
struct RealSpriteGroup real; |
48da21eb9ff2
(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
|
113 |
struct DeterministicSpriteGroup determ; |
445
beafc0fb8f12
(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
|
114 |
struct RandomizedSpriteGroup random; |
408
48da21eb9ff2
(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
|
115 |
} g; |
48da21eb9ff2
(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
|
116 |
}; |
48da21eb9ff2
(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
|
117 |
|
413
36f14a6d63d7
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
118 |
struct DeterministicSpriteGroupRange { |
408
48da21eb9ff2
(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
|
119 |
struct SpriteGroup group; |
413
36f14a6d63d7
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
120 |
byte low; |
36f14a6d63d7
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
121 |
byte high; |
408
48da21eb9ff2
(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
|
122 |
}; |
48da21eb9ff2
(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 |
|
413
36f14a6d63d7
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
124 |
/* This takes value (probably of the variable specified in the group) and |
36f14a6d63d7
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
125 |
* chooses corresponding SpriteGroup accordingly to the given |
36f14a6d63d7
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
126 |
* DeterministicSpriteGroup. */ |
36f14a6d63d7
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
127 |
struct SpriteGroup *EvalDeterministicSpriteGroup(struct DeterministicSpriteGroup *dsg, int value); |
36f14a6d63d7
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
128 |
/* Get value of a common deterministic SpriteGroup variable. */ |
36f14a6d63d7
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
408
diff
changeset
|
129 |
int GetDeterministicSpriteValue(byte var); |
408
48da21eb9ff2
(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
|
130 |
|
445
beafc0fb8f12
(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
|
131 |
/* This takes randomized bitmask (probably associated with |
beafc0fb8f12
(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
|
132 |
* vehicle/station/whatever) and chooses corresponding SpriteGroup |
beafc0fb8f12
(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
|
133 |
* accordingly to the given RandomizedSpriteGroup. */ |
beafc0fb8f12
(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
|
134 |
struct SpriteGroup *EvalRandomizedSpriteGroup(struct RandomizedSpriteGroup *rsg, byte random_bits); |
beafc0fb8f12
(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
|
135 |
/* Triggers given RandomizedSpriteGroup with given bitmask and returns and-mask |
beafc0fb8f12
(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
|
136 |
* of random bits to be reseeded, or zero if there were no triggers matched |
beafc0fb8f12
(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
|
137 |
* (then they are |ed to @waiting_triggers instead). */ |
beafc0fb8f12
(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
|
138 |
byte RandomizedSpriteGroupTriggeredBits(struct RandomizedSpriteGroup *rsg, byte triggers, byte *waiting_triggers); |
beafc0fb8f12
(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
|
139 |
|
406
34cba651d9f8
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
140 |
#endif |