2022-08-15 11:29:45 +00:00
|
|
|
#ifndef __TRACYTIMELINECONTROLLER_HPP__
|
|
|
|
#define __TRACYTIMELINECONTROLLER_HPP__
|
|
|
|
|
2022-08-20 15:02:29 +00:00
|
|
|
#include "../public/common/TracyForceInline.hpp"
|
|
|
|
#include "tracy_robin_hood.h"
|
|
|
|
|
2022-08-15 11:29:45 +00:00
|
|
|
namespace tracy
|
|
|
|
{
|
|
|
|
|
|
|
|
class TimelineController
|
|
|
|
{
|
2022-08-20 15:02:29 +00:00
|
|
|
struct VisData
|
|
|
|
{
|
|
|
|
bool visible = true;
|
|
|
|
bool showFull = true;
|
|
|
|
bool ghost = false;
|
|
|
|
int offset = 0;
|
|
|
|
int height = 0;
|
|
|
|
};
|
|
|
|
|
2022-08-15 11:29:45 +00:00
|
|
|
public:
|
|
|
|
TimelineController();
|
|
|
|
|
2022-08-20 15:02:29 +00:00
|
|
|
void FirstFrameExpired();
|
2022-08-15 11:29:45 +00:00
|
|
|
void End( float offset );
|
|
|
|
|
|
|
|
float GetHeight() const { return m_height; }
|
2022-08-20 15:02:29 +00:00
|
|
|
const unordered_flat_map<const void*, VisData>& GetVisData() const { return m_visData; }
|
|
|
|
|
|
|
|
void AdjustThreadHeight( VisData& vis, int oldOffset, int& offset );
|
|
|
|
float AdjustThreadPosition( VisData& vis, float wy, int& offset );
|
|
|
|
|
|
|
|
tracy_force_inline VisData& Vis( const void* ptr )
|
|
|
|
{
|
|
|
|
auto it = m_visData.find( ptr );
|
|
|
|
if( it == m_visData.end() )
|
|
|
|
{
|
|
|
|
it = m_visData.emplace( ptr, VisData {} ).first;
|
|
|
|
}
|
|
|
|
return it->second;
|
|
|
|
}
|
2022-08-15 11:29:45 +00:00
|
|
|
|
|
|
|
private:
|
2022-08-20 15:02:29 +00:00
|
|
|
unordered_flat_map<const void*, VisData> m_visData;
|
|
|
|
|
2022-08-15 11:29:45 +00:00
|
|
|
float m_height;
|
|
|
|
float m_offset;
|
|
|
|
float m_scroll;
|
2022-08-20 15:02:29 +00:00
|
|
|
|
|
|
|
bool m_firstFrame;
|
2022-08-15 11:29:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|