From 7cb1504215a366262f6a9b680066171495c6f39d Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 15 Jul 2023 18:49:28 -0500 Subject: [PATCH] GUI: update newSong.cpp --- src/gui/newSong.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/gui/newSong.cpp b/src/gui/newSong.cpp index 1b8e57def..170abfa30 100644 --- a/src/gui/newSong.cpp +++ b/src/gui/newSong.cpp @@ -115,24 +115,22 @@ void FurnaceGUI::drawNewSong() { } if (ImGui::IsItemHovered()) { if (ImGui::BeginTooltip()) { - std::map chipCounts; + std::map chipCounts; std::vector chips; for (FurnaceGUISysDefChip chip: i.orig) { - if (chipCounts.find(chip.sys) == chipCounts.end()) { - chipCounts[chip.sys] = 1; + if (chipCounts.find(chip.sys)==chipCounts.end()) { + chipCounts[chip.sys]=1; chips.push_back(chip.sys); - } - else { - chipCounts[chip.sys] += 1; + } else { + chipCounts[chip.sys]+=1; } } - int num_chips = chips.size(); - for (int chipIndex = 0; chipIndex < num_chips; chipIndex++) { - DivSystem chip = chips[chipIndex]; - const DivSysDef* sysDef = e->getSystemDef(chip); - ImGui::Text("%s (x%d): ", sysDef->name, chipCounts[chip]); - ImGui::TextWrapped("%s", sysDef->description); - if (chipIndex + 1 < num_chips) { + for (size_t chipIndex=0; chipIndexgetSystemDef(chip); + ImGui::Text("%s (x%d): ",sysDef->name,chipCounts[chip]); + ImGui::TextWrapped("%s",sysDef->description); + if (chipIndex+1