diff options
author | Nicola Mettifogo | 2007-08-12 08:26:20 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-08-12 08:26:20 +0000 |
commit | 46c74a5bcfc6e8793fbead21f3e06bfdb6d228c4 (patch) | |
tree | 44e0fc12a30996709e1d7e8b3cb41a3c7e5e8a44 | |
parent | ccfd109e2539c3d1ec46d1f93ffda7001f86d326 (diff) | |
download | scummvm-rg350-46c74a5bcfc6e8793fbead21f3e06bfdb6d228c4.tar.gz scummvm-rg350-46c74a5bcfc6e8793fbead21f3e06bfdb6d228c4.tar.bz2 scummvm-rg350-46c74a5bcfc6e8793fbead21f3e06bfdb6d228c4.zip |
Added very basic support for backgrounds larger than screen:
- background surfaces are now reallocated for every location
- screen is copied according to _scrollX/Y position
svn-id: r28538
-rw-r--r-- | engines/parallaction/graphics.cpp | 10 | ||||
-rw-r--r-- | engines/parallaction/graphics.h | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 2e7d79c37c..95e36cbd69 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -280,7 +280,7 @@ void Gfx::setHalfbriteMode(bool enable) { } void Gfx::updateScreen() { - g_system->copyRectToScreen((const byte*)_buffers[kBitFront]->pixels, _vm->_screenWidth, 0, 0, _vm->_screenWidth, _vm->_screenHeight); + g_system->copyRectToScreen((const byte*)_buffers[kBitFront]->pixels, _buffers[kBitFront]->pitch, _screenX, _screenY, _vm->_screenWidth, _vm->_screenHeight); g_system->updateScreen(); return; } @@ -695,6 +695,10 @@ void Gfx::restoreBackground(const Common::Rect& r) { void Gfx::setBackground(Graphics::Surface *surface) { _buffers[kBit2] = surface; + + _buffers[kBitFront]->create(surface->w, surface->h, 1); + _buffers[kBitBack]->create(surface->w, surface->h, 1); + copyScreen(kBit2, kBitBack); } @@ -778,13 +782,15 @@ 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] = 0; _depthMask = 0; setPalette(_palette); + _screenX = 0; + _screenY = 0; + _bgLayers[0] = _bgLayers[1] = _bgLayers[2] = _bgLayers[3] = 0; memset(_palettefx, 0, sizeof(_palettefx)); diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index a830b9b2c9..5125e09b04 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -241,6 +241,9 @@ public: PaletteFxRange _palettefx[6]; Palette _palette; + uint _screenX; // scrolling position + uint _screenY; + protected: Parallaction* _vm; Graphics::Surface *_buffers[NUM_BUFFERS]; |