diff --git a/neo/renderer/BinaryImage.h b/neo/renderer/BinaryImage.h index 31445f47..30e39298 100644 --- a/neo/renderer/BinaryImage.h +++ b/neo/renderer/BinaryImage.h @@ -104,6 +104,17 @@ private: memcpy( data, other.data, other.dataSize ); return *this; } + idBinaryImageData& operator=( idBinaryImageData&& other ) + { + if( this == &other ) + { + return *this; + } + dataSize = other.dataSize; + data = other.data; + other.data = NULL; + return *this; + } void Free() { if( data != NULL ) diff --git a/neo/swf/SWF.h b/neo/swf/SWF.h index 418fa063..8339c871 100644 --- a/neo/swf/SWF.h +++ b/neo/swf/SWF.h @@ -50,6 +50,7 @@ public: idSWFDictionaryEntry(); ~idSWFDictionaryEntry(); idSWFDictionaryEntry& operator=( idSWFDictionaryEntry& other ); + idSWFDictionaryEntry& operator=( idSWFDictionaryEntry&& other ); swfDictType_t type; const idMaterial* material; diff --git a/neo/swf/SWF_Bitstream.cpp b/neo/swf/SWF_Bitstream.cpp index 7cb3d490..68d16985 100644 --- a/neo/swf/SWF_Bitstream.cpp +++ b/neo/swf/SWF_Bitstream.cpp @@ -84,6 +84,33 @@ idSWFBitStream& idSWFBitStream::operator=( idSWFBitStream& other ) return *this; } +/* +======================== +idSWFBitStream::operator= +======================== +*/ +idSWFBitStream& idSWFBitStream::operator=( idSWFBitStream&& other ) +{ + Free(); + free = other.free; + startp = other.startp; + readp = other.readp; + endp = other.endp; + currentBit = other.currentBit; + currentByte = other.currentByte; + if( other.free ) + { + // this is actually quite dangerous, but we need to do this + // because these things are copied around inside idList + other.free = false; + } + other.readp = NULL; + other.endp = NULL; + other.currentBit = 0; + other.currentByte = 0; + return *this; +} + /* ======================== idSWFBitStream::Free diff --git a/neo/swf/SWF_Bitstream.h b/neo/swf/SWF_Bitstream.h index 873fa49e..6951682b 100644 --- a/neo/swf/SWF_Bitstream.h +++ b/neo/swf/SWF_Bitstream.h @@ -43,6 +43,7 @@ public: } idSWFBitStream& operator=( idSWFBitStream& other ); + idSWFBitStream& operator=( idSWFBitStream&& other ); void Load( const byte* data, uint32 len, bool copy ); void Free(); diff --git a/neo/swf/SWF_Dictionary.cpp b/neo/swf/SWF_Dictionary.cpp index ecd6b119..21521972 100644 --- a/neo/swf/SWF_Dictionary.cpp +++ b/neo/swf/SWF_Dictionary.cpp @@ -88,6 +88,32 @@ idSWFDictionaryEntry& idSWFDictionaryEntry::operator=( idSWFDictionaryEntry& oth return *this; } +/* +======================== +idSWF::idSWFDictionaryEntry::operator= (move) +======================== +*/ +idSWFDictionaryEntry& idSWFDictionaryEntry::operator=( idSWFDictionaryEntry&& other ) +{ + type = other.type; + material = other.material; + shape = other.shape; + sprite = other.sprite; + font = other.font; + text = other.text; + edittext = other.edittext; + imageSize = other.imageSize; + imageAtlasOffset = other.imageAtlasOffset; + other.type = SWF_DICT_NULL; + other.material = NULL; + other.shape = NULL; + other.sprite = NULL; + other.font = NULL; + other.text = NULL; + other.edittext = NULL; + return *this; +} + /* ======================== idSWF::AddDictionaryEntry