aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/driver_vga.cpp
diff options
context:
space:
mode:
authorSven Hesse2009-07-09 02:54:10 +0000
committerSven Hesse2009-07-09 02:54:10 +0000
commit3823ae285f92c0b39d141b6132a4187b1e83b6be (patch)
tree1ad3b512f6653ecd5cd7ee80ddc26e11eb9d7c56 /engines/gob/driver_vga.cpp
parentc7eedb573ac3ac1bd4c8f8e64d75ee8ee931bc50 (diff)
downloadscummvm-rg350-3823ae285f92c0b39d141b6132a4187b1e83b6be.tar.gz
scummvm-rg350-3823ae285f92c0b39d141b6132a4187b1e83b6be.tar.bz2
scummvm-rg350-3823ae285f92c0b39d141b6132a4187b1e83b6be.zip
Giving Font its own real class
svn-id: r42277
Diffstat (limited to 'engines/gob/driver_vga.cpp')
-rw-r--r--engines/gob/driver_vga.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/engines/gob/driver_vga.cpp b/engines/gob/driver_vga.cpp
index aff971164f..c93962c206 100644
--- a/engines/gob/driver_vga.cpp
+++ b/engines/gob/driver_vga.cpp
@@ -70,24 +70,22 @@ void VGAVideoDriver::fillRect(SurfaceDesc &dest, int16 left, int16 top,
}
void VGAVideoDriver::drawLetter(unsigned char item, int16 x, int16 y,
- Video::FontDesc *fontDesc, byte color1, byte color2,
+ const Font &font, byte color1, byte color2,
byte transp, SurfaceDesc &dest) {
- byte *src, *dst;
uint16 data;
- src = fontDesc->dataPtr +
- (item - fontDesc->startItem) * (fontDesc->itemSize & 0xFF);
- dst = dest.getVidMem() + x + dest.getWidth() * y;
+ const byte *src = font.getCharData(item);
+ byte *dst = dest.getVidMem() + x + dest.getWidth() * y;
- int nWidth = fontDesc->itemWidth;
+ int nWidth = font.getCharWidth();
if (nWidth & 7)
nWidth = (nWidth & 0xF8) + 8;
nWidth >>= 3;
- for (int i = 0; i < fontDesc->itemHeight; i++) {
- int width = fontDesc->itemWidth;
+ for (int i = 0; i < font.getCharHeight(); i++) {
+ int width = font.getCharWidth();
for (int k = 0; k < nWidth; k++) {
@@ -106,7 +104,7 @@ void VGAVideoDriver::drawLetter(unsigned char item, int16 x, int16 y,
}
- dst += dest.getWidth() - fontDesc->itemWidth;
+ dst += dest.getWidth() - font.getCharWidth();
}
}