fixed drawing overloaded laser when rotating McDuffin in MM engine
authorHolger Schemel <info@artsoft.org>
Mon, 2 Jan 2023 09:52:48 +0000 (10:52 +0100)
committerHolger Schemel <info@artsoft.org>
Mon, 2 Jan 2023 09:52:48 +0000 (10:52 +0100)
src/game_mm/mm_game.c

index 9d32be5e813033793684fdcf3a1940cb3f43ed93..b4fef9625ddd6fc80289cf23b7f948e183a3d4a2 100644 (file)
@@ -573,10 +573,13 @@ static void InitLaser(void)
 
   AddLaserEdge(LX, LY);                // set laser starting edge
 
+  int color_up = 0xFF * laser.overload_value / MAX_LASER_OVERLOAD;
+  int color_down = 0xFF - color_up;
+
   pen_ray = GetPixelFromRGB(window,
-                           native_mm_level.laser_red   * 0xFF,
-                           native_mm_level.laser_green * 0xFF,
-                           native_mm_level.laser_blue  * 0xFF);
+                           (native_mm_level.laser_red   ? 0xFF : color_up),
+                           (native_mm_level.laser_green ? color_down : 0x00),
+                           (native_mm_level.laser_blue  ? color_down : 0x00));
 }
 
 void InitGameEngine_MM(void)