mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-12-01 17:29:38 +00:00
Added rule of five ctors/operators
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user