aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Hesse2008-12-12 04:31:01 +0000
committerSven Hesse2008-12-12 04:31:01 +0000
commitfa07cfe7c6ca928a7ad6bcf4d9e8f2e74de749f4 (patch)
treeb0129c48f094805db8b8d7a6e853302f4c7c4776
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
-rw-r--r--engines/gob/draw_v2.cpp5
-rw-r--r--engines/gob/driver_vga.cpp34
-rw-r--r--engines/gob/video.h4
3 files changed, 25 insertions, 18 deletions
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp
index f5f3848f9a..937f2ec0f8 100644
--- a/engines/gob/draw_v2.cpp
+++ b/engines/gob/draw_v2.cpp
@@ -792,11 +792,6 @@ void Draw_v2::spriteOperation(int16 operation) {
break;
case DRAW_PRINTTEXT:
- if (_vm->getGameType() == kGameTypeUrban) {
- warning("Urban Stub: Print text \"%s\"", _textToPrint);
- break;
- }
-
len = strlen(_textToPrint);
left = _destSpriteX;
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;
}
}
diff --git a/engines/gob/video.h b/engines/gob/video.h
index 5fb87fc5da..37b3afb317 100644
--- a/engines/gob/video.h
+++ b/engines/gob/video.h
@@ -69,8 +69,8 @@ public:
byte *dataPtr;
int8 itemWidth;
int8 itemHeight;
- int8 startItem;
- int8 endItem;
+ uint8 startItem;
+ uint8 endItem;
int8 itemSize;
int8 bitWidth;
byte *extraData;