From 1a934fc2c7f3dd5d7fe9a9a8f5f9874fbba94128 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Wed, 20 Mar 2024 18:25:12 +0200 Subject: [PATCH] Cleanup --- CMakeLists.txt | 2 +- include/{mappings.hpp => input_mappings.hpp} | 0 include/panda_qt/main_window.hpp | 6 +++--- include/panda_sdl/frontend_sdl.hpp | 5 +++-- src/panda_qt/main_window.cpp | 2 +- src/panda_qt/mappings.cpp | 3 ++- src/panda_sdl/mappings.cpp | 3 ++- 7 files changed, 12 insertions(+), 9 deletions(-) rename include/{mappings.hpp => input_mappings.hpp} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c13cc41..dc230bf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -201,7 +201,7 @@ set(AUDIO_SOURCE_FILES src/core/audio/dsp_core.cpp src/core/audio/null_core.cpp ) set(RENDERER_SW_SOURCE_FILES src/core/renderer_sw/renderer_sw.cpp) -set(HEADER_FILES include/emulator.hpp include/helpers.hpp include/termcolor.hpp include/mappings.hpp +set(HEADER_FILES include/emulator.hpp include/helpers.hpp include/termcolor.hpp include/input_mappings.hpp include/cpu.hpp include/cpu_dynarmic.hpp include/memory.hpp include/renderer.hpp include/kernel/kernel.hpp include/dynarmic_cp15.hpp include/kernel/resource_limits.hpp include/kernel/kernel_types.hpp include/kernel/config_mem.hpp include/services/service_manager.hpp include/services/apt.hpp diff --git a/include/mappings.hpp b/include/input_mappings.hpp similarity index 100% rename from include/mappings.hpp rename to include/input_mappings.hpp diff --git a/include/panda_qt/main_window.hpp b/include/panda_qt/main_window.hpp index 4d48169c..287502f2 100644 --- a/include/panda_qt/main_window.hpp +++ b/include/panda_qt/main_window.hpp @@ -11,7 +11,7 @@ #include #include "emulator.hpp" -#include "mappings.hpp" +#include "input_mappings.hpp" #include "panda_qt/about_window.hpp" #include "panda_qt/config_window.hpp" #include "panda_qt/cheats_window.hpp" @@ -81,7 +81,6 @@ class MainWindow : public QMainWindow { // This would normally be an std::unique_ptr but it's shared between threads so definitely not Emulator* emu = nullptr; - InputMappings keyboardMappings; std::thread emuThread; std::atomic appRunning = true; // Is the application itself running? @@ -89,7 +88,8 @@ class MainWindow : public QMainWindow { std::mutex messageQueueMutex; std::vector messageQueue; - ScreenWidget screen; + InputMappings keyboardMappings; + ScreenWidget screen; AboutWindow* aboutWindow; ConfigWindow* configWindow; CheatsWindow* cheatsEditor; diff --git a/include/panda_sdl/frontend_sdl.hpp b/include/panda_sdl/frontend_sdl.hpp index 9fb84b22..dd6ab6c0 100644 --- a/include/panda_sdl/frontend_sdl.hpp +++ b/include/panda_sdl/frontend_sdl.hpp @@ -5,11 +5,10 @@ #include #include "emulator.hpp" -#include "mappings.hpp" +#include "input_mappings.hpp" class FrontendSDL { Emulator emu; - InputMappings keyboardMappings; #ifdef PANDA3DS_ENABLE_OPENGL SDL_GLContext glContext; #endif @@ -22,6 +21,8 @@ class FrontendSDL { SDL_Window* window = nullptr; SDL_GameController* gameController = nullptr; + InputMappings keyboardMappings; + int gameControllerID; bool programRunning = true; diff --git a/src/panda_qt/main_window.cpp b/src/panda_qt/main_window.cpp index 32b80eaf..02fed376 100644 --- a/src/panda_qt/main_window.cpp +++ b/src/panda_qt/main_window.cpp @@ -8,7 +8,7 @@ #include #include "cheats.hpp" -#include "mappings.hpp" +#include "input_mappings.hpp" MainWindow::MainWindow(QApplication* app, QWidget* parent) : QMainWindow(parent), keyboardMappings(InputMappings::DefaultKeyboardMappings()), screen(this) { setWindowTitle("Alber"); diff --git a/src/panda_qt/mappings.cpp b/src/panda_qt/mappings.cpp index 79f667bf..bfb453d7 100644 --- a/src/panda_qt/mappings.cpp +++ b/src/panda_qt/mappings.cpp @@ -1,4 +1,4 @@ -#include "mappings.hpp" +#include "input_mappings.hpp" #include @@ -20,5 +20,6 @@ InputMappings InputMappings::DefaultKeyboardMappings() { mappings.setMapping(Qt::Key_S, HID::Keys::CirclePadDown); mappings.setMapping(Qt::Key_D, HID::Keys::CirclePadRight); mappings.setMapping(Qt::Key_A, HID::Keys::CirclePadLeft); + return mappings; } \ No newline at end of file diff --git a/src/panda_sdl/mappings.cpp b/src/panda_sdl/mappings.cpp index 0147833b..eba76b09 100644 --- a/src/panda_sdl/mappings.cpp +++ b/src/panda_sdl/mappings.cpp @@ -1,4 +1,4 @@ -#include "mappings.hpp" +#include "input_mappings.hpp" #include @@ -20,5 +20,6 @@ InputMappings InputMappings::DefaultKeyboardMappings() { mappings.setMapping(SDLK_s, HID::Keys::CirclePadDown); mappings.setMapping(SDLK_d, HID::Keys::CirclePadRight); mappings.setMapping(SDLK_a, HID::Keys::CirclePadLeft); + return mappings; } \ No newline at end of file