From 4af768d2809a2c585477a4ce915dcfdc7499adf7 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 17 Aug 2025 05:38:38 -0500 Subject: [PATCH] GUI: loop start/end hints, part 1 --- src/gui/sampleEdit.cpp | 45 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index ac58350b7..784485d93 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -2042,12 +2042,53 @@ void FurnaceGUI::drawSampleEdit() { } dl->PopClipRect(); + //bool displayLoopHintsNES=false; + bool displayLoopHintsSNES=false; + //bool displayLoopHintsAmiga=false; + + for (int i=0; isong.systemLen; i++) { + /* + if (e->song.system[i]==DIV_SYSTEM_NES) { + displayLoopHintsNES=true; + }*/ + if (e->song.system[i]==DIV_SYSTEM_SNES) { + displayLoopHintsSNES=true; + } + /*if (e->song.system[i]==DIV_SYSTEM_AMIGA) { + displayLoopHintsAmiga=true; + }*/ + } + if (displayLoopStartHints) { - dl->AddText(ImVec2(minArea.x,minArea.y),0xffffffff,"Loop start hints."); + if (displayLoopHintsSNES) { + if (sampleZoom<0.5) { + for (int i=0; i<(int)(sampleZoom*avail.x); i++) { + if (((i+samplePos)&15)==0) { + ImVec2 p1=ImVec2(rectMin.x+((float)i/sampleZoom),rectMin.y); + ImVec2 p2=p1; + p2.y=rectMax.y; + + dl->AddLine(p1,p2,ImGui::GetColorU32(uiColors[GUI_COLOR_SAMPLE_NEEDLE])); + } + } + } + } } if (displayLoopEndHints) { - dl->AddText(ImVec2(minArea.x,minArea.y),0xffffffff,"Loop end hints."); + if (displayLoopHintsSNES) { + if (sampleZoom<0.5) { + for (int i=0; i<(int)(sampleZoom*avail.x); i++) { + if (((i+samplePos)&15)==0) { + ImVec2 p1=ImVec2(rectMin.x+((float)i/sampleZoom),rectMin.y); + ImVec2 p2=p1; + p2.y=rectMax.y; + + dl->AddLine(p1,p2,ImGui::GetColorU32(uiColors[GUI_COLOR_SAMPLE_NEEDLE])); + } + } + } + } } if (drawSelection) {