mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r27983) -Codechange: Reduce complexity of VA2 add-div/mod adjustments
This commit is contained in:
parent
4fc178aebd
commit
7c406f0d9d
@ -194,11 +194,9 @@ static U EvalAdjustT(const DeterministicSpriteGroupAdjust *adjust, ScopeResolver
|
||||
value >>= adjust->shift_num;
|
||||
value &= adjust->and_mask;
|
||||
|
||||
if (adjust->type != DSGA_TYPE_NONE) value += (S)adjust->add_val;
|
||||
|
||||
switch (adjust->type) {
|
||||
case DSGA_TYPE_DIV: value = (S)value / (S)adjust->divmod_val; break;
|
||||
case DSGA_TYPE_MOD: value = (S)value % (S)adjust->divmod_val; break;
|
||||
case DSGA_TYPE_DIV: value = ((S)value + (S)adjust->add_val) / (S)adjust->divmod_val; break;
|
||||
case DSGA_TYPE_MOD: value = ((S)value + (S)adjust->add_val) % (S)adjust->divmod_val; break;
|
||||
case DSGA_TYPE_NONE: break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user