Commit graph

23187 commits

Author SHA1 Message Date
Shiz
e647503eb2
Core/HW/WiimoteReal: add missing Linux include
IOLinux.cpp should include <sys/select.h> as it uses select() functionality.
On certain platforms it's included implicitly by other headers, which is why
it compiled before. This makes it also work on musl platforms.
2019-06-29 02:17:58 +02:00
Léo Lam
58c78a495d
Merge pull request #8213 from JosJuice/filesystem-u8string
Work around C++20 std::filesystem changes related to u8string
2019-06-28 19:42:34 +02:00
Léo Lam
6fd435fdff
Merge pull request #8208 from lioncash/fmt
Core/IOS: Use fmt where applicable
2019-06-28 18:53:47 +02:00
spycrab
dacba85a08 UpdaterCommon: Hide Updater before Dolphin quits 2019-06-23 19:47:18 +02:00
spycrab
396546f5c0 Config/ARCodeWidget: Add option for alphabetical sorting 2019-06-22 19:54:13 +02:00
spycrab
1d43d9afc1 Config/GeckoCodeWidget: Add option for alphabetical sorting 2019-06-22 19:54:13 +02:00
spycrab
93393a288c Qt/ARCodeWidget: Support drag and drop reordering 2019-06-22 19:54:13 +02:00
spycrab
389351c6c0 Qt/GeckoCodeWidget: Support drag and drop reordering 2019-06-22 19:54:13 +02:00
JosJuice
c0a6fa5dcc Work around C++20 std::filesystem changes related to u8string 2019-06-21 18:34:21 +02:00
spycrab
d68f62c0f5 Core/NetPlayServer: Fix empty error messages when adding session to the index fails 2019-06-20 20:55:38 +02:00
Anthony
84b9b37fef
Merge pull request #8210 from spycrab/httpreq_error_msg
Common/HttpRequest: Use CURLOPT_ERRORBUFFER for error messages
2019-06-20 10:59:25 -07:00
spycrab
ba4c1c5947 Common/HttpRequest: Use CURLOPT_ERRORBUFFER for error messages 2019-06-20 19:44:51 +02:00
JosJuice
63bb646721 Fix opening controller config when there is no profile directory
https://bugs.dolphin-emu.org/issues/11771
2019-06-20 18:35:14 +02:00
Lioncash
980085e106 Core/IOS: Use fmt where applicable 2019-06-20 11:50:02 -04:00
Léo Lam
3cafd0ae81
Merge pull request #8171 from Pokechu22/backend-changing-fix
Disallow changing the backend when running when software renderer is currently selected
2019-06-20 13:58:01 +02:00
Léo Lam
4edf174b61
Merge pull request #8180 from lioncash/fmt
Core/Movie: Use fmt where applicable
2019-06-20 13:56:15 +02:00
Léo Lam
973bba7c1e
Merge pull request #8191 from lioncash/ini
Common/IniFile: Use std::string_view where applicable
2019-06-20 13:44:20 +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
Léo Lam
baf02194c1
Merge pull request #8195 from lioncash/macro
VideoCommon/Statistics: Remove preprocessor macro
2019-06-20 13:29:27 +02:00
JosJuice
9c33f658a5 Simplify std::filesystem usage a little in Boot.cpp
If path_b is absolute, (path_a / path_b) will be the same as path_b.
2019-06-20 10:42:56 +02:00
JosJuice
fab15edb53 Replace <experimental/filesystem> includes with <filesystem>
https://bugs.dolphin-emu.org/issues/11770
2019-06-20 10:39:56 +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
e7dd46a531 Common/MsgHandler: Brace if statement in MsgAlert
The condition travels more than one line, so the body should be braced.
While we're at it, make the comparison against nullptr explicit.
2019-06-19 16:03:33 -04:00
Lioncash
0eddf6dd8f Common/MsgHandler: Use std::string's empty for emptiness checking in MsgAlert
Provides more straightforward code compared to negating a length check.
2019-06-19 16:00:16 -04:00
Léo Lam
ff96dc0e6f
Merge pull request #8199 from lioncash/namespace
General: Use nested namespace specifiers where applicable
2019-06-18 11:33:08 +02:00
Lioncash
2714ba2b3d UICommon: Add missing header guards 2019-06-17 18:39:44 -04:00
Lioncash
10f705f665 Core: Add missing header guards 2019-06-17 18:39:03 -04:00
Lioncash
c4def7c814 Common: Add missing header guards 2019-06-17 18:37:56 -04:00
Lioncash
72b04a353d VideoBackends/Vulkan: Use nested namespace specifiers where applicable 2019-06-17 16:57:30 -04:00
Lioncash
ec60027f56 InputCommon: Use nested namespace specifiers where applicable 2019-06-17 16:51:41 -04:00
Lioncash
8e030a4a45 Common: Use nested namespace specifiers where applicable 2019-06-17 16:36:48 -04:00
Lioncash
32bacfa4bd Core: Use nested namespace specifiers where applicable
Same thing, less visual noise.
2019-06-17 16:32:30 -04:00
Lioncash
5cafce3cc4 VideoCommon/Statistics: Amend imgui include
This is a library header, so it should be using '<' and '>' to delineate
that.
2019-06-17 02:37:02 -04:00
Lioncash
73710c0745 VideoCommon/Statistics: Remove unused header inclusions
These aren't used anywhere, so they can be removed.
2019-06-17 02:36:41 -04:00
Lioncash
6416fe336c VideoCommon/Statistics: Replace memset with assignment in ResetFrame()
Same behavior, less code, and it doesn't require the type ThisFrame
itself to actually be a trivially-copyable type.
2019-06-17 02:27:36 -04:00
Lioncash
e981fa2073 VideoCommon/Statistics: Use ImGui::TextUnformatted() where applicable
ImGui::Text() assumes that the incoming text is intended to be
formatted, but we don't actually use it to format anything. We can be
explicit by using the relevant function.

This also has a plus of not needing to go through the formatter itself,
but the gains from that are probably minimal.
2019-06-17 02:27:26 -04:00
Lioncash
1c40fd8569 VideoCommon/Statistics: Replace DRAW_STAT macro with variadic lambda
We don't need to use the preprocessor here. We can just use a variadic
lambda function instead and forward the arguments to the formatting
function.
2019-06-17 02:26:25 -04:00
Lioncash
1968643297 Common/MsgHandler: Amend file-scope variable names
Makes them follow our coding style.
2019-06-16 23:37:03 -04:00
Lioncash
76b675e9f0 Common/MsgHandler: Make default message handler and translator's internally linked
Previously these functions were declared without the static specifier,
giving them external linkage, which isn't really ideal.

Instead, we can place these functions up by the relevant file-scope
variables and place them inside an anonymous namespace with said variables,
giving them internal linkage.
2019-06-16 23:37:03 -04:00
Lioncash
d1475f6d59 Common/MsgHandler: Convert type aliases over to using
Same thing, nicer to read.
2019-06-16 23:37:03 -04:00
Lioncash
027c17558f Common/MsgHandler: Use fmt::print on non-Windows OSes
Provides the same behavior.
2019-06-16 23:37:00 -04:00
Lioncash
78d1716251 Common/IniFile: Make use of std::string_view where applicable
Now that the std::map less-than comparitor is capable of being used with
heterogenous lookup, we're able to convert many of the querying
functions that took std::string references over to std::string_view.

Now these functions may be used without potentially allocating a
std::string instance unnecessarily.
2019-06-16 18:20:08 -04:00
Lioncash
de7e9557dc Common/IniFile: Make CaseInsensitiveStringCompare usable with heterogenous lookup
Previously, when performing find() operations or indexing operations on
the section map, it would need to operate on a std::string key.

This means cases like:

map.find(some_string_view)

aren't usable, which kind of sucks, especially given for most cases, we
use regular string literals to perform operations in calling code.
However, since C++14, it's possible to use heterogenous lookup to avoid
needing to construct exact key types. In otherwords, we can perform the
above or use string literals without constructing a std::string instance
around them implicitly.

We simply need to specify a member type within our comparison struct
named is_transparent, to allow std::map to perform automatic type
deduction.

We also slightly alter the algorithm to an equivalent compatible with
std::string_view (which need not be null-terminated), as strcasecmp
requires null-terminated strings.

While we're at it, we can also provide a helper function to the struct
for comparing string equality rather than only less than. This allows
removing other usages of strcasecmp in other functions, allowing for the
transition of them to std::string_view.
2019-06-16 18:20:03 -04:00
Léo Lam
b3525ad774
Merge pull request #8186 from lioncash/view
{Common/SymbolDB, Core/HLE/HLE}: Make use of std::string_view where applicable
2019-06-16 16:20:02 +02:00
Léo Lam
1550c098d3
Merge pull request #8187 from lioncash/disasm
GekkoDisassmbler: Amend erroneous formatting specifiers
2019-06-16 16:19:30 +02:00
Lioncash
9952dfe293
GekkoDisassmbler: Amend erroneous formatting specifiers
fmt diverges from printf in that '.' as a precision specifier may only
be used for floating-point values (makes sense, given it's indicating
precision after the decimal point).
2019-06-16 02:05:16 -04:00
Lioncash
a3046fe807
Core/HLE/HLE: Use std::string_view where applicable
Now that SymbolDB's querying functions accept std::string_view
instances, we can alter the Patch/UnPatch HLE functions to follow suit.
2019-06-16 01:20:12 -04:00
Lioncash
936aa5dbaa
Common/SymbolDB: Use std::string_view where applicable
These strings are only used for comparison against other strings, so a
string view can be used here.
2019-06-16 01:10:02 -04:00
Techjar
56c818b3d8 VideoCommon/RenderBase: Reset scissor rectangle after ImGui rendering
This fixes the problem where OBS game capture only grabs the region
inside an ImGui window whenever one is open, when using the OpenGL
backend. Shouldn't have any negative effects, as the scissor would've
been something completely arbitrary anyways.

This may affect other capture software that uses the same hooking
method, but I've only tested OBS.
2019-06-15 07:12:17 -04:00
Lioncash
c64fe7df65
Core/Movie: Use fmt where applicable
In a few cases we needed to alter... less than ideal parameter types.
While u8 may have been OK with printf-style formatting, which promotes
most smaller types back to int, this won't work with fmt. fmt preserves
the type of the passed in arguments, meaning that u8, being an alias of
uint8_t (itself being an alias of unsigned char on all the platforms we
support), will print out as a character, not a numeric value.

As such, we amend some functions to operate on u32 values for two
reasons:

1. We actually want it to print out as a value
2. Arithmetic on unsigned types smaller than unsigned int will actually promote to an int,
   not unsigned int. This is very non-obvious to some and makes for
   error-prone code. < sizeof(int) types are great for storage, not so
   much for performing unsigned arithmetic, despite the signedness of
   the type.
2019-06-14 17:47:02 -04:00