From a90d588167aa34934485f9b2fbe8fc68a52d11f9 Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Fri, 11 Dec 2020 05:19:15 +0100 Subject: [PATCH] PAD: fix ini saving --- pcsx2/PAD/Linux/PAD.cpp | 7 ------- pcsx2/PAD/Linux/PAD.h | 1 - pcsx2/PAD/Linux/ini.cpp | 10 ++++++---- pcsx2/PAD/Linux/keyboard.h | 6 ++++-- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/pcsx2/PAD/Linux/PAD.cpp b/pcsx2/PAD/Linux/PAD.cpp index 8409576e6c..ab24a6c633 100644 --- a/pcsx2/PAD/Linux/PAD.cpp +++ b/pcsx2/PAD/Linux/PAD.cpp @@ -39,7 +39,6 @@ PADconf g_conf; keyEvent event; static keyEvent s_event; -std::string s_padstrIniPath("inis/"); std::string s_padstrLogPath("logs/"); FILE* padLog = NULL; @@ -124,12 +123,6 @@ s32 PADopen(void* pDsp) return _PADopen(pDsp); } -void PADsetSettingsDir(const char* dir) -{ - // Get the path to the ini directory. - s_padstrIniPath = (dir == NULL) ? "inis/" : dir; -} - void PADsetLogDir(const char* dir) { // Get the path to the log directory. diff --git a/pcsx2/PAD/Linux/PAD.h b/pcsx2/PAD/Linux/PAD.h index 4a578aac02..d5514d4f28 100644 --- a/pcsx2/PAD/Linux/PAD.h +++ b/pcsx2/PAD/Linux/PAD.h @@ -127,7 +127,6 @@ void SysMessage(char* fmt, ...); s32 PADinit(); void PADshutdown(); s32 PADopen(void* pDsp); -void PADsetSettingsDir(const char* dir); void PADsetLogDir(const char* dir); void PADclose(); u32 PADquery(); diff --git a/pcsx2/PAD/Linux/ini.cpp b/pcsx2/PAD/Linux/ini.cpp index 9043f7fdc5..19511176ac 100644 --- a/pcsx2/PAD/Linux/ini.cpp +++ b/pcsx2/PAD/Linux/ini.cpp @@ -17,10 +17,9 @@ #include "GamePad.h" #include "keyboard.h" +#include "AppConfig.h" #include "PAD.h" -extern std::string s_padstrIniPath; - void DefaultKeyboardValues() { set_keyboard_key(0, XK_a, PAD_L2); @@ -43,7 +42,8 @@ void PADSaveConfig() { FILE* f; - const std::string iniFile(s_padstrIniPath + "PAD.ini"); + wxString iniName(L"PAD.ini"); + const std::string iniFile = std::string(GetSettingsFolder().Combine(iniName).GetFullPath()); // default path, just in case f = fopen(iniFile.c_str(), "w"); if (f == NULL) { @@ -76,7 +76,9 @@ void PADLoadConfig() g_conf.init(); - const std::string iniFile(s_padstrIniPath + "PAD.ini"); + + wxString iniName(L"PAD.ini"); + const std::string iniFile = std::string(GetSettingsFolder().Combine(iniName).GetFullPath()); // default path, just in case f = fopen(iniFile.c_str(), "r"); if (f == NULL) { diff --git a/pcsx2/PAD/Linux/keyboard.h b/pcsx2/PAD/Linux/keyboard.h index e3ab7f9802..4ba2d1efdc 100644 --- a/pcsx2/PAD/Linux/keyboard.h +++ b/pcsx2/PAD/Linux/keyboard.h @@ -18,11 +18,13 @@ #include "PAD.h" +#if defined(__unix__) || defined(__APPLE__) + #include #include #include - -#if defined(__unix__) || defined(__APPLE__) +// x11 is dumb like that +#undef DisableScreenSaver extern void AnalyzeKeyEvent(keyEvent& evt); extern void UpdateKeyboardInput();