return endAction;
}
-AnimationDefinition::AnimationDefinition()
-{}
+AnimationDefinition::AnimationDefinition() = default;
AnimationDefinition::AnimationDefinition(AnimationDefinition&& other)
-: mName(std::move(other.mName)),
+: mName(std::move(other.mName)),
mDuration(other.mDuration),
mLoopCount(other.mLoopCount),
mDisconnectAction(other.mDisconnectAction),
* on the given @a shader and @a actor.
*/
static void ConfigureProperties(const std::pair<MeshDefinition, MeshGeometry>& mesh, Shader shader, Actor actor);
+
+ BlendShapes() = delete;
};
}
struct DALI_SCENE_LOADER_API CameraParameters
{
- CameraParameters()
- : matrix(Matrix::IDENTITY),
- orthographicSize(-1.f, 1.f, 1.f, -1.f),
- yFov(60.f),
- zNear(0.1f),
- zFar(1000.f),
- isPerspective(true)
- {}
-
- ~CameraParameters() = default;
-
- Matrix matrix;
- Vector4 orthographicSize;
- float yFov;
- float zNear;
- float zFar;
- bool isPerspective;
+ Matrix matrix = Matrix::IDENTITY;
+ Vector4 orthographicSize = Vector4{ -1.f, 1.f, 1.f, -1.f };
+ float yFov = 60.f;
+ float zNear = 0.1f;
+ float zFar = 1000.f;
+ bool isPerspective = true;
/**
* @return The view-projection matrix of the camera.
ReadFloat(eArc->GetChild("endAngle"), arc.mEndAngleDegrees);
}
-const TreeNode *Tidx(const TreeNode *node, int index)
+const TreeNode *GetNthChild(const TreeNode *node, uint32_t index)
{
- int i = 0;
+ uint32_t i = 0;
for (TreeNode::ConstIterator it = (*node).CBegin(); it != (*node).CEnd(); ++it, ++i)
{
if (i == index)
void DliLoader::Impl::ParseSceneInternal(Index iScene, const Toolkit::TreeNode* tnScenes,
const Toolkit::TreeNode* tnNodes, LoadParams& params)
{
- auto getSceneRootIdx = [&](Index iScene) {
- auto tn = Tidx(tnScenes, iScene); // now a "scene" object
+ auto getSceneRootIdx = [tnScenes, tnNodes](Index iScene) {
+ auto tn = GetNthChild(tnScenes, iScene); // now a "scene" object
if (!tn)
{
ExceptionFlinger(ASSERT_LOCATION) << iScene << " is out of bounds access into " << SCENES << ".";
" must define a node id.";
}
- tn = Tidx(tn, 0); // now the first element of the array
+ tn = GetNthChild(tn, 0); // now the first element of the array
Index iRootNode;
if (!ReadIndex(tn, iRootNode))
{
ExceptionFlinger(ASSERT_LOCATION) << "Root node index << " << iRootNode << " of scene " << iScene << " is out of bounds.";
}
- tn = Tidx(tnNodes, iRootNode); // now a "node" object
+ tn = GetNthChild(tnNodes, iRootNode); // now a "node" object
if (tn->GetType() != TreeNode::OBJECT)
{
ExceptionFlinger(ASSERT_LOCATION) << "Root node of scene " << iScene << " is of invalid JSON type; object required";
std::vector<IndexProperty> resourceIds;
resourceIds.reserve(4);
- if (auto node = Tidx(nodes, index))
+ if (auto node = GetNthChild(nodes, index))
{
NodeDefinition nodeDef;
nodeDef.mParentIdx = inOutParentStack.empty() ? INVALID_INDEX : inOutParentStack.back();
return sampler;
}
+TextureDefinition::TextureDefinition(const std::string& imageUri, SamplerFlags::Type samplerFlags)
+: mImageUri(imageUri),
+ mSamplerFlags(samplerFlags)
+{}
+
MaterialDefinition::RawData
MaterialDefinition::LoadRaw(const std::string& imagesPath) const
{
std::string mImageUri;
SamplerFlags::Type mSamplerFlags;
- TextureDefinition(const std::string& imageUri = "", SamplerFlags::Type samplerFlags = SamplerFlags::DEFAULT)
- : mImageUri(imageUri),
- mSamplerFlags(samplerFlags)
- {}
+ TextureDefinition(const std::string& imageUri = "", SamplerFlags::Type samplerFlags = SamplerFlags::DEFAULT);
};
/**
};
-const std::string QUAD_STRING("quad");
+const std::string QUAD("quad");
///@brief Reads a blob from the given stream @a source into @a target, which must have
/// at least @a descriptor.length bytes.
{
DALI_ASSERT_DEBUG(0u != totalTextureSize && "totalTextureSize is zero.")
- // Calculate the dimensions of the texture.
- // The total size of the texture is the length of the blend shapes blob.
+ // Calculate the dimensions of the texture.
+ // The total size of the texture is the length of the blend shapes blob.
- textureWidth = 0u;
+ textureWidth = 0u;
textureHeight = 0u;
if (0u == totalTextureSize)
}
MeshDefinition::SparseBlob::SparseBlob(const Blob& indices, const Blob& values, uint32_t count)
-: mIndices{indices},
+: mIndices{indices},
mValues{values},
mCount{count}
{}
MeshDefinition::Accessor::Accessor(const MeshDefinition::Blob& blob,
const MeshDefinition::SparseBlob& sparse)
-: mBlob{blob},
+: mBlob{blob},
mSparse{(sparse.mIndices.IsDefined() && sparse.mValues.IsDefined()) ? new SparseBlob{sparse} : nullptr}
{}
}
}
+MeshDefinition::Blob::Blob(uint32_t offset, uint32_t length, uint16_t stride, uint16_t elementSizeHint, const std::vector<float>& min, const std::vector<float>& max)
+: mOffset(offset),
+ mLength(length),
+ mStride(stride),
+ mElementSizeHint(elementSizeHint),
+ mMin(min),
+ mMax(max)
+{}
+
uint32_t MeshDefinition::Blob::GetBufferSize() const
{
return IsConsecutive() ? mLength : (mLength * mElementSizeHint / mStride);
bool MeshDefinition::IsQuad() const
{
- return CaseInsensitiveStringCompare("quad", mUri);
+ return CaseInsensitiveStringCompare(QUAD, mUri);
}
bool MeshDefinition::IsSkinned() const
Blob() = default;
Blob(uint32_t offset, uint32_t length, uint16_t stride = 0, uint16_t elementSizeHint = 0,
- const std::vector<float>& min = {}, const std::vector<float>& max = {})
- : mOffset(offset),
- mLength(length),
- mStride(stride),
- mElementSizeHint(elementSizeHint),
- mMin(min),
- mMax(max)
- {}
+ const std::vector<float>& min = {}, const std::vector<float>& max = {});
/**
* @brief Calculates the size of a tightly-packed buffer for the elements from the blob.
class DALI_SCENE_LOADER_API IResourceReceiver
{
public:
- virtual ~IResourceReceiver()
- {}
+ virtual ~IResourceReceiver() = default;
virtual void Register(ResourceType::Value type, Index id) = 0;
};
class DALI_SCENE_LOADER_API IResourceReflector
{
public:
- virtual ~IResourceReflector()
- {}
+ virtual ~IResourceReflector() = default;
virtual void Reflect(ResourceType::Value type, Index& id) = 0;
};
Index mShaderIdx = INVALID_INDEX;
public: // METHODS
- virtual ~Renderable() {}
+ virtual ~Renderable() = default;
virtual void RegisterResources(IResourceReceiver& receiver) const;
virtual void ReflectResources(IResourceReflector& reflector);
virtual void Finish(NodeDefinition& n) = 0;
protected:
- ~IVisitor() {}
+ ~IVisitor() = default; // deliberately non-virtual these are transient objects and we don't want to pay for the vtable.
};
class IConstVisitor
virtual void Finish(const NodeDefinition& n) = 0;
protected:
- ~IConstVisitor() {}
+ ~IConstVisitor() = default; // deliberately non-virtual these are transient objects and we don't want to pay for the vtable.
};
struct Extra
{
public:
ActorCreatorVisitor(NodeDefinition::CreateParams& params)
- : mCreationContext(params)
+ : mCreationContext(params)
{}
void Start(const NodeDefinition& n)
}
SceneDefinition::SceneDefinition(SceneDefinition&& other)
-: mNodes(std::move(other.mNodes)),
+: mNodes(std::move(other.mNodes)),
mRootNodeIds(std::move(other.mRootNodeIds))
{
#ifdef DEBUG_JOINTS
* @brief Name of bone matrix uniform (array).
*/
static const std::string BONE_UNIFORM_NAME;
+
+ Skinning() = delete;
};
}
thread_local char sExceptionFlingerMessageBuffer[ExceptionFlinger::MESSAGE_BUFFER_SIZE]{};
}
+StreamBuffer::StreamBuffer(char* buffer, size_t size) noexcept(true)
+{
+ setp(buffer, buffer + size);
+}
+
+ExceptionFlinger::ExceptionFlinger(const char* location) noexcept(true)
+: mLocation(location),
+ mStreamBuffer(GetMessageBuffer(), MESSAGE_BUFFER_SIZE - 1),
+ mStream(&mStreamBuffer)
+{}
+
+ExceptionFlinger::~ExceptionFlinger() noexcept(false)
+{
+ operator<<('\0');
+ throw DaliException(mLocation, GetMessageBuffer());
+}
+
char* ExceptionFlinger::GetMessageBuffer() noexcept(true)
{
return sExceptionFlingerMessageBuffer;
class DALI_SCENE_LOADER_API StreamBuffer : public std::basic_streambuf<char>
{
public:
- StreamBuffer(char* buffer, size_t size) noexcept(true)
- {
- setp(buffer, buffer + size);
- }
+ StreamBuffer(char* buffer, size_t size) noexcept(true);
};
/*
public:
enum { MESSAGE_BUFFER_SIZE = 512 };
- ExceptionFlinger(const char* location) noexcept(true)
- : mLocation(location),
- mStreamBuffer(GetMessageBuffer(), MESSAGE_BUFFER_SIZE - 1),
- mStream(&mStreamBuffer)
- {}
+ ExceptionFlinger(const char* location) noexcept(true);
[[noreturn]]
- ~ExceptionFlinger() noexcept(false)
- {
- operator<<('\0');
- throw DaliException(mLocation, GetMessageBuffer());
- }
+ ~ExceptionFlinger() noexcept(false);
template <typename T>
ExceptionFlinger& operator<<(const T& rhs) noexcept(true)