switch to INI for settings (easier), make settings a singleton thingy, slightly simplify core pause/stop/reset. Drop support for remappable inputs for now
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <backend/Core.hpp>
|
||||
#include <ImGuiImpl/StatusBar.hpp>
|
||||
#include <ImGuiImpl/GUI.hpp>
|
||||
#include <resources/gamecontrollerdb.h>
|
||||
|
||||
bool HandleInput(void *userdata, SDL_Event *event);
|
||||
bool QueryDevices(void *userdata, SDL_Event *event);
|
||||
@@ -10,6 +11,7 @@ bool QueryDevices(void *userdata, SDL_Event *event);
|
||||
KaizenGui::KaizenGui() noexcept : window("Kaizen", 800, 600), core(std::make_shared<n64::Core>()), vulkanWidget(core, window.getHandle()), emuThread(core, fpsCounter, vulkanWidget, settingsWindow) {
|
||||
gui::Initialize(core->parallel.wsi, window.getHandle());
|
||||
|
||||
SDL_AddGamepadMapping(gamecontrollerdb_str);
|
||||
SDL_AddEventWatch(HandleInput, this);
|
||||
SDL_AddEventWatch(QueryDevices, this);
|
||||
|
||||
@@ -59,6 +61,7 @@ KaizenGui::KaizenGui() noexcept : window("Kaizen", 800, 600), core(std::make_sha
|
||||
if(result == NFD_CANCEL) return;
|
||||
if(result == NFD_ERROR)
|
||||
Util::panic("Error: {}", NFD::GetError());
|
||||
|
||||
LoadROM(path.get());
|
||||
}},
|
||||
{"Exit", [&]() {
|
||||
@@ -233,7 +236,6 @@ void KaizenGui::LoadROM(const std::string &path) noexcept {
|
||||
|
||||
void KaizenGui::run() {
|
||||
while(!quit) {
|
||||
emuThread.run();
|
||||
SDL_Event e;
|
||||
while (SDL_PollEvent(&e)) {
|
||||
ImGui_ImplSDL3_ProcessEvent(&e);
|
||||
@@ -245,6 +247,7 @@ void KaizenGui::run() {
|
||||
}
|
||||
}
|
||||
|
||||
emuThread.run();
|
||||
RenderUI();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user