diff options
author | lukaslw | 2014-09-30 15:43:16 +0200 |
---|---|---|
committer | lukaslw | 2014-09-30 15:43:16 +0200 |
commit | e1774dc4462332b8345c44c7ebc5d5f7ff722efa (patch) | |
tree | eeaf1690edbcf3f51ec4cf30ed17a27bb0a1a505 | |
parent | afe47b014a0538171e826c780f198a19df60bd69 (diff) | |
download | scummvm-rg350-e1774dc4462332b8345c44c7ebc5d5f7ff722efa.tar.gz scummvm-rg350-e1774dc4462332b8345c44c7ebc5d5f7ff722efa.tar.bz2 scummvm-rg350-e1774dc4462332b8345c44c7ebc5d5f7ff722efa.zip |
PRINCE: countDrawPosition() - clean up
-rw-r--r-- | engines/prince/animation.cpp | 20 | ||||
-rw-r--r-- | engines/prince/animation.h | 5 | ||||
-rw-r--r-- | engines/prince/hero.cpp | 26 |
3 files changed, 5 insertions, 46 deletions
diff --git a/engines/prince/animation.cpp b/engines/prince/animation.cpp index db16adacbc..b594ff47d1 100644 --- a/engines/prince/animation.cpp +++ b/engines/prince/animation.cpp @@ -28,7 +28,7 @@ namespace Prince { -Animation::Animation() : _idXDiff(0), _idYDiff(0), _loopCount(0), _phaseCount(0), _frameCount(0), _baseX(0), _baseY(0) +Animation::Animation() : _loopCount(0), _phaseCount(0), _frameCount(0), _baseX(0), _baseY(0) { } @@ -50,8 +50,7 @@ void Animation::clear() { } bool Animation::loadFromStream(Common::SeekableReadStream &stream) { - _idXDiff = stream.readByte(); - _idYDiff = stream.readByte(); + stream.skip(2); // skip not used x and y coord diff _loopCount = stream.readUint16LE(); _phaseCount = stream.readUint16LE(); stream.skip(2); // skip _frameCount here @@ -109,21 +108,6 @@ bool Animation::loadFromStream(Common::SeekableReadStream &stream) { return true; } -bool Animation::testId() const { - if (_idXDiff == 'A' && _idYDiff == 'N') { - return true; - } - return false; -} - -int8 Animation::getIdXDiff() const { - return _idXDiff; -} - -int8 Animation::getIdYDiff() const { - return _idYDiff; -} - int16 Animation::getLoopCount() const { return _loopCount; } diff --git a/engines/prince/animation.h b/engines/prince/animation.h index 87d21f5dbc..c4df3a1970 100644 --- a/engines/prince/animation.h +++ b/engines/prince/animation.h @@ -36,9 +36,6 @@ public: ~Animation(); bool loadFromStream(Common::SeekableReadStream &stream); - bool testId() const; - int8 getIdXDiff() const; - int8 getIdYDiff() const; int16 getLoopCount() const; int32 getPhaseCount() const; int32 getFrameCount() const; @@ -64,8 +61,6 @@ private: }; Common::Array<Frame> _frameList; Common::Array<Phase> _phaseList; - int8 _idXDiff; - int8 _idYDiff; int16 _loopCount; int16 _phaseCount; int32 _frameCount; diff --git a/engines/prince/hero.cpp b/engines/prince/hero.cpp index ff4be1aefc..bc127b398b 100644 --- a/engines/prince/hero.cpp +++ b/engines/prince/hero.cpp @@ -180,18 +180,6 @@ void Hero::countDrawPosition() { heroAnim = _moveSet[_moveSetType]; } if (heroAnim != nullptr) { - int16 tempMiddleY; - int16 baseX = heroAnim->getBaseX(); - int16 baseY = heroAnim->getBaseY(); - // any chance? - if (baseX == 320) { - tempMiddleY = _middleY - (baseY - 240); - if (baseY != 240) { - error("Hero::countDrawPosition() - tempMiddleY"); - } - } else { - tempMiddleY = _middleY; - } int phaseFrameIndex = heroAnim->getPhaseFrameIndex(_phase); Graphics::Surface *heroSurface = heroAnim->getFrame(phaseFrameIndex); @@ -200,26 +188,18 @@ void Hero::countDrawPosition() { _scaledFrameXSize = getScaledValue(_frameXSize); _scaledFrameYSize = getScaledValue(_frameYSize); - // any use of this? - if (!heroAnim->testId()) { - error("countDrawPosition - !heroAnim->testId()"); - //int diffX = heroAnim->getIdXDiff(); - //int diffY = heroAnim->getIdYDiff(); - } - if (_vm->_scaleValue != 10000) { //notfullSize _drawX = _middleX - _scaledFrameXSize / 2; - _drawY = tempMiddleY + 1 - _scaledFrameYSize; + _drawY = _middleY + 1 - _scaledFrameYSize; _vm->checkMasks(_drawX, _drawY - 1, _scaledFrameXSize, _scaledFrameYSize, _middleY); } else { //fullSize _drawX = _middleX - _frameXSize / 2; - _drawY = tempMiddleY + 1 - _frameYSize; + _drawY = _middleY + 1 - _frameYSize; _vm->checkMasks(_drawX, _drawY - 1, _frameXSize, _frameYSize, _middleY); } - - _drawZ = tempMiddleY; + _drawZ = _middleY; } } |