[Scummvm-cvs-logs] scummvm master -> 4486131ca6d2e66376e8bf69e72eb1a1868a892a

dreammaster dreammaster at scummvm.org
Mon Apr 18 12:39:25 CEST 2011


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

Summary:
962d848196 TSAGE: Removed InventoryDialog allFlag parameter.
4486131ca6 TSAGE: Fix bug with selected inventory item remaining selected after restarting game


Commit: 962d8481969150e591f9fc28e60b0dbee2b44c52
    https://github.com/scummvm/scummvm/commit/962d8481969150e591f9fc28e60b0dbee2b44c52
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-04-18T03:37:24-07:00

Commit Message:
TSAGE: Removed InventoryDialog allFlag parameter.

This was intended to be used to simultaneously support the cheat mode dialog with all the inventory items. But that is going to need to be implemented as a completely separate dialog.

Changed paths:
    engines/tsage/dialogs.cpp
    engines/tsage/dialogs.h



diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp
index 0778ea8..21970ce 100644
--- a/engines/tsage/dialogs.cpp
+++ b/engines/tsage/dialogs.cpp
@@ -379,36 +379,34 @@ bool GfxInvImage::process(Event &event) {
 
 /*--------------------------------------------------------------------------*/
 
-void InventoryDialog::show(bool allFlag) {
-	if (!allFlag) {
-		// Determine how many items are in the player's inventory
-		int itemCount = 0;
-		SynchronisedList<InvObject *>::iterator i;
-		for (i = _globals->_inventory._itemList.begin(); i != _globals->_inventory._itemList.end(); ++i) {
-			if ((*i)->inInventory())
-				++itemCount;
-		}
+void InventoryDialog::show() {
+	// Determine how many items are in the player's inventory
+	int itemCount = 0;
+	SynchronisedList<InvObject *>::iterator i;
+	for (i = _globals->_inventory._itemList.begin(); i != _globals->_inventory._itemList.end(); ++i) {
+		if ((*i)->inInventory())
+			++itemCount;
+	}
 
-		if (itemCount == 0) {
-			MessageDialog::show(INV_EMPTY_MSG, OK_BTN_STRING);
-			return;
-		}
+	if (itemCount == 0) {
+		MessageDialog::show(INV_EMPTY_MSG, OK_BTN_STRING);
+		return;
 	}
 
-	InventoryDialog *dlg = new InventoryDialog(allFlag);
+	InventoryDialog *dlg = new InventoryDialog();
 	dlg->draw();
 	dlg->execute();
 	delete dlg;
 }
 
-InventoryDialog::InventoryDialog(bool allFlag) {
+InventoryDialog::InventoryDialog() {
 	// Determine the maximum size of the image of any item in the player's inventory
 	int imgWidth = 0, imgHeight = 0;
 
 	SynchronisedList<InvObject *>::iterator i;
 	for (i = _globals->_inventory._itemList.begin(); i != _globals->_inventory._itemList.end(); ++i) {
 		InvObject *invObject = *i;
-		if (allFlag || invObject->inInventory()) {
+		if (invObject->inInventory()) {
 			// Get the image for the item
 			GfxSurface itemSurface = surfaceFromRes(invObject->_displayResNum, invObject->_rlbNum, invObject->_cursorNum);
 
diff --git a/engines/tsage/dialogs.h b/engines/tsage/dialogs.h
index 8e76637..d782852 100644
--- a/engines/tsage/dialogs.h
+++ b/engines/tsage/dialogs.h
@@ -108,11 +108,11 @@ private:
 	Common::Array<GfxInvImage> _images;
 	GfxButton _btnOk, _btnLook;
 public:
-	InventoryDialog(bool allFlag = false);
+	InventoryDialog();
 	virtual ~InventoryDialog() {}
 	void execute();
 
-	static void show(bool allFlag = false);
+	static void show();
 };
 
 /*--------------------------------------------------------------------------*/


Commit: 4486131ca6d2e66376e8bf69e72eb1a1868a892a
    https://github.com/scummvm/scummvm/commit/4486131ca6d2e66376e8bf69e72eb1a1868a892a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-04-18T03:37:57-07:00

Commit Message:
TSAGE: Fix bug with selected inventory item remaining selected after restarting game

Changed paths:
    engines/tsage/core.cpp



diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index e9f0079..b3b1693 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -3707,6 +3707,7 @@ void Game::restart() {
 	_globals->_inventory._bone._sceneNumber = 5300;
 	_globals->_inventory._jar._sceneNumber = 7700;
 	_globals->_inventory._emptyJar._sceneNumber = 7700;
+	_globals->_inventory._selectedItem = NULL;
 
 	// Change to the first game scene
 	_globals->_sceneManager.changeScene(30);






More information about the Scummvm-git-logs mailing list