From 0229c95953ea225c3b4304689c69c7f8a218e28e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 9 Feb 2017 20:32:34 +0100 Subject: DIRECTOR: Lingo: Documented D4 "Rectangle and point coordinates" Lingo --- engines/director/lingo/lingo-builtins.cpp | 76 ++++++++++++++++++++++++++----- engines/director/lingo/lingo-the.cpp | 4 +- engines/director/lingo/lingo.h | 7 ++- 3 files changed, 73 insertions(+), 14 deletions(-) (limited to 'engines/director/lingo') diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index 99af75db69..d88527226e 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -52,7 +52,7 @@ static struct BuiltinProto { { "hilite", Lingo::b_hilite, 1, 1, true }, // D3 { "length", Lingo::b_length, 1, 1, true }, // D2 { "numToChar", Lingo::b_numToChar, 1, 1, true }, // D2 - { "offset", Lingo::b_offset, 2, 2, true }, // D2 + { "offset", Lingo::b_offset, 2, 3, true }, // D2 { "string", Lingo::b_string, 1, 1, true }, // D2 { "value", Lingo::b_value, 1, 1, true }, // D2 f // Lists @@ -148,7 +148,6 @@ static struct BuiltinProto { // go // D2 { "importFileInto", Lingo::b_importFileInto,2, 2, false }, // D4 c { "installMenu", Lingo::b_installMenu, 1, 1, false }, // D2 c - { "intersect", Lingo::b_intersect, 2, 2, false }, // D4 f { "label", Lingo::b_label, 1, 1, true }, // D2 f { "marker", Lingo::b_marker, 1, 1, true }, // D2 f { "move", Lingo::b_move, 1, 2, false }, // D4 c @@ -167,7 +166,12 @@ static struct BuiltinProto { { "updateStage", Lingo::b_updateStage, 0, 0, false }, // D2 c { "zoomBox", Lingo::b_zoomBox, -1,0, false }, // D2 // Point - { "point", Lingo::b_point, 2, 2, true }, + { "point", Lingo::b_point, 2, 2, true }, // D4 f + { "inside", Lingo::b_inside, 2, 2, true }, // D4 f + { "intersect", Lingo::b_intersect, 2, 2, false }, // D4 f + { "map", Lingo::b_map, 3, 3, true }, // D4 f + { "rect", Lingo::b_rect, 4, 4, true }, // D4 f + { "union", Lingo::b_union, 2, 2, true }, // D4 f // Sound { "beep", Lingo::b_beep, 0, 1, false }, // D2 { "mci", Lingo::b_mci, 1, 1, false }, @@ -238,6 +242,7 @@ static const char *builtinFunctions[] = { "getPropAt", "ilk", "inflate", + "inside", "integer", "integerp", "intersect", @@ -245,16 +250,20 @@ static const char *builtinFunctions[] = { "list", "listP", "log", + "map", "marker", "max", "min", "objectp", + "offset", "param", "pi", "pictureP", + "point", "power", "ramNeeded", "random", + "rect", "rollOver", "quote", "return", @@ -555,6 +564,10 @@ void Lingo::b_numToChar(int nargs) { } void Lingo::b_offset(int nargs) { + if (nargs == 3) { + b_offsetRect(nargs); + return; + } Datum target = g_lingo->pop(); Datum source = g_lingo->pop(); @@ -1086,14 +1099,6 @@ void Lingo::b_installMenu(int nargs) { warning("STUB: b_installMenu(%d)", d.u.i); } -void Lingo::b_intersect(int nargs) { - g_lingo->printSTUBWithArglist("b_intersect", nargs); - - g_lingo->dropStack(nargs); - - g_lingo->push(Datum(0)); -} - void Lingo::b_label(int nargs) { Datum d = g_lingo->pop(); d.toInt(); @@ -1252,6 +1257,55 @@ void Lingo::b_point(int nargs) { g_lingo->push(d); } +void Lingo::b_rect(int nargs) { + g_lingo->printSTUBWithArglist("b_rect", nargs); + + g_lingo->dropStack(nargs); + + g_lingo->push(Datum(0)); +} + + +void Lingo::b_intersect(int nargs) { + g_lingo->printSTUBWithArglist("b_intersect", nargs); + + g_lingo->dropStack(nargs); + + g_lingo->push(Datum(0)); +} + +void Lingo::b_inside(int nargs) { + g_lingo->printSTUBWithArglist("b_inside", nargs); + + g_lingo->dropStack(nargs); + + g_lingo->push(Datum(0)); +} + +void Lingo::b_map(int nargs) { + g_lingo->printSTUBWithArglist("b_map", nargs); + + g_lingo->dropStack(nargs); + + g_lingo->push(Datum(0)); +} + +void Lingo::b_offsetRect(int nargs) { + g_lingo->printSTUBWithArglist("b_offsetRect", nargs); + + g_lingo->dropStack(nargs); + + g_lingo->push(Datum(0)); +} + +void Lingo::b_union(int nargs) { + g_lingo->printSTUBWithArglist("b_union", nargs); + + g_lingo->dropStack(nargs); + + g_lingo->push(Datum(0)); +} + /////////////////// // Sound diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index 16c7be092b..5997f5bb3e 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -186,7 +186,7 @@ TheEntityField fields[] = { { kTheCast, "modified", kTheModified }, // D4 p { kTheCast, "name", kTheName }, // D3 p { kTheCast, "number", kTheNumber }, // D3 p - { kTheCast, "rect", kTheRect }, + { kTheCast, "rect", kTheRect }, // D4 p { kTheCast, "purgePriority",kThePurgePriority },// D4 p // 0 Never purge, 1 Purge Last, 2 Purge next, 2 Purge normal { kTheCast, "scriptText", kTheScriptText }, // D4 p { kTheCast, "width", kTheWidth }, // D4 p @@ -232,7 +232,7 @@ TheEntityField fields[] = { { kTheWindow, "rect", kTheRect }, // D4 p { kTheWindow, "title", kTheTitle }, // D4 p { kTheWindow, "titleVisible", kTheTitleVisible }, // D4 p - { kTheWindow, "sourceRect", kTheSourceRect }, + { kTheWindow, "sourceRect", kTheSourceRect }, // D4 p { kTheWindow, "visible", kTheVisible }, // D4 p { kTheWindow, "windowType", kTheWindowType }, // D4 p diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 83c34fbf4f..ab9f09b370 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -397,7 +397,6 @@ public: static void b_findEmpty(int nargs); static void b_importFileInto(int nargs); static void b_installMenu(int nargs); - static void b_intersect(int nargs); static void b_label(int nargs); static void b_marker(int nargs); static void b_move(int nargs); @@ -447,6 +446,12 @@ public: 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); -- cgit v1.2.3