diff --git a/project/java/MainActivity.java b/project/java/MainActivity.java index 2eea706ee..acdf070cf 100644 --- a/project/java/MainActivity.java +++ b/project/java/MainActivity.java @@ -142,8 +142,6 @@ public class MainActivity extends Activity { _videoLayout.addView(_ad.getView()); _ad.getView().setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM | Gravity.RIGHT)); - _ad.getView().setFocusable(true); - _ad.getView().setFocusableInTouchMode(true); } setContentView(_videoLayout); @@ -265,9 +263,6 @@ public class MainActivity extends Activity { _videoLayout.addView(_ad.getView()); _ad.getView().setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.TOP | Gravity.RIGHT)); - _ad.getView().setFocusable(true); - _ad.getView().setFocusableInTouchMode(true); - _ad.getView().requestFocus(); } // Receive keyboard events DimSystemStatusBar.get().dim(_videoLayout); diff --git a/project/jni/application/ballfield/ballfield.cpp b/project/jni/application/ballfield/ballfield.cpp index 0a5e065df..a416d38f3 100644 --- a/project/jni/application/ballfield/ballfield.cpp +++ b/project/jni/application/ballfield/ballfield.cpp @@ -17,6 +17,8 @@ #include "SDL.h" #include "SDL_image.h" +#define fprintf(X, ...) __android_log_print(ANDROID_LOG_INFO, "Ballfield", __VA_ARGS__) +#define printf(...) __android_log_print(ANDROID_LOG_INFO, "Ballfield", __VA_ARGS__) /*---------------------------------------------------------- Definitions... diff --git a/project/jni/application/commandergenius/commandergenius b/project/jni/application/commandergenius/commandergenius index 023025901..d1b8a7ae0 160000 --- a/project/jni/application/commandergenius/commandergenius +++ b/project/jni/application/commandergenius/commandergenius @@ -1 +1 @@ -Subproject commit 023025901a1d96a46d826791bf9cf264ddf5c9ee +Subproject commit d1b8a7ae03b1a0960722abbab38bbb8fca98e7cd diff --git a/project/jni/application/test-advertisements/AndroidAppSettings.cfg b/project/jni/application/test-advertisements/AndroidAppSettings.cfg index 3922aeeff..892dfa4dc 100644 --- a/project/jni/application/test-advertisements/AndroidAppSettings.cfg +++ b/project/jni/application/test-advertisements/AndroidAppSettings.cfg @@ -3,7 +3,7 @@ AppSettingVersion=17 LibSdlVersion=1.2 AppName="Admob test" AppFullName=ws.openarena.sdl -ScreenOrientation=v +ScreenOrientation=h InhibitSuspend=y AppDataDownloadUrl="Game data is 1 Mb|ballfield2.zip" VideoDepthBpp=16 @@ -23,7 +23,7 @@ ForceRelativeMouseMode=n AppNeedsArrowKeys=n AppNeedsTextInput=y AppUsesJoystick=n -AppHandlesJoystickSensitivity=n +AppUsesAccelerometer=n AppUsesMultitouch=y NonBlockingSwapBuffers=n RedefinedKeys="SPACE RETURN NO_REMAP NO_REMAP SPACE ESCAPE" diff --git a/project/jni/application/test-advertisements/ballfield.cpp b/project/jni/application/test-advertisements/ballfield.cpp index 9c3b974ac..843d47283 100644 --- a/project/jni/application/test-advertisements/ballfield.cpp +++ b/project/jni/application/test-advertisements/ballfield.cpp @@ -18,13 +18,15 @@ #include "SDL_image.h" #include "SDL_android.h" +#define fprintf(X, ...) __android_log_print(ANDROID_LOG_INFO, "Ballfield", __VA_ARGS__) +#define printf(...) __android_log_print(ANDROID_LOG_INFO, "Ballfield", __VA_ARGS__) /*---------------------------------------------------------- Definitions... ----------------------------------------------------------*/ -#define SCREEN_W 480 -#define SCREEN_H 800 +#define SCREEN_W 800 +#define SCREEN_H 480 #define BALLS 300 @@ -638,51 +640,17 @@ int main(int argc, char* argv[]) return 0; } if(evt.type == SDL_MOUSEBUTTONUP || evt.type == SDL_MOUSEBUTTONDOWN) - { __android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL mouse button event: evt %s state %s button %d coords %d:%d", evt.type == SDL_MOUSEBUTTONUP ? "UP " : "DOWN" , evt.button.state == SDL_PRESSED ? "PRESSED " : "RELEASED", (int)evt.button.button, (int)evt.button.x, (int)evt.button.y); - if(evt.key.keysym.sym == SDLK_ESCAPE) - return 0; - } - if(evt.type == SDL_VIDEORESIZE) - __android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL resize event: %d x %d", evt.resize.w, evt.resize.h); - if(evt.type == SDL_ACTIVEEVENT) - __android_log_print(ANDROID_LOG_INFO, "Ballfield", "======= SDL active event: gain %d state %d", evt.active.gain, evt.active.state); - /* - if( evt.type == SDL_ACTIVEEVENT && evt.active.gain == 0 && evt.active.state & SDL_APPACTIVE ) - { - // We've lost GL context, we are not allowed to do any GFX output here, or app will crash! - while( 1 ) - { - SDL_PollEvent(&evt); - if( evt.type == SDL_ACTIVEEVENT && evt.active.gain && evt.active.state & SDL_APPACTIVE ) - { - __android_log_print(ANDROID_LOG_INFO, "Ballfield", "======= SDL active event: gain %d state %d", evt.active.gain, evt.active.state); - SDL_Flip(SDL_GetVideoSurface()); // One SDL_Flip() call is required here to restore OpenGL context - // Re-load all textures, matrixes and all other GL states if we're in SDL+OpenGL mode - // Re-load all images to SDL_Texture if we're using it - // Now we can draw - break; - } - // Process network stuff, maybe play some sounds using SDL_ANDROID_PauseAudioPlayback() / SDL_ANDROID_ResumeAudioPlayback() - SDL_Delay(300); - __android_log_print(ANDROID_LOG_INFO, "Ballfield", "Waiting"); - } - } - */ - if( evt.type == SDL_JOYAXISMOTION ) - { - if( evt.jaxis.which == 0 ) // 0 = The accelerometer - continue; - int joyid = evt.jaxis.which - 1; - touchPointers[joyid][evt.jaxis.axis] = evt.jaxis.value; // Axis 0 and 1 are coordinates, 2 and 3 are pressure and touch point radius - } if( evt.type == SDL_JOYBUTTONDOWN || evt.type == SDL_JOYBUTTONUP ) + touchPointers[evt.jbutton.button][PTR_PRESSED] = (evt.jbutton.state == SDL_PRESSED); + if( evt.type == SDL_JOYBALLMOTION ) { - if( evt.jbutton.which == 0 ) // 0 = The accelerometer - continue; - int joyid = evt.jbutton.which - 1; - touchPointers[joyid][PTR_PRESSED] = (evt.jbutton.state == SDL_PRESSED); + touchPointers[evt.jball.ball][0] = evt.jball.xrel; + touchPointers[evt.jball.ball][1] = evt.jball.yrel; } + if( evt.type == SDL_JOYAXISMOTION ) + if(evt.jaxis.axis >= 4) + touchPointers[evt.jaxis.axis - 4][2] = evt.jaxis.value; } /* Animate */