Refactor.

This commit is contained in:
Dario Manesku 2014-01-30 18:36:40 +01:00
parent de1d5e48ed
commit d68e48c1b7

View file

@ -161,56 +161,29 @@ struct ShadowMapRenderTargets
void imguiEnum(SmImpl::Enum& _enum) void imguiEnum(SmImpl::Enum& _enum)
{ {
if (imguiCheck("Hard", SmImpl::Hard == _enum) ) _enum = (SmImpl::Enum)imguiChoose(_enum
{ , "Hard"
_enum = SmImpl::Hard; , "PCF"
} , "VSM"
, "ESM"
if (imguiCheck("PCF", SmImpl::PCF == _enum) ) );
{
_enum = SmImpl::PCF;
}
if (imguiCheck("VSM", SmImpl::VSM == _enum) )
{
_enum = SmImpl::VSM;
}
if (imguiCheck("ESM", SmImpl::ESM == _enum) )
{
_enum = SmImpl::ESM;
}
} }
void imguiEnum(DepthImpl::Enum& _enum) void imguiEnum(DepthImpl::Enum& _enum)
{ {
if (imguiCheck("InvZ", DepthImpl::InvZ == _enum) ) _enum = (DepthImpl::Enum)imguiChoose(_enum
{ , "InvZ"
_enum = DepthImpl::InvZ; , "Linear"
} );
if (imguiCheck("Linear", DepthImpl::Linear == _enum) )
{
_enum = DepthImpl::Linear;
}
} }
void imguiEnum(LightType::Enum& _enum) void imguiEnum(LightType::Enum& _enum)
{ {
if (imguiCheck("Spot light", LightType::SpotLight == _enum) ) _enum = (LightType::Enum)imguiChoose(_enum
{ , "Spot light"
_enum = LightType::SpotLight; , "Point light"
} , "Directional light"
);
if (imguiCheck("Point light", LightType::PointLight == _enum) )
{
_enum = LightType::PointLight;
}
if (imguiCheck("Directional light", LightType::DirectionalLight == _enum) )
{
_enum = LightType::DirectionalLight;
}
} }
void imguiBool(const char* _str, bool& _flag, bool _enabled = true) void imguiBool(const char* _str, bool& _flag, bool _enabled = true)