aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kernel.cpp3
-rw-r--r--engines/sci/engine/kgraphics.cpp14
-rw-r--r--engines/sci/graphics/gui.cpp4
-rw-r--r--engines/sci/graphics/gui.h2
4 files changed, 9 insertions, 14 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 0b80871ce4..5adf13461f 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -201,7 +201,7 @@ SciKernelFunction kfunct_mappers[] = {
/*0e*/ DEFUN("NumCels", kNumCels, "o"),
/*0f*/ DEFUN("CelWide", kCelWide, "iOi*"),
/*10*/ DEFUN("CelHigh", kCelHigh, "iOi*"),
- /*11*/ DEFUN("DrawCel", kDrawCel, "iiiiii*"),
+ /*11*/ DEFUN("DrawCel", kDrawCel, "iiiiiii*r*"),
/*12*/ DEFUN("AddToPic", kAddToPic, "Il*"),
// FIXME: signature check removed (set to .*) as kNewWindow is different in Mac versions
/*13*/ DEFUN("NewWindow", kNewWindow, "*."),
@@ -658,6 +658,7 @@ int determine_reg_type(SegManager *segMan, reg_t reg) {
case SEG_TYPE_STACK:
case SEG_TYPE_SYS_STRINGS:
case SEG_TYPE_DYNMEM:
+ case SEG_TYPE_HUNK:
#ifdef ENABLE_SCI32
case SEG_TYPE_ARRAY:
case SEG_TYPE_STRING:
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 686c4ae10f..ea323f84b8 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -281,14 +281,8 @@ reg_t kGraph(EngineState *s, int argc, reg_t *argv) {
break;
case K_GRAPH_SAVE_UPSCALEDHIRES_BOX:
- warning("kGraph case 15 (%d, %d, %d, %d)", x, y, x1, y1);
-
- // TODO: implement this properly. The code below crashes KQ6
-
- // Save an area given in upscaled-hires coordinates, so that a hires control will be drawn over it
- //kGraphCreateRect(x, y, x1, y1, &rect);
- //return s->_gui->graphSaveUpscaledHiresBox(rect);
- break;
+ kGraphCreateRect(x, y, x1, y1, &rect);
+ return s->_gui->graphSaveUpscaledHiresBox(rect);
default:
warning("Unsupported kGraph() operation %04x", argv[0].toSint16());
@@ -915,9 +909,9 @@ 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;
- int16 origHeight = (argc > 7) ? argv[7].toSint16() : -1;
+ bool upscaledHires = (argc > 7) ? true : false; // actual parameter is MemoryHandle to saved upscaled hires rect
- s->_gui->drawCel(viewId, loopNo, celNo, x, y, priority, paletteNo, origHeight);
+ s->_gui->drawCel(viewId, loopNo, celNo, x, y, priority, paletteNo, upscaledHires);
return s->r_acc;
}
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index 6e65c0e91f..f2e54d5e6b 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -367,8 +367,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, int16 origHeight) {
- if (origHeight == -1)
+void SciGui::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool upscaledHires) {
+ if (!upscaledHires)
_gfx->drawCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
else
_gfx->drawHiresCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h
index 6ca800efc2..0d9b481934 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, int16 origHeight = -1);
+ virtual void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool upscaledHires = false);
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);