From e08a227b535fe5ea2fe8d986c308519fcd8fbf86 Mon Sep 17 00:00:00 2001 From: frosch Date: Tue, 8 Nov 2011 17:22:19 +0000 Subject: (svn r23136) -Change: [NewGRF v8] Deprecate old-style callback results 0xFF??. --- src/newgrf_spritegroup.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/newgrf_spritegroup.h') diff --git a/src/newgrf_spritegroup.h b/src/newgrf_spritegroup.h index 46d7a1bda..4395a3923 100644 --- a/src/newgrf_spritegroup.h +++ b/src/newgrf_spritegroup.h @@ -240,14 +240,15 @@ struct CallbackResultSpriteGroup : SpriteGroup { /** * Creates a spritegroup representing a callback result * @param value The value that was used to represent this callback result + * @param grf_version8 True, if we are dealing with a new NewGRF which uses GRF version >= 8. */ - CallbackResultSpriteGroup(uint16 value) : + CallbackResultSpriteGroup(uint16 value, bool grf_version8) : SpriteGroup(SGT_CALLBACK), result(value) { - /* Old style callback results have the highest byte 0xFF so signify it is a callback result + /* Old style callback results (only valid for version < 8) have the highest byte 0xFF so signify it is a callback result. * New style ones only have the highest bit set (allows 15-bit results, instead of just 8) */ - if ((this->result >> 8) == 0xFF) { + if (!grf_version8 && (this->result >> 8) == 0xFF) { this->result &= ~0xFF00; } else { this->result &= ~0x8000; -- cgit v1.2.3-54-g00ecf