Added rule of five ctors/operators

This commit is contained in:
Mafciejewicz
2021-08-30 00:37:32 +02:00
parent 8962fc147d
commit facf34ff1c
12 changed files with 385 additions and 0 deletions

View File

@@ -18,6 +18,17 @@ class ModelAnimation : public ::ModelAnimation {
set(model);
}
ModelAnimation(const ModelAnimation&) = delete;
ModelAnimation(ModelAnimation&& other) {
set(other);
other.boneCount = 0;
other.bones = nullptr;
other.frameCount = 0;
other.framePoses = nullptr;
}
~ModelAnimation() {
Unload();
}
@@ -41,6 +52,23 @@ class ModelAnimation : public ::ModelAnimation {
return *this;
}
ModelAnimation& operator=(const ModelAnimation&) = delete;
ModelAnimation& operator=(ModelAnimation&& other) {
if (this != &other) {
return *this;
}
Unload();
set(other);
other.boneCount = 0;
other.bones = nullptr;
other.frameCount = 0;
other.framePoses = nullptr;
}
/**
* Unload animation data
*/