diff options
author | Paul Gilbert | 2010-05-31 12:10:30 +0000 |
---|---|---|
committer | Paul Gilbert | 2010-05-31 12:10:30 +0000 |
commit | 088e6456ea4d009b8ab0c91176c84dce34a8ea41 (patch) | |
tree | 0789fe834b9a6fd72ff90d276ec9912c4556134f /engines/m4/mads_views.cpp | |
parent | 3f4302214c334a590b8428fe7ae32c76e64b6ed5 (diff) | |
download | scummvm-rg350-088e6456ea4d009b8ab0c91176c84dce34a8ea41.tar.gz scummvm-rg350-088e6456ea4d009b8ab0c91176c84dce34a8ea41.tar.bz2 scummvm-rg350-088e6456ea4d009b8ab0c91176c84dce34a8ea41.zip |
In progress work implementing the animation player
svn-id: r49347
Diffstat (limited to 'engines/m4/mads_views.cpp')
-rw-r--r-- | engines/m4/mads_views.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp index 3b5ba9e24c..e66b1d8d41 100644 --- a/engines/m4/mads_views.cpp +++ b/engines/m4/mads_views.cpp @@ -24,6 +24,7 @@ */ #include "m4/m4_views.h" +#include "m4/animation.h" #include "m4/dialogs.h" #include "m4/events.h" #include "m4/font.h" @@ -43,6 +44,22 @@ static const int SCROLLER_DELAY = 200; //-------------------------------------------------------------------------- +bool MadsSpriteSlot::operator==(const SpriteSlotSubset &other) const { + return (spriteListIndex == other.spriteListIndex) && (frameNumber == other.frameNumber) && + (xp == other.xp) && (yp == other.yp) && (depth == other.depth) && (scale == other.scale); +} + +void MadsSpriteSlot::copy(const SpriteSlotSubset &other) { + spriteListIndex = other.spriteListIndex; + frameNumber = other.frameNumber; + xp = other.xp; + yp = other.yp; + depth = other.depth; + scale = other.scale; +} + +//-------------------------------------------------------------------------- + MadsSpriteSlots::MadsSpriteSlots(MadsView &owner): _owner(owner) { for (int i = 0; i < SPRITE_SLOTS_SIZE; ++i) { MadsSpriteSlot rec; @@ -74,6 +91,7 @@ int MadsSpriteSlots::addSprites(const char *resName) { Common::SeekableReadStream *data = _vm->res()->get(resName); SpriteAsset *spriteSet = new SpriteAsset(_vm, data, data->size(), resName); spriteSet->translate(_madsVm->_palette); + assert(spriteSet != NULL); _sprites.push_back(SpriteList::value_type(spriteSet)); _vm->res()->toss(resName); @@ -1125,8 +1143,20 @@ void MadsSequenceList::setAnimRange(int seqIndex, int startVal, int endVal) { //-------------------------------------------------------------------------- +Animation::Animation(MadsM4Engine *vm): _vm(vm) { +} + +void Animation::loadFullScreen(const Common::String &filename) { + _vm->_palette->deleteAllRanges(); + load(filename); +} + +//-------------------------------------------------------------------------- + MadsView::MadsView(View *view): _view(view), _dynamicHotspots(*this), _sequenceList(*this), - _kernelMessages(*this), _spriteSlots(*this), _dirtyAreas(*this), _textDisplay(*this) { + _kernelMessages(*this), _spriteSlots(*this), _dirtyAreas(*this), _textDisplay(*this), + // FIXME: There's probably a cleaner way to do this, and I don't think the destructor is ever called + _sceneAnimation(*new MadsAnimation(_vm, this)) { _textSpacing = -1; _ticksAmount = 3; _newTimeout = 0; |