From a86ad9688a450b98686d6c643e3d28d047da867b Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 9 Sep 2007 23:13:35 +0000 Subject: It's now possible to move around in Winnie using the mouse, by clicking on the appropriate direction (north, south, east or west) svn-id: r28883 --- engines/agi/preagi_winnie.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'engines/agi/preagi_winnie.cpp') diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index df20627ab2..fc50c77f5e 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -760,6 +760,35 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) { break; case Common::EVENT_LBUTTONUP: + // Click to move + if (fCanSel[IDI_WTP_SEL_NORTH] && (event.mouse.x >= 20 && event.mouse.x <= (IDI_WTP_PIC_WIDTH + 10) * 2) && + (event.mouse.y >= 0 && event.mouse.y <= 10)) { + *iSel = IDI_WTP_SEL_NORTH; + makeSel(); + _vm->_gfx->setCursorPalette(false); + return; + } else if (fCanSel[IDI_WTP_SEL_SOUTH] && (event.mouse.x >= 20 && event.mouse.x <= (IDI_WTP_PIC_WIDTH + 10) * 2) && + (event.mouse.y >= IDI_WTP_PIC_HEIGHT - 10 && event.mouse.y <= IDI_WTP_PIC_HEIGHT)) { + *iSel = IDI_WTP_SEL_SOUTH; + makeSel(); + _vm->_gfx->setCursorPalette(false); + return; + } else if (fCanSel[IDI_WTP_SEL_WEST] && (event.mouse.y >= 0 && event.mouse.y <= IDI_WTP_PIC_HEIGHT) && + (event.mouse.x >= 20 && event.mouse.x <= 30)) { + *iSel = IDI_WTP_SEL_WEST; + makeSel(); + _vm->_gfx->setCursorPalette(false); + return; + } else if (fCanSel[IDI_WTP_SEL_EAST] && (event.mouse.y >= 0 && event.mouse.y <= IDI_WTP_PIC_HEIGHT) && + (event.mouse.x >= IDI_WTP_PIC_WIDTH * 2 && event.mouse.x <= (IDI_WTP_PIC_WIDTH + 10) * 2)) { + *iSel = IDI_WTP_SEL_EAST; + makeSel(); + _vm->_gfx->setCursorPalette(false); + return; + } else { + _vm->_gfx->setCursorPalette(false); + } + switch(*iSel) { case IDI_WTP_SEL_OPT_1: case IDI_WTP_SEL_OPT_2: -- cgit v1.2.3