aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2012-06-22 09:43:44 +0300
committerFilippos Karapetis2012-06-22 09:43:44 +0300
commit547fdfe12a3b999473304925bf80ae1afda5f8d6 (patch)
treeeb794c70133854a198fd6fa547e8a837ba5047e9
parent08124396035e8fd0996c9d347be3d606a58ecd1f (diff)
downloadscummvm-rg350-547fdfe12a3b999473304925bf80ae1afda5f8d6.tar.gz
scummvm-rg350-547fdfe12a3b999473304925bf80ae1afda5f8d6.tar.bz2
scummvm-rg350-547fdfe12a3b999473304925bf80ae1afda5f8d6.zip
SCI: Further cleanup of the frame drawing code
-rw-r--r--engines/sci/graphics/frameout.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 0681102863..265a175e66 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -648,15 +648,14 @@ void GfxFrameout::kernelFrameout() {
drawPicture(itemEntry, it->planeOffsetX, it->planeOffsetY, it->planePictureMirrored);
} else {
GfxView *view = (itemEntry->viewId != 0xFFFF) ? _cache->getView(itemEntry->viewId) : NULL;
-
+ int16 dummyX = 0;
+
if (view && view->isSci2Hires()) {
- int16 dummyX = 0;
view->adjustToUpscaledCoordinates(itemEntry->y, itemEntry->x);
view->adjustToUpscaledCoordinates(itemEntry->z, dummyX);
} else if (getSciVersion() == SCI_VERSION_2_1) {
_coordAdjuster->fromScriptToDisplay(itemEntry->y, itemEntry->x);
- int16 tmpVal = 0;
- _coordAdjuster->fromScriptToDisplay(itemEntry->z, tmpVal);
+ _coordAdjuster->fromScriptToDisplay(itemEntry->z, dummyX);
}
// Adjust according to current scroll position
@@ -707,17 +706,9 @@ void GfxFrameout::kernelFrameout() {
g_sci->_gfxCompare->setNSRect(itemEntry->object, nsRect);
}
- int16 screenHeight = _screen->getHeight();
- int16 screenWidth = _screen->getWidth();
- if (view && view->isSci2Hires()) {
- screenHeight = _screen->getDisplayHeight();
- screenWidth = _screen->getDisplayWidth();
- }
-
- if (itemEntry->celRect.bottom < 0 || itemEntry->celRect.top >= screenHeight)
- continue;
-
- if (itemEntry->celRect.right < 0 || itemEntry->celRect.left >= screenWidth)
+ // FIXME: When does this happen, and why?
+ if (itemEntry->celRect.bottom < 0 || itemEntry->celRect.top >= _screen->getDisplayHeight() ||
+ itemEntry->celRect.right < 0 || itemEntry->celRect.left >= _screen->getDisplayWidth())
continue;
Common::Rect clipRect, translatedClipRect;