[Android] Fix screen res check
This commit is contained in:
parent
b4505f2215
commit
d408190f87
|
@ -149,12 +149,10 @@ public class GameLifecycleHandler implements View.OnKeyListener, SurfaceHolder.C
|
||||||
mSurface = (GameSurface) mActivity.findViewById(R.id.gameSurface);
|
mSurface = (GameSurface) mActivity.findViewById(R.id.gameSurface);
|
||||||
mOverlay = (GameOverlay) mActivity.findViewById(R.id.gameOverlay);
|
mOverlay = (GameOverlay) mActivity.findViewById(R.id.gameOverlay);
|
||||||
|
|
||||||
float widthRatio = (float)AndroidDevice.nativeWidth/(float)AndroidDevice.nativeWidthOriginal;
|
float widthRatio = (float)AndroidDevice.nativeWidth/(float)AndroidDevice.nativeHeight;
|
||||||
float heightRatio = (float)AndroidDevice.nativeHeight/(float)AndroidDevice.nativeHeightOriginal;
|
|
||||||
int ScreenRes = NativeExports.SettingsLoadDword(SettingsID.FirstGfxSettings.getValue() + VideoSettingID.Set_Resolution.getValue());
|
int ScreenRes = NativeExports.SettingsLoadDword(SettingsID.FirstGfxSettings.getValue() + VideoSettingID.Set_Resolution.getValue());
|
||||||
|
int videoRenderWidth = Math.round(NativeVideo.GetScreenResHeight(ScreenRes) * widthRatio);
|
||||||
int videoRenderWidth = Math.round(NativeVideo.GetScreenResWidth(ScreenRes) * (ScreenRes == 0 ? 1 : widthRatio));
|
int videoRenderHeight = Math.round(NativeVideo.GetScreenResHeight(ScreenRes));
|
||||||
int videoRenderHeight = Math.round(NativeVideo.GetScreenResHeight(ScreenRes) * (ScreenRes == 0 ? 1 : heightRatio));
|
|
||||||
|
|
||||||
// Update screen res
|
// Update screen res
|
||||||
mSurface.getHolder().setFixedSize(videoRenderWidth, videoRenderHeight);
|
mSurface.getHolder().setFixedSize(videoRenderWidth, videoRenderHeight);
|
||||||
|
|
Loading…
Reference in New Issue