From 2f01c7d990d70b348afc6cad3107d3ddbc89a37e Mon Sep 17 00:00:00 2001 From: peter1138 Date: Wed, 26 Apr 2006 20:44:28 +0000 Subject: (svn r4583) - NewGRF: Revamp sprite group loading to support advanced varadjusts and variable size. These are not yet processed, however. --- sprite.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'sprite.c') diff --git a/sprite.c b/sprite.c index 83d60cd43..c22489830 100644 --- a/sprite.c +++ b/sprite.c @@ -11,27 +11,27 @@ SpriteGroup *EvalDeterministicSpriteGroup(const DeterministicSpriteGroup *dsg, i { int i; - value >>= dsg->shift_num; // This should bring us to the byte range. - value &= dsg->and_mask; + value >>= dsg->adjusts[0].shift_num; // This should bring us to the byte range. + value &= dsg->adjusts[0].and_mask; - if (dsg->operation != DSG_OP_NONE) - value += (signed char) dsg->add_val; + if (dsg->adjusts[0].operation != DSGA_TYPE_NONE) + value += (signed char) dsg->adjusts[0].add_val; - switch (dsg->operation) { - case DSG_OP_DIV: - value /= (signed char) dsg->divmod_val; + switch (dsg->adjusts[0].type) { + case DSGA_TYPE_DIV: + value /= (signed char) dsg->adjusts[0].divmod_val; break; - case DSG_OP_MOD: - value %= (signed char) dsg->divmod_val; + case DSGA_TYPE_MOD: + value %= (signed char) dsg->adjusts[0].divmod_val; break; - case DSG_OP_NONE: + case DSGA_TYPE_NONE: break; } for (i = 0; i < dsg->num_ranges; i++) { DeterministicSpriteGroupRange *range = &dsg->ranges[i]; - if (range->low <= value && value <= range->high) + if (range->low <= (uint32)value && (uint32)value <= range->high) return range->group; } -- cgit v1.2.3-54-g00ecf