diff options
author | athrxx | 2019-11-26 23:08:35 +0100 |
---|---|---|
committer | athrxx | 2019-12-18 20:50:44 +0100 |
commit | 1f42999a7cd3b35df4f5611cf27c7d98974e8673 (patch) | |
tree | 3834cbf1882dc42776e8f1317b0e065ae2f00d5f /graphics | |
parent | 33cce35baaad3043f98e3252ed04bdf2ebcb2786 (diff) | |
download | scummvm-rg350-1f42999a7cd3b35df4f5611cf27c7d98974e8673.tar.gz scummvm-rg350-1f42999a7cd3b35df4f5611cf27c7d98974e8673.tar.bz2 scummvm-rg350-1f42999a7cd3b35df4f5611cf27c7d98974e8673.zip |
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.
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/sjis.cpp | 17 | ||||
-rw-r--r-- | graphics/sjis.h | 3 |
2 files changed, 12 insertions, 8 deletions
diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp index 0c65492ece..847c25db12 100644 --- a/graphics/sjis.cpp +++ b/graphics/sjis.cpp @@ -276,11 +276,14 @@ void FontSJISBase::drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, if (_flippedMode) 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); diff --git a/graphics/sjis.h b/graphics/sjis.h index 2872471d24..d06d20e44d 100644 --- a/graphics/sjis.h +++ b/graphics/sjis.h @@ -84,7 +84,8 @@ public: enum DrawingMode { kDefaultMode, kOutlineMode, - kShadowMode, + kShadowRightMode, + kShadowLeftMode, kFMTownsShadowMode }; |