aboutsummaryrefslogtreecommitdiff
path: root/scumm/gfx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scumm/gfx.cpp')
-rw-r--r--scumm/gfx.cpp45
1 files changed, 35 insertions, 10 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 349a239f51..7322099552 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -66,7 +66,7 @@ struct TransitionEffect {
#ifdef __PALM_OS__
static const TransitionEffect *transitionEffects;
#else
-static const TransitionEffect transitionEffects[4] = {
+static const TransitionEffect transitionEffects[5] = {
// Iris effect (looks like an opening/closing camera iris)
{
13, // Number of iterations
@@ -100,7 +100,23 @@ static const TransitionEffect transitionEffects[4] = {
255, 0, 0, 0
}
},
-
+
+ // Inverse iris effect, specially tailored for V2 games
+ {
+ 8, // Number of iterations
+ {
+ -1, -1, 1, -1,
+ -1, 1, 1, 1,
+ -1, -1, -1, 1,
+ 1, -1, 1, 1
+ },
+ {
+ 7, 7, 32, 7,
+ 7, 8, 32, 8,
+ 7, 8, 7, 8,
+ 32, 7, 32, 8
+ }
+ },
// Box wipe (a box expands from the lower-right corner to the upper-left corner)
{
@@ -1153,7 +1169,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi
if (_vm->_features & GF_AFTER_V1) {
mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + y * _numStrips + x + _imgBufOffs[1];
-// drawStripC64Mask(mask_ptr, stripnr, height);
+ drawStripC64Mask(mask_ptr, stripnr, height);
} else if (_vm->_features & GF_AFTER_V2) {
// Do nothing here for V2 games - zplane was handled already.
} else if (flag & dbDrawMaskOnAll) {
@@ -1352,7 +1368,7 @@ void Gdi::drawStripC64Background(byte *dst, int stripnr, int height) {
}
void Gdi::drawStripC64Mask(byte *dst, int stripnr, int height) {
- for(int y = 0; y < (height / 8); y++) {
+ for(int y = 0; y < (height >> 3); y++) {
for(int i = 0; i < 8; i++) {
for(int j = 7; j >= 0; j--) {
*(dst + (7 - j) + stripnr * 8 + (y * 8 + i) * _vm->_screenWidth) =
@@ -2129,7 +2145,15 @@ void Scumm::fadeIn(int effect) {
case 2:
case 3:
case 4:
- transitionEffect(effect - 1);
+ case 5:
+ // Some of the transition effects won't work properly unless
+ // the screen is marked as clean first. At first I thought I
+ // could safely do this every time fadeIn() was called, but
+ // that broke the FOA intro. Probably other things as well.
+ //
+ // Hopefully it's safe to do it at this point, at least.
+ virtscr[0].setDirtyRange(0, 0);
+ transitionEffect(effect - 1);
break;
case 128:
unkScreenEffect6();
@@ -2173,6 +2197,7 @@ void Scumm::fadeOut(int effect) {
case 2:
case 3:
case 4:
+ case 5:
transitionEffect(effect - 1);
break;
case 128:
@@ -2246,7 +2271,9 @@ void Scumm::transitionEffect(int a) {
continue;
if (b > bottom)
b = bottom;
- virtscr[0].tdirty[l] = t << 3;
+ if (t < 0)
+ t = 0;
+ virtscr[0].tdirty[l] = t << 3;
virtscr[0].bdirty[l] = (b + 1) << 3;
}
updateDirtyScreen(0);
@@ -2973,8 +3000,7 @@ void Scumm::darkenPalette(int redScale, int greenScale, int blueScale, int start
}
}
-static double value(double n1, double n2, double hue)
-{
+static double value(double n1, double n2, double hue) {
if (hue > 360.0)
hue = hue - 360.0;
else if (hue < 0.0)
@@ -2999,8 +3025,7 @@ static double value(double n1, double n2, double hue)
*
* @todo Rewrite desaturatePalette using integer arithmetics only?
*/
-void Scumm::desaturatePalette(int hueScale, int satScale, int lightScale, int startColor, int endColor)
-{
+void Scumm::desaturatePalette(int hueScale, int satScale, int lightScale, int startColor, int endColor) {
if (startColor <= endColor) {
const byte *cptr;