Removes redundant initializers from the constructor and provides
initializers for all members that don't already have one for consistency
(and deterministic initial state).
Given the volume verifier has quite a few non-trivial object within it,
it's best to default the destructor within the cpp file to prevent
inlining complex destruction logic elsewhere, while also making it nicer
if a forward-declared type is ever used in a member variable.
std::call_once is guaranteed to execute the given callable object
exactly once. This guarantee holds even if the function is called
concurrently from several threads.
Given that, we can replace the mutex and boolean flag with
std::call_once and a std::once_flag to perform the same behavior.
Previously, every entry pair within the map would be copied. The reason
for this is subtle.
A std::map's internal entry type is defined as:
std::pair<const Key, Value>
but the loop was declaring it as:
std::pair<Key, Value>
These two types aren't synonymous with one another and so the compiler
is required to always perform a copy.
Using structured bindings avoids this (as would plain auto or correcting
the explicit type), while also allowing the use of more appropriate
names compared to first and second.
std::function is allowed to heap allocate in order to hold any necessary
bound data in order to execute properly (e.g. lambdas with captures), so
this avoids unnecessary reallocating.
The previous implementation of cheat search would reconvert the input
string for every single memory value. Now we do it once and construct
a comparison lambda which we pass to the search code.
In addition, I also added input validation. So, for example, if you've
selected Decimal input and you try to compare against "FF",
it won't search and will instead let the user know they've entered an
invalid value. Similar logic for if you enter "1.2" in a search for
bytes. Before, it would just use 0 if it failed to convert the value.
- Files for the current game are now guaranteed to be loaded, space and validity permitting.
- Avoid showing PanicAlerts for every problem encountered, most of them aren't really important enough and will probably just annoy the user.
- And for the only error the user will definitely care about, when the save of the game they're trying to play fails to load, show an imgui message instead.
To avoid having to claim/release interfaces all the time, and having to
trigger interface changes from several places, all interfaces are now
claimed ahead of time.
This commit also makes us avoid changing the active interface when it's
not necessary.
Changing the active interface has side effects such as resetting the
active alternate setting -- which is extremely undesirable because it
would require the emulated software to change the alternate setting
again, which isn't supposed to be necessary at all.
This fixes Your Shape, which submits isochronous transfers on an
endpoint that only exists in alt setting 6 right after submitting
control transfers (which would have reset to alt setting 0 prior to
this fix).
Changed itemSelectionChanged and itemClicked signal to itemPressed in CodeWidget.
Holding mouse down and moving will only travel up/down the stack one time.
This fixes the common occurrence of unintentionally traveling deeper down the stack or higher up the callstack than intended.
This allows us to update the rich presence description if a channel
is launched from the Wii Menu. It also handles other PPC title
launches, e.g. Smash Bros. Masterpieces.
Host.h: Added Host_TitleChanged().
DolphinNoGUI/MainNoGUI.cpp: Implemented Host_TitleChanged().
DolphinQt/Host.cpp: Implemented Host_TitleChanged().
Android/jni/MainAndroid.cpp: Stubbed Host_TitleChanged().
DSPTool/StubHost.cpp: Stubbed Host_TitleChanged().
UnitTests/StubHost.cpp: Stubbed Host_TitleChanged().
While current usages of ParseLine aren't problematic, this is still a
public function that can be used for other purposes. Essentially makes
the function handle potential external inputs a little nicer.
We can just utilize map's insert_or_assign() function and check the
return value to determine whether or not we need to insert the key into
the keys_order vector.
Even though libusb is supposed to be thread-safe, in practice
it's not (at least on Windows); getting a list of devices from two
different threads can result in libusb crashes. This is easily
fixed by waiting for the scan thread to complete scanning instead
of running the scan on the CPU thread.
This also fixes an issue that I had overlooked in the initial
implementation: IOS interfaces such as OH0 are sometimes opened
every frame, in which case we were doing a full device scan every
single frame on the CPU thread!
Fixes an embarrassing bug that made the implementation utterly useless.
This fixes Your Shape hanging on shutdown. The game was waiting for an
interrupt transfer to be cancelled, and Dolphin wasn't cancelling
transfers on the correct endpoint.