Skip to content

Commit

Permalink
DIRECTOR: Lingo: Added 'play' and 'play done' command stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Aug 7, 2016
1 parent e63460b commit 3864f31
Show file tree
Hide file tree
Showing 7 changed files with 798 additions and 715 deletions.
14 changes: 14 additions & 0 deletions engines/director/lingo/lingo-code.cpp
Expand Up @@ -695,6 +695,20 @@ void Lingo::c_gotoprevious() {
g_lingo->func_gotoprevious();
}

void Lingo::c_play() {
Common::String frame((char *)&(*g_lingo->_currentScript)[g_lingo->_pc]);
g_lingo->_pc += g_lingo->calcStringAlignment(frame.c_str());

Common::String movie((char *)&(*g_lingo->_currentScript)[g_lingo->_pc]);
g_lingo->_pc += g_lingo->calcStringAlignment(movie.c_str());

warning("STUB: c_play(%s, %s)", frame.c_str(), movie.c_str());
}

void Lingo::c_playdone() {
warning("STUB: c_playdone()");
}

void Lingo::c_call() {
Common::String name((char *)&(*g_lingo->_currentScript)[g_lingo->_pc]);
g_lingo->_pc += g_lingo->calcStringAlignment(name.c_str());
Expand Down
893 changes: 456 additions & 437 deletions engines/director/lingo/lingo-gr.cpp

Large diffs are not rendered by default.

66 changes: 35 additions & 31 deletions engines/director/lingo/lingo-gr.h
Expand Up @@ -88,21 +88,23 @@
tFACTORY = 304,
tMETHOD = 305,
tOPEN = 306,
tGE = 307,
tLE = 308,
tGT = 309,
tLT = 310,
tEQ = 311,
tNEQ = 312,
tAND = 313,
tOR = 314,
tNOT = 315,
tCONCAT = 316,
tCONTAINS = 317,
tSTARTS = 318,
tSPRITE = 319,
tINTERSECTS = 320,
tWITHIN = 321
tPLAY = 307,
tDONE = 308,
tGE = 309,
tLE = 310,
tGT = 311,
tLT = 312,
tEQ = 313,
tNEQ = 314,
tAND = 315,
tOR = 316,
tNOT = 317,
tCONCAT = 318,
tCONTAINS = 319,
tSTARTS = 320,
tSPRITE = 321,
tINTERSECTS = 322,
tWITHIN = 323
};
#endif
/* Tokens. */
Expand Down Expand Up @@ -155,21 +157,23 @@
#define tFACTORY 304
#define tMETHOD 305
#define tOPEN 306
#define tGE 307
#define tLE 308
#define tGT 309
#define tLT 310
#define tEQ 311
#define tNEQ 312
#define tAND 313
#define tOR 314
#define tNOT 315
#define tCONCAT 316
#define tCONTAINS 317
#define tSTARTS 318
#define tSPRITE 319
#define tINTERSECTS 320
#define tWITHIN 321
#define tPLAY 307
#define tDONE 308
#define tGE 309
#define tLE 310
#define tGT 311
#define tLT 312
#define tEQ 313
#define tNEQ 314
#define tAND 315
#define tOR 316
#define tNOT 317
#define tCONCAT 318
#define tCONTAINS 319
#define tSTARTS 320
#define tSPRITE 321
#define tINTERSECTS 322
#define tWITHIN 323



Expand All @@ -187,7 +191,7 @@ typedef union YYSTYPE
Common::Array<double> *arr;
}
/* Line 1529 of yacc.c. */
#line 191 "engines/director/lingo/lingo-gr.hpp"
#line 195 "engines/director/lingo/lingo-gr.hpp"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
Expand Down
27 changes: 22 additions & 5 deletions engines/director/lingo/lingo-gr.y
Expand Up @@ -84,7 +84,7 @@ void yyerror(char *s) {
%token<s> BLTIN BLTINNOARGS BLTINNOARGSORONE BLTINONEARG ID STRING HANDLER
%token tDOWN tELSE tNLELSIF tEND tEXIT tFRAME tGLOBAL tGO tIF tINTO tLOOP tMACRO
%token tMCI tMCIWAIT tMOVIE tNEXT tOF tPREVIOUS tPUT tREPEAT tSET tTHEN tTO tWHEN
%token tWITH tWHILE tNLELSE tFACTORY tMETHOD tOPEN
%token tWITH tWHILE tNLELSE tFACTORY tMETHOD tOPEN tPLAY tDONE
%token tGE tLE tGT tLT tEQ tNEQ tAND tOR tNOT
%token tCONCAT tCONTAINS tSTARTS
%token tSPRITE tINTERSECTS tWITHIN
Expand Down Expand Up @@ -400,6 +400,7 @@ func: tMCI STRING { g_lingo->code1(g_lingo->c_mci); g_lingo->codeString($2->c_
| tMCIWAIT ID { g_lingo->code1(g_lingo->c_mciwait); g_lingo->codeString($2->c_str()); delete $2; }
| tPUT expr { g_lingo->code1(g_lingo->c_printtop); }
| gotofunc
| playfunc
| tEXIT { g_lingo->codeConst(0); // Push fake value on stack
g_lingo->code1(g_lingo->c_procret); }
| tGLOBAL globallist
Expand Down Expand Up @@ -449,15 +450,31 @@ gotofunc: tGO tLOOP { g_lingo->code1(g_lingo->c_gotoloop); }
delete $2; }
;

gotoframe: tTO tFRAME STRING { $$ = $3; }
| tFRAME STRING { $$ = $2; }
| tTO STRING { $$ = $2; }
gotoframe: tFRAME STRING { $$ = $2; }
| STRING { $$ = $1; }
;

gotomovie: tOF tMOVIE STRING { $$ = $3; }
| tMOVIE STRING { $$ = $2; }
| tTO tMOVIE STRING { $$ = $3; }
;

playfunc: tPLAY tDONE { g_lingo->code1(g_lingo->c_playdone); }
| tPLAY gotoframe {
g_lingo->code1(g_lingo->c_play);
g_lingo->codeString($2->c_str());
g_lingo->codeString("");
delete $2; }
| tPLAY gotoframe gotomovie {
g_lingo->code1(g_lingo->c_play);
g_lingo->codeString($2->c_str());
g_lingo->codeString($3->c_str());
delete $2;
delete $3; }
| tPLAY gotomovie {
g_lingo->code1(g_lingo->c_play);
g_lingo->codeString("");
g_lingo->codeString($2->c_str());
delete $2; }
;

// macro
Expand Down

0 comments on commit 3864f31

Please sign in to comment.