diff --git a/project/java/MainActivity.java b/project/java/MainActivity.java index 4cf7612ca..60e3b2e81 100644 --- a/project/java/MainActivity.java +++ b/project/java/MainActivity.java @@ -567,6 +567,7 @@ public class MainActivity extends Activity { } catch( UnsatisfiedLinkError e ) { + System.out.println("libSDL: error loading lib " + l + ": " + e.toString()); System.loadLibrary(l); } } diff --git a/project/java/Video.java b/project/java/Video.java index b81df8c85..79fc49c6c 100644 --- a/project/java/Video.java +++ b/project/java/Video.java @@ -323,14 +323,14 @@ abstract class DifferentTouchInput if( (device.getSources() & InputDevice.SOURCE_TOUCHPAD) != InputDevice.SOURCE_TOUCHPAD ) continue; System.out.println("libSDL: input device ID " + id + " type " + device.getSources() + " name " + device.getName() + " is a touchpad" ); - InputDevice.MotionRange range = device.getMotionRange(MotionEvent.AXIS_X, InputDevice.SOURCE_TOUCHPAD); + InputDevice.MotionRange range = device.getMotionRange(MotionEvent.AXIS_X /*, InputDevice.SOURCE_TOUCHPAD*/); if(range != null) { xmin = range.getMin(); xmax = range.getMax() - range.getMin(); System.out.println("libSDL: touch pad X range " + xmin + ":" + xmax ); } - range = device.getMotionRange(MotionEvent.AXIS_Y, InputDevice.SOURCE_TOUCHPAD); + range = device.getMotionRange(MotionEvent.AXIS_Y /*, InputDevice.SOURCE_TOUCHPAD*/); if(range != null) { ymin = range.getMin(); diff --git a/project/jni/application/commandergenius/AndroidAppSettings.cfg b/project/jni/application/commandergenius/AndroidAppSettings.cfg index 68518cd8f..c4e44a99e 100644 --- a/project/jni/application/commandergenius/AndroidAppSettings.cfg +++ b/project/jni/application/commandergenius/AndroidAppSettings.cfg @@ -36,7 +36,7 @@ FirstStartMenuOptions='' MultiABI=n AppVersionCode=40011 AppVersionName="0.4.0.11" -ResetSdlConfigForThisVersion=y +ResetSdlConfigForThisVersion=n DeleteFilesOnUpgrade="%" CompiledLibraries="tremor ogg" CustomBuildScript=n diff --git a/project/jni/physfs/Android.mk b/project/jni/physfs/Android.mk index dba1f47f4..fe72c519c 100644 --- a/project/jni/physfs/Android.mk +++ b/project/jni/physfs/Android.mk @@ -16,7 +16,7 @@ LOCAL_SRC_FILES := $(foreach F, $(APP_SUBDIRS), $(addprefix $(F)/,$(notdir $(wil LOCAL_STATIC_LIBRARIES := -LOCAL_SHARED_LIBRARIES := lzma +LOCAL_SHARED_LIBRARIES := LOCAL_LDLIBS := -lz diff --git a/project/jni/sdl-1.3/src/video/android/SDL_touchscreenkeyboard.c b/project/jni/sdl-1.3/src/video/android/SDL_touchscreenkeyboard.c index 5f862bca8..8bdbff98d 100644 --- a/project/jni/sdl-1.3/src/video/android/SDL_touchscreenkeyboard.c +++ b/project/jni/sdl-1.3/src/video/android/SDL_touchscreenkeyboard.c @@ -115,8 +115,7 @@ oldGlState; static inline void beginDrawingTex() { // Save OpenGL state - // TODO: this code does not work on 1.6 emulator, and on some devices - /* + // TODO: this code does not work on 1.6 emulator, and on some older devices oldGlState.texture2d = glIsEnabled(GL_TEXTURE_2D); glGetIntegerv(GL_TEXTURE_BINDING_2D, &oldGlState.textureId); glGetFloatv(GL_CURRENT_COLOR, &(oldGlState.color[0])); @@ -127,14 +126,12 @@ static inline void beginDrawingTex() glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &oldGlState.texFilter1); glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &oldGlState.texFilter2); // It's very unlikely that some app will use GL_TEXTURE_CROP_RECT_OES, so just skip it - */ glEnable(GL_TEXTURE_2D); } static inline void endDrawingTex() { - /* // Restore OpenGL state if( oldGlState.texture2d == GL_FALSE) glDisable(GL_TEXTURE_2D); @@ -146,9 +143,11 @@ static inline void endDrawingTex() glBlendFunc(oldGlState.blend1, oldGlState.blend2); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, oldGlState.texFilter1); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, oldGlState.texFilter2); - */ + + /* glDisable(GL_BLEND); glDisable(GL_TEXTURE_2D); + */ } static inline void drawCharTexFlip(GLTexture_t * tex, SDL_Rect * src, SDL_Rect * dest, int flipX, int flipY, Uint8 r, Uint8 g, Uint8 b, Uint8 a) diff --git a/readme.txt b/readme.txt index 5ccce359b..fc8507a50 100644 --- a/readme.txt +++ b/readme.txt @@ -102,18 +102,8 @@ Also make sure that your HW textures are not wider than 1024 pixels, or it will texture on HTC G1, and other low-end devices. Software surfaces may be of any size of course. If you want HW acceleration - just use OpenGL, that's the easiest and most cross-platform way, -however if you'll use on-screen keyboard (even the text input button) the OpenGL state will get -messed up after each frame - after each SDL_GL_SwapBuffers() you'll need to call: - -glEnable(GL_TEXTURE_2D); -glBindTexture(GL_TEXTURE_2D, your_texture_id); -glColor4f(1.0f, 1.0f, 1.0f, 1.0f); -glEnable(GL_BLEND); -glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); -glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - -Previously I've got the code to save/restore OpenGL state, but it doens't work on every device - -you may wish to uncomment it inside file SDL_touchscreenkeyboard.c in functions beginDrawingTex() and endDrawingTex(). +however note that on-screen keyboard (even the text input button) is also drawn using OpenGL, +so it might mess up your GL state (although it should not do that due to recent code changes). If you don't use on-screen keyboard you don't need to reinit OpenGL state - set following in AndroidAppSettings.cfg: AppNeedsArrowKeys=n