diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 491394324..e869e2915 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -159,9 +159,8 @@ if (ANDROID) dl z ${OPENSCENEGRAPH_LIBRARIES} - ${OSG_PLUGINS} + freetype jpeg - gif png ) endif (ANDROID) diff --git a/apps/openmw/android_main.c b/apps/openmw/android_main.c index 8cd69e8f0..344d3e871 100644 --- a/apps/openmw/android_main.c +++ b/apps/openmw/android_main.c @@ -1,3 +1,4 @@ +int stderr = 0; // Hack: fix linker error #ifdef __ANDROID__ #include "SDL_main.h" @@ -17,6 +18,8 @@ void releaseArgv(); int Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject obj) { + setenv("OPENMW_DECOMPRESS_TEXTURES", "1", 1); + SDL_Android_Init(env, cls); SDL_SetMainReady(); diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index ac891b980..109610b1e 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -290,7 +290,11 @@ private: }; #endif +#ifdef ANDROID +extern "C" int SDL_main(int argc, char**argv) +#else int main(int argc, char**argv) +#endif { #if defined(__APPLE__) setenv("OSG_GL_TEXTURE_STORAGE", "OFF", 0); diff --git a/components/sdlutil/sdlcursormanager.cpp b/components/sdlutil/sdlcursormanager.cpp index 411fb3694..c32891e37 100644 --- a/components/sdlutil/sdlcursormanager.cpp +++ b/components/sdlutil/sdlcursormanager.cpp @@ -16,7 +16,7 @@ #include "imagetosurface.hpp" -#ifdef OSG_LIBRARY_STATIC +#if defined(OSG_LIBRARY_STATIC) && !defined(ANDROID) // Sets the default windowing system interface according to the OS. // Necessary for OpenSceneGraph to do some things, like decompression. USE_GRAPHICSWINDOW() @@ -220,7 +220,9 @@ namespace SDLUtil void SDLCursorManager::createCursor(const std::string& name, int rotDegrees, osg::Image* image, Uint8 hotspot_x, Uint8 hotspot_y) { +#ifndef ANDROID _createCursorFromResource(name, rotDegrees, image, hotspot_x, hotspot_y); +#endif } void SDLCursorManager::_createCursorFromResource(const std::string& name, int rotDegrees, osg::Image* image, Uint8 hotspot_x, Uint8 hotspot_y)