Files
kaizen/src/frontend/CPUSettings.cpp
2025-04-29 22:40:07 +02:00

24 lines
556 B
C++

#include <CPUSettings.hpp>
#include <JSONUtils.hpp>
#include <log.hpp>
CPUSettings::CPUSettings(nlohmann::json &settings) : settings(settings) {
if (JSONGetField<std::string>(settings, "cpu", "type") == "jit") {
cpuTypes.setCurrentIndex(1);
} else {
cpuTypes.setCurrentIndex(0);
}
}
bool CPUSettings::render() {
if(cpuTypes.render()) {
if(cpuTypes.getCurrentIndex() == 0) {
JSONSetField(settings, "cpu", "type", "interpreter");
} else {
Util::panic("JIT should not be selectable??");
}
modified = true;
}
}