mirror of
https://github.com/wolfpld/tracy
synced 2025-05-01 13:13:53 +00:00
Move client broadcasts processing earlier in code.
This commit is contained in:
parent
f5abdd489d
commit
b24506492a
@ -267,57 +267,8 @@ static void DrawContents()
|
|||||||
static uint16_t reconnectPort;
|
static uint16_t reconnectPort;
|
||||||
static bool showFilter = false;
|
static bool showFilter = false;
|
||||||
|
|
||||||
int display_w, display_h;
|
|
||||||
bptr->NewFrame( display_w, display_h );
|
|
||||||
|
|
||||||
static int activeFrames = 3;
|
|
||||||
if( tracy::WasActive() || ( view && view->WasActive() ) )
|
|
||||||
{
|
|
||||||
activeFrames = 3;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
auto ctx = ImGui::GetCurrentContext();
|
|
||||||
if( ctx->DimBgRatio != 0 && ctx->DimBgRatio != 1 )
|
|
||||||
{
|
|
||||||
activeFrames = 3;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
auto& inputQueue = ctx->InputEventsQueue;
|
|
||||||
if( !inputQueue.empty() )
|
|
||||||
{
|
|
||||||
for( auto& v : inputQueue )
|
|
||||||
{
|
|
||||||
if( v.Type != ImGuiInputEventType_MouseViewport )
|
|
||||||
{
|
|
||||||
activeFrames = 3;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( activeFrames == 0 )
|
|
||||||
{
|
|
||||||
std::this_thread::sleep_for( std::chrono::milliseconds( 16 ) );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
activeFrames--;
|
|
||||||
|
|
||||||
ImGui::NewFrame();
|
|
||||||
tracy::MouseFrame();
|
|
||||||
|
|
||||||
setlocale( LC_NUMERIC, "C" );
|
|
||||||
|
|
||||||
if( !view )
|
if( !view )
|
||||||
{
|
{
|
||||||
if( s_customTitle )
|
|
||||||
{
|
|
||||||
s_customTitle = false;
|
|
||||||
bptr->SetTitle( title );
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto time = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::system_clock::now().time_since_epoch() ).count();
|
const auto time = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::system_clock::now().time_since_epoch() ).count();
|
||||||
if( !broadcastListen )
|
if( !broadcastListen )
|
||||||
{
|
{
|
||||||
@ -398,6 +349,58 @@ static void DrawContents()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int display_w, display_h;
|
||||||
|
bptr->NewFrame( display_w, display_h );
|
||||||
|
|
||||||
|
static int activeFrames = 3;
|
||||||
|
if( tracy::WasActive() || ( view && view->WasActive() ) )
|
||||||
|
{
|
||||||
|
activeFrames = 3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto ctx = ImGui::GetCurrentContext();
|
||||||
|
if( ctx->DimBgRatio != 0 && ctx->DimBgRatio != 1 )
|
||||||
|
{
|
||||||
|
activeFrames = 3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto& inputQueue = ctx->InputEventsQueue;
|
||||||
|
if( !inputQueue.empty() )
|
||||||
|
{
|
||||||
|
for( auto& v : inputQueue )
|
||||||
|
{
|
||||||
|
if( v.Type != ImGuiInputEventType_MouseViewport )
|
||||||
|
{
|
||||||
|
activeFrames = 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( activeFrames == 0 )
|
||||||
|
{
|
||||||
|
std::this_thread::sleep_for( std::chrono::milliseconds( 16 ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
activeFrames--;
|
||||||
|
|
||||||
|
ImGui::NewFrame();
|
||||||
|
tracy::MouseFrame();
|
||||||
|
|
||||||
|
setlocale( LC_NUMERIC, "C" );
|
||||||
|
|
||||||
|
if( !view )
|
||||||
|
{
|
||||||
|
if( s_customTitle )
|
||||||
|
{
|
||||||
|
s_customTitle = false;
|
||||||
|
bptr->SetTitle( title );
|
||||||
|
}
|
||||||
|
|
||||||
auto& style = ImGui::GetStyle();
|
auto& style = ImGui::GetStyle();
|
||||||
style.Colors[ImGuiCol_WindowBg] = ImVec4( 0.129f, 0.137f, 0.11f, 1.f );
|
style.Colors[ImGuiCol_WindowBg] = ImVec4( 0.129f, 0.137f, 0.11f, 1.f );
|
||||||
@ -656,9 +659,10 @@ static void DrawContents()
|
|||||||
ImGui::SetColumnWidth( 1, w * 0.175f );
|
ImGui::SetColumnWidth( 1, w * 0.175f );
|
||||||
ImGui::SetColumnWidth( 2, w * 0.425f );
|
ImGui::SetColumnWidth( 2, w * 0.425f );
|
||||||
}
|
}
|
||||||
std::lock_guard<std::mutex> lock( resolvLock );
|
const auto time = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::system_clock::now().time_since_epoch() ).count();
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
int passed = 0;
|
int passed = 0;
|
||||||
|
std::lock_guard<std::mutex> lock( resolvLock );
|
||||||
for( auto& v : clients )
|
for( auto& v : clients )
|
||||||
{
|
{
|
||||||
const bool badProto = v.second.protocolVersion != tracy::ProtocolVersion;
|
const bool badProto = v.second.protocolVersion != tracy::ProtocolVersion;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user