aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authormd52011-03-07 13:23:52 +0200
committermd52011-03-07 13:23:52 +0200
commit4ddc66d68ef1439ceb669658ea2651a6a5a06597 (patch)
tree18ad30cacc91ec7d224e4b559893f2b5b9b7f8a4 /engines/sci/graphics
parentdf1a800d01918ddda9159e3b9f42e8ef8d701456 (diff)
downloadscummvm-rg350-4ddc66d68ef1439ceb669658ea2651a6a5a06597.tar.gz
scummvm-rg350-4ddc66d68ef1439ceb669658ea2651a6a5a06597.tar.bz2
scummvm-rg350-4ddc66d68ef1439ceb669658ea2651a6a5a06597.zip
SCI: Initial handling of the views in Longbow Amiga. Still not right
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/helpers.h3
-rw-r--r--engines/sci/graphics/palette.cpp16
-rw-r--r--engines/sci/graphics/picture.cpp4
-rw-r--r--engines/sci/graphics/view.cpp17
4 files changed, 24 insertions, 16 deletions
diff --git a/engines/sci/graphics/helpers.h b/engines/sci/graphics/helpers.h
index 1a87e566d5..343f3c7e6e 100644
--- a/engines/sci/graphics/helpers.h
+++ b/engines/sci/graphics/helpers.h
@@ -143,7 +143,8 @@ enum ViewType {
kViewUnknown, // uninitialized, or non-SCI
kViewEga, // EGA SCI0/SCI1 and Amiga SCI0/SCI1 ECS 16 colors
kViewAmiga, // Amiga SCI1 ECS 32 colors
- kViewVga, // VGA SCI1 256 colors or Amiga SCI1 AGA 64 colors (i.e. Longbow)
+ kViewAmiga64, // Amiga SCI1 AGA 64 colors (i.e. Longbow)
+ kViewVga, // VGA SCI1 256 colors
kViewVga11 // VGA SCI1.1 and newer 256 colors
};
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 3b3596a336..5a6b1859cd 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -78,18 +78,18 @@ GfxPalette::GfxPalette(ResourceManager *resMan, GfxScreen *screen, bool useMergi
#endif
switch (_resMan->getViewType()) {
- case kViewVga:
- case kViewVga11:
- if (g_sci->getPlatform() == Common::kPlatformAmiga)
- _totalScreenColors = 64; // Longbow Amiga
- else
- _totalScreenColors = 256;
+ case kViewEga:
+ _totalScreenColors = 16;
break;
case kViewAmiga:
_totalScreenColors = 32;
break;
- case kViewEga:
- _totalScreenColors = 16;
+ case kViewAmiga64:
+ _totalScreenColors = 64;
+ break;
+ case kViewVga:
+ case kViewVga11:
+ _totalScreenColors = 256;
break;
default:
error("GfxPalette: Unknown view type");
diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp
index 6a3767a0c8..e60a62e423 100644
--- a/engines/sci/graphics/picture.cpp
+++ b/engines/sci/graphics/picture.cpp
@@ -712,9 +712,7 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) {
}
break;
case PIC_OPX_VGA_SET_PALETTE:
- if (_resMan->getViewType() == kViewAmiga ||
- (_resMan->getViewType() == kViewVga && g_sci->getPlatform() == Common::kPlatformAmiga) // Longbow Amiga
- ) {
+ if (_resMan->getViewType() == kViewAmiga || _resMan->getViewType() == kViewAmiga64) {
if ((data[curPos] == 0x00) && (data[curPos + 1] == 0x01) && ((data[curPos + 32] & 0xF0) != 0xF0)) {
// Left-Over VGA palette, we simply ignore it
curPos += 256 + 4 + 1024;
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index a6c0805f65..fd74714495 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -106,7 +106,8 @@ void GfxView::initData(GuiResourceId resourceId) {
switch (curViewType) {
case kViewEga: // SCI0 (and Amiga 16 colors)
isEGA = true;
- case kViewAmiga: // Amiga (32 colors)
+ case kViewAmiga: // Amiga ECS (32 colors)
+ case kViewAmiga64: // Amiga AGA (64 colors)
case kViewVga: // View-format SCI1
// LoopCount:WORD MirrorMask:WORD Version:WORD PaletteOffset:WORD LoopOffset0:WORD LoopOffset1:WORD...
@@ -396,15 +397,23 @@ void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCo
if (curByte & 0x07) { // fill with color
runLength = curByte & 0x07;
curByte = curByte >> 3;
- while (runLength-- && pixelNr < pixelCount) {
+ while (runLength-- && pixelNr < pixelCount)
outPtr[pixelNr++] = curByte;
- }
} else { // fill with transparent
runLength = curByte >> 3;
pixelNr += runLength;
}
}
break;
+ case kViewAmiga64:
+ // TODO: This isn't 100% right. Implement it fully.
+ while (pixelNr < pixelCount) {
+ curByte = *rlePtr++;
+ runLength = curByte >> 6;
+ memset(outPtr + pixelNr, curByte & 0x3F, MIN<uint16>(runLength, pixelCount - pixelNr));
+ pixelNr += runLength;
+ }
+ break;
case kViewVga:
case kViewVga11:
while (pixelNr < pixelCount) {
@@ -432,6 +441,7 @@ void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCo
error("Unsupported picture viewtype");
}
} else {
+ // decompression for data that has two separate streams (probably a SCI 1.1 view)
if (isMacSci11ViewData) {
// KQ6/Freddy Pharkas use byte lengths, all others use uint16
// The SCI devs must have realized that a max of 255 pixels wide
@@ -457,7 +467,6 @@ void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCo
pixelNr = pixelLine + width;
}
} else {
- // decompression for data that has two separate streams (probably SCI 1.1 view)
while (pixelNr < pixelCount) {
curByte = *rlePtr++;
runLength = curByte & 0x3F;