mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-20 00:41:12 +00:00
PEGASUS: Implement Item::getDragSprite()
This commit is contained in:
parent
897c585f05
commit
c8752bb1d3
@ -27,7 +27,9 @@
|
||||
#include "common/stream.h"
|
||||
|
||||
#include "pegasus/constants.h"
|
||||
#include "pegasus/elements.h"
|
||||
#include "pegasus/pegasus.h"
|
||||
#include "pegasus/surface.h"
|
||||
#include "pegasus/items/item.h"
|
||||
#include "pegasus/items/itemlist.h"
|
||||
|
||||
@ -266,4 +268,22 @@ ItemStateInfo Item::readItemState(Common::SeekableReadStream *stream) {
|
||||
return info;
|
||||
}
|
||||
|
||||
Sprite *Item::getDragSprite(const tDisplayElementID id) const {
|
||||
PegasusEngine *vm = (PegasusEngine *)g_engine;
|
||||
Sprite *result = new Sprite(id);
|
||||
SpriteFrame *frame = new SpriteFrame();
|
||||
|
||||
frame->initFromPICTResource(vm->_resFork, _itemInfo.dragSpriteNormalID);
|
||||
result->addFrame(frame, 0, 0);
|
||||
|
||||
if (_itemInfo.dragSpriteNormalID != _itemInfo.dragSpriteUsedID) {
|
||||
frame = new SpriteFrame();
|
||||
frame->initFromPICTResource(vm->_resFork, _itemInfo.dragSpriteUsedID);
|
||||
}
|
||||
|
||||
result->addFrame(frame, 0, 0);
|
||||
result->setCurrentFrameIndex(0);
|
||||
return result;
|
||||
}
|
||||
|
||||
} // End of namespace Pegasus
|
||||
|
@ -274,6 +274,8 @@ enum tItemType {
|
||||
kBiochipItemType
|
||||
};
|
||||
|
||||
class Sprite;
|
||||
|
||||
/*
|
||||
|
||||
Item is an object which can be picked up and carried around.
|
||||
@ -313,8 +315,7 @@ public:
|
||||
void getInfoRightTimes(TimeValue&, TimeValue&) const;
|
||||
TimeValue getSharedAreaTime() const;
|
||||
|
||||
//TODO
|
||||
//MMSprite* GetDragSprite(const tDisplayElementID) const;
|
||||
Sprite *getDragSprite(const tDisplayElementID) const;
|
||||
|
||||
/*
|
||||
select -- called when this item becomes current. Also called when the inventory
|
||||
|
Loading…
Reference in New Issue
Block a user