Beispiel #1
0
void KyraEngine_v2::addItemToAnimList(int item) {
	assert(item >= 0 && item < _itemListSize);

	restorePage3();

	AnimObj *animObj = _animItems + item;

	animObj->enabled = 1;
	animObj->needRefresh = 1;

	int itemId = _itemList[item].id;

	animObj->xPos2 = animObj->xPos1 = _itemList[item].x;
	animObj->yPos2 = animObj->yPos1 = _itemList[item].y;

	animObj->shapePtr = getShapePtr(itemId + _desc.itemShapeStart);
	animSetupPaletteEntry(animObj);
	animObj->shapeIndex2 = animObj->shapeIndex1 = itemId + _desc.itemShapeStart;

	int scaleY, scaleX;
	scaleY = scaleX = getScale(animObj->xPos1, animObj->yPos1);

	uint8 *shapePtr = getShapePtr(itemId + _desc.itemShapeStart);
	animObj->xPos3 = (animObj->xPos2 -= (screen_v2()->getShapeScaledWidth(shapePtr, scaleX) >> 1));
	animObj->yPos3 = (animObj->yPos2 -= screen_v2()->getShapeScaledHeight(shapePtr, scaleY));

	animObj->width2 = animObj->height2 = 0;

	_animList = addToAnimListSorted(_animList, animObj);
	animObj->needRefresh = 1;
}
Beispiel #2
0
void KyraEngine_v2::addShapeToPool(const uint8 *data, int realIndex, int shape) {
	remShapeFromPool(realIndex);
	_gameShapes[realIndex] = screen_v2()->makeShapeCopy(data, shape);
}