diff options
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/debugger.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v8.cpp | 20 |
2 files changed, 16 insertions, 6 deletions
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index 348b046bf4..63b3d87d0d 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -524,7 +524,7 @@ bool ScummDebugger::Cmd_ImportRes(int argc, const char** argv) { bool ScummDebugger::Cmd_PrintScript(int argc, const char **argv) { int i; - ScriptSlot *ss = &_s->vm.slot[0]; + ScriptSlot *ss = _s->vm.slot; Debug_Printf("+--------------------------------------+\n"); Debug_Printf("|# | num | offset|sta|typ|fr|rec|fc|cut|\n"); Debug_Printf("+--+-----+-------+---+---+--+--+---+---+\n"); diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index f6e0615d15..1a0903e64b 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1696,17 +1696,27 @@ void Scumm_v8::o8_getObjectImageHeight() { void Scumm_v8::o8_getStringWidth() { int charset = pop(); - int len = resStrLen(_scriptPointer); int oldID = _charset->getCurID(); int width; + const byte *msg = _scriptPointer; + // Skip to the next instruction + _scriptPointer += resStrLen(_scriptPointer) + 1; + + if (msg[0] == '/') { + translateText(msg, _transText); + msg = _transText; + } + + // Temporary set the specified charset id - _charset->setCurID(charset); - width = _charset->getStringWidth(0, _scriptPointer); + _charset->setCurID(_string[charset].charset); + // Determine the strings width + width = _charset->getStringWidth(0, msg); + // Revert to old font _charset->setCurID(oldID); - + push(width); - _scriptPointer += len + 1; } void Scumm_v8::o8_drawObject() { |