diff options
author | Martin Kiewitz | 2015-06-12 11:59:33 +0200 |
---|---|---|
committer | Martin Kiewitz | 2015-06-12 11:59:33 +0200 |
commit | 6c2c0cdfefa7941b7b27d2567be7dd0d14b02dee (patch) | |
tree | 7715797d297673a6600440fe6c660220ccac9a02 | |
parent | a08b0b9e59edb25eb8870582cd161640b2b2f8bc (diff) | |
download | scummvm-rg350-6c2c0cdfefa7941b7b27d2567be7dd0d14b02dee.tar.gz scummvm-rg350-6c2c0cdfefa7941b7b27d2567be7dd0d14b02dee.tar.bz2 scummvm-rg350-6c2c0cdfefa7941b7b27d2567be7dd0d14b02dee.zip |
SHERLOCK: surface setPixels get pixelformat
-rw-r--r-- | engines/sherlock/scalpel/scalpel_user_interface.cpp | 3 | ||||
-rw-r--r-- | engines/sherlock/screen.cpp | 2 | ||||
-rw-r--r-- | engines/sherlock/surface.cpp | 8 | ||||
-rw-r--r-- | engines/sherlock/surface.h | 4 |
4 files changed, 13 insertions, 4 deletions
diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp index 2f89dce3b4..1b54d607a6 100644 --- a/engines/sherlock/scalpel/scalpel_user_interface.cpp +++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp @@ -122,6 +122,9 @@ void ScalpelUserInterface::reset() { void ScalpelUserInterface::drawInterface(int bufferNum) { Screen &screen = *_vm->_screen; + if (_vm->getPlatform() == Common::kPlatform3DO) + return; // 3DO: don't do anything for now + if (bufferNum & 1) screen._backBuffer1.transBlitFrom((*_controlPanel)[0], Common::Point(0, CONTROLS_Y)); if (bufferNum & 2) diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp index 6463bac334..c1aec9ee6a 100644 --- a/engines/sherlock/screen.cpp +++ b/engines/sherlock/screen.cpp @@ -546,7 +546,7 @@ void Screen::makeField(const Common::Rect &r) { void Screen::setDisplayBounds(const Common::Rect &r) { assert(r.left == 0 && r.top == 0); - _sceneSurface.setPixels(_backBuffer1.getPixels(), r.width(), r.height()); + _sceneSurface.setPixels(_backBuffer1.getPixels(), r.width(), r.height(), _backBuffer1.getPixelFormat()); _backBuffer = &_sceneSurface; } diff --git a/engines/sherlock/surface.cpp b/engines/sherlock/surface.cpp index d67e958219..8f3690b108 100644 --- a/engines/sherlock/surface.cpp +++ b/engines/sherlock/surface.cpp @@ -52,6 +52,10 @@ void Surface::create(uint16 width, uint16 height, Common::Platform platform) { _freePixels = true; } +Graphics::PixelFormat Surface::getPixelFormat() { + return _surface.format; +} + void Surface::blitFrom(const Surface &src) { blitFrom(src, Common::Point(0, 0)); } @@ -264,8 +268,8 @@ void Surface::free() { } } -void Surface::setPixels(byte *pixels, int width, int height) { - _surface.format = Graphics::PixelFormat::createFormatCLUT8(); +void Surface::setPixels(byte *pixels, int width, int height, Graphics::PixelFormat pixelFormat) { + _surface.format = pixelFormat; _surface.w = _surface.pitch = width; _surface.h = height; _surface.setPixels(pixels); diff --git a/engines/sherlock/surface.h b/engines/sherlock/surface.h index 6032592084..0192b22d16 100644 --- a/engines/sherlock/surface.h +++ b/engines/sherlock/surface.h @@ -80,6 +80,8 @@ public: */ void create(uint16 width, uint16 height, Common::Platform platform); + Graphics::PixelFormat getPixelFormat(); + /** * Copy a surface into this one */ @@ -155,7 +157,7 @@ public: /** * Set the pixels for the surface to an existing data block */ - void setPixels(byte *pixels, int width, int height); + void setPixels(byte *pixels, int width, int height, Graphics::PixelFormat format); /** * Draws the given string into the back buffer using the images stored in _font |