aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/driver_vga.cpp
diff options
context:
space:
mode:
authorSven Hesse2008-12-12 04:31:01 +0000
committerSven Hesse2008-12-12 04:31:01 +0000
commitfa07cfe7c6ca928a7ad6bcf4d9e8f2e74de749f4 (patch)
treeb0129c48f094805db8b8d7a6e853302f4c7c4776 /engines/gob/driver_vga.cpp
parent4ec382608080432b04c8c305d236c6dc38e61b7b (diff)
downloadscummvm-rg350-fa07cfe7c6ca928a7ad6bcf4d9e8f2e74de749f4.tar.gz
scummvm-rg350-fa07cfe7c6ca928a7ad6bcf4d9e8f2e74de749f4.tar.bz2
scummvm-rg350-fa07cfe7c6ca928a7ad6bcf4d9e8f2e74de749f4.zip
Text now works in Urban Runner
svn-id: r35311
Diffstat (limited to 'engines/gob/driver_vga.cpp')
-rw-r--r--engines/gob/driver_vga.cpp34
1 files changed, 23 insertions, 11 deletions
diff --git a/engines/gob/driver_vga.cpp b/engines/gob/driver_vga.cpp
index 2d3a10b570..e9830cf197 100644
--- a/engines/gob/driver_vga.cpp
+++ b/engines/gob/driver_vga.cpp
@@ -79,21 +79,33 @@ void VGAVideoDriver::drawLetter(unsigned char item, int16 x, int16 y,
(item - fontDesc->startItem) * (fontDesc->itemSize & 0xFF);
dst = dest->getVidMem() + x + dest->getWidth() * y;
+ int nWidth = fontDesc->itemWidth;
+
+ if (nWidth & 7)
+ nWidth = (nWidth & 0xF8) + 8;
+
+ nWidth >>= 3;
+
for (int i = 0; i < fontDesc->itemHeight; i++) {
- data = READ_BE_UINT16(src);
- src += 2;
- if (fontDesc->itemWidth <= 8)
- src--;
+ int width = fontDesc->itemWidth;
+
+ for (int k = 0; k < nWidth; k++) {
+
+ data = *src++;
+ for (int j = 0; j < MIN(8, width); j++) {
+ if (data & 0x80)
+ *dst = color2;
+ else if (color1 == 0)
+ *dst = transp;
+
+ dst++;
+ data <<= 1;
+ }
- for (int j = 0; j < fontDesc->itemWidth; j++) {
- if (data & 0x8000)
- *dst = color2;
- else if (color1 == 0)
- *dst = transp;
+ width -= 8;
- dst++;
- data <<= 1;
}
+
dst += dest->getWidth() - fontDesc->itemWidth;
}
}