aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/animator_v2.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2007-10-07 00:35:22 +0000
committerJohannes Schickel2007-10-07 00:35:22 +0000
commit5ad7870775ef8eb1122e22fa5f12383536e7a01d (patch)
treeda9686d09b9a299d27a3d310bcb420feb1801a73 /engines/kyra/animator_v2.cpp
parentaba30d7ea8541f7260ec7b96a8d33dd7dc06ed74 (diff)
downloadscummvm-rg350-5ad7870775ef8eb1122e22fa5f12383536e7a01d.tar.gz
scummvm-rg350-5ad7870775ef8eb1122e22fa5f12383536e7a01d.tar.bz2
scummvm-rg350-5ad7870775ef8eb1122e22fa5f12383536e7a01d.zip
- little bit more input handling
- implemented item pickup svn-id: r29160
Diffstat (limited to 'engines/kyra/animator_v2.cpp')
-rw-r--r--engines/kyra/animator_v2.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/engines/kyra/animator_v2.cpp b/engines/kyra/animator_v2.cpp
index 179bdd140d..9f0cefe9fa 100644
--- a/engines/kyra/animator_v2.cpp
+++ b/engines/kyra/animator_v2.cpp
@@ -310,4 +310,52 @@ void KyraEngine_v2::drawCharacterAnimObject(AnimObj *obj, int x, int y, int laye
_screen->drawShape(2, getShapePtr(obj->shapeIndex1), x, y, 2, obj->flags | 4, layer, _charScaleX, _charScaleY);
}
+void KyraEngine_v2::addItemToAnimList(int item) {
+ restorePage3();
+
+ AnimObj *animObj = &_animObjects[11+item];
+
+ animObj->enabled = 1;
+ animObj->needRefresh = 1;
+ animObj->unk8 = 1;
+
+ int itemId = _itemList[item].id;
+
+ animObj->xPos2 = animObj->xPos1 = _itemList[item].x;
+ animObj->yPos2 = animObj->yPos1 = _itemList[item].y;
+
+ animObj->shapePtr = _defaultShapeTable[64+itemId];
+ animObj->shapeIndex2 = animObj->shapeIndex1 = 64+itemId;
+
+ int scaleY, scaleX;
+ scaleY = scaleX = getScale(animObj->xPos1, animObj->yPos1);
+
+ uint8 *shapePtr = getShapePtr(64+itemId);
+ animObj->xPos3 = (animObj->xPos2 -= _screen->getShapeScaledWidth(shapePtr, scaleX) >> 1);
+ animObj->yPos3 = (animObj->yPos2 -= _screen->getShapeScaledHeight(shapePtr, scaleY));
+
+ animObj->width2 = animObj->height2 = 0;
+
+ _animList = addToAnimListSorted(_animList, animObj);
+ animObj->needRefresh = 1;
+ animObj->unk8 = 1;
+}
+
+void KyraEngine_v2::deleteItemAnimEntry(int item) {
+ AnimObj *animObj = &_animObjects[11+item];
+
+ restorePage3();
+
+ animObj->shapePtr = 0;
+ animObj->shapeIndex1 = 0xFFFF;
+ animObj->shapeIndex2 = 0xFFFF;
+ animObj->needRefresh = 1;
+ animObj->unk8 = 1;
+
+ refreshAnimObjectsIfNeed();
+
+ animObj->enabled = 0;
+ _animList = deleteAnimListEntry(_animList, animObj);
+}
+
} // end of namespace Kyra