projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix coverity issue on dli loader : Add null check
[platform/core/uifw/dali-toolkit.git]
/
dali-scene-loader
/
public-api
/
environment-definition.cpp
diff --git
a/dali-scene-loader/public-api/environment-definition.cpp
b/dali-scene-loader/public-api/environment-definition.cpp
index
16c8e2c
..
c95883f
100644
(file)
--- a/
dali-scene-loader/public-api/environment-definition.cpp
+++ b/
dali-scene-loader/public-api/environment-definition.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 202
0
Samsung Electronics Co., Ltd.
+ * Copyright (c) 202
1
Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-23,24
+23,22
@@
namespace Dali
{
namespace SceneLoader
{
{
namespace SceneLoader
{
-
EnvironmentDefinition::RawData
EnvironmentDefinition::RawData
-
EnvironmentDefinition::LoadRaw(const std::string& environmentsPath) const
+EnvironmentDefinition::LoadRaw(const std::string& environmentsPath) const
{
RawData raw;
{
RawData raw;
- auto loadFn = [&environmentsPath](const std::string& path, CubeData& cd) {
- if
(path.empty())
+ auto
loadFn = [&environmentsPath](const std::string& path, CubeData& cd) {
+ if(path.empty())
{
cd.data.resize(6);
{
cd.data.resize(6);
- for
(auto& face : cd.data)
+ for(auto& face : cd.data)
{
{
- face.push_back(PixelData::New(new uint8_t[3]{
0xff, 0xff, 0xff
}, 3, 1, 1, Pixel::RGB888, PixelData::DELETE_ARRAY));
+ face.push_back(PixelData::New(new uint8_t[3]{
0xff, 0xff, 0xff
}, 3, 1, 1, Pixel::RGB888, PixelData::DELETE_ARRAY));
}
}
else if(!LoadCubeMapData(environmentsPath + path, cd))
{
}
}
else if(!LoadCubeMapData(environmentsPath + path, cd))
{
- ExceptionFlinger(ASSERT_LOCATION) << "Failed to load cubemap texture from '" <<
- path << "'.";
+ ExceptionFlinger(ASSERT_LOCATION) << "Failed to load cubemap texture from '" << path << "'.";
}
};
}
};
@@
-54,18
+52,18
@@
EnvironmentDefinition::Textures EnvironmentDefinition::Load(RawData&& raw) const
Textures textures;
// This texture should have 6 faces and only one mipmap
Textures textures;
// This texture should have 6 faces and only one mipmap
- if
(!raw.mDiffuse.data.empty())
+ if(!raw.mDiffuse.data.empty())
{
textures.mDiffuse = raw.mDiffuse.CreateTexture();
}
// This texture should have 6 faces and 6 mipmaps
{
textures.mDiffuse = raw.mDiffuse.CreateTexture();
}
// This texture should have 6 faces and 6 mipmaps
- if
(!raw.mSpecular.data.empty())
+ if(!raw.mSpecular.data.empty())
{
textures.mSpecular = raw.mSpecular.CreateTexture();
}
return textures;
}
{
textures.mSpecular = raw.mSpecular.CreateTexture();
}
return textures;
}
-}
-}
+}
// namespace SceneLoader
+}
// namespace Dali