aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-03-29 21:46:49 +0000
committerWillem Jan Palenstijn2009-03-29 21:46:49 +0000
commit968856780bb474dde5ea5685c079cbcd60230377 (patch)
tree0de87fc08cf7cbc46c5f7561b604f9e9b777ffc2 /engines/sci/gfx
parentb524e3d285d04a7f9df139cc55fea13472eacf31 (diff)
downloadscummvm-rg350-968856780bb474dde5ea5685c079cbcd60230377.tar.gz
scummvm-rg350-968856780bb474dde5ea5685c079cbcd60230377.tar.bz2
scummvm-rg350-968856780bb474dde5ea5685c079cbcd60230377.zip
SCI: Merge static palette into global palette at startup
svn-id: r39747
Diffstat (limited to 'engines/sci/gfx')
-rw-r--r--engines/sci/gfx/gfx_resmgr.cpp13
-rw-r--r--engines/sci/gfx/gfx_resmgr.h10
2 files changed, 15 insertions, 8 deletions
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp
index b474a1e36c..19988be9f0 100644
--- a/engines/sci/gfx/gfx_resmgr.cpp
+++ b/engines/sci/gfx/gfx_resmgr.cpp
@@ -242,6 +242,19 @@ void GfxResManager::freeTaggedResources() {
_tagLockCounter = 0;
}
+
+void GfxResManager::setStaticPalette(Palette *newPalette)
+{
+ if (_staticPalette)
+ _staticPalette->free();
+
+ _staticPalette = newPalette;
+ _staticPalette->name = "static palette";
+
+ _staticPalette->mergeInto(_driver->mode->palette);
+}
+
+
#define XLATE_AS_APPROPRIATE(key, entry) \
if (maps & key) { \
if (res->unscaled_data.pic&& (force || !res->unscaled_data.pic->entry->data)) { \
diff --git a/engines/sci/gfx/gfx_resmgr.h b/engines/sci/gfx/gfx_resmgr.h
index 8f5d02038a..6bfdfa2e23 100644
--- a/engines/sci/gfx/gfx_resmgr.h
+++ b/engines/sci/gfx/gfx_resmgr.h
@@ -224,14 +224,8 @@ public:
const PaletteEntry &getColor(int color) { return _staticPalette->getColor(color); }
- void setStaticPalette(Palette *newPalette) {
- if (_staticPalette)
- _staticPalette->free();
-
- _staticPalette = newPalette;
- _staticPalette->name = "static palette";
- }
-
+ // Set static palette and merge it into the global palette
+ void setStaticPalette(Palette *newPalette);
int getColorCount() { return _staticPalette ? _staticPalette->size() : 0; }
private: