Skip to content

Commit

Permalink
DIRECTOR: Lingo: Fix parsing multiple macros
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Aug 3, 2016
1 parent cd133e7 commit c376b12
Show file tree
Hide file tree
Showing 8 changed files with 543 additions and 480 deletions.
27 changes: 26 additions & 1 deletion engines/director/director.cpp
Expand Up @@ -73,6 +73,29 @@ Common::Error DirectorEngine::run() {

_lingo = new Lingo(this);
_soundManager = new DirectorSound();
_lingo->addCode("--\n\
macro SHIPX\n\
set x = 5\n\
if x = 1 then\n\
go \"Zoom\"\n\
exit\n\
end if\n\
if x >1 then\n\
exit\n\
end if\n\
\n\
--\n\
macro ZIPX\n\
set x = 5\n\
if x = 1 then\n\
go \"ZIP\"\n\
exit\n\
end if\n\
if x >1 then\n\
exit\n\
end if\n\
", kMovieScript, 1);

_lingo->addCode("mci \"open MM\\T005045a.wav type WaveAudio alias T005045a\"\n\
mci \"play T005045a from 22710 to 32872\"", kMovieScript, 1);

Expand All @@ -87,11 +110,13 @@ 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\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\
Expand Down
4 changes: 4 additions & 0 deletions engines/director/lingo/lingo-code.cpp
Expand Up @@ -334,6 +334,10 @@ void Lingo::c_ifcode() {
//************************
// Built-in functions
//************************
void Lingo::c_exit() {
warning("STUB: c_exit()");
}

void Lingo::c_mci() {
Common::String s((char *)&(*g_lingo->_currentScript)[g_lingo->_pc]);

Expand Down

0 comments on commit c376b12

Please sign in to comment.