MCPcopy Create free account
hub / github.com/Apress/Ray-Tracing-Gems-II / Update

Method Update

Chapter_27/Core/EngineProfiling.cpp:513–559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511}
512
513void NestedTimingTree::Update( void )
514{
515 ASSERT(sm_SelectedScope != nullptr, "Corrupted profiling data structure");
516
517 if (sm_SelectedScope == &sm_RootScope)
518 {
519 sm_SelectedScope = sm_RootScope.FirstChild();
520 if (sm_SelectedScope == &sm_RootScope)
521 return;
522 }
523
524 if (GameInput::IsFirstPressed( GameInput::kDPadLeft )
525 || GameInput::IsFirstPressed( GameInput::kKey_left ))
526 {
527 //if still on graphs go back to text
528 if (sm_CursorOnGraph)
529 sm_CursorOnGraph = !sm_CursorOnGraph;
530 else
531 sm_SelectedScope->m_IsExpanded = false;
532 }
533 else if (GameInput::IsFirstPressed( GameInput::kDPadRight )
534 || GameInput::IsFirstPressed( GameInput::kKey_right ))
535 {
536 if (sm_SelectedScope->m_IsExpanded == true && !sm_CursorOnGraph)
537 sm_CursorOnGraph = true;
538 else
539 sm_SelectedScope->m_IsExpanded = true;
540 //if already expanded go over to graphs
541
542 }
543 else if (GameInput::IsFirstPressed( GameInput::kDPadDown )
544 || GameInput::IsFirstPressed( GameInput::kKey_down ))
545 {
546 sm_SelectedScope = sm_SelectedScope ? sm_SelectedScope->NextScope() : nullptr;
547 }
548 else if (GameInput::IsFirstPressed( GameInput::kDPadUp )
549 || GameInput::IsFirstPressed( GameInput::kKey_up ))
550 {
551 sm_SelectedScope = sm_SelectedScope ? sm_SelectedScope->PrevScope() : nullptr;
552 }
553 else if (GameInput::IsFirstPressed( GameInput::kAButton )
554 || GameInput::IsFirstPressed( GameInput::kKey_return ))
555 {
556 sm_SelectedScope->Toggle();
557 }
558
559}
560
561void NestedTimingTree::DisplayNode( TextContext& Text, float leftMargin, float indent )
562{

Callers

nothing calls this directly

Calls 4

FirstChildMethod · 0.80
NextScopeMethod · 0.80
PrevScopeMethod · 0.80
ToggleMethod · 0.45

Tested by

no test coverage detected