Skip to content

Commit

Permalink
hotfix updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Mervill committed Oct 8, 2024
1 parent 2215bd3 commit cbd8180
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/cs/samples/HelloWorld/HelloWorld.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Tracy-CSharp" Version="0.11.1" />
<PackageReference Include="Tracy-CSharp" Version="0.11.1-hotfix" />
</ItemGroup>

</Project>
22 changes: 15 additions & 7 deletions src/cs/samples/HelloWorld/Profiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,9 @@ public static ProfilerZone BeginZone(
using var filestr = GetCString(filePath, out var fileln);
using var memberstr = GetCString(memberName, out var memberln);
using var namestr = GetCString(zoneName, out var nameln);
var srcLocId = TracyAllocSrclocName(lineNumber, filestr, fileln, memberstr, memberln, namestr, nameln);
var srcLocId = TracyAllocSrclocName(lineNumber, filestr, fileln, memberstr, memberln, namestr, nameln, color);
var context = TracyEmitZoneBeginAlloc(srcLocId, active ? 1 : 0);

if (color != 0)
{
TracyEmitZoneColor(context, color);
}

if (text != null)
{
using var textstr = GetCString(text, out var textln);
Expand Down Expand Up @@ -123,6 +118,19 @@ private static CString GetPlotCString(string name)
return plotCString;
}

/// <summary>
/// Emit a string that will be included along with the trace description.
/// </summary>
/// <remarks>
/// Viewable in the Info tab in the profiler.
/// </remarks>
public static void AppInfo(string appInfo)
{
using var infostr = GetCString(appInfo, out var infoln);
TracyEmitMessageAppinfo(infostr, infoln);
}


/// <summary>
/// Emit the top-level frame marker.
/// </summary>
Expand All @@ -140,7 +148,7 @@ public static void EmitFrameMark()
/// <returns></returns>
public static bool IsConnected()
{
return Convert.ToBoolean(TracyConnected());
return TracyConnected() != 0;
}

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/cs/samples/HelloWorld/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ static void ColoredEvent()

internal static void Main(string[] args)
{
Profiler.AppInfo("Hello AppInfo!");

while (true)
{
Delay();
Expand Down

0 comments on commit cbd8180

Please sign in to comment.