Commit graph

764 commits

Author SHA1 Message Date
Markus Wick
4a124868d6 Merge pull request #6034 from JonnyH/WIP/fix-android-null-SettingsSection-crash
Fix some Android UI crashes opening 'settings' menus
2017-09-10 11:11:51 +02:00
Lioncash
696e1b40b5 Common: Move version strings to their own header
Ideally Common.h wouldn't be a header in the Common library, and instead be renamed to something else, like PlatformCompatibility.h or something, but even then, there's still some things in the header that don't really fall under that label

This moves the version strings out to their own version header that doesn't dump a bunch of other unrelated things into scope, like what Common.h was doing.

This also places them into the Common namespace, as opposed to letting them sit in the global namespace.
2017-09-09 19:28:10 -04:00
JosJuice
7fa20cb1be Remove trailing spaces from Android files
Android Studio wants to correct these automatically when editing files.
2017-09-09 11:34:28 +02:00
Jonathan Hamilton
ec96a5d8bc Android UI: remove some unnecessary null pointer catches
These can no longer happen during 'normal' use (IE if the setting was
missing)
2017-09-08 10:11:04 -07:00
Jonathan Hamilton
3f247eefae Android SettingsFragmentParser - remove ad-hoc SettingSection construction
Now the SettingsSection map constructs a new SettingsSection at .get()
time, these are no longer needed
2017-09-08 10:06:53 -07:00
Jonathan Hamilton
221462808d Avoid crashes due to null SettingsSections
If a SettingsFile had at least one section, it was assumed all sections
were correctly filled out. This caused crashes when opening the settings
menus if that was not the case - for example the GFX.ini settings empty
sections are removed by the main dolphin app, putting the .ini file in a
state that would crash the settings window if at least one setting was
changed in it from the default, some sections were left as default.

This adds a subclass of HashMap<String, SettingSection> that constructs a
new SettingSection instead of returning 'null' if the key isn't found,
so the mSettings.get(FILE).get(SECTION).get(SETTING) pattern can be
safely used.
2017-09-08 10:06:53 -07:00
Markus Wick
ce670c1851 Merge pull request #5959 from mahdihijazi/tv_version_number
[Android] Show the version number on the title for the Android TV UI
2017-09-08 12:17:06 +02:00
Leo Lam
1705d15d6f Merge pull request #5969 from JosJuice/android-filename
MainAndroid: Remove s_filename
2017-08-28 21:03:26 +02:00
Jonathan Hamilton
5a361fd6b3 Make the Android settings parser a bit more robust
It would fail on lines line "Value =" - IE a value set to emptystring.

This would cause the app to crash when trying to open the corresponding
settings window.
2017-08-23 15:50:21 -07:00
JosJuice
f8703f90e3 MainAndroid: Remove s_filename
This fits better as a function parameter than as global state.
2017-08-23 22:36:21 +02:00
mahdihijazi
9918d6e333 [Android] Show the version number on the title for the Android TV UI
- Stop reading version number from native code and use the one from BuildConfig
- Show the version number on the title for the Android TV UI
2017-08-21 22:00:56 +02:00
mahdihijazi
a1d713c589 [Android] Cleanup unused resources & code 2017-08-20 15:49:39 +02:00
JosJuice
1fc910b3ea Convert to/from old EFB scale numbering 2017-08-08 12:09:50 +02:00
JosJuice
f090a94319 Remove non-integer IRs 2017-08-08 12:09:50 +02:00
Michael M
737651f298 MsgHandler: small cleanup 2017-08-03 13:29:59 -07:00
Stenzek
134b0ca940 Android: Fix ubershader hybrid setting 2017-08-01 00:38:26 +10:00
Stenzek
901bf9c257 VideoConfig: Add config options for ubershaders 2017-07-30 17:43:59 +10:00
Stenzek
1fccbd5be3 DolphinWX: Add a progress dialog host command
Allows feedback from backends to be communicated to the user when
long-running operation are performed (e.g. shader compilation).
2017-07-30 12:38:48 +10:00
Léo Lam
ee868e2362 Move the Wiimote connect code out of Host
I don't know who thought it would be a good idea to put the Wiimote
connect code as part of the Host interface, and have that called
from both the UI code and the core. And then hack around it by having
"force connect" events whenever Host_ConnectWiimote is called
from the core...
2017-07-23 15:47:32 +08:00
Léo Lam
91f8283a1d Remove Wii Remote connection status from status bar
Showing the Wii remote connection status leads to inconsistent UX,
because we don't do anything like that for GameCube controllers
or with Bluetooth passthrough.

It's also questionable how useful it is given that:

* it doesn't print the number of connected remotes, just that one
  remote is connected, connecting or not connected, so the only info
  it provides is actually wrong when using multiple remotes;

* this user-facing feature is actually broken in master and no one has
  complained AFAIK, which means people don't really rely on it;

* the status bar isn't visible most of the time unless the user is
  using render to main or deliberately keeping the main window's
  status bar visible by moving the render window and they're not too
  far away from their screen;

* emulated Wii remotes now reconnect on input, which means that there
  is less of a need to actually know at all times whether a remote
  is connected, since pressing any button will reconnect it and provide
  immediate, visible feedback via OSD messages and the Wii remote
  pointer appearing.
2017-07-15 13:01:56 +08:00
Michael Maltese
0019c34c73 DolphinWX: fix input bitmaps not working when background input is off 2017-07-12 00:12:07 -07:00
Léo Lam
22992ae41e Boot: Clean up the boot code
* Move out boot parameters to a separate struct, which is not part
  of SConfig/ConfigManager because there is no reason for it to
  be there.

* Move out file name parsing and constructing the appropriate params
  from paths to a separate function that does that, and only that.

* For every different boot type we support, add a proper struct with
  only the required parameters, with descriptive names and use
  std::variant to only store what we need.

* Clean up the bHLE_BS2 stuff which made no sense sometimes. Now
  instead of using bHLE_BS2 for two different things, both for storing
  the user config setting and as a runtime boot parameter,
  we simply replace the Disc boot params with BootParameters::IPL.

* Const correctness so it's clear what can or cannot update the config.

* Drop unused parameters and unneeded checks.

* Make a few checks a lot more concise. (Looking at you, extension
  checks for disc images.)

* Remove a mildly terrible workaround where we needed to pass an empty
  string in order to boot the GC IPL without any game inserted.
  (Not required anymore thanks to std::variant and std::optional.)

The motivation for this are multiple: cleaning up and being able to add
support for booting an installed NAND title. Without this change, it'd
be pretty much impossible to implement that.

Also, using std::visit with std::variant makes the compiler do
additional type checks: now we're guaranteed that the boot code will
handle all boot types and no invalid boot type will be possible.
2017-06-06 16:27:52 +02:00
JosJuice
b2af07a7b7 DiscIO: Remove C/I/S prefixes from class names
These prefixes were inconsistent with the rest of Dolphin.

I'm also renaming VolumeWiiCrypted to VolumeWii because of 1113b13.
2017-06-06 12:31:59 +02:00
shuffle2
b9b3b1dc19 Merge pull request #5347 from JosJuice/do-not-translate-button-names
Don't translate button names
2017-06-05 19:05:09 -07:00
Léo Lam
d9fd056803 Fix minor formatting issues
These were not caught by the lint script while it was broken.
2017-06-05 02:32:19 +02:00
Leo Lam
f4190ab1c4 Merge pull request #5465 from sepalani/gc-bios
Tools: Load GameCube BIOS added
2017-05-26 10:23:03 +02:00
Sepalani
95ea721f06 Tools: Load GameCube BIOS added 2017-05-22 22:44:21 +01:00
Léo Lam
cf0c4455cd Fix indirect includes 2017-05-22 10:39:36 +02:00
Pierre Bourdon
d486904e9b build.gradle: do not change the output filename, our CI relies on it 2017-05-20 05:54:55 +02:00
JosJuice
ac5c82b36b DiscIO: Remove VolumeCreator
This file is pretty small now that it doesn't handle Wii
partitions anymore, so let's move its contents to Volume.cpp.
This is also more consistent with how blob creation works.
2017-05-19 18:33:21 +02:00
Lioncash
35aa55931f MainAndroid: Resolve -Wmissing-variable-declarations warnings 2017-05-18 19:55:05 -04:00
Sean Maas
3e33c99f4c Android: Initialize video backend setting on first run 2017-05-18 08:44:45 -04:00
Sean Maas
d4728807e0 Android: Add pressed dpad images for other DPIs 2017-05-15 08:32:22 -04:00
Sean Maas
3bd8890486 Android: Prevent stuck on-screen buttons 2017-05-15 08:32:07 -04:00
Sean Maas
6190b1c4e2 Android: Animate onscreen joystick
Invalidate more often, display nub as pressed when in use, and implement
basic nub bounds.
2017-05-14 15:29:47 -04:00
Mahdi Hijazi
216a7ceea8 Android: Add pressed state to the on-screen controllers
Now the buttons will be shown in different color to indicate a press event
2017-05-14 18:41:04 +02:00
JosJuice
0146456af0 Don't translate button names
Since these button names are printed on all real controllers,
we should show them in the same way as they are printed on
the controllers, regardless of the user's language. It seems
like this was intended all along (except for "Start"), but the
_ markers in TASInputDlg.cpp (accidentally?) led to the button
names in the controller configs also becoming translatable.

I'm making exceptions for "L" and "R" because translators
may want to mark them in some way (for instance "L-Digital")
to clarify the difference from "L-Analog" and "R-Analog".

I'm also making an exception for START/PAUSE because it's
referred to as スタート in Japanese games.

I'm changing "Home" and "Start" to uppercase for consistency
with how Nintendo refers to those buttons, and because someone
who isn't familiar with the Latin script might not know the
connection between the lowercase and uppercase letters (most
users likely do know the connection, but we shouldn't assume it),
and because leaving "Start" as "Start" makes it "collide" with
unrelated strings, such as the string for the button that starts
a netplay session.

To rename "Start" and "Home" without breaking INI
compatibility, I added a ui_name variable like in f5c82ad.
2017-05-06 16:29:10 +02:00
Tim Mutton
3dde12af13 Update support version 2017-05-04 17:21:31 +10:00
Tim Mutton
61aa507d23 Make apk name more descriptive 2017-05-04 17:13:31 +10:00
Tim Mutton
1fe1e11e0e Use try/catch with logging for version number 2017-05-04 17:13:31 +10:00
Tim Mutton
c8d66fa246 Nix and windows variant of getting tag 2017-05-04 17:13:31 +10:00
Tim Mutton
8908d10028 Use different git command for version name 2017-05-04 17:13:31 +10:00
Tim Mutton
3d95bf0837 Revert change to version code until I can work out why its 13 2017-05-04 17:13:31 +10:00
Tim Mutton
6b704f5059 Update to latest libraries, use correct version name 2017-05-04 17:13:30 +10:00
Mahdi Hijazi
ed30caa3dd [Android] Fix crash on the Android TV
Whenever the EmulationActivity crashes and the app gets back to the
TvMainActivity, dolphin will crash tring to restor the mBrowseFragment
since we don't save the adapter data in the bundle.

This is quick hack to avoid the crash. The proper fix would be to save the
adapter data in the bundle and restore it before restoring the fragment
when the activity gets recreated.

Crash Stacktrace:
Process: org.dolphinemu.dolphinemu.debug, PID: 30353
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.dolphinemu.dolphinemu.debug/org.dolphinemu.dolphinemu.ui.main.TvMainActivity}: java.lang.IllegalArgumentException: Invalid position 1 requested
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2691)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2752)
    at android.app.ActivityThread.-wrap12(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1461)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6120)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
    Caused by: java.lang.IllegalArgumentException: Invalid position 1 requested
    at android.support.v17.leanback.app.BrowseFragment.createMainFragment(BrowseFragment.java:509)
    at android.support.v17.leanback.app.BrowseFragment.replaceMainFragment(BrowseFragment.java:1454)
    at android.support.v17.leanback.app.BrowseFragment.setAdapter(BrowseFragment.java:764)
    at org.dolphinemu.dolphinemu.ui.main.TvMainActivity.buildRowsAdapter(TvMainActivity.java:183)
    at org.dolphinemu.dolphinemu.ui.main.TvMainActivity.onCreate(TvMainActivity.java:59)
    at android.app.Activity.performCreate(Activity.java:6664)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2644)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2752) 
    at android.app.ActivityThread.-wrap12(ActivityThread.java) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1461) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:154) 
    at android.app.ActivityThread.main(ActivityThread.java:6120) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
2017-05-03 23:58:40 +02:00
Mahdi Hijazi
796039e340 [Android] Add the missing Stereoscopic options 2017-05-03 11:56:09 +02:00
Mahdi Hijazi
ff475a2c02 [Android] Fix edit controls layout
Not checking the none existing key in the buttonsActionsMap
leads to break the sub menu of the configure controls menu
on Android phones.
2017-04-30 01:46:32 +02:00
Mahdi Hijazi
1e73f3c76e [Android] Fix game banners
Use Bitmap.setPixels() instead of Bitmap.copyPixelsFromBuffer() the former
use non pre-multiplied values of the colors which is what we expect to
come from the native code.
2017-04-27 20:41:55 +02:00
MerryMage
ee7e6edf31 Android: Add audio stretch setting 2017-04-18 18:42:02 +01:00
JosJuice
9cd9ae902a x86-64 support on Android
We can do this now that the x86-64 JIT supports PIE.

JITIL is deliberately excluded from the GUI because it
doesn't support PIE yet. (JITIL will be used if it's
set in the INI, though.)
2017-04-16 11:53:33 +02:00