mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-07 10:21:31 +00:00
DIRECTOR: Properly discover sprite cursors
We canot just use getSpriteIDFromPos, as Director gets the cursor from the topmost sprite that has a non-empty cursor.
This commit is contained in:
parent
c99abbc645
commit
d7ec21cbeb
@ -112,7 +112,7 @@ bool Movie::processEvent(Common::Event &event) {
|
||||
_lastEventTime = g_director->getMacTicks();
|
||||
_lastRollTime = _lastEventTime;
|
||||
|
||||
sc->renderCursor(sc->getSpriteIDFromPos(pos));
|
||||
sc->renderCursor(pos);
|
||||
|
||||
if (_currentDraggedChannel) {
|
||||
if (_currentDraggedChannel->_sprite->_moveable) {
|
||||
@ -176,7 +176,7 @@ bool Movie::processEvent(Common::Event &event) {
|
||||
}
|
||||
|
||||
registerEvent(kEventMouseUp, spriteId);
|
||||
sc->renderCursor(sc->getSpriteIDFromPos(pos));
|
||||
sc->renderCursor(pos);
|
||||
return true;
|
||||
|
||||
case Common::EVENT_KEYDOWN:
|
||||
|
@ -509,7 +509,13 @@ void Score::renderSprites(uint16 frameId, RenderMode mode) {
|
||||
}
|
||||
}
|
||||
|
||||
void Score::renderCursor(uint spriteId) {
|
||||
void Score::renderCursor(Common::Point pos) {
|
||||
uint spriteId = 0;
|
||||
|
||||
for (int i = _channels.size() - 1; i >=0; i--)
|
||||
if (_channels[i]->isMouseIn(pos) && !_channels[i]->_cursor.isEmpty())
|
||||
spriteId = i;
|
||||
|
||||
if (_channels[spriteId]->_cursor.isEmpty()) {
|
||||
if (_currentCursor) {
|
||||
_vm->_wm->popCursor();
|
||||
|
@ -108,7 +108,7 @@ public:
|
||||
bool renderTransition(uint16 frameId);
|
||||
void renderFrame(uint16 frameId, RenderMode mode = kRenderModeNormal);
|
||||
void renderSprites(uint16 frameId, RenderMode mode = kRenderModeNormal);
|
||||
void renderCursor(uint spriteId);
|
||||
void renderCursor(Common::Point pos);
|
||||
|
||||
private:
|
||||
void update();
|
||||
|
Loading…
Reference in New Issue
Block a user