rnd-20100224-1-src
[rocksndiamonds.git] / src / game_sp / Explosions.c
index cf1d72970f177b0a94b4027a3d37d558565c8530..8983a3781b131c0889435dba76e7eafe57babb27 100644 (file)
@@ -30,6 +30,10 @@ int subAnimateExplosion(int si)
     return subAnimateExplosion;
 
   bl = HighByte(PlayField16[si]);
+#if 0
+  printf("::: subAnimateExplosion: %d [%d, %d] [%d]\n",
+        bl, PlayField16[si], si, FrameCounter);
+#endif
   if ((bl & 0x80) != 0) // infotron explosion!
     goto loc_g_28D0;
 
@@ -38,12 +42,28 @@ int subAnimateExplosion(int si)
   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   X = GetStretchX(si);
   Y = GetStretchY(si);
-  StretchedSprites.BltEx(X, Y, aniExplosion[bl]);
+#if 1
+
+#if 1
+  GfxGraphic[GetX(si)][GetY(si)] = aniDefaultExplosion;
+#else
+  StretchedSprites.BltImg(X, Y, aniDefaultExplosion, bl);
+#endif
+
+#else
+  StretchedSprites.BltEx(X, Y, aniFramesExplosion[bl]);
+#endif
   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   if (bl == 8)
   {
     PlayField16[si] = 0;
     ExplosionShake = 0; // nothing explodes
+
+#if 1
+    GfxGraphic[GetX(si)][GetY(si)] = aniSpace;
+#else
+    StretchedSprites.BltImg(X, Y, aniSpace, 0);
+#endif
   } // loc_ret_g_28CF:
 
   return subAnimateExplosion;
@@ -54,6 +74,15 @@ loc_g_28D0: // explosion produces infotron
   {
     PlayField16[si] = fiInfotron;
     MovLowByte(&ExplosionShake, 0); // nothing explodes
+
+#if 1
+    GfxGraphic[GetX(si)][GetY(si)] = aniInfotron;
+#else
+    X = GetStretchX(si);
+    Y = GetStretchY(si);
+    StretchedSprites.BltImg(X, Y, aniInfotron, 0);
+#endif
+
     return subAnimateExplosion;
   } // loc_g_28E3:
 
@@ -61,7 +90,17 @@ loc_g_28D0: // explosion produces infotron
   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   X = GetStretchX(si);
   Y = GetStretchY(si);
+#if 1
+
+#if 1
+  GfxGraphic[GetX(si)][GetY(si)] = aniElectronExplosion;
+#else
+  StretchedSprites.BltImg(X, Y, aniElectronExplosion, bl - 0x80);
+#endif
+
+#else
   StretchedSprites.BltEx(X, Y, aniExplosionInfo + bl - 0x80);
+#endif
   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
   return subAnimateExplosion;
@@ -112,6 +151,8 @@ void ExplodeFieldSP(int si)
   LetExplodeFieldSP(si + FieldWidth, cx, dl);
   LetExplodeFieldSP(si + FieldWidth + 1, cx, dl);
 
+  GfxGraphic[GetX(si)][GetY(si)] = -1;         // restart for chain-explosions
+
   // loc_g_2C3B:
   subSoundFXExplosion();
 } // ExplodeFieldSP
@@ -124,6 +165,10 @@ static void LetExplodeFieldSP(int tsi, int cx, int dh)
     return;
 
   al = LowByte(PlayField16[tsi]);
+#if 0
+  printf("::: LetExplodeFieldSP: got %d [%d, %d] [%d]\n",
+        al, PlayField16[tsi], tsi, FrameCounter);
+#endif
   switch (al)
   {
     case fiHardWare:
@@ -166,6 +211,8 @@ static void LetExplodeFieldSP(int tsi, int cx, int dh)
       PlayField16[tsi] = cx;
       break;
   }
+
+  GfxGraphic[GetX(tsi)][GetY(tsi)] = -1;       // restart for chain-explosions
 }
 
 static int subExplodeZonk(int tsi, int cx)
@@ -277,7 +324,17 @@ int subClearFieldDueToExplosion(int si)
   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   X = GetStretchX(si);
   Y = GetStretchY(si);
+#if 1
+
+#if 1
+  GfxGraphic[GetX(si)][GetY(si)] = aniSpace;
+#else
+  StretchedSprites.BltImg(X, Y, aniSpace, 0);
+#endif
+
+#else
   StretchedSprites.BltEx(X, Y, fiSpace);
+#endif
   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
   return subClearFieldDueToExplosion;
@@ -300,7 +357,18 @@ int subRedDiskReleaseExplosion()
   // +++++++++++++++++++++++++++++++++++++++++
   X = GetStretchX(si);
   Y = GetStretchY(si);
+#if 1
+
+#if 0
+  // !!! causes flicker -- fix in Murphy.c !!!
+  GfxGraphic[GetX(si)][GetY(si)] = aniRedDisk;
+#else
+  StretchedSprites.BltImg(X, Y, aniRedDisk, 0);
+#endif
+
+#else
   StretchedSprites.BltEx(X, Y, fiRedDisk);
+#endif
   // +++++++++++++++++++++++++++++++++++++++++
   RedDiskReleasePhase = RedDiskReleasePhase + 1;
   if (RedDiskReleasePhase >= 0x28)