Allows for both string types to be non-allocating. We can't remove the
const char* overload in this case due to the fact that pointers can
implicitly convert to bool, so if we removed the overload all const
char arrays passed in would begin executing the bool overload instead of
the string_view overload, which is definitely not what we want to occur.
This fixes the desync on playback of start-from-boot input recordings
made while using the GC adapter, as well as other desyncs that could
potentially occur in other circumstances where this bit is used.
I used a previously reserved bit in the ControllerState to store the
new data, so this shouldn't significantly break backwards
compatibility. However, tools that aren't aware of this new bit may set
it to 0, which will break input recordings that contain it.
Since C++17, non-member std::size() is present in the standard library
which also operates on regular C arrays. Given that, we can just replace
usages of ArraySize with that where applicable.
In many cases, we can just change the actual C array ArraySize() was
called on into a std::array and just use its .size() member function
instead.
In some other cases, we can collapse the loops they were used in, into a
ranged-for loop, eliminating the need for en explicit bounds query.
MessageData must be a trivially copyable type, given it's copied into
emulated memory via our memory copy function CopyToEmu. Under the
covers, this function utilizes memcpy. One of memcpy's requirements is
that pointers to it point to types that are trivially copyable,
otherwise the behavior is undefined.
Given that, we can enforce this requirement at compile-time.
Simplifies initialization code quite a bit, and replaces a pointer
variable for SMessageData with a type properly representing the whole
set of data it needs.
These aren't modified by the class, nor do they directly need anything
related to the class state, so they can solely live within the cpp file,
hidden from external view, and also be made const, so the compiler can
place it within the read-only segment.
Makes the names consistent between declaration and definition and
adjusts them to follow our code formatting guidelines.
Now all functions in the translation unit follow our formatting
guidelines.
Constructs the strings directly within the container instead of
performing a construction, then a copy.
The reasoning is that the BACKEND_* strings are const char arrays, so
the push_back code is equivalent to:
push_back(std::string(BACKEND_WHATEVER)) instead of forwarding the
arguments to a constructed instance directly in the container.
This changes the Host Input Authority and Golf Mode checkboxes into a
set of radio buttons, consisting of Fair Input Delay, Host Input
Authority, and Golf Mode. This represents the 3 network modes we have.
Although Golf Mode is just an extension of Host Input Authority, it's
more logical to the user to present it as a separate option, rather
than enabling the Golf Mode checkbox only when Host Input Authority is
enabled. This also eliminates the need to first enable Host Input
Authority before Golf Mode can be enabled.
This also adds tooltips to provide brief descriptions of the options,
as well as reintroducing tooltips that were previously removed.