[Scummvm-cvs-logs] scummvm master -> 6c2c0cdfefa7941b7b27d2567be7dd0d14b02dee

m-kiewitz m_kiewitz at users.sourceforge.net
Fri Jun 12 11:59:47 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6c2c0cdfef SHERLOCK: surface setPixels get pixelformat


Commit: 6c2c0cdfefa7941b7b27d2567be7dd0d14b02dee
    https://github.com/scummvm/scummvm/commit/6c2c0cdfefa7941b7b27d2567be7dd0d14b02dee
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2015-06-12T11:59:33+02:00

Commit Message:
SHERLOCK: surface setPixels get pixelformat

Changed paths:
    engines/sherlock/scalpel/scalpel_user_interface.cpp
    engines/sherlock/screen.cpp
    engines/sherlock/surface.cpp
    engines/sherlock/surface.h



diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp
index 2f89dce..1b54d60 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 6463bac..c1aec9e 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 d67e958..8f3690b 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 6032592..0192b22 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






More information about the Scummvm-git-logs mailing list