MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / IndicatorOpacity

Function IndicatorOpacity

pcsx2/Achievements.cpp:2039–2045  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2037
2038template <typename T>
2039static float IndicatorOpacity(const T& i)
2040{
2041 const float elapsed = static_cast<float>(i.show_hide_time.GetTimeSeconds());
2042 const float time = i.active ? Achievements::INDICATOR_FADE_IN_TIME : Achievements::INDICATOR_FADE_OUT_TIME;
2043 const float opacity = (elapsed >= time) ? 1.0f : (elapsed / time);
2044 return (i.active) ? opacity : (1.0f - opacity);
2045}
2046
2047static ImVec2 CalculateOverlayPosition(const ImGuiIO& io, float padding, AchievementOverlayPosition alignment)
2048{

Callers 1

DrawGameOverlaysMethod · 0.85

Calls 1

GetTimeSecondsMethod · 0.80

Tested by

no test coverage detected