aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-07 20:29:48 +0000
committerMartin Kiewitz2010-01-07 20:29:48 +0000
commit140b22a37400abb65a999c46b6e5145af0bcf364 (patch)
treecaafb0bd7ac14bb58ed593fe780a186f70314e1f /engines/sci/graphics
parenta15cc002bbbba1666cde6b12daa72edb40ef2e89 (diff)
downloadscummvm-rg350-140b22a37400abb65a999c46b6e5145af0bcf364.tar.gz
scummvm-rg350-140b22a37400abb65a999c46b6e5145af0bcf364.tar.bz2
scummvm-rg350-140b22a37400abb65a999c46b6e5145af0bcf364.zip
SCI: implement crazy hack that fixes coordinates of some cel placements. I'm not sure if thats what sierra sci actually does or if we get coordinates 0,0 due some error somewhere. Fixes portrait window placement in kq6 - strangely they are still not at the correct height perhaps related to not adjusting "correctly" (whatever this means in this ugly mess that hires was implemented) inside BitsSave()
svn-id: r47140
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/gui.cpp20
-rw-r--r--engines/sci/graphics/gui.h2
2 files changed, 18 insertions, 4 deletions
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index f2e54d5e6b..2fdb47f3db 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -367,11 +367,25 @@ 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, bool upscaledHires) {
- if (!upscaledHires)
+void SciGui::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, reg_t upscaledHiresHandle) {
+ if (upscaledHiresHandle.isNull()) {
_gfx->drawCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
- else
+ } else {
+ if ((leftPos == 0) && (topPos == 0)) {
+ // HACK: in kq6, we get leftPos&topPos == 0 SOMETIMES, that's why we need to get coordinates from upscaledHiresHandle
+ // I'm not sure if this is what we are supposed to do or if there is some other bug that actually makes
+ // coordinates to be 0 in the first place
+ byte *memoryPtr = NULL;
+ memoryPtr = kmem(_s->_segMan, upscaledHiresHandle);
+ if (memoryPtr) {
+ Common::Rect upscaledHiresRect;
+ _screen->bitsGetRect(memoryPtr, &upscaledHiresRect);
+ leftPos = upscaledHiresRect.left;
+ topPos = upscaledHiresRect.top;
+ }
+ }
_gfx->drawHiresCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
+ }
_palette->setOnScreen();
}
diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h
index 0d9b481934..c3c5ca6d85 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, bool upscaledHires = false);
+ virtual void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, 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);