SCI: Added support for 16/32 color view and picture patches

16 color patches (*.p16 and *.v16) are used in 16 color EGA SCI1 games
32 color patches (*.p32 and *.v32) are used in 32 color Amiga SCI1 games
Removed a workaround for SCI1 EGA (bug #3044500), as that bug has been
fixed already in the view patch. Thanks to waltervn for observing this.
This commit is contained in:
md5 2011-03-04 17:16:54 +02:00
parent fe7d2026b1
commit ef939772b3
2 changed files with 10 additions and 30 deletions

View File

@ -313,25 +313,6 @@ int16 GfxView::getHeight(int16 loopNo, int16 celNo) const {
const CelInfo *GfxView::getCelInfo(int16 loopNo, int16 celNo) const { const CelInfo *GfxView::getCelInfo(int16 loopNo, int16 celNo) const {
assert(_loopCount); assert(_loopCount);
// WORKAROUND for the EGA version of SQ1: View 506 is the portrait of the
// skimmer buyer in room 41 in SQ1. Loop 0 is his face looking left (shown
// the first time Roger arrives in Ulence Flats) and loop 1 is his face
// looking right (shown the second time he appears, when he makes the
// second offer for the skimmer). In the VGA version, the first two loops
// have 2 cels, a valid one (cel 0) and an invalid one (cel 1). In the EGA
// version, the cels in these two loops have been swapped. The game scripts,
// however seem to get confused by this situation, and when they check loop
// 1, cel 0 via kCelHigh and kCelWide regard it as invalid and never show
// it. We just swap the two cels here in the EGA version, making it behave
// like the VGA version, thus the game scripts show the correct loop. Fixes
// bug #3044500. Note that the same workaround is in getBitmap().
// TODO: Check if this issue happens in the original version.
if (g_sci->getGameId() == GID_SQ1 && !_resMan->isVGA() && _resourceId == 506) {
if ((loopNo == 0 || loopNo == 1) && celNo == 0)
celNo = 1;
}
loopNo = CLIP<int16>(loopNo, 0, _loopCount - 1); loopNo = CLIP<int16>(loopNo, 0, _loopCount - 1);
celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1); celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
return &_loop[loopNo].cel[celNo]; return &_loop[loopNo].cel[celNo];
@ -535,13 +516,6 @@ void GfxView::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint32 pixelCou
} }
const byte *GfxView::getBitmap(int16 loopNo, int16 celNo) { const byte *GfxView::getBitmap(int16 loopNo, int16 celNo) {
// WORKAROUND for the EGA version of SQ1, same as the one in getCelInfo().
// Check getCelInfo() above for more information.
if (g_sci->getGameId() == GID_SQ1 && !_resMan->isVGA() && _resourceId == 506) {
if ((loopNo == 0 || loopNo == 1) && celNo == 0)
celNo = 1;
}
loopNo = CLIP<int16>(loopNo, 0, _loopCount -1); loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1); celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
if (_loop[loopNo].cel[celNo].rawBitmap) if (_loop[loopNo].cel[celNo].rawBitmap)

View File

@ -1535,10 +1535,16 @@ void ResourceManager::readResourcePatches() {
mask += s_resourceTypeSuffixes[i]; mask += s_resourceTypeSuffixes[i];
SearchMan.listMatchingMembers(files, mask); SearchMan.listMatchingMembers(files, mask);
if (i == kResourceTypeScript && files.size() == 0) { if (i == kResourceTypeView) {
SearchMan.listMatchingMembers(files, "*.v16"); // EGA SCI1 view patches
SearchMan.listMatchingMembers(files, "*.v32"); // Amiga SCI1 view patches
} else if (i == kResourceTypePic) {
SearchMan.listMatchingMembers(files, "*.p16"); // EGA SCI1 picture patches
SearchMan.listMatchingMembers(files, "*.p32"); // Amiga SCI1 picture patches
} else if (i == kResourceTypeScript) {
if (files.size() == 0)
// SCI3 (we can't use getSciVersion() at this point) // SCI3 (we can't use getSciVersion() at this point)
mask = "*.csc"; SearchMan.listMatchingMembers(files, "*.csc");
SearchMan.listMatchingMembers(files, mask);
} }
for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) { for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) {