- Rename FontSJIS::enableShadow to enableOutline.
- Initialize outline to false by default in FontTowns. svn-id: r42231
This commit is contained in:
parent
62eebc3e17
commit
8c65d4d4a9
3 changed files with 19 additions and 17 deletions
|
@ -115,7 +115,7 @@ bool Screen::init() {
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
_sjisFont->enableShadow(!_use16ColorMode);
|
_sjisFont->enableOutline(!_use16ColorMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3021,7 +3021,7 @@ void Screen::drawCharSJIS(uint16 c, int x, int y) {
|
||||||
color2 = _textColorsMap[0];
|
color2 = _textColorsMap[0];
|
||||||
|
|
||||||
if (color2 == _sjisInvisibleColor)
|
if (color2 == _sjisInvisibleColor)
|
||||||
_sjisFont->enableShadow(false);
|
_sjisFont->enableOutline(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_curPage == 0 || _curPage == 1)
|
if (_curPage == 0 || _curPage == 1)
|
||||||
|
@ -3040,7 +3040,7 @@ void Screen::drawCharSJIS(uint16 c, int x, int y) {
|
||||||
|
|
||||||
_sjisFont->drawChar(destPage, c, 640, 1, color1, color2);
|
_sjisFont->drawChar(destPage, c, 640, 1, color1, color2);
|
||||||
|
|
||||||
_sjisFont->enableShadow(!_use16ColorMode);
|
_sjisFont->enableOutline(!_use16ColorMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
|
@ -35,7 +35,7 @@ bool FontTowns::loadFromStream(Common::ReadStream &stream) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Color>
|
template<typename Color>
|
||||||
void FontTowns::drawCharInternShadow(const uint16 *glyph, uint8 *dst, int pitch, Color c1, Color c2) const {
|
void FontTowns::drawCharInternOutline(const uint16 *glyph, uint8 *dst, int pitch, Color c1, Color c2) const {
|
||||||
uint32 outlineGlyph[18];
|
uint32 outlineGlyph[18];
|
||||||
memset(outlineGlyph, 0, sizeof(outlineGlyph));
|
memset(outlineGlyph, 0, sizeof(outlineGlyph));
|
||||||
|
|
||||||
|
@ -90,15 +90,15 @@ void FontTowns::drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, ui
|
||||||
const uint16 *glyphSource = _fontData + sjisToChunk(ch & 0xFF, ch >> 8) * 16;
|
const uint16 *glyphSource = _fontData + sjisToChunk(ch & 0xFF, ch >> 8) * 16;
|
||||||
|
|
||||||
if (bpp == 1) {
|
if (bpp == 1) {
|
||||||
if (!_shadowEnabled)
|
if (!_outlineEnabled)
|
||||||
drawCharIntern<uint8>(glyphSource, (uint8 *)dst, pitch, c1);
|
drawCharIntern<uint8>(glyphSource, (uint8 *)dst, pitch, c1);
|
||||||
else
|
else
|
||||||
drawCharInternShadow<uint8>(glyphSource, (uint8 *)dst, pitch, c1, c2);
|
drawCharInternOutline<uint8>(glyphSource, (uint8 *)dst, pitch, c1, c2);
|
||||||
} else if (bpp == 2) {
|
} else if (bpp == 2) {
|
||||||
if (!_shadowEnabled)
|
if (!_outlineEnabled)
|
||||||
drawCharIntern<uint16>(glyphSource, (uint8 *)dst, pitch, c1);
|
drawCharIntern<uint16>(glyphSource, (uint8 *)dst, pitch, c1);
|
||||||
else
|
else
|
||||||
drawCharInternShadow<uint16>(glyphSource, (uint8 *)dst, pitch, c1, c2);
|
drawCharInternOutline<uint16>(glyphSource, (uint8 *)dst, pitch, c1, c2);
|
||||||
} else {
|
} else {
|
||||||
error("FontTowns::drawChar: unsupported bpp: %d", bpp);
|
error("FontTowns::drawChar: unsupported bpp: %d", bpp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,12 +42,12 @@ public:
|
||||||
virtual ~FontSJIS() {}
|
virtual ~FontSJIS() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable shadow drawing.
|
* Enable outline drawing.
|
||||||
*
|
*
|
||||||
* After changing shadow state, getFontHeight and getFontWidth might return
|
* After changing outline state, getFontHeight and getFontWidth might return
|
||||||
* different values!
|
* different values!
|
||||||
*/
|
*/
|
||||||
virtual void enableShadow(bool enable) {}
|
virtual void enableOutline(bool enable) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the height of the font.
|
* Returns the height of the font.
|
||||||
|
@ -74,7 +74,7 @@ public:
|
||||||
* @param pitch pitch of the destination buffer (size in *bytes*)
|
* @param pitch pitch of the destination buffer (size in *bytes*)
|
||||||
* @param bpp bytes per pixel of the destination buffer
|
* @param bpp bytes per pixel of the destination buffer
|
||||||
* @param c1 forground color
|
* @param c1 forground color
|
||||||
* @param c2 shadow/outline color
|
* @param c2 outline color
|
||||||
*/
|
*/
|
||||||
virtual void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2) const = 0;
|
virtual void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2) const = 0;
|
||||||
};
|
};
|
||||||
|
@ -86,21 +86,23 @@ public:
|
||||||
*/
|
*/
|
||||||
class FontTowns : public FontSJIS {
|
class FontTowns : public FontSJIS {
|
||||||
public:
|
public:
|
||||||
|
FontTowns() : _outlineEnabled(false) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the ROM data from the given read stream.
|
* Loads the ROM data from the given read stream.
|
||||||
*/
|
*/
|
||||||
bool loadFromStream(Common::ReadStream &stream);
|
bool loadFromStream(Common::ReadStream &stream);
|
||||||
|
|
||||||
void enableShadow(bool enable) { _shadowEnabled = enable; }
|
void enableOutline(bool enable) { _outlineEnabled = enable; }
|
||||||
|
|
||||||
uint getFontHeight() const { return _shadowEnabled ? 18 : 16; }
|
uint getFontHeight() const { return _outlineEnabled ? 18 : 16; }
|
||||||
uint getFontWidth() const { return _shadowEnabled ? 18 : 16; }
|
uint getFontWidth() const { return _outlineEnabled ? 18 : 16; }
|
||||||
|
|
||||||
void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2) const;
|
void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename Color>
|
template<typename Color>
|
||||||
void drawCharInternShadow(const uint16 *glyph, uint8 *dst, int pitch, Color c1, Color c2) const;
|
void drawCharInternOutline(const uint16 *glyph, uint8 *dst, int pitch, Color c1, Color c2) const;
|
||||||
|
|
||||||
template<typename Color>
|
template<typename Color>
|
||||||
void drawCharIntern(const uint16 *glyph, uint8 *dst, int pitch, Color c1) const;
|
void drawCharIntern(const uint16 *glyph, uint8 *dst, int pitch, Color c1) const;
|
||||||
|
@ -109,7 +111,7 @@ private:
|
||||||
kFontRomSize = 262144
|
kFontRomSize = 262144
|
||||||
};
|
};
|
||||||
|
|
||||||
bool _shadowEnabled;
|
bool _outlineEnabled;
|
||||||
uint16 _fontData[kFontRomSize / 2];
|
uint16 _fontData[kFontRomSize / 2];
|
||||||
|
|
||||||
static uint sjisToChunk(uint8 low, uint8 high);
|
static uint sjisToChunk(uint8 low, uint8 high);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue