Skip to content

Commit

Permalink
PINK: fix accessing non-existent pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
voltya authored and sev- committed Jun 28, 2018
1 parent cf04fb2 commit 30b5c30
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions engines/pink/director.cpp
Expand Up @@ -114,9 +114,10 @@ Actor *Director::getActorByPoint(const Common::Point point) {
CelDecoder *decoder = _sprites[i]->getDecoder();
const Graphics::Surface *frame = decoder->getCurrentFrame();
const Common::Rect &rect = decoder->getRectangle();
byte spritePixel = *(const byte*) frame->getBasePtr(point.x - rect.left, point.y - rect.top);
if (rect.contains(point) && spritePixel != decoder->getTransparentColourIndex()) {
return _sprites[i]->getActor();
if (rect.contains(point)) {
byte spritePixel = *(const byte*) frame->getBasePtr(point.x - rect.left, point.y - rect.top);
if (spritePixel != decoder->getTransparentColourIndex())
return _sprites[i]->getActor();
}
}

Expand Down

0 comments on commit 30b5c30

Please sign in to comment.