Sync filesystem.h/path.h
This commit is contained in:
@ -5,10 +5,10 @@
|
||||
#include "common/http_downloader.h"
|
||||
#include "common/log.h"
|
||||
#include "common/md5_digest.h"
|
||||
#include "common/path.h"
|
||||
#include "common/platform.h"
|
||||
#include "common/state_wrapper.h"
|
||||
#include "common/string_util.h"
|
||||
#include "common/timestamp.h"
|
||||
#include "core/bios.h"
|
||||
#include "core/bus.h"
|
||||
#include "core/cpu_core.h"
|
||||
@ -30,6 +30,10 @@
|
||||
Log_SetChannel(Cheevos);
|
||||
|
||||
#ifdef WITH_RAINTEGRATION
|
||||
// RA_Interface ends up including windows.h, with its silly macros.
|
||||
#ifdef _WIN32
|
||||
#include "common/windows_headers.h"
|
||||
#endif
|
||||
#include "RA_Interface.h"
|
||||
#endif
|
||||
|
||||
@ -711,16 +715,16 @@ std::string Cheevos::GetBadgeImageFilename(const char* badge_name, bool locked,
|
||||
{
|
||||
if (!cache_path)
|
||||
{
|
||||
return StringUtil::StdStringFromFormat("%s%s.png", badge_name, locked ? "_lock" : "");
|
||||
return fmt::format("%s%s.png", badge_name, locked ? "_lock" : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
// well, this comes from the internet.... :)
|
||||
SmallString clean_name(badge_name);
|
||||
FileSystem::SanitizeFileName(clean_name);
|
||||
std::string clean_name(badge_name);
|
||||
Path::SanitizeFileName(clean_name);
|
||||
return g_host_interface->GetUserDirectoryRelativePath("cache" FS_OSPATH_SEPARATOR_STR
|
||||
"achievement_badge" FS_OSPATH_SEPARATOR_STR "%s%s.png",
|
||||
clean_name.GetCharArray(), locked ? "_lock" : "");
|
||||
clean_name.c_str(), locked ? "_lock" : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
#include "common/gl/loader.h"
|
||||
#include "common/gl/program.h"
|
||||
#include "common/gl/shader_cache.h"
|
||||
#include "common/gl/stream_buffer.h"
|
||||
#include "common/gl/texture.h"
|
||||
#include "glad.h"
|
||||
#include "gpu_hw.h"
|
||||
#include "texture_replacements.h"
|
||||
#include <array>
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#include "gpu_hw_shadergen.h"
|
||||
#include "common/assert.h"
|
||||
#include <cstdio>
|
||||
#include <glad.h>
|
||||
|
||||
GPU_HW_ShaderGen::GPU_HW_ShaderGen(HostDisplay::RenderAPI render_api, u32 resolution_scale, u32 multisamples,
|
||||
bool per_sample_shading, bool true_color, bool scaled_dithering,
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
#include "common/file_system.h"
|
||||
#include "common/image.h"
|
||||
#include "common/log.h"
|
||||
#include "common/path.h"
|
||||
#include "common/string_util.h"
|
||||
#include "controller.h"
|
||||
#include "cpu_code_cache.h"
|
||||
@ -34,7 +35,7 @@ HostInterface::HostInterface()
|
||||
g_host_interface = this;
|
||||
|
||||
// we can get the program directory at construction time
|
||||
m_program_directory = FileSystem::GetPathDirectory(FileSystem::GetProgramPath());
|
||||
m_program_directory = Path::GetDirectory(FileSystem::GetProgramPath());
|
||||
}
|
||||
|
||||
HostInterface::~HostInterface()
|
||||
@ -896,7 +897,7 @@ void HostInterface::SetUserDirectoryToProgramDirectory()
|
||||
if (program_path.empty())
|
||||
Panic("Failed to get program path.");
|
||||
|
||||
std::string program_directory(FileSystem::GetPathDirectory(program_path));
|
||||
std::string program_directory(Path::GetDirectory(program_path));
|
||||
if (program_directory.empty())
|
||||
Panic("Program path is not valid");
|
||||
|
||||
|
||||
@ -4,8 +4,9 @@
|
||||
#include "IconsFontAwesome5.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/easing.h"
|
||||
#include "common/lru_cache.h"
|
||||
#include "common/file_system.h"
|
||||
#include "common/lru_cache.h"
|
||||
#include "common/path.h"
|
||||
#include "common/string.h"
|
||||
#include "common/string_util.h"
|
||||
#include "common/timer.h"
|
||||
@ -999,7 +1000,6 @@ static ImGuiID s_enum_choice_button_id = 0;
|
||||
static s32 s_enum_choice_button_value = 0;
|
||||
static bool s_enum_choice_button_set = false;
|
||||
|
||||
|
||||
bool EnumChoiceButtonImpl(const char* title, const char* summary, s32* value_pointer,
|
||||
const char* (*to_display_name_function)(s32 value, void* opaque), void* opaque, u32 count,
|
||||
bool enabled, float height, ImFont* font, ImFont* summary_font)
|
||||
@ -1221,7 +1221,7 @@ static void PopulateFileSelectorItems()
|
||||
if (sep_pos != std::string::npos)
|
||||
{
|
||||
parent_path = s_file_selector_current_directory.substr(0, sep_pos);
|
||||
FileSystem::CanonicalizePath(parent_path, true);
|
||||
Path::Canonicalize(&parent_path);
|
||||
}
|
||||
|
||||
s_file_selector_items.emplace_back(ICON_FA_FOLDER_OPEN " <Parent Directory>", std::move(parent_path), false);
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
#include "common/byte_stream.h"
|
||||
#include "common/file_system.h"
|
||||
#include "common/log.h"
|
||||
#include "common/path.h"
|
||||
#include "common/shiftjis.h"
|
||||
#include "common/state_wrapper.h"
|
||||
#include "common/string_util.h"
|
||||
@ -655,7 +656,8 @@ static bool ImportSaveWithDirectoryFrame(DataArray* data, const char* filename,
|
||||
|
||||
static bool ImportRawSave(DataArray* data, const char* filename, const FILESYSTEM_STAT_DATA& sd)
|
||||
{
|
||||
std::string save_name(FileSystem::GetFileTitleFromPath(filename));
|
||||
const std::string display_name(FileSystem::GetDisplayNameFromPath(filename));
|
||||
std::string save_name(Path::GetFileTitle(filename));
|
||||
if (save_name.length() == 0)
|
||||
{
|
||||
Log_ErrorPrintf("Invalid filename: '%s'", filename);
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
#include "common/assert.h"
|
||||
#include "common/file_system.h"
|
||||
#include "common/log.h"
|
||||
#include "common/path.h"
|
||||
#include "system.h"
|
||||
#include "zlib.h"
|
||||
#include <cctype>
|
||||
@ -182,7 +183,7 @@ static bool LoadLibraryPSF(const char* path, bool use_pc_sp, u32 depth = 0)
|
||||
std::optional<std::string> lib_name(file.GetTagString("_lib"));
|
||||
if (lib_name.has_value())
|
||||
{
|
||||
const std::string lib_path(FileSystem::BuildRelativePath(path, lib_name.value()));
|
||||
const std::string lib_path(Path::BuildRelativePath(path, lib_name.value()));
|
||||
Log_InfoPrintf("Loading main parent PSF '%s'", lib_path.c_str());
|
||||
|
||||
// We should use the initial SP/PC from the **first** parent lib.
|
||||
@ -214,7 +215,7 @@ static bool LoadLibraryPSF(const char* path, bool use_pc_sp, u32 depth = 0)
|
||||
if (!lib_name.has_value())
|
||||
break;
|
||||
|
||||
const std::string lib_path(FileSystem::BuildRelativePath(path, lib_name.value()));
|
||||
const std::string lib_path(Path::BuildRelativePath(path, lib_name.value()));
|
||||
Log_InfoPrintf("Loading parent PSF '%s'", lib_path.c_str());
|
||||
if (!LoadLibraryPSF(lib_path.c_str(), false, depth + 1))
|
||||
{
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
#include "shadergen.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/gl/loader.h"
|
||||
#include "common/log.h"
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <glad.h>
|
||||
Log_SetChannel(ShaderGen);
|
||||
|
||||
ShaderGen::ShaderGen(HostDisplay::RenderAPI render_api, bool supports_dual_source_blend)
|
||||
: m_render_api(render_api), m_glsl(render_api != HostDisplay::RenderAPI::D3D11 && render_api != HostDisplay::RenderAPI::D3D12),
|
||||
: m_render_api(render_api),
|
||||
m_glsl(render_api != HostDisplay::RenderAPI::D3D11 && render_api != HostDisplay::RenderAPI::D3D12),
|
||||
m_supports_dual_source_blend(supports_dual_source_blend), m_use_glsl_interface_blocks(false)
|
||||
{
|
||||
if (m_glsl)
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
#include "common/iso_reader.h"
|
||||
#include "common/log.h"
|
||||
#include "common/make_array.h"
|
||||
#include "common/path.h"
|
||||
#include "common/state_wrapper.h"
|
||||
#include "common/string_util.h"
|
||||
#include "common/timestamp.h"
|
||||
#include "controller.h"
|
||||
#include "cpu_code_cache.h"
|
||||
#include "cpu_core.h"
|
||||
@ -705,8 +705,8 @@ std::unique_ptr<CDImage> OpenCDImage(const char* path, Common::Error* error, boo
|
||||
|
||||
if (check_for_patches)
|
||||
{
|
||||
const std::string ppf_filename(FileSystem::BuildRelativePath(
|
||||
path, FileSystem::ReplaceExtension(FileSystem::GetDisplayNameFromPath(path), "ppf")));
|
||||
const std::string ppf_filename(
|
||||
Path::BuildRelativePath(path, Path::ReplaceExtension(FileSystem::GetDisplayNameFromPath(path), "ppf")));
|
||||
if (FileSystem::FileExists(ppf_filename.c_str()))
|
||||
{
|
||||
media = CDImage::OverlayPPFPatch(ppf_filename.c_str(), std::move(media));
|
||||
@ -1754,7 +1754,7 @@ static bool LoadEXEToRAM(const char* filename, bool patch_bios)
|
||||
|
||||
bool LoadEXE(const char* filename)
|
||||
{
|
||||
const std::string libps_path(FileSystem::BuildRelativePath(filename, "libps.exe"));
|
||||
const std::string libps_path(Path::BuildRelativePath(filename, "libps.exe"));
|
||||
if (!libps_path.empty() && FileSystem::FileExists(libps_path.c_str()) && !LoadEXEToRAM(libps_path.c_str(), false))
|
||||
{
|
||||
Log_ErrorPrintf("Failed to load libps.exe from '%s'", libps_path.c_str());
|
||||
@ -1951,7 +1951,7 @@ static std::unique_ptr<MemoryCard> GetMemoryCardForSlot(u32 slot, MemoryCardType
|
||||
case MemoryCardType::PerGameFileTitle:
|
||||
{
|
||||
const std::string display_name(FileSystem::GetDisplayNameFromPath(s_running_game_path));
|
||||
const std::string_view file_title(FileSystem::GetFileTitleFromPath(display_name));
|
||||
const std::string_view file_title(Path::GetFileTitle(display_name));
|
||||
if (file_title.empty())
|
||||
{
|
||||
g_host_interface->AddFormattedOSDMessage(
|
||||
|
||||
Reference in New Issue
Block a user