GUI: fix possible crash with colorize ins

This commit is contained in:
tildearrow 2023-12-18 11:01:11 -05:00
parent 75323be54e
commit 4f86219989

View file

@ -2824,7 +2824,11 @@ void FurnaceGUI::drawInsEdit() {
updateFMPreview=false; updateFMPreview=false;
} }
if (settings.insEditColorize) { if (settings.insEditColorize) {
pushAccentColors(uiColors[GUI_COLOR_INSTR_STD+ins->type],uiColors[GUI_COLOR_INSTR_STD+ins->type],uiColors[GUI_COLOR_INSTR_STD+ins->type],ImVec4(0.0f,0.0f,0.0f,0.0f)); if (ins->type>=DIV_INS_MAX) {
pushAccentColors(uiColors[GUI_COLOR_INSTR_UNKNOWN],uiColors[GUI_COLOR_INSTR_UNKNOWN],uiColors[GUI_COLOR_INSTR_UNKNOWN],ImVec4(0.0f,0.0f,0.0f,0.0f));
} else {
pushAccentColors(uiColors[GUI_COLOR_INSTR_STD+ins->type],uiColors[GUI_COLOR_INSTR_STD+ins->type],uiColors[GUI_COLOR_INSTR_STD+ins->type],ImVec4(0.0f,0.0f,0.0f,0.0f));
}
} }
if (ImGui::BeginTable("InsProp",3)) { if (ImGui::BeginTable("InsProp",3)) {
ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed); ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed);