diff options
author | Martin Kiewitz | 2010-02-05 14:48:51 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-02-05 14:48:51 +0000 |
commit | f8f490c565809c93ca35928210a740b6579fba19 (patch) | |
tree | 94c07530aa26dc845eb7d1731a18f8f8c0aeaa0d /engines/sci/engine | |
parent | 6c204cc890ed769f4d9268e80c6814c2eb95eb02 (diff) | |
download | scummvm-rg350-f8f490c565809c93ca35928210a740b6579fba19.tar.gz scummvm-rg350-f8f490c565809c93ca35928210a740b6579fba19.tar.bz2 scummvm-rg350-f8f490c565809c93ca35928210a740b6579fba19.zip |
SCI: calling most of the cursor functions directly via _gfxCursor instead of SciGui/32
svn-id: r47903
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kevent.cpp | 7 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 49 | ||||
-rw-r--r-- | engines/sci/engine/state.h | 2 |
3 files changed, 12 insertions, 46 deletions
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp index 40ea736a8c..0224ecae90 100644 --- a/engines/sci/engine/kevent.cpp +++ b/engines/sci/engine/kevent.cpp @@ -47,12 +47,7 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { SegManager *segMan = s->_segMan; Common::Point mousePos; -#ifdef ENABLE_SCI32 - if (s->_gui32) - mousePos = s->_gui32->getCursorPos(); - else -#endif - mousePos = s->_gui->getCursorPos(); + mousePos = s->_gfxCursor->getPosition(); // If there's a simkey pending, and the game wants a keyboard event, use the // simkey instead of a normal event diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 7f8ee9de31..b9d898c102 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -107,7 +107,7 @@ static reg_t kSetCursorSci0(EngineState *s, int argc, reg_t *argv) { cursorId = -1; } - s->_gui->setCursorShape(cursorId); + s->_gfxCursor->kernelSetShape(cursorId); return s->r_acc; } @@ -119,12 +119,7 @@ static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) { case 1: switch (argv[0].toSint16()) { case 0: -#ifdef ENABLE_SCI32 - if (s->_gui32) - s->_gui32->hideCursor(); - else -#endif - s->_gui->hideCursor(); + s->_gfxCursor->kernelHide(); break; case -1: // TODO: Special case at least in kq6, check disassembly @@ -133,12 +128,7 @@ static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) { // TODO: Special case at least in kq6, check disassembly break; default: -#ifdef ENABLE_SCI32 - if (s->_gui32) - s->_gui32->showCursor(); - else -#endif - s->_gui->showCursor(); + s->_gfxCursor->kernelShow(); break; } case 2: @@ -176,12 +166,7 @@ static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) { hotspot = new Common::Point(argv[3].toSint16(), argv[4].toSint16()); // Fallthrough case 3: -#ifdef ENABLE_SCI32 - if (s->_gui32) - s->_gui32->setCursorView(argv[0].toUint16(), argv[1].toUint16(), argv[2].toUint16(), hotspot); - else -#endif - s->_gui->setCursorView(argv[0].toUint16(), argv[1].toUint16(), argv[2].toUint16(), hotspot); + s->_gfxCursor->kernelSetView(argv[0].toUint16(), argv[1].toUint16(), argv[2].toUint16(), hotspot); break; default : warning("kSetCursor: Unhandled case: %d arguments given", argc); @@ -1139,19 +1124,9 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) { // previously visible. bool reshowCursor; -#ifdef ENABLE_SCI32 - if (s->_gui32) { - reshowCursor = s->_gui32->isCursorVisible(); - if (reshowCursor) - s->_gui32->hideCursor(); - } else { -#endif - reshowCursor = s->_gui->isCursorVisible(); - if (reshowCursor) - s->_gui->hideCursor(); -#ifdef ENABLE_SCI32 - } -#endif + reshowCursor = s->_gfxCursor->isVisible(); + if (reshowCursor) + s->_gfxCursor->kernelHide(); // The Windows and DOS versions use different video format as well // as a different argument set. @@ -1218,14 +1193,8 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) { s->_gfxScreen->kernelSyncWithFramebuffer(); } - if (reshowCursor) { -#ifdef ENABLE_SCI32 - if (s->_gui32) - s->_gui32->showCursor(); - else -#endif - s->_gui->showCursor(); - } + if (reshowCursor) + s->_gfxCursor->kernelShow(); return s->r_acc; } diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index abf8af4970..a11ba50855 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -54,6 +54,7 @@ class SciEvent; class GfxAnimate; class GfxCache; class GfxControls; +class GfxCursor; class GfxMenu; class GfxPaint; class GfxPaint16; @@ -153,6 +154,7 @@ public: GfxAnimate *_gfxAnimate; // Animate for 16-bit gfx GfxCache *_gfxCache; GfxControls *_gfxControls; // Controls for 16-bit gfx + GfxCursor *_gfxCursor; GfxMenu *_gfxMenu; // Menu for 16-bit gfx GfxPalette *_gfxPalette; GfxPaint *_gfxPaint; |