[Scummvm-cvs-logs] SF.net SVN: scummvm:[43161] scummvm/branches/gsoc2009-draci/engines/draci

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Sun Aug 9 06:12:37 CEST 2009


Revision: 43161
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43161&view=rev
Author:   dkasak13
Date:     2009-08-09 04:12:36 +0000 (Sun, 09 Aug 2009)

Log Message:
-----------
* Implemented GPL functions Script::funcActIco() and Script::funcIsIcoAct().
* Implemented GPL commands Script::loadMap() and Script::roomMap().
* Added temporary HACK to change some speech texts to use the small font because some strings overflow the screen (as stored in the data files).

Modified Paths:
--------------
    scummvm/branches/gsoc2009-draci/engines/draci/script.cpp
    scummvm/branches/gsoc2009-draci/engines/draci/script.h

Modified: scummvm/branches/gsoc2009-draci/engines/draci/script.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/script.cpp	2009-08-09 04:09:24 UTC (rev 43160)
+++ scummvm/branches/gsoc2009-draci/engines/draci/script.cpp	2009-08-09 04:12:36 UTC (rev 43161)
@@ -81,8 +81,8 @@
 		{ 19, 1, "Mark", 				0, { 0 }, &Script::mark },
 		{ 19, 2, "Release", 			0, { 0 }, &Script::release },
 		{ 20, 1, "Play", 				0, { 0 }, &Script::play },
-		{ 21, 1, "LoadMap", 			1, { 2 }, NULL },
-		{ 21, 2, "RoomMap", 			0, { 0 }, NULL },
+		{ 21, 1, "LoadMap", 			1, { 2 }, &Script::loadMap },
+		{ 21, 2, "RoomMap", 			0, { 0 }, &Script::roomMap },
 		{ 22, 1, "DisableQuickHero", 	0, { 0 }, NULL },
 		{ 22, 2, "EnableQuickHero", 	0, { 0 }, NULL },
 		{ 23, 1, "DisableSpeedText", 	0, { 0 }, NULL },
@@ -119,9 +119,9 @@
 		{ "Not", 		&Script::funcNot },
 		{ "Random", 	&Script::funcRandom },
 		{ "IsIcoOn", 	&Script::funcIsIcoOn },
-		{ "IsIcoAct", 	NULL },
+		{ "IsIcoAct", 	&Script::funcIsIcoAct },
 		{ "IcoStat", 	&Script::funcIcoStat },
-		{ "ActIco", 	NULL },
+		{ "ActIco", 	&Script::funcActIco },
 		{ "IsObjOn", 	&Script::funcIsObjOn },
 		{ "IsObjOff", 	&Script::funcIsObjOff },
 		{ "IsObjAway", 	&Script::funcIsObjAway },
@@ -235,6 +235,22 @@
 	return (status == 1) ? 1 : 2;
 }
 
+int Script::funcIsIcoAct(int iconID) {
+	iconID -= 1;
+
+	return _vm->_game->getCurrentIcon() == iconID;
+}
+
+int Script::funcActIco(int iconID) {
+	
+	// The parameter seems to be an omission in the original player since it's not
+	// used in the implementation of the function. It's possible that the functions were
+	// implemented in such a way that they had to have a single parameter so this is only
+	// passed as a dummy.
+
+	return _vm->_game->getCurrentIcon();
+}
+
 int Script::funcIsObjOn(int objID) {
 	objID -= 1;
 
@@ -555,6 +571,14 @@
 	speechFrame->setText(Common::String((const char *)f->_data+1, f->_length-1));
 	speechFrame->setColour(person->_fontColour);
 
+	// HACK: Some strings in the English data files are too long to fit the screen
+	// This is a temporary resolution.
+	if (speechFrame->getWidth() >= kScreenWidth) {
+		speechFrame->setFont(_vm->_smallFont);
+	} else {
+		speechFrame->setFont(_vm->_bigFont);		
+	}
+
 	// Set the loop substatus to an appropriate value
 	_vm->_game->setLoopSubstatus(kStatusTalk);
 
@@ -583,6 +607,18 @@
 	_vm->_game->setExitLoop(false);
 }
 
+void Script::loadMap(Common::Queue<int> &params) {
+	int mapID = params.pop() - 1;
+
+	_vm->_game->loadWalkingMap(mapID);
+}
+
+void Script::roomMap(Common::Queue<int> &params) {
+
+	// Load the default walking map for the room
+	_vm->_game->loadWalkingMap();
+}
+
 void Script::endCurrentProgram() {
 	_endProgram = true;
 }

Modified: scummvm/branches/gsoc2009-draci/engines/draci/script.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/script.h	2009-08-09 04:09:24 UTC (rev 43160)
+++ scummvm/branches/gsoc2009-draci/engines/draci/script.h	2009-08-09 04:12:36 UTC (rev 43161)
@@ -119,6 +119,8 @@
 	void startPlay(Common::Queue<int> &params);
 	void newRoom(Common::Queue<int> &params);
 	void talk(Common::Queue<int> &params);
+	void loadMap(Common::Queue<int> &params);
+	void roomMap(Common::Queue<int> &params);
 
 	int operAnd(int op1, int op2);
 	int operOr(int op1, int op2);
@@ -139,6 +141,8 @@
 	int funcNot(int n);
 	int funcIsIcoOn(int iconID);
 	int funcIcoStat(int iconID);
+	int funcActIco(int iconID);
+	int funcIsIcoAct(int iconID);
 	int funcIsObjOn(int objID);
 	int funcIsObjOff(int objID);
 	int funcIsObjAway(int objID);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list