aboutsummaryrefslogtreecommitdiff
path: root/scumm/charset.cpp
diff options
context:
space:
mode:
authorMax Horn2002-12-25 21:57:01 +0000
committerMax Horn2002-12-25 21:57:01 +0000
commita782a22c4dce266aa53bba74e68483f4e48412d0 (patch)
treef0653e7d978c975bebada39fb4ecdc3a712a3bf5 /scumm/charset.cpp
parent2d46b1e4d78482f5305c81bfdd9a354da1a9f49c (diff)
downloadscummvm-rg350-a782a22c4dce266aa53bba74e68483f4e48412d0.tar.gz
scummvm-rg350-a782a22c4dce266aa53bba74e68483f4e48412d0.tar.bz2
scummvm-rg350-a782a22c4dce266aa53bba74e68483f4e48412d0.zip
seperated classic & old256 rendered (now subclasses of CharsetRenderer)
svn-id: r6152
Diffstat (limited to 'scumm/charset.cpp')
-rw-r--r--scumm/charset.cpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp
index 4701d2d234..8efd33ad47 100644
--- a/scumm/charset.cpp
+++ b/scumm/charset.cpp
@@ -39,23 +39,28 @@ byte *CharsetRenderer::getFontPtr(byte id)
}
// do spacing for variable width old-style font
-int CharsetRenderer::getSpacing(byte chr, byte *charset)
+int CharsetRendererClassic::getSpacing(byte chr, byte *charset)
{
int spacing = 0;
-
- if (_vm->_features & GF_OLD256) {
- spacing = *(charset - 11 + chr);
- } else {
- int offs = READ_LE_UINT32(charset + chr * 4 + 4);
- if (offs) {
- spacing = charset[offs];
- if (charset[offs + 2] >= 0x80) {
- spacing += charset[offs + 2] - 0x100;
- } else {
- spacing += charset[offs + 2];
- }
+
+ int offs = READ_LE_UINT32(charset + chr * 4 + 4);
+ if (offs) {
+ spacing = charset[offs];
+ if (charset[offs + 2] >= 0x80) {
+ spacing += charset[offs + 2] - 0x100;
+ } else {
+ spacing += charset[offs + 2];
}
}
+
+ return spacing;
+}
+
+int CharsetRendererOld256::getSpacing(byte chr, byte *charset)
+{
+ int spacing = 0;
+
+ spacing = *(charset - 11 + chr);
// FIXME - this fixes the inventory icons in Zak256/Indy3
// see bug #613109.
@@ -173,7 +178,7 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth)
}
-void CharsetRenderer::printCharOld(int chr)
+void CharsetRendererOld256::printChar(int chr)
{ // Indy3 / Zak256
VirtScreen *vs;
byte *char_ptr, *dest_ptr;
@@ -223,7 +228,7 @@ void CharsetRenderer::printCharOld(int chr)
}
-void CharsetRenderer::printChar(int chr)
+void CharsetRendererClassic::printChar(int chr)
{
int width, height;
int offsX, offsY;
@@ -339,7 +344,7 @@ void CharsetRenderer::printChar(int chr)
_top -= offsY;
}
-void CharsetRenderer::drawBits(VirtScreen *vs, byte *dst, byte *mask, int drawTop, int width, int height)
+void CharsetRendererClassic::drawBits(VirtScreen *vs, byte *dst, byte *mask, int drawTop, int width, int height)
{
byte maskmask;
int y, x;