aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo/lingo-funcs.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2016-06-20 18:59:26 +0200
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commitdb2380077fee7b6bccba4262fa25f55e50a2981a (patch)
tree6b7f4e9d69311f433ddcc8f6b9506f47886f686f /engines/director/lingo/lingo-funcs.cpp
parenta7ec15f77affc6ec9ee6f08d3e4a4b4d697770ac (diff)
downloadscummvm-rg350-db2380077fee7b6bccba4262fa25f55e50a2981a.tar.gz
scummvm-rg350-db2380077fee7b6bccba4262fa25f55e50a2981a.tar.bz2
scummvm-rg350-db2380077fee7b6bccba4262fa25f55e50a2981a.zip
DIRECTOR: Lingo: Implement logical operators
Diffstat (limited to 'engines/director/lingo/lingo-funcs.cpp')
-rw-r--r--engines/director/lingo/lingo-funcs.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index cd399f7100..3e3d8858b0 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -341,6 +341,55 @@ void Lingo::func_negate() {
g_lingo->push(d);
}
+void Lingo::func_eq() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ d1.val = (d1.val == d2.val) ? 1 : 0;
+ g_lingo->push(d1);
+}
+
+void Lingo::func_neq() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ d1.val = (d1.val != d2.val) ? 1 : 0;
+ g_lingo->push(d1);
+}
+
+void Lingo::func_gt() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ d1.val = (d1.val > d2.val) ? 1 : 0;
+ g_lingo->push(d1);
+}
+
+void Lingo::func_lt() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ d1.val = (d1.val < d2.val) ? 1 : 0;
+ g_lingo->push(d1);
+}
+
+void Lingo::func_ge() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ d1.val = (d1.val >= d2.val) ? 1 : 0;
+ g_lingo->push(d1);
+}
+
+void Lingo::func_le() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ d1.val = (d1.val <= d2.val) ? 1 : 0;
+ g_lingo->push(d1);
+}
+
+
void Lingo::func_ifcode() {
Datum d;
int savepc = g_lingo->_pc; /* then part */