aboutsummaryrefslogtreecommitdiff
path: root/scumm/charset.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2005-02-20 00:17:22 +0000
committerEugene Sandulenko2005-02-20 00:17:22 +0000
commit27469a1896f08c6d32df1778dc7e9cce28c2bec4 (patch)
tree173e32cafae393fd7bcf2d7eb4e81932c5cd2b95 /scumm/charset.cpp
parent3184c2de34c89a1b380fffa9f9ac83f53dc062d7 (diff)
downloadscummvm-rg350-27469a1896f08c6d32df1778dc7e9cce28c2bec4.tar.gz
scummvm-rg350-27469a1896f08c6d32df1778dc7e9cce28c2bec4.tar.bz2
scummvm-rg350-27469a1896f08c6d32df1778dc7e9cce28c2bec4.zip
Patch #1121337 (CGA rendering in early LEC titles).
Differences against patch: o Updated documentation o Fixed text colors o Implemented Hercules dithering Ditherers are based on loom ega and monkey ega, so for zak and mm they're wrong, i.e. these games look better than with original ditherers. TODO: Proper ditherers for zak & MM EGA ditherers for VGA SCUMM v5 games svn-id: r16816
Diffstat (limited to 'scumm/charset.cpp')
-rw-r--r--scumm/charset.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp
index 7b34acc7ab..818c1b16d4 100644
--- a/scumm/charset.cpp
+++ b/scumm/charset.cpp
@@ -1160,6 +1160,8 @@ void CharsetRendererV3::setColor(byte color)
_color &= 0x7f;
} else
_dropShadow = false;
+
+ translateColor();
}
void CharsetRendererV3::printChar(int chr) {
@@ -1253,6 +1255,21 @@ void CharsetRendererV3::drawChar(int chr, const Graphics::Surface &s, int x, int
drawBits1(s, dst, charPtr, y, width, height);
}
+void CharsetRenderer::translateColor() {
+ // Based on disassembly
+ if (_vm->_renderMode == Common::kRenderCGA) {
+ static byte CGAtextColorMap[16] = {0, 3, 3, 3, 5, 5, 5, 15,
+ 15, 3, 3, 3, 5, 5, 15, 15};
+ _color = CGAtextColorMap[_color & 0x0f];
+ }
+
+ if (_vm->_renderMode == Common::kRenderHerc) {
+ static byte HercTextColorMap[16] = {0, 15, 2, 15, 15, 5, 15, 15,
+ 8, 15, 15, 15, 15, 15, 15, 15};
+ _color = HercTextColorMap[_color & 0x0f];
+ }
+}
+
void CharsetRendererClassic::printChar(int chr) {
int width, height, origWidth, origHeight;
@@ -1269,6 +1286,8 @@ void CharsetRendererClassic::printChar(int chr) {
if (chr == '@')
return;
+ translateColor();
+
_vm->_charsetColorMap[1] = _color;
int type = *_fontPtr;