diff options
author | Nicola Mettifogo | 2007-03-18 17:12:48 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-03-18 17:12:48 +0000 |
commit | 919985e4dfef1031ec9e773118e3935b4ce29721 (patch) | |
tree | 4d40b4ed141884ad6c6580b255469498c87f381a /engines | |
parent | ff5ec6462e20760be24f04dd37070e1423911192 (diff) | |
download | scummvm-rg350-919985e4dfef1031ec9e773118e3935b4ce29721.tar.gz scummvm-rg350-919985e4dfef1031ec9e773118e3935b4ce29721.tar.bz2 scummvm-rg350-919985e4dfef1031ec9e773118e3935b4ce29721.zip |
converted input and labels to Common::Point
svn-id: r26214
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/graphics.cpp | 12 | ||||
-rw-r--r-- | engines/parallaction/graphics.h | 2 | ||||
-rw-r--r-- | engines/parallaction/inventory.cpp | 36 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 18 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 2 |
5 files changed, 34 insertions, 36 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index f2344a542c..def57c5d6a 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -50,7 +50,6 @@ const byte _glyphWidths[126] = { }; bool Gfx::_proportionalFont = false; -Point Gfx::_labelPosition[2] = { { 0, 0 }, { 0, 0 } }; byte * Gfx::_buffers[]; #define PALETTE_BACKUP PALETTE_SIZE @@ -417,7 +416,7 @@ void jobDisplayLabel(void *parm, Job *j) { if (label->_cnv._width == 0) return; - _vm->_gfx->flatBlitCnv(&label->_cnv, Gfx::_labelPosition[0]._x, Gfx::_labelPosition[0]._y, Gfx::kBitBack); + _vm->_gfx->flatBlitCnv(&label->_cnv, _vm->_gfx->_labelPosition[0].x, _vm->_gfx->_labelPosition[0].y, Gfx::kBitBack); return; } @@ -444,13 +443,12 @@ void jobEraseLabel(void *parm, Job *j) { _si = SCREEN_WIDTH - label->_cnv._width; Common::Rect r(label->_cnv._width, label->_cnv._height); - r.moveTo(Gfx::_labelPosition[1]._x, Gfx::_labelPosition[1]._y); + r.moveTo(_vm->_gfx->_labelPosition[1]); _vm->_gfx->restoreBackground(r); - Gfx::_labelPosition[1]._x = Gfx::_labelPosition[0]._x; - Gfx::_labelPosition[1]._y = Gfx::_labelPosition[0]._y; - Gfx::_labelPosition[0]._x = _si; - Gfx::_labelPosition[0]._y = _di; + _vm->_gfx->_labelPosition[1] = _vm->_gfx->_labelPosition[0]; + _vm->_gfx->_labelPosition[0].x = _si; + _vm->_gfx->_labelPosition[0].y = _di; return; } diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index 1f91386777..2e26e859f5 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -136,7 +136,7 @@ public: void setFont(const char* name); public: - static Point _labelPosition[2]; + Common::Point _labelPosition[2]; static bool _proportionalFont; uint16 _bgLayers[4]; diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index 723b9176cb..d2386fa0f3 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -52,7 +52,7 @@ namespace Parallaction { static byte *_buffer; uint16 _numInvLines = 0; -static Point _invPosition = { 0, 0 }; +static Common::Point _invPosition; InventoryItem _inventory[INVENTORY_MAX_ITEMS] = { { kZoneDoor, 1 }, // open/close icon @@ -104,13 +104,13 @@ int16 Parallaction::getHoverInventoryItem(int16 x, int16 y) { _si = (_si + 4) / INVENTORY_ITEMS_PER_LINE; - if (_invPosition._x >= _di) return -1; - if ((_invPosition._x + INVENTORY_WIDTH) <= _di) return -1; + if (_invPosition.x >= _di) return -1; + if ((_invPosition.x + INVENTORY_WIDTH) <= _di) return -1; - if (_invPosition._y >= y) return -1; - if ((_si * INVENTORYITEM_HEIGHT + _invPosition._y) <= y) return -1; + if (_invPosition.y >= y) return -1; + if ((_si * INVENTORYITEM_HEIGHT + _invPosition.y) <= y) return -1; - return ((_di - _invPosition._x) / INVENTORYITEM_WIDTH) + (INVENTORY_ITEMS_PER_LINE * ((y - _invPosition._y) / INVENTORYITEM_HEIGHT)); + return ((_di - _invPosition.x) / INVENTORYITEM_WIDTH) + (INVENTORY_ITEMS_PER_LINE * ((y - _invPosition.y) / INVENTORYITEM_HEIGHT)); } @@ -268,7 +268,7 @@ void jobShowInventory(void *parm, Job *j) { _numInvLines = (_numInvLines + 4) / INVENTORY_ITEMS_PER_LINE; Common::Rect r(INVENTORY_WIDTH, _numInvLines * INVENTORYITEM_HEIGHT); - r.moveTo(_invPosition._x, _invPosition._y); + r.moveTo(_invPosition); _vm->_gfx->copyRect( Gfx::kBitBack, @@ -297,7 +297,7 @@ void jobHideInventory(void *parm, Job *j) { } Common::Rect r(INVENTORY_WIDTH, _numInvLines * INVENTORYITEM_HEIGHT); - r.moveTo(_invPosition._x, _invPosition._y); + r.moveTo(_invPosition); _vm->_gfx->restoreBackground(r); @@ -316,19 +316,19 @@ void openInventory() { uint16 _LOCALinventory_lines = (_si + 4) / INVENTORY_ITEMS_PER_LINE; - _invPosition._x = _mousePos._x - (INVENTORY_WIDTH / 2); - if (_invPosition._x < 0) - _invPosition._x = 0; + _invPosition.x = _mousePos._x - (INVENTORY_WIDTH / 2); + if (_invPosition.x < 0) + _invPosition.x = 0; - if ((_invPosition._x + INVENTORY_WIDTH) > SCREEN_WIDTH) - _invPosition._x = SCREEN_WIDTH - INVENTORY_WIDTH; + if ((_invPosition.x + INVENTORY_WIDTH) > SCREEN_WIDTH) + _invPosition.x = SCREEN_WIDTH - INVENTORY_WIDTH; - _invPosition._y = _mousePos._y - 2 - (_LOCALinventory_lines * INVENTORYITEM_HEIGHT); - if (_invPosition._y < 0) - _invPosition._y = 0; + _invPosition.y = _mousePos._y - 2 - (_LOCALinventory_lines * INVENTORYITEM_HEIGHT); + if (_invPosition.y < 0) + _invPosition.y = 0; - if (_invPosition._y > SCREEN_HEIGHT - _LOCALinventory_lines * INVENTORYITEM_HEIGHT) - _invPosition._y = SCREEN_HEIGHT - _LOCALinventory_lines * INVENTORYITEM_HEIGHT; + if (_invPosition.y > SCREEN_HEIGHT - _LOCALinventory_lines * INVENTORYITEM_HEIGHT) + _invPosition.y = SCREEN_HEIGHT - _LOCALinventory_lines * INVENTORYITEM_HEIGHT; return; diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 3c257677b3..0f72f490d3 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -442,10 +442,10 @@ void Parallaction::processInput(InputData *data) { switch (data->_event) { case kEvEnterZone: debugC(2, kDebugInput, "processInput: kEvEnterZone"); - _gfx->_labelPosition[1]._x = -1000; - _gfx->_labelPosition[1]._y = -1000; - _gfx->_labelPosition[0]._x = -1000; - _gfx->_labelPosition[0]._y = -1000; + _gfx->_labelPosition[1].x = -1000; + _gfx->_labelPosition[1].y = -1000; + _gfx->_labelPosition[0].x = -1000; + _gfx->_labelPosition[0].y = -1000; _jDrawLabel = addJob(&jobDisplayLabel, (void*)data->_label, kPriority0); _jEraseLabel = addJob(&jobEraseLabel, (void*)data->_label, kPriority20); break; @@ -507,7 +507,7 @@ void Parallaction::processInput(InputData *data) { changeCursor(kCursorArrow); if (_vm->_char._ani._zone._flags & kFlagsRemove) break; if ((_vm->_char._ani._zone._flags & kFlagsActive) == 0) break; - v4 = buildWalkPath(data->_mousePos._x, data->_mousePos._y); + v4 = buildWalkPath(data->_mousePos.x, data->_mousePos.y); addJob(&jobWalk, v4, kPriority19); _engineFlags |= kEngineWalking; // inhibits processing of input until walking is over break; @@ -552,8 +552,8 @@ Parallaction::InputData *Parallaction::translateInput() { return &_input; } - _input._mousePos._x = _mousePos._x; - _input._mousePos._y = _mousePos._y; + _input._mousePos.x = _mousePos._x; + _input._mousePos.y = _mousePos._y; if (((_engineFlags & kEnginePauseJobs) == 0) && ((_engineFlags & kEngineInventory) == 0)) { @@ -615,8 +615,8 @@ Parallaction::InputData *Parallaction::translateInput() { _input._event = kEvWalk; _actionAfterWalk = true; if (z->_moveTo._y != 0) { - _input._mousePos._x = z->_moveTo._x; - _input._mousePos._y = z->_moveTo._y; + _input._mousePos.x = z->_moveTo._x; + _input._mousePos.y = z->_moveTo._y; } } diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index c26846f520..5fea511a35 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -342,7 +342,7 @@ protected: // data struct InputData { uint16 _event; - Point _mousePos; + Common::Point _mousePos; int16 _inventoryIndex; Zone* _zone; |