aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-05-27 15:33:38 +0000
committerMax Horn2003-05-27 15:33:38 +0000
commitaf2574c02d23e220010bc727b3488a1aeaed78d1 (patch)
treeb3537b3bb5f696c5723dd6a8d8b8772073c4aa40
parent052a482f4083d70f009cc0cd6c126fb4b8c92134 (diff)
downloadscummvm-rg350-af2574c02d23e220010bc727b3488a1aeaed78d1.tar.gz
scummvm-rg350-af2574c02d23e220010bc727b3488a1aeaed78d1.tar.bz2
scummvm-rg350-af2574c02d23e220010bc727b3488a1aeaed78d1.zip
fixed o8_getStringWidth (should fix bug #741625)
svn-id: r8035
-rw-r--r--scumm/debugger.cpp2
-rw-r--r--scumm/script_v8.cpp20
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() {