src/file/SDL_rwops.c
changeset 6629 8e2c731103e6
parent 6430 48d519500f7e
child 6633 e36b94438fcf
equal deleted inserted replaced
6628:7994e6979876 6629:8e2c731103e6
   425     if (!file || !*file || !mode || !*mode) {
   425     if (!file || !*file || !mode || !*mode) {
   426         SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
   426         SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
   427         return NULL;
   427         return NULL;
   428     }
   428     }
   429 #if defined(ANDROID)
   429 #if defined(ANDROID)
       
   430 #ifdef HAVE_STDIO_H
       
   431     /* Try to open the file on the filesystem first */
       
   432     {
       
   433         FILE *fp = fopen(file, mode);
       
   434         if (fp) {
       
   435             return SDL_RWFromFP(fp, 1);
       
   436         }
       
   437     }
       
   438 #endif
       
   439 
       
   440     /* Try to open the file from the asset system */
   430     rwops = SDL_AllocRW();
   441     rwops = SDL_AllocRW();
   431     if (!rwops)
   442     if (!rwops)
   432         return NULL;            /* SDL_SetError already setup by SDL_AllocRW() */
   443         return NULL;            /* SDL_SetError already setup by SDL_AllocRW() */
   433     if (Android_JNI_FileOpen(rwops, file, mode) < 0) {
   444     if (Android_JNI_FileOpen(rwops, file, mode) < 0) {
   434         SDL_FreeRW(rwops);
   445         SDL_FreeRW(rwops);