[Scummvm-git-logs] scummvm master -> bac023b726b683258367cb2fcb0c2c34912c418a
sev-
sev at scummvm.org
Tue Jun 9 21:06:07 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
bac023b726 DIRECTOR: Rename debug flags constants to match the flag values
Commit: bac023b726b683258367cb2fcb0c2c34912c418a
https://github.com/scummvm/scummvm/commit/bac023b726b683258367cb2fcb0c2c34912c418a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-06-09T23:05:31+02:00
Commit Message:
DIRECTOR: Rename debug flags constants to match the flag values
Changed paths:
engines/director/director.cpp
engines/director/director.h
engines/director/lingo/lingo-bytecode.cpp
engines/director/lingo/lingo-codegen.cpp
engines/director/lingo/lingo-gr.cpp
engines/director/lingo/lingo-gr.h
engines/director/lingo/lingo-lex.cpp
engines/director/lingo/lingo-lex.l
engines/director/lingo/lingo-patcher.cpp
engines/director/lingo/lingo-preprocessor.cpp
engines/director/lingo/lingo.cpp
engines/director/score-loading.cpp
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index ab827dfebc..0ef6a2867d 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -45,9 +45,9 @@ DirectorEngine *g_director;
DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc),
_rnd("director") {
DebugMan.addDebugChannel(kDebugLingoExec, "lingoexec", "Lingo Execution");
- DebugMan.addDebugChannel(kDebugLingoCompile, "compile", "Lingo Compilation");
- DebugMan.addDebugChannel(kDebugLingoParse, "parse", "Lingo code parsing");
- DebugMan.addDebugChannel(kDebugLingoCompileOnly, "compileonly", "Skip Lingo code execution");
+ DebugMan.addDebugChannel(kDebugCompile, "compile", "Lingo Compilation");
+ DebugMan.addDebugChannel(kDebugParse, "parse", "Lingo code parsing");
+ DebugMan.addDebugChannel(kDebugCompileOnly, "compileonly", "Skip Lingo code execution");
DebugMan.addDebugChannel(kDebugLoading, "loading", "Loading");
DebugMan.addDebugChannel(kDebugImages, "images", "Image drawing");
DebugMan.addDebugChannel(kDebugText, "text", "Text rendering");
@@ -57,7 +57,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
DebugMan.addDebugChannel(kDebugNoLoop, "noloop", "Do not loop the playback");
DebugMan.addDebugChannel(kDebugBytecode, "bytecode", "Execute Lscr bytecode");
DebugMan.addDebugChannel(kDebugFewFramesOnly, "fewframesonly", "Only run the first 10 frames");
- DebugMan.addDebugChannel(kDebugLingoPreprocess, "preprocess", "Lingo preprocessing");
+ DebugMan.addDebugChannel(kDebugPreprocess, "preprocess", "Lingo preprocessing");
g_director = this;
@@ -241,7 +241,7 @@ Common::Error DirectorEngine::run() {
_nextMovie.frameI = -1;
}
- if (!debugChannelSet(-1, kDebugLingoCompileOnly) && goodMovie) {
+ if (!debugChannelSet(-1, kDebugCompileOnly) && goodMovie) {
debugC(1, kDebugEvents, "Starting playback of score '%s'", _currentScore->getMacName().c_str());
_currentScore->startLoop();
diff --git a/engines/director/director.h b/engines/director/director.h
index b78b43a1f3..af98ebbd66 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -60,20 +60,20 @@ class Score;
class Cast;
enum {
- kDebugLingoExec = 1 << 0,
- kDebugLingoCompile = 1 << 1,
- kDebugLoading = 1 << 2,
- kDebugImages = 1 << 3,
- kDebugText = 1 << 4,
- kDebugEvents = 1 << 5,
- kDebugLingoParse = 1 << 6,
- kDebugLingoCompileOnly = 1 << 7,
- kDebugSlow = 1 << 8,
- kDebugFast = 1 << 9,
- kDebugNoLoop = 1 << 10,
- kDebugBytecode = 1 << 11,
- kDebugFewFramesOnly = 1 << 12,
- kDebugLingoPreprocess = 1 << 13
+ kDebugLingoExec = 1 << 0,
+ kDebugCompile = 1 << 1,
+ kDebugLoading = 1 << 2,
+ kDebugImages = 1 << 3,
+ kDebugText = 1 << 4,
+ kDebugEvents = 1 << 5,
+ kDebugParse = 1 << 6,
+ kDebugCompileOnly = 1 << 7,
+ kDebugSlow = 1 << 8,
+ kDebugFast = 1 << 9,
+ kDebugNoLoop = 1 << 10,
+ kDebugBytecode = 1 << 11,
+ kDebugFewFramesOnly = 1 << 12,
+ kDebugPreprocess = 1 << 13
};
struct MovieReference {
diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index d24110f2d8..692e17e4c9 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -704,7 +704,7 @@ void LC::cb_zeropush() {
}
void Lingo::addCodeV4(Common::SeekableSubReadStreamEndian &stream, ScriptType type, uint16 id, Common::String &archName) {
- debugC(1, kDebugLingoCompile, "Add V4 bytecode for type %s with id %d", scriptType2str(type), id);
+ debugC(1, kDebugCompile, "Add V4 bytecode for type %s with id %d", scriptType2str(type), id);
if (getScriptContext(type, id)) {
// We can't undefine context data because it could be used in e.g. symbols.
@@ -1158,12 +1158,12 @@ void Lingo::addCodeV4(Common::SeekableSubReadStreamEndian &stream, ScriptType ty
} else {
// unimplemented instruction
if (opcode < 0x40) { // 1 byte instruction
- debugC(5, kDebugLingoCompile, "Unimplemented opcode: 0x%02x", opcode);
+ debugC(5, kDebugCompile, "Unimplemented opcode: 0x%02x", opcode);
offsetList.push_back(_currentScript->size());
g_lingo->code1(LC::cb_unk);
g_lingo->codeInt(opcode);
} else if (opcode < 0x80) { // 2 byte instruction
- debugC(5, kDebugLingoCompile, "Unimplemented opcode: 0x%02x (%d)", opcode, (uint)codeStore[pointer]);
+ debugC(5, kDebugCompile, "Unimplemented opcode: 0x%02x (%d)", opcode, (uint)codeStore[pointer]);
offsetList.push_back(_currentScript->size());
g_lingo->code1(LC::cb_unk1);
g_lingo->codeInt(opcode);
@@ -1171,7 +1171,7 @@ void Lingo::addCodeV4(Common::SeekableSubReadStreamEndian &stream, ScriptType ty
g_lingo->codeInt((uint)codeStore[pointer]);
pointer += 1;
} else { // 3 byte instruction
- debugC(5, kDebugLingoCompile, "Unimplemented opcode: 0x%02x (%d, %d)", opcode, (uint)codeStore[pointer], (uint)codeStore[pointer+1]);
+ debugC(5, kDebugCompile, "Unimplemented opcode: 0x%02x (%d, %d)", opcode, (uint)codeStore[pointer], (uint)codeStore[pointer+1]);
offsetList.push_back(_currentScript->size());
g_lingo->code1(LC::cb_unk2);
g_lingo->codeInt(opcode);
@@ -1247,7 +1247,7 @@ void Lingo::addCodeV4(Common::SeekableSubReadStreamEndian &stream, ScriptType ty
void Lingo::addNamesV4(Common::SeekableSubReadStreamEndian &stream) {
- debugC(1, kDebugLingoCompile, "Add V4 script name index");
+ debugC(1, kDebugCompile, "Add V4 script name index");
if (stream.size() < 0x14) {
warning("Lnam header too small");
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index 0f29aceb2d..2e0c8b6002 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -76,14 +76,14 @@ Symbol Lingo::define(Common::String &name, int nargs, ScriptData *code, Common::
sym.ctx = _currentScriptContext;
sym.archiveIndex = _archiveIndex;
- if (debugChannelSet(1, kDebugLingoCompile)) {
+ if (debugChannelSet(1, kDebugCompile)) {
uint pc = 0;
while (pc < sym.u.defn->size()) {
uint spc = pc;
Common::String instr = g_lingo->decodeInstruction(sym.u.defn, pc, &pc);
- debugC(1, kDebugLingoCompile, "[%5d] %s", spc, instr.c_str());
+ debugC(1, kDebugCompile, "[%5d] %s", spc, instr.c_str());
}
- debugC(1, kDebugLingoCompile, "<end define code>");
+ debugC(1, kDebugCompile, "<end define code>");
}
if (factory) {
@@ -107,7 +107,7 @@ Symbol Lingo::define(Common::String &name, int nargs, ScriptData *code, Common::
}
Symbol Lingo::codeDefine(Common::String &name, int start, int nargs, Object *factory, int end, bool removeCode) {
- debugC(1, kDebugLingoCompile, "codeDefine(\"%s\"(len: %d), %d, %d, \"%s\", %d) entity: %d",
+ debugC(1, kDebugCompile, "codeDefine(\"%s\"(len: %d), %d, %d, \"%s\", %d) entity: %d",
name.c_str(), _currentScript->size() - 1, start, nargs, (factory ? factory->name->c_str() : ""),
end, _currentEntityId);
@@ -221,13 +221,13 @@ int Lingo::codeFunc(Common::String *s, int numpar) {
void Lingo::codeLabel(int label) {
_labelstack.push_back(label);
- debugC(4, kDebugLingoCompile, "codeLabel: Added label %d", label);
+ debugC(4, kDebugCompile, "codeLabel: Added label %d", label);
}
void Lingo::processIf(int toplabel, int endlabel) {
inst iend;
- debugC(4, kDebugLingoCompile, "processIf(%d, %d)", toplabel, endlabel);
+ debugC(4, kDebugCompile, "processIf(%d, %d)", toplabel, endlabel);
while (true) {
if (_labelstack.empty()) {
@@ -242,7 +242,7 @@ void Lingo::processIf(int toplabel, int endlabel) {
if (!label)
break;
- debugC(4, kDebugLingoCompile, "processIf: label at %d", label);
+ debugC(4, kDebugCompile, "processIf: label at %d", label);
WRITE_UINT32(&iend, endlabel - label + 1);
diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp
index 35b8f74b8f..c0c4197e55 100644
--- a/engines/director/lingo/lingo-gr.cpp
+++ b/engines/director/lingo/lingo-gr.cpp
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.6.2. */
+/* A Bison parser, made by GNU Bison 3.6.3. */
/* Bison implementation for Yacc-like parsers in C
@@ -49,7 +49,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.6.2"
+#define YYBISON_VERSION "3.6.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -860,7 +860,7 @@ static const yytype_int8 yytranslate[] =
};
#if YYDEBUG
- /* YYRLINEYYN -- Source line where rule number YYN was defined. */
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_int16 yyrline[] =
{
0, 198, 198, 199, 201, 202, 203, 205, 212, 216,
@@ -955,7 +955,7 @@ static const yytype_int16 yytoknum[] =
#define yytable_value_is_error(Yyn) \
0
- /* YYPACTSTATE-NUM -- Index in YYTABLE of the portion describing
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
static const yytype_int16 yypact[] =
{
@@ -998,7 +998,7 @@ static const yytype_int16 yypact[] =
-300, -300, 1110, 1532, -300, -300, -300, 1616, -300
};
- /* YYDEFACTSTATE-NUM -- Default reduction number in state STATE-NUM.
+ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
Performed when YYTABLE does not specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
@@ -1042,7 +1042,7 @@ static const yytype_uint8 yydefact[] =
53, 48, 0, 0, 53, 47, 29, 0, 33
};
- /* YYPGOTONTERM-NUM. */
+ /* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
-300, 98, -300, -300, -41, 15, -300, -300, -300, -300,
@@ -1053,7 +1053,7 @@ static const yytype_int16 yypgoto[] =
-300, 13, -32, -300, -300, -300, -300, 43
};
- /* YYDEFGOTONTERM-NUM. */
+ /* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
-1, 45, 46, 47, 48, 313, 303, 330, 355, 304,
@@ -1064,7 +1064,7 @@ static const yytype_int16 yydefgoto[] =
61, 154, 77, 62, 121, 122, 123, 124
};
- /* YYTABLEYYPACT[STATE-NUM] -- What to do in state STATE-NUM. If
+ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule whose
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
@@ -1593,7 +1593,7 @@ static const yytype_int16 yycheck[] =
89, 90, 91, 92, 93, 94
};
- /* YYSTOSSTATE-NUM -- The (internal number of the) accessing
+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
@@ -1636,7 +1636,7 @@ static const yytype_uint8 yystos[] =
122, 114, 127, 127, 122, 123, 86, 127, 86
};
- /* YYR1YYN -- Symbol number of symbol that rule YYN derives. */
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
0, 103, 104, 104, 105, 105, 105, 106, 106, 106,
@@ -1659,7 +1659,7 @@ static const yytype_uint8 yyr1[] =
157, 157, 158, 158, 159, 159, 160, 160
};
- /* YYR2YYN -- Number of symbols on the right hand side of rule YYN. */
+ /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
static const yytype_int8 yyr2[] =
{
0, 2, 1, 3, 0, 1, 1, 4, 4, 6,
diff --git a/engines/director/lingo/lingo-gr.h b/engines/director/lingo/lingo-gr.h
index 4310d7d043..fd848f68f9 100644
--- a/engines/director/lingo/lingo-gr.h
+++ b/engines/director/lingo/lingo-gr.h
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.6.2. */
+/* A Bison parser, made by GNU Bison 3.6.3. */
/* Bison interface for Yacc-like parsers in C
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp
index 2b0e23a5dc..ffd626ec20 100644
--- a/engines/director/lingo/lingo-lex.cpp
+++ b/engines/director/lingo/lingo-lex.cpp
@@ -427,7 +427,7 @@ static const YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 2, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
@@ -743,7 +743,7 @@ using namespace Director;
int yyparse();
static void count() {
- if (debugChannelSet(-1, kDebugLingoParse))
+ if (debugChannelSet(-1, kDebugParse))
debug("LEXER: Read '%s' at %d:%d", yytext, g_lingo->_linenumber, g_lingo->_colnumber);
char *p = yytext;
@@ -2722,7 +2722,7 @@ int Lingo::parse(const char *code) {
YY_BUFFER_STATE bp;
- if (debugChannelSet(-1, kDebugLingoParse))
+ if (debugChannelSet(-1, kDebugParse))
yydebug = 1;
else
yydebug = 0;
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l
index 7543b67dfb..4238f4f32c 100644
--- a/engines/director/lingo/lingo-lex.l
+++ b/engines/director/lingo/lingo-lex.l
@@ -44,7 +44,7 @@ using namespace Director;
int yyparse();
static void count() {
- if (debugChannelSet(-1, kDebugLingoParse))
+ if (debugChannelSet(-1, kDebugParse))
debug("LEXER: Read '%s' at %d:%d", yytext, g_lingo->_linenumber, g_lingo->_colnumber);
char *p = yytext;
@@ -470,7 +470,7 @@ int Lingo::parse(const char *code) {
YY_BUFFER_STATE bp;
- if (debugChannelSet(-1, kDebugLingoParse))
+ if (debugChannelSet(-1, kDebugParse))
yydebug = 1;
else
yydebug = 0;
diff --git a/engines/director/lingo/lingo-patcher.cpp b/engines/director/lingo/lingo-patcher.cpp
index e755bef087..b55bc7d907 100644
--- a/engines/director/lingo/lingo-patcher.cpp
+++ b/engines/director/lingo/lingo-patcher.cpp
@@ -101,7 +101,7 @@ Common::String Lingo::patchLingoCode(Common::String &line, ScriptType type, uint
}
// Now everything matched
- debugC(1, kDebugLingoParse, "Lingo::patchLingoCode(): Applied a patch for '%s', '%s' %s:%d @ %d. \"%s\" -> \"%s\"",
+ debugC(1, kDebugParse, "Lingo::patchLingoCode(): Applied a patch for '%s', '%s' %s:%d @ %d. \"%s\" -> \"%s\"",
patch->gameId, patch->movie, scriptType2str(type), id, linenum,
patch->orig, line.c_str());
return patch->replace;
diff --git a/engines/director/lingo/lingo-preprocessor.cpp b/engines/director/lingo/lingo-preprocessor.cpp
index 56c85fe104..149a83ecc9 100644
--- a/engines/director/lingo/lingo-preprocessor.cpp
+++ b/engines/director/lingo/lingo-preprocessor.cpp
@@ -179,14 +179,14 @@ Common::String Lingo::codePreprocessor(const char *s, ScriptType type, uint16 id
if (*s == '\xc2')
linenumber++;
}
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "line: %d '%s'", iflevel, line.c_str());
+ debugC(2, kDebugParse | kDebugPreprocess, "line: %d '%s'", iflevel, line.c_str());
if (type == kMovieScript && _vm->getVersion() <= 3 && !defFound) {
tok = nexttok(line.c_str());
if (tok.equals("macro") || tok.equals("factory") || tok.equals("on")) {
defFound = true;
} else {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "skipping line before first definition");
+ debugC(2, kDebugParse | kDebugPreprocess, "skipping line before first definition");
linenumber++;
if (*s) // copy newline symbol
res += *s++;
@@ -213,7 +213,7 @@ Common::String Lingo::codePreprocessor(const char *s, ScriptType type, uint16 id
if (*s) // copy newline symbol
res += *s++;
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "too small");
+ debugC(2, kDebugParse | kDebugPreprocess, "too small");
continue;
}
@@ -221,23 +221,23 @@ Common::String Lingo::codePreprocessor(const char *s, ScriptType type, uint16 id
tok = nexttok(line.c_str(), &lineStart);
if (tok.equals("if")) {
tok = prevtok(&line.c_str()[line.size() - 1], lineStart, &prevEnd);
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "start-if <%s>", tok.c_str());
+ debugC(2, kDebugParse | kDebugPreprocess, "start-if <%s>", tok.c_str());
if (tok.equals("if")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "end-if");
+ debugC(2, kDebugParse | kDebugPreprocess, "end-if");
tok = prevtok(prevEnd, lineStart);
if (tok.equals("end")) {
// do nothing, we open and close same line
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "end-end");
+ debugC(2, kDebugParse | kDebugPreprocess, "end-end");
} else {
iflevel++;
}
} else if (tok.equals("then")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "last-then");
+ debugC(2, kDebugParse | kDebugPreprocess, "last-then");
iflevel++;
} else if (tok.equals("else")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "last-else");
+ debugC(2, kDebugParse | kDebugPreprocess, "last-else");
iflevel++;
} else { // other token
// Now check if we have tNLELSE
@@ -252,23 +252,23 @@ Common::String Lingo::codePreprocessor(const char *s, ScriptType type, uint16 id
tok = nexttok(s1);
if (tok.equalsIgnoreCase("else")) { // ignore case because it is look-ahead
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "tNLELSE");
+ debugC(2, kDebugParse | kDebugPreprocess, "tNLELSE");
iflevel++;
} else {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "++++ end if (no nlelse after single liner)");
+ debugC(2, kDebugParse | kDebugPreprocess, "++++ end if (no nlelse after single liner)");
res += " end if";
}
}
} else if (tok.equals("else")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "start-else");
+ debugC(2, kDebugParse | kDebugPreprocess, "start-else");
bool elseif = false;
tok = nexttok(lineStart);
if (tok.equals("if")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "second-if");
+ debugC(2, kDebugParse | kDebugPreprocess, "second-if");
elseif = true;
} else if (tok.empty()) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "lonely-else");
+ debugC(2, kDebugParse | kDebugPreprocess, "lonely-else");
if (*s) // copy newline symbol
res += *s++;
@@ -277,24 +277,24 @@ Common::String Lingo::codePreprocessor(const char *s, ScriptType type, uint16 id
}
tok = prevtok(&line.c_str()[line.size() - 1], lineStart, &prevEnd);
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "last: '%s'", tok.c_str());
+ debugC(2, kDebugParse | kDebugPreprocess, "last: '%s'", tok.c_str());
if (tok.equals("if")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "end-if");
+ debugC(2, kDebugParse | kDebugPreprocess, "end-if");
tok = prevtok(prevEnd, lineStart);
if (tok.equals("end")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "end-end");
+ debugC(2, kDebugParse | kDebugPreprocess, "end-end");
iflevel--;
}
} else if (tok.equals("then")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "last-then");
+ debugC(2, kDebugParse | kDebugPreprocess, "last-then");
if (elseif == false) {
warning("Badly nested then");
}
} else if (tok.equals("else")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "last-else");
+ debugC(2, kDebugParse | kDebugPreprocess, "last-else");
if (elseif == false) {
warning("Badly nested else");
}
@@ -310,46 +310,46 @@ Common::String Lingo::codePreprocessor(const char *s, ScriptType type, uint16 id
if (tok.equalsIgnoreCase("else") && elseif) {
// Nothing to do here, same level
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "tNLELSE");
+ debugC(2, kDebugParse | kDebugPreprocess, "tNLELSE");
} else if (tok.equalsIgnoreCase("end") && elseif) {
tok = nexttok(s1);
if (tok.equalsIgnoreCase("if")) {
// Nothing to do here
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "see-end-if");
+ debugC(2, kDebugParse | kDebugPreprocess, "see-end-if");
} else {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "++++ end if (no tNLELSE 2)");
+ debugC(2, kDebugParse | kDebugPreprocess, "++++ end if (no tNLELSE 2)");
res += " end if";
iflevel--;
}
} else {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "++++ end if (no tNLELSE)");
+ debugC(2, kDebugParse | kDebugPreprocess, "++++ end if (no tNLELSE)");
res += " end if";
iflevel--;
}
}
} else if (tok.equals("end")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "start-end");
+ debugC(2, kDebugParse | kDebugPreprocess, "start-end");
tok = nexttok(lineStart);
if (tok.equals("if")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "second-if");
+ debugC(2, kDebugParse | kDebugPreprocess, "second-if");
iflevel--;
}
} else if (tok.equals("when")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "start-when");
+ debugC(2, kDebugParse | kDebugPreprocess, "start-when");
if (strstr(lineStart, "if") && strstr(lineStart, "then")) {
tok = prevtok(&line.c_str()[line.size() - 1], lineStart, &prevEnd);
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "when-start-if <%s>", tok.c_str());
+ debugC(2, kDebugParse | kDebugPreprocess, "when-start-if <%s>", tok.c_str());
if (tok.equals("if")) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "when-end-if");
+ debugC(2, kDebugParse | kDebugPreprocess, "when-end-if");
tok = prevtok(prevEnd, lineStart);
if (tok.equals("end")) {
// do nothing, we open and close same line
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "when-end-end");
+ debugC(2, kDebugParse | kDebugPreprocess, "when-end-end");
} else {
res += " end if";
}
@@ -358,7 +358,7 @@ Common::String Lingo::codePreprocessor(const char *s, ScriptType type, uint16 id
}
}
} else {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "nothing");
+ debugC(2, kDebugParse | kDebugPreprocess, "nothing");
}
if (*s) // copy newline symbol
@@ -366,14 +366,14 @@ Common::String Lingo::codePreprocessor(const char *s, ScriptType type, uint16 id
}
for (int i = 0; i < iflevel; i++) {
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "++++ end if (unclosed)");
+ debugC(2, kDebugParse | kDebugPreprocess, "++++ end if (unclosed)");
res += "\nend if";
}
// Make the parser happier when there is no newline at the end
res += '\n';
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "#############\n%s\n#############", res.c_str());
+ debugC(2, kDebugParse | kDebugPreprocess, "#############\n%s\n#############", res.c_str());
return res;
}
@@ -463,7 +463,7 @@ Common::String preprocessWhen(Common::String in, bool *changed) {
res += Common::String(beg);
if (in.size() != res.size())
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "WHEN: in: %s\nout: %s", in.c_str(), res.c_str());
+ debugC(2, kDebugParse | kDebugPreprocess, "WHEN: in: %s\nout: %s", in.c_str(), res.c_str());
return res;
}
@@ -487,7 +487,7 @@ Common::String preprocessReturn(Common::String in) {
next = nexttok(ptr + 6); // end of 'return'
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "RETURN: prevtok: %s nexttok: %s", prev.c_str(), next.c_str());
+ debugC(2, kDebugParse | kDebugPreprocess, "RETURN: prevtok: %s nexttok: %s", prev.c_str(), next.c_str());
if (prev.hasSuffix("&") || prev.hasSuffix("&&") || prev.hasSuffix("=") ||
next.hasPrefix("&") || next.hasPrefix("&&")) {
@@ -501,7 +501,7 @@ Common::String preprocessReturn(Common::String in) {
res += Common::String(beg);
if (in.size() != res.size())
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "RETURN: in: %s\nout: %s", in.c_str(), res.c_str());
+ debugC(2, kDebugParse | kDebugPreprocess, "RETURN: in: %s\nout: %s", in.c_str(), res.c_str());
return res;
}
@@ -532,7 +532,7 @@ Common::String preprocessPlay(Common::String in) {
next = nexttok(ptr, &nextPtr);
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "PLAY: nexttok: %s", next.c_str());
+ debugC(2, kDebugParse | kDebugPreprocess, "PLAY: nexttok: %s", next.c_str());
if (next.equalsIgnoreCase("done")) {
res += " #"; // Turn it into SYMBOL
@@ -548,7 +548,7 @@ Common::String preprocessPlay(Common::String in) {
res += Common::String(beg);
if (in.size() != res.size())
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "PLAY: in: %s\nout: %s", in.c_str(), res.c_str());
+ debugC(2, kDebugParse | kDebugPreprocess, "PLAY: in: %s\nout: %s", in.c_str(), res.c_str());
return res;
}
@@ -579,7 +579,7 @@ Common::String preprocessSound(Common::String in) {
next = nexttok(ptr, &nextPtr);
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "SOUND: nexttok: %s", next.c_str());
+ debugC(2, kDebugParse | kDebugPreprocess, "SOUND: nexttok: %s", next.c_str());
bool modified = false;
@@ -604,7 +604,7 @@ Common::String preprocessSound(Common::String in) {
res += Common::String(beg);
if (in.size() != res.size())
- debugC(2, kDebugLingoParse | kDebugLingoPreprocess, "SOUND: in: %s\nout: %s", in.c_str(), res.c_str());
+ debugC(2, kDebugParse | kDebugPreprocess, "SOUND: in: %s\nout: %s", in.c_str(), res.c_str());
return res;
}
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 08d3cb4e73..437a5b3544 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -252,22 +252,22 @@ const char *Lingo::findNextDefinition(const char *s) {
return NULL;
if (!scumm_strnicmp(res, "macro ", 6)) {
- debugC(1, kDebugLingoCompile, "findNextDefinition(): See 'macros ' construct");
+ debugC(1, kDebugCompile, "findNextDefinition(): See 'macros ' construct");
return res;
}
if (!scumm_strnicmp(res, "on ", 3)) {
- debugC(1, kDebugLingoCompile, "findNextDefinition(): See 'on ' construct");
+ debugC(1, kDebugCompile, "findNextDefinition(): See 'on ' construct");
return res;
}
if (!scumm_strnicmp(res, "factory ", 8)) {
- debugC(1, kDebugLingoCompile, "findNextDefinition(): See 'factory ' construct");
+ debugC(1, kDebugCompile, "findNextDefinition(): See 'factory ' construct");
return res;
}
if (!scumm_strnicmp(res, "method ", 7)) {
- debugC(1, kDebugLingoCompile, "findNextDefinition(): See 'method ' construct");
+ debugC(1, kDebugCompile, "findNextDefinition(): See 'method ' construct");
return res;
}
@@ -279,7 +279,7 @@ const char *Lingo::findNextDefinition(const char *s) {
}
void Lingo::addCode(const char *code, ScriptType type, uint16 id) {
- debugC(1, kDebugLingoCompile, "Add code for type %s(%d) with id %d\n"
+ debugC(1, kDebugCompile, "Add code for type %s(%d) with id %d\n"
"***********\n%s\n\n***********", scriptType2str(type), type, id, code);
if (getScriptContext(type, id)) {
@@ -305,7 +305,7 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) {
const char *begin, *end;
if (!strncmp(code, "menu:", 5)) {
- debugC(1, kDebugLingoCompile, "Parsing menu");
+ debugC(1, kDebugCompile, "Parsing menu");
parseMenu(code);
return;
@@ -328,25 +328,25 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) {
else
_inFactory = false;
- debugC(1, kDebugLingoCompile, "Code chunk:\n#####\n%s#####", chunk.c_str());
+ debugC(1, kDebugCompile, "Code chunk:\n#####\n%s#####", chunk.c_str());
parse(chunk.c_str());
- if (debugChannelSet(3, kDebugLingoCompile)) {
- debugC(2, kDebugLingoCompile, "<current code>");
+ if (debugChannelSet(3, kDebugCompile)) {
+ debugC(2, kDebugCompile, "<current code>");
uint pc = 0;
while (pc < _currentScript->size()) {
uint spc = pc;
Common::String instr = decodeInstruction(_currentScript, pc, &pc);
- debugC(2, kDebugLingoCompile, "[%5d] %s", spc, instr.c_str());
+ debugC(2, kDebugCompile, "[%5d] %s", spc, instr.c_str());
}
- debugC(2, kDebugLingoCompile, "<end code>");
+ debugC(2, kDebugCompile, "<end code>");
}
begin = end;
} while ((end = findNextDefinition(begin + 1)));
- debugC(1, kDebugLingoCompile, "Last code chunk:\n#####\n%s\n#####", begin);
+ debugC(1, kDebugCompile, "Last code chunk:\n#####\n%s\n#####", begin);
parse(begin);
// end of script, add a c_procret so stack frames work as expected
@@ -361,22 +361,22 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) {
_inFactory = false;
- if (debugChannelSet(3, kDebugLingoCompile)) {
+ if (debugChannelSet(3, kDebugCompile)) {
if (_currentScript->size() && !_hadError)
Common::hexdump((byte *)&_currentScript->front(), _currentScript->size() * sizeof(inst));
- debugC(2, kDebugLingoCompile, "<resulting code>");
+ debugC(2, kDebugCompile, "<resulting code>");
uint pc = 0;
while (pc < _currentScript->size()) {
uint spc = pc;
Common::String instr = decodeInstruction(_currentScript, pc, &pc);
- debugC(2, kDebugLingoCompile, "[%5d] %s", spc, instr.c_str());
+ debugC(2, kDebugCompile, "[%5d] %s", spc, instr.c_str());
}
- debugC(2, kDebugLingoCompile, "<end code>");
+ debugC(2, kDebugCompile, "<end code>");
}
// for D4 and above, there won't be any code left. all scoped methods
- // will be defined and stored by the code parser, and this function we save
+ // will be defined and stored by the code parser, and this function we save
// will be blank.
// however D3 and below allow scopeless functions!
Symbol currentFunc;
@@ -963,7 +963,7 @@ void Lingo::runTests() {
_hadError = false;
addCode(script, kMovieScript, counter);
- if (!debugChannelSet(-1, kDebugLingoCompileOnly)) {
+ if (!debugChannelSet(-1, kDebugCompileOnly)) {
if (!_hadError)
executeScript(kMovieScript, counter, 0);
else
diff --git a/engines/director/score-loading.cpp b/engines/director/score-loading.cpp
index 92aaf61e6b..1ecf0eebd0 100644
--- a/engines/director/score-loading.cpp
+++ b/engines/director/score-loading.cpp
@@ -1017,7 +1017,7 @@ void Score::loadLingoNames(Common::SeekableSubReadStreamEndian &stream) {
void Score::loadLingoContext(Common::SeekableSubReadStreamEndian &stream) {
if (_vm->getVersion() >= 4) {
- debugC(1, kDebugLingoCompile, "Add V4 script context");
+ debugC(1, kDebugCompile, "Add V4 script context");
if (debugChannelSet(5, kDebugLoading)) {
debugC(5, kDebugLoading, "Lctx header:");
More information about the Scummvm-git-logs
mailing list