mirror of
https://github.com/libretro/scummvm.git
synced 2025-05-13 09:36:21 +00:00
DIRECTOR: Lingo: Made 'go to' and 'play' commands work with expressions
This commit is contained in:
parent
a253d1f50e
commit
83a3cb7db1
@ -677,18 +677,13 @@ void Lingo::c_goto() {
|
||||
Datum mode = g_lingo->pop();
|
||||
Datum frame, movie;
|
||||
|
||||
if (mode.u.i == 1 || mode.u.i == 3)
|
||||
frame = g_lingo->pop();
|
||||
|
||||
if (mode.u.i == 2 || mode.u.i == 3)
|
||||
movie = g_lingo->pop();
|
||||
|
||||
frame.toString();
|
||||
movie.toString();
|
||||
if (mode.u.i == 1 || mode.u.i == 3)
|
||||
frame = g_lingo->pop();
|
||||
|
||||
warning("c_goto(%s, %s)", frame.u.s->c_str(), movie.u.s->c_str());
|
||||
|
||||
//g_lingo->func_goto(frame, movie);
|
||||
g_lingo->func_goto(frame, movie);
|
||||
}
|
||||
|
||||
void Lingo::c_gotoloop() {
|
||||
@ -704,13 +699,28 @@ void Lingo::c_gotoprevious() {
|
||||
}
|
||||
|
||||
void Lingo::c_play() {
|
||||
Common::String frame((char *)&(*g_lingo->_currentScript)[g_lingo->_pc]);
|
||||
g_lingo->_pc += g_lingo->calcStringAlignment(frame.c_str());
|
||||
Datum mode = g_lingo->pop();
|
||||
Datum frame, movie;
|
||||
|
||||
Common::String movie((char *)&(*g_lingo->_currentScript)[g_lingo->_pc]);
|
||||
g_lingo->_pc += g_lingo->calcStringAlignment(movie.c_str());
|
||||
if (mode.u.i == 2 || mode.u.i == 3)
|
||||
movie = g_lingo->pop();
|
||||
|
||||
warning("STUB: c_play(%s, %s)", frame.c_str(), movie.c_str());
|
||||
if (mode.u.i == 1 || mode.u.i == 3)
|
||||
frame = g_lingo->pop();
|
||||
|
||||
if (frame.type == VOID) {
|
||||
frame.u.s = new Common::String("<void>");
|
||||
frame.type = STRING;
|
||||
}
|
||||
frame.toString();
|
||||
|
||||
if (movie.type == VOID) {
|
||||
movie.u.s = new Common::String("<void>");
|
||||
movie.type = STRING;
|
||||
}
|
||||
movie.toString();
|
||||
|
||||
warning("STUB: c_play(%s, %s)", frame.u.s->c_str(), movie.u.s->c_str());
|
||||
}
|
||||
|
||||
void Lingo::c_playdone() {
|
||||
|
@ -189,25 +189,35 @@ void Lingo::func_mciwait(Common::String &s) {
|
||||
warning("STUB: MCI wait file: %s", s.c_str());
|
||||
}
|
||||
|
||||
void Lingo::func_goto(Common::String &frame, Common::String &movie) {
|
||||
if (!_vm->_movies || !_vm->_movies->contains(movie)) {
|
||||
warning("Movie %s does not exist", movie.c_str());
|
||||
return;
|
||||
}
|
||||
void Lingo::func_goto(Datum &frame, Datum &movie) {
|
||||
if (movie.type != VOID) {
|
||||
movie.toString();
|
||||
|
||||
_vm->_currentScore = _vm->_movies->getVal(movie);
|
||||
_vm->_currentScore->loadArchive();
|
||||
|
||||
if (frame.empty())
|
||||
return;
|
||||
|
||||
for (uint16 i = 0; i < frame.size(); i++) {
|
||||
if (!Common::isDigit(frame[i])) {
|
||||
_vm->_currentScore->setStartToLabel(frame);
|
||||
if (!_vm->_movies || !_vm->_movies->contains(*movie.u.s)) {
|
||||
warning("Movie %s does not exist", movie.u.s->c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
_vm->_currentScore = _vm->_movies->getVal(*movie.u.s);
|
||||
_vm->_currentScore->loadArchive();
|
||||
}
|
||||
_vm->_currentScore->setCurrentFrame(strtol(frame.c_str(), 0, 10));
|
||||
|
||||
if (!_vm->_currentScore) {
|
||||
warning("func_goto: No score is loaded");
|
||||
return;
|
||||
}
|
||||
|
||||
if (frame.type == VOID)
|
||||
return;
|
||||
|
||||
if (frame.type == STRING) {
|
||||
_vm->_currentScore->setStartToLabel(*frame.u.s);
|
||||
return;
|
||||
}
|
||||
|
||||
frame.toInt();
|
||||
|
||||
_vm->_currentScore->setCurrentFrame(frame.u.i);
|
||||
}
|
||||
|
||||
void Lingo::func_gotoloop() {
|
||||
|
@ -301,7 +301,7 @@ public:
|
||||
|
||||
void func_mci(Common::String &s);
|
||||
void func_mciwait(Common::String &s);
|
||||
void func_goto(Common::String &frame, Common::String &movie);
|
||||
void func_goto(Datum &frame, Datum &movie);
|
||||
void func_gotoloop();
|
||||
void func_gotonext();
|
||||
void func_gotoprevious();
|
||||
|
Loading…
x
Reference in New Issue
Block a user