mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Merge pull request #11872 from LillyJadeKatrin/retroachievements-bugfix
RetroAchievements Bugfix: Fixed Missing DoFrame Call
This commit is contained in:
@ -176,6 +176,8 @@ void AchievementManager::LoadGameByFilenameAsync(const std::string& iso_path,
|
|||||||
}
|
}
|
||||||
ActivateDeactivateLeaderboards();
|
ActivateDeactivateLeaderboards();
|
||||||
ActivateDeactivateRichPresence();
|
ActivateDeactivateRichPresence();
|
||||||
|
// Reset this to zero so that RP immediately triggers on the first frame
|
||||||
|
m_last_ping_time = 0;
|
||||||
|
|
||||||
callback(fetch_game_data_response);
|
callback(fetch_game_data_response);
|
||||||
});
|
});
|
||||||
@ -255,9 +257,13 @@ void AchievementManager::DoFrame()
|
|||||||
});
|
});
|
||||||
if (!m_system)
|
if (!m_system)
|
||||||
return;
|
return;
|
||||||
u64 current_time = m_system->GetCoreTiming().GetTicks();
|
time_t current_time = std::time(nullptr);
|
||||||
if (current_time - m_last_ping_time > SystemTimers::GetTicksPerSecond() * 120)
|
if (difftime(current_time, m_last_ping_time) > 120)
|
||||||
m_queue.EmplaceItem([this] { PingRichPresence(GenerateRichPresence()); });
|
{
|
||||||
|
RichPresence rp = GenerateRichPresence();
|
||||||
|
m_queue.EmplaceItem([this, rp] { PingRichPresence(rp); });
|
||||||
|
m_last_ping_time = current_time;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 AchievementManager::MemoryPeeker(u32 address, u32 num_bytes, void* ud)
|
u32 AchievementManager::MemoryPeeker(u32 address, u32 num_bytes, void* ud)
|
||||||
@ -298,6 +304,9 @@ void AchievementManager::AchievementEventHandler(const rc_runtime_event_t* runti
|
|||||||
case RC_RUNTIME_EVENT_LBOARD_STARTED:
|
case RC_RUNTIME_EVENT_LBOARD_STARTED:
|
||||||
HandleLeaderboardStartedEvent(runtime_event);
|
HandleLeaderboardStartedEvent(runtime_event);
|
||||||
break;
|
break;
|
||||||
|
case RC_RUNTIME_EVENT_LBOARD_CANCELED:
|
||||||
|
HandleLeaderboardCanceledEvent(runtime_event);
|
||||||
|
break;
|
||||||
case RC_RUNTIME_EVENT_LBOARD_TRIGGERED:
|
case RC_RUNTIME_EVENT_LBOARD_TRIGGERED:
|
||||||
HandleLeaderboardTriggeredEvent(runtime_event);
|
HandleLeaderboardTriggeredEvent(runtime_event);
|
||||||
break;
|
break;
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <ctime>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -109,7 +110,7 @@ private:
|
|||||||
u32 m_game_id = 0;
|
u32 m_game_id = 0;
|
||||||
rc_api_fetch_game_data_response_t m_game_data{};
|
rc_api_fetch_game_data_response_t m_game_data{};
|
||||||
bool m_is_game_loaded = false;
|
bool m_is_game_loaded = false;
|
||||||
u64 m_last_ping_time = 0;
|
time_t m_last_ping_time = 0;
|
||||||
|
|
||||||
struct UnlockStatus
|
struct UnlockStatus
|
||||||
{
|
{
|
||||||
|
@ -900,6 +900,10 @@ void Callback_NewField(Core::System& system)
|
|||||||
CallOnStateChangedCallbacks(Core::GetState());
|
CallOnStateChangedCallbacks(Core::GetState());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||||
|
AchievementManager::GetInstance()->DoFrame();
|
||||||
|
#endif // USE_RETRO_ACHIEVEMENTS
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateTitle()
|
void UpdateTitle()
|
||||||
|
Reference in New Issue
Block a user