GUI: prevent lag when drawing on wave editor

This commit is contained in:
tildearrow 2023-07-15 02:50:49 -05:00
parent d096d5eb3c
commit 99e55136f3
2 changed files with 8 additions and 2 deletions

View file

@ -2419,7 +2419,7 @@ void FurnaceGUI::processDrags(int dragX, int dragY) {
if (y>waveDragMax) y=waveDragMax; if (y>waveDragMax) y=waveDragMax;
if (y<waveDragMin) y=waveDragMin; if (y<waveDragMin) y=waveDragMin;
waveDragTarget[x]=y; waveDragTarget[x]=y;
e->notifyWaveChange(curWave); notifyWaveChange=true;
MARK_MODIFIED; MARK_MODIFIED;
} }
} }
@ -3746,6 +3746,11 @@ bool FurnaceGUI::loop() {
midiLock.unlock(); midiLock.unlock();
} }
if (notifyWaveChange) {
notifyWaveChange=false;
e->notifyWaveChange(curWave);
}
eventTimeEnd=SDL_GetPerformanceCounter(); eventTimeEnd=SDL_GetPerformanceCounter();
if (SDL_GetWindowFlags(sdlWin)&SDL_WINDOW_MINIMIZED) { if (SDL_GetWindowFlags(sdlWin)&SDL_WINDOW_MINIMIZED) {
@ -6718,6 +6723,7 @@ FurnaceGUI::FurnaceGUI():
preserveChanPos(false), preserveChanPos(false),
wantScrollList(false), wantScrollList(false),
noteInputPoly(true), noteInputPoly(true),
notifyWaveChange(false),
displayPendingIns(false), displayPendingIns(false),
pendingInsSingle(false), pendingInsSingle(false),
displayPendingRawSample(false), displayPendingRawSample(false),

View file

@ -1310,7 +1310,7 @@ class FurnaceGUI {
bool vgmExportDirectStream, displayInsTypeList; bool vgmExportDirectStream, displayInsTypeList;
bool portrait, injectBackUp, mobileMenuOpen, warnColorPushed; bool portrait, injectBackUp, mobileMenuOpen, warnColorPushed;
bool wantCaptureKeyboard, oldWantCaptureKeyboard, displayMacroMenu; bool wantCaptureKeyboard, oldWantCaptureKeyboard, displayMacroMenu;
bool displayNew, fullScreen, preserveChanPos, wantScrollList, noteInputPoly; bool displayNew, fullScreen, preserveChanPos, wantScrollList, noteInputPoly, notifyWaveChange;
bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString; bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString;
bool mobileEdit; bool mobileEdit;
bool killGraphics; bool killGraphics;