diff options
author | Travis Howell | 2006-04-19 11:54:38 +0000 |
---|---|---|
committer | Travis Howell | 2006-04-19 11:54:38 +0000 |
commit | 18d0afaafd3f37c0013353d642baedf9141f7d38 (patch) | |
tree | 623040cd5a7d4b5a103edd049fac268d74ade0ad /engines/simon | |
parent | e97476621d6ed49edd11cca6150c034ee81ae8fe (diff) | |
download | scummvm-rg350-18d0afaafd3f37c0013353d642baedf9141f7d38.tar.gz scummvm-rg350-18d0afaafd3f37c0013353d642baedf9141f7d38.tar.bz2 scummvm-rg350-18d0afaafd3f37c0013353d642baedf9141f7d38.zip |
Correct dummyItems in FF and cleanup
svn-id: r22035
Diffstat (limited to 'engines/simon')
-rw-r--r-- | engines/simon/items.cpp | 14 | ||||
-rw-r--r-- | engines/simon/oracle.cpp | 4 | ||||
-rw-r--r-- | engines/simon/saveload.cpp | 2 | ||||
-rw-r--r-- | engines/simon/simon.cpp | 42 | ||||
-rw-r--r-- | engines/simon/simon.h | 6 |
5 files changed, 35 insertions, 33 deletions
diff --git a/engines/simon/items.cpp b/engines/simon/items.cpp index 7955a6b679..1e8e788aff 100644 --- a/engines/simon/items.cpp +++ b/engines/simon/items.cpp @@ -379,12 +379,12 @@ int SimonEngine::getScriptReturn() { void SimonEngine::o_at() { // 1: ptrA parent is - setScriptCondition(getItem1Ptr()->parent == getNextItemID()); + setScriptCondition(me()->parent == getNextItemID()); } void SimonEngine::o_notAt() { // 2: ptrA parent is not - setScriptCondition(getItem1Ptr()->parent != getNextItemID()); + setScriptCondition(me()->parent != getNextItemID()); } void SimonEngine::o_carried() { @@ -633,7 +633,7 @@ void SimonEngine::o_random() { void SimonEngine::o_goto() { // 55: set itemA parent - setItemParent(getItem1Ptr(), getNextItemPtr()); + setItemParent(me(), getNextItemPtr()); } void SimonEngine::o_oset() { @@ -1030,7 +1030,7 @@ void SimonEngine::o_defObj() { void SimonEngine::o_here() { // 125: item is sibling with item 1 Item *item = getNextItemPtr(); - setScriptCondition(getItem1Ptr()->parent == item->parent); + setScriptCondition(me()->parent == item->parent); } void SimonEngine::o_doClassIcons() { @@ -1340,10 +1340,10 @@ void SimonEngine::o_getDollar2() { _objectItem = _hitAreaObjectItem; if (_objectItem == _dummyItem2) - _objectItem = getItem1Ptr(); + _objectItem = me(); if (_objectItem == _dummyItem3) - _objectItem = derefItem(getItem1Ptr()->parent); + _objectItem = derefItem(me()->parent); if (_objectItem != NULL) { _scriptNoun2 = _objectItem->noun; @@ -1811,7 +1811,7 @@ void SimonEngine::o3_addTextBox() { h = getVarOrWord(); num = getVarOrByte(); if (num < _numTextBoxes) - defineBox(id, x, y, w, h, flags + (num << 8), 208, _dummyItem1); + defineBox(id, x, y, w, h, flags + (num << 8), 208, _dummyItem2); } void SimonEngine::o3_printLongText() { diff --git a/engines/simon/oracle.cpp b/engines/simon/oracle.cpp index f2119049f3..38c10f28d9 100644 --- a/engines/simon/oracle.cpp +++ b/engines/simon/oracle.cpp @@ -34,7 +34,7 @@ void SimonEngine::checkLinkBox() { // Check for boxes spilling over to next row if (_hyperLink != 0) { _variableArray[52] = _textWindow->x + _textWindow->textColumn - _variableArray[50]; if (_variableArray[52] != 0) { - defineBox(_variableArray[53], _variableArray[50], _variableArray[51], _variableArray[52], 15, 145, 208, _dummyItem1); + defineBox(_variableArray[53], _variableArray[50], _variableArray[51], _variableArray[52], 15, 145, 208, _dummyItem2); _variableArray[53]++; } _variableArray[50] = _textWindow->x; @@ -57,7 +57,7 @@ void SimonEngine::hyperLinkOff() { return; _variableArray[52] = _textWindow->x + _textWindow->textColumn - _variableArray[50]; - defineBox(_variableArray[53], _variableArray[50], _variableArray[51], _variableArray[52], 15, 145, 208, _dummyItem1); + defineBox(_variableArray[53], _variableArray[50], _variableArray[51], _variableArray[52], 15, 145, 208, _dummyItem2); _variableArray[53]++; _hyperLink = 0; } diff --git a/engines/simon/saveload.cpp b/engines/simon/saveload.cpp index b2224ab739..ee05b6df63 100644 --- a/engines/simon/saveload.cpp +++ b/engines/simon/saveload.cpp @@ -116,7 +116,7 @@ void SimonEngine::quickLoadOrSave() { } else { // Redraw Inventory mouseOff(); - drawIconArray(2, getItem1Ptr(), 0, 0); + drawIconArray(2, me(), 0, 0); mouseOn(); // Reset engine? setBitFlag(97, true); diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp index 1aa1735a2b..0e585df82f 100644 --- a/engines/simon/simon.cpp +++ b/engines/simon/simon.cpp @@ -280,7 +280,7 @@ SimonEngine::SimonEngine(OSystem *syst) _subjectItem = 0; _objectItem = 0; - _item1 = 0; + _currentPlayer = 0; _currentBoxNumber = 0; _iOverflow = 0; @@ -804,15 +804,15 @@ void SimonEngine::setUserFlag(Item *item, int a, int b) { void SimonEngine::createPlayer() { Child *child; - _item1 = _itemArrayPtr[1]; - _item1->adjective = -1; - _item1->noun = 10000; + _currentPlayer = _itemArrayPtr[1]; + _currentPlayer->adjective = -1; + _currentPlayer->noun = 10000; - child = (Child *)allocateChildBlock(_item1, 3, sizeof(Child)); + child = (Child *)allocateChildBlock(_currentPlayer, 3, sizeof(Child)); if (child == NULL) error("player create failure"); - setUserFlag(_item1, 0, 0); + setUserFlag(_currentPlayer, 0, 0); } void SimonEngine::allocateStringTable(int num) { @@ -1011,11 +1011,11 @@ Item *SimonEngine::getNextItemPtr() { case -3: return _objectItem; case -5: - return getItem1Ptr(); + return me(); case -7: - return getItemPtrB(); + return actor(); case -9: - return derefItem(getItem1Ptr()->parent); + return derefItem(me()->parent); default: return derefItem(a); } @@ -1051,20 +1051,22 @@ uint SimonEngine::getNextItemID() { case -7: return 0; case -9: - return getItem1Ptr()->parent; + return me()->parent; default: return a; } } -Item *SimonEngine::getItem1Ptr() { - if (_item1) - return _item1; +Item *SimonEngine::me() { + if (_currentPlayer) + return _currentPlayer; return _dummyItem1; } -Item *SimonEngine::getItemPtrB() { - error("getItemPtrB: is this code ever used?"); +Item *SimonEngine::actor() { + error("actor: is this code ever used?"); + //if (_actorPlayer) + // return _actorPlayer; return _dummyItem1; } @@ -2080,18 +2082,18 @@ void SimonEngine::handleVerbClicked(uint verb) { _objectItem = _hitAreaObjectItem; if (_objectItem == _dummyItem2) { - _objectItem = getItem1Ptr(); + _objectItem = me(); } if (_objectItem == _dummyItem3) { - _objectItem = derefItem(getItem1Ptr()->parent); + _objectItem = derefItem(me()->parent); } _subjectItem = _hitAreaSubjectItem; if (_subjectItem == _dummyItem2) { - _subjectItem = getItem1Ptr(); + _subjectItem = me(); } if (_subjectItem == _dummyItem3) { - _subjectItem = derefItem(getItem1Ptr()->parent); + _subjectItem = derefItem(me()->parent); } if (_subjectItem) { @@ -2817,7 +2819,7 @@ bool SimonEngine::itemIsSiblingOf(uint16 a) { if (item == NULL) return true; - return getItem1Ptr()->parent == item->parent; + return me()->parent == item->parent; } bool SimonEngine::itemIsParentOf(uint16 a, uint16 b) { diff --git a/engines/simon/simon.h b/engines/simon/simon.h index 9139f53afc..ad53375338 100644 --- a/engines/simon/simon.h +++ b/engines/simon/simon.h @@ -279,7 +279,7 @@ protected: WindowBlock *_textWindow; Item *_subjectItem, *_objectItem; - Item *_item1; + Item *_currentPlayer; Item *_hitAreaObjectItem; HitArea *_lastHitArea; @@ -522,8 +522,8 @@ protected: Item *getNextItemPtr(); uint getNextItemID(); uint getItem1ID() {return 1;} - Item *getItem1Ptr(); - Item *getItemPtrB(); + Item *me(); + Item *actor(); byte getByte(); int getNextWord(); |