Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Separate Custom Layout options for Portrait and Landscape modes #192

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DavidRGriswold
Copy link
Contributor

@DavidRGriswold DavidRGriswold commented Jul 15, 2024

This implements some additional config.ini settings to enable separated Custom Layouts for portrait and landscape mode on android. This is the only reason I still use Citra MMJ.

I have tested it on my phone and it works perfectly, but I have not successfully been able to build a desktop version to see if this somehow breaks that, so let me know what else I might need to change to get this in!

The biggest worry I have: I used an #ifdef to declare these settings as existing for Android only in settings.h, but I'm not sure if that will have knock-on effects when those settings don't exist in other builds. Most clearly, I couldn't figure out how to only do the ReadBasicSetting and WriteBasicSetting calls for those settings on android only, so I'm concerned that will cause an issue on non-android devices when it tries to do those calls on non-declared settings. If somebody with a better understanding of the whole project could look at this before merging it, I'd appreciated it.

@DavidRGriswold
Copy link
Contributor Author

Okay, I updated having run clang-format and I removed the #ifdef flag around the settings declaration since the build output above did show that as a problem. i also reverted the device rotation commit on this branch so I could test, since it was crashing me. I still can't build locally (slowly working on getting that set up!) but we will see if this update passes the check now...

@DavidRGriswold DavidRGriswold changed the title Portrait custom Separate Custom Layout options for Portrait and Landscape modes Jul 16, 2024
@DavidRGriswold
Copy link
Contributor Author

Okay I got xcode all set up and the mac version builds fine for me after the latest commits. My qt-config.ini has all of the portrait mode layout stuff even though those aren't in the default config file code for the qt build, but I think that may be because this was a debug build by default or something? There were LOTS of options in there that are not normally there.

In the current iteration, all of the new settings (starting with custom_portrait_layout and custom_portrait_top_top) should only appear in the default config.ini for the android version, but the settings exist in all versions. I was getting c++ errors otherwise. But since the other versions should never be in portrait mode, they should be ignored.

Is it possible to make it so that those settings always get written (blank if unchanged) to the config.ini on android so that if a user installs the update it adds the documentation I included in the default ini file?

@rtiangha
Copy link
Contributor

@DavidRGriswold FYI, if you enable Github Actions on your fork (click on the Actions tab and turn it on), it'll automatically build things for all the OSes whenever you push a commit. That way, you can test things using Citra's build scripts without having to set up a local dev environment.

@DavidRGriswold
Copy link
Contributor Author

This finally satisfies clang-format. Not sure why just running the clang-format extension on VS Code didn't do it.

@PabloMK7 I hope you will consider merging this - it's a niche feature, but a useful one.

@rtiangha
Copy link
Contributor

I'm not sure how VS Code does things, but Citra code uses clang-format-15 (different projects may use a different format, for example Lime3DS switched to clang-format-18 so you need to double-check your code if you're porting between the two); if VS Code is applying a different version of clang-format, then that could be why.

@DavidRGriswold
Copy link
Contributor Author

I'm not sure how VS Code does things, but Citra code uses clang-format-15 (different projects may use a different format, for example Lime3DS switched to clang-format-18 so you need to double-check your code if you're porting between the two); if VS Code is applying a different version of clang-format, then that could be why.

any idea how to install two versions of clang-format? It does seem like I have version 18 installed.

@rtiangha
Copy link
Contributor

rtiangha commented Jul 18, 2024

I'm not familiar with the VS Code environment, but perhaps you could download a set of Clang Tools binaries from here:

https://github.com/muttleyxd/clang-tools-static-binaries

And then use this extension:

https://github.com/xaverh/vscode-clang-format

to point to the location of clang-format-15.exe. There might be some other (easier?) solutions as well; I only spent about 20 seconds on Google.

@@ -189,6 +189,18 @@ void Config::ReadValues() {
ReadSetting("Layout", Settings::values.cardboard_x_shift);
ReadSetting("Layout", Settings::values.cardboard_y_shift);

#ifdef ANDROID
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just remove this, the JNI code is only compiled on Android anyways

@@ -175,7 +175,17 @@ void Config::ReadValues() {
ReadSetting("Layout", Settings::values.custom_bottom_right);
ReadSetting("Layout", Settings::values.custom_bottom_bottom);
ReadSetting("Layout", Settings::values.custom_second_layer_opacity);

#ifdef ANDROID
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is only used in the desktop citra.exe (non-qt). There's no need for it and should be removed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants