diff options
author | Martin Kiewitz | 2009-10-07 12:47:53 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-07 12:47:53 +0000 |
commit | 77b549a0ad9e3a66f9a571e049c26a74231c2ce4 (patch) | |
tree | f9be159bc9aac4a8ffc8fdbbf5d630ac6f63ff61 /engines/sci/engine | |
parent | 23b39f5c459c9387012e63cde931c9b929b387cb (diff) | |
download | scummvm-rg350-77b549a0ad9e3a66f9a571e049c26a74231c2ce4.tar.gz scummvm-rg350-77b549a0ad9e3a66f9a571e049c26a74231c2ce4.tar.bz2 scummvm-rg350-77b549a0ad9e3a66f9a571e049c26a74231c2ce4.zip |
SCI: SciGuiCursor class added, cleanup, OSystem removed from SciGui constructor
svn-id: r44730
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/game.cpp | 3 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 23 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 1 |
3 files changed, 18 insertions, 9 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index d87135503b..43fe120db5 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -279,7 +279,8 @@ int _reset_graphics_input(EngineState *s) { s->titlebar_port->_bgcolor.priority = 11; // Standard priority for the titlebar port #endif - s->gui->moveCursor(160, 150); + Common::Point mousePos(160, 150); + s->gui->moveCursor(mousePos); return 0; } diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index dde4cfe536..57b884ee09 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -268,7 +268,7 @@ PaletteEntry get_pic_color(EngineState *s, int color) { } static reg_t kSetCursorSci0(EngineState *s, int argc, reg_t *argv) { - + Common::Point pos; int16 cursor = argv[0].toSint16(); @@ -278,13 +278,16 @@ static reg_t kSetCursorSci0(EngineState *s, int argc, reg_t *argv) { gfxop_set_pointer_cursor(s->gfx_state, cursor); // Set pointer position, if requested - if (argc >= 4) - s->gui->moveCursor(argv[2].toSint16() + s->port->_bounds.x, argv[3].toSint16() + s->port->_bounds.y); - + if (argc >= 4) { + pos.y = argv[3].toSint16(); + pos.x = argv[2].toSint16(); + s->gui->setCursorPos(pos); + } return s->r_acc; } static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) { + Common::Point pos; Common::Point *hotspot = NULL; switch (argc) { @@ -292,7 +295,9 @@ static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) { CursorMan.showMouse(argv[0].toSint16() != 0); break; case 2: - s->gui->moveCursor(argv[0].toUint16() + s->port->_bounds.x, argv[1].toUint16() + s->port->_bounds.y); + pos.y = argv[1].toSint16(); + pos.x = argv[0].toSint16(); + s->gui->setCursorPos(pos); break; case 4: { int16 top = argv[0].toSint16(); @@ -337,8 +342,12 @@ reg_t kSetCursor(EngineState *s, int argc, reg_t *argv) { } reg_t kMoveCursor(EngineState *s, int argc, reg_t *argv) { - if (argc == 2) - s->gui->moveCursor(argv[0].toSint16(), argv[1].toSint16()); + Common::Point pos; + if (argc == 2) { + pos.y = argv[1].toSint16(); + pos.x = argv[0].toSint16(); + s->gui->moveCursor(pos); + } return s->r_acc; } diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 89809408c7..2e54b00d77 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -798,7 +798,6 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { retval->_msgState = s->_msgState; retval->gui = s->gui; - retval->gui->resetEngineState(retval); return retval; } |