diff options
author | peter1138 <peter1138@openttd.org> | 2006-04-26 20:44:28 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-04-26 20:44:28 +0000 |
commit | 2f01c7d990d70b348afc6cad3107d3ddbc89a37e (patch) | |
tree | 71fddf3085e3ecae2d9fa11320b11d740ab8ab0d /sprite.c | |
parent | b81e6dd6a2ab42524f66d456266ae2f6171ba08b (diff) | |
download | openttd-2f01c7d990d70b348afc6cad3107d3ddbc89a37e.tar.xz |
(svn r4583) - NewGRF: Revamp sprite group loading to support advanced varadjusts and variable size. These are not yet processed, however.
Diffstat (limited to 'sprite.c')
-rw-r--r-- | sprite.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -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; } |