diff options
author | Sven Hesse | 2011-01-16 22:28:49 +0000 |
---|---|---|
committer | Sven Hesse | 2011-01-16 22:28:49 +0000 |
commit | 0d11ae143f8734ddf0632e9981558120acbabd28 (patch) | |
tree | ecb58e219f98cdee21ee887f4414c517c2c1e760 | |
parent | 68ebdf20d5e8ae24029b0e1d7cfa1e3e89e455f9 (diff) | |
download | scummvm-rg350-0d11ae143f8734ddf0632e9981558120acbabd28.tar.gz scummvm-rg350-0d11ae143f8734ddf0632e9981558120acbabd28.tar.bz2 scummvm-rg350-0d11ae143f8734ddf0632e9981558120acbabd28.zip |
GOB: Add a method to get a true palette color
svn-id: r55271
-rw-r--r-- | engines/gob/draw.cpp | 9 | ||||
-rw-r--r-- | engines/gob/draw.h | 2 |
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); |