aboutsummaryrefslogtreecommitdiff
path: root/engines/director/director.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/director/director.cpp')
-rw-r--r--engines/director/director.cpp158
1 files changed, 7 insertions, 151 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index bbd7916a41..58a5459602 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -104,158 +104,14 @@ Common::Error DirectorEngine::run() {
_lingo = new Lingo(this);
_soundManager = new DirectorSound();
-#if 0
- _mainArchive = nullptr;
- _currentScore = nullptr;
-
- _lingo->addCode("--\n\
- set x = 1\n\
- if x = 5 then exit\n\
- else put 10.0\n\
- repeat with x = 1 to 5\n\
- if x = 3 then put 30\n\
- else if x = 4 then put 40\n\
- else if x = 5 then put 50\n\
- else put 10.0\n\
- if x = 1 then\n\
- put 1\n\
- else if x = 2 then\n\
- put 1232.12345678901234\n\
- put 2.2\n\
- else if x = 3 then put 3\n\
- end if\n\
- if x = 4 then put 4\n\
- else put 5\n\
- end repeat\n\
- set z = \"foo bar baz\"\n\
- set z1 = z & \" meow\"\n\
- set z1 = z1 && \"woof\"\n\
- put z\n\
- put z1\n\
- put chars(\"Macromedia\", 6, 6)\n\
- put chars(\"Macromedia\", 6, 10)\n\
- put chars(\"Macromedia\", -1, 15)\n\
- if z1 contains \"Me\xafW\" then\n\
- put \"Contains\"\n\
- else\n\
- put \"Doesn't contain\"\n\
- end if\n\
-", kMovieScript, 2);
-
-_lingo->executeScript(kMovieScript, 2);
-
-return Common::kNoError;
-
- _lingo->addCode("--\n\
-macro SHIPX\n\
-global x, y\n\
-set x = Random(5)\n\
-if x = 1 then\n\
-go \"Zoom\"\n\
-exit\n\
-end if\n\
-if x >1 then\n\
-set y = 10\n\
-exit\n\
-end if\n\
-put 100\n\
-\n\
---\n\
-macro ZIPX\n\
-set x = Random(5)\n\
-if x = 1 then\n\
-go \"ZIP\"\n\
-exit\n\
-end if\n\
-if x >1 then\n\
-put x\n\
-exit\n\
-end if\n\
-\n\
---\n\
-macro check par1, par2 \n\
-, par3\n\
-if par1 = 3 then\n\
- put -3\n\
-else\n\
- put 0\n\
-end if \n\
-if par2 = 2 then \n\
- put 2 \n\
-else \n\
- put 0\n\
-end if\n\
-put par1\n\
-put par2\n\
-put par3\n\
-", kMovieScript, 1);
-
-_lingo->addCode("check(2, 3)\n\
-global x, y\n\
-set y = 8\n\
-shipx\n\
-put x\n\
-zipx\n\
-put x\n\
-put y\n\
-check(1, 2, 3)\n\
-check 4, 5, 6\n\
-check 7, 8\n\
-if random(4) > 2 then put 1000\n\
-set z = 5.5\n\
-set z1 = 2\n\
-set z2 = z / z1\n\
-put z\n\
-put z1\n\
-put z2\n\
-put integer(z2)\n\
-put cos(z2)\n\
-", kMovieScript, 2);
-
-_lingo->executeScript(kMovieScript, 2);
-
-return Common::kNoError;
-
-
- _lingo->addCode("mci \"open MM\\T005045a.wav type WaveAudio alias T005045a\"\n\
- mci \"play T005045a from 22710 to 32872\"", kMovieScript, 1);
-
- _lingo->addCode("go to frame \"Open23\" of movie \"OpenCabin23\"\n\
-go \"CARDBACK\"\n\
-go movie \"BAR 1\"\n\
-go to \"Open23\" of movie \"OpenCabin23\"\n\
-go to \"Chair\"\n\
-set x = 2 + 3 * (4 / 2)\n\
-put x\n", kMovieScript, 2);
-
-_lingo->addCode("set x = 5\n\
-if x <= 5 then set x = 6 end if\n\
-if (x = 5) then\n\
- set x = 7 -- this is comment\n\
-else\n\
- set x = 8\n\
- -- this is another comment\n\
-end if\n\
-put x\n\
--- this is more comment\n\
-set y = 1\n\
-repeat while (y < 5)\n\
- set y = y + 1\n\
- put y\n\
-end repeat\n\
-\n\
-repeat with z = 10 to 15\n\
- put z\n\
-end repeat\n\
-repeat with y = 5 down to 1\n\
-put y\n\
-end repeat\n\
-", kMovieScript, 3);
-
- _lingo->executeScript(kMovieScript, 3);
+ if (getGameID() == GID_TEST) {
+ _mainArchive = nullptr;
+ _currentScore = nullptr;
- return Common::kNoError;
-#endif
+ _lingo->runTests();
+
+ return Common::kNoError;
+ }
//FIXME
_mainArchive = new RIFFArchive();