[Scummvm-git-logs] scummvm master -> cff82fb3573934bcd70e04d8e2222e961350486b

a-yyg 76591232+a-yyg at users.noreply.github.com
Sat Jul 24 20:44:38 UTC 2021


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

Summary:
659d6b44ee SAGA2: Remove unnecessary warning
c246022f92 SAGA2: Add TeleportToNPC command
ab81402f33 SAGA2: Expand search command to actors/worlds
114a0df459 SAGA2: Add TeleportNPC commands
c47e518a43 SAGA2: Add more information to search command
a9f2fa115b SAGA2: Add save/load location command
c2aac871a9 SAGA2: Add command to teleport on click
cff82fb357 SAGA2: Remove book/parchment close button images


Commit: 659d6b44ee71d6e085e6e3879e92652b59b816a2
    https://github.com/scummvm/scummvm/commit/659d6b44ee71d6e085e6e3879e92652b59b816a2
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-25T05:29:27+09:00

Commit Message:
SAGA2: Remove unnecessary warning

Changed paths:
    engines/saga2/objproto.cpp


diff --git a/engines/saga2/objproto.cpp b/engines/saga2/objproto.cpp
index 7f1f86c6cd..cca07e3d7b 100644
--- a/engines/saga2/objproto.cpp
+++ b/engines/saga2/objproto.cpp
@@ -643,7 +643,6 @@ bool ProtoObj::acceptStrike(
 	int16   scriptResult;
 
 	//  Handle object script in a standard fashion
-	warning("ProtoObj::acceptStrike: Method_GameObject_onAcceptStrike undefined");
 	if ((scriptResult = stdActionScript(
 	                        Method_GameObject_onAcceptStrike,
 	                        dObj, enactor, strikingObj))


Commit: c246022f92577257a26af3c8dd12d0097e30c856
    https://github.com/scummvm/scummvm/commit/c246022f92577257a26af3c8dd12d0097e30c856
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-25T05:29:27+09:00

Commit Message:
SAGA2: Add TeleportToNPC command

Changed paths:
    engines/saga2/console.cpp
    engines/saga2/console.h


diff --git a/engines/saga2/console.cpp b/engines/saga2/console.cpp
index a3b6d2168d..f2240113b8 100644
--- a/engines/saga2/console.cpp
+++ b/engines/saga2/console.cpp
@@ -63,6 +63,8 @@ Console::Console(Saga2Engine *vm) : GUI::Debugger() {
 
 	registerCmd("teleport", WRAP_METHOD(Console, cmdTeleport));
 
+	registerCmd("teleport_to_npc", WRAP_METHOD(Console, cmdTeleportToNPC));
+
 	registerCmd("goto_place", WRAP_METHOD(Console, cmdGotoPlace));
 
 	registerCmd("list_places", WRAP_METHOD(Console, cmdListPlaces));
@@ -198,6 +200,20 @@ bool Console::cmdTeleport(int argc, const char **argv) {
 	return true;
 }
 
+bool Console::cmdTeleportToNPC(int argc, const char **argv) {
+	if (argc != 2)
+		debugPrintf("Usage: %s <Actor ID>\n", argv[0]);
+	else {
+		ObjectID id = atoi(argv[1]);
+		Actor *a = getCenterActor();
+		Actor *b = (Actor *)GameObject::objectAddress(id);
+
+		a->setLocation(b->getLocation());
+	}
+
+	return true;
+}
+
 bool Console::cmdGotoPlace(int argc, const char **argv) {
 	if (argc != 2)
 		debugPrintf("Usage: %s <place id>\n", argv[0]);
diff --git a/engines/saga2/console.h b/engines/saga2/console.h
index b2d01bfce9..2909c2bffe 100644
--- a/engines/saga2/console.h
+++ b/engines/saga2/console.h
@@ -57,6 +57,8 @@ private:
 
 	bool cmdTeleport(int argc, const char **argv);
 
+	bool cmdTeleportToNPC(int argc, const char **argv);
+
 	bool cmdGotoPlace(int argc, const char **argv);
 
 	bool cmdListPlaces(int argc, const char **argv);


Commit: ab81402f33389c6e44cd75b88db0ebb09b5d3497
    https://github.com/scummvm/scummvm/commit/ab81402f33389c6e44cd75b88db0ebb09b5d3497
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-25T05:29:27+09:00

Commit Message:
SAGA2: Expand search command to actors/worlds

Changed paths:
    engines/saga2/console.cpp
    engines/saga2/console.h
    engines/saga2/objects.cpp
    engines/saga2/objects.h


diff --git a/engines/saga2/console.cpp b/engines/saga2/console.cpp
index f2240113b8..c36e4cde27 100644
--- a/engines/saga2/console.cpp
+++ b/engines/saga2/console.cpp
@@ -53,7 +53,7 @@ Console::Console(Saga2Engine *vm) : GUI::Debugger() {
 
 	registerCmd("obj_name", WRAP_METHOD(Console, cmdObjName));
 
-	registerCmd("name2id", WRAP_METHOD(Console, cmdObjNameToID));
+	registerCmd("nid2id", WRAP_METHOD(Console, cmdObjNameIndexToID));
 
 	registerCmd("search_obj", WRAP_METHOD(Console, cmdSearchObj));
 
@@ -123,7 +123,7 @@ bool Console::cmdObjName(int argc, const char **argv) {
 	return true;
 }
 
-bool Console::cmdObjNameToID(int argc, const char **argv) {
+bool Console::cmdObjNameIndexToID(int argc, const char **argv) {
 	if (argc != 2)
 		debugPrintf("Usage: %s <Name index>\n", argv[0]);
 	else {
@@ -141,11 +141,18 @@ bool Console::cmdSearchObj(int argc, const char **argv) {
 	if (argc != 2)
 		debugPrintf("Usage: %s <Object name>\n", argv[0]);
 	else {
-		for (int i = 0; i < objectCount; ++i) {
-			Common::String objName = objectList[i].objName();
-			objName.toLowercase();
-			if (objName.contains(argv[1]))
-				debugPrintf("%d: %s\n", i, objectList[i].objName());
+		Common::String name = argv[1];
+		Common::Array<ObjectID> array = GameObject::nameToID(name);
+
+		if (array.size() == 0)
+			debugPrintf("No objects found!\n");
+		else {
+			for (uint i = 0; i < array.size(); ++i) {
+			ObjectID id = array[i];
+
+			GameObject *obj = GameObject::objectAddress(id);
+			debugPrintf("%s: %d\n", obj->objName(), id);
+			}
 		}
 	}
 
diff --git a/engines/saga2/console.h b/engines/saga2/console.h
index 2909c2bffe..f630be1ef4 100644
--- a/engines/saga2/console.h
+++ b/engines/saga2/console.h
@@ -43,7 +43,7 @@ private:
 
 	bool cmdObjName(int argc, const char **argv);
 
-	bool cmdObjNameToID(int argc, const char **argv);
+	bool cmdObjNameIndexToID(int argc, const char **argv);
 
 	bool cmdSearchObj(int argc, const char **argv);
 
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index 790ce7dd21..826318b964 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -421,6 +421,34 @@ int32 GameObject::nameIndexToID(uint16 ind) {
 	return -1;
 }
 
+Common::Array<ObjectID> GameObject::nameToID(Common::String name) {
+	Common::Array<ObjectID> array;
+	name.toLowercase();
+
+	for (int i = 0; i < objectCount; ++i) {
+		Common::String objName = objectList[i].objName();
+		objName.toLowercase();
+		if (objName.contains(name))
+			array.push_back(objectList[i].thisID());
+	}
+
+	for (int i = 0; i < kActorCount; ++i) {
+		Common::String objName = g_vm->_actorList[i]->objName();
+		objName.toLowercase();
+		if (objName.contains(name))
+			array.push_back(g_vm->_actorList[i]->thisID());
+	}
+
+	for (int i = 0; i < worldCount; ++i) {
+		Common::String objName = worldList[i].objName();
+		objName.toLowercase();
+		if (objName.contains(name))
+			array.push_back(worldList[i].thisID());
+	}
+
+	return array;
+}
+
 
 uint16 GameObject::containmentSet(void) {
 	return  prototype->containmentSet();
diff --git a/engines/saga2/objects.h b/engines/saga2/objects.h
index 6c0a651d1c..b8309887e3 100644
--- a/engines/saga2/objects.h
+++ b/engines/saga2/objects.h
@@ -198,8 +198,12 @@ public:
 	//  Converts object ID into prototype address...
 	static ProtoObj *protoAddress(ObjectID id);
 
+	// Returns first object id found associate with the given name index
 	static int32 nameIndexToID(uint16 ind);
 
+	// Returns first object id found assciated with the given name
+	static Common::Array<ObjectID> nameToID(Common::String name);
+
 	//  object creation and deletion
 	static GameObject *newObject(void);      // get a newly created object
 	void deleteObject(void);                 // delete this object and remove


Commit: 114a0df459785ae84f3ad76902ca9e72371eff48
    https://github.com/scummvm/scummvm/commit/114a0df459785ae84f3ad76902ca9e72371eff48
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-25T05:29:28+09:00

Commit Message:
SAGA2: Add TeleportNPC commands

Changed paths:
    engines/saga2/console.cpp
    engines/saga2/console.h


diff --git a/engines/saga2/console.cpp b/engines/saga2/console.cpp
index c36e4cde27..28ff22a7cd 100644
--- a/engines/saga2/console.cpp
+++ b/engines/saga2/console.cpp
@@ -65,6 +65,10 @@ Console::Console(Saga2Engine *vm) : GUI::Debugger() {
 
 	registerCmd("teleport_to_npc", WRAP_METHOD(Console, cmdTeleportToNPC));
 
+	registerCmd("teleport_npc", WRAP_METHOD(Console, cmdTeleportNPC));
+
+	registerCmd("teleport_npc_here", WRAP_METHOD(Console, cmdTeleportNPCHere));
+
 	registerCmd("goto_place", WRAP_METHOD(Console, cmdGotoPlace));
 
 	registerCmd("list_places", WRAP_METHOD(Console, cmdListPlaces));
@@ -221,6 +225,37 @@ bool Console::cmdTeleportToNPC(int argc, const char **argv) {
 	return true;
 }
 
+bool Console::cmdTeleportNPC(int argc, const char **argv) {
+	if (argc != 5)
+		debugPrintf("Usage: %s <Actor ID> <u> <v> <z>\n", argv[0]);
+	else {
+		ObjectID id = atoi(argv[1]);
+		Actor *a = (Actor *)GameObject::objectAddress(id);
+
+		TilePoint loc;
+		loc.u = atoi(argv[2]);
+		loc.v = atoi(argv[3]);
+		loc.z = atoi(argv[4]);
+
+		a->setLocation(loc);
+	}
+
+	return true;
+}
+
+bool Console::cmdTeleportNPCHere(int argc, const char **argv) {
+	if (argc != 2)
+		debugPrintf("Usage: %s <Actor ID>\n", argv[0]);
+	else {
+		ObjectID id = atoi(argv[1]);
+		Actor *a = (Actor *)GameObject::objectAddress(id);
+
+		a->setLocation(getCenterActor()->getLocation());
+	}
+
+	return true;
+}
+
 bool Console::cmdGotoPlace(int argc, const char **argv) {
 	if (argc != 2)
 		debugPrintf("Usage: %s <place id>\n", argv[0]);
diff --git a/engines/saga2/console.h b/engines/saga2/console.h
index f630be1ef4..ea519ac380 100644
--- a/engines/saga2/console.h
+++ b/engines/saga2/console.h
@@ -59,6 +59,10 @@ private:
 
 	bool cmdTeleportToNPC(int argc, const char **argv);
 
+	bool cmdTeleportNPC(int argc, const char **argv);
+
+	bool cmdTeleportNPCHere(int argc, const char **argv);
+
 	bool cmdGotoPlace(int argc, const char **argv);
 
 	bool cmdListPlaces(int argc, const char **argv);


Commit: c47e518a43413edc7fc56b05b9cdc27a9c5d20eb
    https://github.com/scummvm/scummvm/commit/c47e518a43413edc7fc56b05b9cdc27a9c5d20eb
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-25T05:29:28+09:00

Commit Message:
SAGA2: Add more information to search command

Changed paths:
    engines/saga2/console.cpp


diff --git a/engines/saga2/console.cpp b/engines/saga2/console.cpp
index 28ff22a7cd..1672bad743 100644
--- a/engines/saga2/console.cpp
+++ b/engines/saga2/console.cpp
@@ -55,7 +55,7 @@ Console::Console(Saga2Engine *vm) : GUI::Debugger() {
 
 	registerCmd("nid2id", WRAP_METHOD(Console, cmdObjNameIndexToID));
 
-	registerCmd("search_obj", WRAP_METHOD(Console, cmdSearchObj));
+	registerCmd("search", WRAP_METHOD(Console, cmdSearchObj));
 
 	registerCmd("add_obj", WRAP_METHOD(Console, cmdAddObj));
 
@@ -147,15 +147,26 @@ bool Console::cmdSearchObj(int argc, const char **argv) {
 	else {
 		Common::String name = argv[1];
 		Common::Array<ObjectID> array = GameObject::nameToID(name);
+		Common::String type;
 
 		if (array.size() == 0)
 			debugPrintf("No objects found!\n");
 		else {
 			for (uint i = 0; i < array.size(); ++i) {
-			ObjectID id = array[i];
+				ObjectID id = array[i];
 
-			GameObject *obj = GameObject::objectAddress(id);
-			debugPrintf("%s: %d\n", obj->objName(), id);
+				GameObject *obj = GameObject::objectAddress(id);
+
+				if (isObject(obj))
+					type = "OBJECT";
+				else if (isActor(obj))
+					type = "ACTOR";
+				else if (isWorld(obj))
+					type = "WORLD";
+				else
+					type = "???";
+
+				debugPrintf("%s: %d (%s)\n", obj->objName(), id, type.c_str());
 			}
 		}
 	}


Commit: a9f2fa115b06ef6ce2288b9ca3c03779a2181e26
    https://github.com/scummvm/scummvm/commit/a9f2fa115b06ef6ce2288b9ca3c03779a2181e26
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-25T05:29:28+09:00

Commit Message:
SAGA2: Add save/load location command

Changed paths:
    engines/saga2/console.cpp
    engines/saga2/console.h


diff --git a/engines/saga2/console.cpp b/engines/saga2/console.cpp
index 1672bad743..1f3d93dfae 100644
--- a/engines/saga2/console.cpp
+++ b/engines/saga2/console.cpp
@@ -69,6 +69,10 @@ Console::Console(Saga2Engine *vm) : GUI::Debugger() {
 
 	registerCmd("teleport_npc_here", WRAP_METHOD(Console, cmdTeleportNPCHere));
 
+	registerCmd("save_loc", WRAP_METHOD(Console, cmdSaveLoc));
+
+	registerCmd("load_loc", WRAP_METHOD(Console, cmdLoadLoc));
+
 	registerCmd("goto_place", WRAP_METHOD(Console, cmdGotoPlace));
 
 	registerCmd("list_places", WRAP_METHOD(Console, cmdListPlaces));
@@ -267,6 +271,32 @@ bool Console::cmdTeleportNPCHere(int argc, const char **argv) {
 	return true;
 }
 
+bool Console::cmdSaveLoc(int argc, const char **argv) {
+	if (argc != 1)
+		debugPrintf("Usage: %s\n", argv[0]);
+	else {
+		Actor *a = getCenterActor();
+		_savedLoc = a->getLocation();
+	}
+
+	return true;
+}
+
+bool Console::cmdLoadLoc(int argc, const char **argv) {
+	if (argc != 1)
+		debugPrintf("Usage: %s\n", argv[0]);
+	else {
+		Actor *a = getCenterActor();
+
+		if (_savedLoc.u != 0 || _savedLoc.v != 0 || _savedLoc.z != 0)
+			a->setLocation(_savedLoc);
+		else
+			debugPrintf("Location not saved!\n");
+	}
+
+	return true;
+}
+
 bool Console::cmdGotoPlace(int argc, const char **argv) {
 	if (argc != 2)
 		debugPrintf("Usage: %s <place id>\n", argv[0]);
diff --git a/engines/saga2/console.h b/engines/saga2/console.h
index ea519ac380..4e6f75748a 100644
--- a/engines/saga2/console.h
+++ b/engines/saga2/console.h
@@ -25,6 +25,8 @@
 
 #include "gui/debugger.h"
 
+#include "saga2/tcoords.h"
+
 namespace Saga2 {
 
 class Saga2Engine;
@@ -37,6 +39,8 @@ public:
 private:
 	Saga2Engine *_vm;
 
+	TilePoint _savedLoc;
+
 	bool cmdKillProtag(int argc, const char **argv);
 
 	bool cmdKill(int argc, const char **argv);
@@ -63,6 +67,10 @@ private:
 
 	bool cmdTeleportNPCHere(int argc, const char **argv);
 
+	bool cmdSaveLoc(int argc, const char **argv);
+
+	bool cmdLoadLoc(int argc, const char **argv);
+
 	bool cmdGotoPlace(int argc, const char **argv);
 
 	bool cmdListPlaces(int argc, const char **argv);


Commit: c2aac871a951b58e1dc3dd95072c0ec2d864009a
    https://github.com/scummvm/scummvm/commit/c2aac871a951b58e1dc3dd95072c0ec2d864009a
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-25T05:29:28+09:00

Commit Message:
SAGA2: Add command to teleport on click

Changed paths:
    engines/saga2/console.cpp
    engines/saga2/console.h
    engines/saga2/saga2.cpp
    engines/saga2/saga2.h
    engines/saga2/tilemode.cpp


diff --git a/engines/saga2/console.cpp b/engines/saga2/console.cpp
index 1f3d93dfae..18fefec3fe 100644
--- a/engines/saga2/console.cpp
+++ b/engines/saga2/console.cpp
@@ -61,6 +61,8 @@ Console::Console(Saga2Engine *vm) : GUI::Debugger() {
 
 	registerCmd("position", WRAP_METHOD(Console, cmdPosition));
 
+	registerCmd("teleport_on_click", WRAP_METHOD(Console, cmdTeleportOnClick));
+
 	registerCmd("teleport", WRAP_METHOD(Console, cmdTeleport));
 
 	registerCmd("teleport_to_npc", WRAP_METHOD(Console, cmdTeleportToNPC));
@@ -211,6 +213,17 @@ bool Console::cmdStats(int argc, const char **argv) {
 	return true;
 }
 
+bool Console::cmdTeleportOnClick(int argc, const char **argv) {
+	if (argc != 2)
+		debugPrintf("Usage: %s <1/0>\n", argv[0]);
+	else {
+		bool teleport = atoi(argv[1]);
+		_vm->_teleportOnClick = teleport;
+	}
+
+	return true;
+}
+
 bool Console::cmdTeleport(int argc, const char **argv) {
 	if (argc != 4)
 		debugPrintf("Usage: %s <u> <v> <z>\n", argv[0]);
diff --git a/engines/saga2/console.h b/engines/saga2/console.h
index 4e6f75748a..e3a1094496 100644
--- a/engines/saga2/console.h
+++ b/engines/saga2/console.h
@@ -59,6 +59,8 @@ private:
 
 	bool cmdStats(int argc, const char **argv);
 
+	bool cmdTeleportOnClick(int argc, const char **argv);
+
 	bool cmdTeleport(int argc, const char **argv);
 
 	bool cmdTeleportToNPC(int argc, const char **argv);
diff --git a/engines/saga2/saga2.cpp b/engines/saga2/saga2.cpp
index d37e35c605..96e92c90fe 100644
--- a/engines/saga2/saga2.cpp
+++ b/engines/saga2/saga2.cpp
@@ -75,6 +75,7 @@ Saga2Engine::Saga2Engine(OSystem *syst)
 	_speechText = true;
 	_showPosition = false;
 	_showStats = false;
+	_teleportOnClick = false;
 
 	SearchMan.addSubDirectoryMatching(gameDataDir, "res");
 	SearchMan.addSubDirectoryMatching(gameDataDir, "dos/drivers"); // For Miles Sound files
diff --git a/engines/saga2/saga2.h b/engines/saga2/saga2.h
index 58ee9d8927..fce526cb9f 100644
--- a/engines/saga2/saga2.h
+++ b/engines/saga2/saga2.h
@@ -178,6 +178,7 @@ public:
 	bool _autoWeapon;
 	bool _showNight;
 	bool _speechText;
+	bool _teleportOnClick;
 
 	bool _showPosition;
 	bool _showStats;
diff --git a/engines/saga2/tilemode.cpp b/engines/saga2/tilemode.cpp
index c6183df036..1d04c83463 100644
--- a/engines/saga2/tilemode.cpp
+++ b/engines/saga2/tilemode.cpp
@@ -1223,7 +1223,9 @@ static APPFUNC(cmdClickTileMap) {
 			//  We're not pointing at an object and the mouse cursor
 			//  does not have an object
 			else {
-				if (g_vm->_mouseInfo->getIntent() == GrabInfo::WalkTo
+				if (g_vm->_teleportOnClick) {
+					getCenterActor()->setLocation(walkToPos);
+				} else if (g_vm->_mouseInfo->getIntent() == GrabInfo::WalkTo
 				        &&  g_vm->_mouseInfo->getDoable()) {
 					if (pickedTAI == NULL) {
 						navigateDirect(walkToPos, false);


Commit: cff82fb3573934bcd70e04d8e2222e961350486b
    https://github.com/scummvm/scummvm/commit/cff82fb3573934bcd70e04d8e2222e961350486b
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-25T05:43:44+09:00

Commit Message:
SAGA2: Remove book/parchment close button images

Changed paths:
    engines/saga2/button.cpp
    engines/saga2/button.h
    engines/saga2/document.cpp


diff --git a/engines/saga2/button.cpp b/engines/saga2/button.cpp
index ca74efa473..7d1a3bdbef 100644
--- a/engines/saga2/button.cpp
+++ b/engines/saga2/button.cpp
@@ -483,6 +483,16 @@ gCompButton::gCompButton(gPanelList &list, const StaticRect &box, void **images,
 	extent        = box;
 }
 
+gCompButton::gCompButton(gPanelList &list, const Rect16 &box, AppFunc *cmd) : gCompImage(list, box, NULL, 0, cmd) {
+	forImage    = NULL;
+	resImage    = NULL;
+	dimImage    = NULL;
+
+	internalAlloc   = false;
+	dimmed          = false;
+	extent          = box;
+}
+
 gCompButton::~gCompButton(void) {
 	if (internalAlloc) {
 		if (forImage) {
diff --git a/engines/saga2/button.h b/engines/saga2/button.h
index aaeb75de27..0c143d7ecf 100644
--- a/engines/saga2/button.h
+++ b/engines/saga2/button.h
@@ -247,6 +247,7 @@ public:
 	gCompButton(gPanelList &, const StaticRect &, void **, int16,
 	            const char *, textPallete &, uint16, AppFunc *cmd = NULL);
 
+	gCompButton(gPanelList &, const Rect16 &, AppFunc *cmd = NULL);
 
 	~gCompButton(void);
 
diff --git a/engines/saga2/document.cpp b/engines/saga2/document.cpp
index 68df8d7870..20b360e567 100644
--- a/engines/saga2/document.cpp
+++ b/engines/saga2/document.cpp
@@ -788,19 +788,15 @@ int16 openBook(uint16 textScript) {
 	CDocument       *win = NULL;
 
 	gCompButton *closeBook;
-	void** closeBtnImage;
-	uint16 buttonResID = 0;
 	hResContext *decRes;
 
 	decRes = resFile->newContext(MKTAG('S', 'C', 'R', 'L'), "book resources");
 
-	closeBtnImage = loadButtonRes(decRes, buttonResID, numBtnImages);
-
 	// create the window
 	win = new CDocument(bookAppearance, bookText, &Script10Font, 0, NULL);
 
 	// make the quit button
-	closeBook = new gCompButton(*win, bookAppearance.closeRect, closeBtnImage, numBtnImages, 0, cmdDocumentQuit);
+	closeBook = new gCompButton(*win, bookAppearance.closeRect, cmdDocumentQuit);
 	closeBook->accelKey = 0x1B;
 
 	// attach the structure to the book, open the book
@@ -813,8 +809,6 @@ int16 openBook(uint16 textScript) {
 	// remove the window all attatched controls
 	delete  win;
 
-	unloadImageRes(closeBtnImage, numBtnImages);
-
 	if (decRes)
 		resFile->disposeContext(decRes);
 
@@ -841,18 +835,14 @@ int16 openParchment(uint16 textScript) {
 	CDocument       *win = NULL;
 
 	gCompButton *closeParchment;
-	void** closeBtnImage;
-	uint16 buttonResID = 0;
 	hResContext *decRes;
 
 	decRes = resFile->newContext(MKTAG('S', 'C', 'R', 'L'), "book resources");
 
-	closeBtnImage = loadButtonRes(decRes, buttonResID, numBtnImages);
-
 	// create the window
 	win = new CDocument(parchAppearance, bookText, &Script10Font, 0, NULL);
 	// make the quit button
-	closeParchment = new gCompButton(*win, parchAppearance.closeRect, closeBtnImage, numBtnImages, 0, cmdDocumentQuit);
+	closeParchment = new gCompButton(*win, parchAppearance.closeRect, cmdDocumentQuit);
 	closeParchment->accelKey = 0x1B;
 
 	// attach the structure to the book, open the book
@@ -865,8 +855,6 @@ int16 openParchment(uint16 textScript) {
 	// remove the window all attatched controls
 	delete  win;
 
-	unloadImageRes(closeBtnImage, numBtnImages);
-
 	if (decRes)
 		resFile->disposeContext(decRes);
 




More information about the Scummvm-git-logs mailing list