diff --git a/project/jni/application/alienblaster/AndroidAppSettings.cfg b/project/jni/application/alienblaster/AndroidAppSettings.cfg index e2442d2b9..bcf660fb9 100644 --- a/project/jni/application/alienblaster/AndroidAppSettings.cfg +++ b/project/jni/application/alienblaster/AndroidAppSettings.cfg @@ -1,5 +1,5 @@ # The application settings for Android libSDL port -AppSettingVersion=12 +AppSettingVersion=15 LibSdlVersion=1.3 AppName="Alien Blaster" AppFullName=de.schwardtnet.alienblaster @@ -10,7 +10,9 @@ SdlVideoResize=y SdlVideoResizeKeepAspect=n NeedDepthBuffer=n AppUsesMouse=n +AppNeedsTwoButtonMouse=n AppNeedsArrowKeys=y +AppNeedsTextInput=y AppUsesJoystick=n AppHandlesJoystickSensitivity=n AppUsesMultitouch=n @@ -27,4 +29,5 @@ AppCflags='-O3' AppLdflags='' AppSubdirsBuild='' AppUseCrystaXToolchain=n +AppCmdline='' ReadmeText='^You can press "Home" now - the data will be downloaded in background^In game press "Menu" for secondary fire, "Volume Up/Down" to cycle weapons' diff --git a/project/jni/application/fheroes2/AndroidAppSettings.cfg b/project/jni/application/fheroes2/AndroidAppSettings.cfg index b6f2e3f30..012ce26ed 100644 --- a/project/jni/application/fheroes2/AndroidAppSettings.cfg +++ b/project/jni/application/fheroes2/AndroidAppSettings.cfg @@ -21,8 +21,8 @@ RedefinedKeys="LCTRL m t h e" AppTouchscreenKeyboardKeysAmount=0 AppTouchscreenKeyboardKeysAmountAutoFire=0 MultiABI=n -AppVersionCode=208303 -AppVersionName="2083.03" +AppVersionCode=209404 +AppVersionName="2094.04" CompiledLibraries="sdl_net sdl_mixer sdl_image sdl_ttf png intl" CustomBuildScript=n AppCflags='-finline-functions -O2 -DWITH_ZLIB -DWITH_MIXER -DWITH_XML -DWITH_IMAGE -DWITH_TTF -DBUILD_RELEASE' diff --git a/project/jni/application/openttd/AndroidAppSettings.cfg b/project/jni/application/openttd/AndroidAppSettings.cfg index 3c4ce1bbd..b420b5152 100644 --- a/project/jni/application/openttd/AndroidAppSettings.cfg +++ b/project/jni/application/openttd/AndroidAppSettings.cfg @@ -21,8 +21,8 @@ RedefinedKeys="LALT RETURN KP_PLUS KP_MINUS SPACE DELETE" AppTouchscreenKeyboardKeysAmount=0 AppTouchscreenKeyboardKeysAmountAutoFire=0 MultiABI=n -AppVersionCode=10505 -AppVersionName="1.0.5.05" +AppVersionCode=10506 +AppVersionName="1.0.5.06" CompiledLibraries="jpeg png freetype timidity lzma lzo2" CustomBuildScript=y AppCflags='' diff --git a/project/jni/application/src b/project/jni/application/src index 59d41f41e..4de17cd97 120000 --- a/project/jni/application/src +++ b/project/jni/application/src @@ -1 +1 @@ -fheroes2 \ No newline at end of file +alienblaster \ No newline at end of file diff --git a/project/jni/sdl-1.3/src/video/android/SDL_androidinput.c b/project/jni/sdl-1.3/src/video/android/SDL_androidinput.c index 98fa3d504..bacd4f3a5 100644 --- a/project/jni/sdl-1.3/src/video/android/SDL_androidinput.c +++ b/project/jni/sdl-1.3/src/video/android/SDL_androidinput.c @@ -133,8 +133,19 @@ void UpdateScreenUnderFingerRect(int x, int y) JNIEXPORT void JNICALL JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMouse) ( JNIEnv* env, jobject thiz, jint x, jint y, jint action, jint pointerId, jint force, jint radius ) { +#if SDL_VERSION_ATLEAST(1,3,0) + + SDL_Window * window = SDL_GetFocusWindow(); + if( !window ) + return; + +#define SDL_ANDROID_sFakeWindowWidth window->w +#define SDL_ANDROID_sFakeWindowHeight window->h + +#else if( !SDL_CurrentVideoSurface ) return; +#endif if(pointerId < 0) pointerId = 0; if(pointerId > MAX_MULTITOUCH_POINTERS) @@ -146,16 +157,8 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMouse) ( JNIEnv* env, jobject thiz, j #if SDL_VIDEO_RENDER_RESIZE // Translate mouse coordinates -#if SDL_VERSION_ATLEAST(1,3,0) - SDL_Window * window = SDL_GetFocusWindow(); - if( window && window->renderer->window ) { - x = x * window->w / window->display->desktop_mode.w; - y = y * window->h / window->display->desktop_mode.h; - } -#else x = x * SDL_ANDROID_sFakeWindowWidth / SDL_ANDROID_sWindowWidth; y = y * SDL_ANDROID_sFakeWindowHeight / SDL_ANDROID_sWindowHeight; -#endif #endif @@ -301,8 +304,11 @@ static int processAndroidTrackball(int key, int action); JNIEXPORT void JNICALL JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeKey) ( JNIEnv* env, jobject thiz, jint key, jint action ) { +#if SDL_VERSION_ATLEAST(1,3,0) +#else if( !SDL_CurrentVideoSurface ) return; +#endif if( isTrackballUsed ) if( processAndroidTrackball(key, action) ) return; @@ -332,8 +338,11 @@ static void updateOrientation ( float accX, float accY, float accZ ); JNIEXPORT void JNICALL JAVA_EXPORT_NAME(AccelerometerReader_nativeAccelerometer) ( JNIEnv* env, jobject thiz, jfloat accPosX, jfloat accPosY, jfloat accPosZ ) { +#if SDL_VERSION_ATLEAST(1,3,0) +#else if( !SDL_CurrentVideoSurface ) return; +#endif // Calculate two angles from three coordinates - TODO: this is faulty! //float accX = atan2f(-accPosX, sqrtf(accPosY*accPosY+accPosZ*accPosZ) * ( accPosY > 0 ? 1.0f : -1.0f ) ) * M_1_PI * 180.0f; //float accY = atan2f(accPosZ, accPosY) * M_1_PI; @@ -350,8 +359,11 @@ JAVA_EXPORT_NAME(AccelerometerReader_nativeAccelerometer) ( JNIEnv* env, jobjec JNIEXPORT void JNICALL JAVA_EXPORT_NAME(AccelerometerReader_nativeOrientation) ( JNIEnv* env, jobject thiz, jfloat accX, jfloat accY, jfloat accZ ) { +#if SDL_VERSION_ATLEAST(1,3,0) +#else if( !SDL_CurrentVideoSurface ) return; +#endif updateOrientation (accX, accY, accZ); // TODO: make values in range 0.0:1.0 } @@ -1100,8 +1112,11 @@ extern void SDL_ANDROID_MainThreadPushKeyboardKey(int pressed, SDL_scancode key) ev->key.keysym.sym = key; ev->key.keysym.mod = KMOD_NONE; ev->key.keysym.unicode = 0; +#if SDL_VERSION_ATLEAST(1,3,0) +#else if ( SDL_TranslateUNICODE ) ev->key.keysym.unicode = key; +#endif BufferedEventsEnd = nextEvent; SDL_mutexV(BufferedEventsMutex); @@ -1153,7 +1168,7 @@ extern void SDL_ANDROID_MainThreadPushMultitouchButton(int id, int pressed, int SDL_Event * ev = &BufferedEvents[BufferedEventsEnd]; - ev->type = SDL_FINGERDOWN: + ev->type = SDL_FINGERDOWN; ev->tfinger.fingerId = id; ev->tfinger.state = pressed; ev->tfinger.x = x; @@ -1173,7 +1188,7 @@ extern void SDL_ANDROID_MainThreadPushMultitouchMotion(int id, int x, int y, int SDL_Event * ev = &BufferedEvents[BufferedEventsEnd]; - ev->type = SDL_FINGERMOTION: + ev->type = SDL_FINGERMOTION; ev->tfinger.fingerId = id; ev->tfinger.x = x; ev->tfinger.y = y; diff --git a/project/jni/sdl-1.3/src/video/android/SDL_androidvideo.c b/project/jni/sdl-1.3/src/video/android/SDL_androidvideo.c index 7ed09ac76..03ce4a82a 100644 --- a/project/jni/sdl-1.3/src/video/android/SDL_androidvideo.c +++ b/project/jni/sdl-1.3/src/video/android/SDL_androidvideo.c @@ -129,6 +129,9 @@ JAVA_EXPORT_NAME(DemoRenderer_nativeResize) ( JNIEnv* env, jobject thiz, jint { SDL_ANDROID_sRealWindowWidth = w; SDL_ANDROID_sRealWindowHeight = h; +#if SDL_VERSION_ATLEAST(1,3,0) + // Not supported in SDL 1.3 +#else if( keepRatio ) { // TODO: tweak that parameters when app calls SetVideoMode(), not here - app may request something else than 640x480, it's okay for most apps though @@ -147,9 +150,10 @@ JAVA_EXPORT_NAME(DemoRenderer_nativeResize) ( JNIEnv* env, jobject thiz, jint SDL_ANDROID_ForceClearScreenRect.y = SDL_ANDROID_sWindowHeight; SDL_ANDROID_ForceClearScreenRect.w = w; SDL_ANDROID_ForceClearScreenRect.h = SDL_ANDROID_sWindowHeight - h; // OpenGL vertical coord is inverted - } - } + } + } else +#endif { SDL_ANDROID_ForceClearScreenRect.w = 0; SDL_ANDROID_ForceClearScreenRect.h = 0;