aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/parallaction_br.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2008-07-28 11:50:36 +0000
committerNicola Mettifogo2008-07-28 11:50:36 +0000
commita1557bd776c9335b36313860d437bc8b1ef2a936 (patch)
tree7bcb7e7104780cb1e27d468af69ed8d382c101b6 /engines/parallaction/parallaction_br.cpp
parentfb388deb99be4c1457dd052382c32a05dfc4b528 (diff)
downloadscummvm-rg350-a1557bd776c9335b36313860d437bc8b1ef2a936.tar.gz
scummvm-rg350-a1557bd776c9335b36313860d437bc8b1ef2a936.tar.bz2
scummvm-rg350-a1557bd776c9335b36313860d437bc8b1ef2a936.zip
Pick up/drop/open/close actions are now available in game.
svn-id: r33371
Diffstat (limited to 'engines/parallaction/parallaction_br.cpp')
-rw-r--r--engines/parallaction/parallaction_br.cpp65
1 files changed, 47 insertions, 18 deletions
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index 6482329c5e..efdf0d06b4 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -32,6 +32,27 @@
namespace Parallaction {
+struct MouseComboProperties {
+ int _xOffset;
+ int _yOffset;
+ int _width;
+ int _height;
+};
+/*
+// TODO: improve NS's handling of normal cursor before merging cursor code.
+MouseComboProperties _mouseComboProps_NS = {
+ 7, // combo x offset (the icon from the inventory will be rendered from here)
+ 7, // combo y offset (ditto)
+ 32, // combo (arrow + icon) width
+ 32 // combo (arrow + icon) height
+};
+*/
+MouseComboProperties _mouseComboProps_BR = {
+ 8, // combo x offset (the icon from the inventory will be rendered from here)
+ 8, // combo y offset (ditto)
+ 68, // combo (arrow + icon) width
+ 68 // combo (arrow + icon) height
+};
const char *Parallaction_br::_partNames[] = {
"PART0",
@@ -103,6 +124,7 @@ Parallaction_br::~Parallaction_br() {
delete _dougCursor;
delete _donnaCursor;
+ delete _mouseArrow;
}
void Parallaction_br::callFunction(uint index, void* parm) {
@@ -154,6 +176,12 @@ void Parallaction_br::initCursors() {
_dougCursor = _disk->loadPointer("pointer2");
_donnaCursor = _disk->loadPointer("pointer3");
+ Graphics::Surface *surf = new Graphics::Surface;
+ surf->create(_mouseComboProps_BR._width, _mouseComboProps_BR._height, 1);
+ _comboArrow = new SurfaceToFrames(surf);
+
+ // TODO: choose the pointer depending on the active character
+ // For now, we pick Donna's
_mouseArrow = _donnaCursor;
} else {
// TODO: Where are the Amiga cursors?
@@ -161,19 +189,6 @@ void Parallaction_br::initCursors() {
}
-void Parallaction_br::setMousePointer(int16 index) {
- // FIXME: Where are the Amiga cursors?
- if (getPlatform() == Common::kPlatformAmiga)
- return;
-
- Common::Rect r;
- _mouseArrow->getRect(0, r);
-
- _system->setMouseCursor(_mouseArrow->getData(0), r.width(), r.height(), 0, 0, 0);
- _system->showMouse(true);
-
-}
-
void Parallaction_br::initPart() {
memset(_counters, 0, ARRAYSIZE(_counters));
@@ -340,15 +355,29 @@ void Parallaction_br::changeCharacter(const char *name) {
void Parallaction_br::setArrowCursor() {
- // TODO: choose the pointer depending on the active character
- // For now, defaults to 0, that corresponds to the default in the original
- setMousePointer(0);
-}
+ // FIXME: Where are the Amiga cursors?
+ if (getPlatform() == Common::kPlatformAmiga)
+ return;
-void Parallaction_br::setInventoryCursor(int pos) {
+ Common::Rect r;
+ _mouseArrow->getRect(0, r);
+
+ _system->setMouseCursor(_mouseArrow->getData(0), r.width(), r.height(), 0, 0, 0);
+ _system->showMouse(true);
+
+ _input->_activeItem._id = 0;
+}
+void Parallaction_br::setInventoryCursor(ItemName name) {
+ assert(name > 0);
+ byte *src = _mouseArrow->getData(0);
+ byte *dst = _comboArrow->getData(0);
+ memcpy(dst, src, _comboArrow->getSize(0));
+ // FIXME: destination offseting is not clear
+ _inventoryRenderer->drawItem(name, dst + _mouseComboProps_BR._yOffset * _mouseComboProps_BR._width + _mouseComboProps_BR._xOffset, _mouseComboProps_BR._width);
+ _system->setMouseCursor(dst, _mouseComboProps_BR._width, _mouseComboProps_BR._height, 0, 0, 0);
}
} // namespace Parallaction