From aedd41ae7f8f4ea340a1173a644e9b7f872f0f71 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Fri, 25 Sep 2020 11:36:00 +0300 Subject: [PATCH] Fix mesh move constructor & assignment bugs --- libs/gfx/source/mesh.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libs/gfx/source/mesh.cpp b/libs/gfx/source/mesh.cpp index 15676c4f..56607dea 100644 --- a/libs/gfx/source/mesh.cpp +++ b/libs/gfx/source/mesh.cpp @@ -19,10 +19,13 @@ namespace psemek::gfx array_ = other.array_; buffer_ = other.buffer_; count_ = other.count_; + stride_ = other.stride_; + primitive_type_ = other.primitive_type_; other.array_ = 0; other.buffer_ = 0; other.count_ = 0; + other.stride_ = 0; } mesh & mesh::operator =(mesh && other) @@ -38,10 +41,13 @@ namespace psemek::gfx array_ = other.array_; buffer_ = other.buffer_; count_ = other.count_; + stride_ = other.stride_; + primitive_type_ = other.primitive_type_; other.array_ = 0; other.buffer_ = 0; other.count_ = 0; + other.stride_ = 0; return *this; } @@ -77,12 +83,15 @@ namespace psemek::gfx index_buffer_ = other.index_buffer_; count_ = other.count_; index_type_ = other.index_type_; + stride_ = other.stride_; + primitive_type_ = other.primitive_type_; other.array_ = 0; other.buffer_ = 0; other.index_buffer_ = 0; other.count_ = 0; other.index_type_ = 0; + other.stride_ = 0; } indexed_mesh & indexed_mesh::operator =(indexed_mesh && other) @@ -101,12 +110,15 @@ namespace psemek::gfx index_buffer_ = other.index_buffer_; count_ = other.count_; index_type_ = other.index_type_; + stride_ = other.stride_; + primitive_type_ = other.primitive_type_; other.array_ = 0; other.buffer_ = 0; other.index_buffer_ = 0; other.count_ = 0; other.index_type_ = 0; + other.stride_ = 0; return *this; }