From aa38292ca4e91aeedcefdc32701389c99deac521 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 16 Sep 2022 00:04:43 -0500 Subject: [PATCH] GUI: fix OPLL/OPL op swapping --- src/gui/insEdit.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index a4b99d141..df92dd523 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -1579,15 +1579,17 @@ void FurnaceGUI::drawMacros(std::vector& macros) { if (dragItem!=NULL) { \ if (dragItem->IsDataType("FUR_OP")) { \ 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)) { \ - e->lockEngine([this,ins,i]() { \ - ins->fm.op[orderedOps[i]]=ins->fm.op[orderedOps[opToMove]]; \ + e->lockEngine([ins,destOp,sourceOp]() { \ + ins->fm.op[destOp]=ins->fm.op[sourceOp]; \ }); \ } else { \ - e->lockEngine([this,ins,i]() { \ - DivInstrumentFM::Operator origOp=ins->fm.op[orderedOps[opToMove]]; \ - ins->fm.op[orderedOps[opToMove]]=ins->fm.op[orderedOps[i]]; \ - ins->fm.op[orderedOps[i]]=origOp; \ + e->lockEngine([ins,destOp,sourceOp]() { \ + DivInstrumentFM::Operator origOp=ins->fm.op[sourceOp]; \ + ins->fm.op[sourceOp]=ins->fm.op[destOp]; \ + ins->fm.op[destOp]=origOp; \ }); \ } \ PARAMETER; \