While we're at it, we can also improve some of the allocations and
copying that would be going on in one case by preallocating and then
emplacing before modifying.
This might be caused by some packet/status delay within the enet protocol, or may be caused by our not properly handling disconnection. Anyway, this situation *can* happen, and we should not crash Citra for a non-critical error.
This change is not HW tested as I do not have 3 3DSes, but this should make sure that all the members of the network hold the same `node_info`, `nodes` and the bitmasks, etc.
Previously, when connecting, the host was using the incorrect node_id to update `node_info`.
This is an attempt to fix tywald's problem with MH, reported on Discord a while ago. I'm not sure if this would actually fix that though.
I'm not sure why we decided to have a boolean here, but apparently that wasn't the correct behaviour. According to HW tests, the Software Keyboard simply displays the default text when the button text provided is empty (**not necessarily all zero**). For example, if you set a text for one of the buttons and leave others empty, the button you set will have your text, while others will have their default texts. Removed the boolean and updated frontend code to make it correct.
* gl_rasterizer_cache: Mark file-scope functions as static where applicable
Prevents -Wmissing-declaration warnings from occurring and also makes
these functions internally linked.
* gl_rasterizer_cache: Remove unused local std::string variable
Despite being unused, compilers are unable to completely remove any code
gen related to the construction and destruction of this variable, since
the destructor of std::string is non-trivial.
Thus, we can remove it to reduce a minor amount of unnecessary code
generation
* gl_rasterizer_cache: Mark hash implementation as noexcept
This shouldn't throw.
* gl_rasterizer_cache: Remove unused variable in ClearAll()
* gl_rasterizer_cache: Make use of const on references explicit
While declared as auto&, these actually behave as const auto& variables,
due to the constness of the container being iterated. We can make this
explicit for readability sake.
* gl_rasterizer_cache: Resolve truncation warnings
The size is forwarded to a std::memset call, which takes a std::size_t
as its size parameter, so we can just make this change to silence the
warnings.
* gl_rasterizer_cache: Resolve variable shadowing warnings
Prevents a -Wshadow warning from occurring.
* GUI: Deadzone controls for sdl engine at configuration input
Co-Authored-By: CJ Bok <cjbok@users.noreply.github.com>
* configure_input: Use slider to edit modifier scale
Co-Authored-By: Kewlan <kewlan@users.noreply.github.com>
* Address minor review comment
Co-Authored-By: Kewlan <kewlan@users.noreply.github.com>
Co-authored-by: CJ Bok <cjbok@users.noreply.github.com>
Co-authored-by: Kewlan <kewlan@users.noreply.github.com>
It's undefined behavior to pass a null pointer to std::fread and
std::fwrite, even if the length passed in is zero, so we must perform
the precondition checking ourselves.
A common case where this can occur is when passing in the data of an
empty std::vector and size, as an empty vector will typically have a
null internal buffer.
While we're at it, we can move the implementation out of line and add
debug checks against passing in nullptr to std::fread and std::fwrite.
Prevents the internal buffer in the std::optional from being zeroed out
unnecessarily and instead sets the validity byte only in some
implementations.
While we're at it, we can make use of std::move to eliminate unnecessary
heap reallocations from occurring.