diff options
author | Martin Kiewitz | 2010-01-10 08:55:19 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-01-10 08:55:19 +0000 |
commit | da09ee6732b77461d836f064ff7200b2f94ae80f (patch) | |
tree | 3d836e3c37a455906f8ca73c48f73a2366a2f34c | |
parent | 96068d30d937c5529e730ac61fd1ba26f69d7706 (diff) | |
download | scummvm-rg350-da09ee6732b77461d836f064ff7200b2f94ae80f.tar.gz scummvm-rg350-da09ee6732b77461d836f064ff7200b2f94ae80f.tar.bz2 scummvm-rg350-da09ee6732b77461d836f064ff7200b2f94ae80f.zip |
SCI: switching to hires kDrawCel when 8th parameter is passed, fixed kDrawCel port adjust - fixes kq6 hires inventory
svn-id: r47217
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 3 | ||||
-rw-r--r-- | engines/sci/graphics/gfx.cpp | 6 | ||||
-rw-r--r-- | engines/sci/graphics/gui.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/gui.h | 2 |
4 files changed, 9 insertions, 6 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index ec787b464e..f9ae3e2366 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -910,9 +910,10 @@ reg_t kDrawCel(EngineState *s, int argc, reg_t *argv) { uint16 y = argv[4].toUint16(); int16 priority = (argc > 5) ? argv[5].toSint16() : -1; uint16 paletteNo = (argc > 6) ? argv[6].toUint16() : 0; + bool hiresMode = (argc > 7) ? true : false; reg_t upscaledHiresHandle = (argc > 7) ? argv[7] : NULL_REG; - s->_gui->drawCel(viewId, loopNo, celNo, x, y, priority, paletteNo, upscaledHiresHandle); + s->_gui->drawCel(viewId, loopNo, celNo, x, y, priority, paletteNo, hiresMode, upscaledHiresHandle); return s->r_acc; } diff --git a/engines/sci/graphics/gfx.cpp b/engines/sci/graphics/gfx.cpp index d671d8e6e8..299f2cbd64 100644 --- a/engines/sci/graphics/gfx.cpp +++ b/engines/sci/graphics/gfx.cpp @@ -386,6 +386,7 @@ void Gfx::drawCel(View *view, int16 loopNo, int16 celNo, Common::Rect celRect, b void Gfx::drawHiresCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY) { View *view = getView(viewId); Common::Rect celRect, curPortRect, clipRect, clipRectTranslated; + Common::Point curPortPos; if (view) { celRect.left = leftPos; @@ -402,8 +403,9 @@ void Gfx::drawHiresCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, u return; clipRectTranslated = clipRect; - clipRectTranslated.top += curPortRect.top; clipRectTranslated.bottom += curPortRect.top; - clipRectTranslated.left += curPortRect.left; clipRectTranslated.right += curPortRect.left; + curPortPos.x = _curPort->left * 2; curPortPos.y = _curPort->top * 2; + clipRectTranslated.top += curPortPos.y; clipRectTranslated.bottom += curPortPos.y; + clipRectTranslated.left += curPortPos.x; clipRectTranslated.right += curPortPos.x; view->draw(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo, true, scaleX, scaleY); if (!_screen->_picNotValidSci11) { diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp index 3f62c0f5c7..228527a50a 100644 --- a/engines/sci/graphics/gui.cpp +++ b/engines/sci/graphics/gui.cpp @@ -368,8 +368,8 @@ void SciGui::drawPicture(GuiResourceId pictureId, int16 animationNr, bool animat _gfx->SetPort(oldPort); } -void SciGui::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, reg_t upscaledHiresHandle) { - if (upscaledHiresHandle.isNull()) { +void SciGui::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle) { + if (!hiresMode) { _gfx->drawCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo); } else { if ((leftPos == 0) && (topPos == 0)) { diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h index d456b2cf0b..0813acd1f8 100644 --- a/engines/sci/graphics/gui.h +++ b/engines/sci/graphics/gui.h @@ -88,7 +88,7 @@ public: virtual reg_t menuSelect(reg_t eventObject); virtual void drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo); - virtual void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, reg_t upscaledHiresHandle = NULL_REG); + virtual void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode = false, reg_t upscaledHiresHandle = NULL_REG); virtual void drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite); virtual void drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 alignment, int16 style, bool hilite); virtual void drawControlTextEdit(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, int16 cursorPos, int16 maxChars, bool hilite); |