aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/engine/eobcommon.cpp11
-rw-r--r--engines/kyra/graphics/screen.cpp2
-rw-r--r--engines/kyra/graphics/screen.h8
-rw-r--r--engines/kyra/graphics/screen_eob.cpp43
4 files changed, 45 insertions, 19 deletions
diff --git a/engines/kyra/engine/eobcommon.cpp b/engines/kyra/engine/eobcommon.cpp
index 26a23aac7f..5b7c4aea8e 100644
--- a/engines/kyra/engine/eobcommon.cpp
+++ b/engines/kyra/engine/eobcommon.cpp
@@ -438,27 +438,20 @@ Common::Error EoBCoreEngine::init() {
assert(_debugger);
if (_flags.platform == Common::kPlatformAmiga) {
- bool showErrorDlg = false;
if (_res->exists("EOBF6.FONT"))
_screen->loadFont(Screen::FID_6_FNT, "EOBF6.FONT");
else if (_res->exists("FONTS/EOBF6.FONT"))
_screen->loadFont(Screen::FID_6_FNT, "FONTS/EOBF6.FONT");
else
- showErrorDlg = true;
+ AmigaDOSFont::errorDialog(0);
if (_res->exists("EOBF8.FONT"))
_screen->loadFont(Screen::FID_8_FNT, "EOBF8.FONT");
else if (_res->exists("FONTS/EOBF8.FONT"))
_screen->loadFont(Screen::FID_8_FNT, "FONTS/EOBF8.FONT");
else
- showErrorDlg = true;
+ AmigaDOSFont::errorDialog(0);
- if (showErrorDlg) {
- ::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.");
- }
} else {
_screen->loadFont(Screen::FID_6_FNT, "FONT6.FNT");
_screen->loadFont(Screen::FID_8_FNT, "FONT8.FNT");
diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp
index 5717319b7f..ea0871f317 100644
--- a/engines/kyra/graphics/screen.cpp
+++ b/engines/kyra/graphics/screen.cpp
@@ -1365,7 +1365,7 @@ bool Screen::loadFont(FontId fontId, const char *filename) {
fnt = new AMIGAFont();
#ifdef ENABLE_EOB
else if (_isAmiga)
- fnt = new AmigaDOSFont(_vm->resource());
+ fnt = new AmigaDOSFont(_vm->resource(), _vm->game() == GI_EOB2 && _vm->gameFlags().lang == Common::DE_DEU);
else if (_vm->game() == GI_EOB1 || _vm->game() == GI_EOB2)
// We use normal VGA rendering in EOB II, since we do the complete EGA dithering in updateScreen().
fnt = new OldDOSFont(_useHiResEGADithering ? Common::kRenderVGA : _renderMode);
diff --git a/engines/kyra/graphics/screen.h b/engines/kyra/graphics/screen.h
index 5a746a0956..b6706cd14f 100644
--- a/engines/kyra/graphics/screen.h
+++ b/engines/kyra/graphics/screen.h
@@ -187,7 +187,7 @@ private:
class Resource;
class AmigaDOSFont : public Font {
public:
- AmigaDOSFont(Resource *res);
+ AmigaDOSFont(Resource *res, bool needsLocalizedFont = false);
~AmigaDOSFont() { unload(); }
bool load(Common::SeekableReadStream &file);
@@ -197,6 +197,8 @@ public:
void setColorMap(const uint8 *src) { _colorMap = src; }
void drawChar(uint16 c, byte *dst, int pitch, int) const;
+ static void errorDialog(int index);
+
private:
void unload();
@@ -242,8 +244,10 @@ private:
uint16 _selectedElement;
const uint8 *_colorMap;
-
const uint16 _maxPathLen;
+ const bool _needsLocalizedFont;
+
+ static uint8 _errorDialogDisplayed;
Resource *_res;
};
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);