VarAction2: Fix detection of callback handlers which don't inspect var C
This commit is contained in:
@@ -2482,6 +2482,10 @@ void OptimiseVarAction2DeterministicSpriteGroup(VarAction2OptimiseState &state,
|
||||
group->dsg_flags |= DSGF_CB_HANDLER;
|
||||
state.have_cb_handler = true;
|
||||
}
|
||||
if ((dsg->dsg_flags & DSGF_CB_RESULT) && !state.ignore_cb_handler) {
|
||||
group->dsg_flags |= DSGF_CB_RESULT;
|
||||
state.have_cb_handler = true;
|
||||
}
|
||||
}
|
||||
if (sg != nullptr && sg->type == SGT_RANDOMIZED) {
|
||||
const RandomizedSpriteGroup *rsg = (const RandomizedSpriteGroup*)sg;
|
||||
@@ -2532,6 +2536,12 @@ void OptimiseVarAction2DeterministicSpriteGroup(VarAction2OptimiseState &state,
|
||||
bits.set(ipsg->again, true);
|
||||
}
|
||||
}
|
||||
if (sg != nullptr && sg->type == SGT_CALLBACK) {
|
||||
if (!state.ignore_cb_handler) {
|
||||
group->dsg_flags |= DSGF_CB_RESULT;
|
||||
state.have_cb_handler = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
HandleGroupState default_group_state;
|
||||
@@ -2573,6 +2583,8 @@ void OptimiseVarAction2DeterministicSpriteGroup(VarAction2OptimiseState &state,
|
||||
}
|
||||
state.GetVarTracking(group)->in |= in_bits;
|
||||
}
|
||||
} else {
|
||||
group->dsg_flags |= DSGF_CB_RESULT;
|
||||
}
|
||||
if (possible_callback_handler) group->dsg_flags |= DSGF_CB_HANDLER;
|
||||
|
||||
|
@@ -658,6 +658,7 @@ void SpriteGroupDumper::DumpSpriteGroup(const SpriteGroup *sg, const char *paddi
|
||||
if (dsg->dsg_flags & DSGF_REQUIRES_VAR1C) p += seprintf(p, lastof(this->buffer), ", REQ_1C");
|
||||
if (dsg->dsg_flags & DSGF_CHECK_EXPENSIVE_VARS) p += seprintf(p, lastof(this->buffer), ", CHECK_EXP_VAR");
|
||||
if (dsg->dsg_flags & DSGF_CHECK_INSERT_JUMP) p += seprintf(p, lastof(this->buffer), ", CHECK_INS_JMP");
|
||||
if (dsg->dsg_flags & DSGF_CB_RESULT) p += seprintf(p, lastof(this->buffer), ", CB_RESULT");
|
||||
if (dsg->dsg_flags & DSGF_CB_HANDLER) p += seprintf(p, lastof(this->buffer), ", CB_HANDLER");
|
||||
if (dsg->dsg_flags & DSGF_INLINE_CANDIDATE) p += seprintf(p, lastof(this->buffer), ", INLINE_CANDIDATE");
|
||||
}
|
||||
|
@@ -442,6 +442,7 @@ struct DeterministicSpriteGroupRange {
|
||||
enum DeterministicSpriteGroupFlags : uint8 {
|
||||
DSGF_NONE = 0,
|
||||
DSGF_NO_DSE = 1 << 0,
|
||||
DSGF_CB_RESULT = 1 << 1,
|
||||
DSGF_VAR_TRACKING_PENDING = 1 << 2,
|
||||
DSGF_REQUIRES_VAR1C = 1 << 3,
|
||||
DSGF_CHECK_EXPENSIVE_VARS = 1 << 4,
|
||||
|
Reference in New Issue
Block a user