X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_mm%2Fmm_game.c;h=bd03e337df1fe28f13310de7ea5ec82aa251c765;hb=ea1ac518cfa502e41c036aaf35c97231387c8067;hp=316c891edea811616016ef637d49bde1764c50ed;hpb=95d0baeb4a79a9a0c239c736d43729574751fa58;p=rocksndiamonds.git diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 316c891e..bd03e337 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -2553,33 +2553,43 @@ static void GrowAmoeba(int x, int y) } static void DrawFieldAnimated_MM(int x, int y) +{ + DrawField_MM(x, y); + + laser.redraw = TRUE; +} + +static void DrawFieldAnimatedIfNeeded_MM(int x, int y) { int element = Tile[x][y]; + int graphic = el2gfx(element); - if (IS_BLOCKED(x, y)) + if (!getGraphicInfo_NewFrame(x, y, graphic)) return; DrawField_MM(x, y); - if (IS_MIRROR(element) || - IS_MIRROR_FIXED(element) || - element == EL_PRISM) + laser.redraw = TRUE; +} + +static void DrawFieldTwinkle(int x, int y) +{ + if (MovDelay[x][y] != 0) // wait some time before next frame { - if (MovDelay[x][y] != 0) // wait some time before next frame - { - MovDelay[x][y]--; + MovDelay[x][y]--; - if (MovDelay[x][y] != 0) - { - int graphic = IMG_TWINKLE_WHITE; - int frame = getGraphicAnimationFrame(graphic, 10 - MovDelay[x][y]); + DrawField_MM(x, y); - DrawGraphicThruMask_MM(SCREENX(x), SCREENY(y), graphic, frame); - } + if (MovDelay[x][y] != 0) + { + int graphic = IMG_TWINKLE_WHITE; + int frame = getGraphicAnimationFrame(graphic, 10 - MovDelay[x][y]); + + DrawGraphicThruMask_MM(SCREENX(x), SCREENY(y), graphic, frame); } - } - laser.redraw = TRUE; + laser.redraw = TRUE; + } } static void Explode_MM(int x, int y, int phase, int mode) @@ -3044,8 +3054,6 @@ void RotateMirror(int x, int y, int button) IS_POLAR(Tile[x][y]) || IS_POLAR_CROSS(Tile[x][y])) && x == ELX && y == ELY) { - check = 0; - if (IS_BEAMER(Tile[x][y])) { #if 0 @@ -3053,12 +3061,13 @@ void RotateMirror(int x, int y, int button) LX, LY, laser.beamer_edge, laser.beamer[1].num); #endif -#if 0 - laser.num_edges--; -#endif + if (check == 1) + laser.num_edges--; } ScanLaser(); + + check = 0; } if (check == 2) @@ -3223,8 +3232,16 @@ static void GameActions_MM_Ext(void) MeltIce(x, y); else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_AMOEBA) GrowAmoeba(x, y); - else + else if (IS_MIRROR(element) || + IS_MIRROR_FIXED(element) || + element == EL_PRISM) + DrawFieldTwinkle(x, y); + else if (element == EL_GRAY_BALL_OPENING || + element == EL_BOMB_ACTIVE || + element == EL_MINE_ACTIVE) DrawFieldAnimated_MM(x, y); + else if (!IS_BLOCKED(x, y)) + DrawFieldAnimatedIfNeeded_MM(x, y); } AutoRotateMirrors();