aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/draw.cpp9
-rw-r--r--engines/gob/draw.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp
index ae1bbd4e8e..54ac86b23d 100644
--- a/engines/gob/draw.cpp
+++ b/engines/gob/draw.cpp
@@ -295,6 +295,15 @@ void Draw::clearPalette() {
}
}
+uint32 Draw::getColor(uint8 index) const {
+ if (!_vm->isTrueColor())
+ return index;
+
+ return _vm->getPixelFormat().RGBToColor(_vgaPalette[index].red << 2,
+ _vgaPalette[index].green << 2,
+ _vgaPalette[index].blue << 2);
+}
+
void Draw::dirtiedRect(int16 surface,
int16 left, int16 top, int16 right, int16 bottom) {
diff --git a/engines/gob/draw.h b/engines/gob/draw.h
index fe37382666..8ef5671948 100644
--- a/engines/gob/draw.h
+++ b/engines/gob/draw.h
@@ -173,6 +173,8 @@ public:
void setPalette();
void clearPalette();
+ uint32 getColor(uint8 index) const;
+
void dirtiedRect(int16 surface, int16 left, int16 top, int16 right, int16 bottom);
void dirtiedRect(SurfacePtr surface, int16 left, int16 top, int16 right, int16 bottom);