Permalink
Browse files

Android: Call setDisplayParameters early with the display w/h in pixe…

…ls. Without this, was defaulting to 1x rendering on S8 which is silly.
  • Loading branch information...
hrydgard committed Nov 26, 2017
1 parent 2b271db commit a763fe4b95836425ea58ce5c03de87a2081f9cca
Showing with 14 additions and 6 deletions.
  1. +3 −1 Core/Config.cpp
  2. +11 −5 android/src/org/ppsspp/ppsspp/NativeActivity.java
@@ -433,7 +433,9 @@ static int DefaultInternalResolution() {
return 0;
#else
int longestDisplaySide = std::max(System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES));
return longestDisplaySide >= 1000 ? 2 : 1;
int scale = longestDisplaySide >= 1000 ? 2 : 1;
ILOG("Longest display side: %d pixels. Choosing scale %d", longestDisplaySide, scale);
return scale;
#endif
}
@@ -288,6 +288,8 @@ public void Initialize() {
// All other device types are treated the same.
}
isXperiaPlay = IsXperiaPlay();
String libraryDir = getApplicationLibraryDir(appInfo);
@@ -453,17 +455,21 @@ public void onCreate(Bundle savedInstanceState) {
shuttingDown = false;
registerCallbacks();
if (!initialized) {
Initialize();
initialized = true;
}
Display display = getWindowManager().getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
display.getMetrics(metrics);
densityDpi = metrics.densityDpi;
refreshRate = display.getRefreshRate();
// Set early to be able to set defaults when loading config for the first time. Like figuring out
// whether to start at 1x or 2x.
NativeApp.setDisplayParameters(metrics.widthPixels, metrics.heightPixels, (int)densityDpi, refreshRate);
if (!initialized) {
Initialize();
initialized = true;
}
// OK, config should be initialized, we can query for screen rotation.
updateScreenRotation("onCreate");
updateSustainedPerformanceMode();

0 comments on commit a763fe4

Please sign in to comment.