mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 08:25:35 +00:00
GRAPHICS: implement left sided shadowing for SJIS font
The current shadow mode draws a shadow on the right side of the character. This allows drawing one on the left. Adapt LOOM/PCE accordingly.
This commit is contained in:
parent
33cce35baa
commit
1f42999a7c
@ -68,7 +68,7 @@ void ScummEngine::loadCJKFont() {
|
||||
if (!_cjkFont)
|
||||
error("SCUMM::Font: Could not open file 'pce.cdbios'");
|
||||
|
||||
_cjkFont->setDrawingMode(Graphics::FontSJIS::kShadowMode);
|
||||
_cjkFont->setDrawingMode(Graphics::FontSJIS::kShadowRightMode);
|
||||
_2byteWidth = _2byteHeight = 12;
|
||||
_useCJKMode = true;
|
||||
#endif
|
||||
|
@ -277,10 +277,13 @@ void FontSJISBase::drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1,
|
||||
glyphSource = flipCharacter(glyphSource, width);
|
||||
#endif
|
||||
|
||||
int shadowOffset = bpp;
|
||||
uint8 outline[18 * 18];
|
||||
if (_drawMode == kOutlineMode) {
|
||||
memset(outline, 0, sizeof(outline));
|
||||
createOutline(outline, glyphSource, width, height);
|
||||
} else if (_drawMode == kShadowLeftMode) {
|
||||
shadowOffset = -shadowOffset;
|
||||
}
|
||||
|
||||
if (bpp == 1) {
|
||||
@ -289,10 +292,10 @@ void FontSJISBase::drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1,
|
||||
blitCharacter<uint8>(glyphSource, width - outlineXOffset, height - outlineYOffset, (uint8 *)dst + pitch + 1, pitch, c1);
|
||||
} else {
|
||||
if (_drawMode != kDefaultMode) {
|
||||
blitCharacter<uint8>(glyphSource, width - outlineXOffset, height, ((uint8 *)dst) + 1, pitch, c2);
|
||||
blitCharacter<uint8>(glyphSource, width - outlineXOffset, height, ((uint8 *)dst) + shadowOffset, pitch, c2);
|
||||
blitCharacter<uint8>(glyphSource, width, height - outlineYOffset, ((uint8 *)dst) + pitch, pitch, c2);
|
||||
if (_drawMode == kShadowMode)
|
||||
blitCharacter<uint8>(glyphSource, width - outlineXOffset, height - outlineYOffset, ((uint8 *)dst) + pitch + 1, pitch, c2);
|
||||
if (_drawMode != kFMTownsShadowMode)
|
||||
blitCharacter<uint8>(glyphSource, width - outlineXOffset, height - outlineYOffset, ((uint8 *)dst) + pitch + shadowOffset, pitch, c2);
|
||||
}
|
||||
|
||||
blitCharacter<uint8>(glyphSource, width, height, (uint8 *)dst, pitch, c1);
|
||||
@ -303,10 +306,10 @@ void FontSJISBase::drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1,
|
||||
blitCharacter<uint16>(glyphSource, width - outlineXOffset, height - outlineYOffset, (uint8 *)dst + pitch + 2, pitch, c1);
|
||||
} else {
|
||||
if (_drawMode != kDefaultMode) {
|
||||
blitCharacter<uint16>(glyphSource, width - outlineXOffset, height, ((uint8 *)dst) + 2, pitch, c2);
|
||||
blitCharacter<uint16>(glyphSource, width - outlineXOffset, height, ((uint8 *)dst) + shadowOffset, pitch, c2);
|
||||
blitCharacter<uint16>(glyphSource, width, height - outlineYOffset, ((uint8 *)dst) + pitch, pitch, c2);
|
||||
if (_drawMode == kShadowMode)
|
||||
blitCharacter<uint16>(glyphSource, width - outlineXOffset, height - outlineYOffset, ((uint8 *)dst) + pitch + 2, pitch, c2);
|
||||
if (_drawMode != kFMTownsShadowMode)
|
||||
blitCharacter<uint16>(glyphSource, width - outlineXOffset, height - outlineYOffset, ((uint8 *)dst) + pitch + shadowOffset, pitch, c2);
|
||||
}
|
||||
|
||||
blitCharacter<uint16>(glyphSource, width, height, (uint8 *)dst, pitch, c1);
|
||||
|
@ -84,7 +84,8 @@ public:
|
||||
enum DrawingMode {
|
||||
kDefaultMode,
|
||||
kOutlineMode,
|
||||
kShadowMode,
|
||||
kShadowRightMode,
|
||||
kShadowLeftMode,
|
||||
kFMTownsShadowMode
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user