diff options
author | Filippos Karapetis | 2011-10-11 02:33:45 +0300 |
---|---|---|
committer | Filippos Karapetis | 2011-10-11 02:33:45 +0300 |
commit | a9c6d2a4c4e80708d63dbbd7dc2c0419258d6d19 (patch) | |
tree | 1f161c57d6b0bd1449ecbfd519c13897e4e0fa8e /engines/sci/graphics | |
parent | 4cb9a2c809d7b66a4065de68247153f1057c84be (diff) | |
download | scummvm-rg350-a9c6d2a4c4e80708d63dbbd7dc2c0419258d6d19.tar.gz scummvm-rg350-a9c6d2a4c4e80708d63dbbd7dc2c0419258d6d19.tar.bz2 scummvm-rg350-a9c6d2a4c4e80708d63dbbd7dc2c0419258d6d19.zip |
SCI: Some work on the SCI32 bitmap / font code
- Initial implementation of kBitmap(0)
- Bugfixes for fonts in upscaled games
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/text32.cpp | 17 | ||||
-rw-r--r-- | engines/sci/graphics/text32.h | 1 |
2 files changed, 17 insertions, 1 deletions
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp index d906d56892..1939baeb06 100644 --- a/engines/sci/graphics/text32.cpp +++ b/engines/sci/graphics/text32.cpp @@ -100,6 +100,15 @@ reg_t GfxText32::createTextBitmap(reg_t textObject, uint16 maxWidth, uint16 maxH return memoryId; } +reg_t GfxText32::createTextBitmapSci21(uint16 width, uint16 height, byte skip, byte back, uint16 width2, uint16 height2, byte transparentFlag) { + // TODO: skip, width2, height2, transparentFlag + int entrySize = width * height; + reg_t memoryId = _segMan->allocateHunkEntry("TextBitmap()", entrySize); + byte *memoryPtr = _segMan->getHunkPointer(memoryId); + memset(memoryPtr, back, entrySize); + return memoryId; +} + void GfxText32::disposeTextBitmap(reg_t hunkId) { _segMan->freeHunkEntry(hunkId); } @@ -119,11 +128,17 @@ void GfxText32::drawTextBitmap(reg_t textObject) { uint16 width = nsRect.width(); uint16 height = nsRect.height(); + // Upscale the coordinates/width if the fonts are already upscaled + if (_screen->fontIsUpscaled()) { + textX = textX * _screen->getDisplayWidth() / _screen->getWidth(); + textY = textY * _screen->getDisplayHeight() / _screen->getHeight(); + } + for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { byte pixel = surface[curByte++]; if (pixel) - _screen->putPixel(x + textX, y + textY, 1, pixel, 0, 0); + _screen->putFontPixel(textY, x + textX, y, pixel); } } } diff --git a/engines/sci/graphics/text32.h b/engines/sci/graphics/text32.h index 4c1e53d971..43395f6517 100644 --- a/engines/sci/graphics/text32.h +++ b/engines/sci/graphics/text32.h @@ -38,6 +38,7 @@ public: GfxText32(SegManager *segMan, GfxCache *fonts, GfxScreen *screen); ~GfxText32(); reg_t createTextBitmap(reg_t textObject, uint16 maxWidth = 0, uint16 maxHeight = 0); + reg_t createTextBitmapSci21(uint16 width, uint16 height, byte skip, byte back, uint16 width2, uint16 height2, byte transparentFlag); void disposeTextBitmap(reg_t hunkId); void drawTextBitmap(reg_t textObject); int16 GetLongest(const char *text, int16 maxWidth, GfxFont *font); |