diff options
author | Nicola Mettifogo | 2007-08-06 20:07:57 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-08-06 20:07:57 +0000 |
commit | 16f161f68995a7179c373df046c86a72274460c1 (patch) | |
tree | fa6c262e7c5a0c5fb3f0e2c6997c3353dd080aaf /engines/parallaction/disk_ns.cpp | |
parent | 7c20288ba103b4c752b89583c7599a2cf6b594fa (diff) | |
download | scummvm-rg350-16f161f68995a7179c373df046c86a72274460c1.tar.gz scummvm-rg350-16f161f68995a7179c373df046c86a72274460c1.tar.bz2 scummvm-rg350-16f161f68995a7179c373df046c86a72274460c1.zip |
Made disk code directly create background Surface from resources.
svn-id: r28475
Diffstat (limited to 'engines/parallaction/disk_ns.cpp')
-rw-r--r-- | engines/parallaction/disk_ns.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp index 9c93a9f9df..b79e845ad3 100644 --- a/engines/parallaction/disk_ns.cpp +++ b/engines/parallaction/disk_ns.cpp @@ -589,20 +589,21 @@ void DosDisk_ns::loadBackground(const char *filename) { parseBackground(_resArchive); - byte *bg = (byte*)calloc(1, _vm->_screenSize); + Graphics::Surface *bg = new Graphics::Surface; + bg->create(_vm->_screenWidth, _vm->_screenHeight, 1); + BitBuffer *mask = new BitBuffer; mask->create(_vm->_screenWidth, _vm->_screenHeight); byte *path = (byte*)calloc(1, _vm->_screenPathSize); Graphics::PackBitsReadStream stream(_resArchive); - unpackBackground(&stream, bg, mask->data, path); + unpackBackground(&stream, (byte*)bg->pixels, mask->data, path); _vm->_gfx->setBackground(bg); _vm->_gfx->setMask(mask); _vm->setPath(path); - free(bg); free(path); return; @@ -1191,17 +1192,17 @@ void AmigaDisk_ns::loadBackground(const char *name) { Common::SeekableReadStream *s = openArchivedFile(name, true); - Graphics::Surface surf; + Graphics::Surface *surf = new Graphics::Surface; byte *pal; - BackgroundDecoder decoder(*s, surf, pal, _vm->_gfx->_palettefx); + BackgroundDecoder decoder(*s, *surf, pal, _vm->_gfx->_palettefx); decoder.decode(); for (uint32 i = 0; i < BASE_PALETTE_COLORS * 3; i++) _vm->_gfx->_palette[i] = pal[i] >> 2; free(pal); _vm->_gfx->setPalette(_vm->_gfx->_palette); - _vm->_gfx->setBackground(static_cast<byte*>(surf.pixels)); - surf.free(); + _vm->_gfx->setBackground(surf); + delete s; return; |