diff options
Diffstat (limited to 'engines/fullpipe/scenes.cpp')
-rw-r--r-- | engines/fullpipe/scenes.cpp | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 980dae7f62..37be7facc9 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -1440,12 +1440,30 @@ void sceneDbgMenu_initScene(Scene *sc) { setInputDisabled(0); } +GameObject *sceneHandlerDbgMenu_getObjectAtXY(int x, int y) { + if (g_fullpipe->_currentScene) + for (uint i = 0; i < g_fullpipe->_currentScene->_picObjList.size(); i++) { + PictureObject *pic = (PictureObject *)g_fullpipe->_currentScene->_picObjList[i]; + + if (x >= pic->_ox && y >= pic->_oy) { + Common::Point point; + + pic->getDimensions(&point); + + if (x <= pic->_ox + point.x && y <= pic->_oy + point.y && pic != g_vars->selector) + return pic; + } + } + + return 0; +} + int sceneHandlerDbgMenu(ExCommand *ex) { if (ex->_messageKind != 17) return 0; -#if 0 - int mx = g_fullpipe->_mouseScreenPos.x + g_sceneRect.left; - int my = g_fullpipe->_mouseScreenPos.y + g_sceneRect.top; + + int mx = g_fullpipe->_mouseScreenPos.x + g_fullpipe->_sceneRect.left; + int my = g_fullpipe->_mouseScreenPos.y + g_fullpipe->_sceneRect.top; if (ex->_messageNum == 29) { GameObject *obj = sceneHandlerDbgMenu_getObjectAtXY(mx, my); @@ -1467,8 +1485,8 @@ int sceneHandlerDbgMenu(ExCommand *ex) { GameObject *obj = g_fullpipe->_currentScene->getStaticANIObjectAtPos(mx, my); if (obj) { if (canInteractAny(0, obj, -3)) { - g_cursorId = PIC_CSR_DEFAULT; - input_setCursor(PIC_CSR_DEFAULT); + g_fullpipe->_cursorId = PIC_CSR_DEFAULT; + g_fullpipe->setCursor(PIC_CSR_DEFAULT); return 0; } } else { @@ -1477,13 +1495,13 @@ int sceneHandlerDbgMenu(ExCommand *ex) { g_vars->selector->_flags |= 4; g_vars->selector->setOXY(obj->_ox, obj->_oy); g_fullpipe->_cursorId = PIC_CSR_DEFAULT; - input_setCursor(PIC_CSR_DEFAULT); + g_fullpipe->setCursor(PIC_CSR_DEFAULT); return 0; } g_vars->selector->_flags &= 0xFFFB; } - input_setCursor(g_cursorId); -#endif + g_fullpipe->setCursor(g_fullpipe->_cursorId); + return 0; } |