aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2011-10-28 21:52:17 +0300
committerFilippos Karapetis2011-10-28 22:20:31 +0300
commitf61ea4c9cfae34cb1966cc2664c326d035ac79ad (patch)
tree73a9d87e400c249b63ac73ec807a617962d514a5 /engines
parentacaedcce700ac1292a4225ebd41d34a764ce5ef9 (diff)
downloadscummvm-rg350-f61ea4c9cfae34cb1966cc2664c326d035ac79ad.tar.gz
scummvm-rg350-f61ea4c9cfae34cb1966cc2664c326d035ac79ad.tar.bz2
scummvm-rg350-f61ea4c9cfae34cb1966cc2664c326d035ac79ad.zip
SCI: Fixed text background color and text transparency for SCI32 games
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/selector.cpp1
-rw-r--r--engines/sci/engine/selector.h1
-rw-r--r--engines/sci/graphics/text32.cpp8
3 files changed, 7 insertions, 3 deletions
diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp
index a9aca9e22f..a8b1cf7ec2 100644
--- a/engines/sci/engine/selector.cpp
+++ b/engines/sci/engine/selector.cpp
@@ -178,6 +178,7 @@ void Kernel::mapSelectors() {
FIND_SELECTOR(dimmed);
FIND_SELECTOR(fore);
FIND_SELECTOR(back);
+ FIND_SELECTOR(skip);
FIND_SELECTOR(fixPriority);
FIND_SELECTOR(mirrored);
FIND_SELECTOR(useInsetRect);
diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h
index bbd86bb03e..4b913a866a 100644
--- a/engines/sci/engine/selector.h
+++ b/engines/sci/engine/selector.h
@@ -144,6 +144,7 @@ struct SelectorCache {
Selector fore;
Selector back;
+ Selector skip;
Selector dimmed;
Selector fixPriority;
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp
index 029030165d..50b782d3e6 100644
--- a/engines/sci/graphics/text32.cpp
+++ b/engines/sci/graphics/text32.cpp
@@ -61,6 +61,7 @@ reg_t GfxText32::createTextBitmap(reg_t textObject, uint16 maxWidth, uint16 maxH
GfxFont *font = _cache->getFont(readSelectorValue(_segMan, textObject, SELECTOR(font)));
bool dimmed = readSelectorValue(_segMan, textObject, SELECTOR(dimmed));
uint16 foreColor = readSelectorValue(_segMan, textObject, SELECTOR(fore));
+ uint16 backColor = readSelectorValue(_segMan, textObject, SELECTOR(back));
Common::Rect planeRect = getPlaneRect(textObject);
uint16 width = planeRect.width() + 1;
@@ -82,7 +83,7 @@ reg_t GfxText32::createTextBitmap(reg_t textObject, uint16 maxWidth, uint16 maxH
reg_t memoryId = _segMan->allocateHunkEntry("TextBitmap()", entrySize);
writeSelector(_segMan, textObject, SELECTOR(bitmap), memoryId);
byte *memoryPtr = _segMan->getHunkPointer(memoryId);
- memset(memoryPtr, 0, entrySize);
+ memset(memoryPtr, backColor, entrySize);
byte *bitmap = memoryPtr + BITMAP_HEADER_SIZE;
int16 charCount = 0;
@@ -133,6 +134,7 @@ void GfxText32::drawTextBitmap(reg_t textObject) {
Common::Rect planeRect = getPlaneRect(textObject);
uint16 x = readSelectorValue(_segMan, textObject, SELECTOR(x));
uint16 y = readSelectorValue(_segMan, textObject, SELECTOR(y));
+ uint16 skipColor = readSelectorValue(_segMan, textObject, SELECTOR(skip));
uint16 textX = planeRect.left + x;
uint16 textY = planeRect.top + y;
uint16 width = nsRect.width() + 1;
@@ -149,7 +151,7 @@ void GfxText32::drawTextBitmap(reg_t textObject) {
for (int curY = 0; curY < height; curY++) {
for (int curX = 0; curX < width; curX++) {
byte pixel = surface[curByte++];
- if (pixel)
+ if (pixel != skipColor)
_screen->putFontPixel(textY, curX + textX, curY, pixel);
}
}
@@ -280,4 +282,4 @@ int16 GfxText32::Size(Common::Rect &rect, const char *text, GuiResourceId fontId
return rect.right;
}
-} // End of namespace Sci
+} // End of namespace Sci \ No newline at end of file