From: Holger Schemel Date: Thu, 11 May 2017 19:01:25 +0000 (+0200) Subject: fixed drawing enabled laser when redrawing level playfield (MM engine) X-Git-Tag: 4.1.0.0~112 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=95f91d5fb8835feb5b461b97607b1730baaf699b;p=rocksndiamonds.git fixed drawing enabled laser when redrawing level playfield (MM engine) --- diff --git a/src/game_mm/export.h b/src/game_mm/export.h index d92dcdb2..31c01770 100644 --- a/src/game_mm/export.h +++ b/src/game_mm/export.h @@ -151,6 +151,7 @@ struct GameInfo_MM boolean cheat_no_explosion; int laser_overload_value; + boolean laser_enabled; }; struct LevelInfo_MM @@ -206,6 +207,8 @@ extern void InitGameEngine_MM(); extern void InitGameActions_MM(); extern void GameActions_MM(struct MouseActionInfo, boolean); +extern void DrawLaser_MM(); + extern void ClickElement(int, int, int); extern unsigned int InitEngineRandom_MM(int); diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index e2a2e5f8..1e6c3061 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -606,6 +606,7 @@ void InitGameEngine_MM() game_mm.game_over_cause = 0; game_mm.laser_overload_value = 0; + game_mm.laser_enabled = FALSE; /* set global laser control values (must be set before "InitLaser()") */ laser.start_edge.x = 0; @@ -1329,6 +1330,13 @@ void DrawLaser(int start_edge, int mode) { DrawLaserExt(start_edge, laser.num_edges - start_edge, mode); } + + game_mm.laser_enabled = mode; +} + +void DrawLaser_MM() +{ + DrawLaser(0, game_mm.laser_enabled); } boolean HitElement(int element, int hit_mask) diff --git a/src/game_mm/mm_tools.c b/src/game_mm/mm_tools.c index a2b7e451..8a9de52a 100644 --- a/src/game_mm/mm_tools.c +++ b/src/game_mm/mm_tools.c @@ -739,6 +739,7 @@ int el2gfx(int element) void RedrawPlayfield_MM() { DrawLevel_MM(); + DrawLaser_MM(); } void BlitScreenToBitmap_MM(Bitmap *target_bitmap) diff --git a/src/game_mm/mm_tools.h b/src/game_mm/mm_tools.h index 3655ccf4..d7a050de 100644 --- a/src/game_mm/mm_tools.h +++ b/src/game_mm/mm_tools.h @@ -100,6 +100,7 @@ void DrawMiniElementOrWall_MM(int, int, int, int); void DrawField_MM(int, int); void DrawLevel_MM(void); +void DrawLaser_MM(void); void DrawElement_MM(int, int, int); void DrawWallsExt_MM(int, int, int, int); void DrawWalls_MM(int, int, int);