aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorRobert Špalek2009-10-11 23:28:40 +0000
committerRobert Špalek2009-10-11 23:28:40 +0000
commit62cebbb51ee74ca5341d2dd35af79b723d738222 (patch)
treec1cc4be5cab7161c543f7e12c08eae5286fb670d /engines
parentf71b32dd96cc524fbb433752ea2ead51e1cf02a4 (diff)
downloadscummvm-rg350-62cebbb51ee74ca5341d2dd35af79b723d738222.tar.gz
scummvm-rg350-62cebbb51ee74ca5341d2dd35af79b723d738222.tar.bz2
scummvm-rg350-62cebbb51ee74ca5341d2dd35af79b723d738222.zip
Implemented a few more harmless GPL2 commands
svn-id: r44958
Diffstat (limited to 'engines')
-rw-r--r--engines/draci/game.cpp13
-rw-r--r--engines/draci/game.h4
-rw-r--r--engines/draci/script.cpp27
-rw-r--r--engines/draci/script.h3
4 files changed, 41 insertions, 6 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 34549df416..6d0c929fc6 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -219,6 +219,7 @@ void Game::init() {
setRoomNum(kNoEscRoom);
rememberRoomNumAsPrevious();
scheduleEnteringRoomUsingGate(_info._startRoom, 0);
+ _pushedNewRoom = _pushedNewGate = -1;
}
void Game::loop() {
@@ -1426,6 +1427,18 @@ void Game::scheduleEnteringRoomUsingGate(int room, int gate) {
_newGate = gate;
}
+void Game::pushNewRoom() {
+ _pushedNewRoom = _newRoom;
+ _pushedNewGate = _newGate;
+}
+
+void Game::popNewRoom() {
+ if (_loopStatus != kStatusInventory && _pushedNewRoom >= 0) {
+ scheduleEnteringRoomUsingGate(_pushedNewRoom, _pushedNewGate);
+ _pushedNewRoom = _pushedNewGate = -1;
+ }
+}
+
void Game::setLoopStatus(LoopStatus status) {
_loopStatus = status;
}
diff --git a/engines/draci/game.h b/engines/draci/game.h
index 57f0c799ae..54d4a6844c 100644
--- a/engines/draci/game.h
+++ b/engines/draci/game.h
@@ -281,6 +281,8 @@ public:
int getPreviousRoomNum() const;
void rememberRoomNumAsPrevious();
void scheduleEnteringRoomUsingGate(int room, int gate);
+ void pushNewRoom();
+ void popNewRoom();
double getPers0() const;
double getPersStep() const;
@@ -371,6 +373,8 @@ private:
int _newRoom;
int _newGate;
int _previousRoom;
+ int _pushedNewRoom; // used in GPL programs
+ int _pushedNewGate;
uint *_dialogueOffsets;
int _currentDialogue;
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index ecdca91435..1650e2b72f 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -70,9 +70,9 @@ void Script::setupCommandList() {
{ 15, 1, "ExecInit", 1, { 3 }, &Script::execInit },
{ 15, 2, "ExecLook", 1, { 3 }, &Script::execLook },
{ 15, 3, "ExecUse", 1, { 3 }, &Script::execUse },
- { 16, 1, "RepaintInventory", 0, { 0 }, NULL },
- { 16, 2, "ExitInventory", 0, { 0 }, NULL },
- { 17, 1, "ExitMap", 0, { 0 }, NULL },
+ { 16, 1, "RepaintInventory", 0, { 0 }, NULL }, // not used in the original game files
+ { 16, 2, "ExitInventory", 0, { 0 }, NULL }, // not used in the original game files
+ { 17, 1, "ExitMap", 0, { 0 }, NULL }, // not used in the original game files
{ 18, 1, "LoadMusic", 1, { 2 }, NULL },
{ 18, 2, "StartMusic", 0, { 0 }, NULL },
{ 18, 3, "StopMusic", 0, { 0 }, NULL },
@@ -87,9 +87,12 @@ void Script::setupCommandList() {
{ 22, 2, "EnableQuickHero", 0, { 0 }, NULL },
{ 23, 1, "DisableSpeedText", 0, { 0 }, NULL },
{ 23, 2, "EnableSpeedText", 0, { 0 }, NULL },
- { 24, 1, "QuitGame", 0, { 0 }, NULL },
- { 25, 1, "PushNewRoom", 0, { 0 }, NULL },
- { 25, 2, "PopNewRoom", 0, { 0 }, NULL },
+ { 24, 1, "QuitGame", 0, { 0 }, &Script::quitGame },
+ { 25, 1, "PushNewRoom", 0, { 0 }, &Script::pushNewRoom },
+ { 25, 2, "PopNewRoom", 0, { 0 }, &Script::popNewRoom },
+ // The following commands are not even defined in the game
+ // sources, but their numbers are allocated for internal
+ // purposes of the old player.
{ 26, 1, "ShowCheat", 0, { 0 }, NULL },
{ 26, 2, "HideCheat", 0, { 0 }, NULL },
{ 26, 3, "ClearCheat", 1, { 1 }, NULL },
@@ -823,6 +826,18 @@ void Script::endCurrentProgram() {
_endProgram = true;
}
+void Script::quitGame(Common::Queue<int> &params) {
+ _vm->_game->setQuit(true);
+}
+
+void Script::pushNewRoom(Common::Queue<int> &params) {
+ _vm->_game->pushNewRoom();
+}
+
+void Script::popNewRoom(Common::Queue<int> &params) {
+ _vm->_game->popNewRoom();
+}
+
/**
* @brief Evaluates mathematical expressions
* @param reader Stream reader set to the beginning of the expression
diff --git a/engines/draci/script.h b/engines/draci/script.h
index c9f1a61e66..57412215ba 100644
--- a/engines/draci/script.h
+++ b/engines/draci/script.h
@@ -133,6 +133,9 @@ private:
void setPalette(Common::Queue<int> &params);
void blackPalette(Common::Queue<int> &params);
void loadPalette(Common::Queue<int> &params);
+ void quitGame(Common::Queue<int> &params);
+ void pushNewRoom(Common::Queue<int> &params);
+ void popNewRoom(Common::Queue<int> &params);
int operAnd(int op1, int op2) const;
int operOr(int op1, int op2) const;