VarAction2: Add helper functions for constant comparison adjust types

This commit is contained in:
Jonathan G Rennison
2022-06-08 19:40:36 +01:00
parent 249a20e47a
commit caebff85f5
2 changed files with 34 additions and 16 deletions

View File

@@ -389,6 +389,24 @@ inline bool IsEvalAdjustWithZeroLastValueAlwaysZero(DeterministicSpriteGroupAdju
}
}
inline bool IsConstantComparisonAdjustType(DeterministicSpriteGroupAdjustType adjust_type)
{
switch (adjust_type) {
case DSGA_TYPE_EQ:
case DSGA_TYPE_NEQ:
return true;
default:
return false;
}
}
inline DeterministicSpriteGroupAdjustType InvertConstantComparisonAdjustType(DeterministicSpriteGroupAdjustType adjust_type)
{
assert(IsConstantComparisonAdjustType(adjust_type));
return (adjust_type == DSGA_TYPE_EQ) ? DSGA_TYPE_NEQ : DSGA_TYPE_EQ;
}
struct DeterministicSpriteGroupAdjust {
DeterministicSpriteGroupAdjustOperation operation;
DeterministicSpriteGroupAdjustType type;