early-access version 3685
This commit is contained in:
@@ -53,6 +53,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
<activity
|
||||
android:name="org.yuzu.yuzu_emu.activities.EmulationActivity"
|
||||
android:theme="@style/Theme.Yuzu.Main"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|uiMode"
|
||||
android:exported="true">
|
||||
|
@@ -85,20 +85,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
||||
onReturnFromSettings = context.activityResultRegistry.register(
|
||||
"SettingsResult",
|
||||
ActivityResultContracts.StartActivityForResult()
|
||||
) {
|
||||
binding.surfaceEmulation.setAspectRatio(
|
||||
when (IntSetting.RENDERER_ASPECT_RATIO.int) {
|
||||
0 -> Rational(16, 9)
|
||||
1 -> Rational(4, 3)
|
||||
2 -> Rational(21, 9)
|
||||
3 -> Rational(16, 10)
|
||||
4 -> null // Stretch
|
||||
else -> Rational(16, 9)
|
||||
}
|
||||
)
|
||||
emulationActivity?.buildPictureInPictureParams()
|
||||
updateScreenLayout()
|
||||
}
|
||||
) { updateScreenLayout() }
|
||||
} else {
|
||||
throw IllegalStateException("EmulationFragment must have EmulationActivity parent")
|
||||
}
|
||||
@@ -242,17 +229,6 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
||||
DirectoryInitialization.start(requireContext())
|
||||
}
|
||||
|
||||
binding.surfaceEmulation.setAspectRatio(
|
||||
when (IntSetting.RENDERER_ASPECT_RATIO.int) {
|
||||
0 -> Rational(16, 9)
|
||||
1 -> Rational(4, 3)
|
||||
2 -> Rational(21, 9)
|
||||
3 -> Rational(16, 10)
|
||||
4 -> null // Stretch
|
||||
else -> Rational(16, 9)
|
||||
}
|
||||
)
|
||||
|
||||
updateScreenLayout()
|
||||
|
||||
emulationState.run(emulationActivity!!.isActivityRecreated)
|
||||
@@ -315,7 +291,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
||||
}
|
||||
|
||||
@SuppressLint("SourceLockedOrientationActivity")
|
||||
private fun updateScreenLayout() {
|
||||
private fun updateOrientation() {
|
||||
emulationActivity?.let {
|
||||
it.requestedOrientation = when (IntSetting.RENDERER_SCREEN_LAYOUT.int) {
|
||||
Settings.LayoutOption_MobileLandscape ->
|
||||
@@ -326,7 +302,21 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
||||
else -> ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
||||
}
|
||||
}
|
||||
onConfigurationChanged(resources.configuration)
|
||||
}
|
||||
|
||||
private fun updateScreenLayout() {
|
||||
binding.surfaceEmulation.setAspectRatio(
|
||||
when (IntSetting.RENDERER_ASPECT_RATIO.int) {
|
||||
0 -> Rational(16, 9)
|
||||
1 -> Rational(4, 3)
|
||||
2 -> Rational(21, 9)
|
||||
3 -> Rational(16, 10)
|
||||
4 -> null // Stretch
|
||||
else -> Rational(16, 9)
|
||||
}
|
||||
)
|
||||
emulationActivity?.buildPictureInPictureParams()
|
||||
updateOrientation()
|
||||
}
|
||||
|
||||
private fun updateFoldableLayout(
|
||||
@@ -359,7 +349,8 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
||||
binding.overlayContainer.layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT
|
||||
binding.inGameMenu.layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT
|
||||
isInFoldableLayout = false
|
||||
updateScreenLayout()
|
||||
updateOrientation()
|
||||
onConfigurationChanged(resources.configuration)
|
||||
}
|
||||
binding.emulationContainer.requestLayout()
|
||||
binding.inputContainer.requestLayout()
|
||||
|
@@ -15,7 +15,7 @@ namespace FileSys::SystemArchive {
|
||||
const static std::map<std::string, const std::map<const char*, const std::vector<u8>>&>
|
||||
tzdb_zoneinfo_dirs = {{"Africa", NxTzdb::africa},
|
||||
{"America", NxTzdb::america},
|
||||
{"Antartica", NxTzdb::antartica},
|
||||
{"Antarctica", NxTzdb::antarctica},
|
||||
{"Arctic", NxTzdb::arctic},
|
||||
{"Asia", NxTzdb::asia},
|
||||
{"Atlantic", NxTzdb::atlantic},
|
||||
|
@@ -849,8 +849,9 @@ static Result CreateCalendarTime(s64 time, int gmt_offset, CalendarTimeInternal&
|
||||
static Result ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time,
|
||||
CalendarTimeInternal& calendar_time,
|
||||
CalendarAdditionalInfo& calendar_additional_info) {
|
||||
if ((rules.go_ahead && time < rules.ats[0]) ||
|
||||
(rules.go_back && time > rules.ats[rules.time_count - 1])) {
|
||||
ASSERT(rules.go_ahead ? rules.time_count > 0 : true);
|
||||
if ((rules.go_back && time < rules.ats[0]) ||
|
||||
(rules.go_ahead && time > rules.ats[rules.time_count - 1])) {
|
||||
s64 seconds{};
|
||||
if (time < rules.ats[0]) {
|
||||
seconds = rules.ats[0] - time;
|
||||
|
Reference in New Issue
Block a user