diff --git a/src/gui/cursor.cpp b/src/gui/cursor.cpp index 421b6d486..53652ec70 100644 --- a/src/gui/cursor.cpp +++ b/src/gui/cursor.cpp @@ -158,8 +158,8 @@ void FurnaceGUI::moveCursor(int x, int y, bool select) { if (settings.wrapVertical!=0 && !select) { cursor.y=0; if (settings.wrapVertical==2) { - if (!e->isPlaying() && e->getOrder()<(e->song.ordersLen-1)) { - e->setOrder(e->getOrder()+1); + if ((!e->isPlaying() || !followPattern) && curOrder<(e->song.ordersLen-1)) { + setOrder(curOrder+1); } else { cursor.y=e->song.patLen-1; } @@ -176,8 +176,8 @@ void FurnaceGUI::moveCursor(int x, int y, bool select) { if (settings.wrapVertical!=0 && !select) { cursor.y=e->song.patLen-1; if (settings.wrapVertical==2) { - if (!e->isPlaying() && e->getOrder()>0) { - e->setOrder(e->getOrder()-1); + if ((!e->isPlaying() || !followPattern) && curOrder>0) { + setOrder(curOrder-1); } else { cursor.y=0; } diff --git a/src/gui/doAction.cpp b/src/gui/doAction.cpp index c05455bf3..808d57a0c 100644 --- a/src/gui/doAction.cpp +++ b/src/gui/doAction.cpp @@ -428,13 +428,13 @@ void FurnaceGUI::doAction(int what) { e->unmuteAll(); break; case GUI_ACTION_PAT_NEXT_ORDER: - if (e->getOrder()song.ordersLen-1) { - e->setOrder(e->getOrder()+1); + if (curOrdersong.ordersLen-1) { + setOrder(curOrder+1); } break; case GUI_ACTION_PAT_PREV_ORDER: - if (e->getOrder()>0) { - e->setOrder(e->getOrder()-1); + if (curOrder>0) { + setOrder(curOrder-1); } break; case GUI_ACTION_PAT_COLLAPSE: @@ -1096,13 +1096,13 @@ void FurnaceGUI::doAction(int what) { } case GUI_ACTION_ORDERS_UP: - if (e->getOrder()>0) { - e->setOrder(e->getOrder()-1); + if (curOrder>0) { + setOrder(curOrder-1); } break; case GUI_ACTION_ORDERS_DOWN: - if (e->getOrder()song.ordersLen-1) { - e->setOrder(e->getOrder()+1); + if (curOrdersong.ordersLen-1) { + setOrder(curOrder+1); } break; case GUI_ACTION_ORDERS_LEFT: { @@ -1131,7 +1131,6 @@ void FurnaceGUI::doAction(int what) { } case GUI_ACTION_ORDERS_INCREASE: { if (orderCursor<0 || orderCursor>=e->getTotalChannelCount()) break; - int curOrder=e->getOrder(); if (e->song.orders.ord[orderCursor][curOrder]<0x7f) { e->song.orders.ord[orderCursor][curOrder]++; } @@ -1139,7 +1138,6 @@ void FurnaceGUI::doAction(int what) { } case GUI_ACTION_ORDERS_DECREASE: { if (orderCursor<0 || orderCursor>=e->getTotalChannelCount()) break; - int curOrder=e->getOrder(); if (e->song.orders.ord[orderCursor][curOrder]>0) { e->song.orders.ord[orderCursor][curOrder]--; } @@ -1199,7 +1197,7 @@ void FurnaceGUI::doAction(int what) { makeUndo(GUI_UNDO_CHANGE_ORDER); break; case GUI_ACTION_ORDERS_REPLAY: - e->setOrder(e->getOrder()); + setOrder(curOrder); break; } } \ No newline at end of file diff --git a/src/gui/editing.cpp b/src/gui/editing.cpp index 96f827f32..bd17e20ab 100644 --- a/src/gui/editing.cpp +++ b/src/gui/editing.cpp @@ -42,7 +42,6 @@ const char* noteNameNormal(short note, short octave) { } void FurnaceGUI::prepareUndo(ActionType action) { - int order=e->getOrder(); switch (action) { case GUI_UNDO_CHANGE_ORDER: oldOrders=e->song.orders; @@ -64,7 +63,7 @@ void FurnaceGUI::prepareUndo(ActionType action) { case GUI_UNDO_PATTERN_COLLAPSE: case GUI_UNDO_PATTERN_EXPAND: for (int i=0; igetTotalChannelCount(); i++) { - e->song.pat[i].getPattern(e->song.orders.ord[i][order],false)->copyOn(oldPat[i]); + e->song.pat[i].getPattern(e->song.orders.ord[i][curOrder],false)->copyOn(oldPat[i]); } break; } @@ -77,8 +76,7 @@ void FurnaceGUI::makeUndo(ActionType action) { s.cursor=cursor; s.selStart=selStart; s.selEnd=selEnd; - int order=e->getOrder(); - s.order=order; + s.order=curOrder; s.nibble=curNibble; switch (action) { case GUI_UNDO_CHANGE_ORDER: @@ -114,11 +112,11 @@ void FurnaceGUI::makeUndo(ActionType action) { case GUI_UNDO_PATTERN_COLLAPSE: case GUI_UNDO_PATTERN_EXPAND: for (int i=0; igetTotalChannelCount(); i++) { - DivPattern* p=e->song.pat[i].getPattern(e->song.orders.ord[i][order],false); + DivPattern* p=e->song.pat[i].getPattern(e->song.orders.ord[i][curOrder],false); for (int j=0; jsong.patLen; j++) { for (int k=0; k<32; k++) { if (p->data[j][k]!=oldPat[i]->data[j][k]) { - s.pat.push_back(UndoPatternData(i,e->song.orders.ord[i][order],j,k,oldPat[i]->data[j][k],p->data[j][k])); + s.pat.push_back(UndoPatternData(i,e->song.orders.ord[i][curOrder],j,k,oldPat[i]->data[j][k],p->data[j][k])); } } } @@ -199,10 +197,9 @@ void FurnaceGUI::doDelete() { int iCoarse=selStart.xCoarse; int iFine=selStart.xFine; - int ord=e->getOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarsegetOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarsesong.patLen; j++) { @@ -270,10 +266,9 @@ void FurnaceGUI::doInsert() { int iCoarse=selStart.xCoarse; int iFine=selStart.xFine; - int ord=e->getOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarsesong.patLen-1; j>=selStart.y; j--) { @@ -303,10 +298,9 @@ void FurnaceGUI::doTranspose(int amount) { int iCoarse=selStart.xCoarse; int iFine=selStart.xFine; - int ord=e->getOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse3 && !(iFine&1)) { iFine--; } - int ord=e->getOrder(); clipboard+='\n'; for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarsedata[j][0],pat->data[j][1]); @@ -439,7 +432,6 @@ void FurnaceGUI::doPaste(PasteMode mode) { int j=cursor.y; char note[4]; - int ord=e->getOrder(); for (size_t i=2; isong.patLen; i++) { size_t charPos=0; int iCoarse=cursor.xCoarse; @@ -448,7 +440,7 @@ void FurnaceGUI::doPaste(PasteMode mode) { String& line=data[i]; while (charPossong.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); if (line[charPos]=='|') { iCoarse++; if (iCoarsesong.chanShow[iCoarse]) { @@ -551,9 +543,9 @@ void FurnaceGUI::doPaste(PasteMode mode) { break; } j++; - if (mode==GUI_PASTE_MODE_OVERFLOW && j>=e->song.patLen && ordsong.ordersLen-1) { + if (mode==GUI_PASTE_MODE_OVERFLOW && j>=e->song.patLen && curOrdersong.ordersLen-1) { j=0; - ord++; + curOrder++; } if (mode==GUI_PASTE_MODE_FLOOD && i==data.size()-1) { @@ -573,10 +565,9 @@ void FurnaceGUI::doChangeIns(int ins) { prepareUndo(GUI_UNDO_PATTERN_CHANGE_INS); int iCoarse=selStart.xCoarse; - int ord=e->getOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (int j=selStart.y; j<=selEnd.y; j++) { if (pat->data[j][2]!=-1 || !(pat->data[j][0]==0 && pat->data[j][1]==0)) { pat->data[j][2]=ins; @@ -594,10 +585,9 @@ void FurnaceGUI::doInterpolate() { std::vector> points; int iCoarse=selStart.xCoarse; int iFine=selStart.xFine; - int ord=e->getOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarsegetOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarsegetOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarsegetOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarsegetOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarsegetOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarsegetOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarsegetOrder(); for (; iCoarse<=selEnd.xCoarse; iCoarse++) { if (!e->song.chanShow[iCoarse]) continue; - DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true); + DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][curOrder],true); for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarsesong.pat[i.chan].getPattern(i.pat,true); p->data[i.row][i.col]=i.oldVal; } - if (!e->isPlaying()) { + if (!e->isPlaying() || !followPattern) { cursor=us.cursor; selStart=us.selStart; selEnd=us.selEnd; curNibble=us.nibble; updateScroll(cursor.y); - e->setOrder(us.order); + setOrder(us.order); } break; } @@ -1013,7 +996,7 @@ void FurnaceGUI::doRedo() { selEnd=us.selEnd; curNibble=us.nibble; updateScroll(cursor.y); - e->setOrder(us.order); + setOrder(us.order); } break; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index a63585e6b..54034c078 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -841,6 +841,7 @@ float FurnaceGUI::calcBPM(int s1, int s2, float hz) { void FurnaceGUI::play(int row) { e->walkSong(loopOrder,loopRow,loopEnd); memset(lastIns,-1,sizeof(int)*DIV_MAX_CHANS); + if (!followPattern) e->setOrder(curOrder); if (row>0) { e->playToRow(row); } else { @@ -851,6 +852,13 @@ void FurnaceGUI::play(int row) { activeNotes.clear(); } +void FurnaceGUI::setOrder(unsigned char order, bool forced) { + curOrder=order; + if (followPattern || forced) { + e->setOrder(order); + } +} + void FurnaceGUI::stop() { e->walkSong(loopOrder,loopRow,loopEnd); e->stop(); @@ -921,7 +929,7 @@ void FurnaceGUI::stopPreviewNote(SDL_Scancode scancode, bool autoNote) { } void FurnaceGUI::noteInput(int num, int key, int vol) { - DivPattern* pat=e->song.pat[cursor.xCoarse].getPattern(e->song.orders.ord[cursor.xCoarse][e->getOrder()],true); + DivPattern* pat=e->song.pat[cursor.xCoarse].getPattern(e->song.orders.ord[cursor.xCoarse][curOrder],true); prepareUndo(GUI_UNDO_PATTERN_EDIT); @@ -962,7 +970,7 @@ void FurnaceGUI::noteInput(int num, int key, int vol) { } void FurnaceGUI::valueInput(int num, bool direct, int target) { - DivPattern* pat=e->song.pat[cursor.xCoarse].getPattern(e->song.orders.ord[cursor.xCoarse][e->getOrder()],true); + DivPattern* pat=e->song.pat[cursor.xCoarse].getPattern(e->song.orders.ord[cursor.xCoarse][curOrder],true); prepareUndo(GUI_UNDO_PATTERN_EDIT); if (target==-1) target=cursor.xFine+1; if (direct) { @@ -1135,8 +1143,7 @@ void FurnaceGUI::keyDown(SDL_Event& ev) { try { int num=valueKeys.at(ev.key.keysym.sym); if (orderCursor>=0 && orderCursorgetTotalChannelCount()) { - int curOrder=e->getOrder(); - e->lockSave([this,curOrder,num]() { + e->lockSave([this,num]() { e->song.orders.ord[orderCursor][curOrder]=((e->song.orders.ord[orderCursor][curOrder]<<4)|num); }); if (orderEditMode==2 || orderEditMode==3) { @@ -1147,7 +1154,7 @@ void FurnaceGUI::keyDown(SDL_Event& ev) { if (orderCursor>=e->getTotalChannelCount()) orderCursor=0; } else if (orderEditMode==3) { if (curOrdersong.ordersLen-1) { - e->setOrder(curOrder+1); + setOrder(curOrder+1); } } } @@ -2559,7 +2566,7 @@ bool FurnaceGUI::loop() { bool hasInfo=false; String info; if (cursor.xCoarse>=0 && cursor.xCoarsegetTotalChannelCount()) { - DivPattern* p=e->song.pat[cursor.xCoarse].getPattern(e->song.orders.ord[cursor.xCoarse][e->getOrder()],false); + DivPattern* p=e->song.pat[cursor.xCoarse].getPattern(e->song.orders.ord[cursor.xCoarse][curOrder],false); if (cursor.xFine>=0) switch (cursor.xFine) { case 0: // note if (p->data[cursor.y][0]>0) { @@ -3475,6 +3482,7 @@ FurnaceGUI::FurnaceGUI(): curWave(0), curSample(0), curOctave(3), + curOrder(0), oldRow(0), oldOrder(0), oldOrder1(0), diff --git a/src/gui/gui.h b/src/gui/gui.h index 7583412d8..07f7b5261 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -892,7 +892,7 @@ class FurnaceGUI { char finalLayoutPath[4096]; - int curIns, curWave, curSample, curOctave, oldRow, oldOrder, oldOrder1, editStep, exportLoops, soloChan, soloTimeout, orderEditMode, orderCursor; + int curIns, curWave, curSample, curOctave, curOrder, oldRow, oldOrder, oldOrder1, editStep, exportLoops, soloChan, soloTimeout, orderEditMode, orderCursor; int loopOrder, loopRow, loopEnd, isClipping, extraChannelButtons, patNameTarget, newSongCategory; int wheelX, wheelY; @@ -1167,6 +1167,7 @@ class FurnaceGUI { void doRedoSample(); void play(int row=0); + void setOrder(unsigned char order, bool forced=false); void stop(); void previewNote(int refChan, int note, bool autoNote=false); diff --git a/src/gui/orders.cpp b/src/gui/orders.cpp index 945f551d7..2311a3980 100644 --- a/src/gui/orders.cpp +++ b/src/gui/orders.cpp @@ -47,10 +47,9 @@ void FurnaceGUI::drawOrders() { ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing,prevSpacing); ImGui::TableSetupScrollFreeze(1,1); float lineHeight=(ImGui::GetTextLineHeight()+4*dpiScale); - int curOrder=e->getOrder(); if (e->isPlaying()) { if (followOrders) { - ImGui::SetScrollY((curOrder+1)*lineHeight-(ImGui::GetContentRegionAvail().y/2)); + ImGui::SetScrollY((e->getOrder()+1)*lineHeight-(ImGui::GetContentRegionAvail().y/2)); } } ImGui::TableNextRow(0,lineHeight); @@ -75,7 +74,7 @@ void FurnaceGUI::drawOrders() { snprintf(selID,4096,"%d##O_S%.2x",i,i); } if (ImGui::Selectable(selID)) { - e->setOrder(i); + setOrder(i); curNibble=false; orderCursor=-1; @@ -115,7 +114,7 @@ void FurnaceGUI::drawOrders() { curNibble=false; } } else { - e->setOrder(i); + setOrder(i); e->walkSong(loopOrder,loopRow,loopEnd); if (orderEditMode!=0) { orderCursor=j; @@ -151,7 +150,7 @@ void FurnaceGUI::drawOrders() { curNibble=false; } } else { - e->setOrder(i); + setOrder(i); e->walkSong(loopOrder,loopRow,loopEnd); if (orderEditMode!=0) { orderCursor=j; diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index d4fb939cd..b2d01743f 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -120,7 +120,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int if (settings.overflowHighlight) { if (edit && cursor.y==i) { ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,ImGui::GetColorU32(uiColors[GUI_COLOR_EDITING])); - } else if (isPlaying && oldRow==i) { + } else if (isPlaying && oldRow==i && ord==e->getOrder()) { ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PLAY_HEAD])); } else if (e->song.hilightB>0 && !(i%e->song.hilightB)) { ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_HI_2])); @@ -131,7 +131,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int isPushing=true; if (edit && cursor.y==i) { ImGui::PushStyleColor(ImGuiCol_Header,ImGui::GetColorU32(uiColors[GUI_COLOR_EDITING])); - } else if (isPlaying && oldRow==i) { + } else if (isPlaying && oldRow==i && ord==e->getOrder()) { ImGui::PushStyleColor(ImGuiCol_Header,ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PLAY_HEAD])); } else if (e->song.hilightB>0 && !(i%e->song.hilightB)) { ImGui::PushStyleColor(ImGuiCol_Header,ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_HI_2])); @@ -409,9 +409,11 @@ void FurnaceGUI::drawPattern() { patWindowSize=ImGui::GetWindowSize(); //char id[32]; ImGui::PushFont(patFont); - // TODO: separate GUI curOrder from engine curOrder - int ord=e->isPlaying()?oldOrder:e->getOrder(); - oldOrder=e->getOrder(); + int ord=oldOrder; + if (followPattern) { + curOrder=e->getOrder(); + } + oldOrder=curOrder; int chans=e->getTotalChannelCount(); int displayChans=0; const DivPattern* patCache[DIV_MAX_CHANS]; @@ -661,8 +663,8 @@ void FurnaceGUI::drawPattern() { if (wheelY>0) { if (ImGui::GetScrollY()<=0) { if (haveHitBounds) { - if (e->getOrder()>0) { - e->setOrder(e->getOrder()-1); + if (curOrder>0) { + setOrder(curOrder-1); ImGui::SetScrollY(ImGui::GetScrollMaxY()); updateScroll(e->song.patLen); } @@ -676,8 +678,8 @@ void FurnaceGUI::drawPattern() { } else { if (ImGui::GetScrollY()>=ImGui::GetScrollMaxY()) { if (haveHitBounds) { - if (e->getOrder()<(e->song.ordersLen-1)) { - e->setOrder(e->getOrder()+1); + if (curOrder<(e->song.ordersLen-1)) { + setOrder(curOrder+1); ImGui::SetScrollY(0); updateScroll(0); } diff --git a/src/gui/songInfo.cpp b/src/gui/songInfo.cpp index a2f788c35..e225b9557 100644 --- a/src/gui/songInfo.cpp +++ b/src/gui/songInfo.cpp @@ -124,8 +124,8 @@ void FurnaceGUI::drawSongInfo() { if (ordLen<1) ordLen=1; if (ordLen>256) ordLen=256; e->song.ordersLen=ordLen; - if (e->getOrder()>=ordLen) { - e->setOrder(ordLen-1); + if (curOrder>=ordLen) { + setOrder(ordLen-1); } }