diff options
author | lukaslw | 2014-05-30 19:37:33 +0200 |
---|---|---|
committer | lukaslw | 2014-06-22 20:08:23 +0200 |
commit | a2b1f2fb7bac421074aee600f86900162be9c834 (patch) | |
tree | 70ceb09effb50cc654a084f7c18271380e87331b | |
parent | 63834499f78cd9b1513344d2cd2b84bbae9e9b0e (diff) | |
download | scummvm-rg350-a2b1f2fb7bac421074aee600f86900162be9c834.tar.gz scummvm-rg350-a2b1f2fb7bac421074aee600f86900162be9c834.tar.bz2 scummvm-rg350-a2b1f2fb7bac421074aee600f86900162be9c834.zip |
PRINCE: Warings fix, drawAsShadow update - kShadowColor to graphics.h
-rw-r--r-- | engines/prince/graphics.cpp | 2 | ||||
-rw-r--r-- | engines/prince/graphics.h | 2 | ||||
-rw-r--r-- | engines/prince/hero.cpp | 6 | ||||
-rw-r--r-- | engines/prince/hero.h | 4 | ||||
-rw-r--r-- | engines/prince/prince.cpp | 6 |
5 files changed, 10 insertions, 10 deletions
diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp index 6265d94766..5bcadc442a 100644 --- a/engines/prince/graphics.cpp +++ b/engines/prince/graphics.cpp @@ -93,7 +93,7 @@ void GraphicsMan::drawAsShadow(int32 posX, int32 posY, const Graphics::Surface * for (int y = 0; y < s->h; y++) { for (int x = 0; x < s->w; x++) { byte pixel = *((byte*)s->getBasePtr(x, y)); - if (pixel != 255) { + if (pixel == kShadowColor) { if (x + posX < _frontScreen->w && x + posX >= 0) { if (y + posY < _frontScreen->h && y + posY >= 0) { byte *background = (byte *)_frontScreen->getBasePtr(x + posX, y + posY); diff --git a/engines/prince/graphics.h b/engines/prince/graphics.h index fea7d14744..af2bfe716d 100644 --- a/engines/prince/graphics.h +++ b/engines/prince/graphics.h @@ -54,6 +54,8 @@ public: byte *_shadowTable70; byte *_shadowTable50; + static const byte kShadowColor = 191; + private: PrinceEngine *_vm; diff --git a/engines/prince/hero.cpp b/engines/prince/hero.cpp index 58f729a73e..6576901838 100644 --- a/engines/prince/hero.cpp +++ b/engines/prince/hero.cpp @@ -245,7 +245,7 @@ void Hero::showHeroShadow(Graphics::Surface *heroFrame) { for (int x = 0; x < _frameXSize; x++, dst++, src++) { if (*src != 0xFF) { - *dst = kShadowColor; + *dst = _graph->kShadowColor; } else { *dst = *src; } @@ -397,7 +397,7 @@ void Hero::showHeroShadow(Graphics::Surface *heroFrame) { if (shadZoomX < 0 && _scaleValue != 10000) { shadZoomX += _scaleValue; } else { - if (*shadowHero == kShadowColor) { + if (*shadowHero == _graph->kShadowColor) { if ((shadBitMaskCopyTrans & _shadowBitmap[shadBitAddrCopyTrans]) != 0) { if (shadWallDown == 0) { if ((shadBitMaskCopyTrans & _shadowBitmap[shadBitAddrCopyTrans + kShadowBitmapSize]) != 0) { @@ -455,7 +455,7 @@ void Hero::showHeroShadow(Graphics::Surface *heroFrame) { shadZoomXWall += _scaleValue; } else { //point_ok: - if (*shadowHero == kShadowColor) { + if (*shadowHero == _graph->kShadowColor) { if ((shadBitMaskWallCopyTrans & _shadowBitmap[shadBitAddrWallCopyTrans + kShadowBitmapSize]) != 0) { *background = *(sprShadow + *background); } diff --git a/engines/prince/hero.h b/engines/prince/hero.h index c430cc3861..00a81bdc7e 100644 --- a/engines/prince/hero.h +++ b/engines/prince/hero.h @@ -47,8 +47,6 @@ public: static const int32 kShadowBitmapSize = kMaxPicWidth * kMaxPicHeight / 8; static const int16 kScreenWidth = 640; - static const byte kShadowColor = 191; - enum State { STAY = 0, TURN = 1, @@ -163,7 +161,7 @@ public: // DestDir // LeftRight previous left/right direction // UpDown previous up/down direction - uint _phase; // Phase animation phase + int32 _phase; // Phase animation phase // Step x/y step size depends on direction // MaxBoredom stand still timeout int16 _boredomTime;// Boredom current boredom time in frames diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index a46393f94c..859db8c3e3 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -117,7 +117,7 @@ PrinceEngine::~PrinceEngine() { for (uint i = 0; i < _backAnimList.size(); i++) { int anims = _backAnimList[i]._seq._anims != 0 ? _backAnimList[i]._seq._anims : 1; - for (uint j = 0; j < anims; j++) { + for (int j = 0; j < anims; j++) { delete _backAnimList[i].backAnims[j]._animData; delete _backAnimList[i].backAnims[j]._shadowData; } @@ -328,9 +328,9 @@ bool PrinceEngine::loadLocation(uint16 locationNr) { _mainHero->setShadowScale(_script->getShadowScale(_locationNr)); _room->loadRoom(_script->getRoomOffset(_locationNr)); - for (uint32 i = 0; i < _backAnimList.size(); i++) { + for (uint i = 0; i < _backAnimList.size(); i++) { int anims = _backAnimList[i]._seq._anims != 0 ? _backAnimList[i]._seq._anims : 1; - for (uint32 j = 0; j < anims; j++) { + for (int j = 0; j < anims; j++) { delete _backAnimList[i].backAnims[j]._animData; delete _backAnimList[i].backAnims[j]._shadowData; } |