mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-05 02:17:05 +00:00
DIRECTOR: Fix compilation with C++98
The default assignment constructor just copies data over and we could end up with _matte pointing twice to the same surface. It's now properly reseted.
This commit is contained in:
parent
c464d06cfd
commit
353d2f0220
@ -71,7 +71,13 @@ Sprite::Sprite(Frame *frame) {
|
||||
_stretch = 0;
|
||||
}
|
||||
|
||||
Sprite::Sprite(const Sprite &sprite) {
|
||||
Sprite& Sprite::operator=(const Sprite &sprite) {
|
||||
if (this == &sprite) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
this->~Sprite();
|
||||
|
||||
_frame = sprite._frame;
|
||||
_score = sprite._score;
|
||||
_movie = sprite._movie;
|
||||
@ -108,6 +114,13 @@ Sprite::Sprite(const Sprite &sprite) {
|
||||
|
||||
_volume = sprite._volume;
|
||||
_stretch = sprite._stretch;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Sprite::Sprite(const Sprite &sprite) {
|
||||
_matte = nullptr;
|
||||
*this = sprite;
|
||||
}
|
||||
|
||||
Sprite::~Sprite() {
|
||||
|
@ -61,7 +61,7 @@ class Sprite {
|
||||
public:
|
||||
Sprite(Frame *frame = nullptr);
|
||||
Sprite(const Sprite &sprite);
|
||||
Sprite& operator=(const Sprite &sprite) = default;
|
||||
Sprite& operator=(const Sprite &sprite);
|
||||
~Sprite();
|
||||
|
||||
Frame *getFrame() const { return _frame; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user