aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/lingo/lingo-builtins.cpp643
-rw-r--r--engines/director/lingo/lingo-builtins.h211
-rw-r--r--engines/director/lingo/lingo-code.cpp3
-rw-r--r--engines/director/lingo/lingo-codegen.cpp3
-rw-r--r--engines/director/lingo/lingo.h183
5 files changed, 542 insertions, 501 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 654ffedb67..8f0fe48a1c 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -24,6 +24,7 @@
#include "director/director.h"
#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-builtins.h"
#include "director/lingo/lingo-code.h"
#include "director/frame.h"
#include "director/score.h"
@@ -45,188 +46,188 @@ static struct BuiltinProto {
int type;
} builtins[] = {
// Math
- { "abs", Lingo::b_abs, 1, 1, true, 2, FBLTIN }, // D2 function
- { "atan", Lingo::b_atan, 1, 1, true, 4, FBLTIN }, // D4 f
- { "cos", Lingo::b_cos, 1, 1, true, 4, FBLTIN }, // D4 f
- { "exp", Lingo::b_exp, 1, 1, true, 4, FBLTIN }, // D4 f
- { "float", Lingo::b_float, 1, 1, true, 4, FBLTIN }, // D4 f
- { "integer", Lingo::b_integer, 1, 1, true, 3, FBLTIN }, // D3 f
- { "log", Lingo::b_log, 1, 1, true, 4, FBLTIN }, // D4 f
- { "pi", Lingo::b_pi, 0, 0, true, 4, FBLTIN }, // D4 f
- { "power", Lingo::b_power, 2, 2, true, 4, FBLTIN }, // D4 f
- { "random", Lingo::b_random, 1, 1, true, 2, FBLTIN }, // D2 f
- { "sin", Lingo::b_sin, 1, 1, true, 4, FBLTIN }, // D4 f
- { "sqrt", Lingo::b_sqrt, 1, 1, true, 2, FBLTIN }, // D2 f
- { "tan", Lingo::b_tan, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "abs", LB::b_abs, 1, 1, true, 2, FBLTIN }, // D2 function
+ { "atan", LB::b_atan, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "cos", LB::b_cos, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "exp", LB::b_exp, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "float", LB::b_float, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "integer", LB::b_integer, 1, 1, true, 3, FBLTIN }, // D3 f
+ { "log", LB::b_log, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "pi", LB::b_pi, 0, 0, true, 4, FBLTIN }, // D4 f
+ { "power", LB::b_power, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "random", LB::b_random, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "sin", LB::b_sin, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "sqrt", LB::b_sqrt, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "tan", LB::b_tan, 1, 1, true, 4, FBLTIN }, // D4 f
// String
- { "chars", Lingo::b_chars, 3, 3, true, 2, FBLTIN }, // D2 f
- { "charToNum", Lingo::b_charToNum, 1, 1, true, 2, FBLTIN }, // D2 f
- { "delete", Lingo::b_delete, 1, 1, true, 3, BLTIN }, // D3 c
- { "hilite", Lingo::b_hilite, 1, 1, true, 3, BLTIN }, // D3 c
- { "length", Lingo::b_length, 1, 1, true, 2, FBLTIN }, // D2 f
- { "numToChar", Lingo::b_numToChar, 1, 1, true, 2, FBLTIN }, // D2 f
- { "offset", Lingo::b_offset, 2, 3, true, 2, FBLTIN }, // D2 f
- { "string", Lingo::b_string, 1, 1, true, 2, FBLTIN }, // D2 f
- { "value", Lingo::b_value, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "chars", LB::b_chars, 3, 3, true, 2, FBLTIN }, // D2 f
+ { "charToNum", LB::b_charToNum, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "delete", LB::b_delete, 1, 1, true, 3, BLTIN }, // D3 c
+ { "hilite", LB::b_hilite, 1, 1, true, 3, BLTIN }, // D3 c
+ { "length", LB::b_length, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "numToChar", LB::b_numToChar, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "offset", LB::b_offset, 2, 3, true, 2, FBLTIN }, // D2 f
+ { "string", LB::b_string, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "value", LB::b_value, 1, 1, true, 2, FBLTIN }, // D2 f
// Lists
- { "add", Lingo::b_add, 2, 2, false, 4, BLTIN }, // D4 command
- { "addAt", Lingo::b_addAt, 3, 3, false, 4, BLTIN }, // D4 c
- { "addProp", Lingo::b_addProp, 3, 3, false, 4, BLTIN }, // D4 c
- { "append", Lingo::b_append, 2, 2, false, 4, BLTIN }, // D4 c
- { "count", Lingo::b_count, 1, 1, true, 4, FBLTIN }, // D4 f
- { "deleteAt", Lingo::b_deleteAt, 2, 2, false, 4, BLTIN }, // D4 c
- { "deleteProp", Lingo::b_deleteProp, 2, 2, false, 4, BLTIN }, // D4 c
- { "findPos", Lingo::b_findPos, 2, 2, true, 4, FBLTIN }, // D4 f
- { "findPosNear", Lingo::b_findPosNear, 2, 2, true, 4, FBLTIN }, // D4 f
- { "getaProp", Lingo::b_getaProp, 2, 2, true, 4, FBLTIN }, // D4 f
- { "getAt", Lingo::b_getAt, 2, 2, true, 4, FBLTIN }, // D4 f
- { "getLast", Lingo::b_getLast, 1, 1, true, 4, FBLTIN }, // D4 f
- { "getOne", Lingo::b_getOne, 2, 2, true, 4, FBLTIN }, // D4 f
- { "getPos", Lingo::b_getPos, 2, 2, true, 4, FBLTIN }, // D4 f
- { "getProp", Lingo::b_getProp, 2, 2, true, 4, FBLTIN }, // D4 f
- { "getPropAt", Lingo::b_getPropAt, 2, 2, true, 4, FBLTIN }, // D4 f
- { "list", Lingo::b_list, -1, 0, true, 4, FBLTIN }, // D4 f
- { "listP", Lingo::b_listP, 1, 1, true, 4, FBLTIN }, // D4 f
- { "max", Lingo::b_max, 1, 1, true, 4, FBLTIN }, // D4 f
- { "min", Lingo::b_min, 1, 1, true, 4, FBLTIN }, // D4 f
- { "setaProp", Lingo::b_setaProp, 3, 3, false, 4, BLTIN }, // D4 c
- { "setAt", Lingo::b_setAt, 3, 3, false, 4, BLTIN }, // D4 c
- { "setProp", Lingo::b_setProp, 3, 3, false, 4, BLTIN }, // D4 c
- { "sort", Lingo::b_sort, 1, 1, false, 4, BLTIN }, // D4 c
+ { "add", LB::b_add, 2, 2, false, 4, BLTIN }, // D4 command
+ { "addAt", LB::b_addAt, 3, 3, false, 4, BLTIN }, // D4 c
+ { "addProp", LB::b_addProp, 3, 3, false, 4, BLTIN }, // D4 c
+ { "append", LB::b_append, 2, 2, false, 4, BLTIN }, // D4 c
+ { "count", LB::b_count, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "deleteAt", LB::b_deleteAt, 2, 2, false, 4, BLTIN }, // D4 c
+ { "deleteProp", LB::b_deleteProp, 2, 2, false, 4, BLTIN }, // D4 c
+ { "findPos", LB::b_findPos, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "findPosNear", LB::b_findPosNear, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "getaProp", LB::b_getaProp, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "getAt", LB::b_getAt, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "getLast", LB::b_getLast, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "getOne", LB::b_getOne, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "getPos", LB::b_getPos, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "getProp", LB::b_getProp, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "getPropAt", LB::b_getPropAt, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "list", LB::b_list, -1, 0, true, 4, FBLTIN }, // D4 f
+ { "listP", LB::b_listP, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "max", LB::b_max, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "min", LB::b_min, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "setaProp", LB::b_setaProp, 3, 3, false, 4, BLTIN }, // D4 c
+ { "setAt", LB::b_setAt, 3, 3, false, 4, BLTIN }, // D4 c
+ { "setProp", LB::b_setProp, 3, 3, false, 4, BLTIN }, // D4 c
+ { "sort", LB::b_sort, 1, 1, false, 4, BLTIN }, // D4 c
// Files
- { "closeDA", Lingo::b_closeDA, 0, 0, false, 2, BLTIN }, // D2 c
- { "closeResFile", Lingo::b_closeResFile, 0, 1, false, 2, BLTIN }, // D2 c
- { "closeXlib", Lingo::b_closeXlib, 0, 1, false, 2, BLTIN }, // D2 c
- { "getNthFileNameInFolder",Lingo::b_getNthFileNameInFolder,2,2,true,4,FBLTIN },// D4 f
+ { "closeDA", LB::b_closeDA, 0, 0, false, 2, BLTIN }, // D2 c
+ { "closeResFile", LB::b_closeResFile, 0, 1, false, 2, BLTIN }, // D2 c
+ { "closeXlib", LB::b_closeXlib, 0, 1, false, 2, BLTIN }, // D2 c
+ { "getNthFileNameInFolder",LB::b_getNthFileNameInFolder,2,2,true,4,FBLTIN },// D4 f
// open // D2 c
- { "openDA", Lingo::b_openDA, 1, 1, false, 2, BLTIN }, // D2 c
- { "openResFile", Lingo::b_openResFile, 1, 1, false, 2, BLTIN }, // D2 c
- { "openXlib", Lingo::b_openXlib, 1, 1, false, 2, BLTIN }, // D2 c
- { "saveMovie", Lingo::b_saveMovie, 1, 1, false, 4, BLTIN }, // D4 c
- { "setCallBack", Lingo::b_setCallBack, 2, 2, false, 3, BLTIN }, // D3 c
- { "showResFile", Lingo::b_showResFile, 0, 1, false, 2, BLTIN }, // D2 c
- { "showXlib", Lingo::b_showXlib, 0, 1, false, 2, BLTIN }, // D2 c
- { "xFactoryList", Lingo::b_xFactoryList, 1, 1, true, 3, FBLTIN }, // D3 f
+ { "openDA", LB::b_openDA, 1, 1, false, 2, BLTIN }, // D2 c
+ { "openResFile", LB::b_openResFile, 1, 1, false, 2, BLTIN }, // D2 c
+ { "openXlib", LB::b_openXlib, 1, 1, false, 2, BLTIN }, // D2 c
+ { "saveMovie", LB::b_saveMovie, 1, 1, false, 4, BLTIN }, // D4 c
+ { "setCallBack", LB::b_setCallBack, 2, 2, false, 3, BLTIN }, // D3 c
+ { "showResFile", LB::b_showResFile, 0, 1, false, 2, BLTIN }, // D2 c
+ { "showXlib", LB::b_showXlib, 0, 1, false, 2, BLTIN }, // D2 c
+ { "xFactoryList", LB::b_xFactoryList, 1, 1, true, 3, FBLTIN }, // D3 f
// Control
- { "abort", Lingo::b_abort, 0, 0, false, 4, BLTIN }, // D4 c
- { "continue", Lingo::b_continue, 0, 0, false, 2, BLTIN }, // D2 c
- { "dontPassEvent", Lingo::b_dontPassEvent, 0, 0, false, 2, BLTIN }, // D2 c
- { "delay", Lingo::b_delay, 1, 1, false, 2, BLTIN }, // D2 c
- { "do", Lingo::b_do, 1, 1, false, 2, BLTIN }, // D2 c
- { "halt", Lingo::b_halt, 0, 0, false, 4, BLTIN }, // D4 c
- { "nothing", Lingo::b_nothing, 0, 0, false, 2, BLTIN }, // D2 c
- { "pass", Lingo::b_pass, 0, 0, false, 4, BLTIN }, // D4 c
- { "pause", Lingo::b_pause, 0, 0, false, 2, BLTIN }, // D2 c
+ { "abort", LB::b_abort, 0, 0, false, 4, BLTIN }, // D4 c
+ { "continue", LB::b_continue, 0, 0, false, 2, BLTIN }, // D2 c
+ { "dontPassEvent", LB::b_dontPassEvent, 0, 0, false, 2, BLTIN }, // D2 c
+ { "delay", LB::b_delay, 1, 1, false, 2, BLTIN }, // D2 c
+ { "do", LB::b_do, 1, 1, false, 2, BLTIN }, // D2 c
+ { "halt", LB::b_halt, 0, 0, false, 4, BLTIN }, // D4 c
+ { "nothing", LB::b_nothing, 0, 0, false, 2, BLTIN }, // D2 c
+ { "pass", LB::b_pass, 0, 0, false, 4, BLTIN }, // D4 c
+ { "pause", LB::b_pause, 0, 0, false, 2, BLTIN }, // D2 c
// play // D2 c
- { "playAccel", Lingo::b_playAccel, -1,0, false, 2, BLTIN }, // D2
+ { "playAccel", LB::b_playAccel, -1,0, false, 2, BLTIN }, // D2
// play done // D2
- { "preLoad", Lingo::b_preLoad, -1,0, false, 3, BLTIN }, // D3 c
- { "preLoadCast", Lingo::b_preLoadCast, -1,0, false, 3, BLTIN }, // D3 c
- { "quit", Lingo::b_quit, 0, 0, false, 2, BLTIN }, // D2 c
- { "restart", Lingo::b_restart, 0, 0, false, 2, BLTIN }, // D2 c
- { "return", Lingo::b_return, 0, 1, false, 2, BLTIN }, // D2 function
- { "shutDown", Lingo::b_shutDown, 0, 0, false, 2, BLTIN }, // D2 c
- { "startTimer", Lingo::b_startTimer, 0, 0, false, 2, BLTIN }, // D2 c
+ { "preLoad", LB::b_preLoad, -1,0, false, 3, BLTIN }, // D3 c
+ { "preLoadCast", LB::b_preLoadCast, -1,0, false, 3, BLTIN }, // D3 c
+ { "quit", LB::b_quit, 0, 0, false, 2, BLTIN }, // D2 c
+ { "restart", LB::b_restart, 0, 0, false, 2, BLTIN }, // D2 c
+ { "return", LB::b_return, 0, 1, false, 2, BLTIN }, // D2 function
+ { "shutDown", LB::b_shutDown, 0, 0, false, 2, BLTIN }, // D2 c
+ { "startTimer", LB::b_startTimer, 0, 0, false, 2, BLTIN }, // D2 c
// when keyDown // D2
// when mouseDown // D2
// when mouseUp // D2
// when timeOut // D2
// Types
- { "factory", Lingo::b_factoryP, 1, 1, true, 3, FBLTIN }, // D3
- { "floatP", Lingo::b_floatP, 1, 1, true, 3, FBLTIN }, // D3
- { "ilk", Lingo::b_ilk, 1, 2, false, 4, FBLTIN }, // D4 f
- { "integerp", Lingo::b_integerp, 1, 1, true, 2, FBLTIN }, // D2 f
- { "objectp", Lingo::b_objectp, 1, 1, true, 2, FBLTIN }, // D2 f
- { "pictureP", Lingo::b_pictureP, 1, 1, true, 4, FBLTIN }, // D4 f
- { "stringp", Lingo::b_stringp, 1, 1, true, 2, FBLTIN }, // D2 f
- { "symbolp", Lingo::b_symbolp, 1, 1, true, 2, FBLTIN }, // D2 f
- { "voidP", Lingo::b_voidP, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "factory", LB::b_factoryP, 1, 1, true, 3, FBLTIN }, // D3
+ { "floatP", LB::b_floatP, 1, 1, true, 3, FBLTIN }, // D3
+ { "ilk", LB::b_ilk, 1, 2, false, 4, FBLTIN }, // D4 f
+ { "integerp", LB::b_integerp, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "objectp", LB::b_objectp, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "pictureP", LB::b_pictureP, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "stringp", LB::b_stringp, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "symbolp", LB::b_symbolp, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "voidP", LB::b_voidP, 1, 1, true, 4, FBLTIN }, // D4 f
// Misc
- { "alert", Lingo::b_alert, 1, 1, false, 2, BLTIN }, // D2 c
- { "birth", Lingo::b_birth, -1,0, false, 4, FBLTIN }, // D4 f
- { "clearGlobals", Lingo::b_clearGlobals, 0, 0, false, 4, BLTIN }, // D4 c
- { "cursor", Lingo::b_cursor, 1, 1, false, 2, BLTIN }, // D2 c
- { "framesToHMS", Lingo::b_framesToHMS, 4, 4, false, 3, FBLTIN }, // D3 f
- { "HMStoFrames", Lingo::b_HMStoFrames, 4, 4, false, 3, FBLTIN }, // D3 f
- { "param", Lingo::b_param, 1, 1, true, 4, FBLTIN }, // D4 f
- { "printFrom", Lingo::b_printFrom, -1,0, false, 2, BLTIN }, // D2 c
+ { "alert", LB::b_alert, 1, 1, false, 2, BLTIN }, // D2 c
+ { "birth", LB::b_birth, -1,0, false, 4, FBLTIN }, // D4 f
+ { "clearGlobals", LB::b_clearGlobals, 0, 0, false, 4, BLTIN }, // D4 c
+ { "cursor", LB::b_cursor, 1, 1, false, 2, BLTIN }, // D2 c
+ { "framesToHMS", LB::b_framesToHMS, 4, 4, false, 3, FBLTIN }, // D3 f
+ { "HMStoFrames", LB::b_HMStoFrames, 4, 4, false, 3, FBLTIN }, // D3 f
+ { "param", LB::b_param, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "printFrom", LB::b_printFrom, -1,0, false, 2, BLTIN }, // D2 c
// put // D2
// set // D2
- { "showGlobals", Lingo::b_showGlobals, 0, 0, false, 2, BLTIN }, // D2 c
- { "showLocals", Lingo::b_showLocals, 0, 0, false, 2, BLTIN }, // D2 c
+ { "showGlobals", LB::b_showGlobals, 0, 0, false, 2, BLTIN }, // D2 c
+ { "showLocals", LB::b_showLocals, 0, 0, false, 2, BLTIN }, // D2 c
// Score
- { "constrainH", Lingo::b_constrainH, 2, 2, true, 2, FBLTIN }, // D2 f
- { "constrainV", Lingo::b_constrainV, 2, 2, true, 2, FBLTIN }, // D2 f
- { "copyToClipBoard",Lingo::b_copyToClipBoard,1,1, false, 4, BLTIN }, // D4 c
- { "duplicate", Lingo::b_duplicate, 1, 2, false, 4, BLTIN }, // D4 c
- { "editableText", Lingo::b_editableText, 0, 0, false, 2, BLTIN }, // D2
- { "erase", Lingo::b_erase, 1, 1, false, 4, BLTIN }, // D4 c
- { "findEmpty", Lingo::b_findEmpty, 1, 1, true, 4, FBLTIN }, // D4 f
+ { "constrainH", LB::b_constrainH, 2, 2, true, 2, FBLTIN }, // D2 f
+ { "constrainV", LB::b_constrainV, 2, 2, true, 2, FBLTIN }, // D2 f
+ { "copyToClipBoard",LB::b_copyToClipBoard,1,1, false, 4, BLTIN }, // D4 c
+ { "duplicate", LB::b_duplicate, 1, 2, false, 4, BLTIN }, // D4 c
+ { "editableText", LB::b_editableText, 0, 0, false, 2, BLTIN }, // D2
+ { "erase", LB::b_erase, 1, 1, false, 4, BLTIN }, // D4 c
+ { "findEmpty", LB::b_findEmpty, 1, 1, true, 4, FBLTIN }, // D4 f
// go // D2
- { "importFileInto", Lingo::b_importFileInto,2, 2, false, 4, BLTIN }, // D4 c
- { "installMenu", Lingo::b_installMenu, 1, 1, false, 2, BLTIN }, // D2 c
- { "label", Lingo::b_label, 1, 1, true, 2, FBLTIN }, // D2 f
- { "marker", Lingo::b_marker, 1, 1, true, 2, FBLTIN }, // D2 f
- { "move", Lingo::b_move, 1, 2, false, 4, BLTIN }, // D4 c
- { "moveableSprite", Lingo::b_moveableSprite,0, 0, false, 2, BLTIN }, // D2
- { "pasteClipBoardInto",Lingo::b_pasteClipBoardInto,1,1,false,4,BLTIN }, // D4 c
- { "puppetPalette", Lingo::b_puppetPalette, -1,0, false, 2, BLTIN }, // D2 c
- { "puppetSound", Lingo::b_puppetSound, -1,0, false, 2, BLTIN }, // D2 c
- { "puppetSprite", Lingo::b_puppetSprite, -1,0, false, 2, BLTIN }, // D2 c
- { "puppetTempo", Lingo::b_puppetTempo, 1, 1, false, 2, BLTIN }, // D2 c
- { "puppetTransition",Lingo::b_puppetTransition,-1,0,false,2, BLTIN }, // D2 c
- { "ramNeeded", Lingo::b_ramNeeded, 2, 2, true, 4, FBLTIN }, // D4 f
- { "rollOver", Lingo::b_rollOver, 1, 1, true, 2, FBLTIN }, // D2 f
- { "spriteBox", Lingo::b_spriteBox, -1,0, false, 2, BLTIN }, // D2 c
- { "unLoad", Lingo::b_unLoad, 0, 2, false, 4, BLTIN }, // D4 c
- { "unLoadCast", Lingo::b_unLoadCast, 0, 2, false, 4, BLTIN }, // D4 c
- { "updateStage", Lingo::b_updateStage, 0, 0, false, 2, BLTIN }, // D2 c
- { "zoomBox", Lingo::b_zoomBox, -1,0, false, 2, BLTIN }, // D2 c
+ { "importFileInto", LB::b_importFileInto,2, 2, false, 4, BLTIN }, // D4 c
+ { "installMenu", LB::b_installMenu, 1, 1, false, 2, BLTIN }, // D2 c
+ { "label", LB::b_label, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "marker", LB::b_marker, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "move", LB::b_move, 1, 2, false, 4, BLTIN }, // D4 c
+ { "moveableSprite", LB::b_moveableSprite,0, 0, false, 2, BLTIN }, // D2
+ { "pasteClipBoardInto",LB::b_pasteClipBoardInto,1,1,false,4,BLTIN }, // D4 c
+ { "puppetPalette", LB::b_puppetPalette, -1,0, false, 2, BLTIN }, // D2 c
+ { "puppetSound", LB::b_puppetSound, -1,0, false, 2, BLTIN }, // D2 c
+ { "puppetSprite", LB::b_puppetSprite, -1,0, false, 2, BLTIN }, // D2 c
+ { "puppetTempo", LB::b_puppetTempo, 1, 1, false, 2, BLTIN }, // D2 c
+ { "puppetTransition",LB::b_puppetTransition,-1,0,false,2, BLTIN }, // D2 c
+ { "ramNeeded", LB::b_ramNeeded, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "rollOver", LB::b_rollOver, 1, 1, true, 2, FBLTIN }, // D2 f
+ { "spriteBox", LB::b_spriteBox, -1,0, false, 2, BLTIN }, // D2 c
+ { "unLoad", LB::b_unLoad, 0, 2, false, 4, BLTIN }, // D4 c
+ { "unLoadCast", LB::b_unLoadCast, 0, 2, false, 4, BLTIN }, // D4 c
+ { "updateStage", LB::b_updateStage, 0, 0, false, 2, BLTIN }, // D2 c
+ { "zoomBox", LB::b_zoomBox, -1,0, false, 2, BLTIN }, // D2 c
// Point
- { "point", Lingo::b_point, 2, 2, true, 4, FBLTIN }, // D4 f
- { "inside", Lingo::b_inside, 2, 2, true, 4, FBLTIN }, // D4 f
- { "intersect", Lingo::b_intersect, 2, 2, false, 4, FBLTIN }, // D4 f
- { "map", Lingo::b_map, 3, 3, true, 4, FBLTIN }, // D4 f
- { "rect", Lingo::b_rect, 4, 4, true, 4, FBLTIN }, // D4 f
- { "union", Lingo::b_union, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "point", LB::b_point, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "inside", LB::b_inside, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "intersect", LB::b_intersect, 2, 2, false, 4, FBLTIN }, // D4 f
+ { "map", LB::b_map, 3, 3, true, 4, FBLTIN }, // D4 f
+ { "rect", LB::b_rect, 4, 4, true, 4, FBLTIN }, // D4 f
+ { "union", LB::b_union, 2, 2, true, 4, FBLTIN }, // D4 f
// Sound
- { "beep", Lingo::b_beep, 0, 1, false, 2, BLTIN }, // D2
- { "mci", Lingo::b_mci, 1, 1, false, 4, BLTIN }, // D4 c
- { "mciwait", Lingo::b_mciwait, 1, 1, false, 4, BLTIN }, // D4 c
- { "sound-close", Lingo::b_soundClose, 1, 1, false, 4, BLTIN }, // D4 c
- { "sound-fadeIn", Lingo::b_soundFadeIn, 1, 2, false, 3, BLTIN }, // D3 c
- { "sound-fadeOut", Lingo::b_soundFadeOut, 1, 2, false, 3, BLTIN }, // D3 c
- { "sound-playFile", Lingo::b_soundPlayFile, 2, 2, false, 3, BLTIN }, // D3 c
- { "sound-stop", Lingo::b_soundStop, 1, 1, false, 3, BLTIN }, // D3 c
- { "soundBusy", Lingo::b_soundBusy, 1, 1, true, 3, FBLTIN }, // D3 f
+ { "beep", LB::b_beep, 0, 1, false, 2, BLTIN }, // D2
+ { "mci", LB::b_mci, 1, 1, false, 4, BLTIN }, // D4 c
+ { "mciwait", LB::b_mciwait, 1, 1, false, 4, BLTIN }, // D4 c
+ { "sound-close", LB::b_soundClose, 1, 1, false, 4, BLTIN }, // D4 c
+ { "sound-fadeIn", LB::b_soundFadeIn, 1, 2, false, 3, BLTIN }, // D3 c
+ { "sound-fadeOut", LB::b_soundFadeOut, 1, 2, false, 3, BLTIN }, // D3 c
+ { "sound-playFile", LB::b_soundPlayFile, 2, 2, false, 3, BLTIN }, // D3 c
+ { "sound-stop", LB::b_soundStop, 1, 1, false, 3, BLTIN }, // D3 c
+ { "soundBusy", LB::b_soundBusy, 1, 1, true, 3, FBLTIN }, // D3 f
// Window
- { "close", Lingo::b_close, 1, 1, false, 4, BLTIN }, // D4 c
- { "forget", Lingo::b_forget, 1, 1, false, 4, BLTIN }, // D4 c
- { "inflate", Lingo::b_inflate, 3, 3, true, 4, FBLTIN }, // D4 f
- { "moveToBack", Lingo::b_moveToBack, 1, 1, false, 4, BLTIN }, // D4 c
- { "moveToFront", Lingo::b_moveToFront, 1, 1, false, 4, BLTIN }, // D4 c
+ { "close", LB::b_close, 1, 1, false, 4, BLTIN }, // D4 c
+ { "forget", LB::b_forget, 1, 1, false, 4, BLTIN }, // D4 c
+ { "inflate", LB::b_inflate, 3, 3, true, 4, FBLTIN }, // D4 f
+ { "moveToBack", LB::b_moveToBack, 1, 1, false, 4, BLTIN }, // D4 c
+ { "moveToFront", LB::b_moveToFront, 1, 1, false, 4, BLTIN }, // D4 c
// Constants
- { "ancestor", Lingo::b_ancestor, 0, 0, false, 4, BLTIN }, // D4
- { "backspace", Lingo::b_backspace, 0, 0, false, 2, FBLTIN }, // D2
- { "empty", Lingo::b_empty, 0, 0, false, 2, FBLTIN }, // D2
- { "enter", Lingo::b_enter, 0, 0, false, 2, FBLTIN }, // D2
- { "false", Lingo::b_false, 0, 0, false, 2, FBLTIN }, // D2
- { "quote", Lingo::b_quote, 0, 0, false, 2, FBLTIN }, // D2
- { "scummvm_return", Lingo::b_returnconst, 0, 0, false, 2, FBLTIN }, // D2
- { "tab", Lingo::b_tab, 0, 0, false, 2, FBLTIN }, // D2
- { "true", Lingo::b_true, 0, 0, false, 2, FBLTIN }, // D2
- { "version", Lingo::b_version, 0, 0, false, 3, FBLTIN }, // D3
+ { "ancestor", LB::b_ancestor, 0, 0, false, 4, BLTIN }, // D4
+ { "backspace", LB::b_backspace, 0, 0, false, 2, FBLTIN }, // D2
+ { "empty", LB::b_empty, 0, 0, false, 2, FBLTIN }, // D2
+ { "enter", LB::b_enter, 0, 0, false, 2, FBLTIN }, // D2
+ { "false", LB::b_false, 0, 0, false, 2, FBLTIN }, // D2
+ { "quote", LB::b_quote, 0, 0, false, 2, FBLTIN }, // D2
+ { "scummvm_return", LB::b_returnconst, 0, 0, false, 2, FBLTIN }, // D2
+ { "tab", LB::b_tab, 0, 0, false, 2, FBLTIN }, // D2
+ { "true", LB::b_true, 0, 0, false, 2, FBLTIN }, // D2
+ { "version", LB::b_version, 0, 0, false, 3, FBLTIN }, // D3
// References
- { "cast", Lingo::b_cast, 1, 1, false, 4, RBLTIN }, // D4 f
- { "field", Lingo::b_field, 1, 1, false, 3, RBLTIN }, // D3 f
- { "me", Lingo::b_me, -1,0, false, 3, BLTIN }, // D3
- { "script", Lingo::b_script, 1, 1, false, 4, RBLTIN }, // D4 f
- { "window", Lingo::b_window, 1, 1, false, 4, RBLTIN }, // D4 f
+ { "cast", LB::b_cast, 1, 1, false, 4, RBLTIN }, // D4 f
+ { "field", LB::b_field, 1, 1, false, 3, RBLTIN }, // D3 f
+ { "me", LB::b_me, -1,0, false, 3, BLTIN }, // D3
+ { "script", LB::b_script, 1, 1, false, 4, RBLTIN }, // D4 f
+ { "window", LB::b_window, 1, 1, false, 4, RBLTIN }, // D4 f
// Chunk operations
- { "numberOfChars", Lingo::b_numberofchars, 1, 1, false, 4, FBLTIN }, // D4 f
- { "numberOfItems", Lingo::b_numberofitems, 1, 1, false, 4, FBLTIN }, // D4 f
- { "numberOfLines", Lingo::b_numberoflines, 1, 1, false, 4, FBLTIN }, // D4 f
- { "numberOfWords", Lingo::b_numberofwords, 1, 1, false, 4, FBLTIN }, // D4 f
+ { "numberOfChars", LB::b_numberofchars, 1, 1, false, 4, FBLTIN }, // D4 f
+ { "numberOfItems", LB::b_numberofitems, 1, 1, false, 4, FBLTIN }, // D4 f
+ { "numberOfLines", LB::b_numberoflines, 1, 1, false, 4, FBLTIN }, // D4 f
+ { "numberOfWords", LB::b_numberofwords, 1, 1, false, 4, FBLTIN }, // D4 f
{ 0, 0, 0, 0, false, 0, 0 }
};
@@ -329,7 +330,7 @@ void Lingo::drop(uint num) {
///////////////////
// Math
///////////////////
-void Lingo::b_abs(int nargs) {
+void LB::b_abs(int nargs) {
Datum d = g_lingo->pop();
if (d.type == INT)
@@ -340,21 +341,21 @@ void Lingo::b_abs(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_atan(int nargs) {
+void LB::b_atan(int nargs) {
Datum d = g_lingo->pop();
d.toFloat();
d.u.f = atan(d.u.f);
g_lingo->push(d);
}
-void Lingo::b_cos(int nargs) {
+void LB::b_cos(int nargs) {
Datum d = g_lingo->pop();
d.toFloat();
d.u.f = cos(d.u.f);
g_lingo->push(d);
}
-void Lingo::b_exp(int nargs) {
+void LB::b_exp(int nargs) {
Datum d = g_lingo->pop();
d.toInt(); // Lingo uses int, so we're enforcing it
d.toFloat();
@@ -362,33 +363,33 @@ void Lingo::b_exp(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_float(int nargs) {
+void LB::b_float(int nargs) {
Datum d = g_lingo->pop();
d.toFloat();
g_lingo->push(d);
}
-void Lingo::b_integer(int nargs) {
+void LB::b_integer(int nargs) {
Datum d = g_lingo->pop();
d.toInt();
g_lingo->push(d);
}
-void Lingo::b_log(int nargs) {
+void LB::b_log(int nargs) {
Datum d = g_lingo->pop();
d.toFloat();
d.u.f = log(d.u.f);
g_lingo->push(d);
}
-void Lingo::b_pi(int nargs) {
+void LB::b_pi(int nargs) {
Datum d;
d.toFloat();
d.u.f = M_PI;
g_lingo->push(d);
}
-void Lingo::b_power(int nargs) {
+void LB::b_power(int nargs) {
Datum d1 = g_lingo->pop();
Datum d2 = g_lingo->pop();
d1.toFloat();
@@ -397,7 +398,7 @@ void Lingo::b_power(int nargs) {
g_lingo->push(d1);
}
-void Lingo::b_random(int nargs) {
+void LB::b_random(int nargs) {
Datum max = g_lingo->pop();
Datum res;
@@ -409,21 +410,21 @@ void Lingo::b_random(int nargs) {
g_lingo->push(res);
}
-void Lingo::b_sin(int nargs) {
+void LB::b_sin(int nargs) {
Datum d = g_lingo->pop();
d.toFloat();
d.u.f = sin(d.u.f);
g_lingo->push(d);
}
-void Lingo::b_sqrt(int nargs) {
+void LB::b_sqrt(int nargs) {
Datum d = g_lingo->pop();
d.toFloat();
d.u.f = sqrt(d.u.f);
g_lingo->push(d);
}
-void Lingo::b_tan(int nargs) {
+void LB::b_tan(int nargs) {
Datum d = g_lingo->pop();
d.toFloat();
d.u.f = tan(d.u.f);
@@ -433,7 +434,7 @@ void Lingo::b_tan(int nargs) {
///////////////////
// String
///////////////////
-void Lingo::b_chars(int nargs) {
+void LB::b_chars(int nargs) {
Datum to = g_lingo->pop();
Datum from = g_lingo->pop();
Datum s = g_lingo->pop();
@@ -457,7 +458,7 @@ void Lingo::b_chars(int nargs) {
g_lingo->push(s);
}
-void Lingo::b_charToNum(int nargs) {
+void LB::b_charToNum(int nargs) {
Datum d = g_lingo->pop();
if (d.type != STRING)
@@ -471,7 +472,7 @@ void Lingo::b_charToNum(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_delete(int nargs) {
+void LB::b_delete(int nargs) {
Datum d = g_lingo->pop();
d.toInt();
@@ -481,7 +482,7 @@ void Lingo::b_delete(int nargs) {
g_lingo->push(Datum((char)d.u.i));
}
-void Lingo::b_hilite(int nargs) {
+void LB::b_hilite(int nargs) {
Datum d = g_lingo->pop();
d.toInt();
@@ -491,7 +492,7 @@ void Lingo::b_hilite(int nargs) {
g_lingo->push(Datum((char)d.u.i));
}
-void Lingo::b_length(int nargs) {
+void LB::b_length(int nargs) {
Datum d = g_lingo->pop();
if (d.type != STRING)
@@ -505,7 +506,7 @@ void Lingo::b_length(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_numToChar(int nargs) {
+void LB::b_numToChar(int nargs) {
Datum d = g_lingo->pop();
d.toInt();
@@ -513,7 +514,7 @@ void Lingo::b_numToChar(int nargs) {
g_lingo->push(Datum((char)d.u.i));
}
-void Lingo::b_offset(int nargs) {
+void LB::b_offset(int nargs) {
if (nargs == 3) {
b_offsetRect(nargs);
return;
@@ -529,13 +530,13 @@ void Lingo::b_offset(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_string(int nargs) {
+void LB::b_string(int nargs) {
Datum d = g_lingo->pop();
d.toString();
g_lingo->push(d);
}
-void Lingo::b_value(int nargs) {
+void LB::b_value(int nargs) {
Datum d = g_lingo->pop();
d.toInt();
warning("STUB: b_value()");
@@ -545,122 +546,122 @@ void Lingo::b_value(int nargs) {
///////////////////
// Lists
///////////////////
-void Lingo::b_add(int nargs) {
+void LB::b_add(int nargs) {
g_lingo->printSTUBWithArglist("b_add", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_addAt(int nargs) {
+void LB::b_addAt(int nargs) {
g_lingo->printSTUBWithArglist("b_addAt", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_addProp(int nargs) {
+void LB::b_addProp(int nargs) {
g_lingo->printSTUBWithArglist("b_addProp", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_append(int nargs) {
+void LB::b_append(int nargs) {
g_lingo->printSTUBWithArglist("b_append", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_count(int nargs) {
+void LB::b_count(int nargs) {
g_lingo->printSTUBWithArglist("b_count", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_deleteAt(int nargs) {
+void LB::b_deleteAt(int nargs) {
g_lingo->printSTUBWithArglist("b_deleteAt", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_deleteProp(int nargs) {
+void LB::b_deleteProp(int nargs) {
g_lingo->printSTUBWithArglist("b_deleteProp", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_findPos(int nargs) {
+void LB::b_findPos(int nargs) {
g_lingo->printSTUBWithArglist("b_findPos", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_findPosNear(int nargs) {
+void LB::b_findPosNear(int nargs) {
g_lingo->printSTUBWithArglist("b_findPosNear", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_getaProp(int nargs) {
+void LB::b_getaProp(int nargs) {
g_lingo->printSTUBWithArglist("b_getaProp", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_getAt(int nargs) {
+void LB::b_getAt(int nargs) {
g_lingo->printSTUBWithArglist("b_getAt", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_getLast(int nargs) {
+void LB::b_getLast(int nargs) {
g_lingo->printSTUBWithArglist("b_getLast", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_getOne(int nargs) {
+void LB::b_getOne(int nargs) {
g_lingo->printSTUBWithArglist("b_getOne", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_getPos(int nargs) {
+void LB::b_getPos(int nargs) {
g_lingo->printSTUBWithArglist("b_getPos", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_getProp(int nargs) {
+void LB::b_getProp(int nargs) {
g_lingo->printSTUBWithArglist("b_getProp", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_getPropAt(int nargs) {
+void LB::b_getPropAt(int nargs) {
g_lingo->printSTUBWithArglist("b_getPropAt", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_list(int nargs) {
+void LB::b_list(int nargs) {
g_lingo->printSTUBWithArglist("b_list", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_listP(int nargs) {
+void LB::b_listP(int nargs) {
g_lingo->printSTUBWithArglist("b_listP", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_max(int nargs) {
+void LB::b_max(int nargs) {
g_lingo->printSTUBWithArglist("b_max", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_min(int nargs) {
+void LB::b_min(int nargs) {
g_lingo->printSTUBWithArglist("b_min", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_setaProp(int nargs) {
+void LB::b_setaProp(int nargs) {
g_lingo->printSTUBWithArglist("b_setaProp", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_setAt(int nargs) {
+void LB::b_setAt(int nargs) {
g_lingo->printSTUBWithArglist("b_setAt", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_setProp(int nargs) {
+void LB::b_setProp(int nargs) {
g_lingo->printSTUBWithArglist("b_setProp", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_sort(int nargs) {
+void LB::b_sort(int nargs) {
g_lingo->printSTUBWithArglist("b_sort", nargs);
g_lingo->dropStack(nargs);
}
@@ -669,11 +670,11 @@ void Lingo::b_sort(int nargs) {
///////////////////
// Files
///////////////////
-void Lingo::b_closeDA(int nargs) {
+void LB::b_closeDA(int nargs) {
warning("STUB: b_closeDA");
}
-void Lingo::b_closeResFile(int nargs) {
+void LB::b_closeResFile(int nargs) {
Datum d = g_lingo->pop();
d.toString();
@@ -683,7 +684,7 @@ void Lingo::b_closeResFile(int nargs) {
delete d.u.s;
}
-void Lingo::b_closeXlib(int nargs) {
+void LB::b_closeXlib(int nargs) {
Datum d = g_lingo->pop();
d.toString();
@@ -693,7 +694,7 @@ void Lingo::b_closeXlib(int nargs) {
delete d.u.s;
}
-void Lingo::b_getNthFileNameInFolder(int nargs) {
+void LB::b_getNthFileNameInFolder(int nargs) {
g_lingo->printSTUBWithArglist("b_getNthFileNameInFolder", nargs);
g_lingo->dropStack(nargs);
@@ -701,7 +702,7 @@ void Lingo::b_getNthFileNameInFolder(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_openDA(int nargs) {
+void LB::b_openDA(int nargs) {
Datum d = g_lingo->pop();
d.toString();
@@ -711,7 +712,7 @@ void Lingo::b_openDA(int nargs) {
delete d.u.s;
}
-void Lingo::b_openResFile(int nargs) {
+void LB::b_openResFile(int nargs) {
Datum d = g_lingo->pop();
d.toString();
@@ -721,7 +722,7 @@ void Lingo::b_openResFile(int nargs) {
delete d.u.s;
}
-void Lingo::b_openXlib(int nargs) {
+void LB::b_openXlib(int nargs) {
Datum d = g_lingo->pop();
d.toString();
@@ -731,17 +732,17 @@ void Lingo::b_openXlib(int nargs) {
delete d.u.s;
}
-void Lingo::b_saveMovie(int nargs) {
+void LB::b_saveMovie(int nargs) {
g_lingo->printSTUBWithArglist("b_saveMovie", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_setCallBack(int nargs) {
+void LB::b_setCallBack(int nargs) {
warning("STUB: b_setCallBack");
}
-void Lingo::b_showResFile(int nargs) {
+void LB::b_showResFile(int nargs) {
Datum d = g_lingo->pop();
d.toString();
@@ -751,7 +752,7 @@ void Lingo::b_showResFile(int nargs) {
delete d.u.s;
}
-void Lingo::b_showXlib(int nargs) {
+void LB::b_showXlib(int nargs) {
Datum d = g_lingo->pop();
d.toString();
@@ -761,7 +762,7 @@ void Lingo::b_showXlib(int nargs) {
delete d.u.s;
}
-void Lingo::b_xFactoryList(int nargs) {
+void LB::b_xFactoryList(int nargs) {
Datum d = g_lingo->pop();
d.toString();
@@ -774,37 +775,37 @@ void Lingo::b_xFactoryList(int nargs) {
///////////////////
// Control
///////////////////
-void Lingo::b_abort(int nargs) {
+void LB::b_abort(int nargs) {
warning("STUB: b_abort");
}
-void Lingo::b_continue(int nargs) {
+void LB::b_continue(int nargs) {
g_director->_playbackPaused = false;
}
-void Lingo::b_dontPassEvent(int nargs) {
+void LB::b_dontPassEvent(int nargs) {
g_lingo->_dontPassEvent = true;
warning("dontPassEvent raised");
}
-void Lingo::b_nothing(int nargs) {
+void LB::b_nothing(int nargs) {
// Noop
}
-void Lingo::b_delay(int nargs) {
+void LB::b_delay(int nargs) {
Datum d = g_lingo->pop();
d.toInt();
g_director->getCurrentScore()->_nextFrameTime = g_system->getMillis() + (float)d.u.i / 60 * 1000;
}
-void Lingo::b_do(int nargs) {
+void LB::b_do(int nargs) {
Datum d = g_lingo->pop();
d.toString();
warning("STUB: b_do(%s)", d.u.s->c_str());
}
-void Lingo::b_go(int nargs) {
+void LB::b_go(int nargs) {
// Builtin function for go as used by the Director bytecode engine.
//
// Accepted arguments:
@@ -865,41 +866,41 @@ void Lingo::b_go(int nargs) {
}
}
-void Lingo::b_halt(int nargs) {
+void LB::b_halt(int nargs) {
b_quit(nargs);
warning("Movie halted");
}
-void Lingo::b_pass(int nargs) {
+void LB::b_pass(int nargs) {
g_lingo->printSTUBWithArglist("b_pass", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_pause(int nargs) {
+void LB::b_pause(int nargs) {
g_director->_playbackPaused = true;
}
-void Lingo::b_playAccel(int nargs) {
+void LB::b_playAccel(int nargs) {
g_lingo->printSTUBWithArglist("b_playAccel", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_preLoad(int nargs) {
+void LB::b_preLoad(int nargs) {
g_lingo->printSTUBWithArglist("b_preLoad", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_preLoadCast(int nargs) {
+void LB::b_preLoadCast(int nargs) {
g_lingo->printSTUBWithArglist("b_preLoadCast", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_framesToHMS(int nargs) {
+void LB::b_framesToHMS(int nargs) {
g_lingo->printSTUBWithArglist("b_framesToHMS", nargs);
g_lingo->dropStack(nargs);
@@ -907,7 +908,7 @@ void Lingo::b_framesToHMS(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_HMStoFrames(int nargs) {
+void LB::b_HMStoFrames(int nargs) {
g_lingo->printSTUBWithArglist("b_HMStoFrames", nargs);
g_lingo->dropStack(nargs);
@@ -915,50 +916,50 @@ void Lingo::b_HMStoFrames(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_param(int nargs) {
+void LB::b_param(int nargs) {
g_lingo->printSTUBWithArglist("b_param", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_printFrom(int nargs) {
+void LB::b_printFrom(int nargs) {
g_lingo->printSTUBWithArglist("b_printFrom", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_quit(int nargs) {
+void LB::b_quit(int nargs) {
if (g_director->getCurrentScore())
g_director->getCurrentScore()->_stopPlay = true;
g_lingo->pushVoid();
}
-void Lingo::b_return(int nargs) {
+void LB::b_return(int nargs) {
// We do not touch the top of the stack, it will be returned
LC::c_procret();
}
-void Lingo::b_restart(int nargs) {
+void LB::b_restart(int nargs) {
b_quit(nargs);
warning("Computer restarts");
}
-void Lingo::b_shutDown(int nargs) {
+void LB::b_shutDown(int nargs) {
b_quit(nargs);
warning("Computer shuts down");
}
-void Lingo::b_startTimer(int nargs) {
+void LB::b_startTimer(int nargs) {
warning("STUB: b_startTimer");
}
///////////////////
// Types
///////////////////
-void Lingo::b_factoryP(int nargs) {
+void LB::b_factoryP(int nargs) {
Datum d = g_lingo->pop();
d.toInt();
d.u.i = 1;
@@ -967,7 +968,7 @@ void Lingo::b_factoryP(int nargs) {
warning("STUB: b_factoryP");
}
-void Lingo::b_floatP(int nargs) {
+void LB::b_floatP(int nargs) {
Datum d = g_lingo->pop();
int res = (d.type == FLOAT) ? 1 : 0;
d.toInt();
@@ -975,14 +976,14 @@ void Lingo::b_floatP(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_ilk(int nargs) {
+void LB::b_ilk(int nargs) {
Datum d = g_lingo->pop();
d.u.i = d.type;
d.type = SYMBOL;
g_lingo->push(d);
}
-void Lingo::b_integerp(int nargs) {
+void LB::b_integerp(int nargs) {
Datum d = g_lingo->pop();
int res = (d.type == INT) ? 1 : 0;
d.toInt();
@@ -990,7 +991,7 @@ void Lingo::b_integerp(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_objectp(int nargs) {
+void LB::b_objectp(int nargs) {
Datum d = g_lingo->pop();
int res = (d.type == OBJECT) ? 1 : 0;
d.toInt();
@@ -998,13 +999,13 @@ void Lingo::b_objectp(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_pictureP(int nargs) {
+void LB::b_pictureP(int nargs) {
g_lingo->pop();
warning("STUB: b_pictureP");
g_lingo->push(Datum(0));
}
-void Lingo::b_stringp(int nargs) {
+void LB::b_stringp(int nargs) {
Datum d = g_lingo->pop();
int res = (d.type == STRING) ? 1 : 0;
d.toInt();
@@ -1012,7 +1013,7 @@ void Lingo::b_stringp(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_symbolp(int nargs) {
+void LB::b_symbolp(int nargs) {
Datum d = g_lingo->pop();
int res = (d.type == SYMBOL) ? 1 : 0;
d.toInt();
@@ -1020,7 +1021,7 @@ void Lingo::b_symbolp(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_voidP(int nargs) {
+void LB::b_voidP(int nargs) {
Datum d = g_lingo->pop();
int res = (d.type == VOID) ? 1 : 0;
d.toInt();
@@ -1032,7 +1033,7 @@ void Lingo::b_voidP(int nargs) {
///////////////////
// Misc
///////////////////
-void Lingo::b_alert(int nargs) {
+void LB::b_alert(int nargs) {
Datum d = g_lingo->pop();
d.toString();
@@ -1042,7 +1043,7 @@ void Lingo::b_alert(int nargs) {
delete d.u.s;
}
-void Lingo::b_birth(int nargs) {
+void LB::b_birth(int nargs) {
g_lingo->printSTUBWithArglist("b_birth", nargs);
g_lingo->dropStack(nargs);
@@ -1050,30 +1051,30 @@ void Lingo::b_birth(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_clearGlobals(int nargs) {
+void LB::b_clearGlobals(int nargs) {
g_lingo->printSTUBWithArglist("b_clearGlobals", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_cursor(int nargs) {
+void LB::b_cursor(int nargs) {
Datum d = g_lingo->pop();
d.toInt();
g_lingo->func_cursor(d.u.i);
}
-void Lingo::b_showGlobals(int nargs) {
+void LB::b_showGlobals(int nargs) {
warning("STUB: b_showGlobals");
}
-void Lingo::b_showLocals(int nargs) {
+void LB::b_showLocals(int nargs) {
warning("STUB: b_showLocals");
}
///////////////////
// Score
///////////////////
-void Lingo::b_constrainH(int nargs) {
+void LB::b_constrainH(int nargs) {
Datum num = g_lingo->pop();
Datum sprite = g_lingo->pop();
@@ -1085,7 +1086,7 @@ void Lingo::b_constrainH(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_constrainV(int nargs) {
+void LB::b_constrainV(int nargs) {
Datum num = g_lingo->pop();
Datum sprite = g_lingo->pop();
@@ -1097,29 +1098,29 @@ void Lingo::b_constrainV(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_copyToClipBoard(int nargs) {
+void LB::b_copyToClipBoard(int nargs) {
g_lingo->printSTUBWithArglist("b_copyToClipBoard", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_duplicate(int nargs) {
+void LB::b_duplicate(int nargs) {
g_lingo->printSTUBWithArglist("b_duplicate", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_editableText(int nargs) {
+void LB::b_editableText(int nargs) {
warning("STUB: b_editableText");
}
-void Lingo::b_erase(int nargs) {
+void LB::b_erase(int nargs) {
g_lingo->printSTUBWithArglist("b_erase", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_findEmpty(int nargs) {
+void LB::b_findEmpty(int nargs) {
g_lingo->printSTUBWithArglist("b_findEmpty", nargs);
g_lingo->dropStack(nargs);
@@ -1127,7 +1128,7 @@ void Lingo::b_findEmpty(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_importFileInto(int nargs) {
+void LB::b_importFileInto(int nargs) {
g_lingo->printSTUBWithArglist("b_importFileInto", nargs);
g_lingo->dropStack(nargs);
@@ -1139,7 +1140,7 @@ void menuCommandsCallback(int action, Common::String &text, void *data) {
LC::call(name, 0);
}
-void Lingo::b_installMenu(int nargs) {
+void LB::b_installMenu(int nargs) {
// installMenu castNum
Datum d = g_lingo->pop();
@@ -1274,7 +1275,7 @@ Common::String Lingo::genMenuHandler(int *commandId, Common::String &command) {
return Common::String::format("on %s\n %s\nend %s\n\n", name.c_str(), command.c_str(), name.c_str());
}
-void Lingo::b_label(int nargs) {
+void LB::b_label(int nargs) {
Datum d = g_lingo->pop();
d.toInt();
warning("STUB: b_label(%d)", d.u.i);
@@ -1282,20 +1283,20 @@ void Lingo::b_label(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_marker(int nargs) {
+void LB::b_marker(int nargs) {
Datum d = g_lingo->pop();
d.toInt();
int marker = g_lingo->func_marker(d.u.i);
g_lingo->push(marker);
}
-void Lingo::b_move(int nargs) {
+void LB::b_move(int nargs) {
g_lingo->printSTUBWithArglist("b_move", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_moveableSprite(int nargs) {
+void LB::b_moveableSprite(int nargs) {
Frame *frame = g_director->getCurrentScore()->_frames[g_director->getCurrentScore()->getCurrentFrame()];
// Will have no effect
@@ -1304,13 +1305,13 @@ void Lingo::b_moveableSprite(int nargs) {
g_director->setDraggedSprite(frame->_sprites[g_lingo->_currentEntityId]->_castId);
}
-void Lingo::b_pasteClipBoardInto(int nargs) {
+void LB::b_pasteClipBoardInto(int nargs) {
g_lingo->printSTUBWithArglist("b_pasteClipBoardInto", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_puppetPalette(int nargs) {
+void LB::b_puppetPalette(int nargs) {
g_lingo->convertVOIDtoString(0, nargs);
g_lingo->printSTUBWithArglist("b_puppetPalette", nargs);
@@ -1318,7 +1319,7 @@ void Lingo::b_puppetPalette(int nargs) {
g_lingo->dropStack(nargs);
}
-void Lingo::b_puppetSound(int nargs) {
+void LB::b_puppetSound(int nargs) {
g_lingo->convertVOIDtoString(0, nargs);
g_lingo->printSTUBWithArglist("b_puppetSound", nargs);
@@ -1326,31 +1327,31 @@ void Lingo::b_puppetSound(int nargs) {
g_lingo->dropStack(nargs);
}
-void Lingo::b_puppetSprite(int nargs) {
+void LB::b_puppetSprite(int nargs) {
g_lingo->printSTUBWithArglist("b_puppetSprite", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_puppetTempo(int nargs) {
+void LB::b_puppetTempo(int nargs) {
Datum d = g_lingo->pop();
warning("STUB: b_puppetTempo(%d)", d.u.i);
}
-void Lingo::b_puppetTransition(int nargs) {
+void LB::b_puppetTransition(int nargs) {
g_lingo->printSTUBWithArglist("b_puppetTransition", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_ramNeeded(int nargs) {
+void LB::b_ramNeeded(int nargs) {
Datum d = g_lingo->pop();
warning("STUB: b_ramNeeded(%d)", d.u.i);
g_lingo->push(Datum(0));
}
-void Lingo::b_rollOver(int nargs) {
+void LB::b_rollOver(int nargs) {
Datum d = g_lingo->pop();
d.toInt();
@@ -1374,25 +1375,25 @@ void Lingo::b_rollOver(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_spriteBox(int nargs) {
+void LB::b_spriteBox(int nargs) {
g_lingo->printSTUBWithArglist("b_spriteBox", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_unLoad(int nargs) {
+void LB::b_unLoad(int nargs) {
g_lingo->printSTUBWithArglist("b_unLoad", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_unLoadCast(int nargs) {
+void LB::b_unLoadCast(int nargs) {
g_lingo->printSTUBWithArglist("b_unLoadCast", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_zoomBox(int nargs) {
+void LB::b_zoomBox(int nargs) {
// zoomBox startSprite, endSprite [, delatTicks]
// ticks are in 1/60th, default 1
if (nargs < 2 || nargs > 3) {
@@ -1451,7 +1452,7 @@ void Lingo::b_zoomBox(int nargs) {
score->addZoomBox(box);
}
-void Lingo::b_updateStage(int nargs) {
+void LB::b_updateStage(int nargs) {
warning("STUB: b_updateStage");
}
@@ -1460,27 +1461,27 @@ void Lingo::b_updateStage(int nargs) {
// Window
///////////////////
-void Lingo::b_close(int nargs) {
+void LB::b_close(int nargs) {
g_lingo->printSTUBWithArglist("b_close", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_forget(int nargs) {
+void LB::b_forget(int nargs) {
g_lingo->printSTUBWithArglist("b_forget", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_inflate(int nargs) {
+void LB::b_inflate(int nargs) {
g_lingo->printSTUBWithArglist("b_inflate", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_moveToBack(int nargs) {
+void LB::b_moveToBack(int nargs) {
g_lingo->printSTUBWithArglist("b_moveToBack", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_moveToFront(int nargs) {
+void LB::b_moveToFront(int nargs) {
g_lingo->printSTUBWithArglist("b_moveToFront", nargs);
g_lingo->dropStack(nargs);
}
@@ -1489,7 +1490,7 @@ void Lingo::b_moveToFront(int nargs) {
///////////////////
// Point
///////////////////
-void Lingo::b_point(int nargs) {
+void LB::b_point(int nargs) {
Datum y = g_lingo->pop();
Datum x = g_lingo->pop();
Datum d;
@@ -1506,7 +1507,7 @@ void Lingo::b_point(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_rect(int nargs) {
+void LB::b_rect(int nargs) {
g_lingo->printSTUBWithArglist("b_rect", nargs);
g_lingo->dropStack(nargs);
@@ -1515,7 +1516,7 @@ void Lingo::b_rect(int nargs) {
}
-void Lingo::b_intersect(int nargs) {
+void LB::b_intersect(int nargs) {
g_lingo->printSTUBWithArglist("b_intersect", nargs);
g_lingo->dropStack(nargs);
@@ -1523,7 +1524,7 @@ void Lingo::b_intersect(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_inside(int nargs) {
+void LB::b_inside(int nargs) {
g_lingo->printSTUBWithArglist("b_inside", nargs);
g_lingo->dropStack(nargs);
@@ -1531,7 +1532,7 @@ void Lingo::b_inside(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_map(int nargs) {
+void LB::b_map(int nargs) {
g_lingo->printSTUBWithArglist("b_map", nargs);
g_lingo->dropStack(nargs);
@@ -1539,7 +1540,7 @@ void Lingo::b_map(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_offsetRect(int nargs) {
+void LB::b_offsetRect(int nargs) {
g_lingo->printSTUBWithArglist("b_offsetRect", nargs);
g_lingo->dropStack(nargs);
@@ -1547,7 +1548,7 @@ void Lingo::b_offsetRect(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_union(int nargs) {
+void LB::b_union(int nargs) {
g_lingo->printSTUBWithArglist("b_union", nargs);
g_lingo->dropStack(nargs);
@@ -1559,7 +1560,7 @@ void Lingo::b_union(int nargs) {
///////////////////
// Sound
///////////////////
-void Lingo::b_beep(int nargs) {
+void LB::b_beep(int nargs) {
int repeat = 1;
if (nargs == 1) {
Datum d = g_lingo->pop();
@@ -1568,7 +1569,7 @@ void Lingo::b_beep(int nargs) {
g_lingo->func_beep(repeat);
}
-void Lingo::b_mci(int nargs) {
+void LB::b_mci(int nargs) {
Datum d = g_lingo->pop();
d.toString();
@@ -1576,7 +1577,7 @@ void Lingo::b_mci(int nargs) {
g_lingo->func_mci(*d.u.s);
}
-void Lingo::b_mciwait(int nargs) {
+void LB::b_mciwait(int nargs) {
Datum d = g_lingo->pop();
d.toString();
@@ -1584,37 +1585,37 @@ void Lingo::b_mciwait(int nargs) {
g_lingo->func_mciwait(*d.u.s);
}
-void Lingo::b_soundBusy(int nargs) {
+void LB::b_soundBusy(int nargs) {
g_lingo->printSTUBWithArglist("b_soundBusy", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_soundClose(int nargs) {
+void LB::b_soundClose(int nargs) {
g_lingo->printSTUBWithArglist("b_soundClose", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_soundFadeIn(int nargs) {
+void LB::b_soundFadeIn(int nargs) {
g_lingo->printSTUBWithArglist("b_soundFadeIn", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_soundFadeOut(int nargs) {
+void LB::b_soundFadeOut(int nargs) {
g_lingo->printSTUBWithArglist("b_soundFadeOut", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_soundPlayFile(int nargs) {
+void LB::b_soundPlayFile(int nargs) {
g_lingo->printSTUBWithArglist("b_soundPlayFile", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_soundStop(int nargs) {
+void LB::b_soundStop(int nargs) {
g_lingo->printSTUBWithArglist("b_soundStop", nargs);
g_lingo->dropStack(nargs);
@@ -1623,51 +1624,51 @@ void Lingo::b_soundStop(int nargs) {
///////////////////
// Constants
///////////////////
-void Lingo::b_ancestor(int nargs) {
+void LB::b_ancestor(int nargs) {
warning("STUB: b_ancestor");
g_lingo->push(Datum(0));
}
-void Lingo::b_backspace(int nargs) {
+void LB::b_backspace(int nargs) {
g_lingo->push(Datum(new Common::String("\b")));
}
-void Lingo::b_empty(int nargs) {
+void LB::b_empty(int nargs) {
g_lingo->push(Datum(new Common::String("")));
}
-void Lingo::b_enter(int nargs) {
+void LB::b_enter(int nargs) {
g_lingo->push(Datum(new Common::String("\n")));
}
-void Lingo::b_false(int nargs) {
+void LB::b_false(int nargs) {
g_lingo->push(Datum(0));
}
-void Lingo::b_quote(int nargs) {
+void LB::b_quote(int nargs) {
g_lingo->push(Datum(new Common::String("\"")));
}
-void Lingo::b_returnconst(int nargs) {
+void LB::b_returnconst(int nargs) {
g_lingo->push(Datum(new Common::String("\n")));
}
-void Lingo::b_tab(int nargs) {
+void LB::b_tab(int nargs) {
g_lingo->push(Datum(new Common::String("\t")));
}
-void Lingo::b_true(int nargs) {
+void LB::b_true(int nargs) {
g_lingo->push(Datum(1));
}
-void Lingo::b_version(int nargs) {
+void LB::b_version(int nargs) {
g_lingo->push(Datum(g_director->getVersion()));
}
///////////////////
// Factory
///////////////////
-void Lingo::b_factory(int nargs) {
+void LB::b_factory(int nargs) {
// This is intentionally empty
}
@@ -1703,7 +1704,7 @@ void Lingo::factoryCall(Common::String &name, int nargs) {
///////////////////
// References
///////////////////
-void Lingo::b_cast(int nargs) {
+void LB::b_cast(int nargs) {
Datum d = g_lingo->pop();
warning("STUB: b_cast");
@@ -1713,7 +1714,7 @@ void Lingo::b_cast(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_field(int nargs) {
+void LB::b_field(int nargs) {
Datum d = g_lingo->pop();
int id;
@@ -1737,13 +1738,13 @@ void Lingo::b_field(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_me(int nargs) {
+void LB::b_me(int nargs) {
g_lingo->printSTUBWithArglist("me", nargs);
g_lingo->dropStack(nargs);
}
-void Lingo::b_script(int nargs) {
+void LB::b_script(int nargs) {
Datum d = g_lingo->pop();
warning("STUB: b_script");
@@ -1753,7 +1754,7 @@ void Lingo::b_script(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_window(int nargs) {
+void LB::b_window(int nargs) {
Datum d = g_lingo->pop();
warning("STUB: b_window");
@@ -1763,7 +1764,7 @@ void Lingo::b_window(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_numberofchars(int nargs) {
+void LB::b_numberofchars(int nargs) {
Datum d = g_lingo->pop();
warning("STUB: b_numberofchars");
@@ -1773,7 +1774,7 @@ void Lingo::b_numberofchars(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_numberofitems(int nargs) {
+void LB::b_numberofitems(int nargs) {
Datum d = g_lingo->pop();
warning("STUB: b_numberofitems");
@@ -1783,7 +1784,7 @@ void Lingo::b_numberofitems(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_numberoflines(int nargs) {
+void LB::b_numberoflines(int nargs) {
Datum d = g_lingo->pop();
warning("STUB: b_numberoflines");
@@ -1793,7 +1794,7 @@ void Lingo::b_numberoflines(int nargs) {
g_lingo->push(d);
}
-void Lingo::b_numberofwords(int nargs) {
+void LB::b_numberofwords(int nargs) {
Datum d = g_lingo->pop();
warning("STUB: b_numberofwords");
diff --git a/engines/director/lingo/lingo-builtins.h b/engines/director/lingo/lingo-builtins.h
new file mode 100644
index 0000000000..9cc6e19c3c
--- /dev/null
+++ b/engines/director/lingo/lingo-builtins.h
@@ -0,0 +1,211 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef DIRECTOR_LINGO_BUILTINS_H
+#define DIRECTOR_LINGO_BUILTINS_H
+
+namespace Director {
+
+namespace LB {
+ // builtin functions
+ void b_abs(int nargs);
+ void b_atan(int nargs);
+ void b_cos(int nargs);
+ void b_exp(int nargs);
+ void b_float(int nargs);
+ void b_integer(int nargs);
+ void b_log(int nargs);
+ void b_pi(int nargs);
+ void b_power(int nargs);
+ void b_random(int nargs);
+ void b_sin(int nargs);
+ void b_sqrt(int nargs);
+ void b_tan(int nargs);
+
+ void b_chars(int nargs);
+ void b_charToNum(int nargs);
+ void b_delete(int nargs);
+ void b_hilite(int nargs);
+ void b_length(int nargs);
+ void b_numToChar(int nargs);
+ void b_offset(int nargs);
+ void b_string(int nargs);
+
+ void b_add(int nargs);
+ void b_addAt(int nargs);
+ void b_addProp(int nargs);
+ void b_append(int nargs);
+ void b_count(int nargs);
+ void b_deleteAt(int nargs);
+ void b_deleteProp(int nargs);
+ void b_findPos(int nargs);
+ void b_findPosNear(int nargs);
+ void b_getaProp(int nargs);
+ void b_getAt(int nargs);
+ void b_getLast(int nargs);
+ void b_getOne(int nargs);
+ void b_getPos(int nargs);
+ void b_getProp(int nargs);
+ void b_getPropAt(int nargs);
+ void b_list(int nargs);
+ void b_listP(int nargs);
+ void b_max(int nargs);
+ void b_min(int nargs);
+ void b_setaProp(int nargs);
+ void b_setAt(int nargs);
+ void b_setProp(int nargs);
+ void b_sort(int nargs);
+
+ void b_factoryP(int nargs);
+ void b_floatP(int nargs);
+ void b_ilk(int nargs);
+ void b_integerp(int nargs);
+ void b_objectp(int nargs);
+ void b_pictureP(int nargs);
+ void b_stringp(int nargs);
+ void b_symbolp(int nargs);
+ void b_voidP(int nargs);
+
+ void b_alert(int nargs);
+ void b_birth(int nargs);
+ void b_clearGlobals(int nargs);
+ void b_cursor(int nargs);
+ void b_framesToHMS(int nargs);
+ void b_HMStoFrames(int nargs);
+ void b_param(int nargs);
+ void b_printFrom(int nargs);
+ void b_showGlobals(int nargs);
+ void b_showLocals(int nargs);
+ void b_value(int nargs);
+
+ void b_constrainH(int nargs);
+ void b_constrainV(int nargs);
+ void b_copyToClipBoard(int nargs);
+ void b_duplicate(int nargs);
+ void b_editableText(int nargs);
+ void b_erase(int nargs);
+ void b_findEmpty(int nargs);
+ void b_importFileInto(int nargs);
+ void b_installMenu(int nargs);
+ void b_label(int nargs);
+ void b_marker(int nargs);
+ void b_move(int nargs);
+ void b_moveableSprite(int nargs);
+ void b_pasteClipBoardInto(int nargs);
+ void b_puppetPalette(int nargs);
+ void b_puppetSound(int nargs);
+ void b_puppetSprite(int nargs);
+ void b_puppetTempo(int nargs);
+ void b_puppetTransition(int nargs);
+ void b_ramNeeded(int nargs);
+ void b_rollOver(int nargs);
+ void b_spriteBox(int nargs);
+ void b_unLoad(int nargs);
+ void b_unLoadCast(int nargs);
+ void b_updateStage(int nargs);
+ void b_zoomBox(int nargs);
+
+ void b_abort(int nargs);
+ void b_continue(int nargs);
+ void b_dontPassEvent(int nargs);
+ void b_delay(int nargs);
+ void b_do(int nargs);
+ void b_go(int nargs);
+ void b_halt(int nargs);
+ void b_nothing(int nargs);
+ void b_pass(int nargs);
+ void b_pause(int nargs);
+ void b_playAccel(int nargs);
+ void b_preLoad(int nargs);
+ void b_preLoadCast(int nargs);
+ void b_quit(int nargs);
+ void b_restart(int nargs);
+ void b_shutDown(int nargs);
+ void b_startTimer(int nargs);
+ void b_return(int nargs);
+
+ void b_closeDA(int nargs);
+ void b_closeResFile(int nargs);
+ void b_closeXlib(int nargs);
+ void b_getNthFileNameInFolder(int nargs);
+ void b_openDA(int nargs);
+ void b_openResFile(int nargs);
+ void b_openXlib(int nargs);
+ void b_setCallBack(int nargs);
+ void b_saveMovie(int nargs);
+ void b_showResFile(int nargs);
+ void b_showXlib(int nargs);
+ void b_xFactoryList(int nargs);
+
+ void b_point(int nargs);
+ void b_inside(int nargs);
+ void b_intersect(int nargs);
+ void b_map(int nargs);
+ void b_offsetRect(int nargs);
+ void b_rect(int nargs);
+ void b_union(int nargs);
+
+ void b_close(int nargs);
+ void b_forget(int nargs);
+ void b_inflate(int nargs);
+ void b_moveToBack(int nargs);
+ void b_moveToFront(int nargs);
+ void b_window(int nargs);
+
+ void b_beep(int nargs);
+ void b_mci(int nargs);
+ void b_mciwait(int nargs);
+ void b_soundBusy(int nargs);
+ void b_soundClose(int nargs);
+ void b_soundFadeIn(int nargs);
+ void b_soundFadeOut(int nargs);
+ void b_soundPlayFile(int nargs);
+ void b_soundStop(int nargs);
+
+ void b_ancestor(int nargs);
+ void b_backspace(int nargs);
+ void b_empty(int nargs);
+ void b_enter(int nargs);
+ void b_false(int nargs);
+ void b_quote(int nargs);
+ void b_returnconst(int nargs);
+ void b_tab(int nargs);
+ void b_true(int nargs);
+ void b_version(int nargs);
+
+ void b_factory(int nargs);
+
+ void b_cast(int nargs);
+ void b_field(int nargs);
+ void b_me(int nargs);
+ void b_script(int nargs);
+
+ void b_numberofchars(int nargs);
+ void b_numberofitems(int nargs);
+ void b_numberoflines(int nargs);
+ void b_numberofwords(int nargs);
+
+} // End of namespace LB
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 97c8050bde..ed307fb1dc 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -48,6 +48,7 @@
#include "director/score.h"
#include "director/util.h"
#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-builtins.h"
#include "director/lingo/lingo-code.h"
namespace Director {
@@ -1182,7 +1183,7 @@ void LC::call(Common::String name, int nargs) {
}
if (sym->type == BLTIN || sym->type == FBLTIN || sym->type == RBLTIN) {
- if (sym->u.bltin == g_lingo->b_factory) {
+ if (sym->u.bltin == LB::b_factory) {
g_lingo->factoryCall(name, nargs);
} else {
int stackSize = g_lingo->_stack.size() - nargs;
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index 10254c3df3..9077e9d6ad 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -45,6 +45,7 @@
#include "director/director.h"
#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-builtins.h"
#include "director/lingo/lingo-code.h"
#include "director/util.h"
@@ -474,7 +475,7 @@ void Lingo::codeFactory(Common::String &name) {
sym->nargs = -1;
sym->maxArgs = 0;
sym->parens = true;
- sym->u.bltin = g_lingo->b_factory;
+ sym->u.bltin = LB::b_factory;
_handlers[ENTITY_INDEX(_eventHandlerTypeIds[name.c_str()], _currentEntityId)] = sym;
}
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index 09476e7b1c..dcc1bfa5ad 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -198,8 +198,10 @@ public:
void runTests();
-private:
+public:
Common::String codePreprocessor(const char *s, bool simple = false);
+
+private:
Common::String preprocessReturn(Common::String in);
const char *findNextDefinition(const char *s);
@@ -274,185 +276,8 @@ public:
void dropStack(int nargs);
void drop(uint num);
- // builtin functions
- static void b_abs(int nargs);
- static void b_atan(int nargs);
- static void b_cos(int nargs);
- static void b_exp(int nargs);
- static void b_float(int nargs);
- static void b_integer(int nargs);
- static void b_log(int nargs);
- static void b_pi(int nargs);
- static void b_power(int nargs);
- static void b_random(int nargs);
- static void b_sin(int nargs);
- static void b_sqrt(int nargs);
- static void b_tan(int nargs);
-
- static void b_chars(int nargs);
- static void b_charToNum(int nargs);
- static void b_delete(int nargs);
- static void b_hilite(int nargs);
- static void b_length(int nargs);
- static void b_numToChar(int nargs);
- static void b_offset(int nargs);
- static void b_string(int nargs);
-
- static void b_add(int nargs);
- static void b_addAt(int nargs);
- static void b_addProp(int nargs);
- static void b_append(int nargs);
- static void b_count(int nargs);
- static void b_deleteAt(int nargs);
- static void b_deleteProp(int nargs);
- static void b_findPos(int nargs);
- static void b_findPosNear(int nargs);
- static void b_getaProp(int nargs);
- static void b_getAt(int nargs);
- static void b_getLast(int nargs);
- static void b_getOne(int nargs);
- static void b_getPos(int nargs);
- static void b_getProp(int nargs);
- static void b_getPropAt(int nargs);
- static void b_list(int nargs);
- static void b_listP(int nargs);
- static void b_max(int nargs);
- static void b_min(int nargs);
- static void b_setaProp(int nargs);
- static void b_setAt(int nargs);
- static void b_setProp(int nargs);
- static void b_sort(int nargs);
-
- static void b_factoryP(int nargs);
- static void b_floatP(int nargs);
- static void b_ilk(int nargs);
- static void b_integerp(int nargs);
- static void b_objectp(int nargs);
- static void b_pictureP(int nargs);
- static void b_stringp(int nargs);
- static void b_symbolp(int nargs);
- static void b_voidP(int nargs);
-
- static void b_alert(int nargs);
- static void b_birth(int nargs);
- static void b_clearGlobals(int nargs);
- static void b_cursor(int nargs);
- static void b_framesToHMS(int nargs);
- static void b_HMStoFrames(int nargs);
- static void b_param(int nargs);
- static void b_printFrom(int nargs);
- static void b_showGlobals(int nargs);
- static void b_showLocals(int nargs);
- static void b_value(int nargs);
-
- static void b_constrainH(int nargs);
- static void b_constrainV(int nargs);
- static void b_copyToClipBoard(int nargs);
- static void b_duplicate(int nargs);
- static void b_editableText(int nargs);
- static void b_erase(int nargs);
- static void b_findEmpty(int nargs);
- static void b_importFileInto(int nargs);
- static void b_installMenu(int nargs);
- static void b_label(int nargs);
- static void b_marker(int nargs);
- static void b_move(int nargs);
- static void b_moveableSprite(int nargs);
- static void b_pasteClipBoardInto(int nargs);
- static void b_puppetPalette(int nargs);
- static void b_puppetSound(int nargs);
- static void b_puppetSprite(int nargs);
- static void b_puppetTempo(int nargs);
- static void b_puppetTransition(int nargs);
- static void b_ramNeeded(int nargs);
- static void b_rollOver(int nargs);
- static void b_spriteBox(int nargs);
- static void b_unLoad(int nargs);
- static void b_unLoadCast(int nargs);
- static void b_updateStage(int nargs);
- static void b_zoomBox(int nargs);
-
- static void b_abort(int nargs);
- static void b_continue(int nargs);
- static void b_dontPassEvent(int nargs);
- static void b_delay(int nargs);
- static void b_do(int nargs);
- static void b_go(int nargs);
- static void b_halt(int nargs);
- static void b_nothing(int nargs);
- static void b_pass(int nargs);
- static void b_pause(int nargs);
- static void b_playAccel(int nargs);
- static void b_preLoad(int nargs);
- static void b_preLoadCast(int nargs);
- static void b_quit(int nargs);
- static void b_restart(int nargs);
- static void b_shutDown(int nargs);
- static void b_startTimer(int nargs);
- static void b_return(int nargs);
-
- static void b_closeDA(int nargs);
- static void b_closeResFile(int nargs);
- static void b_closeXlib(int nargs);
- static void b_getNthFileNameInFolder(int nargs);
- static void b_openDA(int nargs);
- static void b_openResFile(int nargs);
- static void b_openXlib(int nargs);
- static void b_setCallBack(int nargs);
- static void b_saveMovie(int nargs);
- static void b_showResFile(int nargs);
- static void b_showXlib(int nargs);
- static void b_xFactoryList(int nargs);
-
- static void b_point(int nargs);
- static void b_inside(int nargs);
- static void b_intersect(int nargs);
- static void b_map(int nargs);
- static void b_offsetRect(int nargs);
- static void b_rect(int nargs);
- static void b_union(int nargs);
-
- static void b_close(int nargs);
- static void b_forget(int nargs);
- static void b_inflate(int nargs);
- static void b_moveToBack(int nargs);
- static void b_moveToFront(int nargs);
- static void b_window(int nargs);
-
- static void b_beep(int nargs);
- static void b_mci(int nargs);
- static void b_mciwait(int nargs);
- static void b_soundBusy(int nargs);
- static void b_soundClose(int nargs);
- static void b_soundFadeIn(int nargs);
- static void b_soundFadeOut(int nargs);
- static void b_soundPlayFile(int nargs);
- static void b_soundStop(int nargs);
-
- static void b_ancestor(int nargs);
- static void b_backspace(int nargs);
- static void b_empty(int nargs);
- static void b_enter(int nargs);
- static void b_false(int nargs);
- static void b_quote(int nargs);
- static void b_returnconst(int nargs);
- static void b_tab(int nargs);
- static void b_true(int nargs);
- static void b_version(int nargs);
-
- static void b_factory(int nargs);
void factoryCall(Common::String &name, int nargs);
- static void b_cast(int nargs);
- static void b_field(int nargs);
- static void b_me(int nargs);
- static void b_script(int nargs);
-
- static void b_numberofchars(int nargs);
- static void b_numberofitems(int nargs);
- static void b_numberoflines(int nargs);
- static void b_numberofwords(int nargs);
-
void func_mci(Common::String &s);
void func_mciwait(Common::String &s);
void func_beep(int repeats);
@@ -522,6 +347,8 @@ public:
private:
int parse(const char *code);
void parseMenu(const char *code);
+
+public:
Common::String genMenuHandler(int *commandId, Common::String &command);
public: