diff options
Diffstat (limited to 'engines/neverhood/resource.cpp')
-rw-r--r-- | engines/neverhood/resource.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/engines/neverhood/resource.cpp b/engines/neverhood/resource.cpp index dde80ebe79..97eae89bd5 100644 --- a/engines/neverhood/resource.cpp +++ b/engines/neverhood/resource.cpp @@ -158,8 +158,10 @@ void AnimResource::draw(uint frameIndex, byte *dest, int destPitch, bool flipX, _currSpriteData = _spriteData + frameInfo.spriteDataOffs; _width = frameInfo.rect.width; _height = frameInfo.rect.height; - // TODO: Repl stuff - unpackSpriteRle(_currSpriteData, _width, _height, dest, destPitch, flipX, flipY); + if (_replEnabled && _replOldColor != _replNewColor) + unpackSpriteRleRepl(_currSpriteData, _width, _height, dest, destPitch, _replOldColor, _replNewColor, flipX, flipY); + else + unpackSpriteRle(_currSpriteData, _width, _height, dest, destPitch, flipX, flipY); } bool AnimResource::load(uint32 fileHash) { @@ -276,8 +278,8 @@ void AnimResource::clear() { void AnimResource::clear2() { clear(); _replEnabled = true; - _replOldByte = 0; - _replNewByte = 0; + _replOldColor = 0; + _replNewColor = 0; } bool AnimResource::loadInternal(uint32 fileHash) { @@ -301,6 +303,11 @@ int16 AnimResource::getFrameIndex(uint32 frameHash) { return frameIndex; } +void AnimResource::setRepl(byte oldColor, byte newColor) { + _replOldColor = oldColor; + _replNewColor = newColor; +} + MouseCursorResource::MouseCursorResource(NeverhoodEngine *vm) : _cursorSprite(vm), _cursorNum(4), _currFileHash(0) { |