summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-05-08 17:47:35 +0000
committerpeter1138 <peter1138@openttd.org>2006-05-08 17:47:35 +0000
commit8fa9ff068fcfc030ffaf6ecc62d97ffbe66abe5a (patch)
tree88b48242270344674f382b913cc5d97b572df777
parent288ffe7f50198c6bf5ef0bd0b668aca28f543487 (diff)
downloadopenttd-8fa9ff068fcfc030ffaf6ecc62d97ffbe66abe5a.tar.xz
(svn r4784) - NewGRF: shuffle the mix of signed / unsigned types when dealing with var adjusts. Fixes issues with some station layouts.
-rw-r--r--newgrf_spritegroup.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/newgrf_spritegroup.c b/newgrf_spritegroup.c
index fd27d3aff..d6ae1a98f 100644
--- a/newgrf_spritegroup.c
+++ b/newgrf_spritegroup.c
@@ -99,7 +99,7 @@ static inline uint32 GetVariable(const ResolverObject *object, byte variable, by
/* Evaluate an adjustment for a variable of the given size. This is a bit of
* an unwieldy macro, but it saves triplicating the code. */
#define BUILD_EVAL_ADJUST(size, usize) \
-static inline size EvalAdjust_ ## size(const DeterministicSpriteGroupAdjust *adjust, size last_value, uint value) \
+static inline usize EvalAdjust_ ## size(const DeterministicSpriteGroupAdjust *adjust, usize last_value, int32 value) \
{ \
value >>= adjust->shift_num; \
value &= adjust->and_mask; \
@@ -108,12 +108,12 @@ static inline size EvalAdjust_ ## size(const DeterministicSpriteGroupAdjust *adj
\
switch (adjust->type) { \
case DSGA_TYPE_DIV: value /= (size)adjust->divmod_val; break; \
- case DSGA_TYPE_MOD: value %= (size)adjust->divmod_val; break; \
+ case DSGA_TYPE_MOD: value %= (usize)adjust->divmod_val; break; \
case DSGA_TYPE_NONE: break; \
} \
\
/* Get our value to the correct range */ \
- value = (size)value; \
+ value = (usize)value; \
\
switch (adjust->operation) { \
case DSGA_OP_ADD: return last_value + value; \