diff options
author | maedhros <maedhros@openttd.org> | 2007-01-12 11:20:34 +0000 |
---|---|---|
committer | maedhros <maedhros@openttd.org> | 2007-01-12 11:20:34 +0000 |
commit | 4ae861880bda8a0882db1a6bd1e82cff003248a6 (patch) | |
tree | b908ffc45eacd441ee01360329e463991af50290 /src/newgrf.cpp | |
parent | 5afd50017de25527e0d3334e9515e82a0299fe31 (diff) | |
download | openttd-4ae861880bda8a0882db1a6bd1e82cff003248a6.tar.xz |
(svn r8075) -Feature: Add support for variable 7E - subroutines. (peter1138)
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 6d4f1a333..4d0982d93 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1648,7 +1648,12 @@ static void NewSpriteGroup(byte *buf, int len) /* The first var adjust doesn't have an operation specified, so we set it to add. */ adjust->operation = group->g.determ.num_adjusts == 1 ? DSGA_OP_ADD : (DeterministicSpriteGroupAdjustOperation)grf_load_byte(&buf); adjust->variable = grf_load_byte(&buf); - adjust->parameter = IS_BYTE_INSIDE(adjust->variable, 0x60, 0x80) ? grf_load_byte(&buf) : 0; + if (adjust->variable == 0x7E) { + /* Link subroutine group */ + adjust->subroutine = GetGroupFromGroupID(setid, type, grf_load_byte(&buf)); + } else { + adjust->parameter = IS_BYTE_INSIDE(adjust->variable, 0x60, 0x80) ? grf_load_byte(&buf) : 0; + } varadjust = grf_load_byte(&buf); adjust->shift_num = GB(varadjust, 0, 5); |