[Scummvm-cvs-logs] scummvm master -> f387785e57ab1aad0340ea3d207436972c630cf4

dreammaster dreammaster at scummvm.org
Sat Jul 4 03:13:05 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:
f387785e57 SHERLOCK: RT: Beginnings of scrolling scene support


Commit: f387785e57ab1aad0340ea3d207436972c630cf4
    https://github.com/scummvm/scummvm/commit/f387785e57ab1aad0340ea3d207436972c630cf4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-03T21:12:14-04:00

Commit Message:
SHERLOCK: RT: Beginnings of scrolling scene support

Changed paths:
    engines/sherlock/scene.cpp
    engines/sherlock/screen.cpp
    engines/sherlock/tattoo/tattoo_scene.cpp
    engines/sherlock/tattoo/tattoo_user_interface.cpp



diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index f3bbad6..450370d 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -362,12 +362,6 @@ bool Scene::loadScene(const Common::String &filename) {
 			_invGraphicItems = bgHeader._numImages + 1;
 
 			if (IS_ROSE_TATTOO) {
-				screen.initPaletteFade(bgHeader._bytesWritten);
-				rrmStream->read(screen._cMap, PALETTE_SIZE);
-				screen.translatePalette(screen._cMap);
-
-				paletteLoaded();
-
 				// Resize the screen if necessary
 				int fullWidth = SHERLOCK_SCREEN_WIDTH + bgHeader._scrollSize;
 				if (screen._backBuffer1.w() != fullWidth) {
@@ -375,6 +369,13 @@ bool Scene::loadScene(const Common::String &filename) {
 					screen._backBuffer2.create(fullWidth, SHERLOCK_SCREEN_HEIGHT);
 				}
 
+				// Handle initializing the palette
+				screen.initPaletteFade(bgHeader._bytesWritten);
+				rrmStream->read(screen._cMap, PALETTE_SIZE);
+				screen.translatePalette(screen._cMap);
+
+				paletteLoaded();
+
 				// Read in background
 				if (_compressed) {
 					res.decompress(*rrmStream, (byte *)screen._backBuffer1.getPixels(), fullWidth * SHERLOCK_SCREEN_HEIGHT);
diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp
index e20c1b5..404b3d5 100644
--- a/engines/sherlock/screen.cpp
+++ b/engines/sherlock/screen.cpp
@@ -523,8 +523,7 @@ void Screen::vgaBar(const Common::Rect &r, int color) {
 }
 
 void Screen::setDisplayBounds(const Common::Rect &r) {
-	assert(r.left == 0 && r.top == 0);
-	_sceneSurface.setPixels(_backBuffer1.getPixels(), r.width(), r.height(), _backBuffer1.getPixelFormat());
+	_sceneSurface.setPixels(_backBuffer1.getBasePtr(r.left, r.top), r.width(), r.height(), _backBuffer1.getPixelFormat());
 
 	_backBuffer = &_sceneSurface;
 }
diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp
index a7f2a87..c8b769a 100644
--- a/engines/sherlock/tattoo/tattoo_scene.cpp
+++ b/engines/sherlock/tattoo/tattoo_scene.cpp
@@ -354,6 +354,11 @@ void TattooScene::doBgAnim() {
 	if (!vm._fastMode)
 		events.wait(3);
 
+	if (screen._flushScreen) {
+		screen.slamRect(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT), ui._currentScroll);
+		screen._flushScreen = false;
+	}
+
 	screen._flushScreen = false;
 	_doBgAnimDone = true;
 	ui._drawMenu = false;
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index 12cf4ae..a7b7392 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -33,7 +33,8 @@ TattooUserInterface::TattooUserInterface(SherlockEngine *vm): UserInterface(vm),
 		_inventoryWidget(vm), _messageWidget(vm), _textWidget(vm), _tooltipWidget(vm), _verbsWidget(vm) {
 	Common::fill(&_lookupTable[0], &_lookupTable[PALETTE_COUNT], 0);
 	Common::fill(&_lookupTable1[0], &_lookupTable1[PALETTE_COUNT], 0);
-	_scrollSize = _scrollSpeed = 0;
+	_scrollSize = 0;
+	_scrollSpeed = 16;
 	_drawMenu = false;
 	_bgShape = nullptr;
 	_personFound = false;
@@ -57,7 +58,7 @@ TattooUserInterface::~TattooUserInterface() {
 }
 
 void TattooUserInterface::initScrollVars() {
-	_scrollSize = 0;
+	_scrollSize = _vm->_screen->_backBuffer1.w() - SHERLOCK_SCREEN_WIDTH;
 	_currentScroll.x = _currentScroll.y = 0;
 	_targetScroll.x = _targetScroll.y = 0;
 }






More information about the Scummvm-git-logs mailing list