Fix mesh move constructor & assignment bugs
This commit is contained in:
parent
616b7cfce5
commit
aedd41ae7f
1 changed files with 12 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue