Changeset - r22755:0cb1ea35844a
[Not reviewed]
master
0 1 0
frosch - 6 years ago 2018-03-11 13:18:13
frosch@openttd.org
(svn r27983) -Codechange: Reduce complexity of VA2 add-div/mod adjustments
1 file changed with 2 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/newgrf_spritegroup.cpp
Show inline comments
 
@@ -194,11 +194,9 @@ static U EvalAdjustT(const Deterministic
 
	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;
 
	}
 

	
0 comments (0 inline, 0 general)