hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.12k stars 2.16k forks source link

[Feature Request] Auto Landscape Rotation option #10708

Closed Leopard20 closed 6 years ago

Leopard20 commented 6 years ago

By auto landscape I mean automatic switch between landscape and inverted landscape modes as you flip the device upside down.

Florin9doi commented 6 years ago

setRequestedOrientation(SCREEN_ORIENTATION_SENSOR_LANDSCAPE); in android/src/org/ppsspp/ppsspp/NativeActivity.java should do it

Leopard20 commented 6 years ago

@hrydgard Thank you for trying to implement this. But what I meant was Landscape Auto, which is an automatic switch between Landscape and Landscape Reverse, but right now the Auto option cycles through all possible orientations, including portrait and portrait reverse. Another limitation: The option doesn't work if Autorotation is turned off through phone settings.

hrydgard commented 6 years ago

Yeah I eventually understood that. Florin9doi has contributed what you want in https://github.com/hrydgard/ppsspp/pull/10751 , just waiting for him to make a change.

If autorotation is turned off, there's nothing I can do to override it.

Leopard20 commented 6 years ago

Actually, I've seen plenty of games that work without autorotation on. I'm not sure how they do this though!

For example: GTA SA, Xash3D, Special Forces Group 2, etc.

That Xash3D I mentioned is actually open source, hosted on this very github. Maybe you could look at the source codes or ask the creator, a1batross.

Leopard20 commented 6 years ago

Here's the link: https://github.com/FWGS/xash3d-android-project

hrydgard commented 6 years ago

But that seems completely pointless? Presumably, if the user has disabled autorotation in the OS, they don't want the screen to rotate.

Leopard20 commented 6 years ago

You could be right. But personally I don't want my phone to change from Landscape to Portrait every time I make a ~50 degree rotation, which is inadvertent most of the time! But switching between Landscape and Landscape Reverse in games doesn't pose any inconveniences to me. Besides, it only reverses when I rotate the phone more than 90 degrees. That can't be inadvertent!

Also, since this new rotation option is called Landscape Auto, people who select it actually want their phone to rotate right?! 😉

Florin9doi commented 6 years ago

Landscape Auto don't requires to enable autorotation. It works the same as the games mentioned.

Leopard20 commented 6 years ago

@Florin9doi Thanks a lot!