diff --git a/project/java/Video.java b/project/java/Video.java index 7a29449e0..a33b861f4 100644 --- a/project/java/Video.java +++ b/project/java/Video.java @@ -1163,14 +1163,19 @@ class DemoGLSurfaceView extends GLSurfaceView_SDL { if (DifferentTouchInput.capturedMouseY >= this.getHeight()) DifferentTouchInput.capturedMouseY = this.getHeight() - 1; - //Log.v("SDL", "DemoGLSurfaceView::onCapturedPointerEvent(): X " + DifferentTouchInput.capturedMouseX + " Y " + DifferentTouchInput.capturedMouseY + + //Log.v("SDL", "SDL DemoGLSurfaceView::onCapturedPointerEvent(): X " + DifferentTouchInput.capturedMouseX + " Y " + DifferentTouchInput.capturedMouseY + // " W " + this.getWidth() + " H " + this.getHeight() + " getX " + event.getX() + " getY " + event.getY() + // " RelX " + event.getAxisValue(MotionEvent.AXIS_RELATIVE_X) + " RelY " + event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y) ); event.setLocation(DifferentTouchInput.capturedMouseX, DifferentTouchInput.capturedMouseY); event.setAction(MotionEvent.ACTION_HOVER_MOVE); - //Log.v("SDL", "DemoGLSurfaceView::onCapturedPointerEvent(): XY " + event.getX() + " " + event.getY() + " action " + event.getAction()); + int scrollX = Math.round(event.getAxisValue(MotionEvent.AXIS_HSCROLL)); + int scrollY = Math.round(event.getAxisValue(MotionEvent.AXIS_VSCROLL)); + if (scrollX != 0 || scrollY != 0) + DemoGLSurfaceView.nativeMouseWheel(scrollX, scrollY); + + //Log.v("SDL", "DemoGLSurfaceView::onCapturedPointerEvent(): XY " + event.getX() + " " + event.getY() + " action " + event.getAction() + " scroll " + scrollX + " " + scrollY); return this.onTouchEvent(event); } diff --git a/project/jni/application/ballfield/ballfield.c b/project/jni/application/ballfield/ballfield.c index bd3c1e5ff..6fb0a6965 100644 --- a/project/jni/application/ballfield/ballfield.c +++ b/project/jni/application/ballfield/ballfield.c @@ -23,8 +23,6 @@ #define fprintf(X, ...) __android_log_print(ANDROID_LOG_INFO, "Ballfield", __VA_ARGS__) #define printf(...) __android_log_print(ANDROID_LOG_INFO, "Ballfield", __VA_ARGS__) -extern int create_server_socket(int portno); - /*---------------------------------------------------------- Definitions... @@ -716,6 +714,22 @@ int main(int argc, char* argv[]) 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.type == SDL_MOUSEBUTTONDOWN && evt.button.button == SDL_BUTTON_WHEELDOWN) + { + y_offs += 10000; + } + if (evt.type == SDL_MOUSEBUTTONDOWN && evt.button.button == SDL_BUTTON_WHEELUP) + { + y_offs -= 10000; + } + if (evt.type == SDL_MOUSEBUTTONDOWN && evt.button.button == SDL_BUTTON_X1) + { + x_offs += 10000; + } + if (evt.type == SDL_MOUSEBUTTONDOWN && evt.button.button == SDL_BUTTON_X2) + { + x_offs -= 10000; + } } if(evt.type == SDL_VIDEORESIZE) __android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL resize event: %d x %d", evt.resize.w, evt.resize.h); diff --git a/project/jni/application/openttd/src b/project/jni/application/openttd/src index 40f573cb9..dcacc5850 160000 --- a/project/jni/application/openttd/src +++ b/project/jni/application/openttd/src @@ -1 +1 @@ -Subproject commit 40f573cb9188937a73649c0164f123bf93dc231d +Subproject commit dcacc5850f13f3580bd759481e81d892062a8b89