SCI: update sys palette timestamp only on kDrawPic in SCI1.1, fixes intro of island of dr. brain

svn-id: r50077
This commit is contained in:
Martin Kiewitz 2010-06-20 13:25:08 +00:00
parent 871c9bddde
commit 30f6e7824b
3 changed files with 15 additions and 1 deletions

View File

@ -75,6 +75,10 @@ void GfxPaint16::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mi
picture->draw(animationNr, mirroredFlag, addToFlag, paletteId);
delete picture;
// We update our sys palette timestamp here (SCI1.1 only)
if (getSciVersion() == SCI_VERSION_1_1)
_palette->increaseSysTimestamp();
}
// This one is the only one that updates screen!

View File

@ -292,10 +292,18 @@ bool GfxPalette::merge(Palette *pFrom, bool force, bool forceRealMerge) {
}
}
}
_sysPalette.timestamp = g_system->getMillis() * 60 / 1000;
// We don't update the timestamp here for SCI1.1, it's only updated on kDrawPic calls
if (getSciVersion() < SCI_VERSION_1_1)
_sysPalette.timestamp = g_system->getMillis() * 60 / 1000;
return paletteChanged;
}
// This is used for SCI1.1 and called from kDrawPic. We only update sysPalette timestamp this way for SCI1.1
void GfxPalette::increaseSysTimestamp() {
_sysPalette.timestamp++;
}
uint16 GfxPalette::matchColor(byte r, byte g, byte b) {
byte found = 0xFF;
int diff = 0x2FFFF, cdiff;

View File

@ -51,6 +51,8 @@ public:
void setOnScreen();
void increaseSysTimestamp();
bool kernelSetFromResource(GuiResourceId resourceId, bool force);
void kernelSetFlag(uint16 fromColor, uint16 toColor, uint16 flag);
void kernelUnsetFlag(uint16 fromColor, uint16 toColor, uint16 flag);