Revert "(UWP/WinRT)"

This reverts commit b43b3e2bb0.
This commit is contained in:
Ghabry 2019-04-27 15:01:01 +02:00
parent b43b3e2bb0
commit 4390317992
8 changed files with 365 additions and 389 deletions

View File

@ -264,11 +264,6 @@ enum frontend_architecture frontend_uwp_get_architecture(void)
return FRONTEND_ARCH_NONE;
}
/* Disable the UWP VFS parts for ow */
#ifndef DISABLE_UWP_VFS
#define DISABLE_UWP_VFS
#endif
static int frontend_uwp_parse_drive_list(void *data, bool load_content)
{
#ifdef HAVE_MENU
@ -280,10 +275,8 @@ static int frontend_uwp_parse_drive_list(void *data, bool load_content)
char *home_dir = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
bool have_any_drives = false;
fill_pathname_home_dir(home_dir,
PATH_MAX_LENGTH * sizeof(char));
fill_pathname_home_dir(home_dir, PATH_MAX_LENGTH * sizeof(char));
#ifndef DISABLE_UWP_VFS
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++)
{
if (uwp_drive_exists(drive))
@ -296,7 +289,6 @@ static int frontend_uwp_parse_drive_list(void *data, bool load_content)
have_any_drives = true;
}
}
#endif
menu_entries_append_enum(list,
home_dir,
@ -304,7 +296,6 @@ static int frontend_uwp_parse_drive_list(void *data, bool load_content)
enum_idx,
FILE_TYPE_DIRECTORY, 0, 0);
#ifndef DISABLE_UWP_VFS
if (!have_any_drives)
{
menu_entries_append_enum(list,
@ -322,7 +313,6 @@ static int frontend_uwp_parse_drive_list(void *data, bool load_content)
MENU_SETTING_ACTION, 0, 0);
}
}
#endif
free(home_dir);
#endif

View File

@ -948,7 +948,9 @@ FILE
#include "../libretro-common/streams/file_stream_transforms.c"
#include "../libretro-common/streams/interface_stream.c"
#include "../libretro-common/streams/memory_stream.c"
#ifndef __WINRT__
#include "../libretro-common/vfs/vfs_implementation.c"
#endif
#include "../list_special.c"
#include "../libretro-common/string/stdstring.c"
#include "../libretro-common/file/nbio/nbio_stdio.c"

View File

@ -1197,20 +1197,3 @@ void fill_pathname_home_dir(char *s, size_t len)
#endif
}
#endif
bool is_path_accessible_using_standard_io(char *path)
{
#ifdef __WINRT__
bool result;
size_t path_sizeof = PATH_MAX_LENGTH * sizeof(char);
char *relative_path_abbrev = (char*)malloc(path_sizeof);
fill_pathname_abbreviate_special(relative_path_abbrev, path, path_sizeof);
result = strlen(relative_path_abbrev) >= 2 && (relative_path_abbrev[0] == ':' || relative_path_abbrev[0] == '~') && path_char_is_slash(relative_path_abbrev[1]);
free(relative_path_abbrev);
return result;
#else
return true;
#endif
}

View File

@ -498,8 +498,6 @@ bool path_is_valid(const char *path);
int32_t path_get_size(const char *path);
bool is_path_accessible_using_standard_io(char *path);
RETRO_END_DECLS
#endif

View File

@ -720,6 +720,17 @@ int retro_vfs_closedir_impl(libretro_vfs_implementation_dir *rdir)
return 0;
}
bool uwp_is_path_accessible_using_standard_io(char *path)
{
char *relative_path_abbrev = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
fill_pathname_abbreviate_special(relative_path_abbrev, path, PATH_MAX_LENGTH * sizeof(char));
bool result = strlen(relative_path_abbrev) >= 2 && (relative_path_abbrev[0] == ':' || relative_path_abbrev[0] == '~') && path_char_is_slash(relative_path_abbrev[1]);
free(relative_path_abbrev);
return result;
}
bool uwp_drive_exists(const char *path)
{
if (!path || !*path)

View File

@ -4277,12 +4277,16 @@ static int action_ok_open_uwp_permission_settings(const char *path,
static int action_ok_open_picker(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
/* TODO/FIXME - Disable file picker for now as long as VFS has problems */
#if 0
int ret;
#ifdef __WINRT__
char *new_path = uwp_trigger_picker();
if (!new_path)
return 0; /* User aborted */
#else
char *new_path = NULL;
retro_assert(false);
#endif
ret = generic_action_ok_displaylist_push(path, new_path,
msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES),
type, idx,
@ -4290,9 +4294,6 @@ static int action_ok_open_picker(const char *path,
free(new_path);
return ret;
#else
return 0;
#endif
}
static int action_ok_shader_pass(const char *path,

View File

@ -283,16 +283,7 @@
<None Include="RetroArch-UWP_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\libretro-common\vfs\vfs_implementation_uwp.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\libretro-common\vfs\vfs_implementation_uwp.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\uwp\uwp_func.h" />

View File

@ -629,7 +629,7 @@ static bool content_file_load(
#ifdef __WINRT__
/* TODO: When support for the 'actual' VFS is added, there will need to be some more logic here */
if (!system->supports_vfs && !is_path_accessible_using_standard_io(path))
if (!system->supports_vfs && !uwp_is_path_accessible_using_standard_io(path))
{
/* Fallback to a file copy into an accessible directory */
char* buf;
@ -648,7 +648,7 @@ static bool content_file_load(
if (!string_is_empty(content_ctx->directory_cache))
strlcpy(new_basedir, content_ctx->directory_cache, new_basedir_size);
if (string_is_empty(new_basedir) || !path_is_directory(new_basedir) || !is_path_accessible_using_standard_io(new_basedir))
if (string_is_empty(new_basedir) || !path_is_directory(new_basedir) || !uwp_is_path_accessible_using_standard_io(new_basedir))
{
RARCH_WARN("Tried copying to cache directory, but "
"cache directory was not set or found. "