aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
authorEugene Sandulenko2016-08-13 12:51:18 +0200
committerEugene Sandulenko2016-08-13 12:51:18 +0200
commitdc2a456b64c86439883c57ca457c61a44a74ddfe (patch)
treeba3a4b4ef7f0b4798241880fe5421867a34f778c /engines/director
parent963826ca6f350783e2fd0a2ca6bdb9f3a5222d52 (diff)
downloadscummvm-rg350-dc2a456b64c86439883c57ca457c61a44a74ddfe.tar.gz
scummvm-rg350-dc2a456b64c86439883c57ca457c61a44a74ddfe.tar.bz2
scummvm-rg350-dc2a456b64c86439883c57ca457c61a44a74ddfe.zip
DIRECTOR: Lingo: Implemented integerp function and added stubs for 'the free*'
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/lingo/lingo-builtins.cpp9
-rw-r--r--engines/director/lingo/lingo-the.cpp4
-rw-r--r--engines/director/lingo/lingo-the.h2
-rw-r--r--engines/director/lingo/lingo.h1
4 files changed, 15 insertions, 1 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 05553fe806..0e1d4f0733 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -38,6 +38,7 @@ static struct BuiltinProto {
{ "exp", Lingo::b_exp, 1, 1, true }, // D4
{ "float", Lingo::b_float, 1, 1, true }, // D4
{ "integer",Lingo::b_integer, 1, 1, true },
+ { "integerp",Lingo::b_integerp, 1, 1, true },
{ "log", Lingo::b_log, 1, 1, true }, // D4
{ "pi", Lingo::b_pi, 0, 0, true }, // D4
{ "power", Lingo::b_power, 2, 2, true }, // D4
@@ -220,6 +221,14 @@ void Lingo::b_integer(int nargs) {
g_lingo->push(d);
}
+void Lingo::b_integerp(int nargs) {
+ Datum d = g_lingo->pop();
+ int res = (d.type == INT) ? 1 : 0;
+ d.toInt();
+ d.u.i = res;
+ g_lingo->push(d);
+}
+
void Lingo::b_log(int nargs) {
Datum d = g_lingo->pop();
d.toFloat();
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 3f4f9cc432..3b00c092ec 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -37,9 +37,11 @@ TheEntity entities[] = {
{ kTheExitLock, "exitlock", false },
{ kTheFloatPrecision, "floatPrecision", false },
{ kTheFrame, "frame", false },
+ { kTheFreeBlock, "freeBlock", false },
+ { kTheFreeBytes, "freeBytes", false },
{ kTheItemDelimiter, "itemDelimiter", false },
{ kTheKey, "key", false },
- { kTheKeyCode, "keycode", false },
+ { kTheKeyCode, "keyCode", false },
{ kTheLastClick, "lastClick", false },
{ kTheLastEvent, "lastEvent", false },
{ kTheLastFrame, "lastFrame", false },
diff --git a/engines/director/lingo/lingo-the.h b/engines/director/lingo/lingo-the.h
index 5fea4ba009..7a27c0ad84 100644
--- a/engines/director/lingo/lingo-the.h
+++ b/engines/director/lingo/lingo-the.h
@@ -28,6 +28,8 @@ namespace Director {
enum TheEntityType {
kTheNOEntity = 0,
kTheFrame = 1,
+ kTheFreeBlock,
+ kTheFreeBytes,
kThePathName,
kTheMenu,
kTheMenuItem,
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index a8b8c04355..6fd5f1974a 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -271,6 +271,7 @@ public:
static void b_exp(int nargs);
static void b_float(int nargs);
static void b_integer(int nargs);
+ static void b_integerp(int nargs);
static void b_log(int nargs);
static void b_pi(int nargs);
static void b_power(int nargs);