aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorColin Snover2018-02-10 16:31:43 -0600
committerFilippos Karapetis2019-05-12 19:05:49 +0300
commitfde0a488b745958cc5e799c31f37974336d65b1d (patch)
tree681551b5ae7914c2743aa76355f37e015a88a6db /engines/sci
parent5c8c1ca95ce25f39467eef2001a0e204b46f7eb9 (diff)
downloadscummvm-rg350-fde0a488b745958cc5e799c31f37974336d65b1d.tar.gz
scummvm-rg350-fde0a488b745958cc5e799c31f37974336d65b1d.tar.bz2
scummvm-rg350-fde0a488b745958cc5e799c31f37974336d65b1d.zip
SCI32: Fix invalid calls to SCI16 graphics code
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kgraphics.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 8e97716b96..1e380e2573 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -492,7 +492,12 @@ reg_t kNumLoops(EngineState *s, int argc, reg_t *argv) {
GuiResourceId viewId = readSelectorValue(s->_segMan, object, SELECTOR(view));
int16 loopCount;
- loopCount = g_sci->_gfxCache->kernelViewGetLoopCount(viewId);
+#ifdef ENABLE_SCI32
+ if (getSciVersion() >= SCI_VERSION_2) {
+ loopCount = CelObjView::getNumLoops(viewId);
+ } else
+#endif
+ loopCount = g_sci->_gfxCache->kernelViewGetLoopCount(viewId);
debugC(9, kDebugLevelGraphics, "NumLoops(view.%d) = %d", viewId, loopCount);
@@ -505,7 +510,12 @@ reg_t kNumCels(EngineState *s, int argc, reg_t *argv) {
int16 loopNo = readSelectorValue(s->_segMan, object, SELECTOR(loop));
int16 celCount;
- celCount = g_sci->_gfxCache->kernelViewGetCelCount(viewId, loopNo);
+#ifdef ENABLE_SCI32
+ if (getSciVersion() >= SCI_VERSION_2) {
+ celCount = CelObjView::getNumCels(viewId, loopNo);
+ } else
+#endif
+ celCount = g_sci->_gfxCache->kernelViewGetCelCount(viewId, loopNo);
debugC(9, kDebugLevelGraphics, "NumCels(view.%d, %d) = %d", viewId, loopNo, celCount);