示例#1
0
GameObject *sceneHandlerDbgMenu_getObjectAtXY(int x, int y) {
	if (!g_fp->_currentScene)
		return 0;

	for (uint i = 1; i < g_fp->_currentScene->_picObjList.size(); i++) {
		PictureObject *pic = g_fp->_currentScene->_picObjList[i];

		if (x >= pic->_ox && y >= pic->_oy) {
			const Dims dims = pic->getDimensions();
			if (x <= pic->_ox + dims.x && y <= pic->_oy + dims.y && pic != g_vars->selector)
				return pic;
		}
	}

	return 0;
}
示例#2
0
文件: sceneDbg.cpp 项目: 33d/scummvm
GameObject *sceneHandlerDbgMenu_getObjectAtXY(int x, int y) {
	if (g_fp->_currentScene)
		for (uint i = 0; 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;

				pic->getDimensions(&point);

				if (x <= pic->_ox + point.x && y <= pic->_oy + point.y && pic != g_vars->selector)
					return pic;
			}
		}

	return 0;
}