PostProcessing: Add compile progress indicator

This commit is contained in:
Stenzek
2023-12-14 16:50:07 +10:00
parent 7e2afe82b5
commit 57aa138808
9 changed files with 79 additions and 18 deletions

View File

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#include "host_interface_progress_callback.h"
@ -60,6 +60,9 @@ void HostInterfaceProgressCallback::SetProgressValue(u32 value)
void HostInterfaceProgressCallback::Redraw(bool force)
{
if (m_last_progress_percent < 0 && m_open_time.GetTimeSeconds() < m_open_delay)
return;
const int percent =
static_cast<int>((static_cast<float>(m_progress_value) / static_cast<float>(m_progress_range)) * 100.0f);
if (percent == m_last_progress_percent && !force)