Commit graph

26901 commits

Author SHA1 Message Date
JosJuice
4261e8d892 Android: Add a bit more warning to the game INI deletion prompt 2019-08-04 19:31:56 +02:00
Allan
7029ebd97b Fix for crash when switching to landscape mode
https://bugs.dolphin-emu.org/issues/10815
2019-08-04 13:47:19 -03:00
Lioncash
8285a94d93 UICommon/NetPlayIndex: Take std::vector by const reference in ParseResponse()
This variable isn't std::moved anywhere and is just read out of into a
string. Instead of making a copy, and then another copy of the data into
a std::string, we can take it by reference, only copying the data once.
2019-08-04 12:36:52 -04:00
Lioncash
75f3656804 UICommon/NetPlayIndex: Use a std::string_view for EncryptID()/DecryptID()
These parameters only acted as views into the provided strings, so these
can just be turned into non-owning string views.
2019-08-04 12:32:33 -04:00
Lioncash
2830fe820d UICommon/NetPlayIndex: Take NetPlaySession by const reference for Add()
This isn't std::moved wholesale into a member variable or further
std::moved into another function, so it's better to take it by const
reference here to avoid unnecessary reallocations of contained
std::string instances.
2019-08-04 12:29:17 -04:00
Lioncash
0a67a40e7c UICommon/NetPlayIndex: Move NetPlaySession variable closer to its usage point in List()
Moves it closer to where its used, narrowing its visible scope, as well
as preventing unnecessary std::string constructor executions in the
event invalid data is encountered (the continue branch).
2019-08-04 12:24:04 -04:00
Lioncash
13292563ee UICommon/NetPlayIndex: Use std::move within SetErrorCallback()
std::function is allowed to heap allocate in order to store captured
variables, etc, so std::function isn't a trivial type. We can std::move
here in order to avoid potential reallocating.

While we're at it, make the definition's parameter name match the
declaration's parameter name for consistency.
2019-08-04 12:21:02 -04:00
Lioncash
5220922a22 UICommon/NetPlayIndex: Allow move semantics in SetGame()
If the parameter is const, then a move won't actually be able to occur,
making the std::move non-functional. We can remove the const qualifier
to remedy this.
2019-08-04 12:16:19 -04:00
Miksel12
9395d7ea08 DolphinQt: Reorder nunchuk mapping 2019-08-04 14:02:43 +02:00
Connor McLaughlin
d3151d8808
Merge pull request #8278 from Miksel12/qt-changes
DolphinQt: Limit numeric widget width
2019-08-04 20:28:17 +10:00
Connor McLaughlin
7de6b57c13
Merge pull request #8284 from stenzek/logic-op-hack
RenderState: Approximate logic op with blending if unsupported
2019-08-04 14:39:38 +10:00
Connor McLaughlin
c829351c90
Merge pull request #8286 from stenzek/efb-savestate-fixes
FramebufferManager: Fix restoring of EFB depth buffer / upside-down in OpenGL
2019-08-04 14:07:18 +10:00
Stenzek
f6f9dc0cac RenderState: Approximate logic op with blending if unsupported
This is a giant hack which was previously removed because it causes
broken rendering. However, it seems that some devices still do not
support logical operations (looking at you, Adreno/Mali). Therefore, for
a handful of cases where the hack actually makes things slightly better,
we can use it.

... but not without spamming the log with warnings. With my warning
message PR, we can inform the users before emulation starts anyway.
2019-08-04 14:06:08 +10:00
Connor McLaughlin
4ccb4ef74f
Merge pull request #8283 from stenzek/d3d11-null-render-target
D3D11: Only use integer RTV when logic op is supported+enabled
2019-08-04 13:14:35 +10:00
JosJuice
64c0ff576c
Merge pull request #8285 from lioncash/dinput-ffe
InputCommon/DInputJoystick: Correct force-feedback flag testing
2019-08-03 10:09:31 +02:00
JosJuice
2770707587
Merge pull request #8287 from lioncash/static-ctor
DiscIO/Volume: Make Partition's interface constexpr
2019-08-03 10:07:53 +02:00
Lioncash
db3b31c246 DiscIO/Volume: Make Partition's interface constexpr
PARTITION_NONE technically has a runtime static constructor otherwise.
This allows compile-time instances of Partition to be created without
the use of a static constructor.
2019-08-02 18:25:09 -04:00
Mike Kuijl
cbfc442e90 DolphinQt: Limit numeric widget width 2019-08-02 18:20:37 +02:00
Stenzek
d6460e0b18 FramebufferShaderGen: Fix upside-down EFB being restored in OpenGL 2019-08-03 01:48:57 +10:00
Stenzek
25b3e5e029 FramebufferManager: Fix restoring of EFB depth buffer
Correct state wasn't being set.
2019-08-03 01:46:54 +10:00
Connor McLaughlin
7afba6776f
Merge pull request #8279 from spycrab/fix_save_state_wait
Fix saving states freezing up emulation
2019-08-03 01:26:07 +10:00
Lioncash
37d643c7d3 InputCommon/DInputJoystick: Correct force-feedback flag testing
Introduced in a995e2f5ba

We need to be performing a bitwise AND on the flags and not a logical
AND, otherwise we could end up counting device objects that don't
support forced feedback.
2019-08-02 10:26:44 -04:00
Stenzek
d78a9356d2 D3D11: Only use integer RTV when logic op is supported+enabled 2019-08-02 18:47:19 +10:00
JMC47
b01cacb27e
Merge pull request #8236 from booto/si_greatest_hits_vol_1
SI: Minor bugfixes
2019-08-02 03:17:54 -04:00
Silent
3fe8ef4c1c
Make alert messages application modal and not window modal,
so assertions cannot be interrupted by terminating the application
2019-08-01 22:27:36 +02:00
spycrab
04764f8b7f Fix saving states freezing up emulation
Only for about half a second but noticeable nonetheless
2019-08-01 21:33:12 +02:00
Lioncash
ff8f627499 DolphinQt/Config/GeckoCodeWidget: Use forward declarations where applicable
Avoids propagating headers into scopes where they're not needed.
2019-07-31 09:54:54 -04:00
Lioncash
14263ec6dd DolphinQt/Config/GeckoCodeWidget: Call LoadDefaultGameIni() directly
This is a static class function, so we don't need to go through the
SConfig instance in order to call it.
2019-07-31 09:54:54 -04:00
Lioncash
6002529ece DolphinQt/Config/GeckoCodeWidget: Make exec() outcomes explicit
Makes it a little more explicit which dialog outcomes we're expecting.
While we're at it, we can invert them into guard clauses to unindent
code a little bit.
2019-07-31 09:54:54 -04:00
Lioncash
255d2ff2d2 DolphinQt/Config/GeckoCodeWidget: Deduplicate ini path
We can store this to a local variable to avoid duplicating the same
string creation twice.
2019-07-31 09:54:53 -04:00
Lioncash
a07d19a2fd DolphinQt/Config/ARCodeWidget: Use forward declarations where applicable
Avoids propagating headers into scopes where they're not necessary.

Also uncovered reliance on an indirect inclusion within
CheatsManager.cpp, which is now fixed.
2019-07-31 09:48:45 -04:00
Lioncash
e08a76f9e2 DolphinQt/Config/ARCodeWidget: Call LoadDefaultGameIni() directly
This is a static function, so we don't need to go through the instance
of SConfig in order to call it.
2019-07-31 09:08:31 -04:00
Lioncash
4d8d2acae7 DolphinQt/Config/ARCodeWidget: Avoid unnecessary disk operations
If a user indicates that they want to clone and edit an AR code, then
click cancel on the following dialog, we shouldn't actually clone the
code.

We also shouldn't resave the codes if the edit dialog is opened and then
closed again via cancel, as there's nothing that actually changed. This
way we don't perform disk accesses unless they're actually necessary.
2019-07-31 09:01:38 -04:00
Lioncash
0d406f2bdc DolphinQt/Config/ARCodeWidget: Deduplicate ini path
We can just store this to a const local and use it to avoid doing the
same work twice.
2019-07-31 08:36:00 -04:00
Stenzek
06daf58032 FramebufferManager: Correctly handle read back D24S8 textures
Needed for the Adreno/Vulkan workaround, and if we ever switch to a D24
texture for the depth buffer w/ unrestricted depth range.
2019-07-31 15:33:28 +10:00
Stenzek
2698e311aa Vulkan: Use correct aspect for D24S8 textures 2019-07-31 15:33:05 +10:00
Brandon Rothweiler
fdfa14d9cc Show a message in netplay chat when a player joins or leaves 2019-07-30 20:14:51 -07:00
Lioncash
6e14dcf70a DolphinQt/Config/GameConfigEdit: Pass parent pointer to base class
Previously, the constructor of GameConfigEdit wasn't doing anything with
the passed in parent pointer. This is dangerous because it can result in
memory being leaked in certain scenarios. It can also affect layout
decisions made by the parent. Instead, pass it through to the base class.

Current usages of the class pass in nullptr as the parent, so this is a
safe change to make with regards to the class hierarchy.

While we're at it, we can std::move the passed in QString into the class
member, allowing calling code to move strings into the constructor,
avoiding copies.
2019-07-30 19:17:25 -04:00
Lioncash
fef1b84f0a DolphinQt: Replace QStringLiteral with alternatives where applicable
QStringLiterals generate a buffer so that during runtime there's very
little cost to constructing a QString. However, this also means that
duplicated strings cannot be optimized out into a single entry that gets
referenced everywhere, taking up space in the binary.

Rather than use QStringLiteral(""), we can just use QString{} (the
default constructor) to signify the empty string. This gets rid of an
unnecessary string buffer from being created, saving a tiny bit of
space.

While we're at it, we can just use the character overloads of particular
functions when they're available instead of using a QString overload.
The characters in this case are Latin-1 to begin with, so we can just
specify the characters as QLatin1Char instances to use those overloads.
These will automatically convert to QChar if needed, so this is safe.
2019-07-30 09:06:03 -04:00
Connor McLaughlin
dea2b9c509
Merge pull request #8258 from CookiePLMonster/dx11.1-detection-fixes
D3D11 resources refactor and DX11.1 feature detection fixes
2019-07-30 01:24:57 +10:00
Silent
baa9636d48
D3D11: Add extra logging to StateCache::Get 2019-07-29 16:48:24 +02:00
Silent
43bfb183c2
D3D11: Show a warning message about unsupported features when switching to D3D11 backend on Windows 7 2019-07-29 16:47:45 +02:00
Silent
ff00873610
D3D11: Query for output merger logic op support and use logic op code only if supported
Previously code assumed that if DX11.1 runtime is supported, logic ops will,
but Windows 7 SP1 with a Platform Update supports DX11.1 runtime without logic ops.
This created pretty jarring visual artifacts, which now should be gone OR replaced
with much less jarring errors.
2019-07-29 16:47:39 +02:00
Silent
a6b8e8b9c3
D3D11: Ownership fixes for objects in DXTexture 2019-07-29 16:43:02 +02:00
Silent
77425ef83b
D3D11: Ownership fixes for objects in D3DState 2019-07-29 16:39:21 +02:00
Silent
88db577c17
D3D11: Correctly poll ALL possible AA levels. 2019-07-29 16:39:06 +02:00
Lioncash
c93fffaed6 DolphinQt/HotkeyScheduler: Correct string within Run()
AddMessage() by itself doesn't perform string formatting facilities, so
this message was actually using the EFB scale as a duration value, not a
format argument. This corrects that.
2019-07-28 23:16:23 -04:00
Lioncash
3f947f086f VideoCommon/OnScreenDisplay: Use deduction guides for std::lock_guard
Same behavior without hardcoding the type of the mutex within the lock
guards. This means the type of the mutex would be able to be changed
without needing to also change all occurrences lock guards are used.
2019-07-28 23:08:21 -04:00
Lioncash
a565e41cb8 VideoCommon/OnScreenDisplay: Remove unused headers
While we're at it, fix up the imgui include to use the convention we use
for referencing external library headers.
2019-07-28 23:04:52 -04:00
Lioncash
c212310fbe VideoCommon/OnScreenDisplay: Take Message's std::string parameter by value
Allows callers to std::move strings into the functions (or automatically
assume the move constructor/move assignment operator for rvalue
references, potentially avoiding copies altogether.
2019-07-28 23:00:58 -04:00
Lioncash
50b240fcbd VideoCommon/OnScreenDisplay: Default initialize all Message members
Provides a deterministic initial state in the case of the default
constructor.
2019-07-28 22:42:45 -04:00
Connor McLaughlin
b0113b6c64
Merge pull request #8266 from lioncash/shadowing
D3DCommon/Shader: Use std::optional where applicable
2019-07-28 14:24:32 +10:00
Connor McLaughlin
5bad233b1a
Merge pull request #8265 from lioncash/view
OGL/ProgramShaderCache: Use std::string_view where applicable
2019-07-28 14:21:59 +10:00
Lioncash
6db305a4e8 VideoBackends/Null: Add missing override specifiers
Applies a missing override specifier to VertexManager's destructor.
2019-07-27 17:33:18 -04:00
Lioncash
23c5b362a5 VideoBackends/Null: Apply final to classes where applicable
These aren't intended to be further specialized, so we can make this
obvious with final.
2019-07-27 17:33:18 -04:00
Lioncash
86000fc6b4 VideoBackends/Null: Remove unnecessary constructors and destructors
Removes constructors and destructors that don't actually provide any
behavior (i.e. doesn't constain generated code related to non-trivial
members in a cpp file, etc).

Lessens the amount of code present.
2019-07-27 17:33:18 -04:00
Lioncash
bdcc5853d5 VideoBackends/Null: Remove unnecessary includes 2019-07-27 17:33:16 -04:00
Lioncash
aca02f9734 D3DCommon/Shader: Use std::optional with CompileShader()
Allows removing the use of an out parameter, making it nicer to use.
2019-07-26 20:06:14 -04:00
Lioncash
0ce6264f90 D3DCommon/Shader: Create vector via iterators in CreateByteCode()
Same behavior, but without unnecessary zeroing of data contents.
Instead, we supply the dataset to use directly.
2019-07-26 19:45:33 -04:00
Lioncash
287b446ef7 D3D/DXShader: Remove duplicate GetByteCode function
This is already provided in the base class, which performs the same
exact behavior. Given the function in the base class isn't virtual, this
also essentially resolves an instance of shadowing.
2019-07-26 19:45:23 -04:00
Lioncash
67bd2de73e OGL/ProgramShaderCache: Convert typedef over to a using alias
Same thing, but nicer to read from left to right.
2019-07-26 18:43:44 -04:00
Lioncash
d6617d399f OGL/ProgramShaderCache: Use std::lock_guard deduction guides where applicable
Same thing, less reading.
2019-07-26 18:22:55 -04:00
Lioncash
6e69e3cf26 OGL/ProgramShaderCache: Remove unused headers
Removes a few inclusions that aren't necessary, reducing the number of
header dependencies.
2019-07-26 18:09:44 -04:00
Lioncash
fb384dec55 OGL/ProgramShaderCache: Use std::string_view where applicable 2019-07-26 18:02:00 -04:00
Silent
890f781cd0
Factorize software renderer backend switching warning to be fetched from a new GetWarningMessage in video backend - will be needed for DX11.1 feature set warnings 2019-07-26 19:39:07 +02:00
Silent
799c52463e
Fixes for WRL usage - QueryInterface is explicitly mentioned as not to be used with WRL ComPtr 2019-07-26 19:38:58 +02:00
Connor McLaughlin
d48dabc1fd
Merge pull request #8259 from stenzek/macos-disable-reversed-depth
Vulkan: Disable reversed viewport depth on macOS/MoltenVK
2019-07-25 14:11:09 +10:00
Connor McLaughlin
a8bbbd0bfc
Merge pull request #8262 from Tilka/gdbstub
Fix GDB stub build
2019-07-25 13:54:02 +10:00
Connor McLaughlin
ac9912bad3
Merge pull request #6321 from stenzek/efb-savestates
Support saving EFB and texture cache in save states
2019-07-25 13:50:57 +10:00
Silent
3529dfd691
Connect numerous QPushButtons to use clicked signal instead of pressed. This unifies UI behaviour more. 2019-07-24 00:18:58 +02:00
Stenzek
53e30c06e8 Config: Add an option to skip saving texture cache to save state 2019-07-24 05:19:22 +10:00
Stenzek
63358adfb1 Core: Save movie state before video backend state
Fixes the old frame number/inputs being displayed after loading state.
2019-07-24 05:19:22 +10:00
Stenzek
560074cf9f Core: Fix crash when state is loaded while waiting for the CPU 2019-07-24 05:19:22 +10:00
Stenzek
137009affe FramebufferManager: Support saving EFB to save state 2019-07-24 05:19:22 +10:00
Stenzek
1082468133 TextureCache: Support saving cache entries, including EFB copies 2019-07-24 04:10:38 +10:00
Stenzek
b26bb0605b VideoBackendBase: Do save state logic on the GPU thread 2019-07-24 04:08:25 +10:00
Stenzek
a25a4e0708 State: Use RunOnCPUThread to invoke save state handlers
This ensures that the emulated state is only touched by the CPU thread
2019-07-24 04:08:25 +10:00
Stenzek
df45e714a3 Core: Support asynchronously executing functions on the CPU thread
The CPU thread will be interrupted to execute the callback, and then
restored to its old state after execution completes.
2019-07-24 04:08:19 +10:00
JosJuice
117a60ceb2 StringUtil: Comply with variable naming style 2019-07-23 14:49:13 +02:00
JosJuice
a2a1e04fc9 StringUtil: Use std::string_view more 2019-07-23 14:49:12 +02:00
Lioncash
1f98188277 Core/Core: Use fmt where applicable
Continues the migration over to using fmt. Given fmt is also compatible
with std::string and std::string_view, we can convert some parameters
over to std::string_view, such as the message parameter for
StopMessage() and the name parameter for an overload of SaveScreenShot()
2019-07-23 08:42:29 -04:00
Léo Lam
29ba53f6c3
Merge pull request #8256 from JosJuice/setrunninggamemetadata-channel-disc
Never set disc as active title when launching channel with same ID
2019-07-23 09:47:55 +08:00
Léo Lam
c8c1a0d747
Merge pull request #8253 from JosJuice/fakesigned-common-key-fix
Re-implement FixCommonKeyIndex for WAD files
2019-07-23 09:41:46 +08:00
Connor McLaughlin
8f6b237e11
Merge pull request #8217 from CookiePLMonster/windows-updater-improvements
Updates to auto-updater on Windows
2019-07-23 10:39:04 +10:00
Anthony
66e7a11139
Merge pull request #8235 from lioncash/move
Common/DebugInterface: Minor cleanup changes
2019-07-22 15:07:14 -07:00
Anthony
136264d340
Merge pull request #8245 from JosJuice/volumeverifier-wii-menu-region
Fix VolumeVerifier considering Wii Menu WADs to have wrong region
2019-07-22 15:06:07 -07:00
JosJuice
8bb333d811 ConfigManager: Include "Common/Common.h" for _trans macro
Aims to fix https://github.com/dolphin-emu/dolphin/pull/8232#issuecomment-513913625
2019-07-22 22:23:46 +02:00
Silent
baab660f1c
WinUpdater: Removed MAX_PATH limitation on path to updater, also fixed a wrong size parameter 2019-07-22 19:46:25 +02:00
Silent
94a19ca670
Qt/Updater: Fixed an assert on m_parent->close() (was called from a wrong thread) 2019-07-22 19:30:02 +02:00
Silent
4b03790eda
Core: Fixup AutoUpdateChecker::TriggerUpdate on Windows:
- Properly close handles if Updater.exe process spawns successfully
- Fix STARTUPINFO sizeof typo
2019-07-22 19:29:50 +02:00
Silent
a00dfeecf0
WinUpdater: Properly account for failure in WaitForPID 2019-07-22 19:29:22 +02:00
Silent
d355abaf0c
WinUpdater: Improved exit synchronization on Windows - now joins a thread instead of using flags to signal 2019-07-22 19:28:20 +02:00
Silent
3f1ba830e7
UpdaterCommon: Remove manual UI::Stop() calls in favour of a scope guard to ensure it's called on all return paths 2019-07-22 19:16:22 +02:00
Silent
2ae409ba06
WinUpdater: Replaced PeekMessage with GetMessage - removes a busy loop in favour of a proper wait based message queue 2019-07-22 19:16:14 +02:00
Léo Lam
15679a9a70
Merge pull request #8227 from lioncash/gekko
Common/GekkoDisassembler: Don't print out '\0' as a character
2019-07-22 21:39:49 +08:00
Léo Lam
60aea524b1
Merge pull request #8232 from JosJuice/wasapi-translatable
Mark "WASAPI (Exclusive Mode)" as translatable
2019-07-22 21:38:39 +08:00
Léo Lam
71b2e1a997
Merge pull request #8225 from JosJuice/sd-hotkey
Add a hotkey for inserting/ejecting the SD card
2019-07-22 21:38:00 +08:00
JosJuice
73a9b4148b
Merge pull request #8257 from CookiePLMonster/assert-fixes
Fixes to assertions
2019-07-22 08:47:13 +02:00
Silent
518d96ad48
Remove duplicated "Ignore and countinue?" 2019-07-21 15:36:24 +02:00
JosJuice
f3b9d93737 TitleDatabase: Don't crash on unknown language
This only happens if the GC or Wii language is set to an
invalid value, but it's best to guard against it anyway.
2019-07-21 10:15:38 +02:00