From c42e101596dac050e5a3ed3ba35abeb282d3525c Mon Sep 17 00:00:00 2001 From: kenshen112 Date: Thu, 17 Dec 2020 12:20:47 -0700 Subject: [PATCH] Adde dcasts to recording, dev9 and usb --- pcsx2/DEV9/Linux/Config.cpp | 4 ++-- pcsx2/DEV9/Win32/DEV9WinConfig.cpp | 4 ++-- pcsx2/Recording/InputRecording.cpp | 14 +++++++------- pcsx2/USB/configuration.cpp | 6 +++--- pcsx2/USB/configuration.h | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pcsx2/DEV9/Linux/Config.cpp b/pcsx2/DEV9/Linux/Config.cpp index aac9b06f67cbfa..0bd9f6ad79eb77 100644 --- a/pcsx2/DEV9/Linux/Config.cpp +++ b/pcsx2/DEV9/Linux/Config.cpp @@ -64,7 +64,7 @@ void SaveConf() */ - const std::string file(GetSettingsFolder().Combine(wxString("DEV9.cfg")).GetFullPath()); + const std::string file(Path::Combine(GetSettingsFolder(), "DEV9.cfg")); fprintf(stderr, "CONF: %s", file.c_str()); @@ -84,7 +84,7 @@ void SaveConf() void LoadConf() { - const std::string file(GetSettingsFolder().Combine(wxString("DEV9.cfg")).GetFullPath()); + const std::string file(Path::Combine(GetSettingsFolder(), "DEV9.cfg")); if (-1 == access(file.c_str(), F_OK)) return; diff --git a/pcsx2/DEV9/Win32/DEV9WinConfig.cpp b/pcsx2/DEV9/Win32/DEV9WinConfig.cpp index d6bd4bc3008106..29f3ce50a321e4 100644 --- a/pcsx2/DEV9/Win32/DEV9WinConfig.cpp +++ b/pcsx2/DEV9/Win32/DEV9WinConfig.cpp @@ -34,7 +34,7 @@ bool FileExists(std::string szPath) void SaveConf() { - const std::string file(GetSettingsFolder().Combine(wxString("DEV9.cfg")).GetFullPath()); + const std::string file(Path::Combine(GetSettingsFolder(), "DEV9.cfg")); DeleteFileA(file.c_str()); WritePrivateProfileStringA("DEV9", "Eth", config.Eth, file.c_str()); @@ -46,7 +46,7 @@ void SaveConf() void LoadConf() { - const std::string file(GetSettingsFolder().Combine(wxString("DEV9.cfg")).GetFullPath()); + const std::string file(Path::Combine(GetSettingsFolder(), "DEV9.cfg")); if (FileExists(file.c_str()) == false) return; diff --git a/pcsx2/Recording/InputRecording.cpp b/pcsx2/Recording/InputRecording.cpp index ccb9c8b6cf6757..12cf5a23628adb 100644 --- a/pcsx2/Recording/InputRecording.cpp +++ b/pcsx2/Recording/InputRecording.cpp @@ -332,7 +332,7 @@ bool InputRecording::Play(wxString fileName) if (!wxFileExists(inputRecordingData.GetFilename() + "_SaveState.p2s")) { inputRec::consoleLog(fmt::format("Could not locate savestate file at location - {}_SaveState.p2s", - inputRecordingData.GetFilename())); + inputRecordingData.GetFilename().ToStdString())); inputRecordingData.Close(); return false; } @@ -371,17 +371,17 @@ wxString InputRecording::resolveGameName() const wxString gameKey(SysGetDiscID()); if (!gameKey.IsEmpty()) { - if (IGameDatabase* GameDB = AppHost_GetGameDatabase()) + if (IGameDatabase* gameDB = AppHost_GetGameDatabase()) { - Game_Data game; - if (GameDB->findGame(game, gameKey)) + GameDatabaseSchema::GameEntry game = gameDB->findGame(std::string(gameKey)); + if (game.isValid) { - gameName = game.getString("Name"); - gameName += L" (" + game.getString("Region") + L")"; + gameName = game.name; + gameName += L" (" + game.region + L")"; } } } - return !gameName.IsEmpty() ? gameName : Path::GetFilename(g_Conf->CurrentIso); + return !gameName.IsEmpty() ? gameName : (wxString)Path::GetFilename(g_Conf->CurrentIso.ToStdString()); } #endif diff --git a/pcsx2/USB/configuration.cpp b/pcsx2/USB/configuration.cpp index 22816832cfbba6..613e36a63d3c79 100644 --- a/pcsx2/USB/configuration.cpp +++ b/pcsx2/USB/configuration.cpp @@ -23,7 +23,7 @@ #include std::map, std::string> changedAPIs; -wxString iniFile(L"USB.ini"); +std::string iniFile("USB.ini"); static TSTDSTRING usb_path; TSTDSTRING IniPath; // default path, just in case TSTDSTRING LogDir; @@ -35,9 +35,9 @@ void USBsetSettingsDir() if(!USBpathSet) { #ifdef _WIN32 - IniPath = GetSettingsFolder().Combine( iniFile ).GetFullPath(); // default path, just in case + IniPath = Path::Combine(GetSettingsFolder(), fs::path(iniFile)).wstring(); // default path, just in case #else - IniPath = std::string(GetSettingsFolder().Combine( iniFile ).GetFullPath()); // default path, just in case + IniPath = Path::Combine(GetSettingsFolder(), fs::path(iniFile)); // default path, just in case #endif USBpathSet = true; } diff --git a/pcsx2/USB/configuration.h b/pcsx2/USB/configuration.h index b54f822e854fb1..e07a1105131de7 100644 --- a/pcsx2/USB/configuration.h +++ b/pcsx2/USB/configuration.h @@ -71,7 +71,7 @@ void RemoveSection(const char* dev_type, int port, const std::string& key); extern TSTDSTRING IniPath; extern TSTDSTRING LogDir; -extern wxString iniFile; +extern std::string iniFile; extern std::map, std::string> changedAPIs; std::string GetSelectedAPI(const std::pair& pair);