mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 01:46:42 +00:00
DIRECTOR: Lingo: Fix b_rollOver() implementation
This commit is contained in:
parent
e8fb572487
commit
f802d26fa8
@ -1055,4 +1055,13 @@ uint16 Frame::getSpriteIDFromPos(Common::Point pos) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Frame::checkSpriteIntersection(uint16 spriteId, Common::Point pos) {
|
||||
// Find first from front to back
|
||||
for (int dr = _drawRects.size() - 1; dr >= 0; dr--)
|
||||
if (_drawRects[dr]->spriteId == spriteId && _drawRects[dr]->rect.contains(pos))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // End of namespace Director
|
||||
|
@ -119,6 +119,8 @@ public:
|
||||
void readChannel(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size);
|
||||
void prepareFrame(Score *score);
|
||||
uint16 getSpriteIDFromPos(Common::Point pos);
|
||||
bool checkSpriteIntersection(uint16 spriteId, Common::Point pos);
|
||||
|
||||
|
||||
private:
|
||||
void playTransition(Score *score);
|
||||
|
@ -1234,9 +1234,8 @@ void Lingo::b_rollOver(int nargs) {
|
||||
}
|
||||
|
||||
Common::Point pos = g_system->getEventManager()->getMousePos();
|
||||
uint16 spriteId = frame->getSpriteIDFromPos(pos);
|
||||
|
||||
if (spriteId == arg)
|
||||
if (frame->checkSpriteIntersection(arg, pos))
|
||||
d.u.i = 1; // TRUE
|
||||
|
||||
g_lingo->push(d);
|
||||
|
Loading…
x
Reference in New Issue
Block a user