From 8ffa6483f45960c2c0d919aa7c11f06a9c79f3b0 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 20 Sep 2016 23:03:55 +0200 Subject: FULLPIPE: Simplified Debug scene logic --- engines/fullpipe/scenes/sceneDbg.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/scenes/sceneDbg.cpp b/engines/fullpipe/scenes/sceneDbg.cpp index 9df8c2766b..2ba59778ba 100644 --- a/engines/fullpipe/scenes/sceneDbg.cpp +++ b/engines/fullpipe/scenes/sceneDbg.cpp @@ -41,19 +41,21 @@ void sceneDbgMenu_initScene(Scene *sc) { } GameObject *sceneHandlerDbgMenu_getObjectAtXY(int x, int y) { - if (g_fp->_currentScene) - for (uint i = 1; i < g_fp->_currentScene->_picObjList.size(); i++) { - PictureObject *pic = (PictureObject *)g_fp->_currentScene->_picObjList[i]; + if (!g_fp->_currentScene) + return 0; + + for (uint i = 1; i < g_fp->_currentScene->_picObjList.size(); i++) { + PictureObject *pic = (PictureObject *)g_fp->_currentScene->_picObjList[i]; - if (x >= pic->_ox && y >= pic->_oy) { - Common::Point point; + if (x >= pic->_ox && y >= pic->_oy) { + Common::Point point; - pic->getDimensions(&point); + pic->getDimensions(&point); - if (x <= pic->_ox + point.x && y <= pic->_oy + point.y && pic != g_vars->selector) - return pic; - } + if (x <= pic->_ox + point.x && y <= pic->_oy + point.y && pic != g_vars->selector) + return pic; } + } return 0; } -- cgit v1.2.3