GUI: fix OPLL/OPL op swapping

This commit is contained in:
tildearrow 2022-09-16 00:04:43 -05:00
parent 480243b652
commit aa38292ca4

View file

@ -1579,15 +1579,17 @@ void FurnaceGUI::drawMacros(std::vector<FurnaceGUIMacroDesc>& macros) {
if (dragItem!=NULL) { \ if (dragItem!=NULL) { \
if (dragItem->IsDataType("FUR_OP")) { \ if (dragItem->IsDataType("FUR_OP")) { \
if (opToMove!=i && opToMove>=0) { \ if (opToMove!=i && opToMove>=0) { \
int destOp=(opCount==4 && ins->type!=DIV_INS_OPL_DRUMS)?opOrder[i]:i; \
int sourceOp=(opCount==4 && ins->type!=DIV_INS_OPL_DRUMS)?opOrder[opToMove]:opToMove; \
if (ImGui::IsKeyDown(ImGuiKey_LeftShift) || ImGui::IsKeyDown(ImGuiKey_RightShift)) { \ if (ImGui::IsKeyDown(ImGuiKey_LeftShift) || ImGui::IsKeyDown(ImGuiKey_RightShift)) { \
e->lockEngine([this,ins,i]() { \ e->lockEngine([ins,destOp,sourceOp]() { \
ins->fm.op[orderedOps[i]]=ins->fm.op[orderedOps[opToMove]]; \ ins->fm.op[destOp]=ins->fm.op[sourceOp]; \
}); \ }); \
} else { \ } else { \
e->lockEngine([this,ins,i]() { \ e->lockEngine([ins,destOp,sourceOp]() { \
DivInstrumentFM::Operator origOp=ins->fm.op[orderedOps[opToMove]]; \ DivInstrumentFM::Operator origOp=ins->fm.op[sourceOp]; \
ins->fm.op[orderedOps[opToMove]]=ins->fm.op[orderedOps[i]]; \ ins->fm.op[sourceOp]=ins->fm.op[destOp]; \
ins->fm.op[orderedOps[i]]=origOp; \ ins->fm.op[destOp]=origOp; \
}); \ }); \
} \ } \
PARAMETER; \ PARAMETER; \