Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Replace Java INI parser with C++ INI parser #8941

Merged
merged 3 commits into from Sep 6, 2020

Conversation

JosJuice
Copy link
Member

@JosJuice JosJuice commented Jul 7, 2020

Fixes https://bugs.dolphin-emu.org/issues/12096 and opens up for future improvements.

I had to touch a lot of the settings code in the second commit, so testing is needed to make sure that all the settings still work correctly, in particular per-game Wii controller settings.

@JosJuice JosJuice force-pushed the android-ini branch 7 times, most recently from 939f56c to 5bad69e Compare July 8, 2020 12:59
@JosJuice JosJuice force-pushed the android-ini branch 6 times, most recently from aec9e0c to 7b8ae75 Compare July 19, 2020 13:33
@Ebola16
Copy link
Member

Ebola16 commented Jul 20, 2020

Changing emulated Wii Remote's extension doesn't update the displayed "Extension", however the proper selection is saved. This problem is visible when backing out of a changed extension submenu or changing the value to "None" from a different value.

@JosJuice
Copy link
Member Author

Thanks! It should be fixed now.

@JosJuice JosJuice force-pushed the android-ini branch 6 times, most recently from 2da3861 to 58d9b81 Compare July 22, 2020 20:35
@JosJuice JosJuice force-pushed the android-ini branch 2 times, most recently from 7058bbd to cea5e24 Compare August 3, 2020 15:34
@Ebola16
Copy link
Member

Ebola16 commented Aug 7, 2020

I'll test this again when rebased.

Copy link
Member

@Ebola16 Ebola16 left a comment

Choose a reason for hiding this comment

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

I like the premise of this PR. Gave it a first pass but I'll need to look at this again later.

  • Shouldn't we have getType() overrides in InvertedCheckBoxSetting and PercentSliderSetting?

The following issue also occur on master but it may be a good idea to address it in this PR. If this is too much work for this PR, feel free to ignore it:

  • Can you make FilePicker paths work with game-specific settings? That would be useful for switching SD paths for modded games.

@JosJuice
Copy link
Member Author

Shouldn't we have getType() overrides in InvertedCheckBoxSetting and PercentSliderSetting?

I thought there was no need to report a different type for those two since they use the same ViewHolder as their parents and otherwise behave identically to their parents as far as outside observers can tell (without looking at how they load and save to the settings store). Is there are reason why they should report different values from their parents?

Can you make FilePicker paths work with game-specific settings? That would be useful for switching SD paths for modded games.

This is why I thought it would make sense for PR #9014 to stay open :)

The first commit of PR #8975 should fix this. I think I'm going to split that commit out to a separate PR once this PR is merged, but I could do it even earlier (which would require some conflict resolution) if you want me to.

@Ebola16
Copy link
Member

Ebola16 commented Aug 10, 2020

I thought there was no need to report a different type for those two since they use the same ViewHolder as their parents and otherwise behave identically to their parents as far as outside observers can tell (without looking at how they load and save to the settings store). Is there are reason why they should report different values from their parents?

We override getType() in IntSliderSetting and FloatSliderSetting so it seemed strange that we didn't for PercentSliderSetting. I can't test removing the override for all of those files right now but it may be possible since they all inherit from SliderSetting.

This is why I thought it would make sense for PR #9014 to stay open :)
The first commit of PR #8975 should fix this. I think I'm going to split that commit out to a separate PR once this PR is merged, but I could do it even earlier (which would require some conflict resolution) if you want me to.

I'm fine with fixing that issue outside of this PR. I'll look at #8975 again once this one is merged. I'm also fine with splitting #8975 but I'd rather not be the one who splits your PR. It is a large and somewhat complex PR so reviewing my changes to code you've already written may not be the best use of your time.

@JosJuice
Copy link
Member Author

We override getType() in IntSliderSetting and FloatSliderSetting so it seemed strange that we didn't for PercentSliderSetting. I can't test removing the override for all of those files right now but it may be possible since they all inherit from SliderSetting.

You're right, that is inconsistent. I'll remove it from IntSliderSetting and FloatSliderSetting.

I'm also fine with splitting #8975 but I'd rather not be the one who splits your PR. It is a large and somewhat complex PR so reviewing my changes to code you've already written may not be the best use of your time.

Yes, I will be splitting it myself.

Copy link
Member

@Ebola16 Ebola16 left a comment

Choose a reason for hiding this comment

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

The following issue also occurs on master but it may be a good idea to address it in this PR:

  1. Clear Game Settings for your chosen game.
  2. Emulate "Wii Remote 1" and change the extension.
  3. Save settings.
  4. Return to the "Wii Remote 1" submenu and note that the previously changed extension is correctly displayed.
  5. Press back
  6. Emulate "Wii Remote 2"
  7. Note that the extension is incorrectly displayed as the same extension as "Wii Remote 1"
  8. Changing the "Wii Remote 2" extension or backing out of game-specific settings will cause the correct extension to be displayed again.

R.string.wiimote_scanning_description, true));
sl.add(new CheckBoxSetting(SettingsFile.FILE_NAME_DOLPHIN, Settings.SECTION_INI_CORE,
SettingsFile.KEY_WIIMOTE_SPEAKER, R.string.wiimote_speaker,
R.string.wiimote_speaker_description, true));
Copy link
Member

Choose a reason for hiding this comment

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

When Dolphin.ini is created, WiimoteContinuousScanning and WiimoteEnableSpeaker default to false. Should the defaults be false here too?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is fixed in PR #8975, but in case you want the fix early, I've submitted it as PR #9024.

@JosJuice
Copy link
Member Author

The code for the per-game extension setting is a big mess and I'd rather not touch it more in this PR than I already have.

Copy link
Member

@Ebola16 Ebola16 left a comment

Choose a reason for hiding this comment

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

The code for the per-game extension setting is a big mess and I'd rather not touch it more in this PR than I already have.

That's fine.

Tested one setting from each of our settings model views, both as a general setting and a game-specific setting. Per-game Wii controller settings don’t appear to be made worse but I’ll be able to better test them in #8894. Appears to fix the issue mentioned in this PR. Visually reviewed the rest of the changes.

Copy link
Member

@BhaaLseN BhaaLseN left a comment

Choose a reason for hiding this comment

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

Code LGTM

@JMC47 JMC47 merged commit a390640 into dolphin-emu:master Sep 6, 2020
10 checks passed
@JosJuice JosJuice deleted the android-ini branch September 6, 2020 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants