diff options
author | Paul Gilbert | 2012-01-18 23:09:31 +1100 |
---|---|---|
committer | Strangerke | 2012-04-06 08:19:54 +0200 |
commit | 45083e7c94508d09e8e96e8e90c452218e2a07bc (patch) | |
tree | b412bad76032ac51e963373c225ebc88041387fd /engines/mortevielle | |
parent | 55f5adeff3550695d6da84adce8db698ef2f1514 (diff) | |
download | scummvm-rg350-45083e7c94508d09e8e96e8e90c452218e2a07bc.tar.gz scummvm-rg350-45083e7c94508d09e8e96e8e90c452218e2a07bc.tar.bz2 scummvm-rg350-45083e7c94508d09e8e96e8e90c452218e2a07bc.zip |
MORTEVIELLE: Added needed palette remapping to drawPicture()
The remapping allows the first image to now display using the correct colours.
Diffstat (limited to 'engines/mortevielle')
-rw-r--r-- | engines/mortevielle/graphics.cpp | 25 | ||||
-rw-r--r-- | engines/mortevielle/level15.cpp | 1 | ||||
-rw-r--r-- | engines/mortevielle/var_mor.cpp | 2 |
3 files changed, 12 insertions, 16 deletions
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp index dda2974228..44bd58dfb5 100644 --- a/engines/mortevielle/graphics.cpp +++ b/engines/mortevielle/graphics.cpp @@ -892,8 +892,8 @@ void ScreenSurface::updateScreen() { * Draws a decoded picture on the screen * @remarks - Because the ScummVM surface is using a double height 640x400 surface to * simulate the original 640x400 surface, all Y values have to be doubled. - * - Image resources are stored at 320x200, so when drawn onto the screen every - * other column is interpolated. + * - Image resources are stored at 320x200, so when drawn onto the screen a single pixel + * from the source image is drawn using the two pixels at the given index in the palette map * - Because the original game supported 320 width resolutions, the X coordinate * also needs to be doubled for EGA mode */ @@ -906,6 +906,9 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) { Graphics::Surface destSurface = lockArea(Common::Rect(x * 2, y * 2, (x + surface.w) * 2, (y + surface.h) * 2)); + // Get a lookup for the palette mapping + const byte *paletteMap = &mem[0x7000 * 16 + 2]; + // Loop through writing for (int yp = 0; yp < surface.h; ++yp) { if (((y + yp) < 0) || ((y + yp) >= 200)) @@ -915,20 +918,14 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) { byte *pDest = (byte *)destSurface.getBasePtr(0, yp * 2); for (int xp = 0; xp < surface.w; ++xp, ++pSrc) { - // Draw pixel from source image - *pDest = *pSrc; - *(pDest + SCREEN_WIDTH) = *pSrc; + // Draw the pixel using the specified index in the palette map + *pDest = paletteMap[*pSrc * 2]; + *(pDest + SCREEN_WIDTH) = paletteMap[*pSrc * 2]; ++pDest; - // TODO: I'm not sure what algorithm the original uses to calculate - // which pixel to use on the alternate columns, so for now I'm doing - // a simple output of null values. This should be revisited once we've - // got the palette loading so we can compare palettes. In fact, the - // original had the alternate columns very noticablely striped. With - // the larger 256 colour palette, it may be worthwhile to offer a - // better blended graphics mode as an option. - *pDest = 0; - *(pDest + SCREEN_WIDTH) = 0; + // Use the secondary mapping value to draw the secondary column pixel + *pDest = paletteMap[*pSrc * 2 + 1]; + *(pDest + SCREEN_WIDTH) = paletteMap[*pSrc * 2 + 1]; ++pDest; } } diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp index 8b8dbcf02f..42e4393527 100644 --- a/engines/mortevielle/level15.cpp +++ b/engines/mortevielle/level15.cpp @@ -103,7 +103,6 @@ void pictout(int seg, int dep, int x, int y) { GfxSurface surface; surface.decode(&mem[seg * 16 + dep]); - decomp(seg, dep); if (gd == her) { mem[0x7000 * 16 + 2] = 0; mem[0x7000 * 16 + 32] = 15; diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp index 1b742a75e2..0b004a163a 100644 --- a/engines/mortevielle/var_mor.cpp +++ b/engines/mortevielle/var_mor.cpp @@ -399,7 +399,7 @@ void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt) { // (* external 'c:\mc\decomp.com'; *) void decomp(int seg, int dep) { - warning("TODO: decomp"); + warning("TODO: decomp deprecated in faovur of GfxSurface::decode"); } // (* external 'c:\mc\affich.com'; *) |