Skip to content

Commit 2708834

Browse files
authored
Merge pull request #1836 from nicolasnoble/spu-debug-collisions
Fixing ImGui ID collisions in the SPU debugger.
2 parents e6f816d + bc497e1 commit 2708834

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/spu/debug.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@ void DrawTableGeneralTag(const size_t channel, SPU_CHANNELS_TAGS& tags) {
181181
void DrawTableGeneralOn(const Chan::Data& data) {
182182
ImGui::BeginDisabled();
183183
auto bit1 = data.get<Chan::On>().value;
184-
ImGui::Checkbox("", &bit1);
184+
ImGui::Checkbox("##On", &bit1);
185185
ImGui::EndDisabled();
186186
}
187187

188188
void DrawTableGeneralOff(const Chan::Data& data) {
189189
auto bit2 = data.get<Chan::Stop>().value;
190190
ImGui::BeginDisabled();
191-
ImGui::Checkbox("", &bit2);
191+
ImGui::Checkbox("##Off", &bit2);
192192
ImGui::EndDisabled();
193193
}
194194

@@ -237,7 +237,7 @@ void DrawTableGeneralFMod(const Chan::Data& data) { ImGui::Text("%i", data.get<C
237237

238238
void DrawTableGeneralPlot(SPU_CHANNELS_PLOT plot, size_t channel) {
239239
constexpr auto plotSize = ImVec2(Grid::WidthGeneralPlot - TablePadding, 0);
240-
ImGui::PlotHistogram("", plot[channel], impl::DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize);
240+
ImGui::PlotHistogram("##Plot", plot[channel], impl::DEBUG_SAMPLES, 0, nullptr, 0.0f, 1.0f, plotSize);
241241
}
242242

243243
void DrawTableGeneral(SPU_CHANNELS_INFO channels, const float rowHeight, SPU_CHANNELS_TAGS tags,
@@ -255,6 +255,7 @@ void DrawTableGeneral(SPU_CHANNELS_INFO channels, const float rowHeight, SPU_CHA
255255

256256
ImGui::TableHeadersRow();
257257
for (auto i = 0u; i < SPU_CHANNELS_SIZE; ++i) {
258+
ImGui::PushID(i);
258259
const auto& data = channels[i].data;
259260

260261
ImGui::TableNextRow(Grid::FlagsRow, rowHeight);
@@ -282,6 +283,7 @@ void DrawTableGeneral(SPU_CHANNELS_INFO channels, const float rowHeight, SPU_CHA
282283
ImGui::TableNextColumn();
283284
DrawTableGeneralPlot(plot, i);
284285
// @formatter:on
286+
ImGui::PopID();
285287
}
286288
ImGui::EndTable();
287289
}

0 commit comments

Comments
 (0)