[Scummvm-cvs-logs] SF.net SVN: scummvm:[39747] scummvm/trunk/engines/sci
wjpalenstijn at users.sourceforge.net
wjpalenstijn at users.sourceforge.net
Sun Mar 29 23:46:49 CEST 2009
Revision: 39747
http://scummvm.svn.sourceforge.net/scummvm/?rev=39747&view=rev
Author: wjpalenstijn
Date: 2009-03-29 21:46:49 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
SCI: Merge static palette into global palette at startup
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/game.cpp
scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
scummvm/trunk/engines/sci/gfx/gfx_resmgr.h
Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp 2009-03-29 21:46:26 UTC (rev 39746)
+++ scummvm/trunk/engines/sci/engine/game.cpp 2009-03-29 21:46:49 UTC (rev 39747)
@@ -112,12 +112,13 @@
gfxop_set_system_color(s->gfx_state, i, &(s->ega_colors[i]));
}
} else {
+ _sci1_alloc_system_colors(s);
+
// Check for Amiga palette file.
Common::File file;
if (file.open("spal")) {
s->gfx_state->gfxResMan->setStaticPalette(gfxr_read_pal1_amiga(file));
file.close();
- _sci1_alloc_system_colors(s);
} else {
resource = s->resmgr->findResource(kResourceTypePalette, 999, 1);
if (resource) {
@@ -125,7 +126,6 @@
s->gfx_state->gfxResMan->setStaticPalette(gfxr_read_pal1(999, resource->data, resource->size));
else
s->gfx_state->gfxResMan->setStaticPalette(gfxr_read_pal11(999, resource->data, resource->size));
- _sci1_alloc_system_colors(s);
s->resmgr->unlockResource(resource, 999, kResourceTypePalette);
} else {
sciprintf("Couldn't find the default palette!\n");
Modified: scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp 2009-03-29 21:46:26 UTC (rev 39746)
+++ scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp 2009-03-29 21:46:49 UTC (rev 39747)
@@ -242,6 +242,19 @@
_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)) { \
Modified: scummvm/trunk/engines/sci/gfx/gfx_resmgr.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resmgr.h 2009-03-29 21:46:26 UTC (rev 39746)
+++ scummvm/trunk/engines/sci/gfx/gfx_resmgr.h 2009-03-29 21:46:49 UTC (rev 39747)
@@ -224,14 +224,8 @@
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:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list