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/graphics.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/graphics.cpp')
-rw-r--r-- | engines/parallaction/graphics.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 5f33b49cda..b13519ed2a 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -752,9 +752,12 @@ void Gfx::freeStaticCnv(StaticCnv *cnv) { -void Gfx::setBackground(byte *background) { - memcpy(_buffers[kBitBack]->pixels, background, _vm->_screenSize); - copyScreen(kBitBack, kBit2); +void Gfx::setBackground(Graphics::Surface *surface) { + if (_buffers[kBit2]) + delete _buffers[kBit2]; + + _buffers[kBit2] = surface; + copyScreen(kBit2, kBitBack); } void Gfx::setMask(BitBuffer *buffer) { @@ -847,8 +850,8 @@ Gfx::Gfx(Parallaction* vm) : _buffers[kBitFront]->create(_vm->_screenWidth, _vm->_screenHeight, 1); _buffers[kBitBack] = new Graphics::Surface; _buffers[kBitBack]->create(_vm->_screenWidth, _vm->_screenHeight, 1); - _buffers[kBit2] = new Graphics::Surface; - _buffers[kBit2]->create(_vm->_screenWidth, _vm->_screenHeight, 1); + + _buffers[kBit2] = 0; _depthMask = 0; @@ -878,8 +881,9 @@ Gfx::~Gfx() { delete _buffers[kBitFront]; _buffers[kBitBack]->free(); delete _buffers[kBitBack]; - _buffers[kBit2]->free(); - delete _buffers[kBit2]; + + if (_buffers[kBit2]) + delete _buffers[kBit2]; delete _fonts[kFontDialogue]; delete _fonts[kFontLabel]; |