mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Replace "enum class" switches with explicit casts
This commit is contained in:
parent
d6761c2ffa
commit
f000dce73f
@ -12277,32 +12277,9 @@ void View::AccumulationModeComboBox()
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
const char* accumulationModeTable = "Self only\0Including children\0Non-reentrant\0";
|
const char* accumulationModeTable = "Self only\0Including children\0Non-reentrant\0";
|
||||||
ImGui::SetNextItemWidth( ImGui::CalcTextSize( "Including children" ).x + ImGui::GetTextLineHeight() * 2 );
|
ImGui::SetNextItemWidth( ImGui::CalcTextSize( "Including children" ).x + ImGui::GetTextLineHeight() * 2 );
|
||||||
int accumulationMode;
|
int accumulationMode = static_cast<int>( m_statAccumulationMode );
|
||||||
switch ( m_statAccumulationMode )
|
|
||||||
{
|
|
||||||
case AccumulationMode::SelfOnly:
|
|
||||||
accumulationMode = 0;
|
|
||||||
break;
|
|
||||||
case AccumulationMode::AllChildren:
|
|
||||||
accumulationMode = 1;
|
|
||||||
break;
|
|
||||||
case AccumulationMode::NonReentrantChildren:
|
|
||||||
accumulationMode = 2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
ImGui::Combo( "##accumulationMode", &accumulationMode, accumulationModeTable );
|
ImGui::Combo( "##accumulationMode", &accumulationMode, accumulationModeTable );
|
||||||
switch ( accumulationMode )
|
m_statAccumulationMode = static_cast<AccumulationMode>( accumulationMode );
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
m_statAccumulationMode = AccumulationMode::SelfOnly;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
m_statAccumulationMode = AccumulationMode::AllChildren;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
m_statAccumulationMode = AccumulationMode::NonReentrantChildren;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::DrawStatistics()
|
void View::DrawStatistics()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user