mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-11 04:06:12 +00:00
DIRECTOR: Lingo: Implemented 'me' function support for factories
This commit is contained in:
parent
8a29870a8a
commit
0bda622337
@ -207,12 +207,25 @@ void Lingo::codeArgStore() {
|
||||
}
|
||||
|
||||
int Lingo::codeFunc(Common::String *s, int numpar) {
|
||||
g_lingo->code1(g_lingo->c_call);
|
||||
g_lingo->codeString(s->c_str());
|
||||
int ret = g_lingo->code1(g_lingo->c_call);
|
||||
|
||||
if (s->equalsIgnoreCase("me")) {
|
||||
if (!g_lingo->_currentFactory.empty()) {
|
||||
g_lingo->codeString(g_lingo->_currentFactory.c_str());
|
||||
debug(2, "Repaced 'me' with %s", g_lingo->_currentFactory.c_str());
|
||||
} else {
|
||||
warning("'me' out of factory method");
|
||||
g_lingo->codeString(s->c_str());
|
||||
}
|
||||
} else {
|
||||
g_lingo->codeString(s->c_str());
|
||||
}
|
||||
|
||||
inst num = 0;
|
||||
WRITE_UINT32(&num, numpar);
|
||||
g_lingo->code1(num);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Lingo::codeLabel(int label) {
|
||||
@ -239,7 +252,7 @@ void Lingo::processIf(int elselabel, int endlabel) {
|
||||
break;
|
||||
|
||||
WRITE_UINT32(&ielse1, else1);
|
||||
(*_currentScript)[label + 2] = ielse1; /* elsepart */
|
||||
(*_currentScript)[label + 2] = ielse1; /* elsepart */
|
||||
(*_currentScript)[label + 3] = iend; /* end, if cond fails */
|
||||
|
||||
else1 = label;
|
||||
|
@ -2377,7 +2377,7 @@ yyreduce:
|
||||
|
||||
case 105:
|
||||
#line 480 "engines/director/lingo/lingo-gr.y"
|
||||
{ g_lingo->_indef = true; ;}
|
||||
{ g_lingo->_indef = true; g_lingo->_currentFactory.clear(); ;}
|
||||
break;
|
||||
|
||||
case 106:
|
||||
|
@ -477,7 +477,7 @@ gotomovie: tOF tMOVIE STRING { $$ = $3; }
|
||||
//
|
||||
// See also:
|
||||
// on keyword
|
||||
defn: tMACRO ID { g_lingo->_indef = true; }
|
||||
defn: tMACRO ID { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); }
|
||||
begin argdef nl argstore stmtlist {
|
||||
g_lingo->code2(g_lingo->c_constpush, (inst)0); // Push fake value on stack
|
||||
g_lingo->code1(g_lingo->c_procret);
|
||||
|
Loading…
x
Reference in New Issue
Block a user