aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-21 13:13:55 +0000
committerMartin Kiewitz2010-07-21 13:13:55 +0000
commite1bc084547ff6235fe35e8f9830f34859c255db7 (patch)
tree9d7e22edff54c68e57e31216c4f99adc00e37f67
parent54c516b3bf34ce2f6f4e7f499839dfad2d5fa68a (diff)
downloadscummvm-rg350-e1bc084547ff6235fe35e8f9830f34859c255db7.tar.gz
scummvm-rg350-e1bc084547ff6235fe35e8f9830f34859c255db7.tar.bz2
scummvm-rg350-e1bc084547ff6235fe35e8f9830f34859c255db7.zip
SCI: fixing hires background pictures sci2.1
svn-id: r51086
-rw-r--r--engines/sci/graphics/frameout.cpp4
-rw-r--r--engines/sci/graphics/picture.cpp9
-rw-r--r--engines/sci/graphics/picture.h2
3 files changed, 10 insertions, 5 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 37c99e1e83..d540b44557 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -230,7 +230,7 @@ void GfxFrameout::kernelFrameout() {
itemEntry = *listIterator;
if (planePicture) {
while ((planePictureCel <= itemEntry->priority) && (planePictureCel < planePictureCels)) {
- planePicture->drawSci32Vga(planePictureCel);
+ planePicture->drawSci32Vga(planePictureCel, planeResY, planeResX);
planePictureCel++;
}
}
@@ -302,7 +302,7 @@ void GfxFrameout::kernelFrameout() {
if (planePicture) {
while (planePictureCel < planePictureCels) {
- planePicture->drawSci32Vga(planePictureCel);
+ planePicture->drawSci32Vga(planePictureCel, planeResY, planeResX);
planePictureCel++;
}
delete planePicture;
diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp
index 1416412b33..65a253459e 100644
--- a/engines/sci/graphics/picture.cpp
+++ b/engines/sci/graphics/picture.cpp
@@ -79,7 +79,7 @@ void GfxPicture::draw(int16 animationNr, bool mirroredFlag, bool addToFlag, int1
#ifdef ENABLE_SCI32
case 0x0e: // SCI32 VGA picture
_resourceType = SCI_PICTURE_TYPE_SCI32;
- drawSci32Vga();
+ //drawSci32Vga();
break;
#endif
default:
@@ -131,7 +131,7 @@ int16 GfxPicture::getSci32celCount() {
return inbuffer[2];
}
-void GfxPicture::drawSci32Vga(int16 celNo) {
+void GfxPicture::drawSci32Vga(int16 celNo, uint16 planeResY, uint16 planeResX) {
byte *inbuffer = _resource->data;
int size = _resource->size;
int header_size = READ_LE_UINT16(inbuffer);
@@ -162,6 +162,11 @@ void GfxPicture::drawSci32Vga(int16 celNo) {
cel_LiteralPos = READ_LE_UINT32(inbuffer + cel_headerPos + 28);
cel_relXpos = READ_LE_UINT16(inbuffer + cel_headerPos + 38);
cel_relYpos = READ_LE_UINT16(inbuffer + cel_headerPos + 40);
+
+ // This is really weird, adjusting picture data to plane resolution - why...
+ cel_relYpos = ((cel_relYpos * g_sci->_gfxScreen->getHeight()) / planeResY);
+ cel_relXpos = ((cel_relXpos * g_sci->_gfxScreen->getWidth()) / planeResX);
+
drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, cel_relXpos, cel_relYpos);
cel_headerPos += 42;
celCount--;
diff --git a/engines/sci/graphics/picture.h b/engines/sci/graphics/picture.h
index 5a86539b37..b5636d5bd8 100644
--- a/engines/sci/graphics/picture.h
+++ b/engines/sci/graphics/picture.h
@@ -56,7 +56,7 @@ public:
#ifdef ENABLE_SCI32
int16 getSci32celCount();
- void drawSci32Vga(int16 celNo = -1);
+ void drawSci32Vga(int16 celNo, uint16 planeResY, uint16 planeResX);
#endif
private: