VarAction2: Remove operations which always do nothing when applied to 0

This commit is contained in:
Jonathan G Rennison
2022-06-06 22:20:16 +01:00
parent 26dd84f931
commit 9d04ebcc90
2 changed files with 25 additions and 0 deletions

View File

@@ -307,6 +307,27 @@ inline bool IsEvalAdjustOperationOnConstantEffectiveLoad(DeterministicSpriteGrou
}
}
inline bool IsEvalAdjustWithZeroLastValueAlwaysZero(DeterministicSpriteGroupAdjustOperation op)
{
switch (op) {
case DSGA_OP_SDIV:
case DSGA_OP_SMOD:
case DSGA_OP_UDIV:
case DSGA_OP_UMOD:
case DSGA_OP_UMIN:
case DSGA_OP_MUL:
case DSGA_OP_AND:
case DSGA_OP_ROR:
case DSGA_OP_SHL:
case DSGA_OP_SHR:
case DSGA_OP_SAR:
return true;
default:
return false;
}
}
struct DeterministicSpriteGroupAdjust {
DeterministicSpriteGroupAdjustOperation operation;
DeterministicSpriteGroupAdjustType type;