aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2013-07-29 12:22:59 +0200
committeruruk2013-07-29 12:22:59 +0200
commita1f87fdaebc86be92b189086bba1dba0d3e049c6 (patch)
tree10f5095164676f93e1a5c28fe2ea02b52411ce03 /engines
parentb182fd814ecd0d70ea4c34cbe2d188b363df94ed (diff)
downloadscummvm-rg350-a1f87fdaebc86be92b189086bba1dba0d3e049c6.tar.gz
scummvm-rg350-a1f87fdaebc86be92b189086bba1dba0d3e049c6.tar.bz2
scummvm-rg350-a1f87fdaebc86be92b189086bba1dba0d3e049c6.zip
AVALANCHE: Modify Graphics and Lucerna, so the engine saves the background and redraws it every time before a sprite is drawn.
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/graphics.cpp2
-rw-r--r--engines/avalanche/graphics.h4
-rw-r--r--engines/avalanche/lucerna2.cpp6
3 files changed, 8 insertions, 4 deletions
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index bed8136dd4..6338893dbf 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -62,6 +62,7 @@ void Graphics::init() {
Graphics::~Graphics() {
_surface.free();
+ _background.free();
}
@@ -85,6 +86,7 @@ void Graphics::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
}
void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
+ drawPicture(_background, 0, 10);
/* First we make the pixels of the spirte blank. */
for (byte qay = 0; qay < sprite.yl; qay++) {
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 3d32bdafcb..d0adb17767 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -57,7 +57,9 @@ public:
static const int16 kScreenWidth = 640;
static const int16 kScreenHeight = 200;
-
+ ::Graphics::Surface _background;
+
+
Graphics(AvalancheEngine *vm);
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index eb5f5094c9..047301cf3e 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -245,11 +245,11 @@ void Lucerna::load(byte n) { /* Load2, actually */
byte backgroundHeight = 8 * 12080 / _vm->_graphics->kScreenWidth; // With 640 width it's 151
// The 8 = number of bits in a byte, and 12080 comes from the original code (see above)
- ::Graphics::Surface background = _vm->_graphics->loadPictureRow(f, backgroundWidht, backgroundHeight);
+ _vm->_graphics->_background = _vm->_graphics->loadPictureRow(f, backgroundWidht, backgroundHeight);
- _vm->_graphics->drawPicture(background, 0, 10);
+ _vm->_graphics->drawPicture(_vm->_graphics->_background, 0, 10);
- background.free();
+ _vm->_graphics->refreshScreen();
f.close();