aboutsummaryrefslogtreecommitdiff
path: root/scumm/script_v2.cpp
diff options
context:
space:
mode:
authorMax Horn2003-05-08 22:44:46 +0000
committerMax Horn2003-05-08 22:44:46 +0000
commitc63ec9d0084f341c39118cfe8d5a01434bc9bbf5 (patch)
tree5804dc9e67adc749a3fc770d886c66db2248540d /scumm/script_v2.cpp
parent4d7f7a8c80fdf78cf29f8517546a5a2a89694bab (diff)
downloadscummvm-rg350-c63ec9d0084f341c39118cfe8d5a01434bc9bbf5.tar.gz
scummvm-rg350-c63ec9d0084f341c39118cfe8d5a01434bc9bbf5.tar.bz2
scummvm-rg350-c63ec9d0084f341c39118cfe8d5a01434bc9bbf5.zip
added a v2 charset rendered (with a hardcoded font take from german zak); enabled verbs in zak (well, they are drawn at least :-)
svn-id: r7398
Diffstat (limited to 'scumm/script_v2.cpp')
-rw-r--r--scumm/script_v2.cpp59
1 files changed, 50 insertions, 9 deletions
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index ae6ea37aaa..1e7adcee50 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -728,31 +728,72 @@ void Scumm_v2::o2_resourceRoutines() {
void Scumm_v2::o2_verbOps() {
int opcode = fetchScriptByte();
- int slot, state;
+ int verb, slot, state;
switch (opcode) {
case 0: // Delete Verb
- slot = getVarOrDirectByte(0x80);
+ verb = getVarOrDirectByte(0x80);
+ slot = getVerbSlot(verb, 0);
+
+ printf("o2_verbOps delete verb = %d, slot = %d\n", verb, slot);
+ killVerb(slot);
break;
case 0xFF: // Verb On/Off
- slot = fetchScriptByte();
+ verb = fetchScriptByte();
state = fetchScriptByte();
+ slot = getVerbSlot(verb, 0);
+
+ printf("o2_verbOps Verb On/Off: verb = %d, slot = %d, state = %d\n", verb, slot, state);
+
+ _verbs[slot].curmode = state;
+
break;
default: { // New Verb
- int x = fetchScriptByte();
- int y = fetchScriptByte();
- slot = getVarOrDirectByte(0x80);
+ int x = fetchScriptByte() << 3;
+ int y = fetchScriptByte() << 3;
+ verb = getVarOrDirectByte(0x80);
int unk = fetchScriptByte(); // ?
- // It follows the verb name
printf("o2_verbOps: opcode = %d, x = %d, y = %d, slot = %d, unk = %d, name = %s\n",
- opcode, x, y, slot, unk, _scriptPointer);
- _scriptPointer += strlen((char *)_scriptPointer) + 1;
+ opcode, x, y, verb, unk, _scriptPointer);
+
+ VerbSlot *vs;
+ slot = getVerbSlot(verb, 0);
+ if (slot == 0) {
+ for (slot = 1; slot < _maxVerbs; slot++) {
+ if (_verbs[slot].verbid == 0)
+ break;
+ }
+ if (slot == _maxVerbs)
+ error("Too many verbs");
+ }
+ vs = &_verbs[slot];
+ vs->verbid = verb;
+ vs->color = 2;
+ vs->hicolor = 0;
+ vs->dimcolor = 8;
+ vs->type = kTextVerbType;
+ vs->charset_nr = _string[0].t_charset;
+ vs->curmode = 1;
+ vs->saveid = 0;
+ vs->key = 0;
+ vs->center = 0;
+ vs->imgindex = 0;
+
+ vs->x = x;
+ vs->y = y;
+
+ // It follows the verb name
+ loadPtrToResource(rtVerb, slot, NULL);
}
break;
}
+
+ // FIXME - hack!
+ drawVerb(slot, 0);
+ verbMouseOver(0);
}
void Scumm_v2::o2_doSentence() {