summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2005-09-22 20:58:14 +0000
committerpeter1138 <peter1138@openttd.org>2005-09-22 20:58:14 +0000
commiteeeeecb03011d7d7d88fba79a74608f73b961386 (patch)
treefc9564c2cee3147802ad3541aa3e08df242f3e30
parente380abec9708ea3a655d3d78df66dba463f9026e (diff)
downloadopenttd-eeeeecb03011d7d7d88fba79a74608f73b961386.tar.xz
(svn r2971) - Newgrf: Support loading VarAction2 parameter for variables 0x60-0x7F. This parameter isn't used yet.
-rw-r--r--newgrf.c3
-rw-r--r--sprite.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/newgrf.c b/newgrf.c
index 717dd9577..60ade0192 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -1268,6 +1268,9 @@ static void NewSpriteGroup(byte *buf, int len)
dg->var_scope = numloaded == 0x82 ? VSG_SCOPE_PARENT : VSG_SCOPE_SELF;
dg->variable = grf_load_byte(&buf);
+ /* Variables 0x60 - 0x7F include an extra parameter */
+ if (IS_BYTE_INSIDE(dg->variable, 0x60, 0x80))
+ dg->parameter = grf_load_byte(&buf);
dg->shift_num = grf_load_byte(&buf);
dg->and_mask = grf_load_byte(&buf);
diff --git a/sprite.h b/sprite.h
index 68c7848d1..67dce1612 100644
--- a/sprite.h
+++ b/sprite.h
@@ -70,6 +70,7 @@ typedef struct DeterministicSpriteGroup {
// Take this variable:
VarSpriteGroupScope var_scope;
byte variable;
+ byte parameter; ///< Used for variables between 0x60 and 0x7F inclusive.
// Do this with it:
byte shift_num;