Move unspecific Emulator code out of System.cpp

This commit is contained in:
Megamouse 2021-04-21 22:12:21 +02:00 committed by Ivan
parent 4c2a11b6d0
commit 1caf81811a
38 changed files with 729 additions and 652 deletions

View file

@ -6,6 +6,7 @@
#include "Utilities/StrUtil.h"
#include "Utilities/File.h"
#include "Emu/System.h"
#include "Emu/system_utils.hpp"
#include "util/logs.hpp"
#include <QApplication>
@ -284,7 +285,7 @@ bool update_manager::handle_rpcs3(const QByteArray& data)
#ifdef _WIN32
// Get executable path
const std::string orig_path = Emulator::GetExeDir() + "rpcs3.exe";
const std::string orig_path = rpcs3::utils::get_exe_dir() + "rpcs3.exe";
std::wstring wchar_orig_path;
const auto tmp_size = MultiByteToWideChar(CP_UTF8, 0, orig_path.c_str(), -1, nullptr, 0);
@ -390,7 +391,7 @@ bool update_manager::handle_rpcs3(const QByteArray& data)
usz outBufferSize = 0;
// Creates temp folder for moving active files
const std::string tmp_folder = Emulator::GetEmuDir() + "rpcs3_old/";
const std::string tmp_folder = rpcs3::utils::get_emu_dir() + "rpcs3_old/";
fs::create_dir(tmp_folder);
for (UInt32 i = 0; i < db.NumFiles; i++)
@ -423,7 +424,7 @@ bool update_manager::handle_rpcs3(const QByteArray& data)
temp_u8[index] = static_cast<u8>(temp_u16[index]);
}
temp_u8[len] = 0;
const std::string name = Emulator::GetEmuDir() + std::string(reinterpret_cast<char*>(temp_u8));
const std::string name = rpcs3::utils::get_emu_dir() + std::string(reinterpret_cast<char*>(temp_u8));
if (!isDir)
{