diff options
author | Nicola Mettifogo | 2007-01-15 20:11:49 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-01-15 20:11:49 +0000 |
commit | 3545af0275459b1bebd32dc1405fc3d3dd4395be (patch) | |
tree | cb9a29b4dfe10d1f364fbc7acebeae2f68c8a030 /engines | |
parent | 48061b339297a363b87856b8cb7db95650e4befe (diff) | |
download | scummvm-rg350-3545af0275459b1bebd32dc1405fc3d3dd4395be.tar.gz scummvm-rg350-3545af0275459b1bebd32dc1405fc3d3dd4395be.tar.bz2 scummvm-rg350-3545af0275459b1bebd32dc1405fc3d3dd4395be.zip |
fixed pointer casting in InputData management
svn-id: r25093
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/parallaction.cpp | 26 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 5 |
2 files changed, 16 insertions, 15 deletions
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 97ddcda570..9857365c26 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -428,8 +428,8 @@ void Parallaction::processInput(InputData *data) { _graphics->_labelPosition[1]._y = -1000; _graphics->_labelPosition[0]._x = -1000; _graphics->_labelPosition[0]._y = -1000; - _jDrawLabel = addJob(&jobDisplayLabel, (void*)data->_data, JOBPRIORITY_DRAWLABEL); - _jEraseLabel = addJob(&jobEraseLabel, (void*)data->_data, JOBPRIORITY_HIDEINVENTORY); + _jDrawLabel = addJob(&jobDisplayLabel, (void*)data->_cnv, JOBPRIORITY_DRAWLABEL); + _jEraseLabel = addJob(&jobEraseLabel, (void*)data->_cnv, JOBPRIORITY_HIDEINVENTORY); break; case kEvExitZone: @@ -442,7 +442,7 @@ void Parallaction::processInput(InputData *data) { _procCurrentHoverItem = -1; _hoverZone = NULL; pauseJobs(); - z = (Zone*)data->_data; + z = data->_zone; if (runZone(z) == 0) { runCommands( z->_commands, z ); } @@ -466,9 +466,9 @@ void Parallaction::processInput(InputData *data) { case kEvCloseInventory: // closes inventory and possibly select item closeInventory(); - if ((data->_data != -1) && (_inventory[data->_data]._id != 0)) { + if ((data->_inventoryIndex != -1) && (_inventory[data->_inventoryIndex]._id != 0)) { // activates item - changeCursor(data->_data); + changeCursor(data->_inventoryIndex); } _jRunScripts = addJob(&jobRunScripts, 0, JOBPRIORITY_RUNSTUFF); addJob(&jobHideInventory, 0, JOBPRIORITY_HIDEINVENTORY); @@ -477,8 +477,8 @@ void Parallaction::processInput(InputData *data) { case kEvHoverInventory: highlightInventoryItem(_procCurrentHoverItem, 12); // disable - highlightInventoryItem(data->_data, 19); // enable - _procCurrentHoverItem = data->_data; + highlightInventoryItem(data->_inventoryIndex, 19); // enable + _procCurrentHoverItem = data->_inventoryIndex; break; case kEvWalk: @@ -594,15 +594,13 @@ Parallaction::InputData *Parallaction::translateInput() { _hoverZone = z; _input._event = kEvEnterZone; - // FIXME: casting pointer to int32 - _input._data= (int32)&z->_label; + _input._cnv = &z->_label; return &_input; } if ((_mouseButtons == kMouseLeftUp) && ((_activeItem._id != 0) || ((z->_type & 0xFFFF) == kZoneCommand))) { - // FIXME: casting pointer to int32 - _input._data = (int32)z; + _input._zone = z; if (z->_flags & kFlagsNoWalk) { // printf("7.1\n"); @@ -645,13 +643,13 @@ Parallaction::InputData *Parallaction::translateInput() { // right up hides inventory _input._event = kEvCloseInventory; - _input._data = getHoverInventoryItem(_mousePos._x, _mousePos._y); + _input._inventoryIndex = getHoverInventoryItem(_mousePos._x, _mousePos._y); highlightInventoryItem(_transCurrentHoverItem, 12); // disable if ((_engineFlags & kEngineDragging) == 0) return &_input; _engineFlags &= ~kEngineDragging; - Zone *z = hitZone(kZoneMerge, _activeItem._index, _inventory[_input._data]._index); + Zone *z = hitZone(kZoneMerge, _activeItem._index, _inventory[_input._inventoryIndex]._index); if (z != NULL) { dropItem(z->u.merge->_obj1 - 4); @@ -667,7 +665,7 @@ Parallaction::InputData *Parallaction::translateInput() { _transCurrentHoverItem = _si; _input._event = kEvHoverInventory; - _input._data = _si; + _input._inventoryIndex = _si; return &_input; } diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index fb2221cd6a..37d8e7f0cf 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -252,7 +252,10 @@ protected: // data struct InputData { uint16 _event; Point _mousePos; - int32 _data; + + int16 _inventoryIndex; + Zone* _zone; + StaticCnv* _cnv; }; bool _skipMenu; |