aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/picture.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2010-02-06 19:35:51 +0000
committerMartin Kiewitz2010-02-06 19:35:51 +0000
commit4cae2b13e2acbd81e4b726f1e409c5615eda7967 (patch)
treeb6eeaaf0887ef616347a059a0d9ebd9526e30a5e /engines/sci/graphics/picture.cpp
parentcf1b03f694740203901924ea66d004d26e461e0b (diff)
downloadscummvm-rg350-4cae2b13e2acbd81e4b726f1e409c5615eda7967.tar.gz
scummvm-rg350-4cae2b13e2acbd81e4b726f1e409c5615eda7967.tar.bz2
scummvm-rg350-4cae2b13e2acbd81e4b726f1e409c5615eda7967.zip
SCI: added plane coordinate adjustment code for sci32 when drawing pictures, put everything into GfxCoordAdjuster
svn-id: r47939
Diffstat (limited to 'engines/sci/graphics/picture.cpp')
-rw-r--r--engines/sci/graphics/picture.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp
index ac96746e1b..eba41baa63 100644
--- a/engines/sci/graphics/picture.cpp
+++ b/engines/sci/graphics/picture.cpp
@@ -28,13 +28,14 @@
#include "sci/engine/state.h"
#include "sci/graphics/screen.h"
#include "sci/graphics/palette.h"
+#include "sci/graphics/coordadjuster.h"
#include "sci/graphics/ports.h"
#include "sci/graphics/picture.h"
namespace Sci {
-GfxPicture::GfxPicture(ResourceManager *resMan, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize)
- : _resMan(resMan), _ports(ports), _screen(screen), _palette(palette), _resourceId(resourceId), _EGAdrawingVisualize(EGAdrawingVisualize) {
+GfxPicture::GfxPicture(ResourceManager *resMan, GfxCoordAdjuster *coordAdjuster, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize)
+ : _resMan(resMan), _coordAdjuster(coordAdjuster), _ports(ports), _screen(screen), _palette(palette), _resourceId(resourceId), _EGAdrawingVisualize(EGAdrawingVisualize) {
assert(resourceId != -1);
initData(resourceId);
}
@@ -280,20 +281,12 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos
memcpy(celBitmap, rlePtr, pixelCount);
}
- if (_ports) {
- // Set initial vertical coordinate by using current port
- y = callerY + _ports->getPort()->top;
- lastY = MIN<int16>(height + y, _ports->getPort()->rect.bottom + _ports->getPort()->top);
- leftX = callerX + _ports->getPort()->left;
- rightX = MIN<int16>(width + leftX, _ports->getPort()->rect.right + _ports->getPort()->left);
- } else {
- y = callerY + 10; // TODO: Implement plane support for SCI32
- lastY = y + height;
- if (lastY > _screen->getHeight())
- lastY = _screen->getHeight();
- leftX = callerX;
- rightX = leftX + width;
- }
+ Common::Rect displayArea = _coordAdjuster->pictureGetDisplayArea();
+
+ y = callerY + displayArea.top;
+ lastY = MIN<int16>(height + y, displayArea.bottom);
+ leftX = callerX + displayArea.left;
+ rightX = MIN<int16>(width + leftX, displayArea.right);
// Change clearcolor to white, if we dont add to an existing picture. That way we will paint everything on screen
// but white and that wont matter because the screen is supposed to be already white. It seems that most (if not all)