Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-07-30 20:32:25 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-07-30 20:32:25 +0300
commitb19f9e1f4d5da34337a8da55301b0545c62a9bf6 (patch)
treeeeedb4ad1bb918ef0b15b7dd8ac5456bc0c45d6f /server/TracyView_Utility.cpp
parent92871ba75ad279be275a2466e7d3513e9bcbea7a (diff)
Use common functionality to get frame set name.
Diffstat (limited to 'server/TracyView_Utility.cpp')
-rw-r--r--server/TracyView_Utility.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/server/TracyView_Utility.cpp b/server/TracyView_Utility.cpp
index ff094120..ca603b3e 100644
--- a/server/TracyView_Utility.cpp
+++ b/server/TracyView_Utility.cpp
@@ -1,3 +1,5 @@
+#include <inttypes.h>
+
#include "TracyColor.hpp"
#include "TracyPrint.hpp"
#include "TracyView.hpp"
@@ -791,11 +793,32 @@ const char* View::GetFrameText( const FrameData& fd, int i, uint64_t ftime, uint
}
else
{
- sprintf( buf, "%s %s (%s)", m_worker.GetString( fd.name ), RealToString( fnum ), TimeToString( ftime ) );
+ sprintf( buf, "%s %s (%s)", GetFrameSetName( fd ), RealToString( fnum ), TimeToString( ftime ) );
}
return buf;
}
+const char* View::GetFrameSetName( const FrameData& fd ) const
+{
+ return GetFrameSetName( fd, m_worker );
+}
+
+const char* View::GetFrameSetName( const FrameData& fd, const Worker& worker )
+{
+ enum { Pool = 4 };
+ static char bufpool[Pool][64];
+ static int bufsel = 0;
+
+ if( fd.name == 0 )
+ {
+ return "Frames";
+ }
+ else
+ {
+ return worker.GetString( fd.name );
+ }
+}
+
const char* View::ShortenNamespace( const char* name ) const
{
if( m_namespace == Namespace::Full ) return name;