mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Fallback to app0:
This commit is contained in:
parent
6f7c7c557a
commit
d9b2bde2f6
@ -589,7 +589,21 @@ SDL_RWFromFile(const char *file, const char *mode)
|
|||||||
rwops->write = windows_file_write;
|
rwops->write = windows_file_write;
|
||||||
rwops->close = windows_file_close;
|
rwops->close = windows_file_close;
|
||||||
rwops->type = SDL_RWOPS_WINFILE;
|
rwops->type = SDL_RWOPS_WINFILE;
|
||||||
|
#elif defined(__VITA__)
|
||||||
|
/* Try to open the file on the filesystem first */
|
||||||
|
FILE *fp = fopen(file, mode);
|
||||||
|
if (fp) {
|
||||||
|
return SDL_RWFromFP(fp, 1);
|
||||||
|
} else {
|
||||||
|
/* Try opening it from app0:/ container if it's a relative path */
|
||||||
|
char path[4096];
|
||||||
|
SDL_snprintf(path, 4096, "app0:/%s", file);
|
||||||
|
fp = fopen(path, mode);
|
||||||
|
if (fp) {
|
||||||
|
return SDL_RWFromFP(fp, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SDL_SetError("Couldn't open %s", file);
|
||||||
#elif HAVE_STDIO_H
|
#elif HAVE_STDIO_H
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
Loading…
Reference in New Issue
Block a user