aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kasak2009-08-09 04:12:36 +0000
committerDenis Kasak2009-08-09 04:12:36 +0000
commitf68ceeb88cb839f7205a0ba401b8ee329a439122 (patch)
treee8b2b3330092153ebc1d812e0303ecc378aec77d
parenteeb72e3d0db18043d6ce050ebb1103ca907d640c (diff)
downloadscummvm-rg350-f68ceeb88cb839f7205a0ba401b8ee329a439122.tar.gz
scummvm-rg350-f68ceeb88cb839f7205a0ba401b8ee329a439122.tar.bz2
scummvm-rg350-f68ceeb88cb839f7205a0ba401b8ee329a439122.zip
* 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). svn-id: r43161
-rw-r--r--engines/draci/script.cpp44
-rw-r--r--engines/draci/script.h4
2 files changed, 44 insertions, 4 deletions
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index a997fa4e55..872b10a3cb 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -81,8 +81,8 @@ void Script::setupCommandList() {
{ 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 @@ void Script::setupCommandList() {
{ "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 @@ int Script::funcIcoStat(int iconID) {
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 @@ void Script::talk(Common::Queue<int> &params) {
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 @@ void Script::talk(Common::Queue<int> &params) {
_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;
}
diff --git a/engines/draci/script.h b/engines/draci/script.h
index 38871a05f9..f6df7ecee5 100644
--- a/engines/draci/script.h
+++ b/engines/draci/script.h
@@ -119,6 +119,8 @@ private:
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 @@ private:
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);