[Scummvm-git-logs] scummvm master -> 7aee945999e04c54393787f1af10d9aba4c6b073
sev-
sev at scummvm.org
Fri Mar 5 18:28:24 UTC 2021
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:
7aee945999 PRIVATE: JANITORIAL: Fix indentation
Commit: 7aee945999e04c54393787f1af10d9aba4c6b073
https://github.com/scummvm/scummvm/commit/7aee945999e04c54393787f1af10d9aba4c6b073
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-05T19:27:58+01:00
Commit Message:
PRIVATE: JANITORIAL: Fix indentation
Changed paths:
engines/private/code.cpp
engines/private/cursors.cpp
engines/private/detection.cpp
engines/private/funcs.cpp
engines/private/grammar.h
engines/private/grammar.y
engines/private/lexer.l
engines/private/metaengine.cpp
engines/private/module.mk
engines/private/private.cpp
engines/private/private.h
engines/private/symbol.cpp
engines/private/symbol.h
diff --git a/engines/private/code.cpp b/engines/private/code.cpp
index 19ddcb58ad..4334f5b2c7 100644
--- a/engines/private/code.cpp
+++ b/engines/private/code.cpp
@@ -56,7 +56,7 @@ namespace Private {
Gen::VM *Gen::g_vm;
void Gen::VM::run() {
- Gen::execute(Gen::g_vm->_prog);
+ Gen::execute(Gen::g_vm->_prog);
}
namespace Settings {
@@ -67,31 +67,31 @@ SettingMaps *g_setts;
/* initialize setting for code generation */
void SettingMaps::init() {
- _setting = (Setting *)malloc(sizeof(Setting));
- memset((void *)_setting, 0, sizeof(Setting));
+ _setting = (Setting *)malloc(sizeof(Setting));
+ memset((void *)_setting, 0, sizeof(Setting));
- g_vm->_prog = (Inst *)&_setting->prog;
- g_vm->_stack = (Datum *)&_setting->stack;
+ g_vm->_prog = (Inst *)&_setting->prog;
+ g_vm->_stack = (Datum *)&_setting->stack;
- g_vm->_progp = Gen::g_vm->_prog;
- g_vm->_stackp = Gen::g_vm->_stack;
+ g_vm->_progp = Gen::g_vm->_prog;
+ g_vm->_stackp = Gen::g_vm->_stack;
}
void SettingMaps::save(const char *name) {
- _map.setVal(name, _setting);
+ _map.setVal(name, _setting);
}
void SettingMaps::load(const Common::String &name) {
- assert(_map.contains(name));
- _setting = _map.getVal(name);
+ assert(_map.contains(name));
+ _setting = _map.getVal(name);
- debugC(1, kPrivateDebugCode, "loading setting %s", name.c_str());
+ debugC(1, kPrivateDebugCode, "loading setting %s", name.c_str());
- g_vm->_prog = (Inst *)&_setting->prog;
- g_vm->_stack = (Datum *)&_setting->stack;
+ g_vm->_prog = (Inst *)&_setting->prog;
+ g_vm->_stack = (Datum *)&_setting->stack;
- g_vm->_stackp = g_vm->_stack;
- g_vm->_progp = g_vm->_prog;
+ g_vm->_stackp = g_vm->_stack;
+ g_vm->_progp = g_vm->_prog;
}
} // end of namespace Settings
@@ -100,309 +100,309 @@ namespace Gen {
/* pop and return top elem from stack */
Datum pop() {
- assert (!(g_vm->_stackp <= g_vm->_stack));
- return *--g_vm->_stackp;
+ assert (!(g_vm->_stackp <= g_vm->_stack));
+ return *--g_vm->_stackp;
}
/* push d onto stack */
int push(const Datum &d) {
- assert (!(g_vm->_stackp >= &g_vm->_stack[NSTACK]));
- *g_vm->_stackp++ = d;
- return 0;
+ assert (!(g_vm->_stackp >= &g_vm->_stack[NSTACK]));
+ *g_vm->_stackp++ = d;
+ return 0;
}
/* push constant onto stack */
int constpush() {
- Datum d;
- Symbol *s = (Symbol *)*g_vm->_pc++;
- d.type = NUM;
- d.u.val = s->u.val;
-
- debugC(1, kPrivateDebugCode, "pushing const %d with name %s", d.u.val, s->name->c_str());
- push(d);
- return 0;
+ Datum d;
+ Symbol *s = (Symbol *)*g_vm->_pc++;
+ d.type = NUM;
+ d.u.val = s->u.val;
+
+ debugC(1, kPrivateDebugCode, "pushing const %d with name %s", d.u.val, s->name->c_str());
+ push(d);
+ return 0;
}
int strpush() { /* push constant onto stack */
- Datum d;
- d.type = STRING;
- Symbol *s = (Symbol *)*g_vm->_pc++;
- d.u.str = s->u.str;
- debugC(1, kPrivateDebugCode, "pushing const %s with name %s", d.u.str, s->name->c_str());
-
- push(d);
- return 0;
+ Datum d;
+ d.type = STRING;
+ Symbol *s = (Symbol *)*g_vm->_pc++;
+ d.u.str = s->u.str;
+ debugC(1, kPrivateDebugCode, "pushing const %s with name %s", d.u.str, s->name->c_str());
+
+ push(d);
+ return 0;
}
int varpush() { /* push variable onto stack */
- Datum d;
- d.type = NAME;
- d.u.sym = (Symbol *)(*g_vm->_pc++);
- debugC(1, kPrivateDebugCode, "var pushing %s", d.u.sym->name->c_str());
- push(d);
- return 0;
+ Datum d;
+ d.type = NAME;
+ d.u.sym = (Symbol *)(*g_vm->_pc++);
+ debugC(1, kPrivateDebugCode, "var pushing %s", d.u.sym->name->c_str());
+ push(d);
+ return 0;
}
int funcpush() {
Datum s = pop();
Datum n = pop();
- ArgArray args;
+ ArgArray args;
- debugC(1, kPrivateDebugCode, "executing %s with %d params", s.u.str, n.u.val);
- for (int i = 0; i < n.u.val; i++) {
+ debugC(1, kPrivateDebugCode, "executing %s with %d params", s.u.str, n.u.val);
+ for (int i = 0; i < n.u.val; i++) {
Datum arg = pop();
- args.insert(args.begin(), arg) ;
- }
+ args.insert(args.begin(), arg) ;
+ }
- call(s.u.str, args);
- return 0;
+ call(s.u.str, args);
+ return 0;
}
/* evaluate variable on stack */
int eval() {
- Datum d = pop();
- if (d.u.sym->type == NUM) {
- d.type = NUM;
- d.u.val = d.u.sym->u.val;
- } else if (d.u.sym->type == STRING) {
- d.type = STRING;
- d.u.str = d.u.sym->u.str;
- debugC(1, kPrivateDebugCode, "eval returned %s", d.u.str );
- } else if (d.u.sym->type == RECT) {
- d.type = RECT;
- d.u.rect = d.u.sym->u.rect;
- } else if (d.u.sym->type == NAME) {
- // No evaluation until is absolutely needed
- } else
- assert(0);
-
- push(d);
- return 0;
+ Datum d = pop();
+ if (d.u.sym->type == NUM) {
+ d.type = NUM;
+ d.u.val = d.u.sym->u.val;
+ } else if (d.u.sym->type == STRING) {
+ d.type = STRING;
+ d.u.str = d.u.sym->u.str;
+ debugC(1, kPrivateDebugCode, "eval returned %s", d.u.str );
+ } else if (d.u.sym->type == RECT) {
+ d.type = RECT;
+ d.u.rect = d.u.sym->u.rect;
+ } else if (d.u.sym->type == NAME) {
+ // No evaluation until is absolutely needed
+ } else
+ assert(0);
+
+ push(d);
+ return 0;
}
/* add top two elems on stack */
int add() {
- Datum d2 = pop();
- Datum d1 = pop();
- if (d1.type == NAME) {
- d1.u.val = d1.u.sym->u.val;
- d1.type = NUM;
- }
-
- if (d2.type == NAME) {
- d2.u.val = d2.u.sym->u.val;
- d2.type = NUM;
- }
-
- assert(d1.type == NUM);
- assert(d2.type == NUM);
-
- debugC(1, kPrivateDebugCode, "adding %d %d\n", d1.u.val, d2.u.val);
- d1.u.val += d2.u.val;
- push(d1);
- return 0;
+ Datum d2 = pop();
+ Datum d1 = pop();
+ if (d1.type == NAME) {
+ d1.u.val = d1.u.sym->u.val;
+ d1.type = NUM;
+ }
+
+ if (d2.type == NAME) {
+ d2.u.val = d2.u.sym->u.val;
+ d2.type = NUM;
+ }
+
+ assert(d1.type == NUM);
+ assert(d2.type == NUM);
+
+ debugC(1, kPrivateDebugCode, "adding %d %d\n", d1.u.val, d2.u.val);
+ d1.u.val += d2.u.val;
+ push(d1);
+ return 0;
}
int negate() {
- Datum d = pop();
- int v;
- if (d.type == NAME) {
- //debug("negating %s", d.u.sym->name->c_str());
- v = d.u.sym->u.val;
- d.type = NUM;
- } else if (d.type == NUM) {
- v = d.u.val;
- } else
- assert(0);
-
- d.u.val = !v;
- push(d);
- return 0;
+ Datum d = pop();
+ int v;
+ if (d.type == NAME) {
+ //debug("negating %s", d.u.sym->name->c_str());
+ v = d.u.sym->u.val;
+ d.type = NUM;
+ } else if (d.type == NUM) {
+ v = d.u.val;
+ } else
+ assert(0);
+
+ d.u.val = !v;
+ push(d);
+ return 0;
}
int gt() {
- Datum d2 = pop();
- Datum d1 = pop();
- if (d1.type == NAME) {
- //char *name = d1.u.sym->name->c_str();
- //debug("eval %s to %d",
- d1.u.val = d1.u.sym->u.val;
- d1.type = NUM;
- }
-
- if (d2.type == NAME) {
- //char *name = d1.u.sym->name->c_str();
- //debug("eval %s to %d",
- d2.u.val = d2.u.sym->u.val;
- d2.type = NUM;
- }
-
- d1.u.val = (int)(d1.u.val > d2.u.val);
- push(d1);
- return 0;
+ Datum d2 = pop();
+ Datum d1 = pop();
+ if (d1.type == NAME) {
+ //char *name = d1.u.sym->name->c_str();
+ //debug("eval %s to %d",
+ d1.u.val = d1.u.sym->u.val;
+ d1.type = NUM;
+ }
+
+ if (d2.type == NAME) {
+ //char *name = d1.u.sym->name->c_str();
+ //debug("eval %s to %d",
+ d2.u.val = d2.u.sym->u.val;
+ d2.type = NUM;
+ }
+
+ d1.u.val = (int)(d1.u.val > d2.u.val);
+ push(d1);
+ return 0;
}
int lt() {
Datum d2 = pop();
Datum d1 = pop();
- if (d1.type == NAME) {
- //char *name = d1.u.sym->name->c_str();
- //debug("eval %s to %d",
- d1.u.val = d1.u.sym->u.val;
- d1.type = NUM;
- }
-
- if (d2.type == NAME) {
- //char *name = d1.u.sym->name->c_str();
- //debug("eval %s to %d",
- d2.u.val = d2.u.sym->u.val;
- d2.type = NUM;
- }
-
- d1.u.val = (int)(d1.u.val < d2.u.val);
- push(d1);
- return 0;
+ if (d1.type == NAME) {
+ //char *name = d1.u.sym->name->c_str();
+ //debug("eval %s to %d",
+ d1.u.val = d1.u.sym->u.val;
+ d1.type = NUM;
+ }
+
+ if (d2.type == NAME) {
+ //char *name = d1.u.sym->name->c_str();
+ //debug("eval %s to %d",
+ d2.u.val = d2.u.sym->u.val;
+ d2.type = NUM;
+ }
+
+ d1.u.val = (int)(d1.u.val < d2.u.val);
+ push(d1);
+ return 0;
}
int ge() {
Datum d2 = pop();
Datum d1 = pop();
- if (d1.type == NAME) {
- //char *name = d1.u.sym->name->c_str();
- //debug("eval %s to %d",
- d1.u.val = d1.u.sym->u.val;
- d1.type = NUM;
- }
-
- if (d2.type == NAME) {
- //char *name = d1.u.sym->name->c_str();
- //debug("eval %s to %d",
- d2.u.val = d2.u.sym->u.val;
- d2.type = NUM;
- }
-
- d1.u.val = (int)(d1.u.val >= d2.u.val);
- push(d1);
- return 0;
+ if (d1.type == NAME) {
+ //char *name = d1.u.sym->name->c_str();
+ //debug("eval %s to %d",
+ d1.u.val = d1.u.sym->u.val;
+ d1.type = NUM;
+ }
+
+ if (d2.type == NAME) {
+ //char *name = d1.u.sym->name->c_str();
+ //debug("eval %s to %d",
+ d2.u.val = d2.u.sym->u.val;
+ d2.type = NUM;
+ }
+
+ d1.u.val = (int)(d1.u.val >= d2.u.val);
+ push(d1);
+ return 0;
}
int le() {
Datum d2 = pop();
Datum d1 = pop();
- if (d1.type == NAME) {
- //char *name = d1.u.sym->name->c_str();
- //debug("eval %s to %d",
- d1.u.val = d1.u.sym->u.val;
- d1.type = NUM;
- }
-
- if (d2.type == NAME) {
- //char *name = d1.u.sym->name->c_str();
- //debug("eval %s to %d",
- d2.u.val = d2.u.sym->u.val;
- d2.type = NUM;
- }
-
- d1.u.val = (int)(d1.u.val <= d2.u.val);
- push(d1);
- return 0;
+ if (d1.type == NAME) {
+ //char *name = d1.u.sym->name->c_str();
+ //debug("eval %s to %d",
+ d1.u.val = d1.u.sym->u.val;
+ d1.type = NUM;
+ }
+
+ if (d2.type == NAME) {
+ //char *name = d1.u.sym->name->c_str();
+ //debug("eval %s to %d",
+ d2.u.val = d2.u.sym->u.val;
+ d2.type = NUM;
+ }
+
+ d1.u.val = (int)(d1.u.val <= d2.u.val);
+ push(d1);
+ return 0;
}
int eq() {
Datum d2 = pop();
Datum d1 = pop();
- if (d1.type == NAME) {
- //char *name = d1.u.sym->name->c_str();
- //debug("eval %s to %d",
- d1.u.val = d1.u.sym->u.val;
- d1.type = NUM;
- }
-
- if (d2.type == NAME) {
- //char *name = d1.u.sym->name->c_str();
- //debug("eval %s to %d",
- d2.u.val = d2.u.sym->u.val;
- d2.type = NUM;
- }
-
- d1.u.val = (int)(d1.u.val == d2.u.val);
- push(d1);
- return 0;
+ if (d1.type == NAME) {
+ //char *name = d1.u.sym->name->c_str();
+ //debug("eval %s to %d",
+ d1.u.val = d1.u.sym->u.val;
+ d1.type = NUM;
+ }
+
+ if (d2.type == NAME) {
+ //char *name = d1.u.sym->name->c_str();
+ //debug("eval %s to %d",
+ d2.u.val = d2.u.sym->u.val;
+ d2.type = NUM;
+ }
+
+ d1.u.val = (int)(d1.u.val == d2.u.val);
+ push(d1);
+ return 0;
}
int ne() {
Datum d2 = pop();
Datum d1 = pop();
- if (d1.type == NAME) {
- d1.u.val = d1.u.sym->u.val;
- d1.type = NUM;
- }
-
- if (d2.type == NAME) {
- d2.u.val = d2.u.sym->u.val;
- d2.type = NUM;
- }
-
- d1.u.val = (int)(d1.u.val != d2.u.val);
- push(d1);
- return 0;
+ if (d1.type == NAME) {
+ d1.u.val = d1.u.sym->u.val;
+ d1.type = NUM;
+ }
+
+ if (d2.type == NAME) {
+ d2.u.val = d2.u.sym->u.val;
+ d2.type = NUM;
+ }
+
+ d1.u.val = (int)(d1.u.val != d2.u.val);
+ push(d1);
+ return 0;
}
/* install one instruction or operand */
Inst *code(const Inst &f) {
- //debugC(1, kPrivateDebugCode, "pushing code at %x", progp);
- Inst *oprogp = g_vm->_progp;
- assert (!(g_vm->_progp >= &g_vm->_prog[NPROG]));
- *g_vm->_progp++ = f;
- return oprogp;
+ //debugC(1, kPrivateDebugCode, "pushing code at %x", progp);
+ Inst *oprogp = g_vm->_progp;
+ assert (!(g_vm->_progp >= &g_vm->_prog[NPROG]));
+ *g_vm->_progp++ = f;
+ return oprogp;
}
int ifcode() {
- Inst *savepc = g_vm->_pc; /* then part */
- debugC(1, kPrivateDebugCode, "ifcode: evaluating condition");
+ Inst *savepc = g_vm->_pc; /* then part */
+ debugC(1, kPrivateDebugCode, "ifcode: evaluating condition");
- execute(savepc+3); /* condition */
+ execute(savepc+3); /* condition */
Datum d = pop();
- debugC(1, kPrivateDebugCode, "ifcode: selecting branch");
-
- if (d.type == NAME) {
- debugC(1, kPrivateDebugCode, "name %s", d.u.sym->name->c_str());
- d.u.val = d.u.sym->u.val;
- }
-
- if (d.u.val) {
- debugC(1, kPrivateDebugCode, "ifcode: true branch");
- execute(*((Inst **)(savepc)));
- } else if (*((Inst **)(savepc+1))) { /* else part? */
- debugC(1, kPrivateDebugCode, "ifcode: false branch");
- execute(*((Inst **)(savepc+1)));
- }
- debugC(1, kPrivateDebugCode, "ifcode finished");
- g_vm->_pc = *((Inst **)(savepc+2)); /* next stmt */
- return 0;
+ debugC(1, kPrivateDebugCode, "ifcode: selecting branch");
+
+ if (d.type == NAME) {
+ debugC(1, kPrivateDebugCode, "name %s", d.u.sym->name->c_str());
+ d.u.val = d.u.sym->u.val;
+ }
+
+ if (d.u.val) {
+ debugC(1, kPrivateDebugCode, "ifcode: true branch");
+ execute(*((Inst **)(savepc)));
+ } else if (*((Inst **)(savepc+1))) { /* else part? */
+ debugC(1, kPrivateDebugCode, "ifcode: false branch");
+ execute(*((Inst **)(savepc+1)));
+ }
+ debugC(1, kPrivateDebugCode, "ifcode finished");
+ g_vm->_pc = *((Inst **)(savepc+2)); /* next stmt */
+ return 0;
}
int randbool() {
- Datum d = pop();
+ Datum d = pop();
- int v = g_private->getRandomBool(d.u.val);
+ int v = g_private->getRandomBool(d.u.val);
- d.u.val = v;
- push(d);
- return 0;
+ d.u.val = v;
+ push(d);
+ return 0;
}
int fail() {
- assert(0);
- return 0;
+ assert(0);
+ return 0;
}
/* run the machine */
void execute(Inst *p) {
- for (g_vm->_pc = p; *(g_vm->_pc) != STOP; ) {
- (*(*(g_vm->_pc++)))();
- }
+ for (g_vm->_pc = p; *(g_vm->_pc) != STOP; ) {
+ (*(*(g_vm->_pc++)))();
+ }
}
} // End of namespace Gen
diff --git a/engines/private/cursors.cpp b/engines/private/cursors.cpp
index 3581d4dce7..a1b380a68d 100644
--- a/engines/private/cursors.cpp
+++ b/engines/private/cursors.cpp
@@ -28,335 +28,335 @@
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1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0,0,
+ 0,0,0,0,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0,0,0,
+ 0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
static const byte cursorPalette[] = {
- 0, 0, 0, // Black / Transparent
- 0x01, 0x01, 0x01, // Gray
- 0xff, 0xff, 0xff, // White
- 0xff, 0x00, 0x00 // Red
+ 0, 0, 0, // Black / Transparent
+ 0x01, 0x01, 0x01, // Gray
+ 0xff, 0xff, 0xff, // White
+ 0xff, 0x00, 0x00 // Red
};
static struct CursorDataTable {
- const char *name;
- const byte *cursor;
+ const char *name;
+ const byte *cursor;
} cursorDataTable[] = {
- { "kExit", MOUSECURSOR_kExit},
- { "kInventory", MOUSECURSOR_kInventory},
- { "kTurnLeft", MOUSECURSOR_kTurnLeft},
- { "kTurnRight", MOUSECURSOR_kTurnRight},
- { "kZoomIn", MOUSECURSOR_kZoomIn},
- { "kZoomOut", MOUSECURSOR_kZoomOut},
- { "kPhone", MOUSECURSOR_kPhone},
- { "default", MOUSECURSOR_SCI},
- { 0, 0}
+ { "kExit", MOUSECURSOR_kExit},
+ { "kInventory", MOUSECURSOR_kInventory},
+ { "kTurnLeft", MOUSECURSOR_kTurnLeft},
+ { "kTurnRight", MOUSECURSOR_kTurnRight},
+ { "kZoomIn", MOUSECURSOR_kZoomIn},
+ { "kZoomOut", MOUSECURSOR_kZoomOut},
+ { "kPhone", MOUSECURSOR_kPhone},
+ { "default", MOUSECURSOR_SCI},
+ { 0, 0}
};
static struct CursorPointTable {
- const char *name;
- const int coord[2];
+ const char *name;
+ const int coord[2];
} cursorPointTable[] = {
- { "kExit", {9, 0} },
- { "kInventory", {15, 3} },
- { "kTurnLeft", {29, 16} },
- { "kTurnRight", {1, 15} },
- { "kZoomIn", {10, 8} },
- { "kZoomOut", {13, 31} },
- { "kPhone", {17, 19} },
- { "default", {0, 0} },
- { 0, {0, 0} }
+ { "kExit", {9, 0} },
+ { "kInventory", {15, 3} },
+ { "kTurnLeft", {29, 16} },
+ { "kTurnRight", {1, 15} },
+ { "kZoomIn", {10, 8} },
+ { "kZoomOut", {13, 31} },
+ { "kPhone", {17, 19} },
+ { "default", {0, 0} },
+ { 0, {0, 0} }
};
void PrivateEngine::initCursors() {
- for (Private::CursorDataTable *cur = Private::cursorDataTable; cur->name; cur++) {
- Common::String name(cur->name);
- _cursorData.setVal(name, cur->cursor);
- }
+ for (Private::CursorDataTable *cur = Private::cursorDataTable; cur->name; cur++) {
+ Common::String name(cur->name);
+ _cursorData.setVal(name, cur->cursor);
+ }
- for (Private::CursorPointTable *cur = Private::cursorPointTable; cur->name; cur++) {
- Common::String name(cur->name);
- Common::Point point = Common::Point(cur->coord[0], cur->coord[1]);
- _cursorPoints.setVal(name, point);
- }
- CursorMan.replaceCursorPalette(cursorPalette, 0, 3);
+ for (Private::CursorPointTable *cur = Private::cursorPointTable; cur->name; cur++) {
+ Common::String name(cur->name);
+ Common::Point point = Common::Point(cur->coord[0], cur->coord[1]);
+ _cursorPoints.setVal(name, point);
+ }
+ CursorMan.replaceCursorPalette(cursorPalette, 0, 3);
}
void PrivateEngine::changeCursor(const Common::String &cursor) {
- assert(_cursorData.contains(cursor));
- Common::Point p = _cursorPoints.getVal(cursor);
- int x, y;
+ assert(_cursorData.contains(cursor));
+ Common::Point p = _cursorPoints.getVal(cursor);
+ int x, y;
- if (cursor == "default") {
- x = 11;
- y = 16;
- } else {
- x = 32;
- y = 32;
- }
+ if (cursor == "default") {
+ x = 11;
+ y = 16;
+ } else {
+ x = 32;
+ y = 32;
+ }
- CursorMan.replaceCursor(_cursorData.getVal(cursor), x, y, p.x, p.y, 0, false);
- CursorMan.showMouse(true);
+ CursorMan.replaceCursor(_cursorData.getVal(cursor), x, y, p.x, p.y, 0, false);
+ CursorMan.showMouse(true);
}
} // End of namespace Private
diff --git a/engines/private/detection.cpp b/engines/private/detection.cpp
index 7b08060089..ea109bf376 100644
--- a/engines/private/detection.cpp
+++ b/engines/private/detection.cpp
@@ -25,140 +25,140 @@
namespace Private {
static const PlainGameDescriptor privateGames[] = {
- { "private-eye", "Private Eye" },
- { 0, 0 }
+ { "private-eye", "Private Eye" },
+ { 0, 0 }
};
static const ADGameDescription gameDescriptions[] = {
- {
- "private-eye", // US release
- 0,
- AD_ENTRY2s("pvteye.z", "b682118cda6a42fa89833cae2b8824bd", 271895,
- "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
- Common::EN_USA,
- Common::kPlatformWindows,
- ADGF_NO_FLAGS,
- GUIO1(GUIO_NOMIDI)
- },
- {
- "private-eye", // Demo from the US release
- "Demo",
- AD_ENTRY2s("pvteye.z", "af383c813157810e89d8d6d595895ff7", 263893,
- "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
- Common::EN_USA,
- Common::kPlatformWindows,
- ADGF_DEMO,
- GUIO1(GUIO_NOMIDI)
- },
- {
- "private-eye", // EU release
- 0,
- AD_ENTRY2s("pvteye.z", "d9ce391395701615e8b5d04bc4bf7ec3", 284699,
- "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
- Common::EN_GRB,
- Common::kPlatformWindows,
- ADGF_UNSUPPORTED,
- GUIO1(GUIO_NOMIDI)
- },
- {
- "private-eye", // Demo from the EU release
- "Demo",
- AD_ENTRY2s("pvteye.z", "01ca8641970189cb2ca3a96526026091", 284129,
- "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
- Common::EN_GRB,
- Common::kPlatformWindows,
- ADGF_DEMO | ADGF_UNSUPPORTED,
- GUIO1(GUIO_NOMIDI)
- },
- {
- "private-eye", // Demo from archive.org
- "Demo",
- AD_ENTRY2s("pvteye.z", "8ef908e212bb9c1e10f5e3c81f56682c", 263893,
- "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
- Common::EN_USA,
- Common::kPlatformWindows,
- ADGF_DEMO,
- GUIO1(GUIO_NOMIDI)
- },
- {
- "private-eye", // Another demo
- "Demo",
- AD_ENTRY2s("pvteye.z", "af383c813157810e89d8d6d595895ff7", 271214,
- "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
- Common::EN_USA,
- Common::kPlatformWindows,
- ADGF_DEMO,
- GUIO1(GUIO_NOMIDI)
- },
- {
- "private-eye", // EU release (ES)
- "It uses different file format for the assest",
- AD_ENTRY2s("pvteye.ex_", "f41770550ab717086b2d0c805fef4b8f", 498176,
- "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
- Common::ES_ESP,
- Common::kPlatformWindows,
- ADGF_UNSUPPORTED,
- GUIO1(GUIO_NOMIDI)
- },
- {
- "private-eye", // Demo from the EU release (ES)
- "It uses different file format for the assest",
- AD_ENTRY2s("pvtdemo.ex_", "048f751acd7a0f1a87b20d6dc5229210", 497152,
- "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
- Common::ES_ESP,
- Common::kPlatformWindows,
- ADGF_DEMO | ADGF_UNSUPPORTED,
- GUIO1(GUIO_NOMIDI)
- },
- {
- "private-eye", // EU release (FR)
- "It uses different file format for the assest",
- AD_ENTRY2s("pvteye.ex_", "ae0dec43b2f54d45c8a1c93e97092141", 600576,
- "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
- Common::FR_FRA,
- Common::kPlatformWindows,
- ADGF_UNSUPPORTED,
- GUIO1(GUIO_NOMIDI)
- },
- /*
- {
- "private-eye", // Demo from the EU release
- "Demo",
- AD_ENTRY1s("PVTEYE.Z", "", 0),
- Common::EN_GRB,
- Common::kPlatformWindows,
- ADGF_DEMO | ADGF_UNSUPPORTED,
- GUIO1(GUIO_NOMIDI)
- },
- */
- AD_TABLE_END_MARKER
+ {
+ "private-eye", // US release
+ 0,
+ AD_ENTRY2s("pvteye.z", "b682118cda6a42fa89833cae2b8824bd", 271895,
+ "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
+ Common::EN_USA,
+ Common::kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO1(GUIO_NOMIDI)
+ },
+ {
+ "private-eye", // Demo from the US release
+ "Demo",
+ AD_ENTRY2s("pvteye.z", "af383c813157810e89d8d6d595895ff7", 263893,
+ "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
+ Common::EN_USA,
+ Common::kPlatformWindows,
+ ADGF_DEMO,
+ GUIO1(GUIO_NOMIDI)
+ },
+ {
+ "private-eye", // EU release
+ 0,
+ AD_ENTRY2s("pvteye.z", "d9ce391395701615e8b5d04bc4bf7ec3", 284699,
+ "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
+ Common::EN_GRB,
+ Common::kPlatformWindows,
+ ADGF_UNSUPPORTED,
+ GUIO1(GUIO_NOMIDI)
+ },
+ {
+ "private-eye", // Demo from the EU release
+ "Demo",
+ AD_ENTRY2s("pvteye.z", "01ca8641970189cb2ca3a96526026091", 284129,
+ "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
+ Common::EN_GRB,
+ Common::kPlatformWindows,
+ ADGF_DEMO | ADGF_UNSUPPORTED,
+ GUIO1(GUIO_NOMIDI)
+ },
+ {
+ "private-eye", // Demo from archive.org
+ "Demo",
+ AD_ENTRY2s("pvteye.z", "8ef908e212bb9c1e10f5e3c81f56682c", 263893,
+ "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
+ Common::EN_USA,
+ Common::kPlatformWindows,
+ ADGF_DEMO,
+ GUIO1(GUIO_NOMIDI)
+ },
+ {
+ "private-eye", // Another demo
+ "Demo",
+ AD_ENTRY2s("pvteye.z", "af383c813157810e89d8d6d595895ff7", 271214,
+ "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
+ Common::EN_USA,
+ Common::kPlatformWindows,
+ ADGF_DEMO,
+ GUIO1(GUIO_NOMIDI)
+ },
+ {
+ "private-eye", // EU release (ES)
+ "It uses different file format for the assest",
+ AD_ENTRY2s("pvteye.ex_", "f41770550ab717086b2d0c805fef4b8f", 498176,
+ "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
+ Common::ES_ESP,
+ Common::kPlatformWindows,
+ ADGF_UNSUPPORTED,
+ GUIO1(GUIO_NOMIDI)
+ },
+ {
+ "private-eye", // Demo from the EU release (ES)
+ "It uses different file format for the assest",
+ AD_ENTRY2s("pvtdemo.ex_", "048f751acd7a0f1a87b20d6dc5229210", 497152,
+ "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
+ Common::ES_ESP,
+ Common::kPlatformWindows,
+ ADGF_DEMO | ADGF_UNSUPPORTED,
+ GUIO1(GUIO_NOMIDI)
+ },
+ {
+ "private-eye", // EU release (FR)
+ "It uses different file format for the assest",
+ AD_ENTRY2s("pvteye.ex_", "ae0dec43b2f54d45c8a1c93e97092141", 600576,
+ "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
+ Common::FR_FRA,
+ Common::kPlatformWindows,
+ ADGF_UNSUPPORTED,
+ GUIO1(GUIO_NOMIDI)
+ },
+ /*
+ {
+ "private-eye", // Demo from the EU release
+ "Demo",
+ AD_ENTRY1s("PVTEYE.Z", "", 0),
+ Common::EN_GRB,
+ Common::kPlatformWindows,
+ ADGF_DEMO | ADGF_UNSUPPORTED,
+ GUIO1(GUIO_NOMIDI)
+ },
+ */
+ AD_TABLE_END_MARKER
};
} // End of namespace Private
static const char *const directoryGlobs[] = {
- "support",
- "intro",
- 0
+ "support",
+ "intro",
+ 0
};
class PrivateMetaEngineDetection : public AdvancedMetaEngineDetection {
public:
- PrivateMetaEngineDetection() : AdvancedMetaEngineDetection(Private::gameDescriptions, sizeof(ADGameDescription), Private::privateGames) {
- _maxScanDepth = 2;
- _directoryGlobs = directoryGlobs;
- }
+ PrivateMetaEngineDetection() : AdvancedMetaEngineDetection(Private::gameDescriptions, sizeof(ADGameDescription), Private::privateGames) {
+ _maxScanDepth = 2;
+ _directoryGlobs = directoryGlobs;
+ }
- const char *getEngineId() const override {
- return "private";
- }
+ const char *getEngineId() const override {
+ return "private";
+ }
- const char *getName() const override {
- return "Private Eye";
- }
+ const char *getName() const override {
+ return "Private Eye";
+ }
- const char *getOriginalCopyright() const override {
- return "Copyright (C) Brooklyn Multimedia";
- }
+ const char *getOriginalCopyright() const override {
+ return "Copyright (C) Brooklyn Multimedia";
+ }
};
REGISTER_PLUGIN_STATIC(PRIVATE_DETECTION, PLUGIN_TYPE_ENGINE_DETECTION, PrivateMetaEngineDetection);
diff --git a/engines/private/funcs.cpp b/engines/private/funcs.cpp
index 802b901e24..b6d8a7fcc5 100644
--- a/engines/private/funcs.cpp
+++ b/engines/private/funcs.cpp
@@ -31,736 +31,736 @@
namespace Private {
static void fChgMode(ArgArray args) {
- // assert types
- assert (args.size() == 2 || args.size() == 3);
- if (args.size() == 2)
- debugC(1, kPrivateDebugScript, "ChgMode(%d, %s)", args[0].u.val, args[1].u.str);
- else if (args.size() == 3)
- debugC(1, kPrivateDebugScript, "ChgMode(%d, %s, %s)", args[0].u.val, args[1].u.str, args[2].u.sym->name->c_str());
- else
- assert(0);
-
- g_private->_mode = args[0].u.val;
- g_private->_nextSetting = args[1].u.str;
-
- if (g_private->_mode == 0) {
- g_private->_origin = Common::Point(kOriginZero[0], kOriginZero[1]);
- } else if (g_private->_mode == 1) {
- g_private->_origin = Common::Point(kOriginOne[0], kOriginOne[1]);
- } else
- assert(0);
-
- if (args.size() == 3)
- setSymbol(args[2].u.sym, true);
-
- // This is the only place where this should be used
- if (g_private->_noStopSounds) {
- g_private->_noStopSounds = false;
- } else {
- g_private->stopSound(true);
- }
+ // assert types
+ assert (args.size() == 2 || args.size() == 3);
+ if (args.size() == 2)
+ debugC(1, kPrivateDebugScript, "ChgMode(%d, %s)", args[0].u.val, args[1].u.str);
+ else if (args.size() == 3)
+ debugC(1, kPrivateDebugScript, "ChgMode(%d, %s, %s)", args[0].u.val, args[1].u.str, args[2].u.sym->name->c_str());
+ else
+ assert(0);
+
+ g_private->_mode = args[0].u.val;
+ g_private->_nextSetting = args[1].u.str;
+
+ if (g_private->_mode == 0) {
+ g_private->_origin = Common::Point(kOriginZero[0], kOriginZero[1]);
+ } else if (g_private->_mode == 1) {
+ g_private->_origin = Common::Point(kOriginOne[0], kOriginOne[1]);
+ } else
+ assert(0);
+
+ if (args.size() == 3)
+ setSymbol(args[2].u.sym, true);
+
+ // This is the only place where this should be used
+ if (g_private->_noStopSounds) {
+ g_private->_noStopSounds = false;
+ } else {
+ g_private->stopSound(true);
+ }
}
static void fVSPicture(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "VSPicture(%s)", args[0].u.str);
- g_private->_nextVS = args[0].u.str;
+ // assert types
+ debugC(1, kPrivateDebugScript, "VSPicture(%s)", args[0].u.str);
+ g_private->_nextVS = args[0].u.str;
}
static void fDiaryLocList(ArgArray args) {
- int x1, y1, x2, y2;
+ int x1, y1, x2, y2;
- debugC(1, kPrivateDebugScript, "DiaryLocList(%d, %d, %d, %d)", args[0].u.val, args[1].u.val, args[2].u.val, args[3].u.val);
+ debugC(1, kPrivateDebugScript, "DiaryLocList(%d, %d, %d, %d)", args[0].u.val, args[1].u.val, args[2].u.val, args[3].u.val);
- x2 = args[0].u.val;
- y2 = args[1].u.val;
+ x2 = args[0].u.val;
+ y2 = args[1].u.val;
- x1 = args[2].u.val;
- y1 = args[3].u.val;
+ x1 = args[2].u.val;
+ y1 = args[3].u.val;
- Common::Rect rect(x1, y1, x2, y2);
- g_private->loadLocations(rect);
+ Common::Rect rect(x1, y1, x2, y2);
+ g_private->loadLocations(rect);
}
static void fDiaryGoLoc(ArgArray args) {
- debugC(1, kPrivateDebugScript, "WARNING: DiaryGoLoc not implemented");
+ debugC(1, kPrivateDebugScript, "WARNING: DiaryGoLoc not implemented");
}
static void fDiaryInvList(ArgArray args) {
- debugC(1, kPrivateDebugScript, "DiaryInvList(%d, ..)", args[0].u.val);
+ debugC(1, kPrivateDebugScript, "DiaryInvList(%d, ..)", args[0].u.val);
const Common::Rect *r1 = args[1].u.rect;
const Common::Rect *r2 = args[2].u.rect;
- g_private->loadInventory(args[0].u.val, *r1, *r2);
+ g_private->loadInventory(args[0].u.val, *r1, *r2);
}
static void fgoto(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "goto(%s)", args[0].u.str);
- g_private->_nextSetting = args[0].u.str;
+ // assert types
+ debugC(1, kPrivateDebugScript, "goto(%s)", args[0].u.str);
+ g_private->_nextSetting = args[0].u.str;
}
static void fSyncSound(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "SyncSound(%s, %s)", args[0].u.str, args[1].u.str);
- g_private->_nextSetting = args[1].u.str;
- Common::String s = args[0].u.str;
+ // assert types
+ debugC(1, kPrivateDebugScript, "SyncSound(%s, %s)", args[0].u.str, args[1].u.str);
+ g_private->_nextSetting = args[1].u.str;
+ Common::String s = args[0].u.str;
- if (s != "\"\"") {
- g_private->playSound(s, 1, true, false);
- }
+ if (s != "\"\"") {
+ g_private->playSound(s, 1, true, false);
+ }
}
static void fQuit(ArgArray args) {
- debugC(1, kPrivateDebugScript, "Quit()");
- g_private->quitGame();
+ debugC(1, kPrivateDebugScript, "Quit()");
+ g_private->quitGame();
}
static void fLoadGame(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "LoadGame(%s, %s)", args[0].u.str, args[2].u.sym->name->c_str());
- MaskInfo m;
- m.surf = g_private->loadMask(args[0].u.str, 0, 0, true);
- m.cursor = *args[2].u.sym->name;
- m.nextSetting = "";
- m.flag1 = NULL;
- m.flag2 = NULL;
- if (g_private->_loadGameMask.surf)
- g_private->_loadGameMask.surf->free();
- delete g_private->_loadGameMask.surf;
- g_private->_loadGameMask = m;
- g_private->_masks.push_front(m);
+ // assert types
+ debugC(1, kPrivateDebugScript, "LoadGame(%s, %s)", args[0].u.str, args[2].u.sym->name->c_str());
+ MaskInfo m;
+ m.surf = g_private->loadMask(args[0].u.str, 0, 0, true);
+ m.cursor = *args[2].u.sym->name;
+ m.nextSetting = "";
+ m.flag1 = NULL;
+ m.flag2 = NULL;
+ if (g_private->_loadGameMask.surf)
+ g_private->_loadGameMask.surf->free();
+ delete g_private->_loadGameMask.surf;
+ g_private->_loadGameMask = m;
+ g_private->_masks.push_front(m);
}
static void fSaveGame(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "SaveGame(%s, %s)", args[0].u.str, args[1].u.sym->name->c_str());
+ // assert types
+ debugC(1, kPrivateDebugScript, "SaveGame(%s, %s)", args[0].u.str, args[1].u.sym->name->c_str());
MaskInfo m;
- m.surf = g_private->loadMask(args[0].u.str, 0, 0, true);
- m.cursor = *args[1].u.sym->name;
- m.nextSetting = "";
- m.flag1 = NULL;
- m.flag2 = NULL;
- if (g_private->_saveGameMask.surf)
- g_private->_saveGameMask.surf->free();
- delete g_private->_saveGameMask.surf;
- g_private->_saveGameMask = m;
- g_private->_masks.push_front(m);
+ m.surf = g_private->loadMask(args[0].u.str, 0, 0, true);
+ m.cursor = *args[1].u.sym->name;
+ m.nextSetting = "";
+ m.flag1 = NULL;
+ m.flag2 = NULL;
+ if (g_private->_saveGameMask.surf)
+ g_private->_saveGameMask.surf->free();
+ delete g_private->_saveGameMask.surf;
+ g_private->_saveGameMask = m;
+ g_private->_masks.push_front(m);
}
static void fRestartGame(ArgArray args) {
- assert(args.size() == 0);
- g_private->restartGame();
+ assert(args.size() == 0);
+ g_private->restartGame();
}
static void fPoliceBust(ArgArray args) {
- // assert types
- assert (args.size() == 1 || args.size() == 2);
- g_private->_policeBustEnabled = args[0].u.val;
- //debug("Number of clicks %d", g_private->computePoliceIndex());
-
- if (g_private->_policeBustEnabled)
- g_private->startPoliceBust();
-
- if (args.size() == 2) {
- if (args[1].u.val == 2) {
- // Unclear what it means
- } else if (args[1].u.val == 3) {
- g_private->_nextSetting = kMainDesktop;
- g_private->_mode = 0;
- g_private->_origin = Common::Point(kOriginZero[0], kOriginZero[1]);
- } else
- assert(0);
- }
- debugC(1, kPrivateDebugScript, "PoliceBust(%d, ..)", args[0].u.val);
- debugC(1, kPrivateDebugScript, "WARNING: PoliceBust partially implemented");
+ // assert types
+ assert (args.size() == 1 || args.size() == 2);
+ g_private->_policeBustEnabled = args[0].u.val;
+ //debug("Number of clicks %d", g_private->computePoliceIndex());
+
+ if (g_private->_policeBustEnabled)
+ g_private->startPoliceBust();
+
+ if (args.size() == 2) {
+ if (args[1].u.val == 2) {
+ // Unclear what it means
+ } else if (args[1].u.val == 3) {
+ g_private->_nextSetting = kMainDesktop;
+ g_private->_mode = 0;
+ g_private->_origin = Common::Point(kOriginZero[0], kOriginZero[1]);
+ } else
+ assert(0);
+ }
+ debugC(1, kPrivateDebugScript, "PoliceBust(%d, ..)", args[0].u.val);
+ debugC(1, kPrivateDebugScript, "WARNING: PoliceBust partially implemented");
}
static void fBustMovie(ArgArray args) {
- // assert types
- assert (args.size() == 1);
- debugC(1, kPrivateDebugScript, "BustMovie(%s)", args[0].u.str);
- uint policeIndex = g_private->maps.variables.getVal(kPoliceIndex)->u.val;
- int videoIndex = policeIndex/2 - 1;
- if (videoIndex < 0)
- videoIndex = 0;
- assert(videoIndex <= 5);
- Common::String pv =
- Common::String::format("po/animatio/spoc%02dxs.smk",
- kPoliceBustVideos[videoIndex]);
-
- if (kPoliceBustVideos[videoIndex] == 2) {
- Common::String s("global/transiti/audio/spoc02VO.wav");
- g_private->playSound(s, 1, false, false);
- }
-
- g_private->_nextMovie = pv;
- g_private->_nextSetting = args[0].u.str;
+ // assert types
+ assert (args.size() == 1);
+ debugC(1, kPrivateDebugScript, "BustMovie(%s)", args[0].u.str);
+ uint policeIndex = g_private->maps.variables.getVal(kPoliceIndex)->u.val;
+ int videoIndex = policeIndex/2 - 1;
+ if (videoIndex < 0)
+ videoIndex = 0;
+ assert(videoIndex <= 5);
+ Common::String pv =
+ Common::String::format("po/animatio/spoc%02dxs.smk",
+ kPoliceBustVideos[videoIndex]);
+
+ if (kPoliceBustVideos[videoIndex] == 2) {
+ Common::String s("global/transiti/audio/spoc02VO.wav");
+ g_private->playSound(s, 1, false, false);
+ }
+
+ g_private->_nextMovie = pv;
+ g_private->_nextSetting = args[0].u.str;
}
static void fDossierAdd(ArgArray args) {
- assert (args.size() == 2);
- Common::String s1 = args[0].u.str;
- Common::String s2 = args[1].u.str;
- DossierInfo m;
- m.page1 = s1;
+ assert (args.size() == 2);
+ Common::String s1 = args[0].u.str;
+ Common::String s2 = args[1].u.str;
+ DossierInfo m;
+ m.page1 = s1;
- if (s2 != "\"\"") {
- m.page2 = s2;
- } else {
- m.page2 = "";
- }
+ if (s2 != "\"\"") {
+ m.page2 = s2;
+ } else {
+ m.page2 = "";
+ }
- g_private->_dossiers.push_back(m);
+ g_private->_dossiers.push_back(m);
}
static void fDossierBitmap(ArgArray args) {
- assert (args.size() == 2);
- int x = args[0].u.val;
- int y = args[1].u.val;
- assert(x == 40 && y == 30);
- g_private->loadDossier();
+ assert (args.size() == 2);
+ int x = args[0].u.val;
+ int y = args[1].u.val;
+ assert(x == 40 && y == 30);
+ g_private->loadDossier();
}
static void fDossierChgSheet(ArgArray args) {
- debugC(1, kPrivateDebugScript, "WARNING: DossierChgSheet is not implemented");
+ debugC(1, kPrivateDebugScript, "WARNING: DossierChgSheet is not implemented");
}
static void fDossierPrevSuspect(ArgArray args) {
- assert (args.size() == 3);
- Common::String s(args[0].u.str);
+ assert (args.size() == 3);
+ Common::String s(args[0].u.str);
MaskInfo m;
- int x = args[1].u.val;
- int y = args[2].u.val;
+ int x = args[1].u.val;
+ int y = args[2].u.val;
- m.surf = g_private->loadMask(s, x, y, true);
- m.cursor = "kExit";
- m.nextSetting = "";
- m.flag1 = NULL;
- m.flag2 = NULL;
- g_private->_dossierPrevSuspectMask = m;
- g_private->_masks.push_front(m);
+ m.surf = g_private->loadMask(s, x, y, true);
+ m.cursor = "kExit";
+ m.nextSetting = "";
+ m.flag1 = NULL;
+ m.flag2 = NULL;
+ g_private->_dossierPrevSuspectMask = m;
+ g_private->_masks.push_front(m);
}
static void fDossierNextSuspect(ArgArray args) {
- assert (args.size() == 3);
- Common::String s(args[0].u.str);
- MaskInfo m;
+ assert (args.size() == 3);
+ Common::String s(args[0].u.str);
+ MaskInfo m;
- int x = args[1].u.val;
- int y = args[2].u.val;
+ int x = args[1].u.val;
+ int y = args[2].u.val;
- m.surf = g_private->loadMask(s, x, y, true);
- m.cursor = "kExit";
- m.nextSetting = "";
- m.flag1 = NULL;
- m.flag2 = NULL;
- g_private->_dossierNextSuspectMask = m;
- g_private->_masks.push_front(m);
+ m.surf = g_private->loadMask(s, x, y, true);
+ m.cursor = "kExit";
+ m.nextSetting = "";
+ m.flag1 = NULL;
+ m.flag2 = NULL;
+ g_private->_dossierNextSuspectMask = m;
+ g_private->_masks.push_front(m);
}
static void fNoStopSounds(ArgArray args) {
- assert(args.size() == 0);
- debugC(1, kPrivateDebugScript, "NoStopSounds()");
- g_private->_noStopSounds = true;
+ assert(args.size() == 0);
+ debugC(1, kPrivateDebugScript, "NoStopSounds()");
+ g_private->_noStopSounds = true;
}
static void fLoseInventory(ArgArray args) {
- assert(args.size() == 0);
- debugC(1, kPrivateDebugScript, "LoveInventory()");
- g_private->inventory.clear();
+ assert(args.size() == 0);
+ debugC(1, kPrivateDebugScript, "LoveInventory()");
+ g_private->inventory.clear();
}
static void fInventory(ArgArray args) {
- // assert types
- Datum b1 = args[0];
- Datum v1 = args[1];
- Datum v2 = args[2];
- Datum e = args[3];
- Datum i = args[4];
- Datum c = args[5];
- Datum snd = args[8];
-
- assert(v1.type == STRING || v1.type == NAME);
- assert(b1.type == STRING);
- assert(e.type == STRING || e.type == NUM);
- assert(snd.type == STRING);
- assert(i.type == STRING);
-
- Common::String bmp(i.u.str);
- assert(g_private->isDemo() || bmp != "\"\"");
-
- if (v1.type == STRING)
- assert(strcmp(v1.u.str, "\"\"") == 0);
-
- debugC(1, kPrivateDebugScript, "Inventory(...)");
- Common::String mask(b1.u.str);
- if (mask != "\"\"") {
- MaskInfo m;
- m.surf = g_private->loadMask(mask, 0, 0, true);
-
- if (e.type == NUM)
- m.nextSetting = "";
- else
- m.nextSetting = e.u.str;
-
- m.cursor = "kInventory";
- m.point = Common::Point(0,0);
-
- if (v1.type == NAME)
- m.flag1 = v1.u.sym;
- else
- m.flag1 = NULL;
-
- if (v2.type == NAME)
- m.flag2 = v2.u.sym;
- else
- m.flag2 = NULL;
-
- g_private->_masks.push_front(m);
- g_private->_toTake = true;
- Common::String sound(snd.u.str);
-
- if (sound != "\"\"") {
- g_private->playSound(sound, 1, false, false);
- } else {
- g_private->playSound(g_private->getTakeLeaveSound(), 1, false, false);
- }
-
- g_private->inventory.push_back(bmp);
- } else {
- if (v1.type == NAME) {
- if (strcmp(c.u.str, "\"REMOVE\"") == 0) {
- v1.u.sym->u.val = 0;
- g_private->inventory.remove(bmp);
- } else {
- v1.u.sym->u.val = 1;
- g_private->inventory.push_back(bmp);
- }
- } else {
- g_private->inventory.push_back(bmp);
- }
- if (v2.type == NAME)
- v2.u.sym->u.val = 1;
- }
+ // assert types
+ Datum b1 = args[0];
+ Datum v1 = args[1];
+ Datum v2 = args[2];
+ Datum e = args[3];
+ Datum i = args[4];
+ Datum c = args[5];
+ Datum snd = args[8];
+
+ assert(v1.type == STRING || v1.type == NAME);
+ assert(b1.type == STRING);
+ assert(e.type == STRING || e.type == NUM);
+ assert(snd.type == STRING);
+ assert(i.type == STRING);
+
+ Common::String bmp(i.u.str);
+ assert(g_private->isDemo() || bmp != "\"\"");
+
+ if (v1.type == STRING)
+ assert(strcmp(v1.u.str, "\"\"") == 0);
+
+ debugC(1, kPrivateDebugScript, "Inventory(...)");
+ Common::String mask(b1.u.str);
+ if (mask != "\"\"") {
+ MaskInfo m;
+ m.surf = g_private->loadMask(mask, 0, 0, true);
+
+ if (e.type == NUM)
+ m.nextSetting = "";
+ else
+ m.nextSetting = e.u.str;
+
+ m.cursor = "kInventory";
+ m.point = Common::Point(0,0);
+
+ if (v1.type == NAME)
+ m.flag1 = v1.u.sym;
+ else
+ m.flag1 = NULL;
+
+ if (v2.type == NAME)
+ m.flag2 = v2.u.sym;
+ else
+ m.flag2 = NULL;
+
+ g_private->_masks.push_front(m);
+ g_private->_toTake = true;
+ Common::String sound(snd.u.str);
+
+ if (sound != "\"\"") {
+ g_private->playSound(sound, 1, false, false);
+ } else {
+ g_private->playSound(g_private->getTakeLeaveSound(), 1, false, false);
+ }
+
+ g_private->inventory.push_back(bmp);
+ } else {
+ if (v1.type == NAME) {
+ if (strcmp(c.u.str, "\"REMOVE\"") == 0) {
+ v1.u.sym->u.val = 0;
+ g_private->inventory.remove(bmp);
+ } else {
+ v1.u.sym->u.val = 1;
+ g_private->inventory.push_back(bmp);
+ }
+ } else {
+ g_private->inventory.push_back(bmp);
+ }
+ if (v2.type == NAME)
+ v2.u.sym->u.val = 1;
+ }
}
static void fSetFlag(ArgArray args) {
- assert(args.size() == 2);
- assert(args[0].type == NAME && args[1].type == NUM);
- debugC(1, kPrivateDebugScript, "SetFlag(%s, %d)", args[0].u.sym->name->c_str(), args[1].u.val);
- args[0].u.sym->u.val = args[1].u.val;
+ assert(args.size() == 2);
+ assert(args[0].type == NAME && args[1].type == NUM);
+ debugC(1, kPrivateDebugScript, "SetFlag(%s, %d)", args[0].u.sym->name->c_str(), args[1].u.val);
+ args[0].u.sym->u.val = args[1].u.val;
}
static void fExit(ArgArray args) {
- // assert types
- assert(args[2].type == RECT || args[2].type == NAME);
- debugC(1, kPrivateDebugScript, "Exit(%d %d %d)", args[0].type, args[1].type, args[2].type); //, args[0].u.str, args[1].u.sym->name->c_str(), "RECT");
- ExitInfo e;
+ // assert types
+ assert(args[2].type == RECT || args[2].type == NAME);
+ debugC(1, kPrivateDebugScript, "Exit(%d %d %d)", args[0].type, args[1].type, args[2].type); //, args[0].u.str, args[1].u.sym->name->c_str(), "RECT");
+ ExitInfo e;
- if (args[0].type == NUM && args[0].u.val == 0)
- e.nextSetting = "";
- else
- e.nextSetting = args[0].u.str;
+ if (args[0].type == NUM && args[0].u.val == 0)
+ e.nextSetting = "";
+ else
+ e.nextSetting = args[0].u.str;
- if (args[1].type == NUM && args[1].u.val == 0)
- e.cursor = "";
- else
- e.cursor = *args[1].u.sym->name;
+ if (args[1].type == NUM && args[1].u.val == 0)
+ e.cursor = "";
+ else
+ e.cursor = *args[1].u.sym->name;
- if (args[2].type == NAME) {
- assert(args[2].u.sym->type == RECT);
- args[2].u.rect = args[2].u.sym->u.rect;
- }
+ if (args[2].type == NAME) {
+ assert(args[2].u.sym->type == RECT);
+ args[2].u.rect = args[2].u.sym->u.rect;
+ }
- e.rect = *args[2].u.rect;
- g_private->_exits.push_front(e);
+ e.rect = *args[2].u.rect;
+ g_private->_exits.push_front(e);
}
static void fSetModifiedFlag(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "SetModifiedFlag(%d)", args[0].u.val);
- g_private->_modified = args[0].u.val != 0;
+ // assert types
+ debugC(1, kPrivateDebugScript, "SetModifiedFlag(%d)", args[0].u.val);
+ g_private->_modified = args[0].u.val != 0;
}
static void fPaperShuffleSound(ArgArray args) {
- assert(args.size() == 0);
- debugC(1, kPrivateDebugScript, "PaperShuffleSound()");
- g_private->playSound(g_private->getPaperShuffleSound(), 1, false, false);
+ assert(args.size() == 0);
+ debugC(1, kPrivateDebugScript, "PaperShuffleSound()");
+ g_private->playSound(g_private->getPaperShuffleSound(), 1, false, false);
}
static void fSoundEffect(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "SoundEffect(%s)", args[0].u.str);
- Common::String s(args[0].u.str);
- if (s != "\"\"") {
- g_private->playSound(s, 1, false, false);
- } else {
- g_private->stopSound(true);
- }
+ // assert types
+ debugC(1, kPrivateDebugScript, "SoundEffect(%s)", args[0].u.str);
+ Common::String s(args[0].u.str);
+ if (s != "\"\"") {
+ g_private->playSound(s, 1, false, false);
+ } else {
+ g_private->stopSound(true);
+ }
}
static void fSound(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "Sound(%s)", args[0].u.str);
- if (args.size() == 4) {
- bool b1 = args[1].u.val != 0;
- bool b2 = args[2].u.val != 0;
- int c = args[3].u.val;
-
- if (!b1 && !b2 && c == 1) {
- g_private->stopSound(true);
- } else if (!b1 && !b2 && c == 2) {
- g_private->stopSound(false);
- } else
- assert(0);
- }
-
- Common::String s(args[0].u.str);
- if (s != "\"\"") {
- g_private->playSound(s, 1, false, false);
- } else {
- g_private->stopSound(true);
- }
+ // assert types
+ debugC(1, kPrivateDebugScript, "Sound(%s)", args[0].u.str);
+ if (args.size() == 4) {
+ bool b1 = args[1].u.val != 0;
+ bool b2 = args[2].u.val != 0;
+ int c = args[3].u.val;
+
+ if (!b1 && !b2 && c == 1) {
+ g_private->stopSound(true);
+ } else if (!b1 && !b2 && c == 2) {
+ g_private->stopSound(false);
+ } else
+ assert(0);
+ }
+
+ Common::String s(args[0].u.str);
+ if (s != "\"\"") {
+ g_private->playSound(s, 1, false, false);
+ } else {
+ g_private->stopSound(true);
+ }
}
static void fLoopedSound(ArgArray args) {
- // assert types
- assert(args.size() == 1);
- debugC(1, kPrivateDebugScript, "LoopedSound(%s)", args[0].u.str);
- Common::String s(args[0].u.str);
+ // assert types
+ assert(args.size() == 1);
+ debugC(1, kPrivateDebugScript, "LoopedSound(%s)", args[0].u.str);
+ Common::String s(args[0].u.str);
- if (s != "\"\"") {
- g_private->playSound(s, 0, true, true);
- } else {
- g_private->stopSound(true);
- }
+ if (s != "\"\"") {
+ g_private->playSound(s, 0, true, true);
+ } else {
+ g_private->stopSound(true);
+ }
}
static void fViewScreen(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "WARNING: ViewScreen not implemented!");
+ // assert types
+ debugC(1, kPrivateDebugScript, "WARNING: ViewScreen not implemented!");
}
static void fTransition(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "Transition(%s, %s)", args[0].u.str, args[1].u.str);
- g_private->_nextMovie = args[0].u.str;
- g_private->_nextSetting = args[1].u.str;
+ // assert types
+ debugC(1, kPrivateDebugScript, "Transition(%s, %s)", args[0].u.str, args[1].u.str);
+ g_private->_nextMovie = args[0].u.str;
+ g_private->_nextSetting = args[1].u.str;
}
static void fResume(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "Resume(%d)", args[0].u.val); // this value is always 1
- g_private->_nextSetting = g_private->_pausedSetting;
- g_private->_pausedSetting = "";
- g_private->_mode = 1;
- g_private->_origin = Common::Point(kOriginOne[0], kOriginOne[1]);
+ // assert types
+ debugC(1, kPrivateDebugScript, "Resume(%d)", args[0].u.val); // this value is always 1
+ g_private->_nextSetting = g_private->_pausedSetting;
+ g_private->_pausedSetting = "";
+ g_private->_mode = 1;
+ g_private->_origin = Common::Point(kOriginOne[0], kOriginOne[1]);
}
static void fMovie(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "Movie(%s, %s)", args[0].u.str, args[1].u.str);
- Common::String movie = args[0].u.str;
- Common::String nextSetting = args[1].u.str;
-
- if (!g_private->_playedMovies.contains(movie) && movie != "\"\"") {
- g_private->_nextMovie = movie;
- g_private->_playedMovies.setVal(movie, true);
- g_private->_nextSetting = nextSetting;
- } else if (movie == "\"\"") {
- g_private->_repeatedMovieExit = nextSetting;
- debugC(1, kPrivateDebugScript, "repeated movie exit is %s", nextSetting.c_str());
- } else {
- debugC(1, kPrivateDebugScript, "movie %s already played", movie.c_str());
- g_private->_nextSetting = g_private->_repeatedMovieExit;
- }
+ // assert types
+ debugC(1, kPrivateDebugScript, "Movie(%s, %s)", args[0].u.str, args[1].u.str);
+ Common::String movie = args[0].u.str;
+ Common::String nextSetting = args[1].u.str;
+
+ if (!g_private->_playedMovies.contains(movie) && movie != "\"\"") {
+ g_private->_nextMovie = movie;
+ g_private->_playedMovies.setVal(movie, true);
+ g_private->_nextSetting = nextSetting;
+ } else if (movie == "\"\"") {
+ g_private->_repeatedMovieExit = nextSetting;
+ debugC(1, kPrivateDebugScript, "repeated movie exit is %s", nextSetting.c_str());
+ } else {
+ debugC(1, kPrivateDebugScript, "movie %s already played", movie.c_str());
+ g_private->_nextSetting = g_private->_repeatedMovieExit;
+ }
}
static void fCRect(ArgArray args) {
- // assert types
- debugC(1, kPrivateDebugScript, "CRect(%d, %d, %d, %d)", args[0].u.val, args[1].u.val, args[2].u.val, args[3].u.val);
- int x1, y1, x2, y2;
- x1 = args[0].u.val;
- y1 = args[1].u.val;
- x2 = args[2].u.val;
- y2 = args[3].u.val;
+ // assert types
+ debugC(1, kPrivateDebugScript, "CRect(%d, %d, %d, %d)", args[0].u.val, args[1].u.val, args[2].u.val, args[3].u.val);
+ int x1, y1, x2, y2;
+ x1 = args[0].u.val;
+ y1 = args[1].u.val;
+ x2 = args[2].u.val;
+ y2 = args[3].u.val;
- Datum *d = new Datum();
- Common::Rect *rect = new Common::Rect(x1, y1, x2, y2);
- d->type = RECT;
- d->u.rect = rect;
- Gen::push(*d);
+ Datum *d = new Datum();
+ Common::Rect *rect = new Common::Rect(x1, y1, x2, y2);
+ d->type = RECT;
+ d->u.rect = rect;
+ Gen::push(*d);
}
static void fBitmap(ArgArray args) {
- assert(args.size() == 1 || args.size() == 3);
+ assert(args.size() == 1 || args.size() == 3);
- int x = 0;
- int y = 0;
+ int x = 0;
+ int y = 0;
- const char *f = args[0].u.str;
- if (args.size() == 3) {
- x = args[1].u.val;
- y = args[2].u.val;
- }
+ const char *f = args[0].u.str;
+ if (args.size() == 3) {
+ x = args[1].u.val;
+ y = args[2].u.val;
+ }
- debugC(1, kPrivateDebugScript, "Bitmap(%s, %d, %d)", f, x, y);
- Common::String s(args[0].u.str);
- g_private->loadImage(s, x, y);
+ debugC(1, kPrivateDebugScript, "Bitmap(%s, %d, %d)", f, x, y);
+ Common::String s(args[0].u.str);
+ g_private->loadImage(s, x, y);
}
static void _fMask(ArgArray args, bool drawn) {
- assert(args.size() == 3 || args.size() == 5);
+ assert(args.size() == 3 || args.size() == 5);
- int x = 0;
- int y = 0;
- const char *f = args[0].u.str;
- const char *e = args[1].u.str;
- Common::String *c = args[2].u.sym->name;
+ int x = 0;
+ int y = 0;
+ const char *f = args[0].u.str;
+ const char *e = args[1].u.str;
+ Common::String *c = args[2].u.sym->name;
- if (args.size() == 5) {
- x = args[3].u.val;
- y = args[4].u.val;
- }
+ if (args.size() == 5) {
+ x = args[3].u.val;
+ y = args[4].u.val;
+ }
- debugC(1, kPrivateDebugScript, "Mask(%s, %s, %s, %d, %d)", f, e, c->c_str(), x, y);
- const Common::String s(f);
+ debugC(1, kPrivateDebugScript, "Mask(%s, %s, %s, %d, %d)", f, e, c->c_str(), x, y);
+ const Common::String s(f);
- MaskInfo m;
- m.surf = g_private->loadMask(s, x, y, drawn);
- m.nextSetting = e;
- m.cursor = *c;
- m.flag1 = NULL;
- m.flag2 = NULL;
- m.point = Common::Point(x,y);
- g_private->_masks.push_front(m);
+ MaskInfo m;
+ m.surf = g_private->loadMask(s, x, y, drawn);
+ m.nextSetting = e;
+ m.cursor = *c;
+ m.flag1 = NULL;
+ m.flag2 = NULL;
+ m.point = Common::Point(x,y);
+ g_private->_masks.push_front(m);
}
static void fMask(ArgArray args) {
- _fMask(args, false);
+ _fMask(args, false);
}
static void fMaskDrawn(ArgArray args) {
- _fMask(args, true);
+ _fMask(args, true);
}
static void fAddSound(Common::String sound, const char *t, Symbol *flag = NULL, int val = 0) {
- if (sound == "\"\"")
- return;
-
- if (strcmp(t, "AMRadioClip") == 0)
- g_private->_AMRadio.push_back(sound);
- else if (strcmp(t, "PoliceClip") == 0)
- g_private->_policeRadio.push_back(sound);
- else if (strcmp(t, "PhoneClip") == 0) {
- // This condition will avoid adding the same phone call twice,
- // it is unclear why this could be useful, but it looks like a bug
- // in the original scripts
- if (g_private->_playedPhoneClips.contains(sound))
- return;
-
- g_private->_playedPhoneClips.setVal(sound, true);
- PhoneInfo p;
- p.sound = sound;
- p.flag = flag;
- p.val = val;
- g_private->_phone.push_back(p);
- } else
- error("error: invalid sound type %s", t);
+ if (sound == "\"\"")
+ return;
+
+ if (strcmp(t, "AMRadioClip") == 0)
+ g_private->_AMRadio.push_back(sound);
+ else if (strcmp(t, "PoliceClip") == 0)
+ g_private->_policeRadio.push_back(sound);
+ else if (strcmp(t, "PhoneClip") == 0) {
+ // This condition will avoid adding the same phone call twice,
+ // it is unclear why this could be useful, but it looks like a bug
+ // in the original scripts
+ if (g_private->_playedPhoneClips.contains(sound))
+ return;
+
+ g_private->_playedPhoneClips.setVal(sound, true);
+ PhoneInfo p;
+ p.sound = sound;
+ p.flag = flag;
+ p.val = val;
+ g_private->_phone.push_back(p);
+ } else
+ error("error: invalid sound type %s", t);
}
static void fAMRadioClip(ArgArray args) {
- assert(args.size() <= 4);
- fAddSound(args[0].u.str, "AMRadioClip");
+ assert(args.size() <= 4);
+ fAddSound(args[0].u.str, "AMRadioClip");
}
static void fPoliceClip(ArgArray args) {
- assert(args.size() <= 4);
- fAddSound(args[0].u.str, "PoliceClip");
+ assert(args.size() <= 4);
+ fAddSound(args[0].u.str, "PoliceClip");
}
static void fPhoneClip(ArgArray args) {
- if (args.size() == 2) {
- debugC(1, kPrivateDebugScript, "Unimplemented PhoneClip special case");
- return;
- }
- int i = args[2].u.val;
- int j = args[3].u.val;
-
- if (i == j)
- fAddSound(args[0].u.str, "PhoneClip", args[4].u.sym, args[5].u.val);
- else {
- assert(i < j);
- Common::String sound = g_private->getRandomPhoneClip(args[0].u.str, i, j);
- fAddSound(sound, "PhoneClip", args[4].u.sym, args[5].u.val);
- }
+ if (args.size() == 2) {
+ debugC(1, kPrivateDebugScript, "Unimplemented PhoneClip special case");
+ return;
+ }
+ int i = args[2].u.val;
+ int j = args[3].u.val;
+
+ if (i == j)
+ fAddSound(args[0].u.str, "PhoneClip", args[4].u.sym, args[5].u.val);
+ else {
+ assert(i < j);
+ Common::String sound = g_private->getRandomPhoneClip(args[0].u.str, i, j);
+ fAddSound(sound, "PhoneClip", args[4].u.sym, args[5].u.val);
+ }
}
static void fSoundArea(ArgArray args) {
- // assert types
- //char *n;
- Common::String n;
- if (args[1].type == NAME)
- n = *(args[1].u.sym->name);
- else if (args[1].type == STRING)
- n = Common::String(args[1].u.str);
- else
- error("Invalid input for SoundArea");
-
- debugC(1, kPrivateDebugScript, "SoundArea(%s, %s, ..)", args[0].u.str, n.c_str());
- Common::String s = args[0].u.str;
- MaskInfo m;
- if (n == "kAMRadio") {
- m.surf = g_private->loadMask(s, 0, 0, true);
- m.cursor = *args[2].u.sym->name;
- m.nextSetting = "";
- m.flag1 = NULL;
- m.flag2 = NULL;
- if (g_private->_AMRadioArea.surf)
- g_private->_AMRadioArea.surf->free();
- delete g_private->_AMRadioArea.surf;
- g_private->_AMRadioArea = m;
- g_private->_masks.push_front(m);
- } else if (n == "kPoliceRadio") {
- m.surf = g_private->loadMask(s, 0, 0, true);
- m.cursor = *args[2].u.sym->name;
- m.nextSetting = "";
- m.flag1 = NULL;
- m.flag2 = NULL;
- if (g_private->_policeRadioArea.surf)
- g_private->_policeRadioArea.surf->free();
- delete g_private->_policeRadioArea.surf;
- g_private->_policeRadioArea = m;
- g_private->_masks.push_front(m);
- } else if (n == "kPhone") {
- m.surf = g_private->loadMask(s, 0, 0, true);
- m.cursor = *args[2].u.sym->name;
- m.nextSetting = "";
- m.flag1 = NULL;
- m.flag2 = NULL;
- if (g_private->_phoneArea.surf)
- g_private->_phoneArea.surf->free();
- delete g_private->_phoneArea.surf;
- g_private->_phoneArea = m;
- g_private->_masks.push_front(m);
- }
+ // assert types
+ //char *n;
+ Common::String n;
+ if (args[1].type == NAME)
+ n = *(args[1].u.sym->name);
+ else if (args[1].type == STRING)
+ n = Common::String(args[1].u.str);
+ else
+ error("Invalid input for SoundArea");
+
+ debugC(1, kPrivateDebugScript, "SoundArea(%s, %s, ..)", args[0].u.str, n.c_str());
+ Common::String s = args[0].u.str;
+ MaskInfo m;
+ if (n == "kAMRadio") {
+ m.surf = g_private->loadMask(s, 0, 0, true);
+ m.cursor = *args[2].u.sym->name;
+ m.nextSetting = "";
+ m.flag1 = NULL;
+ m.flag2 = NULL;
+ if (g_private->_AMRadioArea.surf)
+ g_private->_AMRadioArea.surf->free();
+ delete g_private->_AMRadioArea.surf;
+ g_private->_AMRadioArea = m;
+ g_private->_masks.push_front(m);
+ } else if (n == "kPoliceRadio") {
+ m.surf = g_private->loadMask(s, 0, 0, true);
+ m.cursor = *args[2].u.sym->name;
+ m.nextSetting = "";
+ m.flag1 = NULL;
+ m.flag2 = NULL;
+ if (g_private->_policeRadioArea.surf)
+ g_private->_policeRadioArea.surf->free();
+ delete g_private->_policeRadioArea.surf;
+ g_private->_policeRadioArea = m;
+ g_private->_masks.push_front(m);
+ } else if (n == "kPhone") {
+ m.surf = g_private->loadMask(s, 0, 0, true);
+ m.cursor = *args[2].u.sym->name;
+ m.nextSetting = "";
+ m.flag1 = NULL;
+ m.flag2 = NULL;
+ if (g_private->_phoneArea.surf)
+ g_private->_phoneArea.surf->free();
+ delete g_private->_phoneArea.surf;
+ g_private->_phoneArea = m;
+ g_private->_masks.push_front(m);
+ }
}
static void fSafeDigit(ArgArray args) {
- debugC(1, kPrivateDebugScript, "WARNING: SafeDigit is not implemented");
+ debugC(1, kPrivateDebugScript, "WARNING: SafeDigit is not implemented");
}
static void fAskSave(ArgArray args) {
- // This is not needed, since scummvm will take care of this
- debugC(1, kPrivateDebugScript, "WARNING: AskSave is partially implemented");
- g_private->_nextSetting = args[0].u.str;
+ // This is not needed, since scummvm will take care of this
+ debugC(1, kPrivateDebugScript, "WARNING: AskSave is partially implemented");
+ g_private->_nextSetting = args[0].u.str;
}
static void fTimer(ArgArray args) {
- assert (args.size() == 2 || args.size() == 3);
+ assert (args.size() == 2 || args.size() == 3);
- if (args.size() == 3)
- debugC(1, kPrivateDebugScript, "Timer(%d, %s, %s)", args[0].u.val, args[1].u.str, args[2].u.str);
- else
- debugC(1, kPrivateDebugScript, "Timer(%d, %s)", args[0].u.val, args[1].u.str);
+ if (args.size() == 3)
+ debugC(1, kPrivateDebugScript, "Timer(%d, %s, %s)", args[0].u.val, args[1].u.str, args[2].u.str);
+ else
+ debugC(1, kPrivateDebugScript, "Timer(%d, %s)", args[0].u.val, args[1].u.str);
- int32 delay = 1000000 * args[0].u.val;
- // This pointer is necessary since installTimer needs one
- Common::String *s = new Common::String(args[1].u.str);
- if (delay > 0) {
- assert(g_private->installTimer(delay, s));
- } else if (delay == 0) {
- g_private->_nextSetting = *s;
- } else {
- assert(0);
- }
+ int32 delay = 1000000 * args[0].u.val;
+ // This pointer is necessary since installTimer needs one
+ Common::String *s = new Common::String(args[1].u.str);
+ if (delay > 0) {
+ assert(g_private->installTimer(delay, s));
+ } else if (delay == 0) {
+ g_private->_nextSetting = *s;
+ } else {
+ assert(0);
+ }
}
const FuncTable funcTable[] = {
- // Control flow
- { fChgMode, "ChgMode"},
- { fResume, "Resume"},
- { fgoto, "goto"},
- { fTimer, "Timer"},
-
- // Variables
- { fSetFlag, "SetFlag"},
- { fSetModifiedFlag, "SetModifiedFlag"},
-
- // Sounds
- { fSound, "Sound"},
- { fSoundEffect, "SoundEffect"},
- { fLoopedSound, "LoopedSound"},
- { fNoStopSounds, "NoStopSounds"},
- { fSyncSound, "SyncSound"},
- { fAMRadioClip, "AMRadioClip"},
- { fPoliceClip, "PoliceClip"},
- { fPhoneClip, "PhoneClip"},
- { fSoundArea, "SoundArea"},
- { fPaperShuffleSound, "PaperShuffleSound"},
-
- // Images
- { fBitmap, "Bitmap"},
- { fMask, "Mask"},
- { fMaskDrawn, "MaskDrawn"},
- { fVSPicture, "VSPicture"},
- { fViewScreen, "ViewScreen"},
- { fExit, "Exit"},
-
- // Video
- { fTransition, "Transition"},
- { fMovie, "Movie"},
-
- // Diary
- { fDiaryLocList, "DiaryLocList"},
- { fDiaryInvList, "DiaryInvList"},
- { fDiaryGoLoc, "DiaryGoLoc"},
-
- // Main menu
- { fQuit, "Quit"},
- { fLoadGame, "LoadGame"},
- { fSaveGame, "SaveGame"},
- { fAskSave, "AskSave"},
- { fRestartGame, "RestartGame"},
-
- // Dossiers
- { fDossierAdd, "DossierAdd"},
- { fDossierChgSheet, "DossierChgSheet"},
- { fDossierBitmap, "DossierBitmap"},
- { fDossierPrevSuspect, "DossierPrevSuspect"},
- { fDossierNextSuspect, "DossierNextSuspect"},
-
- // Inventory
- { fLoseInventory, "LoseInventory"},
- { fInventory, "Inventory"},
-
- // PoliceBust
- { fPoliceBust, "PoliceBust"},
- { fBustMovie, "BustMovie"},
-
- // Others
- { fSafeDigit, "SafeDigit"},
- { fCRect, "CRect"},
-
- { 0, 0}
+ // Control flow
+ { fChgMode, "ChgMode"},
+ { fResume, "Resume"},
+ { fgoto, "goto"},
+ { fTimer, "Timer"},
+
+ // Variables
+ { fSetFlag, "SetFlag"},
+ { fSetModifiedFlag, "SetModifiedFlag"},
+
+ // Sounds
+ { fSound, "Sound"},
+ { fSoundEffect, "SoundEffect"},
+ { fLoopedSound, "LoopedSound"},
+ { fNoStopSounds, "NoStopSounds"},
+ { fSyncSound, "SyncSound"},
+ { fAMRadioClip, "AMRadioClip"},
+ { fPoliceClip, "PoliceClip"},
+ { fPhoneClip, "PhoneClip"},
+ { fSoundArea, "SoundArea"},
+ { fPaperShuffleSound, "PaperShuffleSound"},
+
+ // Images
+ { fBitmap, "Bitmap"},
+ { fMask, "Mask"},
+ { fMaskDrawn, "MaskDrawn"},
+ { fVSPicture, "VSPicture"},
+ { fViewScreen, "ViewScreen"},
+ { fExit, "Exit"},
+
+ // Video
+ { fTransition, "Transition"},
+ { fMovie, "Movie"},
+
+ // Diary
+ { fDiaryLocList, "DiaryLocList"},
+ { fDiaryInvList, "DiaryInvList"},
+ { fDiaryGoLoc, "DiaryGoLoc"},
+
+ // Main menu
+ { fQuit, "Quit"},
+ { fLoadGame, "LoadGame"},
+ { fSaveGame, "SaveGame"},
+ { fAskSave, "AskSave"},
+ { fRestartGame, "RestartGame"},
+
+ // Dossiers
+ { fDossierAdd, "DossierAdd"},
+ { fDossierChgSheet, "DossierChgSheet"},
+ { fDossierBitmap, "DossierBitmap"},
+ { fDossierPrevSuspect, "DossierPrevSuspect"},
+ { fDossierNextSuspect, "DossierNextSuspect"},
+
+ // Inventory
+ { fLoseInventory, "LoseInventory"},
+ { fInventory, "Inventory"},
+
+ // PoliceBust
+ { fPoliceBust, "PoliceBust"},
+ { fBustMovie, "BustMovie"},
+
+ // Others
+ { fSafeDigit, "SafeDigit"},
+ { fCRect, "CRect"},
+
+ { 0, 0}
};
void call(const char *name, const ArgArray &args) {
- Common::String n(name);
- if (!g_private->_functions.contains(n)) {
- error("I don't know how to execute %s", name);
- }
+ Common::String n(name);
+ if (!g_private->_functions.contains(n)) {
+ error("I don't know how to execute %s", name);
+ }
- void (*func)(ArgArray) = (void (*)(ArgArray)) g_private->_functions.getVal(n);
- func(args);
+ void (*func)(ArgArray) = (void (*)(ArgArray)) g_private->_functions.getVal(n);
+ func(args);
}
} // End of namespace Private
diff --git a/engines/private/grammar.h b/engines/private/grammar.h
index 2bed773995..7840572543 100644
--- a/engines/private/grammar.h
+++ b/engines/private/grammar.h
@@ -39,22 +39,22 @@
namespace Private {
typedef struct Datum { /* interpreter stack type */
- short type;
- union {
- int val;
- const char *str;
- Symbol *sym;
- Common::Rect *rect;
- } u;
+ short type;
+ union {
+ int val;
+ const char *str;
+ Symbol *sym;
+ Common::Rect *rect;
+ } u;
} Datum;
typedef struct Arg {
- int n;
- int (** inst)();
+ int n;
+ int (** inst)();
} Arg;
typedef int (* Inst)(); /* machine instruction */
-#define STOP (Inst) 0
+#define STOP (Inst) 0
typedef Common::HashMap<void *, Common::String *> PtrToName;
@@ -64,20 +64,20 @@ void initFuncs();
namespace Settings {
typedef struct Setting {
- Datum stack[NSTACK]; /* the stack */
- Inst prog[NPROG]; /* the machine */
+ Datum stack[NSTACK]; /* the stack */
+ Inst prog[NPROG]; /* the machine */
} Setting;
typedef Common::HashMap<Common::String, Setting *> SettingMap;
class SettingMaps {
public:
- Setting *_setting;
- SettingMap _map;
+ Setting *_setting;
+ SettingMap _map;
- void init();
- void save(const char *);
- void load(const Common::String &);
+ void init();
+ void save(const char *);
+ void load(const Common::String &);
};
extern SettingMaps *g_setts;
@@ -95,13 +95,13 @@ namespace Gen {
class VM {
public:
- Datum *_stack; /* the stack */
- Datum *_stackp; /* next free spot on stack */
+ Datum *_stack; /* the stack */
+ Datum *_stackp; /* next free spot on stack */
- Inst *_progp; /* next free spot for code generation */
- Inst *_prog; /* the machine */
- Inst *_pc; /* program counter during execution */
- void run(); /* run the virtual machine */
+ Inst *_progp; /* next free spot for code generation */
+ Inst *_prog; /* the machine */
+ Inst *_pc; /* program counter during execution */
+ void run(); /* run the virtual machine */
};
extern VM *g_vm;
diff --git a/engines/private/grammar.y b/engines/private/grammar.y
index 0768c6881c..eb10cd154d 100644
--- a/engines/private/grammar.y
+++ b/engines/private/grammar.y
@@ -54,7 +54,7 @@
#include "private/grammar.h"
#undef yyerror
-#define yyerror PRIVATE_xerror
+#define yyerror PRIVATE_xerror
#define code1(c1) code(c1);
#define code2(c1,c2) code(c1); code(c2)
@@ -78,17 +78,17 @@ int PRIVATE_wrap() {
%}
%union {
- Private::Symbol *sym; /* symbol table pointer */
- int (**inst)(); /* machine instruction */
- char *s; /* string value */
- int *i; /* integer value */
- int narg; /* auxiliary value to count function arguments */
+ Private::Symbol *sym; /* symbol table pointer */
+ int (**inst)(); /* machine instruction */
+ char *s; /* string value */
+ int *i; /* integer value */
+ int narg; /* auxiliary value to count function arguments */
}
%token<s> NAME
%token<sym> STRING NUM
%type <inst> body if startp cond end expr statements statement fcall value
-%token LTE GTE NEQ EQ FALSETOK TRUETOK NULLTOK IFTOK ELSETOK RECT GOTOTOK DEBUGTOK DEFINETOK SETTINGTOK RANDOMTOK
+%token LTE GTE NEQ EQ FALSETOK TRUETOK NULLTOK IFTOK ELSETOK RECT GOTOTOK DEBUGTOK DEFINETOK SETTINGTOK RANDOMTOK
%type<narg> params
%%
@@ -97,112 +97,112 @@ lines: line lines
| line
;
-line: DEBUGTOK '{' debug '}' { /* Not used in the game */ }
- | DEFINETOK NAME '{' define '}' { g_private->maps.installAll($NAME); }
- | SETTINGTOK NAME '{' statements '}' { g_setts->save($NAME);
- g_setts->init(); }
- ;
+line: DEBUGTOK '{' debug '}' { /* Not used in the game */ }
+ | DEFINETOK NAME '{' define '}' { g_private->maps.installAll($NAME); }
+ | SETTINGTOK NAME '{' statements '}' { g_setts->save($NAME);
+ g_setts->init(); }
+ ;
debug: /* nothing */
- | NAME ',' debug
- ;
+ | NAME ',' debug
+ ;
statements: /* nothing */ { $$ = g_vm->_progp; }
- | statement statements
+ | statement statements
statement: GOTOTOK NAME ';' {
- $$ = g_vm->_progp;
- code2(strpush, (Inst) g_private->maps.constant(STRING, 0, $NAME));
- code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL));
- code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto"));
- code1(funcpush);
- }
- | fcall ';' { $$ = $1; }
- | if cond body end {
- /* else-less if */
- ($1)[1] = (Inst)$3; /* thenpart */
- ($1)[3] = (Inst)$4;
- } /* end, if cond fails */
- | if cond body end ELSETOK body end {
- /* if with else */
- ($1)[1] = (Inst)$3; /* thenpart */
- ($1)[2] = (Inst)$6; /* elsepart */
- ($1)[3] = (Inst)$7;
- } /* end, if cond fails */
- ;
-
-body: statement { $$ = $1; }
- | '{' statements '}' { $$ = $2; }
- ;
+ $$ = g_vm->_progp;
+ code2(strpush, (Inst) g_private->maps.constant(STRING, 0, $NAME));
+ code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL));
+ code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto"));
+ code1(funcpush);
+ }
+ | fcall ';' { $$ = $1; }
+ | if cond body end {
+ /* else-less if */
+ ($1)[1] = (Inst)$3; /* thenpart */
+ ($1)[3] = (Inst)$4;
+ } /* end, if cond fails */
+ | if cond body end ELSETOK body end {
+ /* if with else */
+ ($1)[1] = (Inst)$3; /* thenpart */
+ ($1)[2] = (Inst)$6; /* elsepart */
+ ($1)[3] = (Inst)$7;
+ } /* end, if cond fails */
+ ;
+
+body: statement { $$ = $1; }
+ | '{' statements '}' { $$ = $2; }
+ ;
end: /* nothing */ { code1(STOP); $$ = g_vm->_progp; }
- ;
+ ;
if: IFTOK { $$ = code1(ifcode); code3(STOP, STOP, STOP); }
- ;
+ ;
cond: '(' expr ')' { code1(STOP); $$ = $2; }
- ;
+ ;
define: /* nothing */
- | NAME ',' RECT '(' NUM ',' NUM ',' NUM ',' NUM ')' ',' define {
- Common::Rect *r = new Common::Rect($5->u.val, $7->u.val, $9->u.val, $11->u.val);
- assert(r->isValidRect());
- g_private->maps.defineSymbol($NAME, r);
- }
- | NAME ',' RECT '(' NUM ',' NUM ',' NUM ',' NUM ')' {
- Common::Rect *r = new Common::Rect($5->u.val, $7->u.val, $9->u.val, $11->u.val);
- g_private->maps.defineSymbol($NAME, r);
- }
- | NAME ',' define { g_private->maps.defineSymbol($NAME, NULL); }
- | NAME { g_private->maps.defineSymbol($NAME, NULL); }
- ;
+ | NAME ',' RECT '(' NUM ',' NUM ',' NUM ',' NUM ')' ',' define {
+ Common::Rect *r = new Common::Rect($5->u.val, $7->u.val, $9->u.val, $11->u.val);
+ assert(r->isValidRect());
+ g_private->maps.defineSymbol($NAME, r);
+ }
+ | NAME ',' RECT '(' NUM ',' NUM ',' NUM ',' NUM ')' {
+ Common::Rect *r = new Common::Rect($5->u.val, $7->u.val, $9->u.val, $11->u.val);
+ g_private->maps.defineSymbol($NAME, r);
+ }
+ | NAME ',' define { g_private->maps.defineSymbol($NAME, NULL); }
+ | NAME { g_private->maps.defineSymbol($NAME, NULL); }
+ ;
fcall: GOTOTOK '(' NAME ')' {
- $$ = g_vm->_progp;
- code2(strpush, (Inst) g_private->maps.constant(STRING, 0, $NAME));
- code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL));
- code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto"));
- code1(funcpush);
- }
-
- | RECT '(' NUM ',' NUM ',' NUM ',' NUM ')' { $$ = g_vm->_progp; }
- | NAME '(' startp params ')' {
- $$ = $startp;
- code2(constpush, (Inst) g_private->maps.constant(NUM, $params, NULL));
- code2(strpush, (Inst) g_private->maps.constant(STRING, 0, $NAME));
- code1(funcpush);
- }
- ;
+ $$ = g_vm->_progp;
+ code2(strpush, (Inst) g_private->maps.constant(STRING, 0, $NAME));
+ code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL));
+ code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto"));
+ code1(funcpush);
+ }
+
+ | RECT '(' NUM ',' NUM ',' NUM ',' NUM ')' { $$ = g_vm->_progp; }
+ | NAME '(' startp params ')' {
+ $$ = $startp;
+ code2(constpush, (Inst) g_private->maps.constant(NUM, $params, NULL));
+ code2(strpush, (Inst) g_private->maps.constant(STRING, 0, $NAME));
+ code1(funcpush);
+ }
+ ;
startp: /*nothing*/ { $$ = g_vm->_progp; }
- ;
+ ;
params: /* nothing */ { $$ = 0; }
- | fcall ',' params { $$ = $3 + 1; }
- | expr ',' params { $$ = $3 + 1; }
- | expr { $$ = 1; }
- | fcall { $$ = 1; }
- ;
+ | fcall ',' params { $$ = $3 + 1; }
+ | expr ',' params { $$ = $3 + 1; }
+ | expr { $$ = 1; }
+ | fcall { $$ = 1; }
+ ;
value: NULLTOK { code2(constpush, (Inst) g_private->maps.constant(NUM, 0, NULL)); }
- | FALSETOK { code2(constpush, (Inst) g_private->maps.constant(NUM, 0, NULL)); }
- | TRUETOK { code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL)); }
- | NUM { code2(constpush, (Inst)$NUM); }
- | STRING { code2(strpush, (Inst)$STRING); }
- | NAME { code1(varpush); code1((Inst) g_private->maps.lookupName($NAME)); code1(eval); }
- ;
-
-expr: value { $$ = $1; }
- | '!' value { code1(negate); $$ = $2; }
- | value EQ value { code1(eq); }
- | value NEQ value { code1(ne); }
- | value '+' value { code1(add); }
- | value '<' value { code1(lt); }
- | value '>' value { code1(gt); }
- | value LTE value { code1(le); }
- | value GTE value { code1(ge); }
- | value '+' { $$ = $1; } // unclear what it should do
- | RANDOMTOK '(' NUM '%' ')' { code3(constpush, (Inst)$NUM, randbool); }
- ;
+ | FALSETOK { code2(constpush, (Inst) g_private->maps.constant(NUM, 0, NULL)); }
+ | TRUETOK { code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL)); }
+ | NUM { code2(constpush, (Inst)$NUM); }
+ | STRING { code2(strpush, (Inst)$STRING); }
+ | NAME { code1(varpush); code1((Inst) g_private->maps.lookupName($NAME)); code1(eval); }
+ ;
+
+expr: value { $$ = $1; }
+ | '!' value { code1(negate); $$ = $2; }
+ | value EQ value { code1(eq); }
+ | value NEQ value { code1(ne); }
+ | value '+' value { code1(add); }
+ | value '<' value { code1(lt); }
+ | value '>' value { code1(gt); }
+ | value LTE value { code1(le); }
+ | value GTE value { code1(ge); }
+ | value '+' { $$ = $1; } // unclear what it should do
+ | RANDOMTOK '(' NUM '%' ')' { code3(constpush, (Inst)$NUM, randbool); }
+ ;
diff --git a/engines/private/lexer.l b/engines/private/lexer.l
index 9469cc14a8..9b0c4206ab 100644
--- a/engines/private/lexer.l
+++ b/engines/private/lexer.l
@@ -42,41 +42,41 @@ using namespace Settings;
%}
%%
-\/\/.* /* ignoring the comment */
-\<= return LTE;
-\>= return GTE;
-!= return NEQ;
-== return EQ;
-debug return DEBUGTOK;
-define return DEFINETOK;
-setting return SETTINGTOK;
-if return IFTOK;
-else return ELSETOK;
-goto return GOTOTOK;
-RECT return RECT;
-FALSE return FALSETOK;
-TRUE return TRUETOK;
-NULL return NULLTOK;
-Random return RANDOMTOK;
+\/\/.* /* ignoring the comment */
+\<= return LTE;
+\>= return GTE;
+!= return NEQ;
+== return EQ;
+debug return DEBUGTOK;
+define return DEFINETOK;
+setting return SETTINGTOK;
+if return IFTOK;
+else return ELSETOK;
+goto return GOTOTOK;
+RECT return RECT;
+FALSE return FALSETOK;
+TRUE return TRUETOK;
+NULL return NULLTOK;
+Random return RANDOMTOK;
[A-Za-z_][A-Za-z_0-9]* PRIVATE_lval.s = scumm_strdup(PRIVATE_text); return NAME;
-[\-]?[0-9]+ PRIVATE_lval.sym = g_private->maps.constant(NUM, atoi(PRIVATE_text), NULL); return NUM;
-\"[^\"\r\n]*\" PRIVATE_lval.sym = g_private->maps.constant(STRING, 0, scumm_strdup(PRIVATE_text)); return STRING;
-[\r|\n]+ /* ignore return */;
-[ \t]+ /* ignore whitespace */;
-. return *yytext;
+[\-]?[0-9]+ PRIVATE_lval.sym = g_private->maps.constant(NUM, atoi(PRIVATE_text), NULL); return NUM;
+\"[^\"\r\n]*\" PRIVATE_lval.sym = g_private->maps.constant(STRING, 0, scumm_strdup(PRIVATE_text)); return STRING;
+[\r|\n]+ /* ignore return */;
+[ \t]+ /* ignore whitespace */;
+. return *yytext;
%%
namespace Private {
int parse(char *code) {
- g_setts->init();
- YY_BUFFER_STATE bp;
- yy_delete_buffer(YY_CURRENT_BUFFER);
- bp = yy_scan_string(code);
- yy_switch_to_buffer(bp);
- PRIVATE_parse();
- yy_delete_buffer(bp);
- return 0;
+ g_setts->init();
+ YY_BUFFER_STATE bp;
+ yy_delete_buffer(YY_CURRENT_BUFFER);
+ bp = yy_scan_string(code);
+ yy_switch_to_buffer(bp);
+ PRIVATE_parse();
+ yy_delete_buffer(bp);
+ return 0;
}
} // End of namespace Private
diff --git a/engines/private/metaengine.cpp b/engines/private/metaengine.cpp
index 1725724a4c..ec89cf23ba 100644
--- a/engines/private/metaengine.cpp
+++ b/engines/private/metaengine.cpp
@@ -26,22 +26,22 @@
class PrivateMetaEngine : public AdvancedMetaEngine {
public:
- const char *getName() const override {
- return "private";
- }
+ const char *getName() const override {
+ return "private";
+ }
- Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
+ Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
};
Common::Error PrivateMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
- *engine = new Private::PrivateEngine(syst, gd);
- return Common::kNoError;
+ *engine = new Private::PrivateEngine(syst, gd);
+ return Common::kNoError;
}
namespace Private {
bool PrivateEngine::isDemo() const {
- return (bool)(_gameDescription->flags & ADGF_DEMO);
+ return (bool)(_gameDescription->flags & ADGF_DEMO);
}
} // End of namespace Private
diff --git a/engines/private/module.mk b/engines/private/module.mk
index ba2f9afcdd..43e438a43d 100644
--- a/engines/private/module.mk
+++ b/engines/private/module.mk
@@ -1,17 +1,17 @@
MODULE := engines/private
-
+
MODULE_OBJS := \
- code.o \
- cursors.o \
- funcs.o \
- grammar.o \
+ code.o \
+ cursors.o \
+ funcs.o \
+ grammar.o \
lexer.o \
metaengine.o \
- private.o \
+ private.o \
symbol.o
-
+
MODULE_DIRS += \
- engines/private
+ engines/private
# HACK: Skip this when including the file for detection objects.
ifeq "$(USE_RULES)" "1"
@@ -24,8 +24,8 @@ endif
ifeq ($(ENABLE_PRIVATE), DYNAMIC_PLUGIN)
PLUGIN := 1
endif
-
-# Include common rules
+
+# Include common rules
include $(srcdir)/rules.mk
# Detection objects
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index aebb47eb39..30eadb7255 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -47,1033 +47,1033 @@ PrivateEngine *g_private = NULL;
extern int parse(char *);
PrivateEngine::PrivateEngine(OSystem *syst, const ADGameDescription *gd)
- : Engine(syst), _gameDescription(gd) {
- _rnd = new Common::RandomSource("private");
-
- // Debug channels
- DebugMan.addDebugChannel(kPrivateDebugFunction, "functions", "Function execution debug channel");
- DebugMan.addDebugChannel(kPrivateDebugCode, "code", "Code execution debug channel");
- DebugMan.addDebugChannel(kPrivateDebugScript, "script", "Script execution debug channel");
-
- // Global object for external reference
- g_private = this;
-
- // Setting execution
- _nextSetting = "";
- _currentSetting = "";
- _pausedSetting = "";
- _modified = false;
- _mode = -1;
- _toTake = false;
-
- // Movies
- _nextMovie = "";
- _nextVS = "";
- _repeatedMovieExit = "";
-
- // Save and load
- _saveGameMask.clear();
- _loadGameMask.clear();
-
- // Interface
- _framePath = "inface/general/inface2.bmp";
-
- // Police
- _policeBustEnabled = false;
- _policeBustSetting = "";
- _numberClicks = 0;
- _sirenSound = "po/audio/posfx002.wav";
-
- // General sounds
- _globalAudioPath = "global/audio/";
- _noStopSounds = false;
-
- // Radios and phone
- _policeRadioArea.clear();
- _AMRadioArea.clear();
- _phoneArea.clear();
- // TODO: use this as a default sound for radio
- _infaceRadioPath = "inface/radio/";
- _phonePrefix = "inface/telephon/";
- _phoneCallSound = "phone.wav";
-
- // Dossiers
- _dossierPage = 0;
- _dossierSuspect = 0;
- _dossierNextSuspectMask.clear();
- _dossierPrevSuspectMask.clear();
-
- // Diary
- _diaryLocPrefix = "inface/diary/loclist/";
+ : Engine(syst), _gameDescription(gd) {
+ _rnd = new Common::RandomSource("private");
+
+ // Debug channels
+ DebugMan.addDebugChannel(kPrivateDebugFunction, "functions", "Function execution debug channel");
+ DebugMan.addDebugChannel(kPrivateDebugCode, "code", "Code execution debug channel");
+ DebugMan.addDebugChannel(kPrivateDebugScript, "script", "Script execution debug channel");
+
+ // Global object for external reference
+ g_private = this;
+
+ // Setting execution
+ _nextSetting = "";
+ _currentSetting = "";
+ _pausedSetting = "";
+ _modified = false;
+ _mode = -1;
+ _toTake = false;
+
+ // Movies
+ _nextMovie = "";
+ _nextVS = "";
+ _repeatedMovieExit = "";
+
+ // Save and load
+ _saveGameMask.clear();
+ _loadGameMask.clear();
+
+ // Interface
+ _framePath = "inface/general/inface2.bmp";
+
+ // Police
+ _policeBustEnabled = false;
+ _policeBustSetting = "";
+ _numberClicks = 0;
+ _sirenSound = "po/audio/posfx002.wav";
+
+ // General sounds
+ _globalAudioPath = "global/audio/";
+ _noStopSounds = false;
+
+ // Radios and phone
+ _policeRadioArea.clear();
+ _AMRadioArea.clear();
+ _phoneArea.clear();
+ // TODO: use this as a default sound for radio
+ _infaceRadioPath = "inface/radio/";
+ _phonePrefix = "inface/telephon/";
+ _phoneCallSound = "phone.wav";
+
+ // Dossiers
+ _dossierPage = 0;
+ _dossierSuspect = 0;
+ _dossierNextSuspectMask.clear();
+ _dossierPrevSuspectMask.clear();
+
+ // Diary
+ _diaryLocPrefix = "inface/diary/loclist/";
}
PrivateEngine::~PrivateEngine() {
- // Dispose your resources here
- delete _frame;
- delete _rnd;
+ // Dispose your resources here
+ delete _frame;
+ delete _rnd;
- delete Gen::g_vm;
- delete Settings::g_setts;
+ delete Gen::g_vm;
+ delete Settings::g_setts;
- // Remove all of our debug levels
- DebugMan.clearAllDebugChannels();
+ // Remove all of our debug levels
+ DebugMan.clearAllDebugChannels();
}
void PrivateEngine::initializePath(const Common::FSNode &gamePath) {
- SearchMan.addDirectory(gamePath.getPath(), gamePath, 0, 10);
+ SearchMan.addDirectory(gamePath.getPath(), gamePath, 0, 10);
}
Common::Error PrivateEngine::run() {
- assert(_installerArchive.open("SUPPORT/ASSETS.Z"));
- Common::SeekableReadStream *file = NULL;
- // if the full game is used
- if (!isDemo()) {
- assert(_installerArchive.hasFile("GAME.DAT"));
- file = _installerArchive.createReadStreamForMember("GAME.DAT");
- } else {
- // if the demo from archive.org is used
- if (_installerArchive.hasFile("GAME.TXT"))
- file = _installerArchive.createReadStreamForMember("GAME.TXT");
-
- // if the demo from the full retail CDROM is used
- else {
- if (_installerArchive.hasFile("DEMOGAME.DAT"))
- file = _installerArchive.createReadStreamForMember("DEMOGAME.DAT");
- }
- }
-
- // Read assets file
- assert(file != NULL);
- const int32 fileSize = file->size();
- char *buf = (char *)malloc(fileSize + 1);
- file->read(buf, fileSize);
- buf[fileSize] = '\0';
-
- // Initialize stuff
- Gen::g_vm = new Gen::VM();
- Settings::g_setts = new Settings::SettingMaps();
-
- initFuncs();
- initCursors();
- parse(buf);
- free(buf);
- delete file;
- assert(maps.constants.size() > 0);
-
- // Initialize graphics
- _screenW = 640;
- _screenH = 480;
- //_pixelFormat = Graphics::PixelFormat::createFormatCLUT8();
- _pixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
- _transparentColor = _pixelFormat.RGBToColor(0,255,0);
- initGraphics(_screenW, _screenH, &_pixelFormat);
- screenRect = Common::Rect(0, 0, _screenW, _screenH);
- changeCursor("default");
- _origin = Common::Point(0, 0);
- _image = new Image::BitmapDecoder();
- _compositeSurface = new Graphics::ManagedSurface();
- _compositeSurface->create(_screenW, _screenH, _pixelFormat);
- _compositeSurface->setTransparentColor(_transparentColor);
-
- // Load the game frame once
- Common::File frameFile;
- const Common::String &frameFilePathname = convertPath(_framePath);
- if (!frameFile.open(frameFilePathname)) {
- error("Failed to read %s", frameFilePathname.c_str());
- }
- _image->loadStream(frameFile);
- _frame = _image->getSurface()->convertTo(_pixelFormat, _image->getPalette());
-
- // Main event loop
- Common::Event event;
- Common::Point mousePos;
- _videoDecoder = nullptr;
-
- int saveSlot = ConfMan.getInt("save_slot");
- if (saveSlot >= 0) { // load the savegame
- loadGameState(saveSlot);
- } else {
- _nextSetting = kGoIntro;
- //setNextSetting(new Common::String(kGoIntro));
- }
-
- while (!shouldQuit()) {
- checkPhoneCall();
-
- while (g_system->getEventManager()->pollEvent(event)) {
- mousePos = g_system->getEventManager()->getMousePos();
- // Events
- switch (event.type) {
- case Common::EVENT_KEYDOWN:
- if (event.kbd.keycode == Common::KEYCODE_ESCAPE && _videoDecoder)
- skipVideo();
-
- break;
-
- case Common::EVENT_QUIT:
- case Common::EVENT_RETURN_TO_LAUNCHER:
- break;
-
- case Common::EVENT_LBUTTONDOWN:
- _numberClicks++;
- if (selectDossierNextSuspect(mousePos))
- break;
- else if (selectDossierPrevSuspect(mousePos))
- break;
-
- selectPauseMovie(mousePos);
- selectPhoneArea(mousePos);
- selectPoliceRadioArea(mousePos);
- selectAMRadioArea(mousePos);
- selectLoadGame(mousePos);
- selectSaveGame(mousePos);
- if (_nextSetting.empty())
- selectMask(mousePos);
- if (_nextSetting.empty())
- selectExit(mousePos);
- break;
-
- case Common::EVENT_MOUSEMOVE:
- // Reset cursor to default
- changeCursor("default");
- // The following functions will return true
- // if the cursor is changed
- if (cursorPauseMovie(mousePos)) {}
- else if (cursorMask(mousePos)) {}
- else cursorExit(mousePos);
- break;
-
- default:
- break;
- }
- }
-
- checkPoliceBust();
-
- // Movies
- if (!_nextMovie.empty()) {
- removeTimer();
- _videoDecoder = new Video::SmackerDecoder();
- playVideo(_nextMovie);
- _nextMovie = "";
- continue;
- }
-
- if (!_nextVS.empty() && _currentSetting == kMainDesktop) {
- loadImage(_nextVS, 160, 120);
- drawScreen();
- }
-
- if (_videoDecoder) {
- if (_videoDecoder->getCurFrame() == 0)
- stopSound(true);
- if (_videoDecoder->endOfVideo()) {
- _videoDecoder->close();
- delete _videoDecoder;
- _videoDecoder = nullptr;
- } else if (_videoDecoder->needsUpdate()) {
- drawScreen();
- }
- continue;
- }
-
- if (!_nextSetting.empty()) {
- removeTimer();
- debugC(1, kPrivateDebugFunction, "Executing %s", _nextSetting.c_str());
- clearAreas();
- _currentSetting = _nextSetting;
- Settings::g_setts->load(_nextSetting);
- _nextSetting = "";
- Gen::g_vm->run();
- changeCursor("default");
- drawScreen();
- }
-
- g_system->updateScreen();
- g_system->delayMillis(10);
- }
- return Common::kNoError;
+ assert(_installerArchive.open("SUPPORT/ASSETS.Z"));
+ Common::SeekableReadStream *file = NULL;
+ // if the full game is used
+ if (!isDemo()) {
+ assert(_installerArchive.hasFile("GAME.DAT"));
+ file = _installerArchive.createReadStreamForMember("GAME.DAT");
+ } else {
+ // if the demo from archive.org is used
+ if (_installerArchive.hasFile("GAME.TXT"))
+ file = _installerArchive.createReadStreamForMember("GAME.TXT");
+
+ // if the demo from the full retail CDROM is used
+ else {
+ if (_installerArchive.hasFile("DEMOGAME.DAT"))
+ file = _installerArchive.createReadStreamForMember("DEMOGAME.DAT");
+ }
+ }
+
+ // Read assets file
+ assert(file != NULL);
+ const int32 fileSize = file->size();
+ char *buf = (char *)malloc(fileSize + 1);
+ file->read(buf, fileSize);
+ buf[fileSize] = '\0';
+
+ // Initialize stuff
+ Gen::g_vm = new Gen::VM();
+ Settings::g_setts = new Settings::SettingMaps();
+
+ initFuncs();
+ initCursors();
+ parse(buf);
+ free(buf);
+ delete file;
+ assert(maps.constants.size() > 0);
+
+ // Initialize graphics
+ _screenW = 640;
+ _screenH = 480;
+ //_pixelFormat = Graphics::PixelFormat::createFormatCLUT8();
+ _pixelFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
+ _transparentColor = _pixelFormat.RGBToColor(0,255,0);
+ initGraphics(_screenW, _screenH, &_pixelFormat);
+ screenRect = Common::Rect(0, 0, _screenW, _screenH);
+ changeCursor("default");
+ _origin = Common::Point(0, 0);
+ _image = new Image::BitmapDecoder();
+ _compositeSurface = new Graphics::ManagedSurface();
+ _compositeSurface->create(_screenW, _screenH, _pixelFormat);
+ _compositeSurface->setTransparentColor(_transparentColor);
+
+ // Load the game frame once
+ Common::File frameFile;
+ const Common::String &frameFilePathname = convertPath(_framePath);
+ if (!frameFile.open(frameFilePathname)) {
+ error("Failed to read %s", frameFilePathname.c_str());
+ }
+ _image->loadStream(frameFile);
+ _frame = _image->getSurface()->convertTo(_pixelFormat, _image->getPalette());
+
+ // Main event loop
+ Common::Event event;
+ Common::Point mousePos;
+ _videoDecoder = nullptr;
+
+ int saveSlot = ConfMan.getInt("save_slot");
+ if (saveSlot >= 0) { // load the savegame
+ loadGameState(saveSlot);
+ } else {
+ _nextSetting = kGoIntro;
+ //setNextSetting(new Common::String(kGoIntro));
+ }
+
+ while (!shouldQuit()) {
+ checkPhoneCall();
+
+ while (g_system->getEventManager()->pollEvent(event)) {
+ mousePos = g_system->getEventManager()->getMousePos();
+ // Events
+ switch (event.type) {
+ case Common::EVENT_KEYDOWN:
+ if (event.kbd.keycode == Common::KEYCODE_ESCAPE && _videoDecoder)
+ skipVideo();
+
+ break;
+
+ case Common::EVENT_QUIT:
+ case Common::EVENT_RETURN_TO_LAUNCHER:
+ break;
+
+ case Common::EVENT_LBUTTONDOWN:
+ _numberClicks++;
+ if (selectDossierNextSuspect(mousePos))
+ break;
+ else if (selectDossierPrevSuspect(mousePos))
+ break;
+
+ selectPauseMovie(mousePos);
+ selectPhoneArea(mousePos);
+ selectPoliceRadioArea(mousePos);
+ selectAMRadioArea(mousePos);
+ selectLoadGame(mousePos);
+ selectSaveGame(mousePos);
+ if (_nextSetting.empty())
+ selectMask(mousePos);
+ if (_nextSetting.empty())
+ selectExit(mousePos);
+ break;
+
+ case Common::EVENT_MOUSEMOVE:
+ // Reset cursor to default
+ changeCursor("default");
+ // The following functions will return true
+ // if the cursor is changed
+ if (cursorPauseMovie(mousePos)) {}
+ else if (cursorMask(mousePos)) {}
+ else cursorExit(mousePos);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ checkPoliceBust();
+
+ // Movies
+ if (!_nextMovie.empty()) {
+ removeTimer();
+ _videoDecoder = new Video::SmackerDecoder();
+ playVideo(_nextMovie);
+ _nextMovie = "";
+ continue;
+ }
+
+ if (!_nextVS.empty() && _currentSetting == kMainDesktop) {
+ loadImage(_nextVS, 160, 120);
+ drawScreen();
+ }
+
+ if (_videoDecoder) {
+ if (_videoDecoder->getCurFrame() == 0)
+ stopSound(true);
+ if (_videoDecoder->endOfVideo()) {
+ _videoDecoder->close();
+ delete _videoDecoder;
+ _videoDecoder = nullptr;
+ } else if (_videoDecoder->needsUpdate()) {
+ drawScreen();
+ }
+ continue;
+ }
+
+ if (!_nextSetting.empty()) {
+ removeTimer();
+ debugC(1, kPrivateDebugFunction, "Executing %s", _nextSetting.c_str());
+ clearAreas();
+ _currentSetting = _nextSetting;
+ Settings::g_setts->load(_nextSetting);
+ _nextSetting = "";
+ Gen::g_vm->run();
+ changeCursor("default");
+ drawScreen();
+ }
+
+ g_system->updateScreen();
+ g_system->delayMillis(10);
+ }
+ return Common::kNoError;
}
void PrivateEngine::initFuncs() {
- for (const Private::FuncTable *fnc = funcTable; fnc->name; fnc++) {
- Common::String name(fnc->name);
- _functions.setVal(name, (void *)fnc->func);
- }
+ for (const Private::FuncTable *fnc = funcTable; fnc->name; fnc++) {
+ Common::String name(fnc->name);
+ _functions.setVal(name, (void *)fnc->func);
+ }
}
void PrivateEngine::clearAreas() {
- _exits.clear();
- _masks.clear();
-
- if (_loadGameMask.surf)
- _loadGameMask.surf->free();
- delete _loadGameMask.surf;
- _loadGameMask.clear();
-
- if (_saveGameMask.surf)
- _saveGameMask.surf->free();
- delete _saveGameMask.surf;
- _saveGameMask.clear();
-
- if (_policeRadioArea.surf)
- _policeRadioArea.surf->free();
- delete _policeRadioArea.surf;
- _policeRadioArea.clear();
-
- if (_AMRadioArea.surf)
- _AMRadioArea.surf->free();
- delete _AMRadioArea.surf;
- _AMRadioArea.clear();
-
- if (_phoneArea.surf)
- _phoneArea.surf->free();
- delete _phoneArea.surf;
- _phoneArea.clear();
-
- if (_dossierNextSuspectMask.surf)
- _dossierNextSuspectMask.surf->free();
- delete _dossierNextSuspectMask.surf;
- _dossierNextSuspectMask.clear();
-
- if (_dossierPrevSuspectMask.surf)
- _dossierPrevSuspectMask.surf->free();
- delete _dossierPrevSuspectMask.surf;
- _dossierPrevSuspectMask.clear();
+ _exits.clear();
+ _masks.clear();
+
+ if (_loadGameMask.surf)
+ _loadGameMask.surf->free();
+ delete _loadGameMask.surf;
+ _loadGameMask.clear();
+
+ if (_saveGameMask.surf)
+ _saveGameMask.surf->free();
+ delete _saveGameMask.surf;
+ _saveGameMask.clear();
+
+ if (_policeRadioArea.surf)
+ _policeRadioArea.surf->free();
+ delete _policeRadioArea.surf;
+ _policeRadioArea.clear();
+
+ if (_AMRadioArea.surf)
+ _AMRadioArea.surf->free();
+ delete _AMRadioArea.surf;
+ _AMRadioArea.clear();
+
+ if (_phoneArea.surf)
+ _phoneArea.surf->free();
+ delete _phoneArea.surf;
+ _phoneArea.clear();
+
+ if (_dossierNextSuspectMask.surf)
+ _dossierNextSuspectMask.surf->free();
+ delete _dossierNextSuspectMask.surf;
+ _dossierNextSuspectMask.clear();
+
+ if (_dossierPrevSuspectMask.surf)
+ _dossierPrevSuspectMask.surf->free();
+ delete _dossierPrevSuspectMask.surf;
+ _dossierPrevSuspectMask.clear();
}
void PrivateEngine::startPoliceBust() {
- // This logic was extracted from the binary
- int policeIndex = maps.variables.getVal(kPoliceIndex)->u.val;
- int r = _rnd->getRandomNumber(0xc);
- if (policeIndex > 0x14) {
- policeIndex = 0x15;
- }
- _maxNumberClicks = r + 0x10 + (policeIndex * 0xe) / -0x15;
- _sirenWarning = _rnd->getRandomNumber(0x7) + 3;
- _numberClicks = 0;
- if (_sirenWarning >= _maxNumberClicks)
- _sirenWarning = _maxNumberClicks - 1;
+ // This logic was extracted from the binary
+ int policeIndex = maps.variables.getVal(kPoliceIndex)->u.val;
+ int r = _rnd->getRandomNumber(0xc);
+ if (policeIndex > 0x14) {
+ policeIndex = 0x15;
+ }
+ _maxNumberClicks = r + 0x10 + (policeIndex * 0xe) / -0x15;
+ _sirenWarning = _rnd->getRandomNumber(0x7) + 3;
+ _numberClicks = 0;
+ if (_sirenWarning >= _maxNumberClicks)
+ _sirenWarning = _maxNumberClicks - 1;
}
void PrivateEngine::checkPoliceBust() {
- if (!_policeBustEnabled)
- return;
-
- if (_numberClicks < _sirenWarning)
- return;
-
- if (_numberClicks == _sirenWarning) {
- stopSound(true);
- playSound(_sirenSound, 0, false, false);
- _numberClicks++; // Won't execute again
- return;
- }
-
- if (_numberClicks == _maxNumberClicks+1) {
- uint policeIndex = maps.variables.getVal(kPoliceIndex)->u.val;
- _policeBustSetting = _currentSetting;
- if (policeIndex <= 13) {
- _nextSetting = kPOGoBustMovie;
- } else {
- _nextSetting = kPoliceBustFromMO;
- }
- clearAreas();
- _policeBustEnabled = false;
- }
+ if (!_policeBustEnabled)
+ return;
+
+ if (_numberClicks < _sirenWarning)
+ return;
+
+ if (_numberClicks == _sirenWarning) {
+ stopSound(true);
+ playSound(_sirenSound, 0, false, false);
+ _numberClicks++; // Won't execute again
+ return;
+ }
+
+ if (_numberClicks == _maxNumberClicks+1) {
+ uint policeIndex = maps.variables.getVal(kPoliceIndex)->u.val;
+ _policeBustSetting = _currentSetting;
+ if (policeIndex <= 13) {
+ _nextSetting = kPOGoBustMovie;
+ } else {
+ _nextSetting = kPoliceBustFromMO;
+ }
+ clearAreas();
+ _policeBustEnabled = false;
+ }
}
bool PrivateEngine::cursorExit(Common::Point mousePos) {
- mousePos = mousePos - _origin;
- if (mousePos.x < 0 || mousePos.y < 0)
- return false;
-
- int rs = 100000000;
- int cs = 0;
- Common::String cursor;
-
- for (ExitList::const_iterator it = _exits.begin(); it != _exits.end(); ++it) {
- const ExitInfo &e = *it;
- cs = e.rect.width()*e.rect.height();
-
- if (e.rect.contains(mousePos)) {
- if (cs < rs && !e.cursor.empty()) {
- rs = cs;
- cursor = e.cursor;
- }
- }
- }
-
- if (!cursor.empty()) {
- changeCursor(cursor);
- return true;
- }
-
- return false;
+ mousePos = mousePos - _origin;
+ if (mousePos.x < 0 || mousePos.y < 0)
+ return false;
+
+ int rs = 100000000;
+ int cs = 0;
+ Common::String cursor;
+
+ for (ExitList::const_iterator it = _exits.begin(); it != _exits.end(); ++it) {
+ const ExitInfo &e = *it;
+ cs = e.rect.width()*e.rect.height();
+
+ if (e.rect.contains(mousePos)) {
+ if (cs < rs && !e.cursor.empty()) {
+ rs = cs;
+ cursor = e.cursor;
+ }
+ }
+ }
+
+ if (!cursor.empty()) {
+ changeCursor(cursor);
+ return true;
+ }
+
+ return false;
}
bool PrivateEngine::inMask(Graphics::ManagedSurface *surf, Common::Point mousePos) {
- if (surf == NULL)
- return false;
+ if (surf == NULL)
+ return false;
- mousePos = mousePos - _origin;
- if (mousePos.x < 0 || mousePos.y < 0)
- return false;
+ mousePos = mousePos - _origin;
+ if (mousePos.x < 0 || mousePos.y < 0)
+ return false;
- if (mousePos.x > surf->w || mousePos.y > surf->h)
- return false;
+ if (mousePos.x > surf->w || mousePos.y > surf->h)
+ return false;
- return (*((uint32 *)surf->getBasePtr(mousePos.x, mousePos.y)) != _transparentColor);
+ return (*((uint32 *)surf->getBasePtr(mousePos.x, mousePos.y)) != _transparentColor);
}
bool PrivateEngine::cursorMask(Common::Point mousePos) {
- bool inside = false;
- for (MaskList::const_iterator it = _masks.begin(); it != _masks.end(); ++it) {
- const MaskInfo &m = *it;
-
- if (inMask(m.surf, mousePos)) {
- if (!m.cursor.empty()) { // TODO: check this
- inside = true;
- changeCursor(m.cursor);
- break;
- }
- }
- }
- return inside;
+ bool inside = false;
+ for (MaskList::const_iterator it = _masks.begin(); it != _masks.end(); ++it) {
+ const MaskInfo &m = *it;
+
+ if (inMask(m.surf, mousePos)) {
+ if (!m.cursor.empty()) { // TODO: check this
+ inside = true;
+ changeCursor(m.cursor);
+ break;
+ }
+ }
+ }
+ return inside;
}
bool PrivateEngine::cursorPauseMovie(Common::Point mousePos) {
- if (_mode == 1) {
- Common::Rect window(_origin.x, _origin.y, _screenW - _origin.x, _screenH - _origin.y);
- if (!window.contains(mousePos)) {
- return true;
- }
- }
- return false;
+ if (_mode == 1) {
+ Common::Rect window(_origin.x, _origin.y, _screenW - _origin.x, _screenH - _origin.y);
+ if (!window.contains(mousePos)) {
+ return true;
+ }
+ }
+ return false;
}
void PrivateEngine::selectPauseMovie(Common::Point mousePos) {
- if (_mode == 1) {
- Common::Rect window(_origin.x, _origin.y, _screenW - _origin.x, _screenH - _origin.y);
- if (!window.contains(mousePos)) {
- if (!_pausedSetting.empty()) {
- _pausedSetting = _currentSetting;
- _nextSetting = kPauseMovie;
- }
- }
- }
+ if (_mode == 1) {
+ Common::Rect window(_origin.x, _origin.y, _screenW - _origin.x, _screenH - _origin.y);
+ if (!window.contains(mousePos)) {
+ if (!_pausedSetting.empty()) {
+ _pausedSetting = _currentSetting;
+ _nextSetting = kPauseMovie;
+ }
+ }
+ }
}
void PrivateEngine::selectExit(Common::Point mousePos) {
- mousePos = mousePos - _origin;
- if (mousePos.x < 0 || mousePos.y < 0)
- return;
-
- Common::String ns = "";
- int rs = 100000000;
- int cs = 0;
- for (ExitList::const_iterator it = _exits.begin(); it != _exits.end(); ++it) {
- const ExitInfo &e = *it;
- cs = e.rect.width()*e.rect.height();
- //debug("Testing exit %s %d", e.nextSetting->c_str(), cs);
- if (e.rect.contains(mousePos)) {
- //debug("Inside! %d %d", cs, rs);
- if (cs < rs && !e.nextSetting.empty()) { // TODO: check this
- // an item was not taken
- if (_toTake) {
- playSound(getLeaveSound(), 1, false, false);
- _toTake = false;
- }
-
- //debug("Found Exit %s %d", e.nextSetting->c_str(), cs);
- rs = cs;
- ns = e.nextSetting;
- }
- }
- }
- if (!ns.empty()) {
- _nextSetting = ns;
- }
+ mousePos = mousePos - _origin;
+ if (mousePos.x < 0 || mousePos.y < 0)
+ return;
+
+ Common::String ns = "";
+ int rs = 100000000;
+ int cs = 0;
+ for (ExitList::const_iterator it = _exits.begin(); it != _exits.end(); ++it) {
+ const ExitInfo &e = *it;
+ cs = e.rect.width()*e.rect.height();
+ //debug("Testing exit %s %d", e.nextSetting->c_str(), cs);
+ if (e.rect.contains(mousePos)) {
+ //debug("Inside! %d %d", cs, rs);
+ if (cs < rs && !e.nextSetting.empty()) { // TODO: check this
+ // an item was not taken
+ if (_toTake) {
+ playSound(getLeaveSound(), 1, false, false);
+ _toTake = false;
+ }
+
+ //debug("Found Exit %s %d", e.nextSetting->c_str(), cs);
+ rs = cs;
+ ns = e.nextSetting;
+ }
+ }
+ }
+ if (!ns.empty()) {
+ _nextSetting = ns;
+ }
}
void PrivateEngine::selectMask(Common::Point mousePos) {
- Common::String ns;
- for (MaskList::const_iterator it = _masks.begin(); it != _masks.end(); ++it) {
- const MaskInfo &m = *it;
- //debug("Testing mask %s", m.nextSetting->c_str());
- if (inMask(m.surf, mousePos)) {
- //debug("Inside!");
- if (!m.nextSetting.empty()) { // TODO: check this
- //debug("Found Mask %s", m.nextSetting->c_str());
- ns = m.nextSetting;
- }
-
- if (m.flag1 != NULL) { // TODO: check this
- setSymbol(m.flag1, 1);
- // an item was taken
- if (_toTake) {
- playSound(getTakeSound(), 1, false, false);
- _toTake = false;
- }
- }
-
- if (m.flag2 != NULL) {
- setSymbol(m.flag2, 1);
- }
- break;
- }
- }
- if (!ns.empty()) {
- //debug("Mask selected %s", ns->c_str());
- _nextSetting = ns;
- }
+ Common::String ns;
+ for (MaskList::const_iterator it = _masks.begin(); it != _masks.end(); ++it) {
+ const MaskInfo &m = *it;
+ //debug("Testing mask %s", m.nextSetting->c_str());
+ if (inMask(m.surf, mousePos)) {
+ //debug("Inside!");
+ if (!m.nextSetting.empty()) { // TODO: check this
+ //debug("Found Mask %s", m.nextSetting->c_str());
+ ns = m.nextSetting;
+ }
+
+ if (m.flag1 != NULL) { // TODO: check this
+ setSymbol(m.flag1, 1);
+ // an item was taken
+ if (_toTake) {
+ playSound(getTakeSound(), 1, false, false);
+ _toTake = false;
+ }
+ }
+
+ if (m.flag2 != NULL) {
+ setSymbol(m.flag2, 1);
+ }
+ break;
+ }
+ }
+ if (!ns.empty()) {
+ //debug("Mask selected %s", ns->c_str());
+ _nextSetting = ns;
+ }
}
void PrivateEngine::selectAMRadioArea(Common::Point mousePos) {
- if (_AMRadioArea.surf == NULL)
- return;
+ if (_AMRadioArea.surf == NULL)
+ return;
- if (_AMRadio.empty())
- return;
+ if (_AMRadio.empty())
+ return;
- if (inMask(_AMRadioArea.surf, mousePos)) {
- Common::String sound = _infaceRadioPath + "comm_/" + _AMRadio.back() + ".wav";
- playSound(sound, 1, false, false);
- _AMRadio.pop_back();
- }
+ if (inMask(_AMRadioArea.surf, mousePos)) {
+ Common::String sound = _infaceRadioPath + "comm_/" + _AMRadio.back() + ".wav";
+ playSound(sound, 1, false, false);
+ _AMRadio.pop_back();
+ }
}
void PrivateEngine::selectPoliceRadioArea(Common::Point mousePos) {
- if (_policeRadioArea.surf == NULL)
- return;
+ if (_policeRadioArea.surf == NULL)
+ return;
- if (_policeRadio.empty())
- return;
+ if (_policeRadio.empty())
+ return;
- if (inMask(_policeRadioArea.surf, mousePos)) {
- Common::String sound = _infaceRadioPath + "police/" + _policeRadio.back() + ".wav";
- playSound(sound, 1, false, false);
- _policeRadio.pop_back();
- }
+ if (inMask(_policeRadioArea.surf, mousePos)) {
+ Common::String sound = _infaceRadioPath + "police/" + _policeRadio.back() + ".wav";
+ playSound(sound, 1, false, false);
+ _policeRadio.pop_back();
+ }
}
void PrivateEngine::checkPhoneCall() {
- if (_phoneArea.surf == NULL)
- return;
+ if (_phoneArea.surf == NULL)
+ return;
- if (_phone.empty())
- return;
+ if (_phone.empty())
+ return;
- if (!_mixer->isSoundHandleActive(_fgSoundHandle))
- playSound(_phonePrefix + _phoneCallSound, 1, false, false);
+ if (!_mixer->isSoundHandleActive(_fgSoundHandle))
+ playSound(_phonePrefix + _phoneCallSound, 1, false, false);
}
void PrivateEngine::selectPhoneArea(Common::Point mousePos) {
- if (_phoneArea.surf == NULL)
- return;
-
- if (_phone.empty())
- return;
-
- if (inMask(_phoneArea.surf, mousePos)) {
- const PhoneInfo &i = _phone.back();
- setSymbol(i.flag, i.val);
- Common::String sound = _phonePrefix + i.sound + ".wav";
- playSound(sound, 1, true, false);
- _phone.pop_back();
- }
+ if (_phoneArea.surf == NULL)
+ return;
+
+ if (_phone.empty())
+ return;
+
+ if (inMask(_phoneArea.surf, mousePos)) {
+ const PhoneInfo &i = _phone.back();
+ setSymbol(i.flag, i.val);
+ Common::String sound = _phonePrefix + i.sound + ".wav";
+ playSound(sound, 1, true, false);
+ _phone.pop_back();
+ }
}
void PrivateEngine::loadDossier() {
- int x = 40;
- int y = 30;
+ int x = 40;
+ int y = 30;
- DossierInfo m = _dossiers[_dossierSuspect];
+ DossierInfo m = _dossiers[_dossierSuspect];
- if (_dossierPage == 0) {
- loadImage(m.page1, x, y);
- } else if (_dossierPage == 1) {
- loadImage(m.page2, x, y);
+ if (_dossierPage == 0) {
+ loadImage(m.page1, x, y);
+ } else if (_dossierPage == 1) {
+ loadImage(m.page2, x, y);
} else {
- assert(0);
+ assert(0);
}
}
bool PrivateEngine::selectDossierNextSuspect(Common::Point mousePos) {
- if (_dossierNextSuspectMask.surf == NULL)
- return false;
-
- if (inMask(_dossierNextSuspectMask.surf, mousePos)) {
- if ((_dossierSuspect + 1) < _dossiers.size()) {
- _dossierSuspect++;
- _dossierPage = 0;
- loadDossier();
- drawMask(_dossierNextSuspectMask.surf);
- drawMask(_dossierPrevSuspectMask.surf);
- drawScreen();
- }
- return true;
- }
- return false;
+ if (_dossierNextSuspectMask.surf == NULL)
+ return false;
+
+ if (inMask(_dossierNextSuspectMask.surf, mousePos)) {
+ if ((_dossierSuspect + 1) < _dossiers.size()) {
+ _dossierSuspect++;
+ _dossierPage = 0;
+ loadDossier();
+ drawMask(_dossierNextSuspectMask.surf);
+ drawMask(_dossierPrevSuspectMask.surf);
+ drawScreen();
+ }
+ return true;
+ }
+ return false;
}
bool PrivateEngine::selectDossierPrevSuspect(Common::Point mousePos) {
- if (_dossierPrevSuspectMask.surf == NULL)
- return false;
-
- if (inMask(_dossierPrevSuspectMask.surf, mousePos)) {
- if (_dossierSuspect > 0) {
- _dossierSuspect--;
- _dossierPage = 0;
- loadDossier();
- drawMask(_dossierNextSuspectMask.surf);
- drawMask(_dossierPrevSuspectMask.surf);
- drawScreen();
- }
- return true;
- }
- return false;
+ if (_dossierPrevSuspectMask.surf == NULL)
+ return false;
+
+ if (inMask(_dossierPrevSuspectMask.surf, mousePos)) {
+ if (_dossierSuspect > 0) {
+ _dossierSuspect--;
+ _dossierPage = 0;
+ loadDossier();
+ drawMask(_dossierNextSuspectMask.surf);
+ drawMask(_dossierPrevSuspectMask.surf);
+ drawScreen();
+ }
+ return true;
+ }
+ return false;
}
void PrivateEngine::selectLoadGame(Common::Point mousePos) {
- if (_loadGameMask.surf == NULL)
- return;
+ if (_loadGameMask.surf == NULL)
+ return;
- if (inMask(_loadGameMask.surf, mousePos)) {
- loadGameDialog();
- }
+ if (inMask(_loadGameMask.surf, mousePos)) {
+ loadGameDialog();
+ }
}
void PrivateEngine::selectSaveGame(Common::Point mousePos) {
- if (_saveGameMask.surf == NULL)
- return;
+ if (_saveGameMask.surf == NULL)
+ return;
- if (inMask(_saveGameMask.surf, mousePos)) {
- saveGameDialog();
- }
+ if (inMask(_saveGameMask.surf, mousePos)) {
+ saveGameDialog();
+ }
}
bool PrivateEngine::hasFeature(EngineFeature f) const {
- return (f == kSupportsReturnToLauncher);
+ return (f == kSupportsReturnToLauncher);
}
void PrivateEngine::restartGame() {
- debugC(1, kPrivateDebugFunction, "restartGame");
-
- for (NameList::iterator it = maps.variableList.begin(); it != maps.variableList.end(); ++it) {
- Private::Symbol *sym = maps.variables.getVal(*it);
- if (*(sym->name) != "kAlternateGame")
- sym->u.val = 0;
- }
-
- // Diary
- for (NameList::iterator it = maps.locationList.begin(); it != maps.locationList.end(); ++it) {
- Private::Symbol *sym = maps.locations.getVal(*it);
- sym->u.val = 0;
- }
- inventory.clear();
- _dossiers.clear();
-
- // Sounds
- _AMRadio.clear();
- _policeRadio.clear();
- _phone.clear();
- _playedPhoneClips.clear();
-
- // Movies
- _repeatedMovieExit = "";
- _playedMovies.clear();
+ debugC(1, kPrivateDebugFunction, "restartGame");
+
+ for (NameList::iterator it = maps.variableList.begin(); it != maps.variableList.end(); ++it) {
+ Private::Symbol *sym = maps.variables.getVal(*it);
+ if (*(sym->name) != "kAlternateGame")
+ sym->u.val = 0;
+ }
+
+ // Diary
+ for (NameList::iterator it = maps.locationList.begin(); it != maps.locationList.end(); ++it) {
+ Private::Symbol *sym = maps.locations.getVal(*it);
+ sym->u.val = 0;
+ }
+ inventory.clear();
+ _dossiers.clear();
+
+ // Sounds
+ _AMRadio.clear();
+ _policeRadio.clear();
+ _phone.clear();
+ _playedPhoneClips.clear();
+
+ // Movies
+ _repeatedMovieExit = "";
+ _playedMovies.clear();
}
Common::Error PrivateEngine::loadGameStream(Common::SeekableReadStream *stream) {
- // We don't want to continue with any sound from a previous game
- stopSound(true);
-
- Common::Serializer s(stream, nullptr);
- debugC(1, kPrivateDebugFunction, "loadGameStream");
- _nextSetting = kStartGame;
- int val;
-
- for (NameList::iterator it = maps.variableList.begin(); it != maps.variableList.end(); ++it) {
- s.syncAsUint32LE(val);
- Private::Symbol *sym = maps.variables.getVal(*it);
- sym->u.val = val;
- }
-
- // Diary
- for (NameList::iterator it = maps.locationList.begin(); it != maps.locationList.end(); ++it) {
- s.syncAsUint32LE(val);
- Private::Symbol *sym = maps.locations.getVal(*it);
- sym->u.val = val;
- }
- uint32 size = stream->readUint32LE();
- for (uint32 i = 0; i < size; ++i) {
- inventory.push_back(stream->readString());
- }
-
- // Dossiers
- size = stream->readUint32LE();
- DossierInfo m;
- for (uint32 i = 0; i < size; ++i) {
- m.page1 = stream->readString();
- m.page2 = stream->readString();
- _dossiers.push_back(m);
- }
-
- // Radios
- size = stream->readUint32LE();
- _AMRadio.clear();
-
- for (uint32 i = 0; i < size; ++i) {
- _AMRadio.push_back(stream->readString());
- }
-
- size = stream->readUint32LE();
- _policeRadio.clear();
-
- for (uint32 i = 0; i < size; ++i) {
- _policeRadio.push_back(stream->readString());
- }
-
- size = stream->readUint32LE();
- _phone.clear();
- PhoneInfo p;
- for (uint32 j = 0; j < size; ++j) {
- p.sound = stream->readString();
- p.flag = maps.variables.getVal(stream->readString());
- p.val = stream->readUint32LE();
- _phone.push_back(p);
- }
-
- // Played media
- _repeatedMovieExit = stream->readString();
- _playedMovies.clear();
- size = stream->readUint32LE();
- for (uint32 i = 0; i < size; ++i) {
- _playedMovies.setVal(stream->readString(), true);
- }
-
- _playedPhoneClips.clear();
- size = stream->readUint32LE();
- for (uint32 i = 0; i < size; ++i) {
- _playedPhoneClips.setVal(stream->readString(), true);
- }
-
- return Common::kNoError;
+ // We don't want to continue with any sound from a previous game
+ stopSound(true);
+
+ Common::Serializer s(stream, nullptr);
+ debugC(1, kPrivateDebugFunction, "loadGameStream");
+ _nextSetting = kStartGame;
+ int val;
+
+ for (NameList::iterator it = maps.variableList.begin(); it != maps.variableList.end(); ++it) {
+ s.syncAsUint32LE(val);
+ Private::Symbol *sym = maps.variables.getVal(*it);
+ sym->u.val = val;
+ }
+
+ // Diary
+ for (NameList::iterator it = maps.locationList.begin(); it != maps.locationList.end(); ++it) {
+ s.syncAsUint32LE(val);
+ Private::Symbol *sym = maps.locations.getVal(*it);
+ sym->u.val = val;
+ }
+ uint32 size = stream->readUint32LE();
+ for (uint32 i = 0; i < size; ++i) {
+ inventory.push_back(stream->readString());
+ }
+
+ // Dossiers
+ size = stream->readUint32LE();
+ DossierInfo m;
+ for (uint32 i = 0; i < size; ++i) {
+ m.page1 = stream->readString();
+ m.page2 = stream->readString();
+ _dossiers.push_back(m);
+ }
+
+ // Radios
+ size = stream->readUint32LE();
+ _AMRadio.clear();
+
+ for (uint32 i = 0; i < size; ++i) {
+ _AMRadio.push_back(stream->readString());
+ }
+
+ size = stream->readUint32LE();
+ _policeRadio.clear();
+
+ for (uint32 i = 0; i < size; ++i) {
+ _policeRadio.push_back(stream->readString());
+ }
+
+ size = stream->readUint32LE();
+ _phone.clear();
+ PhoneInfo p;
+ for (uint32 j = 0; j < size; ++j) {
+ p.sound = stream->readString();
+ p.flag = maps.variables.getVal(stream->readString());
+ p.val = stream->readUint32LE();
+ _phone.push_back(p);
+ }
+
+ // Played media
+ _repeatedMovieExit = stream->readString();
+ _playedMovies.clear();
+ size = stream->readUint32LE();
+ for (uint32 i = 0; i < size; ++i) {
+ _playedMovies.setVal(stream->readString(), true);
+ }
+
+ _playedPhoneClips.clear();
+ size = stream->readUint32LE();
+ for (uint32 i = 0; i < size; ++i) {
+ _playedPhoneClips.setVal(stream->readString(), true);
+ }
+
+ return Common::kNoError;
}
Common::Error PrivateEngine::saveGameStream(Common::WriteStream *stream, bool isAutosave) {
- debugC(1, kPrivateDebugFunction, "saveGameStream(%d)", isAutosave);
- if (isAutosave)
- return Common::kNoError;
-
- // Variables
- for (NameList::const_iterator it = maps.variableList.begin(); it != maps.variableList.end(); ++it) {
- const Private::Symbol *sym = maps.variables.getVal(*it);
- stream->writeUint32LE(sym->u.val);
- }
-
- // Diary
- for (NameList::const_iterator it = maps.locationList.begin(); it != maps.locationList.end(); ++it) {
- const Private::Symbol *sym = maps.locations.getVal(*it);
- stream->writeUint32LE(sym->u.val);
- }
-
- stream->writeUint32LE(inventory.size());
- for (NameList::const_iterator it = inventory.begin(); it != inventory.end(); ++it) {
- stream->writeString(*it);
- stream->writeByte(0);
- }
-
- // Dossiers
- stream->writeUint32LE(_dossiers.size());
- for (DossierArray::const_iterator it = _dossiers.begin(); it != _dossiers.end(); ++it) {
- stream->writeString(it->page1.c_str());
- stream->writeByte(0);
-
- if (!it->page2.empty())
- stream->writeString(it->page2.c_str());
- stream->writeByte(0);
- }
-
- // Radios
- stream->writeUint32LE(_AMRadio.size());
- for (SoundList::const_iterator it = _AMRadio.begin(); it != _AMRadio.end(); ++it) {
- stream->writeString(*it);
- stream->writeByte(0);
- }
- stream->writeUint32LE(_policeRadio.size());
- for (SoundList::const_iterator it = _policeRadio.begin(); it != _policeRadio.end(); ++it) {
- stream->writeString(*it);
- stream->writeByte(0);
- }
-
- stream->writeUint32LE(_phone.size());
- for (PhoneList::const_iterator it = _phone.begin(); it != _phone.end(); ++it) {
- stream->writeString(it->sound);
- stream->writeByte(0);
- stream->writeString(*it->flag->name);
- stream->writeByte(0);
- stream->writeUint32LE(it->val);
- }
-
- // Played media
- stream->writeString(_repeatedMovieExit);
- stream->writeByte(0);
-
- stream->writeUint32LE(_playedMovies.size());
- for (PlayedMediaTable::const_iterator it = _playedMovies.begin(); it != _playedMovies.end(); ++it) {
- stream->writeString(it->_key);
- stream->writeByte(0);
- }
-
- stream->writeUint32LE(_playedPhoneClips.size());
- for (PlayedMediaTable::const_iterator it = _playedPhoneClips.begin(); it != _playedPhoneClips.end(); ++it) {
- stream->writeString(it->_key);
- stream->writeByte(0);
- }
-
- return Common::kNoError;
+ debugC(1, kPrivateDebugFunction, "saveGameStream(%d)", isAutosave);
+ if (isAutosave)
+ return Common::kNoError;
+
+ // Variables
+ for (NameList::const_iterator it = maps.variableList.begin(); it != maps.variableList.end(); ++it) {
+ const Private::Symbol *sym = maps.variables.getVal(*it);
+ stream->writeUint32LE(sym->u.val);
+ }
+
+ // Diary
+ for (NameList::const_iterator it = maps.locationList.begin(); it != maps.locationList.end(); ++it) {
+ const Private::Symbol *sym = maps.locations.getVal(*it);
+ stream->writeUint32LE(sym->u.val);
+ }
+
+ stream->writeUint32LE(inventory.size());
+ for (NameList::const_iterator it = inventory.begin(); it != inventory.end(); ++it) {
+ stream->writeString(*it);
+ stream->writeByte(0);
+ }
+
+ // Dossiers
+ stream->writeUint32LE(_dossiers.size());
+ for (DossierArray::const_iterator it = _dossiers.begin(); it != _dossiers.end(); ++it) {
+ stream->writeString(it->page1.c_str());
+ stream->writeByte(0);
+
+ if (!it->page2.empty())
+ stream->writeString(it->page2.c_str());
+ stream->writeByte(0);
+ }
+
+ // Radios
+ stream->writeUint32LE(_AMRadio.size());
+ for (SoundList::const_iterator it = _AMRadio.begin(); it != _AMRadio.end(); ++it) {
+ stream->writeString(*it);
+ stream->writeByte(0);
+ }
+ stream->writeUint32LE(_policeRadio.size());
+ for (SoundList::const_iterator it = _policeRadio.begin(); it != _policeRadio.end(); ++it) {
+ stream->writeString(*it);
+ stream->writeByte(0);
+ }
+
+ stream->writeUint32LE(_phone.size());
+ for (PhoneList::const_iterator it = _phone.begin(); it != _phone.end(); ++it) {
+ stream->writeString(it->sound);
+ stream->writeByte(0);
+ stream->writeString(*it->flag->name);
+ stream->writeByte(0);
+ stream->writeUint32LE(it->val);
+ }
+
+ // Played media
+ stream->writeString(_repeatedMovieExit);
+ stream->writeByte(0);
+
+ stream->writeUint32LE(_playedMovies.size());
+ for (PlayedMediaTable::const_iterator it = _playedMovies.begin(); it != _playedMovies.end(); ++it) {
+ stream->writeString(it->_key);
+ stream->writeByte(0);
+ }
+
+ stream->writeUint32LE(_playedPhoneClips.size());
+ for (PlayedMediaTable::const_iterator it = _playedPhoneClips.begin(); it != _playedPhoneClips.end(); ++it) {
+ stream->writeString(it->_key);
+ stream->writeByte(0);
+ }
+
+ return Common::kNoError;
}
Common::String PrivateEngine::convertPath(const Common::String &name) {
- Common::String path(name);
- Common::String s1("\\");
- Common::String s2("/");
+ Common::String path(name);
+ Common::String s1("\\");
+ Common::String s2("/");
- while (path.contains(s1))
- Common::replace(path, s1, s2);
+ while (path.contains(s1))
+ Common::replace(path, s1, s2);
- s1 = Common::String("\"");
- s2 = Common::String("");
+ s1 = Common::String("\"");
+ s2 = Common::String("");
- Common::replace(path, s1, s2);
- Common::replace(path, s1, s2);
+ Common::replace(path, s1, s2);
+ Common::replace(path, s1, s2);
- path.toLowercase();
- return path;
+ path.toLowercase();
+ return path;
}
void PrivateEngine::playSound(const Common::String &name, uint loops, bool stopOthers, bool background) {
- debugC(1, kPrivateDebugFunction, "%s(%s,%d,%d,%d)", __FUNCTION__, name.c_str(), loops, stopOthers, background);
-
- Common::File *file = new Common::File();
- Common::String path = convertPath(name);
-
- if (!file->open(path))
- error("unable to find sound file %s", path.c_str());
-
- Audio::LoopingAudioStream *stream;
- stream = new Audio::LoopingAudioStream(Audio::makeWAVStream(file, DisposeAfterUse::YES), loops);
- if (stopOthers) {
- stopSound(true);
- }
-
- Audio::SoundHandle *sh = NULL;
- if (background) {
- _mixer->stopHandle(_bgSoundHandle);
- sh = &_bgSoundHandle;
- } else {
- _mixer->stopHandle(_fgSoundHandle);
- sh = &_fgSoundHandle;
- }
-
- _mixer->playStream(Audio::Mixer::kSFXSoundType, sh, stream, -1, Audio::Mixer::kMaxChannelVolume);
+ debugC(1, kPrivateDebugFunction, "%s(%s,%d,%d,%d)", __FUNCTION__, name.c_str(), loops, stopOthers, background);
+
+ Common::File *file = new Common::File();
+ Common::String path = convertPath(name);
+
+ if (!file->open(path))
+ error("unable to find sound file %s", path.c_str());
+
+ Audio::LoopingAudioStream *stream;
+ stream = new Audio::LoopingAudioStream(Audio::makeWAVStream(file, DisposeAfterUse::YES), loops);
+ if (stopOthers) {
+ stopSound(true);
+ }
+
+ Audio::SoundHandle *sh = NULL;
+ if (background) {
+ _mixer->stopHandle(_bgSoundHandle);
+ sh = &_bgSoundHandle;
+ } else {
+ _mixer->stopHandle(_fgSoundHandle);
+ sh = &_fgSoundHandle;
+ }
+
+ _mixer->playStream(Audio::Mixer::kSFXSoundType, sh, stream, -1, Audio::Mixer::kMaxChannelVolume);
}
void PrivateEngine::playVideo(const Common::String &name) {
- debugC(1, kPrivateDebugFunction, "%s(%s)", __FUNCTION__, name.c_str());
- //stopSound(true);
- Common::File *file = new Common::File();
- Common::String path = convertPath(name);
+ debugC(1, kPrivateDebugFunction, "%s(%s)", __FUNCTION__, name.c_str());
+ //stopSound(true);
+ Common::File *file = new Common::File();
+ Common::String path = convertPath(name);
- if (!file->open(path))
- error("unable to find video file %s", path.c_str());
+ if (!file->open(path))
+ error("unable to find video file %s", path.c_str());
- if (!_videoDecoder->loadStream(file))
- error("unable to load video %s", path.c_str());
- _videoDecoder->start();
+ if (!_videoDecoder->loadStream(file))
+ error("unable to load video %s", path.c_str());
+ _videoDecoder->start();
}
void PrivateEngine::skipVideo() {
- _videoDecoder->close();
- delete _videoDecoder;
- _videoDecoder = nullptr;
+ _videoDecoder->close();
+ delete _videoDecoder;
+ _videoDecoder = nullptr;
}
void PrivateEngine::stopSound(bool all) {
- debugC(1, kPrivateDebugFunction, "%s(%d)", __FUNCTION__, all);
-
- if (all) {
- _mixer->stopHandle(_fgSoundHandle);
- _mixer->stopHandle(_bgSoundHandle);
- } else {
- _mixer->stopHandle(_fgSoundHandle);
- }
+ debugC(1, kPrivateDebugFunction, "%s(%d)", __FUNCTION__, all);
+
+ if (all) {
+ _mixer->stopHandle(_fgSoundHandle);
+ _mixer->stopHandle(_bgSoundHandle);
+ } else {
+ _mixer->stopHandle(_fgSoundHandle);
+ }
}
void PrivateEngine::loadImage(const Common::String &name, int x, int y) {
- debugC(1, kPrivateDebugFunction, "%s(%s,%d,%d)", __FUNCTION__, name.c_str(), x, y);
- Common::File file;
- Common::String path = convertPath(name);
- if (!file.open(path))
- error("unable to load image %s", path.c_str());
-
- _image->loadStream(file);
- Graphics::Surface *surf = _image->getSurface()->convertTo(_pixelFormat, _image->getPalette());
- _compositeSurface->transBlitFrom(*surf, _origin + Common::Point(x,y), _transparentColor);
- surf->free();
- delete surf;
- _image->destroy();
- //drawScreen();
+ debugC(1, kPrivateDebugFunction, "%s(%s,%d,%d)", __FUNCTION__, name.c_str(), x, y);
+ Common::File file;
+ Common::String path = convertPath(name);
+ if (!file.open(path))
+ error("unable to load image %s", path.c_str());
+
+ _image->loadStream(file);
+ Graphics::Surface *surf = _image->getSurface()->convertTo(_pixelFormat, _image->getPalette());
+ _compositeSurface->transBlitFrom(*surf, _origin + Common::Point(x,y), _transparentColor);
+ surf->free();
+ delete surf;
+ _image->destroy();
+ //drawScreen();
}
void PrivateEngine::drawScreenFrame() {
- g_system->copyRectToScreen(_frame->getPixels(), _frame->pitch, 0, 0, _screenW, _screenH);
- //surf->copyRectToSurface(*_frame, 0, 0, Common::Rect(0, 0, _screenW, _screenH));
+ g_system->copyRectToScreen(_frame->getPixels(), _frame->pitch, 0, 0, _screenW, _screenH);
+ //surf->copyRectToSurface(*_frame, 0, 0, Common::Rect(0, 0, _screenW, _screenH));
}
Graphics::ManagedSurface *PrivateEngine::loadMask(const Common::String &name, int x, int y, bool drawn) {
- debugC(1, kPrivateDebugFunction, "%s(%s,%d,%d,%d)", __FUNCTION__, name.c_str(), x, y, drawn);
- Common::File file;
- Common::String path = convertPath(name);
- if (!file.open(path))
- error("unable to load mask %s", path.c_str());
-
- _image->loadStream(file);
- Graphics::ManagedSurface *surf = new Graphics::ManagedSurface();
- surf->create(_screenW, _screenH, _pixelFormat);
- surf->fillRect(screenRect, _transparentColor);
- Graphics::Surface *csurf = _image->getSurface()->convertTo(_pixelFormat, _image->getPalette());
- surf->transBlitFrom(*csurf, Common::Point(x,y));
- csurf->free();
- delete csurf;
- _image->destroy();
-
- if (drawn) {
- drawMask(surf);
- }
-
- return surf;
+ debugC(1, kPrivateDebugFunction, "%s(%s,%d,%d,%d)", __FUNCTION__, name.c_str(), x, y, drawn);
+ Common::File file;
+ Common::String path = convertPath(name);
+ if (!file.open(path))
+ error("unable to load mask %s", path.c_str());
+
+ _image->loadStream(file);
+ Graphics::ManagedSurface *surf = new Graphics::ManagedSurface();
+ surf->create(_screenW, _screenH, _pixelFormat);
+ surf->fillRect(screenRect, _transparentColor);
+ Graphics::Surface *csurf = _image->getSurface()->convertTo(_pixelFormat, _image->getPalette());
+ surf->transBlitFrom(*csurf, Common::Point(x,y));
+ csurf->free();
+ delete csurf;
+ _image->destroy();
+
+ if (drawn) {
+ drawMask(surf);
+ }
+
+ return surf;
}
void PrivateEngine::drawMask(Graphics::ManagedSurface *surf) {
- _compositeSurface->transBlitFrom(surf->rawSurface(), _origin, _transparentColor);
- //drawScreen();
+ _compositeSurface->transBlitFrom(surf->rawSurface(), _origin, _transparentColor);
+ //drawScreen();
}
void PrivateEngine::drawScreen() {
- Graphics::ManagedSurface *surface = _compositeSurface;
-
- if (_videoDecoder) {
- const Graphics::Surface *frame = _videoDecoder->decodeNextFrame();
- //frame->create(_videoDecoder->getWidth(), _videoDecoder->getHeight(), _pixelFormat);
- //frame->copyFrom(*_videoDecoder->decodeNextFrame());
- Graphics::Surface *cframe = frame->convertTo(_pixelFormat, _videoDecoder->getPalette());
- Common::Point center((_screenW - _videoDecoder->getWidth())/2, (_screenH - _videoDecoder->getHeight())/2);
- surface->transBlitFrom(*cframe, center);
- //frame->free();
- cframe->free();
- //delete frame;
- delete cframe;
- }
-
- if (_mode == 1) {
- drawScreenFrame();
- }
-
- Common::Rect w(_origin.x, _origin.y, _screenW - _origin.x, _screenH - _origin.y);
- Graphics::Surface sa = surface->getSubArea(w);
- g_system->copyRectToScreen(sa.getPixels(), sa.pitch, _origin.x, _origin.y, sa.w, sa.h);
- //if (_image->getPalette() != nullptr)
- // g_system->getPaletteManager()->setPalette(_image->getPalette(), _image->getPaletteStartIndex(), _image->getPaletteColorCount());
- g_system->updateScreen();
+ Graphics::ManagedSurface *surface = _compositeSurface;
+
+ if (_videoDecoder) {
+ const Graphics::Surface *frame = _videoDecoder->decodeNextFrame();
+ //frame->create(_videoDecoder->getWidth(), _videoDecoder->getHeight(), _pixelFormat);
+ //frame->copyFrom(*_videoDecoder->decodeNextFrame());
+ Graphics::Surface *cframe = frame->convertTo(_pixelFormat, _videoDecoder->getPalette());
+ Common::Point center((_screenW - _videoDecoder->getWidth())/2, (_screenH - _videoDecoder->getHeight())/2);
+ surface->transBlitFrom(*cframe, center);
+ //frame->free();
+ cframe->free();
+ //delete frame;
+ delete cframe;
+ }
+
+ if (_mode == 1) {
+ drawScreenFrame();
+ }
+
+ Common::Rect w(_origin.x, _origin.y, _screenW - _origin.x, _screenH - _origin.y);
+ Graphics::Surface sa = surface->getSubArea(w);
+ g_system->copyRectToScreen(sa.getPixels(), sa.pitch, _origin.x, _origin.y, sa.w, sa.h);
+ //if (_image->getPalette() != nullptr)
+ // g_system->getPaletteManager()->setPalette(_image->getPalette(), _image->getPaletteStartIndex(), _image->getPaletteColorCount());
+ g_system->updateScreen();
}
bool PrivateEngine::getRandomBool(uint p) {
- uint r = _rnd->getRandomNumber(100);
- return (r <= p);
+ uint r = _rnd->getRandomNumber(100);
+ return (r <= p);
}
Common::String PrivateEngine::getPaperShuffleSound() {
- uint r = _rnd->getRandomNumber(6);
- return Common::String::format("%sglsfx0%d.wav", _globalAudioPath.c_str(), kPaperShuffleSound[r]);
+ uint r = _rnd->getRandomNumber(6);
+ return Common::String::format("%sglsfx0%d.wav", _globalAudioPath.c_str(), kPaperShuffleSound[r]);
}
Common::String PrivateEngine::getTakeSound() {
- if (isDemo())
- return (_globalAudioPath + "mvo007.wav");
+ if (isDemo())
+ return (_globalAudioPath + "mvo007.wav");
- uint r = _rnd->getRandomNumber(4) + 1;
- return Common::String::format("%stook%d.wav", _globalAudioPath.c_str(), r);
+ uint r = _rnd->getRandomNumber(4) + 1;
+ return Common::String::format("%stook%d.wav", _globalAudioPath.c_str(), r);
}
Common::String PrivateEngine::getTakeLeaveSound() {
- uint r = _rnd->getRandomNumber(1);
- if (r == 0) {
- return (_globalAudioPath + "mvo001.wav");
- } else {
- return (_globalAudioPath + "mvo006.wav");
- }
+ uint r = _rnd->getRandomNumber(1);
+ if (r == 0) {
+ return (_globalAudioPath + "mvo001.wav");
+ } else {
+ return (_globalAudioPath + "mvo006.wav");
+ }
}
Common::String PrivateEngine::getLeaveSound() {
- if (isDemo())
- return (_globalAudioPath + "mvo008.wav");
+ if (isDemo())
+ return (_globalAudioPath + "mvo008.wav");
- uint r = _rnd->getRandomNumber(4) + 1;
- return Common::String::format("%sleft%d.wav", _globalAudioPath.c_str(), r);
+ uint r = _rnd->getRandomNumber(4) + 1;
+ return Common::String::format("%sleft%d.wav", _globalAudioPath.c_str(), r);
}
Common::String PrivateEngine::getRandomPhoneClip(const char *clip, int i, int j) {
- uint r = i + _rnd->getRandomNumber(j - i);
- return Common::String::format("%s%02d", clip, r);
+ uint r = i + _rnd->getRandomNumber(j - i);
+ return Common::String::format("%s%02d", clip, r);
}
// Timers
static void timerCallback(void *refCon) {
- g_private->removeTimer();
- g_private->_nextSetting = *(Common::String *)refCon;
+ g_private->removeTimer();
+ g_private->_nextSetting = *(Common::String *)refCon;
}
bool PrivateEngine::installTimer(uint32 delay, Common::String *ns) {
- return g_system->getTimerManager()->installTimerProc(&timerCallback, delay, (void *)ns, "timerCallback");
+ return g_system->getTimerManager()->installTimerProc(&timerCallback, delay, (void *)ns, "timerCallback");
}
void PrivateEngine::removeTimer() {
- g_system->getTimerManager()->removeTimerProc(&timerCallback);
+ g_system->getTimerManager()->removeTimerProc(&timerCallback);
}
// Diary
void PrivateEngine::loadLocations(const Common::Rect &rect) {
- uint32 i = 0;
- int16 offset = 44;
- for (NameList::const_iterator it = maps.locationList.begin(); it != maps.locationList.end(); ++it) {
- const Private::Symbol *sym = maps.locations.getVal(*it);
- i++;
- if (sym->u.val) {
- offset = offset + 22;
- Common::String s =
- Common::String::format("%sdryloc%d.bmp", _diaryLocPrefix.c_str(), i);
-
- loadMask(s, rect.left + 120, rect.top + offset, true);
- }
- }
+ uint32 i = 0;
+ int16 offset = 44;
+ for (NameList::const_iterator it = maps.locationList.begin(); it != maps.locationList.end(); ++it) {
+ const Private::Symbol *sym = maps.locations.getVal(*it);
+ i++;
+ if (sym->u.val) {
+ offset = offset + 22;
+ Common::String s =
+ Common::String::format("%sdryloc%d.bmp", _diaryLocPrefix.c_str(), i);
+
+ loadMask(s, rect.left + 120, rect.top + offset, true);
+ }
+ }
}
void PrivateEngine::loadInventory(uint32 x, const Common::Rect &r1, const Common::Rect &r2) {
- int16 offset = 0;
- for (NameList::const_iterator it = inventory.begin(); it != inventory.end(); ++it) {
- offset = offset + 22;
- //debug("%hd %hd", rect->left, rect->top + offset);
- loadMask(*it, r1.left, r1.top + offset, true);
- }
+ int16 offset = 0;
+ for (NameList::const_iterator it = inventory.begin(); it != inventory.end(); ++it) {
+ offset = offset + 22;
+ //debug("%hd %hd", rect->left, rect->top + offset);
+ loadMask(*it, r1.left, r1.top + offset, true);
+ }
}
} // End of namespace Private
diff --git a/engines/private/private.h b/engines/private/private.h
index 334e5362e2..5706a49d96 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -46,9 +46,9 @@ namespace Private {
// debug channels
enum {
- kPrivateDebugFunction = 1 << 0,
- kPrivateDebugCode = 1 << 1,
- kPrivateDebugScript = 1 << 2
+ kPrivateDebugFunction = 1 << 0,
+ kPrivateDebugCode = 1 << 1,
+ kPrivateDebugScript = 1 << 2
};
// sounds
@@ -81,18 +81,18 @@ static const char *kStartGame = "kStartGame";
// structs
typedef struct ExitInfo {
- Common::String nextSetting;
- Common::Rect rect;
- Common::String cursor;
+ Common::String nextSetting;
+ Common::Rect rect;
+ Common::String cursor;
} ExitInfo;
typedef struct MaskInfo {
- Graphics::ManagedSurface *surf;
- Common::String nextSetting;
- Common::Point point;
- Symbol *flag1;
- Symbol *flag2;
- Common::String cursor;
+ Graphics::ManagedSurface *surf;
+ Common::String nextSetting;
+ Common::Point point;
+ Symbol *flag1;
+ Symbol *flag2;
+ Common::String cursor;
void clear() {
surf = nullptr;
@@ -105,21 +105,21 @@ typedef struct MaskInfo {
} MaskInfo;
typedef struct PhoneInfo {
- Common::String sound;
- Symbol *flag;
- int val;
+ Common::String sound;
+ Symbol *flag;
+ int val;
} PhoneInfo;
typedef struct DossierInfo {
- Common::String page1;
- Common::String page2;
+ Common::String page1;
+ Common::String page2;
} DossierInfo;
// funcs
typedef struct FuncTable {
- void (*func)(Private::ArgArray);
- const char *name;
+ void (*func)(Private::ArgArray);
+ const char *name;
} FunctTable;
typedef Common::HashMap<Common::String, void *> NameToPtr;
@@ -146,174 +146,174 @@ typedef Common::HashMap<Common::String, Common::Point> CursorPointMap;
class PrivateEngine : public Engine {
private:
- Common::RandomSource *_rnd;
- Graphics::PixelFormat _pixelFormat;
- Image::ImageDecoder *_image;
- int _screenW, _screenH;
+ Common::RandomSource *_rnd;
+ Graphics::PixelFormat _pixelFormat;
+ Image::ImageDecoder *_image;
+ int _screenW, _screenH;
public:
- PrivateEngine(OSystem *syst, const ADGameDescription *gd);
- ~PrivateEngine();
-
- const ADGameDescription *_gameDescription;
- bool isDemo() const;
-
- SymbolMaps maps;
-
- Audio::SoundHandle _fgSoundHandle;
- Audio::SoundHandle _bgSoundHandle;
- Video::SmackerDecoder *_videoDecoder;
- Common::InstallShieldV3 _installerArchive;
-
- Common::Error run() override;
- void restartGame();
- void clearAreas();
- void initializePath(const Common::FSNode &gamePath) override;
-
- // Functions
-
- NameToPtr _functions;
- void initFuncs();
-
- // User input
- void selectPauseMovie(Common::Point);
- void selectMask(Common::Point);
- void selectExit(Common::Point);
- void selectLoadGame(Common::Point);
- void selectSaveGame(Common::Point);
-
- // Cursors
- bool cursorPauseMovie(Common::Point);
- bool cursorExit(Common::Point);
- bool cursorMask(Common::Point);
-
- bool hasFeature(EngineFeature f) const override;
- bool canLoadGameStateCurrently() override {
- return true;
- }
- bool canSaveAutosaveCurrently() override {
- return false;
- }
- bool canSaveGameStateCurrently() override {
- return true;
- }
-
- Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
- Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
- void syncGameStream(Common::Serializer &s);
-
- Common::String convertPath(const Common::String &);
- void playVideo(const Common::String &);
- void skipVideo();
-
- void loadImage(const Common::String &file, int x, int y);
- void drawScreenFrame();
-
- void changeCursor(const Common::String &);
- void initCursors();
-
- // Rendering
- Graphics::ManagedSurface *_compositeSurface;
- Graphics::ManagedSurface *loadMask(const Common::String &, int, int, bool);
- void drawMask(Graphics::ManagedSurface *);
- bool inMask(Graphics::ManagedSurface *, Common::Point);
- uint32 _transparentColor;
- Common::Rect screenRect;
- Common::String _framePath;
- Graphics::Surface *_frame;
- Common::String _nextVS;
- void drawScreen();
-
- // settings
- Common::String _nextSetting;
- Common::String _pausedSetting;
- Common::String _currentSetting;
-
- Common::String _nextMovie;
- Common::Point _origin;
- bool _toTake;
-
- // Dossiers
- DossierArray _dossiers;
- unsigned int _dossierSuspect;
- unsigned int _dossierPage;
- MaskInfo _dossierNextSuspectMask;
- MaskInfo _dossierPrevSuspectMask;
- bool selectDossierNextSuspect(Common::Point);
- bool selectDossierPrevSuspect(Common::Point);
- void loadDossier();
-
- // Police Bust
- void policeBust();
- bool _policeBustEnabled;
- void startPoliceBust();
- void checkPoliceBust();
- int _numberClicks;
- int _maxNumberClicks;
- int _sirenWarning;
- Common::String _policeBustSetting;
-
- // Diary
- InvList inventory;
- Common::String _diaryLocPrefix;
- void loadLocations(const Common::Rect &);
- void loadInventory(uint32, const Common::Rect &, const Common::Rect &);
-
- // Save/Load games
- MaskInfo _saveGameMask;
- MaskInfo _loadGameMask;
-
- int _mode;
- bool _modified;
-
- PlayedMediaTable _playedMovies;
- PlayedMediaTable _playedPhoneClips;
- Common::String _repeatedMovieExit;
-
- // Masks/Exits
- ExitList _exits;
- MaskList _masks;
-
- // Sounds
- void playSound(const Common::String &, uint, bool, bool);
- void stopSound(bool);
- bool _noStopSounds;
-
- Common::String getPaperShuffleSound();
- Common::String _globalAudioPath;
-
- Common::String getTakeSound();
- Common::String getTakeLeaveSound();
- Common::String getLeaveSound();
- Common::String _sirenSound;
-
- // Radios
- Common::String _infaceRadioPath;
- MaskInfo _AMRadioArea;
- MaskInfo _policeRadioArea;
- MaskInfo _phoneArea;
- Common::String _phonePrefix;
- Common::String _phoneCallSound;
- SoundList _AMRadio;
- SoundList _policeRadio;
- PhoneList _phone;
-
- Common::String getRandomPhoneClip(const char *, int, int);
- void selectAMRadioArea(Common::Point);
- void selectPoliceRadioArea(Common::Point);
- void selectPhoneArea(Common::Point);
- void checkPhoneCall();
-
- // Random values
- bool getRandomBool(uint);
-
- // Timers
- bool installTimer(uint32, Common::String *);
- void removeTimer();
-
- // Cursors
- CursorDataMap _cursorData;
- CursorPointMap _cursorPoints;
+ PrivateEngine(OSystem *syst, const ADGameDescription *gd);
+ ~PrivateEngine();
+
+ const ADGameDescription *_gameDescription;
+ bool isDemo() const;
+
+ SymbolMaps maps;
+
+ Audio::SoundHandle _fgSoundHandle;
+ Audio::SoundHandle _bgSoundHandle;
+ Video::SmackerDecoder *_videoDecoder;
+ Common::InstallShieldV3 _installerArchive;
+
+ Common::Error run() override;
+ void restartGame();
+ void clearAreas();
+ void initializePath(const Common::FSNode &gamePath) override;
+
+ // Functions
+
+ NameToPtr _functions;
+ void initFuncs();
+
+ // User input
+ void selectPauseMovie(Common::Point);
+ void selectMask(Common::Point);
+ void selectExit(Common::Point);
+ void selectLoadGame(Common::Point);
+ void selectSaveGame(Common::Point);
+
+ // Cursors
+ bool cursorPauseMovie(Common::Point);
+ bool cursorExit(Common::Point);
+ bool cursorMask(Common::Point);
+
+ bool hasFeature(EngineFeature f) const override;
+ bool canLoadGameStateCurrently() override {
+ return true;
+ }
+ bool canSaveAutosaveCurrently() override {
+ return false;
+ }
+ bool canSaveGameStateCurrently() override {
+ return true;
+ }
+
+ Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
+ Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
+ void syncGameStream(Common::Serializer &s);
+
+ Common::String convertPath(const Common::String &);
+ void playVideo(const Common::String &);
+ void skipVideo();
+
+ void loadImage(const Common::String &file, int x, int y);
+ void drawScreenFrame();
+
+ void changeCursor(const Common::String &);
+ void initCursors();
+
+ // Rendering
+ Graphics::ManagedSurface *_compositeSurface;
+ Graphics::ManagedSurface *loadMask(const Common::String &, int, int, bool);
+ void drawMask(Graphics::ManagedSurface *);
+ bool inMask(Graphics::ManagedSurface *, Common::Point);
+ uint32 _transparentColor;
+ Common::Rect screenRect;
+ Common::String _framePath;
+ Graphics::Surface *_frame;
+ Common::String _nextVS;
+ void drawScreen();
+
+ // settings
+ Common::String _nextSetting;
+ Common::String _pausedSetting;
+ Common::String _currentSetting;
+
+ Common::String _nextMovie;
+ Common::Point _origin;
+ bool _toTake;
+
+ // Dossiers
+ DossierArray _dossiers;
+ unsigned int _dossierSuspect;
+ unsigned int _dossierPage;
+ MaskInfo _dossierNextSuspectMask;
+ MaskInfo _dossierPrevSuspectMask;
+ bool selectDossierNextSuspect(Common::Point);
+ bool selectDossierPrevSuspect(Common::Point);
+ void loadDossier();
+
+ // Police Bust
+ void policeBust();
+ bool _policeBustEnabled;
+ void startPoliceBust();
+ void checkPoliceBust();
+ int _numberClicks;
+ int _maxNumberClicks;
+ int _sirenWarning;
+ Common::String _policeBustSetting;
+
+ // Diary
+ InvList inventory;
+ Common::String _diaryLocPrefix;
+ void loadLocations(const Common::Rect &);
+ void loadInventory(uint32, const Common::Rect &, const Common::Rect &);
+
+ // Save/Load games
+ MaskInfo _saveGameMask;
+ MaskInfo _loadGameMask;
+
+ int _mode;
+ bool _modified;
+
+ PlayedMediaTable _playedMovies;
+ PlayedMediaTable _playedPhoneClips;
+ Common::String _repeatedMovieExit;
+
+ // Masks/Exits
+ ExitList _exits;
+ MaskList _masks;
+
+ // Sounds
+ void playSound(const Common::String &, uint, bool, bool);
+ void stopSound(bool);
+ bool _noStopSounds;
+
+ Common::String getPaperShuffleSound();
+ Common::String _globalAudioPath;
+
+ Common::String getTakeSound();
+ Common::String getTakeLeaveSound();
+ Common::String getLeaveSound();
+ Common::String _sirenSound;
+
+ // Radios
+ Common::String _infaceRadioPath;
+ MaskInfo _AMRadioArea;
+ MaskInfo _policeRadioArea;
+ MaskInfo _phoneArea;
+ Common::String _phonePrefix;
+ Common::String _phoneCallSound;
+ SoundList _AMRadio;
+ SoundList _policeRadio;
+ PhoneList _phone;
+
+ Common::String getRandomPhoneClip(const char *, int, int);
+ void selectAMRadioArea(Common::Point);
+ void selectPoliceRadioArea(Common::Point);
+ void selectPhoneArea(Common::Point);
+ void checkPhoneCall();
+
+ // Random values
+ bool getRandomBool(uint);
+
+ // Timers
+ bool installTimer(uint32, Common::String *);
+ void removeTimer();
+
+ // Cursors
+ CursorDataMap _cursorData;
+ CursorPointMap _cursorPoints;
};
extern PrivateEngine *g_private;
diff --git a/engines/private/symbol.cpp b/engines/private/symbol.cpp
index 4952f6f266..b25564251d 100644
--- a/engines/private/symbol.cpp
+++ b/engines/private/symbol.cpp
@@ -52,129 +52,129 @@
namespace Private {
void SymbolMaps::defineSymbol(const char *n, Common::Rect *r) {
- Common::String s(n);
- stringToDefine.push(s);
- rectToDefine.push(r);
+ Common::String s(n);
+ stringToDefine.push(s);
+ rectToDefine.push(r);
}
/*
static void showSymbol(const Symbol *s) {
- if (s->type == NUM)
- debugC(1, kPrivateDebugCode, "%s %d",s->name->c_str(), s->u.val);
- else if (s->type == STRING)
- debugC(1, kPrivateDebugCode, "%s %s", s->name->c_str(), s->u.str);
- else if (s->type == NAME)
- debugC(1, kPrivateDebugCode, "%s %d",s->name->c_str(), s->type);
- else
- debugC(1, kPrivateDebugCode, "%s %d", s->name->c_str(), s->type);
+ if (s->type == NUM)
+ debugC(1, kPrivateDebugCode, "%s %d",s->name->c_str(), s->u.val);
+ else if (s->type == STRING)
+ debugC(1, kPrivateDebugCode, "%s %s", s->name->c_str(), s->u.str);
+ else if (s->type == NAME)
+ debugC(1, kPrivateDebugCode, "%s %d",s->name->c_str(), s->type);
+ else
+ debugC(1, kPrivateDebugCode, "%s %d", s->name->c_str(), s->type);
}
*/
void setSymbol(Symbol *s, int v) {
- s->u.val = v;
+ s->u.val = v;
}
/* find s in symbol table symlist */
static Symbol *lookup(const Common::String &s, SymbolMap symlist) {
- Symbol *r = symlist.getVal(s);
- return r;
+ Symbol *r = symlist.getVal(s);
+ return r;
}
/* install some symbol s in a symbol table */
static Symbol *install(const Common::String &n, int t, int d, const char *s, Common::Rect *r, SymbolMap *symlist) {
- Common::String *name = new Common::String(n);
-
- Symbol *sp;
-
- sp = (Symbol *)malloc(sizeof(Symbol));
- sp->name = name;
- sp->type = t;
- if (t == NUM || t == NAME)
- sp->u.val = d;
- else if (t == STRING)
- sp->u.str = scumm_strdup(s); // FIXME: leaks a string here.
- else if (t == RECT)
- sp->u.rect = r;
- else
- assert(0);
-
- symlist->setVal(n, sp);
- assert(symlist->size() > 0);
- return sp;
+ Common::String *name = new Common::String(n);
+
+ Symbol *sp;
+
+ sp = (Symbol *)malloc(sizeof(Symbol));
+ sp->name = name;
+ sp->type = t;
+ if (t == NUM || t == NAME)
+ sp->u.val = d;
+ else if (t == STRING)
+ sp->u.str = scumm_strdup(s); // FIXME: leaks a string here.
+ else if (t == RECT)
+ sp->u.rect = r;
+ else
+ assert(0);
+
+ symlist->setVal(n, sp);
+ assert(symlist->size() > 0);
+ return sp;
}
/* lookup some name in some symbol table */
Symbol *SymbolMaps::lookupName(const char *n) {
- //debug("looking up %s", n);
- Common::String s(n);
+ //debug("looking up %s", n);
+ Common::String s(n);
- if (settings.contains(s))
- return lookup(s, settings);
+ if (settings.contains(s))
+ return lookup(s, settings);
- else if (variables.contains(s))
- return lookup(s, variables);
+ else if (variables.contains(s))
+ return lookup(s, variables);
- else if (cursors.contains(s))
- return lookup(s, cursors);
+ else if (cursors.contains(s))
+ return lookup(s, cursors);
- else if (locations.contains(s))
- return lookup(s, locations);
+ else if (locations.contains(s))
+ return lookup(s, locations);
- else if (rects.contains(s))
- return lookup(s, rects);
+ else if (rects.contains(s))
+ return lookup(s, rects);
- else {
- debugC(1, kPrivateDebugCode, "WARNING: %s not defined", s.c_str());
- return constant(STRING, 0, s.c_str());
- }
+ else {
+ debugC(1, kPrivateDebugCode, "WARNING: %s not defined", s.c_str());
+ return constant(STRING, 0, s.c_str());
+ }
}
void SymbolMaps::installAll(const char *n) {
- assert(stringToDefine.size() > 0);
+ assert(stringToDefine.size() > 0);
- while (!stringToDefine.empty()) {
- Common::String s = stringToDefine.pop();
+ while (!stringToDefine.empty()) {
+ Common::String s = stringToDefine.pop();
Common::Rect *r = rectToDefine.pop();
- //debug("name %s", s.c_str());
- if (strcmp(n, "settings") == 0) {
- assert(r == NULL);
- install(s, STRING, 0, s.c_str(), r, &settings);
- } else if (strcmp(n, "variables") == 0) {
- assert(r == NULL);
- install(s, NAME, 0, NULL, r, &variables);
- variableList.push_front(s);
- } else if (strcmp(n, "cursors") == 0) {
- assert(r == NULL);
- install(s, NAME, 0, NULL, r, &cursors);
- } else if (strcmp(n, "locations") == 0) {
- assert(r == NULL);
- install(s, NAME, 0, NULL, r, &locations);
- locationList.push_front(s);
- } else if (strcmp(n, "rects") == 0) {
- assert(r != NULL);
- install(s, RECT, 0, NULL, r, &rects);
- } else
- error("invalid symbol type");
- }
+ //debug("name %s", s.c_str());
+ if (strcmp(n, "settings") == 0) {
+ assert(r == NULL);
+ install(s, STRING, 0, s.c_str(), r, &settings);
+ } else if (strcmp(n, "variables") == 0) {
+ assert(r == NULL);
+ install(s, NAME, 0, NULL, r, &variables);
+ variableList.push_front(s);
+ } else if (strcmp(n, "cursors") == 0) {
+ assert(r == NULL);
+ install(s, NAME, 0, NULL, r, &cursors);
+ } else if (strcmp(n, "locations") == 0) {
+ assert(r == NULL);
+ install(s, NAME, 0, NULL, r, &locations);
+ locationList.push_front(s);
+ } else if (strcmp(n, "rects") == 0) {
+ assert(r != NULL);
+ install(s, RECT, 0, NULL, r, &rects);
+ } else
+ error("invalid symbol type");
+ }
}
Symbol *SymbolMaps::constant(int t, int d, const char *s) {
- Symbol *sp;
- Common::String *n = new Common::String("<constant>");
-
- sp = (Symbol *)malloc(sizeof(Symbol));
- sp->name = n;
- sp->type = t;
- if (t == NUM || t == NAME)
- sp->u.val = d;
- else if (t == STRING)
- sp->u.str = s;
- else
- assert(0);
-
- constants.push_front(sp);
- return sp;
+ Symbol *sp;
+ Common::String *n = new Common::String("<constant>");
+
+ sp = (Symbol *)malloc(sizeof(Symbol));
+ sp->name = n;
+ sp->type = t;
+ if (t == NUM || t == NAME)
+ sp->u.val = d;
+ else if (t == STRING)
+ sp->u.str = s;
+ else
+ assert(0);
+
+ constants.push_front(sp);
+ return sp;
}
} // End of namespace Private
diff --git a/engines/private/symbol.h b/engines/private/symbol.h
index 47467ab9a5..ae601b2e15 100644
--- a/engines/private/symbol.h
+++ b/engines/private/symbol.h
@@ -33,14 +33,14 @@
namespace Private {
-typedef struct Symbol { /* symbol table entry */
- Common::String *name;
- short type; /* NAME, NUM, STRING or RECT */
- union {
- int val; /* NAME or NUM */
- const char *str; /* STRING */
- Common::Rect *rect; /* RECT */
- } u;
+typedef struct Symbol { /* symbol table entry */
+ Common::String *name;
+ short type; /* NAME, NUM, STRING or RECT */
+ union {
+ int val; /* NAME or NUM */
+ const char *str; /* STRING */
+ Common::Rect *rect; /* RECT */
+ } u;
} Symbol;
// Symbols
@@ -56,24 +56,24 @@ typedef Common::Queue<Common::Rect *> RectQueue;
class SymbolMaps {
private:
- StringQueue stringToDefine;
- RectQueue rectToDefine;
+ StringQueue stringToDefine;
+ RectQueue rectToDefine;
public:
- SymbolMap settings;
- SymbolMap variables;
- SymbolMap cursors;
- SymbolMap locations;
- SymbolMap rects;
- ConstantList constants;
-
- NameList variableList;
- NameList locationList;
+ SymbolMap settings;
+ SymbolMap variables;
+ SymbolMap cursors;
+ SymbolMap locations;
+ SymbolMap rects;
+ ConstantList constants;
- Symbol *constant(int t, int d, const char *s);
- Symbol *lookupName(const char *n);
- void installAll(const char *n);
- void defineSymbol(const char *, Common::Rect *);
+ NameList variableList;
+ NameList locationList;
+
+ Symbol *constant(int t, int d, const char *s);
+ Symbol *lookupName(const char *n);
+ void installAll(const char *n);
+ void defineSymbol(const char *, Common::Rect *);
};
} // End of namespace Private
More information about the Scummvm-git-logs
mailing list