Commit Graph

39709 Commits

Author SHA1 Message Date
get
a5d06fde4b Embrace nullptr over NULL and 0 2023-04-15 16:07:05 -05:00
Robin Kertels
57ed5320b5
Android: Fix various issues with the DocumentProvider
Fixes copying & deleting folders and copy conflict handling.
2023-04-15 20:53:01 +02:00
Lioncash
784a216927 Common/MathUtil: Move IntLog2 into MathUtil namespace
Gets this out of the global namespace.
2023-04-15 03:35:05 -04:00
Lioncash
5e0c20f8a5 Common/MathUtil: Remove MathFloatVectorSum()
This isn't used anywhere and not really a generic utility, so we can get
rid of it.

This also lets us remove MathUtil.cpp, since this was the only thing
within that file.
2023-04-15 03:25:38 -04:00
LillyJadeKatrin
31c3288fd5 Added ActivateDeactivateRichPresence to AchievementManager
RetroAchievements Rich Presence is a script that is run periodically on a game's memory to provide a detailed text description of what the player is doing. Existing Discord presence on Dolphin would update a player's Discord status to say not just that they are using Dolphin but that they are playing, for example, Sonic Adventure 2 Battle; Rich Presence would detail that the player is in City Escape with 5 lives and 142 rings.

Activating this in the runtime simply entails loading that text script, as returned by the FetchGameData API call, into the runtime, here only determined by whether rich presence is enabled in the achievement settings. Deactivating this is done via the same rcheevos method by setting the rich presence to an empty string.
2023-04-14 22:22:00 -04:00
LillyJadeKatrin
64e3a64c87 Added ActivateDeactivateLeaderboards to AchievementManager
This activates or deactivates leaderboards in the rcheevos runtime similarly to achievements. The logic is much more straightforward - all leaderboards are active together; there is nothing requiring some leaderboards to be active while others are unactive, and even a leaderboard that has been submitted to in this session is still active to be submitted to again. The only criteria are that leaderboards must be enabled in the settings, and hardcore mode must be on, the latter of which is false until a future PR.
2023-04-14 22:22:00 -04:00
LillyJadeKatrin
da1de36cb9 Added LoadUnlockData and ActivateDeactivateAchievements to AchievementManager
LoadUnlockData and ActivateDeactivateAchievements are the public API components responding to the FetchUnlocks and A/DAchievement (singular) private methods.

LoadUnlockData is asynchronous and performs both a hardcore and a softcore unlock call, updating the unlock map and the active status of any achievements returned from these calls.

ActivateDeactivateAchievements calls ActivateDeactivateAchievement on every achievement ID found in m_game_data, initializing the unlock map for each ID if not already found.

Both of these are currently called in LoadGameByFilenameAsync once the game has been loaded properly. There's a lock around this, to ensure that the unlock map is initialized properly by ActivateDeactivate Achievements before FetchUnlockData makes modifications to it without stalling the async portions of FetchUnlockData.
2023-04-14 22:22:00 -04:00
LillyJadeKatrin
db44e10057 Added FetchUnlockData to AchievementManager
FetchUnlockData is an API call to RetroAchievements that downloads a list of achievement IDs for a game that the user has already unlocked and published to the site. It accepts a parameter for whether or not hardcore or softcore achievements are being requested, so that must be provided as well. Once it has the requested list on hand, it updates each achievement's status in the unlock map and will activate or deactivate achievements as necessary.
2023-04-14 22:22:00 -04:00
LillyJadeKatrin
505f40cf9d Added ActivateDeactivateAchievement to AchievementManager
ActivateDeactivateAchievement is passed an Achievement ID as returned from the FetchGameData API call and determines whether to activate it, deactivate it, or leave it where it is based on its current known state and what settings are enabled.

Activating or deactivating an achievement entails calling a method provided by rcheevos that performs this on the rcheevos runtime. Activating an achievement loads its memory signature into the runtime; now the runtime will process the achievement each time the rc_runtime_do_frame function is called (this will be in a future PR) to determine when the achievement's requirements are met. Deactivating an achievement unloads it from the runtime.

The specific logic to determine whether an achievement is active operates over many fields but is documented in detail inside the function. There are multiple settings flags for which achievements are enabled (one flag for all achievements, an "unofficial" flag for enabling achievements marked as unofficial i.e. those that have logic on the site but have not yet been officially approved, and an "encore" flag that enables achievements the player has already unlocked) and this function also evaluates whether the achievement has been unlocked in hardcore mode or softcore mode (though currently every reference to the current hardcore mode state is hardcoded as false).
2023-04-14 17:15:45 -04:00
Admiral H. Curtiss
e9dbb93cb5
Merge pull request #11756 from lioncash/ini
Common/IniFile: Move interface into Common namespace
2023-04-14 20:52:30 +02:00
TellowKrinkle
09c80513cd VideoBackends:Metal: Fix perf queries
Fixes an issue where perf queries could end up including counts from previous queries
2023-04-14 00:25:31 -05:00
Léo Lam
ae18aa0639
Merge pull request #11687 from Minty-Meeo/warnings
Resolve GCC/Clang Warnings
2023-04-14 01:29:46 +01:00
Lioncash
e4caace6bb Common/IniFile: Move interface into Common namespace
Gets this out of the global namespace and into the Common namespace
2023-04-13 10:19:28 -04:00
Mai
5c03b8af88
Merge pull request #11755 from OatmealDome/mvk-1.2.3
Externals: Update MoltenVK to 1.2.3
2023-04-12 22:06:42 -04:00
OatmealDome
0753b3b6ed Externals: Update MoltenVK to 1.2.3 2023-04-12 16:42:44 -04:00
OatmealDome
33836d630a Externals: Update SDL to 2.26.5 2023-04-12 16:00:08 -04:00
Admiral H. Curtiss
1e4b0d032e
Merge pull request #11753 from lioncash/upnp
Common/UPnP: Move interface into Common namespace
2023-04-12 21:33:16 +02:00
Lioncash
f5bdfdde1a Common/UPnP: Move interface into Common namespace
Keeps these utilities consistent with the rest of most of the Common
library.
2023-04-12 14:15:58 -04:00
Admiral H. Curtiss
c5bbe0af02
Merge pull request #11730 from LillyJadeKatrin/retroachievements-load-game-data
RetroAchievements Load Game Data
2023-04-12 11:50:50 +02:00
Minty-Meeo
f29019180f Pragma diagnostic ignore [-Wregister] is no longer needed 2023-04-12 03:59:57 -05:00
Minty-Meeo
65edfb0eed Resolve [-Wunused-const-variable] 2023-04-12 03:59:57 -05:00
Minty-Meeo
244918acb8 Resolve [-Wdeprecated-declarations] 2023-04-12 03:59:57 -05:00
Minty-Meeo
528f7c90e9 Resolve [-Wtautological-constant-out-of-range-compare] 2023-04-12 03:59:57 -05:00
Minty-Meeo
efd06a85d2 Resolve [-Wunused-but-set-variable] 2023-04-12 03:59:57 -05:00
Minty-Meeo
678c93589a Resolve [-Wclass-memaccess] 2023-04-12 03:59:57 -05:00
LillyJadeKatrin
6982f52f6e Updated rcheevos submodule
Update the rcheevos submodule to the most recent origin/develop, which contains a fix to the gamecube hash algorithm to politely exit if it is unable to open a file.
2023-04-12 03:08:47 -04:00
LillyJadeKatrin
8b57c4b239 Added LoadGameByFilenameAsync and CloseGame to AchievementManager
LoadGameByFilenameAsync sets up a volume reader and hashes the volume, then uses that hash to make the three consecutive API requests to resolve hash, start session and load game data.

CloseGame resets the m_is_game_loaded flag, wipes the queue, and destroys all the game data responses.
2023-04-12 03:08:47 -04:00
LillyJadeKatrin
bd75ce6e6d Added FetchGameData to AchievementManager
FetchGameData is the big one - this retrieves the logic for all the achievements, leaderboards, and rich presence, and all the relevant metadata for the game.
2023-04-12 03:08:47 -04:00
LillyJadeKatrin
7e8a770b30 Added StartRASession to AchievementManager
Added a call to the RetroAchievements Start Session API to AchievementManager. This is primarily for client-side activation, so it doesn't return much of value, aside from its success/error information, but I'm storing the return structure in case this changes in the future.
2023-04-12 03:08:47 -04:00
LillyJadeKatrin
67ab4d2473 Added ResolveHash to AchievementManager
Added the ResolveHash method to AchievementManager. This is a blocking function to send a hash string to the RetroAchievements server to verify it and get a game ID back.
2023-04-12 03:08:47 -04:00
Admiral H. Curtiss
31d2dedcb1
Merge pull request #11749 from lioncash/copy
NetPlayServer: Prevent unnecessary copies in GetInterfaceSet()
2023-04-11 22:09:56 +02:00
Admiral H. Curtiss
d6ae7ad59c
Merge pull request #11748 from lioncash/enet
Common/ENetUtil: Move interface into Common namespace
2023-04-11 21:58:52 +02:00
Lioncash
09e11b8067 Common: Rename ENetUtil.cpp/.h to ENet.cpp/.h 2023-04-11 11:48:46 -04:00
Lioncash
81493ee910 NetPlayServer: Prevent unnecessary copies in GetInterfaceSet()
This was previously copying each pair out of the vector returned by
GetInterfaceListInternal() when we just need to emplace the first entry
of each pair.
2023-04-11 09:17:03 -04:00
Lioncash
64ce2012e3 Common/ENetUtil: Move interface into Common namespace
Rather than just being under a separate ENetUtil namespace, we can unify
this into the common namespace as Common::ENet.
2023-04-11 09:12:04 -04:00
Pierre Bourdon
af52b5a2d9
Merge pull request #11710 from TellowKrinkle/SDL2Framework
CMake: Fix building against macOS framework builds of SDL
2023-04-11 04:30:17 +02:00
Léo Lam
e225ca87a9
Merge pull request #11722 from noahpistilli/write-dl-entry
IOS/Network/KD: Reload DLList on call to DownloadNowEx
2023-04-11 02:08:51 +01:00
Admiral H. Curtiss
948a548fb2
Merge pull request #11720 from Pokechu22/hookable-event-recursive-mutex
HookableEvent: Use std::recursive_mutex instead of std::mutex
2023-04-10 22:50:44 +02:00
Minty-Meeo
2bb619a508 Resolve [-Wstringop-overflow=] 2023-04-10 14:21:15 -05:00
Minty-Meeo
3282082599 Resolve [-Wwrite-strings] 2023-04-10 14:21:15 -05:00
Minty-Meeo
d9a49c68d9 Resolve [-Wunused-lambda-capture] 2023-04-10 14:21:15 -05:00
Minty-Meeo
1cf30055b2 Resolve [-Wsign-compare] 2023-04-10 14:21:15 -05:00
Admiral H. Curtiss
fdc1ff1dad
Merge pull request #11711 from AdmiralCurtiss/ios-fs-stats
IOS/FS: More accurate emulation of GetDirectoryStats() and GetNandStats().
2023-04-10 20:01:51 +02:00
Admiral H. Curtiss
5373fcc1e7
IOS/FS: Filter files exposed to the emulated system in ReadDirectory() and GetDirectoryStats(). 2023-04-10 19:50:08 +02:00
Admiral H. Curtiss
5c05155828
IOS/FS: Implement GetNandStats(). 2023-04-10 19:50:08 +02:00
Admiral H. Curtiss
8295d6d415
IOS/FS: More accurate cluster calculation in GetDirectoryStats(). 2023-04-10 19:50:08 +02:00
Admiral H. Curtiss
69d6be09f7
IOS/FS: GetDirectoryStats() should return an error if the given path is not a directory. 2023-04-10 19:50:08 +02:00
JosJuice
4c80c992eb
Merge pull request #11741 from AdmiralCurtiss/ppc-class
PowerPC: Refactor to class, move to System.
2023-04-10 15:38:19 +02:00
Admiral H. Curtiss
23843583bf
PowerPC: Refactor to class, move to System. 2023-04-09 21:48:37 +02:00
Pierre Bourdon
ebbbdc49ab
Merge pull request #11745 from JosJuice/transifex-url
Readme: Update Transifex URL
2023-04-09 11:45:56 +02:00