From 53615c91288b32892e9a8334ea67d4c0059b575c Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Wed, 23 Jul 2008 07:52:43 +0000 Subject: Removed the historical waitUntilLeftClick function and adapted code to use the more general readInput and waitForButtonEvent. svn-id: r33226 --- engines/parallaction/parallaction_ns.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/parallaction/parallaction_ns.cpp') diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 9e925d1e1d..b2e60c5851 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -323,7 +323,9 @@ void Parallaction_ns::changeLocation(char *location) { showSlide(locname.slide()); uint id = _gfx->createLabel(_menuFont, _location._slideText[0], 1); _gfx->showLabel(id, CENTER_LABEL_HORIZONTAL, 14); - _input->waitUntilLeftClick(); + _gfx->updateScreen(); + + _input->waitForButtonEvent(kMouseLeftUp); _gfx->freeLabels(); freeBackground(); } -- cgit v1.2.3 From 4936e5f7df8e2257b1af4ee3ab2fdcd8cb88e91b Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Thu, 24 Jul 2008 09:24:32 +0000 Subject: * Moved end intro and end game sequences code to gui. * Rewrote all gui code to be run inside the main loop * Added code to avoid crashes when a scene with no standard background is drawn svn-id: r33260 --- engines/parallaction/parallaction_ns.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'engines/parallaction/parallaction_ns.cpp') diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index b2e60c5851..cf5cf2cd73 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -240,17 +240,8 @@ int Parallaction_ns::go() { _globalTable = _disk->loadTable("global"); - guiStart(); + startGui(); - if (_engineFlags & kEngineQuit) - return 0; - - changeLocation(_location._name); - - if (_engineFlags & kEngineQuit) - return 0; - - _input->_inputMode = Input::kInputModeGame; while ((_engineFlags & kEngineQuit) == 0) { runGame(); } -- cgit v1.2.3 From d1a6b175f5ef7f64435477775015730657195a11 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Fri, 25 Jul 2008 02:37:55 +0000 Subject: * Merged old input management flags into a single mouse status variable. * Mouse is now displayed when it is needed, and hidden when it is not ;) svn-id: r33270 --- engines/parallaction/parallaction_ns.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'engines/parallaction/parallaction_ns.cpp') diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index cf5cf2cd73..e8aa32dea7 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -195,8 +195,6 @@ void Parallaction_ns::setArrowCursor() { _input->_activeItem._id = 0; _system->setMouseCursor(_mouseArrow, MOUSEARROW_WIDTH, MOUSEARROW_HEIGHT, 0, 0, 0); - _system->showMouse(true); - } void Parallaction_ns::setInventoryCursor(int pos) { @@ -291,6 +289,9 @@ void Parallaction_ns::runPendingZones() { void Parallaction_ns::changeLocation(char *location) { debugC(1, kDebugExec, "changeLocation(%s)", location); + MouseTriState oldMouseState = _input->getMouseState(); + _input->setMouseState(MOUSE_DISABLED); + _soundMan->playLocationMusic(location); _input->stopHovering(); @@ -298,9 +299,7 @@ void Parallaction_ns::changeLocation(char *location) { _zoneTrap = nullZonePtr; - if (_engineFlags & kEngineBlockInput) { - setArrowCursor(); - } + setArrowCursor(); _gfx->showGfxObj(_char._ani->gfxobj, false); _location._animations.remove(_char._ani); @@ -360,10 +359,9 @@ void Parallaction_ns::changeLocation(char *location) { if (_location._hasSound) _soundMan->playSfx(_location._soundFile, 0, true); - debugC(1, kDebugExec, "changeLocation() done"); - - return; + _input->setMouseState(oldMouseState); + debugC(1, kDebugExec, "changeLocation() done"); } -- cgit v1.2.3 From 387134a16a144df3c9512e8c61901e7b7142e540 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Sun, 27 Jul 2008 14:21:16 +0000 Subject: Moved inventory cursor drawing code to InventoryRenderer. svn-id: r33337 --- engines/parallaction/parallaction_ns.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'engines/parallaction/parallaction_ns.cpp') diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index e8aa32dea7..5b5c9f6871 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -211,18 +211,8 @@ void Parallaction_ns::setInventoryCursor(int pos) { byte *v8 = _mouseComposedArrow->getData(0); // FIXME: destination offseting is not clear - byte* s = _char._objs->getData(item->_index); - byte* d = v8 + 7 + MOUSECOMBO_WIDTH * 7; - - for (uint i = 0; i < INVENTORYITEM_HEIGHT; i++) { - memcpy(d, s, INVENTORYITEM_WIDTH); - - s += INVENTORYITEM_PITCH; - d += MOUSECOMBO_WIDTH; - } - + _inventoryRenderer->drawItem(item->_index, v8 + 7 * MOUSECOMBO_WIDTH + 7, MOUSECOMBO_WIDTH); _system->setMouseCursor(v8, MOUSECOMBO_WIDTH, MOUSECOMBO_HEIGHT, 0, 0, 0); - } -- cgit v1.2.3 From a1557bd776c9335b36313860d437bc8b1ef2a936 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Mon, 28 Jul 2008 11:50:36 +0000 Subject: Pick up/drop/open/close actions are now available in game. svn-id: r33371 --- engines/parallaction/parallaction_ns.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'engines/parallaction/parallaction_ns.cpp') diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 5b5c9f6871..851fe38138 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -34,6 +34,7 @@ namespace Parallaction { + #define MOUSEARROW_WIDTH 16 #define MOUSEARROW_HEIGHT 16 @@ -165,7 +166,6 @@ Parallaction_ns::~Parallaction_ns() { delete _locationParser; delete _programParser; - delete _mouseComposedArrow; _location._animations.remove(_char._ani); @@ -182,7 +182,7 @@ void Parallaction_ns::freeFonts() { } void Parallaction_ns::initCursors() { - _mouseComposedArrow = _disk->loadPointer("pointer"); + _comboArrow = _disk->loadPointer("pointer"); _mouseArrow = _resMouseArrow; } @@ -197,21 +197,13 @@ void Parallaction_ns::setArrowCursor() { _system->setMouseCursor(_mouseArrow, MOUSEARROW_WIDTH, MOUSEARROW_HEIGHT, 0, 0, 0); } -void Parallaction_ns::setInventoryCursor(int pos) { - - if (pos == -1) - return; - - const InventoryItem *item = getInventoryItem(pos); - if (item->_index == 0) - return; - - _input->_activeItem._id = item->_id; +void Parallaction_ns::setInventoryCursor(ItemName name) { + assert(name > 0); - byte *v8 = _mouseComposedArrow->getData(0); + byte *v8 = _comboArrow->getData(0); // FIXME: destination offseting is not clear - _inventoryRenderer->drawItem(item->_index, v8 + 7 * MOUSECOMBO_WIDTH + 7, MOUSECOMBO_WIDTH); + _inventoryRenderer->drawItem(name, v8 + 7 * MOUSECOMBO_WIDTH + 7, MOUSECOMBO_WIDTH); _system->setMouseCursor(v8, MOUSECOMBO_WIDTH, MOUSECOMBO_HEIGHT, 0, 0, 0); } -- cgit v1.2.3