X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame_mm%2Fmm_game.c;h=a649d2333583832d335f48dd8a0d6e59669907ea;hp=9d8a8763f5d77de1f3e407485c844008ca8b3c59;hb=7e68d10c8f4c814e532cc30f6fc721c269a99cb6;hpb=ce20797c3998436e5c54939ef2f56a4fe4a5b14d diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 9d8a8763..a649d233 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -2430,13 +2430,12 @@ static void ContinueMoving_MM(int x, int y) laser.redraw = TRUE; } -void ClickElement(int mx, int my, int button) +void ClickElement(int x, int y, int button) { static unsigned int click_delay = 0; static int click_delay_value = CLICK_DELAY_SHORT; static boolean new_button = TRUE; int element; - int x = (mx - SX) / TILEX, y = (my - SY) / TILEY; /* do not rotate objects hit by the laser after the game was solved */ if (game_mm.level_solved && Hit[x][y]) @@ -2459,7 +2458,7 @@ void ClickElement(int mx, int my, int button) if (button == MB_MIDDLEBUTTON) /* middle button has no function */ return; - if (!IN_PIX_FIELD(mx - SX, my - SY)) + if (!IN_LEV_FIELD(x, y)) return; if (Feld[x][y] == EL_EMPTY) @@ -2762,7 +2761,7 @@ void ColorCycling(void) } } -static void GameActions_MM_Ext(byte action[MAX_PLAYERS], boolean warp_mode) +static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) { static unsigned int action_delay = 0; static unsigned int pacman_delay = 0; @@ -3440,10 +3439,9 @@ static void GameActions_MM_Ext(byte action[MAX_PLAYERS], boolean warp_mode) return; } -void GameActions_MM(byte action[MAX_PLAYERS], boolean warp_mode) +void GameActions_MM(struct MouseActionInfo action, boolean warp_mode) { - if (!button_status) - ClickElement(0, 0, MB_NOT_PRESSED); + ClickElement(action.lx, action.ly, action.button); GameActions_MM_Ext(action, warp_mode); }