diff options
author | Johannes Schickel | 2011-04-17 16:28:05 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-04-17 16:28:05 +0200 |
commit | 6d1d31d0f95ab82872dd821131e0070473bd1aac (patch) | |
tree | 92ba1902e16678e2f3e915a42dfef3c53617ac83 /engines/lastexpress | |
parent | 2104b2adb94a0720dcab79805e206be54eed62ed (diff) | |
download | scummvm-rg350-6d1d31d0f95ab82872dd821131e0070473bd1aac.tar.gz scummvm-rg350-6d1d31d0f95ab82872dd821131e0070473bd1aac.tar.bz2 scummvm-rg350-6d1d31d0f95ab82872dd821131e0070473bd1aac.zip |
LASTEXPRESS: Prefer Surface::create taking a PixelFormat over the one taking a byte depth.
I am not sure whether the engine really uses only surfaces with the exat same
format as the screen. The engine maintainer should review this commit and fix
it in case the surfaces use a different pixel format.
Diffstat (limited to 'engines/lastexpress')
-rw-r--r-- | engines/lastexpress/data/animation.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/data/sequence.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/graphics.cpp | 11 |
3 files changed, 8 insertions, 7 deletions
diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp index 7288889f09..ed0a5a67e1 100644 --- a/engines/lastexpress/data/animation.cpp +++ b/engines/lastexpress/data/animation.cpp @@ -266,7 +266,7 @@ void Animation::play() { if (_changed) { // Create a temporary surface to merge the overlay with the background Graphics::Surface *s = new Graphics::Surface; - s->create(640, 480, 2); + s->create(640, 480, g_system->getScreenFormat()); draw(s); diff --git a/engines/lastexpress/data/sequence.cpp b/engines/lastexpress/data/sequence.cpp index 2308d70a2b..fe694187a4 100644 --- a/engines/lastexpress/data/sequence.cpp +++ b/engines/lastexpress/data/sequence.cpp @@ -82,7 +82,7 @@ void FrameInfo::read(Common::SeekableReadStream *in, bool isSequence) { AnimFrame::AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f) : _palette(NULL) { _palSize = 1; // TODO: use just the needed rectangle - _image.create(640, 480, 1); + _image.create(640, 480, Graphics::PixelFormat::createFormatCLUT8()); //debugC(6, kLastExpressDebugGraphics, " Offsets: data=%d, unknown=%d, palette=%d", f.dataOffset, f.unknown, f.paletteOffset); //debugC(6, kLastExpressDebugGraphics, " Position: (%d, %d) - (%d, %d)", f.xPos1, f.yPos1, f.xPos2, f.yPos2); diff --git a/engines/lastexpress/graphics.cpp b/engines/lastexpress/graphics.cpp index e5a69d16ea..b627796e25 100644 --- a/engines/lastexpress/graphics.cpp +++ b/engines/lastexpress/graphics.cpp @@ -32,13 +32,14 @@ namespace LastExpress { #define COLOR_KEY 0xFFFF GraphicsManager::GraphicsManager() : _changed(false) { - _screen.create(640, 480, 2); + const Graphics::PixelFormat format = g_system->getScreenFormat(); + _screen.create(640, 480, format); // Create the game surfaces - _backgroundA.create(640, 480, 2); - _backgroundC.create(640, 480, 2); - _overlay.create(640, 480, 2); - _inventory.create(640, 480, 2); + _backgroundA.create(640, 480, format); + _backgroundC.create(640, 480, format); + _overlay.create(640, 480, format); + _inventory.create(640, 480, format); clear(kBackgroundAll); } |