fix pvs warning

This commit is contained in:
2019-11-27 15:55:41 +07:00
parent 7fdc227b17
commit 371e05574b
2 changed files with 55 additions and 45 deletions

View File

@@ -6,8 +6,10 @@ cd $BUILD_DIR/pvs_analyze
rm -rf pvs_report
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=On ../..
pvs-studio-analyzer analyze\
--disableLicenseExpirationCheck\
-e ../../untests\
-e ../../modules\
-e ../../headers/3rdparty\
-e ../../sources/3rdparty\
-o pvs_report.log\
-j8

View File

@@ -273,13 +273,14 @@ namespace e2d::render_system_impl
texture_ptr tex_p;
const texture_asset* texture_asset_ptr = atlas_page
? static_cast<texture_asset*>(atlas_page->rendererObject)
? static_cast<const texture_asset*>(atlas_page->rendererObject)
: nullptr;
if ( texture_asset_ptr ) {
tex_p = texture_asset_ptr->content();
}
render::sampler_min_filter tex_min_f = render::sampler_min_filter::linear;
if ( atlas_page ) {
switch ( atlas_page->minFilter ) {
case SP_ATLAS_NEAREST:
case SP_ATLAS_MIPMAP_NEAREST_LINEAR:
@@ -290,8 +291,10 @@ namespace e2d::render_system_impl
tex_min_f = render::sampler_min_filter::linear;
break;
}
}
render::sampler_mag_filter tex_mag_f = render::sampler_mag_filter::linear;
if ( atlas_page ) {
switch ( atlas_page->magFilter ) {
case SP_ATLAS_NEAREST:
case SP_ATLAS_MIPMAP_NEAREST_LINEAR:
@@ -302,8 +305,10 @@ namespace e2d::render_system_impl
tex_mag_f = render::sampler_mag_filter::linear;
break;
}
}
render::sampler_wrap tex_wrap_s = render::sampler_wrap::repeat;
if ( atlas_page ) {
switch ( atlas_page->uWrap ) {
case SP_ATLAS_MIRROREDREPEAT:
tex_wrap_s = render::sampler_wrap::mirror;
@@ -318,8 +323,10 @@ namespace e2d::render_system_impl
E2D_ASSERT_MSG(false, "unexpected wrap mode for slot");
break;
}
}
render::sampler_wrap tex_wrap_t = render::sampler_wrap::repeat;
if ( atlas_page ) {
switch ( atlas_page->vWrap ) {
case SP_ATLAS_MIRROREDREPEAT:
tex_wrap_t = render::sampler_wrap::mirror;
@@ -334,6 +341,7 @@ namespace e2d::render_system_impl
E2D_ASSERT_MSG(false, "unexpected wrap mode for slot");
break;
}
}
material_asset::ptr mat_a;
switch ( slot->data->blendMode ) {