[Scummvm-git-logs] scummvm master -> 6afae47470ff893650600341cc6c6e506081fe8d

antoniou79 a.antoniou79 at gmail.com
Mon Apr 12 12:06:02 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6afae47470 ANDROID: Add support for feature OSystem::kFeatureHiDPI


Commit: 6afae47470ff893650600341cc6c6e506081fe8d
    https://github.com/scummvm/scummvm/commit/6afae47470ff893650600341cc6c6e506081fe8d
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2021-04-12T15:05:34+03:00

Commit Message:
ANDROID: Add support for feature OSystem::kFeatureHiDPI

For testing purposes and feedback mostly

Also set the level for debug to 3, to get messages related to native resolution and scaling from the new hidpi gui scale code

Changed paths:
    backends/platform/android/android.cpp
    backends/platform/android/jni-android.cpp
    backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java


diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index e08464a8f5..8314293e17 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -321,6 +321,11 @@ void OSystem_Android::initBackend() {
 
 	_main_thread = pthread_self();
 
+	// TODO Setting debug level to 3, temporarily
+	//      only for catching the level 3 messages from the new (Apr 2021)
+	//      gui-scale (hidpi) code
+	gDebugLevel = 3;
+
 	// Warning: ConfMan.registerDefault() can be used for a Session of ScummVM
 	//          but:
 	//              1. The values will NOT persist to storage
@@ -447,7 +452,8 @@ bool OSystem_Android::hasFeature(Feature f) {
 		return false;
 	if (f == kFeatureVirtualKeyboard ||
 			f == kFeatureOpenUrl ||
-			f == kFeatureClipboardSupport) {
+			f == kFeatureClipboardSupport ||
+	                f == OSystem::kFeatureHiDPI) {
 		return true;
 	}
 	return ModularGraphicsBackend::hasFeature(f);
@@ -471,6 +477,8 @@ bool OSystem_Android::getFeatureState(Feature f) {
 	switch (f) {
 	case kFeatureVirtualKeyboard:
 		return _virtkeybd_on;
+	case OSystem::kFeatureHiDPI:
+		return true;
 	default:
 		return ModularGraphicsBackend::getFeatureState(f);
 	}
diff --git a/backends/platform/android/jni-android.cpp b/backends/platform/android/jni-android.cpp
index 7cbbf5e633..1d0e42ec99 100644
--- a/backends/platform/android/jni-android.cpp
+++ b/backends/platform/android/jni-android.cpp
@@ -228,7 +228,7 @@ void JNI::getDPI(float *values) {
 			env->ReleaseFloatArrayElements(array, res, 0);
 		}
 	}
-
+	LOGD("JNI::getDPI() xdpi: %f, ydpi: %f", values[0], values[1]);
 	env->DeleteLocalRef(array);
 }
 
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index 072945fbae..426cb3dc98 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -928,6 +928,10 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
 		                                                        }
 		                                                    });
 
+		float[] dpiValues = new float[] { 0.0f, 0.0f };
+		_scummvm.getDPI(dpiValues);
+		Log.d(ScummVM.LOG_TAG, "Current xdpi: " + dpiValues[0] + " and ydpi: " + dpiValues[1]);
+
 		// Currently in release builds version string does not contain the revision info
 		// but in debug builds (daily builds) this should be there (see base/internal_version_h)
 		_currentScummVMVersion = new Version(_scummvm.getInstallingScummVMVersionInfo());




More information about the Scummvm-git-logs mailing list