From 34d8aabc4bb81ac1f8d2685b97d53a4920ec34c2 Mon Sep 17 00:00:00 2001 From: djsrv Date: Tue, 15 Jun 2021 00:48:28 -0400 Subject: [PATCH] DIRECTOR: LINGO: Add DatumType enum --- engines/director/lingo/lingo-builtins.cpp | 3 +-- engines/director/lingo/lingo-bytecode.cpp | 1 - engines/director/lingo/lingo-code.cpp | 1 - engines/director/lingo/lingo-codegen.cpp | 1 - engines/director/lingo/lingo-funcs.cpp | 1 - engines/director/lingo/lingo-object.cpp | 1 - engines/director/lingo/lingo-object.h | 3 +-- engines/director/lingo/lingo-the.cpp | 1 - engines/director/lingo/lingo.h | 4 +++- engines/director/types.h | 19 +++++++++++++++++++ 10 files changed, 24 insertions(+), 11 deletions(-) diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index 18bd0bd21af..fab803cedfe 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -46,7 +46,6 @@ #include "director/lingo/lingo-builtins.h" #include "director/lingo/lingo-code.h" #include "director/lingo/lingo-object.h" -#include "director/lingo/lingo-gr.h" namespace Director { @@ -339,7 +338,7 @@ void Lingo::printSTUBWithArglist(const char *funcname, int nargs, const char *pr } void Lingo::convertVOIDtoString(int arg, int nargs) { - if (_stack[_stack.size() - nargs + arg].type == VOIDSYM) { + if (_stack[_stack.size() - nargs + arg].type == VOID) { if (_stack[_stack.size() - nargs + arg].u.s != NULL) g_lingo->_stack[_stack.size() - nargs + arg].type = STRING; else diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp index a926583a39b..3f413dece70 100644 --- a/engines/director/lingo/lingo-bytecode.cpp +++ b/engines/director/lingo/lingo-bytecode.cpp @@ -35,7 +35,6 @@ #include "director/lingo/lingo-bytecode.h" #include "director/lingo/lingo-object.h" #include "director/lingo/lingo-the.h" -#include "director/lingo/lingo-gr.h" namespace Director { diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index 20da9aa9783..27170e21930 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -56,7 +56,6 @@ #include "director/lingo/lingo-code.h" #include "director/lingo/lingo-object.h" #include "director/lingo/lingo-the.h" -#include "director/lingo/lingo-gr.h" namespace Director { diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp index a3883eaba3d..2d6056dd9df 100644 --- a/engines/director/lingo/lingo-codegen.cpp +++ b/engines/director/lingo/lingo-codegen.cpp @@ -49,7 +49,6 @@ #include "director/lingo/lingo.h" #include "director/lingo/lingo-code.h" #include "director/lingo/lingo-object.h" -#include "director/lingo/lingo-gr.h" namespace Director { diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp index 5f03dd1936c..3a70aaa0440 100644 --- a/engines/director/lingo/lingo-funcs.cpp +++ b/engines/director/lingo/lingo-funcs.cpp @@ -38,7 +38,6 @@ #include "director/util.h" #include "director/lingo/lingo.h" -#include "director/lingo/lingo-gr.h" namespace Director { diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp index d74b2d81390..53299849141 100644 --- a/engines/director/lingo/lingo-object.cpp +++ b/engines/director/lingo/lingo-object.cpp @@ -32,7 +32,6 @@ #include "director/lingo/lingo-code.h" #include "director/lingo/lingo-object.h" #include "director/lingo/lingo-the.h" -#include "director/lingo/lingo-gr.h" #include "director/lingo/xlibs/fileio.h" #include "director/lingo/xlibs/palxobj.h" #include "director/lingo/xlibs/flushxobj.h" diff --git a/engines/director/lingo/lingo-object.h b/engines/director/lingo/lingo-object.h index 197e9e431f7..f2c36387d75 100644 --- a/engines/director/lingo/lingo-object.h +++ b/engines/director/lingo/lingo-object.h @@ -23,9 +23,8 @@ #ifndef DIRECTOR_LINGO_OBJECT_H #define DIRECTOR_LINGO_OBJECT_H -// FIXME: Basic Lingo types like Datum should probably be in a separate, smaller header +#include "director/director.h" #include "director/lingo/lingo.h" -#include "director/lingo/lingo-gr.h" namespace Director { diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index 5e3cd1d4d6a..21ddecabc27 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -37,7 +37,6 @@ #include "director/lingo/lingo-code.h" #include "director/lingo/lingo-object.h" #include "director/lingo/lingo-the.h" -#include "director/lingo/lingo-gr.h" namespace Director { class Sprite; diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 5f68c6ec201..71a1dbcbca4 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -25,6 +25,7 @@ #include "common/hash-ptr.h" #include "common/hash-str.h" +#include "common/str-array.h" #include "director/types.h" @@ -44,6 +45,7 @@ struct LingoArchive; struct LingoV4Bytecode; struct LingoV4TheEntity; class AbstractObject; +class Cast; class ScriptContext; class DirectorEngine; class Frame; @@ -109,7 +111,7 @@ struct Symbol { /* symbol table entry */ }; struct Datum { /* interpreter stack type */ - int type; + DatumType type; union { int i; /* INT, ARGC, ARGCNORET */ diff --git a/engines/director/types.h b/engines/director/types.h index bb2a152bed8..b5d6a6c2c91 100644 --- a/engines/director/types.h +++ b/engines/director/types.h @@ -332,6 +332,25 @@ enum FileVersion { kFileVer1201 = 0x79F }; +enum DatumType { + ARRAY, + ARGC, + ARGCNORET, + CASTREF, + CHUNKREF, + FIELDREF, + FLOAT, + INT, + OBJECT, + PARRAY, + POINT, + STRING, + SYMBOL, + VAR, + VOID, + RECT +}; + struct Datum; struct PCell; typedef Common::Array DatumArray;