From d3748b81a9d17d537d7a34cdbef086df7cbcdbba Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 2 Nov 2012 00:35:48 -0700 Subject: [PATCH] Try opening the file path directly before hitting the asset system. --- src/file/SDL_rwops.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c index 83f692eaa..4a4cda23a 100644 --- a/src/file/SDL_rwops.c +++ b/src/file/SDL_rwops.c @@ -427,6 +427,17 @@ SDL_RWFromFile(const char *file, const char *mode) return NULL; } #if defined(ANDROID) +#ifdef HAVE_STDIO_H + /* Try to open the file on the filesystem first */ + { + FILE *fp = fopen(file, mode); + if (fp) { + return SDL_RWFromFP(fp, 1); + } + } +#endif + + /* Try to open the file from the asset system */ rwops = SDL_AllocRW(); if (!rwops) return NULL; /* SDL_SetError already setup by SDL_AllocRW() */