- Externals/soundtouch/CMakeLists.txt: add -w (since it's not our code) to
silence an unused variable warning
- Source/Core/Core/NetPlayClient.cpp: Work around a Clang/libc++ bug where
initializing a std::array the way the standard says you're supposed to produces
a warning. (libc++'s implementation of std::array, like any sane
implementation, has a C array as a field, so the most explicit form of
initialization would use two braces, one for the struct and one for the array.
Clang has a general warning for not being explicit with braces, which is
usually sane. But the standard only guarantees that initializing std::array
works with a single pair of braces!) There are other places in Dolphin that
incorrectly use double braces, presumably to avoid the warning, so maybe the
warning should just be turned off, but in any case here I just switch to an
equivalent .fill().
This changes Refresh() to use the existing scanning thread to scan for
devices, instead of running the scan on the UI thread and blocking it.
Also makes the UI thread not block when Continuous Scanning is disabled
and removes duplicated code.
Should fix issue 8992.
Under the hood:
* The scanning thread is now always active, even when continuous
scanning is disabled.
* The initialize code which waits for Wiimotes to be connected also
uses the scanning thread instead of scanning on yet another thread.
* The scanning thread now always checks for disconnected devices, to
avoid Dolphin thinking a Wiimote is still connected when it isn't. So
we now check if we need new Wiimotes or a Balance Board at scan time.
This makes it clear that sending a signal a second time will force stop
Dolphin (which is useful in case the GUI is deadlocked or otherwise
unable to react to the signal).
Before this variable was an u8, which could theoretically result in desyncs with a large buffer(greater than 255*120/200=153) filled with blank inputs. If this could actually happen, i don't know. But this part of the code on its own looks like it could break.
A static var is not a good idea, when the value needs to be reset for every session. Also, the variable holds the data size, so it makes sense to set the data size, where the data is added.
This makes DolphinWX shut down cleanly, just like it would with
File->Exit when it receives a SIGINT, SIGTERM (Unix) or some signals
on Windows.
The default signal handler will be restored after a first shutdown
signal so a second signal will exit Dolphin forcefully.
The active codes normally get cleared when a game boots, because
LoadPatches gets called, replacing the codes from the previous game.
However, there were cases where LoadPatches doesn't get called, and
then codes from the previous game would be used for the current game.
This commit clears the codes on shutdown so that it doesn't matter
whether the boot process loads LoadPatches.