diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/screen.cpp | 19 | ||||
-rw-r--r-- | engines/kyra/screen.h | 32 |
2 files changed, 37 insertions, 14 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index c994f47d7d..bce45b2514 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -141,7 +141,7 @@ bool Screen::init() { if (!font) error("Could not load any SJIS font, neither the original nor ScummVM's 'SJIS.FNT'"); - _fonts[FID_SJIS_FNT] = new SJISFont(font, _sjisInvisibleColor, _use16ColorMode, !_use16ColorMode && _vm->game() != GI_LOL, !_use16ColorMode && _vm->game() == GI_LOL ? 1 : 0); + _fonts[FID_SJIS_FNT] = new SJISFont(font, _sjisInvisibleColor, _use16ColorMode, !_use16ColorMode && _vm->game() != GI_LOL && _vm->game() != GI_EOB2, _vm->game() == GI_EOB2 && _vm->gameFlags().platform == Common::kPlatformFMTowns, !_use16ColorMode && _vm->game() == GI_LOL ? 1 : 0); } } @@ -3583,12 +3583,11 @@ void AMIGAFont::unload() { memset(_chars, 0, sizeof(_chars)); } -SJISFont::SJISFont(Graphics::FontSJIS *font, const uint8 invisColor, bool is16Color, bool drawOutline, int extraSpacing) - : _colorMap(0), _font(font), _invisColor(invisColor), _is16Color(is16Color), _drawOutline(drawOutline), _sjisWidthOffset(extraSpacing) { +SJISFont::SJISFont(Graphics::FontSJIS *font, const uint8 invisColor, bool is16Color, bool drawOutline, bool fatPrint, int extraSpacing) + : _colorMap(0), _font(font), _invisColor(invisColor), _is16Color(is16Color), _drawOutline(drawOutline), _sjisWidthOffset(extraSpacing) { assert(_font); - _font->setDrawingMode(_drawOutline ? Graphics::FontSJIS::kOutlineMode : Graphics::FontSJIS::kDefaultMode); - + _font->toggleFatPrint(fatPrint); _sjisWidth = _font->getMaxFontWidth() >> 1; _fontHeight = _font->getFontHeight() >> 1; _asciiWidth = _font->getCharWidth('a') >> 1; @@ -3641,6 +3640,16 @@ void SJISFont::drawChar(uint16 c, byte *dst, int pitch) const { _font->drawChar(dst, c, 640, 1, color1, color2, 640, 400); } +SJISFontLarge::SJISFontLarge(Graphics::FontSJIS *font) : SJISFont(font, 0, false, false, false, 0) { + _sjisWidth = _font->getMaxFontWidth(); + _fontHeight = _font->getFontHeight(); + _asciiWidth = _font->getCharWidth('a'); +} + +void SJISFontLarge::drawChar(uint16 c, byte *dst, int pitch) const { + _font->drawChar(dst, c, 320, 1, _colorMap[1], _colorMap[0], 320, 200); +} + #pragma mark - Palette::Palette(const int numColors) : _palData(0), _numColors(numColors) { diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index b58371ce9b..0b287aa8bc 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -211,34 +211,47 @@ private: */ class SJISFont : public Font { public: - SJISFont(Graphics::FontSJIS *font, const uint8 invisColor, bool is16Color, bool drawOutline, int extraSpacing); - ~SJISFont() { unload(); } + SJISFont(Graphics::FontSJIS *font, const uint8 invisColor, bool is16Color, bool drawOutline, bool fatPrint, int extraSpacing); + virtual ~SJISFont() { unload(); } - bool usesOverlay() const { return true; } + virtual bool usesOverlay() const { return true; } bool load(Common::SeekableReadStream &) { return true; } int getHeight() const; int getWidth() const; int getCharWidth(uint16 c) const; void setColorMap(const uint8 *src); - void drawChar(uint16 c, byte *dst, int pitch) const; -private: + virtual void drawChar(uint16 c, byte *dst, int pitch) const; + +protected: void unload(); const uint8 *_colorMap; + Graphics::FontSJIS *_font; + int _sjisWidth, _asciiWidth; + int _fontHeight; + const bool _drawOutline; - Graphics::FontSJIS *_font; +private: const uint8 _invisColor; const bool _is16Color; - const bool _drawOutline; // We use this for cases where the font width returned by getWidth() or getCharWidth() does not match the original. // The original Japanese game versions use hard coded sjis font widths of 8 or 9. However, this does not necessarily // depend on whether an outline is used or not (neither LOL/PC-9801 nor LOL/FM-TOWNS use an outline, but the first // version uses a font width of 8 where the latter uses a font width of 9). const int _sjisWidthOffset; +}; - int _sjisWidth, _asciiWidth; - int _fontHeight; +/** +* SJISFont variant used in the intro and outro of EOB II FM-Towns. It appears twice as large, since it is not rendered on the hires overlay pages +*/ +class SJISFontLarge : public SJISFont { +public: + SJISFontLarge(Graphics::FontSJIS *font); + virtual ~SJISFontLarge() { unload(); } + + virtual bool usesOverlay() const { return false; } + virtual void drawChar(uint16 c, byte *dst, int pitch) const; }; /** @@ -400,6 +413,7 @@ public: FID_GOLDFONT_FNT, FID_INTRO_FNT, FID_SJIS_FNT, + FID_SJIS_LARGE_FNT, FID_NUM }; |