#include #include #include #include CPUSettings::CPUSettings() { if (Options::GetInstance().GetValue("cpu", "type") == "jit") { selectedCpuTypeIndex = 1; } else { selectedCpuTypeIndex = 0; } } void CPUSettings::render() { const char* items[] = { "Interpreter", "Dynamic Recompiler" }; const char* combo_preview_value = items[selectedCpuTypeIndex]; if (ImGui::BeginCombo("CPU Type", combo_preview_value)) { for (int n = 0; n < IM_ARRAYSIZE(items); n++) { const bool is_selected = (selectedCpuTypeIndex == n); if (ImGui::Selectable(items[n], is_selected)) { selectedCpuTypeIndex = n; modified = true; } // Set the initial focus when opening the combo (scrolling + keyboard navigation focus) if (is_selected) ImGui::SetItemDefaultFocus(); } ImGui::EndCombo(); } if(modified) { if(selectedCpuTypeIndex == 0) { Options::GetInstance().SetValue("cpu", "type", "interpreter"); } else { Options::GetInstance().SetValue("cpu", "type", "jit"); } } }