Commit Graph

225 Commits

Author SHA1 Message Date
JosJuice 3eb360b818 VolumeVerifier: Add zip support for datfile 2019-08-24 16:37:19 +02:00
JosJuice f79ca65170 UICommon: Remove Android hacks from GameFile 2019-08-21 18:48:52 +02:00
Anthony 5f38386575
Merge pull request #8222 from JosJuice/allow-mismatched-region-settings
Replace "Override Language on NTSC Games" with "Allow Mismatched Region Settings"
2019-08-21 09:00:06 -07:00
Silent b6df0bff93
Make --batch run Dolphin in headless mode, provided --exec is also passed 2019-08-11 20:58:04 +02:00
Silent 80e8037e0b
Truly use emplace_back in CommandLineConfigLayerLoader constructor 2019-08-11 20:43:18 +02:00
JosJuice 561a4cfcce Replace "Override Language on NTSC Games" with "Allow Mismatched Region Settings"
This new setting is like Override Language on NTSC Games, except
instead of only applying to the GameCube language setting,
it also applies to the Wii language setting.

Fixes https://bugs.dolphin-emu.org/issues/11299
2019-08-09 17:33:05 +02:00
Lioncash 8285a94d93 UICommon/NetPlayIndex: Take std::vector by const reference in ParseResponse()
This variable isn't std::moved anywhere and is just read out of into a
string. Instead of making a copy, and then another copy of the data into
a std::string, we can take it by reference, only copying the data once.
2019-08-04 12:36:52 -04:00
Lioncash 75f3656804 UICommon/NetPlayIndex: Use a std::string_view for EncryptID()/DecryptID()
These parameters only acted as views into the provided strings, so these
can just be turned into non-owning string views.
2019-08-04 12:32:33 -04:00
Lioncash 2830fe820d UICommon/NetPlayIndex: Take NetPlaySession by const reference for Add()
This isn't std::moved wholesale into a member variable or further
std::moved into another function, so it's better to take it by const
reference here to avoid unnecessary reallocations of contained
std::string instances.
2019-08-04 12:29:17 -04:00
Lioncash 0a67a40e7c UICommon/NetPlayIndex: Move NetPlaySession variable closer to its usage point in List()
Moves it closer to where its used, narrowing its visible scope, as well
as preventing unnecessary std::string constructor executions in the
event invalid data is encountered (the continue branch).
2019-08-04 12:24:04 -04:00
Lioncash 13292563ee UICommon/NetPlayIndex: Use std::move within SetErrorCallback()
std::function is allowed to heap allocate in order to store captured
variables, etc, so std::function isn't a trivial type. We can std::move
here in order to avoid potential reallocating.

While we're at it, make the definition's parameter name match the
declaration's parameter name for consistency.
2019-08-04 12:21:02 -04:00
Lioncash 5220922a22 UICommon/NetPlayIndex: Allow move semantics in SetGame()
If the parameter is const, then a move won't actually be able to occur,
making the std::move non-functional. We can remove the const qualifier
to remedy this.
2019-08-04 12:16:19 -04:00
Silent 4b03790eda
Core: Fixup AutoUpdateChecker::TriggerUpdate on Windows:
- Properly close handles if Updater.exe process spawns successfully
- Fix STARTUPINFO sizeof typo
2019-07-22 19:29:50 +02:00
JosJuice 0f5a4b37ee DiscIO: Add functions CreateDisc and CreateWAD
...in addition to the existing function CreateVolume
(renamed from CreateVolumeFromFilename).

Lets code easily add constraints such as not letting the user
select a WAD file when using the disc changing functionality.
2019-07-18 22:29:04 +02:00
Léo Lam cf60a9a7f7 Use separate libusb contexts to avoid thread safety issues
Unfortunately, it appears that using libusb's synchronous transfer API
from several threads causes nasty race conditions in event handling and
can lead to deadlocks, despite the fact that libusb's synchronous API
is documented to be perfectly fine to use from several threads (only
the manual polling functionality is supposed to require special
precautions).

Since usbdk was the only real reason for using a single libusb context
and since usbdk (currently) has so many issues with Dolphin, I think
dropping support for it in order to fix other backends is acceptable.
2019-06-26 17:55:51 +02:00
Léo Lam 4885130799
Merge pull request #8194 from lioncash/common-msg
Common/MsgHandler: Tidy up interface and namespace code
2019-06-20 13:37:24 +02:00
Lioncash 4f1f55093f Common/MsgHandler: Namespace code within the Common namespace
Closes another gap in the Common library where code isn't being
namespaced under it.
2019-06-19 16:03:55 -04:00
Lioncash 2714ba2b3d UICommon: Add missing header guards 2019-06-17 18:39:44 -04:00
Connor McLaughlin b13e00b003
Merge pull request #8165 from lioncash/linkage
{Android/ButtonManager, ResourcePack/Manager}: Make file-scope variables/functions internally linked where applicable
2019-06-08 20:56:13 +10:00
Lioncash eb15a52fd5 UICommon/ResourcePack/Manager: Make GetPackConfig() internally linked
Silences a -Wmissing-declarations warning.
2019-06-07 20:27:27 -04:00
Lioncash c0c0e412e0 Core/ConfigManager: Use forward declarations where applicable
Avoids dragging in IniFile, EXI device and SI device headers in this header which is
quite widely used throughout the codebase.

This also uncovered a few cases where indirect inclusions were being
relied upon, which this also fixes.
2019-06-07 19:54:39 -04:00
Lioncash 4cdb493eab UICommon/CMakeLists: Specify headers in target sources 2019-05-31 06:54:25 -04:00
Léo Lam 80d8173d29
Merge pull request #8132 from lioncash/string
Common/FileUtil: Use std::string_view with WriteStringToFile
2019-05-29 15:32:18 +02:00
Léo aca46b11f8
Merge pull request #8070 from leoetlino/usb-fixes
Update and patch libusb to fix USB issues
2019-05-29 14:07:19 +02:00
Lioncash eb475025b8 Common/FileUtil: Make WriteStringToFile consistent with ReadFileToString
Makes the parameter ordering consistent and less error-prone.
2019-05-29 07:06:53 -04:00
Lioncash 4d2e0c7b48 UICommon/ResourcePack/Manager: Resolve use-after-move in Add()
The pack is already has its validity checked at the beginning of the
function, so we don't need to check this again after inserting it.

Also resolves a use-after-move case.
2019-05-28 17:40:28 -04:00
Lioncash b4470ad4c2 UICommon/GameFile: Make COVER_URL a plain C string
Same behavior but doesn't take up 8 bytes in the executable to store a
pointer. While we're at it, move it into an anonymous namespace within
the UICommon namespace.
2019-05-28 07:27:41 -04:00
Lioncash 8229ada922 UICommon/GameFile: Remove unused includes
Nothing within the source file makes use of anything in those includes,
so they can be removed.
2019-05-28 07:27:41 -04:00
Lioncash 80786cd295 UICommon/GameFile: Remove unnecessary value() calls in DownloadDefaultCover()
We already check ahead of time if the optional contains a value within
it before accessing it, so we don't need to use the throwing value()
accessor. We can just directly use operator->
2019-05-28 07:27:41 -04:00
Lioncash ab0892e5a5 UICommon/GameFile: Deduplicate string paths where applicable
Rather than construct strings twice, we can just construct it once and
reuse it. While we're at it, we can move variables closer to where
they're actually used within DownloadDefaultCover()
2019-05-28 07:27:35 -04:00
Lioncash 27ecb93b32 UICommon/GameFile: Remove unnecessary initializers
All of the standardized types have constructors that will automatically
initialize them, so the explicit initializers are redundant.
2019-05-28 07:00:15 -04:00
Lioncash 56faf750be UICommon/GameFile: std::move std::string argument in constructor
Allows for calling code to move the argument into the constructor,
avoiding a copy.
2019-05-28 06:57:48 -04:00
Lioncash 8e65869484 UICommon/GameFile: Default no-arg constructor and destructor within the cpp file
A GameFile instance contains quite a lot of non-trivial types, so
default construction and destruction in the same translation unit.
2019-05-28 05:53:40 -04:00
Lioncash 49ca31467d UICommon/GameFile: Use in-class initializers where applicable
Allows deduplicating code within the constructor initializer list.
2019-05-28 05:51:51 -04:00
Léo Lam 256c9375c9 Move libusb utilities to LibusbUtils
* Simplifies libusb context usage and allows us to set options for
all contexts easily. Notably, this lets us enable usbdk support
in libusb, which is now opt-in in the latest version.

* Moves the libusb config descriptor wrapper class to LibusbUtils too
since that could easily be reused.

* Moves device listing to LibusbUtils too and add a lock around it
as some libusb backends are not thread safe.

* Consequences: only a single context and a single event handling
thread is used now, which is more efficient.
2019-05-27 20:09:55 +02:00
Lioncash f07cf9ebab UICommon/ResourcePack: Allow ReadCurrentFileUnlimited() to read into any contiguous container
This allows the same code to be used to read into a std::string, which
allows for eliminating the vector->string transfer when reading the
manifest file.

A ContiguousContainer is a concept that includes std::array,
std::string, and std::vector.
2019-05-27 13:29:40 -04:00
Lioncash 5c4d3f55da UICommon/Manager: Remove unused std::string variable in Remove() 2019-05-27 13:09:21 -04:00
Lioncash 41cda6fe6d UICommon/ResourcePack: Use ScopeGuards to manage closing files
Makes it way harder to introduce resource leaks, and plugs the existing
resource leaks in the constructor and Install() where the file wouldn't
be closed in some error cases.
2019-05-27 13:02:04 -04:00
Lioncash 157a305507 UICommon/ResourcePack: Deduplicate string construction
A few cases duplicate the string patch creation, which is kind of
wasteful. We can just construct the string once.
2019-05-27 12:45:23 -04:00
Lioncash a22cc615a9 UICommon/ResourcePack: Remove unnecessary resizes
We can simply construct the containers with the desired size in these
cases.
2019-05-27 12:37:46 -04:00
Lioncash 57701cd988 UICommon/ResourcePack: Make TEXTURE_PATH a regular array
Same behavior, only it doesn't unnecessarily store a pointer in the
executable. While we're at it, make it constexpr and move it into the
namespace.
2019-05-27 12:33:50 -04:00
spycrab 5625baa32c UICommon/VideoUtils.cpp: Add missing include 2019-05-08 21:00:23 +02:00
Techjar ff972e3673 Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
Léo Lam 99a4ca8de7
Merge pull request #7839 from ShFil119/impr/redundant
Remove redundant initialization
2019-05-04 22:50:51 +02:00
Mikaela Szekely 8fe7e271f3
UICommon: Properly set user dir if ./user is a file (not a directory) 2019-05-03 23:30:50 -06:00
Léo Lam bec85a0962
Merge pull request #8013 from JosJuice/titledatabase-japanese-gc
Show Japanese GC games in Japanese when using TitleDatabase
2019-05-01 17:37:31 +02:00
Léo Lam ef88dd73b3
Merge pull request #8014 from JosJuice/getuniqueidentifier-language-independent
Make GameFile::GetUniqueIdentifier independent of language setting
2019-05-01 17:34:01 +02:00
Filip Gawin c110ffcdaa Remove redundant initialization 2019-04-30 01:22:24 +02:00
JosJuice 3bef561e5d Make GameFile::GetUniqueIdentifier independent of language setting
My bad.

We need this in the situation where two users are using different
languages and the game has a different name in each language.
2019-04-27 14:00:58 +02:00
JMC47 6ea43235d5
Merge pull request #7841 from iwubcode/config-mgr-onion
Config: Move the 'Display' settings from ConfigManager to the layered config system
2019-04-21 00:01:47 -04:00