diff options
author | Strangerke | 2013-01-28 22:36:11 +0100 |
---|---|---|
committer | Strangerke | 2013-01-28 22:36:11 +0100 |
commit | 11a0f00c2571d37742db194cdc92fac25283d8eb (patch) | |
tree | 3e9201c35c86ef6221957cbb5ab0b7054700a49d | |
parent | c0ad052c727650464419318a760e08bb7d152072 (diff) | |
download | scummvm-rg350-11a0f00c2571d37742db194cdc92fac25283d8eb.tar.gz scummvm-rg350-11a0f00c2571d37742db194cdc92fac25283d8eb.tar.bz2 scummvm-rg350-11a0f00c2571d37742db194cdc92fac25283d8eb.zip |
HOPKINS: Add hack to improve the display of text on the computers, for the BeOS and OS/2 versions
-rw-r--r-- | engines/hopkins/computer.cpp | 2 | ||||
-rw-r--r-- | engines/hopkins/font.cpp | 22 |
2 files changed, 20 insertions, 4 deletions
diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp index eef4a64f3e..b4b89f7dac 100644 --- a/engines/hopkins/computer.cpp +++ b/engines/hopkins/computer.cpp @@ -83,10 +83,10 @@ void ComputerManager::setTextMode() { Common::File f; if (!f.exists(filename)) filename = "FONTE.SPR"; // Used by the BeOS and OS/2 versions as an alternative - _vm->_globals.police = _vm->_fileManager.loadFile(filename); _vm->_globals.police_l = 8; _vm->_globals.police_h = 8; + _vm->_graphicsManager.loadImage("WINTEXT"); _vm->_graphicsManager.fadeInLong(); loadMenu(); diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp index 1077cad865..faa77377f1 100644 --- a/engines/hopkins/font.cpp +++ b/engines/hopkins/font.cpp @@ -464,9 +464,25 @@ void FontManager::renderTextDisplay(int xp, int yp, const Common::String &msg, i if (curChar >= 32) { byte printChar = curChar - 32; _vm->_graphicsManager.displayFont(_vm->_graphicsManager._vesaBuffer, _vm->_globals.police, charEndPosX, yp, printChar, fontCol); - charEndPosX += _vm->_objectsManager.getWidth(_vm->_globals.police, printChar); - int charWidth = _vm->_objectsManager.getWidth(_vm->_globals.police, printChar); - _vm->_graphicsManager.addVesaSegment(charEndPosX - charWidth, yp, charEndPosX, yp + 12); + + // UGLY HACK: For some obscure reason, the BeOS and OS/2 versions use another font file, which doesn't have variable width. + // All the fonts have a length of 9, which results in completely broken text in the computer. + // This horrible workaround fixes the English versions of the game. So far, no other languages are known for those platforms. + // Just in case, all the accentuated characters are handled properly, which *should* be OK for the other languages too. + int charWidth; + if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS) { + if ((curChar >= 'A' && curChar <= 'Z') || (curChar >= 'a' && curChar <= 'z' && curChar != 'm' && curChar != 'w') || (curChar >= '0' && curChar <= '9') || curChar == '*' || (curChar >= 128 && curChar <= 168)) + charWidth = _vm->_objectsManager.getWidth(_vm->_globals.police, printChar) - 1; + else if (curChar == 'm' || curChar == 'w') + charWidth = _vm->_objectsManager.getWidth(_vm->_globals.police, printChar); + else + charWidth = 6; + } else + charWidth = _vm->_objectsManager.getWidth(_vm->_globals.police, printChar); + + int charStartPosX = charEndPosX; + charEndPosX += charWidth; + _vm->_graphicsManager.addVesaSegment(charStartPosX, yp, charEndPosX, yp + 12); if (_vm->_eventsManager._escKeyFl) { _vm->_globals.iRegul = 1; _vm->_eventsManager.VBL(); |