used RangeCheck instead of many if
This commit is contained in:
Submodule CMSceneGraph updated: 3844b827bf...ba8cc1897e
@@ -95,14 +95,14 @@ int main(int,char **)
|
|||||||
else
|
else
|
||||||
std::cout<<vf->bytes<<" bytes/pixel.";
|
std::cout<<vf->bytes<<" bytes/pixel.";
|
||||||
|
|
||||||
if(vf->depth!=VulkanDataType::NONE)
|
if(vf->depth!=VulkanNumberType::NONE)
|
||||||
std::cout<<"[Depth:"<<data_type_name[size_t(vf->depth)]<<"]";
|
std::cout<<"[Depth:"<<data_type_name[size_t(vf->depth)]<<"]";
|
||||||
|
|
||||||
if(vf->stencil!=VulkanDataType::NONE)
|
if(vf->stencil!=VulkanNumberType::NONE)
|
||||||
std::cout<<"[Stencil:"<<data_type_name[size_t(vf->stencil)]<<"]";
|
std::cout<<"[Stencil:"<<data_type_name[size_t(vf->stencil)]<<"]";
|
||||||
|
|
||||||
if((vf->depth==VulkanDataType::NONE)
|
if((vf->depth==VulkanNumberType::NONE)
|
||||||
&&(vf->stencil==VulkanDataType::NONE))
|
&&(vf->stencil==VulkanNumberType::NONE))
|
||||||
std::cout<<"[Color:"<<data_type_name[size_t(vf->color)]<<"]";
|
std::cout<<"[Color:"<<data_type_name[size_t(vf->color)]<<"]";
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@@ -82,14 +82,12 @@ TileData *GPUDevice::CreateTileData(const VkFormat format,const uint width,const
|
|||||||
Texture2D *tex=nullptr;
|
Texture2D *tex=nullptr;
|
||||||
VkExtent2D extent={tex_width,tex_height};
|
VkExtent2D extent={tex_width,tex_height};
|
||||||
|
|
||||||
if(vf->color>VulkanDataType::NONE
|
if(RangeCheck(vf->color))
|
||||||
&&vf->color<VulkanDataType::END)
|
|
||||||
{
|
{
|
||||||
tex=CreateTexture2D(new ColorTextureCreateInfo(format,extent));
|
tex=CreateTexture2D(new ColorTextureCreateInfo(format,extent));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if(vf->depth>VulkanDataType::NONE
|
if(RangeCheck(vf->depth))
|
||||||
&&vf->depth<VulkanDataType::END)
|
|
||||||
{
|
{
|
||||||
tex=CreateTexture2D(new DepthTextureCreateInfo(format,extent));
|
tex=CreateTexture2D(new DepthTextureCreateInfo(format,extent));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user