Skip to content

Commit

Permalink
Achievements: Re-add NeedsIdleUpdate()
Browse files Browse the repository at this point in the history
Forgot I needed this on Android..
  • Loading branch information
stenzek committed Dec 22, 2024
1 parent 556a53e commit 9b62632
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/achievements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,15 @@ void Achievements::IdleUpdate()
rc_client_idle(s_state.client);
}

bool Achievements::NeedsIdleUpdate()
{
if (!IsActive())
return false;

const auto lock = GetLock();
return (s_state.http_downloader && s_state.http_downloader->HasAnyRequests());
}

void Achievements::FrameUpdate()
{
if (!IsActive())
Expand Down
3 changes: 3 additions & 0 deletions src/core/achievements.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ void FrameUpdate();
/// Called when the system is paused, because FrameUpdate() won't be getting called.
void IdleUpdate();

/// Returns true if idle updates are necessary (e.g. outstanding requests).
bool NeedsIdleUpdate();

/// Saves/loads state.
bool DoState(StateWrapper& sw);

Expand Down

0 comments on commit 9b62632

Please sign in to comment.