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

dreammaster dreammaster at scummvm.org
Mon Jul 27 03:17:00 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:
c2d1369546 SHERLOCK: RT: Stop windows from going off-screen to the right


Commit: c2d13695463bd6e98910a3fac6d42853cc29a668
    https://github.com/scummvm/scummvm/commit/c2d13695463bd6e98910a3fac6d42853cc29a668
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-26T21:15:57-04:00

Commit Message:
SHERLOCK: RT: Stop windows from going off-screen to the right

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



diff --git a/engines/sherlock/scene.h b/engines/sherlock/scene.h
index cba4f11..42bee4f 100644
--- a/engines/sherlock/scene.h
+++ b/engines/sherlock/scene.h
@@ -247,11 +247,6 @@ public:
 	void selectScene();
 
 	/**
-	 * Fres all the graphics and other dynamically allocated data for the scene
-	 */
-	void freeScene();
-
-	/**
 	 * Check the scene's objects against the game flags. If false is passed,
 	 * it means the scene has just been loaded. A value of true means that the scene
 	 * is in use (ie. not just loaded)
@@ -281,6 +276,11 @@ public:
 	int whichZone(const Common::Point &pt);
 
 	/**
+	 * Fres all the graphics and other dynamically allocated data for the scene
+	 */
+	virtual void freeScene();
+
+	/**
 	 * Returns the index of the closest zone to a given point.
 	 */
 	virtual int closestZone(const Common::Point &pt) = 0;
diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp
index 2a90a51..1ecc997 100644
--- a/engines/sherlock/tattoo/tattoo_scene.cpp
+++ b/engines/sherlock/tattoo/tattoo_scene.cpp
@@ -292,6 +292,15 @@ void TattooScene::checkBgShapes() {
 	}
 }
 
+void TattooScene::freeScene() {
+	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
+	Scene::freeScene();
+
+	delete ui._mask;
+	delete ui._mask1;
+	ui._mask = ui._mask1 = nullptr;
+}
+
 void TattooScene::doBgAnimCheckCursor() {
 	Events &events = *_vm->_events;
 	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
diff --git a/engines/sherlock/tattoo/tattoo_scene.h b/engines/sherlock/tattoo/tattoo_scene.h
index b75f7e7..ade4b00 100644
--- a/engines/sherlock/tattoo/tattoo_scene.h
+++ b/engines/sherlock/tattoo/tattoo_scene.h
@@ -118,6 +118,11 @@ public:
 	int getScaleVal(const Point32 &pt);
 
 	/**
+	 * Fres all the graphics and other dynamically allocated data for the scene
+	 */
+	virtual void freeScene();
+
+	/**
 	 * Draw all objects and characters.
 	 */
 	virtual void doBgAnim();
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index 16cd6f2..d8faa3e 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -65,6 +65,8 @@ TattooUserInterface::TattooUserInterface(SherlockEngine *vm): UserInterface(vm),
 
 TattooUserInterface::~TattooUserInterface() {
 	delete _interfaceImages;
+	delete _mask;
+	delete _mask1;
 }
 
 void TattooUserInterface::initScrollVars() {
diff --git a/engines/sherlock/tattoo/widget_base.cpp b/engines/sherlock/tattoo/widget_base.cpp
index 57d2fe0..539d4a2 100644
--- a/engines/sherlock/tattoo/widget_base.cpp
+++ b/engines/sherlock/tattoo/widget_base.cpp
@@ -177,8 +177,8 @@ void WidgetBase::restrictToScreen() {
 		_bounds.moveTo(screen._currentScroll.x, _bounds.top);
 	if (_bounds.top < 0)
 		_bounds.moveTo(_bounds.left, 0);
-	if (_bounds.right > screen._backBuffer1.w())
-		_bounds.moveTo(screen._backBuffer1.w() - _bounds.width(), _bounds.top);
+	if (_bounds.right > (screen._currentScroll.x + SHERLOCK_SCREEN_WIDTH))
+		_bounds.moveTo(screen._currentScroll.x + SHERLOCK_SCREEN_WIDTH - _bounds.width(), _bounds.top);
 	if (_bounds.bottom > screen._backBuffer1.h())
 		_bounds.moveTo(_bounds.left, screen._backBuffer1.h() - _bounds.height());
 }






More information about the Scummvm-git-logs mailing list