author Sam Lantinga <>
Tue, 02 Apr 2013 07:57:37 -0700
changeset 7045 4be2c24b7de1
parent 6987 7084af936d82
permissions -rw-r--r--
Fixed bug 1780 - SDL_RWFromFile() sets an error on Android although a valid SDL_RWops pointer is returned.

Philipp Wiesemann

SDL_RWFromFile() sets an error to be queried with SDL_GetError() on Android although a valid SDL_RWops pointer is returned.

This happens if the fallback implemented in SDL_android.cpp is used to load compressed assets (see in section "Loading assets") and results in a message like " This file can not be opened as a file descriptor; it is probably compressed". I think this is confusing and not needed because the loading works as expected.

I attached a patch which changes SDL_android.cpp to not set an error if compressed assets are loaded. In this case also no Exception is queried and no additional string are created.
     2                          Simple DirectMedia Layer
     4                                   (SDL)
     6                                 Version 2.0
     8 ---
    11 This is the Simple DirectMedia Layer, a general API that provides low
    12 level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
    13 and 2D framebuffer across multiple platforms.
    15 The current version supports Windows, Mac OS X, Linux, FreeBSD,
    16 NetBSD, OpenBSD, BSD/OS, Solaris, iOS, and Android. The code contains
    17 support for other operating systems but those are not officially supported.
    19 SDL is written in C, but works with C++ natively, and has bindings to
    20 several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
    21 Go, Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
    22 Pike, Pliant, Python, Ruby, and Smalltalk.
    24 This library is distributed under the zlib license, which can be found
    25 in the file "COPYING".
    27 The best way to learn how to use SDL is to check out the header files in
    28 the "include" subdirectory and the programs in the "test" subdirectory.
    29 The header files and test programs are well commented and always up to date.
    30 More documentation and FAQs are available online at:
    33 If you need help with the library, or just want to discuss SDL related
    34 issues, you can join the developers mailing list:
    37 Enjoy!
    38 	Sam Lantinga				(