diff --git a/src/newgrf.cpp b/src/newgrf.cpp index e13e4b94a1..dddd5fdf06 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -6704,7 +6704,7 @@ static void OptimiseVarAction2Adjust(VarAction2OptimiseState &state, const GrfSp } if (adjust.operation == DSGA_OP_MUL && adjust.variable != 0x7E) { state.inference |= VA2AIF_MUL_BOOL; - adjust.adjust_flags |= DSGAF_BOOL_MUL_HINT; + adjust.adjust_flags |= DSGAF_JUMP_INS_HINT; } } } else { @@ -7004,7 +7004,9 @@ static void OptimiseVarAction2Adjust(VarAction2OptimiseState &state, const GrfSp } if ((prev_inference & VA2AIF_ONE_OR_ZERO) || (non_const_var_inference & VA2AIF_ONE_OR_ZERO)) { state.inference |= VA2AIF_MUL_BOOL; - adjust.adjust_flags |= DSGAF_BOOL_MUL_HINT; + } + if (non_const_var_inference & VA2AIF_ONE_OR_ZERO) { + adjust.adjust_flags |= DSGAF_JUMP_INS_HINT; } break; } @@ -7476,7 +7478,7 @@ static void OptimiseVarAction2DeterministicSpriteGroupAdjustOrdering(Determinist }); adjust.operation = DSGA_OP_RST; - adjust.adjust_flags &= ~(DSGAF_SKIP_ON_ZERO | DSGAF_BOOL_MUL_HINT); + adjust.adjust_flags &= ~(DSGAF_SKIP_ON_ZERO | DSGAF_JUMP_INS_HINT); } } } @@ -7585,7 +7587,7 @@ static void OptimiseVarAction2DeterministicSpriteGroupInsertJumps(DeterministicS for (int i = (int)group->adjusts.size() - 1; i >= 1; i--) { DeterministicSpriteGroupAdjust &adjust = group->adjusts[i]; - if (adjust.adjust_flags & DSGAF_BOOL_MUL_HINT) { + if (adjust.adjust_flags & DSGAF_JUMP_INS_HINT) { std::bitset<256> ok_stores; int j = i - 1; while (j >= 0) { @@ -7612,7 +7614,7 @@ static void OptimiseVarAction2DeterministicSpriteGroupInsertJumps(DeterministicS if (j < i - 1) { DeterministicSpriteGroupAdjust current = adjust; current.operation = DSGA_OP_JZ; - current.adjust_flags &= ~(DSGAF_BOOL_MUL_HINT | DSGAF_SKIP_ON_ZERO); + current.adjust_flags &= ~(DSGAF_JUMP_INS_HINT | DSGAF_SKIP_ON_ZERO); group->adjusts[i - 1].adjust_flags |= DSGAF_END_BLOCK; group->adjusts.erase(group->adjusts.begin() + i); if (j >= 0 && current.variable == 0x7D && (current.adjust_flags & DSGAF_LAST_VAR_READ)) { diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp index 957125ec47..345c02bfe4 100644 --- a/src/newgrf_spritegroup.cpp +++ b/src/newgrf_spritegroup.cpp @@ -761,8 +761,8 @@ static char *DumpSpriteGroupAdjust(char *p, const char *last, const Deterministi if (adjust.adjust_flags & DSGAF_LAST_VAR_READ && HasBit(_misc_debug_flags, MDF_NEWGRF_SG_DUMP_MORE_DETAIL)) { p += seprintf(p, last, ", last var read"); } - if (adjust.adjust_flags & DSGAF_BOOL_MUL_HINT && HasBit(_misc_debug_flags, MDF_NEWGRF_SG_DUMP_MORE_DETAIL)) { - p += seprintf(p, last, ", bool mul hint"); + if (adjust.adjust_flags & DSGAF_JUMP_INS_HINT && HasBit(_misc_debug_flags, MDF_NEWGRF_SG_DUMP_MORE_DETAIL)) { + p += seprintf(p, last, ", jump ins hint"); } if (adjust.adjust_flags & DSGAF_END_BLOCK) { p += seprintf(p, last, ", end block"); diff --git a/src/newgrf_spritegroup.h b/src/newgrf_spritegroup.h index 2a683efeb0..ef70da17af 100644 --- a/src/newgrf_spritegroup.h +++ b/src/newgrf_spritegroup.h @@ -219,7 +219,7 @@ enum DeterministicSpriteGroupAdjustFlags : uint8 { DSGAF_SKIP_ON_ZERO = 1 << 0, DSGAF_SKIP_ON_LSB_SET = 1 << 1, DSGAF_LAST_VAR_READ = 1 << 2, - DSGAF_BOOL_MUL_HINT = 1 << 3, + DSGAF_JUMP_INS_HINT = 1 << 3, DSGAF_END_BLOCK = 1 << 4, }; DECLARE_ENUM_AS_BIT_SET(DeterministicSpriteGroupAdjustFlags);