From c064cf089df85b494d798422830e7521d1c03dde Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 1 Apr 2025 14:11:45 -0500 Subject: [PATCH] prepare to fix pitch linearity issues --- extern/backward/backward.hpp | 14 +- src/engine/engine.cpp | 27 ---- src/engine/engine.h | 3 - src/engine/playback.cpp | 51 +------ src/gui/about.cpp | 3 - src/gui/cursor.cpp | 11 -- src/gui/doAction.cpp | 6 - src/gui/gui.cpp | 251 ----------------------------------- src/gui/gui.h | 4 - src/gui/insEdit.cpp | 24 ---- src/gui/osc.cpp | 90 ++++++------- src/gui/settings.cpp | 15 --- src/gui/sysConf.cpp | 4 +- 13 files changed, 49 insertions(+), 454 deletions(-) diff --git a/extern/backward/backward.hpp b/extern/backward/backward.hpp index d5dc5d73e..096e9d73d 100644 --- a/extern/backward/backward.hpp +++ b/extern/backward/backward.hpp @@ -24,8 +24,6 @@ #ifndef H_6B9572DA_A64B_49E6_B234_051480991C89 #define H_6B9572DA_A64B_49E6_B234_051480991C89 -extern int curEngineState; - #ifndef __cplusplus #error "It's not going to compile without a C++ compiler..." #endif @@ -4255,11 +4253,7 @@ public: } #ifdef _WIN32 - if (curEngineState==7 || curEngineState==11) { - MessageBox(NULL,"Furnace whoopsied and obliterated itself to pieces!\r\n\r\nreport the issue to tildearrow with the provided \"furnace_crash.txt\" in your home folder, or whatever that happened to you is inevitable sorry : < < < <\r\n\r\nor do -safemode in terminal if you got the bravery to do so\r\n\r\nif it also still crashes i'm afraid to tell you this is an other undercooked Furnace update","CRASHED IMMENSELY",MB_OK|MB_ICONERROR); - } else { - MessageBox(NULL,"Furnace has crashed! please report this to the issue tracker immediately:\r\nhttps://github.com/tildearrow/furnace/issues/new\r\n\r\na file called furnace_crash.txt will be created in your user directory.\r\nthis will be important for locating the origin of the crash.\r\n\r\nif Furnace keeps crashing and you believe it is caused by a configuration problem, you may start Furnace with the -safemode parameter.","Error",MB_OK|MB_ICONERROR); - } + MessageBox(NULL,"Error","Furnace has crashed! please report this to the issue tracker immediately:\r\nhttps://github.com/tildearrow/furnace/issues/new\r\n\r\na file called furnace_crash.txt will be created in your user directory.\r\nthis will be important for locating the origin of the crash.\r\n\r\nif Furnace keeps crashing and you believe it is caused by a configuration problem, you may start Furnace with the -safemode parameter.",MB_OK|MB_ICONERROR); std::string crashLocation; char* userProfile=getenv("USERPROFILE"); if (userProfile==NULL) { @@ -4498,11 +4492,7 @@ private: printer.print(st, std::cerr); #ifdef _WIN32 - if (curEngineState==7 || curEngineState==11) { - MessageBox(NULL,"Furnace whoopsied and obliterated itself to pieces!\r\n\r\nreport the issue to tildearrow with the provided \"furnace_crash.txt\" in your home folder, or whatever that happened to you is inevitable sorry : < < < <\r\n\r\nor do -safemode in terminal if you got the bravery to do so\r\n\r\nif it also still crashes i'm afraid to tell you this is an other undercooked Furnace update","CRASHED IMMENSELY",MB_OK|MB_ICONERROR); - } else { - MessageBox(NULL,"Furnace has crashed! please report this to the issue tracker immediately:\r\nhttps://github.com/tildearrow/furnace/issues/new\r\n\r\na file called furnace_crash.txt will be created in your user directory.\r\nthis will be important for locating the origin of the crash.\r\n\r\nif Furnace keeps crashing and you believe it is caused by a configuration problem, you may start Furnace with the -safemode parameter.","Error",MB_OK|MB_ICONERROR); - } + MessageBox(NULL,"Furnace has crashed! please report this to the issue tracker immediately:\r\nhttps://github.com/tildearrow/furnace/issues/new\r\n\r\na file called furnace_crash.txt will be created in your user directory.\r\nthis will be important for locating the origin of the crash.\r\n\r\nif Furnace keeps crashing and you believe it is caused by a configuration problem, you may start Furnace with the -safemode parameter.","Error",MB_OK|MB_ICONERROR); std::string crashLocation; char* userProfile=getenv("USERPROFILE"); if (userProfile==NULL) { diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 11bd9f7f6..54e0c96ba 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -42,8 +42,6 @@ #include #include -int curEngineState=-1; - void process(void* u, float** in, float** out, int inChans, int outChans, unsigned int size) { ((DivEngine*)u)->nextBuf(in,out,inChans,outChans,size); } @@ -4020,31 +4018,6 @@ bool DivEngine::prePreInit() { logD("config path: %s",configPath.c_str()); configLoaded=true; - curEngineState=-1; - time_t thisMakesNoSense=time(NULL); - struct tm curTime; -#ifdef _WIN32 - struct tm* tempTM=localtime(&thisMakesNoSense); - if (tempTM!=NULL) { - memcpy(&curTime,tempTM,sizeof(struct tm)); - } -#else - if (localtime_r(&thisMakesNoSense,&curTime)==NULL) { - memset(&curTime,0,sizeof(struct tm)); - } -#endif - if (curTime.tm_year==125) { - if (curTime.tm_mon==2 && curTime.tm_mday==31 && curTime.tm_hour>=23) { - curEngineState=curTime.tm_hour; - } else if (curTime.tm_mon==3 && curTime.tm_mday==1) { - curEngineState=curTime.tm_hour; - } else if (curTime.tm_mon==3 && curTime.tm_mday==2 && curTime.tm_hour<6) { - curEngineState=curTime.tm_hour; - } else { - curEngineState=-1; - } - } - return loadConf(); } diff --git a/src/engine/engine.h b/src/engine/engine.h index 21fc9cebf..02716c4e5 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -432,7 +432,6 @@ enum DivChanTypes { }; extern const char* cmdName[]; -extern int curEngineState; class DivEngine { DivDispatchContainer disCont[DIV_MAX_CHIPS]; @@ -448,7 +447,6 @@ class DivEngine { bool playing; bool freelance; bool shallStop, shallStopSched; - bool reverse; bool endOfSong; bool consoleMode; bool disableStatusOut; @@ -1402,7 +1400,6 @@ class DivEngine { freelance(false), shallStop(false), shallStopSched(false), - reverse(false), endOfSong(false), consoleMode(false), disableStatusOut(false), diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 50e017584..8023851b1 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -29,11 +29,6 @@ void DivEngine::nextOrder() { curRow=0; if (repeatPattern) return; - if (curEngineState==3 || curEngineState==17) { - if ((rand()%80)==0) { - return; - } - } if (++curOrder>=curSubSong->ordersLen) { logV("end of orders reached"); endOfSong=true; @@ -331,18 +326,6 @@ const char* formatNote(unsigned char note, unsigned char octave) { } int DivEngine::dispatchCmd(DivCommand c) { - if (curEngineState==2 || curEngineState==14 || curEngineState==22) { - if (c.cmd==DIV_CMD_NOTE_ON) { - if ((rand()&255)==0) { - c.value++; - } - } - if (c.cmd==DIV_CMD_NOTE_OFF) { - if ((rand()&127)==0) { - return 0; - } - } - } if (view==DIV_STATUS_COMMANDS) { if (!skipping) { switch (c.cmd) { @@ -1441,26 +1424,13 @@ void DivEngine::nextRow() { changeOrd=-1; } if (haltOn==DIV_HALT_PATTERN) halted=true; - } else if (playing) { - if (reverse) { - if (--curRow<1) reverse=false; + } else if (playing) if (++curRow>=curSubSong->patLen) { + if (shallStopSched) { + curRow=curSubSong->patLen-1; } else { - curRow++; - } - if (curRow>=curSubSong->patLen) { - if (shallStopSched) { - curRow=curSubSong->patLen-1; - } else { - nextOrder(); - } - if (haltOn==DIV_HALT_PATTERN) halted=true; - } - - if ((curEngineState==4 || curEngineState==21) && (curRow&3)==0 && !skipping) { - if ((rand()%600)==0) { - reverse=true; - } + nextOrder(); } + if (haltOn==DIV_HALT_PATTERN) halted=true; } // new loop detection routine @@ -1489,17 +1459,6 @@ void DivEngine::nextRow() { nextSpeed=speeds.val[curSpeed]; } - if (curEngineState==3 || curEngineState==17) { - if ((rand()%300)==0) { - ticks++; - nextSpeed++; - } - if ((rand()%15000)==0) { - ticks=128; - nextSpeed+=128; - } - } - /* if (skipping) { ticks=1; diff --git a/src/gui/about.cpp b/src/gui/about.cpp index 82f331194..7f0fdcdf2 100644 --- a/src/gui/about.cpp +++ b/src/gui/about.cpp @@ -257,9 +257,6 @@ void FurnaceGUI::drawAbout() { for (size_t i=0; icanvasH) continue; diff --git a/src/gui/cursor.cpp b/src/gui/cursor.cpp index 33a32d885..3d95bf0f8 100644 --- a/src/gui/cursor.cpp +++ b/src/gui/cursor.cpp @@ -224,14 +224,6 @@ void FurnaceGUI::finishSelection() { } void FurnaceGUI::moveCursor(int x, int y, bool select) { - if (curEngineState==18) { - if ((rand()%120)==0) { - x=-x; - } - if ((rand()%120)==0) { - y=-y; - } - } if (y>=editStepCoarse || y<=-editStepCoarse || x<=-5 || x>=5) { makeCursorUndo(); } @@ -458,9 +450,6 @@ void FurnaceGUI::moveCursorBottom(bool select) { void FurnaceGUI::editAdvance() { finishSelection(); cursor.y+=editStep; - if (curEngineState==18) { - if ((rand()%180)==0) cursor.y=rand()&0xff; - } if (cursor.y>=e->curSubSong->patLen) cursor.y=e->curSubSong->patLen-1; selStart=cursor; selEnd=cursor; diff --git a/src/gui/doAction.cpp b/src/gui/doAction.cpp index e7a8025f1..093e1c1e5 100644 --- a/src/gui/doAction.cpp +++ b/src/gui/doAction.cpp @@ -32,12 +32,6 @@ const unsigned char avRequest[15]={ void FurnaceGUI::doAction(int what) { - if (curEngineState==8 || curEngineState==13 || curEngineState==23) { - if ((rand()%1000)==0) { - showError("I don't wanna"); - return; - } - } switch (what) { case GUI_ACTION_NEW: if (modified) { diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 2e78bc037..d5bc589fe 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1200,7 +1200,6 @@ void FurnaceGUI::play(int row) { curNibble=false; orderNibble=false; activeNotes.clear(); - fullView=false; } void FurnaceGUI::setOrder(unsigned char order, bool forced) { @@ -1226,15 +1225,6 @@ void FurnaceGUI::stop() { } updateScroll(cursor.y); } - if (curEngineState==9) { - if ((rand()%40)==0) { - fullView=true; - } else { - fullView=false; - } - } else { - fullView=false; - } } void FurnaceGUI::previewNote(int refChan, int note, bool autoNote) { @@ -1338,12 +1328,6 @@ void FurnaceGUI::noteInput(int num, int key, int vol) { makeUndo(GUI_UNDO_PATTERN_EDIT); editAdvance(); curNibble=false; - - if (curEngineState==19) { - if ((rand()%300)==0) { - displayRating=true; - } - } } void FurnaceGUI::valueInput(int num, bool direct, int target) { @@ -2389,210 +2373,6 @@ int FurnaceGUI::save(String path, int dmfVersion) { return 0; } -static const signed char kickPos[]={ - 0, 6, 10, -1 -}; - -static const signed char snarePos[]={ - 4, 12, -1 -}; - -static const signed char timpaniPos[]={ - 8, 14, -1 -}; - -static const signed char clapPos[]={ - 2, -1 -}; - -static const signed char chatPos[]={ - 0, 1, 3, 8, 9, 11, -1 -}; - -static const signed char ohatPos[]={ - 2, 10, -1 -}; - -static const signed char bongoPos[]={ - 4, 5, 6, 7, 12, 13, 14, 15, -1 -}; - -static const signed char bongoNotes[4]={ - 4, 1, 5, 1 -}; - -static const signed char bongoOctaves[4]={ - 4, 4, 3, 4 -}; - -static const char* kickNames[]={ - "kick", "kikc", "kik", "bd", "bass d", "bassd", NULL -}; - -static const char* snareNames[]={ - "snar", "snor", "snr", "sd", "sho", "gun", NULL -}; - -static const char* clapNames[]={ - "clap", "clav", "hall", "click", "cow", NULL -}; - -static const char* timpaniNames[]={ - "timp", "tom", "crash", "kettle", NULL -}; - -static const char* chatNames[]={ - "close", "hat", "hhc", "chh", "hh", "short", NULL -}; - -static const char* ohatNames[]={ - "open", "hop", "hho", "ohh", "hh", "ride", "long", "hat", NULL -}; - -static const char* bongoNames[]={ - "bong", "rim", "cong", "tom", "pop", NULL -}; - -#define ASS_FIND_INS(names,id,ch,off) { \ - bool nameFound=false; \ - for (int _n=0; names[_n]; _n++) { \ - const char* name=names[_n]; \ - for (size_t _i=0; _isong.ins.size(); _i++) { \ - String insName=e->song.ins[_i]->name; \ - for (char& i: insName) { \ - if (i>='A' && i<='Z') i+='a'-'A'; \ - } \ - if (insName.find(name)!=String::npos) { \ - id=_i; \ - nameFound=true; \ - break; \ - } \ - } \ - if (nameFound) break; \ - } \ - if (!nameFound) { \ - if (e->song.ins.size()>0) { \ - id=rand()%e->song.ins.size(); \ - } \ - } \ - if (id>=0) { \ - bool skip=off; \ - for (int _i=0; _igetTotalChannelCount(); _i++) { \ - DivInstrumentType pref1=e->getPreferInsType(_i); \ - DivInstrumentType pref2=e->getPreferInsSecondType(_i); \ - DivInstrumentType have=e->song.ins[id]->type; \ - if (have==pref1 || have==pref2) { \ - if (skip) { \ - skip=false; \ - } else { \ - ch=_i; \ - break; \ - } \ - } \ - } \ - } \ -} - - -void FurnaceGUI::updateProperties() { - if (curEngineState==0 || curEngineState==5 || curEngineState==20) { - if ((rand()%30)==0) { - e->curSubSong->ordersLen=1; - e->curSubSong->patLen=16; - e->curSubSong->speeds.val[0]=6; - e->curSubSong->speeds.len=1; - e->curSubSong->virtualTempoD=150; - e->curSubSong->virtualTempoN=150; - int kickID=-1; - int clapID=-1; - int snareID=-1; - int timpaniID=-1; - int chatID=-1; - int ohatID=-1; - int bongoID=-1; - int kickCh=0; - int clapCh=0; - int snareCh=0; - int timpaniCh=0; - int chatCh=1; - int ohatCh=1; - int bongoCh=1; - - // find instruments - ASS_FIND_INS(kickNames,kickID,kickCh,0); - ASS_FIND_INS(snareNames,snareID,snareCh,0); - ASS_FIND_INS(clapNames,clapID,clapCh,0); - ASS_FIND_INS(timpaniNames,timpaniID,timpaniCh,0); - ASS_FIND_INS(chatNames,chatID,chatCh,1); - ASS_FIND_INS(ohatNames,ohatID,ohatCh,1); - ASS_FIND_INS(bongoNames,bongoID,bongoCh,1); - - // prepare song - for (int i=0; igetTotalChannelCount(); i++) { - e->curSubSong->orders.ord[i][0]=0; - e->curSubSong->pat[i].getPattern(0,true)->clear(); - } - - // place kicks - for (int i=0; kickPos[i]>=0; i++) { - DivPattern* p=e->curSubSong->pat[kickCh].getPattern(0,true); - int kp=kickPos[i]; - p->data[kp][0]=12; - p->data[kp][1]=3; - p->data[kp][2]=kickID; - } - // place claps - for (int i=0; clapPos[i]>=0; i++) { - DivPattern* p=e->curSubSong->pat[clapCh].getPattern(0,true); - int kp=clapPos[i]; - p->data[kp][0]=12; - p->data[kp][1]=3; - p->data[kp][2]=clapID; - } - // place snares - for (int i=0; snarePos[i]>=0; i++) { - DivPattern* p=e->curSubSong->pat[snareCh].getPattern(0,true); - int kp=snarePos[i]; - p->data[kp][0]=12; - p->data[kp][1]=3; - p->data[kp][2]=snareID; - } - // place timpani - for (int i=0; timpaniPos[i]>=0; i++) { - DivPattern* p=e->curSubSong->pat[timpaniCh].getPattern(0,true); - int kp=timpaniPos[i]; - p->data[kp][0]=12; - p->data[kp][1]=3; - p->data[kp][2]=timpaniID; - } - // place chats - for (int i=0; chatPos[i]>=0; i++) { - DivPattern* p=e->curSubSong->pat[chatCh].getPattern(0,true); - int kp=chatPos[i]; - p->data[kp][0]=12; - p->data[kp][1]=3; - p->data[kp][2]=chatID; - } - // place ohats - for (int i=0; ohatPos[i]>=0; i++) { - DivPattern* p=e->curSubSong->pat[ohatCh].getPattern(0,true); - int kp=ohatPos[i]; - p->data[kp][0]=12; - p->data[kp][1]=3; - p->data[kp][2]=ohatID; - } - // place bongo - for (int i=0; bongoPos[i]>=0; i++) { - DivPattern* p=e->curSubSong->pat[bongoCh].getPattern(0,true); - int kp=bongoPos[i]; - p->data[kp][0]=bongoNotes[kp&3]; - p->data[kp][1]=bongoOctaves[kp&3]; - p->data[kp][2]=bongoID; - } - } - } -} - int FurnaceGUI::load(String path) { bool wasPlaying=e->isPlaying(); if (!path.empty()) { @@ -2648,7 +2428,6 @@ int FurnaceGUI::load(String path) { return 1; } } - updateProperties(); backupLock.lock(); curFileName=path; backupLock.unlock(); @@ -3979,8 +3758,6 @@ bool FurnaceGUI::loop() { if (settings.powerSave) SDL_WaitEventTimeout(NULL,500); } - updateState(); - memcpy(perfMetricsLast,perfMetrics,64*sizeof(FurnaceGUIPerfMetric)); perfMetricsLastLen=perfMetricsLen; perfMetricsLen=0; @@ -4683,16 +4460,6 @@ bool FurnaceGUI::loop() { openFileDialog(GUI_FILE_SAVE); } ImGui::Separator(); - if (curEngineState==15) { - if (ImGui::MenuItem(_("import MIDI..."))) { - if ((rand()%5)==0) { - showError("what makes you think there is MIDI import?"); - } else { - abort(); - } - } - ImGui::Separator(); - } if (settings.exportOptionsLayout==0) { if (ImGui::BeginMenu(_("export audio..."))) { drawExportAudio(); @@ -6079,11 +5846,6 @@ bool FurnaceGUI::loop() { ImGui::OpenPopup(_("ROM Export Progress")); } - if (displayRating) { - displayRating=false; - ImGui::OpenPopup(_("Furnace###BeatRating")); - } - if (displayNew) { newSongQuery=""; newSongFirstFrame=true; @@ -6310,17 +6072,6 @@ bool FurnaceGUI::loop() { ImGui::EndPopup(); } - centerNextWindow(_("Furnace###BeatRating"),canvasW,canvasH); - if (ImGui::BeginPopupModal("Furnace###BeatRating",NULL,ImGuiWindowFlags_AlwaysAutoResize)) { - stop(); - ImGui::TextUnformatted(_("This beat is ass. Session terminated.")); - if (ImGui::Button(_("OK"))) { - quit=true; - ImGui::CloseCurrentPopup(); - } - ImGui::EndPopup(); - } - centerNextWindow(_("Error"),canvasW,canvasH); if (ImGui::BeginPopupModal(_("Error"),NULL,ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::Text(_("%s"),errorString.c_str()); @@ -8628,14 +8379,12 @@ FurnaceGUI::FurnaceGUI(): displayPendingSamples(false), replacePendingSample(false), displayExportingROM(false), - displayRating(false), changeCoarse(false), mobileEdit(false), killGraphics(false), safeMode(false), midiWakeUp(true), makeDrumkitMode(false), - fullView(false), audioEngineChanged(false), settingsChanged(false), debugFFT(false), diff --git a/src/gui/gui.h b/src/gui/gui.h index 7ca2aabcf..bbc31635b 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1666,14 +1666,12 @@ class FurnaceGUI { bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString; bool displayPendingSamples, replacePendingSample; bool displayExportingROM; - bool displayRating; bool changeCoarse; bool mobileEdit; bool killGraphics; bool safeMode; bool midiWakeUp; bool makeDrumkitMode; - bool fullView; bool audioEngineChanged, settingsChanged, debugFFT; bool willExport[DIV_MAX_CHIPS]; int vgmExportVersion; @@ -2949,8 +2947,6 @@ class FurnaceGUI { void commitTutorial(); void syncState(); void commitState(DivConfig& conf); - void updateState(); - void updateProperties(); void processDrags(int dragX, int dragY); void processPoint(SDL_Event& ev); diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index b3c62c275..19f9e3310 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -1943,30 +1943,6 @@ inline bool enBit30(const int val) { } -void FurnaceGUI::updateState() { - time_t thisMakesNoSense=time(NULL); - struct tm curTime; -#ifdef _WIN32 - struct tm* tempTM=localtime(&thisMakesNoSense); - if (tempTM!=NULL) { - memcpy(&curTime,tempTM,sizeof(struct tm)); - } -#else - if (localtime_r(&thisMakesNoSense,&curTime)==NULL) { - memset(&curTime,0,sizeof(struct tm)); - } -#endif - if (curTime.tm_year==125) { - if (curTime.tm_mon==2 && curTime.tm_mday==31 && curTime.tm_hour>=23) { - curEngineState=curTime.tm_hour; - } else if (curTime.tm_mon==3 && curTime.tm_mday==1) { - curEngineState=curTime.tm_hour; - } else if (curTime.tm_mon==3 && curTime.tm_mday==2 && curTime.tm_hour<6) { - curEngineState=curTime.tm_hour; - } - } -} - void FurnaceGUI::kvsConfig(DivInstrument* ins, bool supportsKVS) { if (fmPreviewOn) { if (ImGui::IsItemHovered()) { diff --git a/src/gui/osc.cpp b/src/gui/osc.cpp index 3dfd78c9d..00680ac75 100644 --- a/src/gui/osc.cpp +++ b/src/gui/osc.cpp @@ -300,23 +300,50 @@ void FurnaceGUI::drawOsc() { } if ((oscWidth-24)>0) { - if (!e->isPlaying() && fullView) { - ImVec2 point0=inRect.Min; - ImVec2 point1=inRect.Max; - point0.y=0; - point1.y=canvasH; - dl->PushClipRectFullScreen(); - dl->AddRectFilled(point0,point1,color,0,ImDrawFlags_None); - dl->PopClipRect(); + if (settings.oscMono) { + if (rend->supportsDrawOsc() && settings.shaderOsc) { + _do.gui=this; + _do.data=&oscValuesAverage[12]; + _do.len=oscWidth-24; + _do.pos0=inRect.Min; + _do.pos1=inRect.Max; + _do.color=isClipping?uiColors[GUI_COLOR_OSC_WAVE_PEAK]:uiColors[GUI_COLOR_OSC_WAVE]; + _do.lineSize=dpiScale*settings.oscLineSize; + + dl->AddCallback(_drawOsc,&_do); + dl->AddCallback(ImDrawCallback_ResetRenderState,NULL); + } else { + for (int i=0; i0.5f) y=0.5f; + } + waveform[i]=ImLerp(inRect.Min,inRect.Max,ImVec2(x,0.5f-y)); + } + + if (settings.oscEscapesBoundary) { + dl->PushClipRectFullScreen(); + dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize); + dl->PopClipRect(); + } else { + dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize); + } + } } else { - if (settings.oscMono) { + for (int ch=0; chgetAudioDescGot().outChans; ch++) { + if (!isClipping) { + color=ImGui::GetColorU32(uiColors[GUI_COLOR_OSC_WAVE_CH0+ch]); + } + if (rend->supportsDrawOsc() && settings.shaderOsc) { _do.gui=this; - _do.data=&oscValuesAverage[12]; + _do.data=&oscValues[ch][12]; _do.len=oscWidth-24; _do.pos0=inRect.Min; _do.pos1=inRect.Max; - _do.color=isClipping?uiColors[GUI_COLOR_OSC_WAVE_PEAK]:uiColors[GUI_COLOR_OSC_WAVE]; + _do.color=isClipping?uiColors[GUI_COLOR_OSC_WAVE_PEAK]:uiColors[GUI_COLOR_OSC_WAVE_CH0+ch]; _do.lineSize=dpiScale*settings.oscLineSize; dl->AddCallback(_drawOsc,&_do); @@ -324,7 +351,7 @@ void FurnaceGUI::drawOsc() { } else { for (int i=0; i0.5f) y=0.5f; @@ -332,6 +359,7 @@ void FurnaceGUI::drawOsc() { waveform[i]=ImLerp(inRect.Min,inRect.Max,ImVec2(x,0.5f-y)); } + if (settings.oscEscapesBoundary) { dl->PushClipRectFullScreen(); dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize); @@ -340,44 +368,6 @@ void FurnaceGUI::drawOsc() { dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize); } } - } else { - for (int ch=0; chgetAudioDescGot().outChans; ch++) { - if (!isClipping) { - color=ImGui::GetColorU32(uiColors[GUI_COLOR_OSC_WAVE_CH0+ch]); - } - - if (rend->supportsDrawOsc() && settings.shaderOsc) { - _do.gui=this; - _do.data=&oscValues[ch][12]; - _do.len=oscWidth-24; - _do.pos0=inRect.Min; - _do.pos1=inRect.Max; - _do.color=isClipping?uiColors[GUI_COLOR_OSC_WAVE_PEAK]:uiColors[GUI_COLOR_OSC_WAVE_CH0+ch]; - _do.lineSize=dpiScale*settings.oscLineSize; - - dl->AddCallback(_drawOsc,&_do); - dl->AddCallback(ImDrawCallback_ResetRenderState,NULL); - } else { - for (int i=0; i0.5f) y=0.5f; - } - waveform[i]=ImLerp(inRect.Min,inRect.Max,ImVec2(x,0.5f-y)); - } - - - if (settings.oscEscapesBoundary) { - dl->PushClipRectFullScreen(); - dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize); - dl->PopClipRect(); - } else { - dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize); - } - } - } } } } diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index bdbba3584..c30f16ee2 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -7203,20 +7203,5 @@ void FurnaceGUI::applyUISettings(bool updateFonts) { fileDialog=new FurnaceGUIFileDialog(settings.sysFileDialog); fileDialog->mobileUI=mobileUI; - - if (curEngineState==10) { - if ((rand()%10)==0) { - for (int i=0; i