diff options
author | athrxx | 2019-03-24 17:39:55 +0100 |
---|---|---|
committer | athrxx | 2019-04-13 18:54:59 +0200 |
commit | 5462d42363bf6f0e84aa0ecbb12b0dc8941acadb (patch) | |
tree | 7b136b23b4fc490098b35b95ee4edf8f166ce05f /engines/kyra/graphics/screen_eob.cpp | |
parent | 463cf48e2a16e0056922b06a741ee477e7078de2 (diff) | |
download | scummvm-rg350-5462d42363bf6f0e84aa0ecbb12b0dc8941acadb.tar.gz scummvm-rg350-5462d42363bf6f0e84aa0ecbb12b0dc8941acadb.tar.bz2 scummvm-rg350-5462d42363bf6f0e84aa0ecbb12b0dc8941acadb.zip |
KYRA: (EOB2/Amiga) - improve font file warnings
- add warning for wrong font file: The German version of EOB II has a font file with more characters than the English version or the EOB I fonts. Users now get a warning/instruction if they have the wrong file.
- add translation support for all AmigaDOS font related warnings/errors
Diffstat (limited to 'engines/kyra/graphics/screen_eob.cpp')
-rw-r--r-- | engines/kyra/graphics/screen_eob.cpp | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/engines/kyra/graphics/screen_eob.cpp b/engines/kyra/graphics/screen_eob.cpp index 33f4bab131..b3c0393e8a 100644 --- a/engines/kyra/graphics/screen_eob.cpp +++ b/engines/kyra/graphics/screen_eob.cpp @@ -31,6 +31,7 @@ #include "kyra/resource/resource.h" #include "common/system.h" +#include "common/translation.h" #include "graphics/cursorman.h" #include "graphics/palette.h" @@ -1975,7 +1976,7 @@ void OldDOSFont::unload() { _bitmapOffsets = 0; } -AmigaDOSFont::AmigaDOSFont(Resource *res) : _res(res), _width(0), _height(0), _first(0), _last(0), _content(0), _numElements(0), _selectedElement(0), _maxPathLen(256) { +AmigaDOSFont::AmigaDOSFont(Resource *res, bool needsLocalizedFont) : _res(res), _needsLocalizedFont(needsLocalizedFont), _width(0), _height(0), _first(0), _last(0), _content(0), _numElements(0), _selectedElement(0), _maxPathLen(256) { assert(_res); } @@ -2078,6 +2079,35 @@ void AmigaDOSFont::drawChar(uint16 c, byte *dst, int pitch, int) const { } } +uint8 AmigaDOSFont::_errorDialogDisplayed = 0; + +void AmigaDOSFont::errorDialog(int index) { + if (_errorDialogDisplayed & (1 << index)) + return; + _errorDialogDisplayed |= (1 << index); + + // I've made rather elaborate dialogs here, since the Amiga font file handling is quite prone to cause problems for users. + // This will hopefully prevent unnecessary forum posts and bug reports. + if (index == 0) { + ::GUI::displayErrorDialog(_s( + "This AMIGA version requires the following font files:\n\nEOBF6.FONT\nEOBF6/6\nEOBF8.FONT\nEOBF8/8\n\n" + "If you used the orginal installer for the installation these files\nshould be located in the AmigaDOS system 'Fonts/' folder.\n" + "Please copy them into the EOB game data directory.\n" + )); + + error("Failed to load font files."); + } else if (index == 1) { + ::GUI::displayErrorDialog(_s( + "This AMIGA version requires the following font files:\n\nEOBF6.FONT\nEOBF6/6\nEOBF8.FONT\nEOBF8/8\n\n" + "This is a localized (non-English) version of EOB II which uses language specific characters\n" + "contained only in the specific font files that came with your game. You cannot use the font\n" + "files from the English version or from any EOB I game which seems to be what you are doing.\n\n" + "The game will continue, but the language specific characters will not be displayed.\n" + "Please copy the correct font files into your EOB II game data directory.\n\n" + )); + } +} + void AmigaDOSFont::unload() { delete[] _content; } @@ -2105,12 +2135,8 @@ AmigaDOSFont::TextFont *AmigaDOSFont::loadContentFile(const Common::String fileN str = _res->createEndianAwareReadStream(fileNameAlt); } - if (!str) { - ::GUI::displayErrorDialog("This AMIGA version requires the following font files:\n\nEOBF6.FONT\nEOBF6/6\nEOBF8.FONT\nEOBF8/8\n\n" - "If you used the orginal installer for the installation these files\nshould be located in the AmigaDOS system 'Fonts/' folder.\n" - "Please copy them into the EOB game data directory.\n"); - error("Failed to load font files."); - } + if (!str) + errorDialog(0); } uint32 hunkId = str->readUint32(); @@ -2137,6 +2163,9 @@ AmigaDOSFont::TextFont *AmigaDOSFont::loadContentFile(const Common::String fileN fnt->firstChar = str->readByte(); fnt->lastChar = str->readByte(); + if (_needsLocalizedFont && fnt->lastChar <= 127) + errorDialog(1); + str->seek(18, SEEK_CUR); int32 curPos = str->pos(); uint32 bufferSize = dataSize - (curPos - fntStartPos); |