Don't pass GetFrameOffset() results to GetFrameText().

Frame offset can be retrieved internally.
This commit is contained in:
Bartosz Taudul 2023-03-04 00:29:00 +01:00
parent 9155b01ddf
commit 8164b776fd
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 5 additions and 5 deletions

View File

@ -317,7 +317,7 @@ private:
bool FindMatchingZone( int prev0, int prev1, int flags );
const ZoneEvent* FindZoneAtTime( uint64_t thread, int64_t time ) const;
uint64_t GetFrameNumber( const FrameData& fd, int i, uint64_t offset ) const;
const char* GetFrameText( const FrameData& fd, int i, uint64_t ftime, uint64_t offset ) const;
const char* GetFrameText( const FrameData& fd, int i, uint64_t ftime ) const;
const char* GetFrameSetName( const FrameData& fd ) const;
static const char* GetFrameSetName( const FrameData& fd, const Worker& worker );

View File

@ -144,7 +144,7 @@ void View::DrawTimelineFrames( const FrameData& frames )
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { fbegin, fend, true };
ImGui::BeginTooltip();
ImGui::TextUnformatted( GetFrameText( frames, i, ftime, m_worker.GetFrameOffset() ) );
ImGui::TextUnformatted( GetFrameText( frames, i, ftime ) );
ImGui::SameLine();
ImGui::TextDisabled( "(%.1f FPS)", 1000000000.0 / ftime );
TextFocused( "Time from start of program:", TimeToStringExact( m_worker.GetFrameBegin( frames, i ) ) );
@ -244,7 +244,7 @@ void View::DrawTimelineFrames( const FrameData& frames )
endPos = fend;
}
auto buf = GetFrameText( frames, i, ftime, m_worker.GetFrameOffset() );
auto buf = GetFrameText( frames, i, ftime );
auto tx = ImGui::CalcTextSize( buf ).x;
uint32_t color = ( frames.name == 0 && i == 0 ) ? redColor : activeColor;

View File

@ -768,9 +768,9 @@ uint64_t View::GetFrameNumber( const FrameData& fd, int i, uint64_t offset ) con
}
}
const char* View::GetFrameText( const FrameData& fd, int i, uint64_t ftime, uint64_t offset ) const
const char* View::GetFrameText( const FrameData& fd, int i, uint64_t ftime ) const
{
const auto fnum = GetFrameNumber( fd, i, offset );
const auto fnum = GetFrameNumber( fd, i, m_worker.GetFrameOffset() );
static char buf[1024];
if( fd.name == 0 )
{