mirror of
https://github.com/wolfpld/tracy.git
synced 2026-11-07 08:25:26 +00:00
Add a time range achievement.
This commit is contained in:
@@ -248,6 +248,7 @@ Embed(PROFILER_FILES TextSamplingIntro src/achievements/SamplingIntro.md TEXT)
|
||||
Embed(PROFILER_FILES TextSamplingStats src/achievements/SamplingStats.md TEXT)
|
||||
Embed(PROFILER_FILES TextSaveTrace src/achievements/SaveTrace.md TEXT)
|
||||
Embed(PROFILER_FILES TextSurviveCrash src/achievements/SurviveCrash.md TEXT)
|
||||
Embed(PROFILER_FILES TextTimeRanges src/achievements/TimeRanges.md TEXT)
|
||||
Embed(PROFILER_FILES TextWaitStacks src/achievements/WaitStacks.md TEXT)
|
||||
Embed(PROFILER_FILES TextZoneCallstacks src/achievements/ZoneCallstacks.md TEXT)
|
||||
Embed(PROFILER_FILES TextSections src/achievements/Sections.md TEXT)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Set a time range
|
||||
|
||||
Statistics cover the whole capture by default. A [time range](#timeranges) limits a window to one part of the run.
|
||||
|
||||
To mark a range, hold Ctrl and drag over the timeline. The menu that opens applies the range to one of six windows: Find zone, Statistics, Flame graph, Wait stacks, Memory, Frame statistics. Right-clicking a zone, section or frame opens the same menu with that item's extent.
|
||||
|
||||
You can adjust a range by dragging its edges. The [Time range limits](#timerangelimits) window, under the * Tools* menu, lists all ranges.
|
||||
|
||||
Try it out: Ctrl-drag a part of your capture, pick Statistics from the menu, and compare the numbers with the full capture.
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "data/TextSections.hpp"
|
||||
#include "data/TextSaveTrace.hpp"
|
||||
#include "data/TextSurviveCrash.hpp"
|
||||
#include "data/TextTimeRanges.hpp"
|
||||
#include "data/TextWaitStacks.hpp"
|
||||
#include "data/TextZoneCallstacks.hpp"
|
||||
|
||||
@@ -228,10 +229,19 @@ AchievementItem ai_readSource = {
|
||||
.items = ac_readSourceItems
|
||||
};
|
||||
|
||||
AchievementItem ai_timeRanges = {
|
||||
.id = "timeRanges",
|
||||
.name = "Set a time range",
|
||||
.text = Unpack( TextTimeRanges )
|
||||
};
|
||||
|
||||
AchievementItem* ac_annotationsItems[] = { &ai_timeRanges, nullptr };
|
||||
|
||||
AchievementItem ai_annotations = {
|
||||
.id = "annotations",
|
||||
.name = "Annotate the timeline",
|
||||
.text = Unpack( TextAnnotations )
|
||||
.text = Unpack( TextAnnotations ),
|
||||
.items = ac_annotationsItems
|
||||
};
|
||||
|
||||
AchievementItem* ac_lightFlameItems[] = { &ai_annotations, nullptr };
|
||||
|
||||
@@ -1261,6 +1261,7 @@ bool View::DrawImpl()
|
||||
{
|
||||
if( ImGui::Selectable( r.name ) )
|
||||
{
|
||||
if( s_config.achievements ) Achieve( "timeRanges" );
|
||||
r.range->active = true;
|
||||
r.range->min = s;
|
||||
r.range->max = e;
|
||||
|
||||
Reference in New Issue
Block a user