From c4780d2befd15dbd66ac54de4a18f29fbc7acd93 Mon Sep 17 00:00:00 2001 From: athrxx Date: Mon, 6 Jan 2020 23:17:19 +0100 Subject: GRAPHICS: Fix screen shake x/y offsets scaling The x and y offsets need to be scaled the same way as the rest of the screen output. --- backends/graphics/windowed.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'backends') diff --git a/backends/graphics/windowed.h b/backends/graphics/windowed.h index 40fbe8baf7..bea4522d5a 100644 --- a/backends/graphics/windowed.h +++ b/backends/graphics/windowed.h @@ -405,9 +405,9 @@ private: width = fracToInt(height * displayAspect); } } - - drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset; - drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset; + + drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset * _windowWidth / getWidth(); + drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset * _windowHeight / getHeight(); drawRect.setWidth(width); drawRect.setHeight(height); } -- cgit v1.2.3 From 2f919d39e4b9ae0cb1f66b97b29a00525619b4c1 Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 8 Jan 2020 17:28:59 +0100 Subject: GRAPHICS: (really) fix screen shake x/y offsets I confused window w/h with actual drawing w/h. And obviously forgot to test stretch modes like "Center". Now these modes also seem to work pixel exact... --- backends/graphics/windowed.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends') diff --git a/backends/graphics/windowed.h b/backends/graphics/windowed.h index bea4522d5a..99115275de 100644 --- a/backends/graphics/windowed.h +++ b/backends/graphics/windowed.h @@ -406,8 +406,8 @@ private: } } - drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset * _windowWidth / getWidth(); - drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset * _windowHeight / getHeight(); + drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset * width / getWidth(); + drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset * height / getHeight(); drawRect.setWidth(width); drawRect.setHeight(height); } -- cgit v1.2.3 From 97c3ac5c2c92cd452bcfc905d1f56b20445dee84 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Sun, 13 Oct 2019 18:58:57 +0100 Subject: ANDROID: Hide the system mouse cursor on Android N --- .../org/scummvm/scummvm/ScummVMActivity.java | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'backends') diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java index f55639f60b..20fa482b66 100644 --- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java +++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java @@ -21,6 +21,7 @@ import android.view.View; import android.view.SurfaceView; import android.view.SurfaceHolder; import android.view.MotionEvent; +import android.view.PointerIcon; import android.view.inputmethod.InputMethodManager; import android.widget.ImageView; import android.widget.Toast; @@ -403,13 +404,19 @@ public class ScummVMActivity extends Activity { } private void showMouseCursor(boolean show) { - /* Currently hiding the system mouse cursor is only - supported on OUYA. If other systems provide similar - intents, please add them here as well */ - Intent intent = - new Intent(show? - "tv.ouya.controller.action.SHOW_CURSOR" : - "tv.ouya.controller.action.HIDE_CURSOR"); - sendBroadcast(intent); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + SurfaceView main_surface = (SurfaceView)findViewById(R.id.main_surface); + int type = show ? PointerIcon.TYPE_DEFAULT : PointerIcon.TYPE_NULL; + main_surface.setPointerIcon(PointerIcon.getSystemIcon(this, type)); + } else { + /* Currently hiding the system mouse cursor is only + supported on OUYA. If other systems provide similar + intents, please add them here as well */ + Intent intent = + new Intent(show? + "tv.ouya.controller.action.SHOW_CURSOR" : + "tv.ouya.controller.action.HIDE_CURSOR"); + sendBroadcast(intent); + } } } -- cgit v1.2.3