mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-15 07:15:46 -04:00
Backport more common classes
This commit is contained in:
@ -215,7 +215,7 @@ void GPUBackend::RunGPULoop()
|
||||
u32 read_ptr = m_command_fifo_read_ptr.load();
|
||||
if (read_ptr == write_ptr)
|
||||
{
|
||||
const Common::Timer::Value current_time = Common::Timer::GetValue();
|
||||
const Common::Timer::Value current_time = Common::Timer::GetCurrentValue();
|
||||
if (Common::Timer::ConvertValueToNanoseconds(current_time - last_command_time) < SPIN_TIME_NS)
|
||||
continue;
|
||||
|
||||
@ -263,7 +263,7 @@ void GPUBackend::RunGPULoop()
|
||||
}
|
||||
}
|
||||
|
||||
last_command_time = allow_sleep ? 0 : Common::Timer::GetValue();
|
||||
last_command_time = allow_sleep ? 0 : Common::Timer::GetCurrentValue();
|
||||
m_command_fifo_read_ptr.store(read_ptr);
|
||||
}
|
||||
}
|
||||
|
@ -1475,7 +1475,7 @@ void GPU_HW::DrawRendererStats(bool is_idle_frame)
|
||||
|
||||
GPU_HW::ShaderCompileProgressTracker::ShaderCompileProgressTracker(std::string title, u32 total)
|
||||
: m_title(std::move(title)), m_min_time(Common::Timer::ConvertSecondsToValue(1.0)),
|
||||
m_update_interval(Common::Timer::ConvertSecondsToValue(0.1)), m_start_time(Common::Timer::GetValue()),
|
||||
m_update_interval(Common::Timer::ConvertSecondsToValue(0.1)), m_start_time(Common::Timer::GetCurrentValue()),
|
||||
m_last_update_time(0), m_progress(0), m_total(total)
|
||||
{
|
||||
}
|
||||
@ -1484,7 +1484,7 @@ void GPU_HW::ShaderCompileProgressTracker::Increment()
|
||||
{
|
||||
m_progress++;
|
||||
|
||||
const u64 tv = Common::Timer::GetValue();
|
||||
const u64 tv = Common::Timer::GetCurrentValue();
|
||||
if ((tv - m_start_time) >= m_min_time && (tv - m_last_update_time) >= m_update_interval)
|
||||
{
|
||||
g_host_interface->DisplayLoadingScreen(m_title.c_str(), 0, static_cast<int>(m_total), static_cast<int>(m_progress));
|
||||
|
@ -36,7 +36,7 @@ bool HostDisplay::ShouldSkipDisplayingFrame()
|
||||
if (m_display_frame_interval == 0.0f)
|
||||
return false;
|
||||
|
||||
const u64 now = Common::Timer::GetValue();
|
||||
const u64 now = Common::Timer::GetCurrentValue();
|
||||
const double diff = Common::Timer::ConvertValueToSeconds(now - m_last_frame_displayed_time);
|
||||
if (diff < m_display_frame_interval)
|
||||
return true;
|
||||
|
@ -1678,7 +1678,7 @@ void AddNotification(float duration, std::string title, std::string text, std::s
|
||||
notif.title = std::move(title);
|
||||
notif.text = std::move(text);
|
||||
notif.badge_path = std::move(image_path);
|
||||
notif.start_time = Common::Timer::GetValue();
|
||||
notif.start_time = Common::Timer::GetCurrentValue();
|
||||
s_notifications.push_back(std::move(notif));
|
||||
}
|
||||
|
||||
@ -1694,7 +1694,7 @@ void DrawNotifications(ImVec2& position, float spacing)
|
||||
|
||||
static constexpr float EASE_IN_TIME = 0.6f;
|
||||
static constexpr float EASE_OUT_TIME = 0.6f;
|
||||
const Common::Timer::Value current_time = Common::Timer::GetValue();
|
||||
const Common::Timer::Value current_time = Common::Timer::GetCurrentValue();
|
||||
|
||||
const float horizontal_padding = ImGuiFullscreen::LayoutScale(20.0f);
|
||||
const float vertical_padding = ImGuiFullscreen::LayoutScale(10.0f);
|
||||
|
@ -283,7 +283,7 @@ void NamcoGunCon::LoadSettings(const char* section)
|
||||
{
|
||||
m_crosshair_image_path = std::move(path);
|
||||
if (m_crosshair_image_path.empty() ||
|
||||
!Common::LoadImageFromFile(&m_crosshair_image, m_crosshair_image_path.c_str()))
|
||||
!m_crosshair_image.LoadFromFile(m_crosshair_image_path.c_str()))
|
||||
{
|
||||
m_crosshair_image.Invalidate();
|
||||
}
|
||||
|
@ -1585,7 +1585,7 @@ void UpdateThrottlePeriod()
|
||||
|
||||
void ResetThrottler()
|
||||
{
|
||||
s_next_frame_time = Common::Timer::GetValue();
|
||||
s_next_frame_time = Common::Timer::GetCurrentValue();
|
||||
}
|
||||
|
||||
void Throttle()
|
||||
@ -1606,7 +1606,7 @@ void Throttle()
|
||||
#endif
|
||||
|
||||
// Use unsigned for defined overflow/wrap-around.
|
||||
const Common::Timer::Value time = Common::Timer::GetValue();
|
||||
const Common::Timer::Value time = Common::Timer::GetCurrentValue();
|
||||
const double sleep_time = (s_next_frame_time >= time) ?
|
||||
Common::Timer::ConvertValueToNanoseconds(s_next_frame_time - time) :
|
||||
-Common::Timer::ConvertValueToNanoseconds(time - s_next_frame_time);
|
||||
@ -1630,7 +1630,7 @@ void RunFrames()
|
||||
const u32 max_frames_to_run = 2;
|
||||
u32 frames_run = 0;
|
||||
|
||||
Common::Timer::Value value = Common::Timer::GetValue();
|
||||
Common::Timer::Value value = Common::Timer::GetCurrentValue();
|
||||
while (frames_run < max_frames_to_run)
|
||||
{
|
||||
if (value < s_next_frame_time)
|
||||
@ -1639,7 +1639,7 @@ void RunFrames()
|
||||
RunFrame();
|
||||
frames_run++;
|
||||
|
||||
value = Common::Timer::GetValue();
|
||||
value = Common::Timer::GetCurrentValue();
|
||||
}
|
||||
|
||||
if (frames_run != 1)
|
||||
|
@ -105,7 +105,7 @@ void TextureReplacements::DumpVRAMWrite(u32 width, u32 height, const void* pixel
|
||||
}
|
||||
|
||||
Log_InfoPrintf("Dumping %ux%u VRAM write to '%s'", width, height, filename.c_str());
|
||||
if (!Common::WriteImageToFile(image, filename.c_str()))
|
||||
if (!image.SaveToFile(filename.c_str()))
|
||||
Log_ErrorPrintf("Failed to dump %ux%u VRAM write to '%s'", width, height, filename.c_str());
|
||||
}
|
||||
|
||||
@ -266,7 +266,7 @@ const TextureReplacementTexture* TextureReplacements::LoadTexture(const std::str
|
||||
return &it->second;
|
||||
|
||||
Common::RGBA8Image image;
|
||||
if (!Common::LoadImageFromFile(&image, filename.c_str()))
|
||||
if (!image.LoadFromFile(filename.c_str()))
|
||||
{
|
||||
Log_ErrorPrintf("Failed to load '%s'", filename.c_str());
|
||||
return nullptr;
|
||||
|
Reference in New Issue
Block a user