diff options
author | uruk | 2013-08-05 12:19:10 +0200 |
---|---|---|
committer | uruk | 2013-08-05 12:19:10 +0200 |
commit | 15f6ba8b2aa3883e47e07bdb131d9ed65a21ee5b (patch) | |
tree | 56f9fef5839e5629fb108b021b82b907d78c519b | |
parent | 1956ca280bdd6491fd595c1c8f8da9aee679984b (diff) | |
download | scummvm-rg350-15f6ba8b2aa3883e47e07bdb131d9ed65a21ee5b.tar.gz scummvm-rg350-15f6ba8b2aa3883e47e07bdb131d9ed65a21ee5b.tar.bz2 scummvm-rg350-15f6ba8b2aa3883e47e07bdb131d9ed65a21ee5b.zip |
AVALANCHE: Introduce _screen in Graphics.
-rw-r--r-- | engines/avalanche/graphics.cpp | 15 | ||||
-rw-r--r-- | engines/avalanche/graphics.h | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 737147b734..677f5109d5 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -60,12 +60,15 @@ void Graphics::init() { _surface.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8()); _magics.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8()); + + _screen.create(kScreenWidth, kScreenHeight * 2, ::Graphics::PixelFormat::createFormatCLUT8()); } Graphics::~Graphics() { _surface.free(); _magics.free(); _background.free(); + _screen.free(); } @@ -166,18 +169,14 @@ void Graphics::drawPicture(const ::Graphics::Surface &picture, uint16 destX, uin void Graphics::refreshScreen() { // These cycles are for doubling the screen height. - ::Graphics::Surface picture; - picture.create(kScreenWidth, kScreenHeight * 2, ::Graphics::PixelFormat::createFormatCLUT8()); - for (uint16 y = 0; y < picture.h / 2; y++) - for (uint16 x = 0; x < picture.w; x++) + for (uint16 y = 0; y < _screen.h / 2; y++) + for (uint16 x = 0; x < _screen.w; x++) for (byte j = 0; j < 2; j++) - *(byte *)picture.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y); + *(byte *)_screen.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y); // Now we copy the stretched picture to the screen. - g_system->copyRectToScreen(picture.pixels, picture.pitch, 0, 0, kScreenWidth, kScreenHeight * 2); + g_system->copyRectToScreen(_screen.pixels, _screen.pitch, 0, 0, kScreenWidth, kScreenHeight * 2); g_system->updateScreen(); - - picture.free(); } diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index f1dbe4a0e0..d16b0c0046 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -63,6 +63,8 @@ public: // Lucerna::draw_also_lines() draws the "magical" lines here. // Further information: https://github.com/urukgit/avalot/wiki/Also + ::Graphics::Surface _screen; + |