(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).

This commit is contained in:
darkvater
2004-11-14 20:50:38 +00:00
parent c2193ce1a8
commit ec434b208e
8 changed files with 166 additions and 13 deletions

View File

@@ -76,7 +76,7 @@ struct DeterministicSpriteGroup {
// And apply it to this:
byte num_ranges;
struct DeterministicSpriteGroupRanges *ranges; // Dynamically allocated
struct DeterministicSpriteGroupRange *ranges; // Dynamically allocated
// Dynamically allocated, this is the sole owner
struct SpriteGroup *default_group;
@@ -95,16 +95,22 @@ struct SpriteGroup {
} g;
};
struct DeterministicSpriteGroupRanges {
struct DeterministicSpriteGroupRange {
struct SpriteGroup group;
byte range_low;
byte range_high;
byte low;
byte high;
};
/* This is a temporary helper for SpriteGroup users not supporting variational
* sprite groups yet - it just traverses those cowardly, always taking the
* default choice until it hits a real sprite group, returning it. */
static struct RealSpriteGroup *TriviallyGetRSG(struct SpriteGroup *sg);
/* This takes value (probably of the variable specified in the group) and
* chooses corresponding SpriteGroup accordingly to the given
* DeterministicSpriteGroup. */
struct SpriteGroup *EvalDeterministicSpriteGroup(struct DeterministicSpriteGroup *dsg, int value);
/* Get value of a common deterministic SpriteGroup variable. */
int GetDeterministicSpriteValue(byte var);