Commit graph

31133 commits

Author SHA1 Message Date
Lioncash
0cde8ab9e8 Common/GekkoDisassembler: Make all lookup tables immutable
Allows these arrays to be placed within the read-only segment (and
enforces the immutability in the code itself). While we're at it, we can
make use of std::array here.
2019-06-16 19:21:07 -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
Alex Kerr
b99ed960a9 Fix Gecko codes for G2RE52 (Shrek SuperSlam) 2019-06-16 11:26:27 +01:00
JosJuice
2e3478a542
Merge pull request #8184 from Techjar/gameini-line-endings
GameSettings: Fix some line endings
2019-06-16 08:35:41 +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
8809087efd GameSettings: Fix some line endings 2019-06-15 20:01:49 -04:00
Connor McLaughlin
9e1c38b6e1
Merge pull request #8182 from Techjar/imgui-reset-scissor
VideoCommon/RenderBase: Reset scissor rectangle after ImGui rendering
2019-06-15 21:29:07 +10: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
Vincent Duvert
2f63b71bde QtGui: Handle file open events
Handle file open events received by Dolphin. This allows Wii/GC files to be
opened when double-clicked or dropped on the Dolphin application on macOS.
2019-06-15 11:27:29 +02: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
Lioncash
7f93ce374d
Core/CMakeLists: Privately link in fmt
While we do have this library as part of the public linkage interface in
the common library target, which will be used in the future for the
logging macros, we should still be explicit that we're using this
library. Therefore, we privately link it in to be explicit about it.
2019-06-14 17:43:39 -04:00
Pokechu22
3c6447e5ed Set texture cache accuracy to safe for Mii Channel 2019-06-14 13:30:54 -07:00
Anthony
c34388f75b
Merge pull request #8157 from JosJuice/rotational-latency
HW/DI: Emulate rotational latency
2019-06-14 12:36:36 -07:00
Anthony
224f292224
Merge pull request #8130 from 8times9/more-text-fixes
Qt: Minor adjustments to graphics window descriptions
2019-06-14 12:30:27 -07:00
Anthony
dd3b678451
Merge pull request #8178 from leoetlino/less-sleep
DiscordHandler: Don't delay shutdown by up to 2s
2019-06-14 12:28:13 -07:00
Anthony
9cf6ba13df
Merge pull request #8177 from lioncash/fmt
Common: Use fmt where applicable
2019-06-14 12:22:16 -07:00
Lioncash
5b92d5076a
Common: Use fmt where applicable
Begins the transition to using fmt for string formatting where
applicable. Given fmt supports formatting std::string instances out of
the box, we can remove now-unnecessary calls to .c_str() and .data().

Note that this change does not touch the actual logging subsystem aside
from converting the final StringFromFormat call in the process over to
fmt::format. Given our logging system is heavily used throughout the
entire codebase, and converting that over will be quite a large change
by itself, this will be tackled near the end of the conversion process.
2019-06-14 15:04:09 -04:00
Lioncash
925afcae3b
VSProps: Add fmt directory to the list of additional includes
Allows fmt's headers to be visible to the Visual Studio projects.
2019-06-14 13:48:39 -04:00
8times9
f1dde9fee0 Qt: Minor adjustments to graphics window descriptions 2019-06-14 15:58:16 +02:00
Léo Lam
59155b4d5e
Merge pull request #8150 from lioncash/kbd
IOS/USB_KBD: Minor cleanup
2019-06-14 15:25:10 +02:00
Léo Lam
3b7a7ae2e7
Merge pull request #8155 from Techjar/dtm-get-origin
Core/Movie: Store PAD_GET_ORIGIN bit in ControllerState
2019-06-14 15:13:43 +02:00
Léo Lam
e2d59abaa7
Merge pull request #8173 from lioncash/fmt
Externals: Add libfmt to externals
2019-06-14 14:47:22 +02:00
Léo Lam
a6f4cb1647 DiscordHandler: Don't delay shutdown by up to 2s
Currently, it is possible for the DiscordHandler thread to be in the
middle of sleeping when Dolphin is closing. This results in a very
noticeable delay of up to 2 seconds that is unacceptable, especially
for people who don't use the Discord integration.

This fixes the issue by making the thread wait on an Event instead
and signalling it when shutting down.
2019-06-13 23:34:25 +02:00
Léo Lam
79ea55c912
Merge pull request #8169 from lioncash/fallthrough
Core/GeckoCodeConfig: Use the [[fallthrough]] attribute in LoadCodes()
2019-06-13 13:36:32 +02:00
Lioncash
d52e69bab1
Common/CMakeLists: Link in fmt
While not currently used by common, this will become the case when the
logging system eventually transitions to it, among other things.
2019-06-10 15:26:46 -04:00
Lioncash
d5d60c6e64
Externals: Add libfmt 5.3.0 to externals
Allows us to migrate off of printf specifiers and have more type-safe
formatting facilities. It also allows for custom type support as well.
fmt is also on track to have part of it standardized within C++2a, so
this will also lessen the transitional work necessary later on by
allowing new code to use it.

This simply adds the library but doesn't do anything with it yet.
2019-06-10 15:26:43 -04:00
Connor McLaughlin
cea1b58919
Merge pull request #8170 from lioncash/lut
VideoCommon/DriverDetails: Make look-up table immutable
2019-06-09 20:36:57 +10:00
Pokechu22
adfbbe3a02 Disallow changing the backend when running when software renderer is currently selected
It already is disabled for other backends, but this didn't happen with the software renderer.  Attempting to change it while running causes the change to visually happen (including switching to the normal render settings UI instead of the barren one for the software renderer), but doesn't actually change the backend itself (it'll still use the software renderer at the next launch).
2019-06-08 16:25:27 -07:00
Lioncash
92b445618a VideoCommon/DriverDetails: Make look-up table immutable
Previously, this array potentially wouldn't be placed within the
read-only segment, since it wasn't marked const. We can make the lookup
table const, along with any other nearby variables.
2019-06-08 18:06:36 -04:00
Lioncash
632b953ebf Core/GeckoCodeConfig: Use the [[fallthrough]] attribute in LoadCodes()
Makes it explicit that this fallthrough is intentional.
2019-06-08 17:55:01 -04:00
Léo Lam
d927cd2b03
Merge pull request #8162 from lioncash/label
DSP/LabelMap: C++17 transitional changes/cleanup
2019-06-08 18:16:20 +02:00
Connor McLaughlin
951b66e4ac
Merge pull request #8049 from stenzek/crop
Renderer: Adjust source rectangle when crop would draw off screen
2019-06-08 20:57:52 +10:00
Connor McLaughlin
b13e00b003
Merge pull request #8165 from lioncash/linkage
{Android/ButtonManager, ResourcePack/Manager}: Make file-scope variables/functions internally linked where applicable
2019-06-08 20:56:13 +10:00
Connor McLaughlin
ab66e91766
Merge pull request #8134 from JosJuice/filesystem-string-view
DiscIO: Use std::string_view in FileSystem::FindFileInfo
2019-06-08 20:52:34 +10:00
Connor McLaughlin
bed2d66bed
Merge pull request #8117 from weihuoya/threaded_env
android: get java env from thread local storage
2019-06-08 20:42:15 +10:00
Connor McLaughlin
5a4e2a6b2f
Merge pull request #7734 from stenzek/mojave-warning
Vulkan: Display a warning when using MoltenVK on HS and earlier
2019-06-08 20:41:39 +10:00
Connor McLaughlin
6567409177
Merge pull request #8096 from stenzek/d3d-old-drivers
D3DCommon: Fallback to base CreateSwapChain on failure
2019-06-08 20:41:04 +10:00
Stenzek
3f1586dbce Vulkan: Display a warning when using MoltenVK on HS and earlier 2019-06-08 20:16:24 +10:00
Stenzek
1028e2c1a6 D3D12: Remove unnecessary includes in DXContext.h 2019-06-08 20:12:15 +10:00
Stenzek
9316e25652 D3DCommon: Fallback to base CreateSwapChain on failure
It appears that some older drivers do not support
CreateSwapChainForHwnd, resulting in DXGI_ERROR_INVALID_CALL. For these
cases, fall back to the base CreateSwapChain() from DXGI 1.0.

In theory this should also let us run on Win7 without the platform
update, but in reality we require the newer shader compiler so this
probably won't work regardless. Also any hardware of this vintage is
unlikely to run Dolphin well.
2019-06-08 20:11:49 +10:00
Connor McLaughlin
0177c6c2c7
Merge pull request #8146 from Techjar/netplay-network-opts
Qt/NetPlayDialog: Change network mode options to radio buttons
2019-06-08 20:05:35 +10:00
Connor McLaughlin
6b4ca318c9
Merge pull request #8139 from lioncash/const
VideoCommon/PixelShaderGen: Make look-up table arrays immutable where applicable
2019-06-08 20:03:02 +10:00
Connor McLaughlin
67a9fc6784
Merge pull request #8163 from lioncash/config
Core/ConfigManager: Use forward declarations where applicable
2019-06-08 20:01:15 +10:00
Connor McLaughlin
b7fba95cdf
Merge pull request #8166 from lioncash/mbedtls
Externals: Update mbedTLS from 2.1.1 to 2.16.1
2019-06-08 19:58:37 +10:00
Connor McLaughlin
f75b254d4f
Merge pull request #8167 from JosJuice/recording-export-enable
DolphinQt: Don't leave Export Recording disabled always
2019-06-08 19:58:12 +10:00