summaryrefslogtreecommitdiff
path: root/sprite.h
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-11-14 20:50:38 +0000
committerdarkvater <darkvater@openttd.org>2004-11-14 20:50:38 +0000
commitec434b208e6e67f98f7795f1a9d6154df888c6b2 (patch)
treeb22ee0fd86834db94fcab89aec21e066ec29e70e /sprite.h
parentc2193ce1a8f1e9acdada4675222d290fcf6640b7 (diff)
downloadopenttd-ec434b208e6e67f98f7795f1a9d6154df888c6b2.tar.xz
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
Diffstat (limited to 'sprite.h')
-rw-r--r--sprite.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/sprite.h b/sprite.h
index 13660a7d8..ded9ce6a8 100644
--- a/sprite.h
+++ b/sprite.h
@@ -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);