diff options
Diffstat (limited to 'engines/gob/save/savefile.cpp')
-rw-r--r-- | engines/gob/save/savefile.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/engines/gob/save/savefile.cpp b/engines/gob/save/savefile.cpp index e1c4c62b12..79e931fe30 100644 --- a/engines/gob/save/savefile.cpp +++ b/engines/gob/save/savefile.cpp @@ -331,14 +331,18 @@ bool SavePartSprite::readPalette(const byte *palette) { return true; } -bool SavePartSprite::readSprite(const SurfaceDesc &sprite) { +bool SavePartSprite::readSprite(const Surface &sprite) { // The sprite's dimensions have to fit if (((uint32)sprite.getWidth()) != _width) return false; if (((uint32)sprite.getHeight()) != _height) return false; - memcpy(_dataSprite, sprite.getVidMem(), _width * _height); + // Only 8bit sprites supported for now + if (sprite.getBPP() != 1) + return false; + + memcpy(_dataSprite, sprite.getData(), _width * _height); return true; } @@ -357,14 +361,18 @@ bool SavePartSprite::writePalette(byte *palette) const { return true; } -bool SavePartSprite::writeSprite(SurfaceDesc &sprite) const { +bool SavePartSprite::writeSprite(Surface &sprite) const { // The sprite's dimensions have to fit if (((uint32)sprite.getWidth()) != _width) return false; if (((uint32)sprite.getHeight()) != _height) return false; - memcpy(sprite.getVidMem(), _dataSprite, _width * _height); + // Only 8bit sprites supported for now + if (sprite.getBPP() != 1) + return false; + + memcpy(sprite.getData(), _dataSprite, _width * _height); return true; } |