aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2013-01-20 20:49:08 +0100
committerStrangerke2013-01-20 20:49:08 +0100
commit2c69135c99e088957306675431c34bdf0c3dbde3 (patch)
tree713b6b6379a909d3cf2740b4b1d7ca9a72a77bdd
parentd92f85f0e1f3fb2ea29cf5fd8827ae75ac2d0f96 (diff)
downloadscummvm-rg350-2c69135c99e088957306675431c34bdf0c3dbde3.tar.gz
scummvm-rg350-2c69135c99e088957306675431c34bdf0c3dbde3.tar.bz2
scummvm-rg350-2c69135c99e088957306675431c34bdf0c3dbde3.zip
HOPKINS: Get rid of GOTOs in FontManager
-rw-r--r--engines/hopkins/font.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp
index bae47957dc..e7d100b380 100644
--- a/engines/hopkins/font.cpp
+++ b/engines/hopkins/font.cpp
@@ -204,8 +204,6 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
WRITE_LE_UINT16((uint16 *)v9 + 48, (int16)READ_LE_UINT16(v10 + 96));
}
byte *v59 = _tempText;
- if (!v69)
- goto LABEL_43;
for (int v63 = 0; v63 < v69; v63++) {
byte v13 = *v59;
if ((byte)(*v59 + 46) > 27) {
@@ -222,8 +220,8 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
v59++;
};
+ int textLength = 0;
if (v69) {
- int textLength = 0;
for (;;) {
byte curChar = _tempText[textLength];
if (curChar == '\r' || curChar == '\n') {
@@ -233,8 +231,11 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
}
++textLength;
if (v69 <= textLength)
- goto LABEL_43;
+ break;
}
+ }
+
+ if (v69 && v69 > textLength) {
_text[idx]._length = textLength;
_vm->_globals._boxWidth = 0;
@@ -257,7 +258,6 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
_text[idx]._lines[0] = Common::String((const char *)_tempText, textLength);
}
} else {
-LABEL_43:
if (!_vm->_globals._boxWidth)
_vm->_globals._boxWidth = 240;
int v65 = 0;
@@ -271,21 +271,16 @@ LABEL_43:
do
curChar = _tempText[v65 + v19++];
while (curChar != ' ' && curChar != '%');
- if (v19 >= ptrb / _vm->_globals.police_l)
+ if (v19 >= ptrb / _vm->_globals.police_l) {
+ if (curChar == '%')
+ curChar = ' ';
break;
+ }
if (curChar == '%') {
- if (v19 < ptrb / _vm->_globals.police_l)
- goto LABEL_55;
+ lineSize = v19;
break;
}
}
- if (curChar != '%')
- goto LABEL_57;
- curChar = ' ';
-LABEL_55:
- if (curChar == '%')
- lineSize = v19;
-LABEL_57:
int v20 = lineCount;
// WORKAROUND: Perhaps due to the usage of ScummVM strings here, recalculate what the