projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20111007-1-src
[rocksndiamonds.git]
/
src
/
game_sp
/
Explosions.c
diff --git
a/src/game_sp/Explosions.c
b/src/game_sp/Explosions.c
index 8983a3781b131c0889435dba76e7eafe57babb27..867cc27302cf73db8101aa10168b972730bc28d8 100644
(file)
--- a/
src/game_sp/Explosions.c
+++ b/
src/game_sp/Explosions.c
@@
-4,107
+4,78
@@
#include "Explosions.h"
#include "Explosions.h"
+
static void LetExplodeFieldSP(int tsi, int cx, int dh);
static void LetExplodeFieldSP(int tsi, int cx, int dh);
-static
int
subExplodeInfotron(int tsi, int cx);
-static
int
subExplodeZonk(int tsi, int cx);
+static
void
subExplodeInfotron(int tsi, int cx);
+static
void
subExplodeZonk(int tsi, int cx);
-// static char *VB_Name = "modExplosions";
-// --- Option Explicit
// ==========================================================================
// SUBROUTINE
// Animate explosion
// ==========================================================================
// ==========================================================================
// SUBROUTINE
// Animate explosion
// ==========================================================================
-int subAnimateExplosion(int si)
-{
- int subAnimateExplosion;
- // int ax, bx, bl, X, Y;
+void subAnimateExplosion(int si)
+{
int ax, bl, X, Y;
if (LowByte(PlayField16[si]) != fiExplosion)
int ax, bl, X, Y;
if (LowByte(PlayField16[si]) != fiExplosion)
- return
subAnimateExplosion
;
+ return;
ax = (TimerVar & 3);
if (ax != 0)
ax = (TimerVar & 3);
if (ax != 0)
- return
subAnimateExplosion
;
+ return;
bl = HighByte(PlayField16[si]);
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;
bl = bl + 1;
MovHighByte(&PlayField16[si], bl);
if ((bl & 0x80) != 0) // infotron explosion!
goto loc_g_28D0;
bl = bl + 1;
MovHighByte(&PlayField16[si], bl);
+
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
-#if 1
-
-#if 1
GfxGraphic[GetX(si)][GetY(si)] = aniDefaultExplosion;
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;
if (bl == 8)
{
PlayField16[si] = 0;
- ExplosionShake = 0; // nothing explodes
+ ExplosionShake = 0; // nothing explodes
+ // ExplosionShakeMurphy = 0; // nothing explodes
-#if 1
+ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GfxGraphic[GetX(si)][GetY(si)] = aniSpace;
GfxGraphic[GetX(si)][GetY(si)] = aniSpace;
-#else
- StretchedSprites.BltImg(X, Y, aniSpace, 0);
-#endif
+ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
} // loc_ret_g_28CF:
} // loc_ret_g_28CF:
- return
subAnimateExplosion
;
+ return;
loc_g_28D0: // explosion produces infotron
bl = bl + 1;
if (bl == 0x89)
{
PlayField16[si] = fiInfotron;
loc_g_28D0: // explosion produces infotron
bl = bl + 1;
if (bl == 0x89)
{
PlayField16[si] = fiInfotron;
- MovLowByte(&ExplosionShake, 0); // nothing explodes
+ MovLowByte(&ExplosionShake, 0); // nothing explodes
+ // MovLowByte(&ExplosionShakeMurphy, 0); // nothing explodes
-#if 1
+ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GfxGraphic[GetX(si)][GetY(si)] = aniInfotron;
GfxGraphic[GetX(si)][GetY(si)] = aniInfotron;
-#else
- X = GetStretchX(si);
- Y = GetStretchY(si);
- StretchedSprites.BltImg(X, Y, aniInfotron, 0);
-#endif
+ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- return
subAnimateExplosion
;
+ return;
} // loc_g_28E3:
MovHighByte(&PlayField16[si], bl);
} // loc_g_28E3:
MovHighByte(&PlayField16[si], bl);
+
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
-#if 1
-
-#if 1
GfxGraphic[GetX(si)][GetY(si)] = aniElectronExplosion;
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;
-} // subAnimateExplosion
+}
// ==========================================================================
// SUBROUTINE
// ==========================================================================
// SUBROUTINE
@@
-113,21
+84,25
@@
loc_g_28D0: // explosion produces infotron
void ExplodeFieldSP(int si)
{
void ExplodeFieldSP(int si)
{
- // int ax, al, cx, dl, dh;
int ax, cx, dl;
ax = LowByte(PlayField16[si]);
if (ax == fiHardWare)
return;
int ax, cx, dl;
ax = LowByte(PlayField16[si]);
if (ax == fiHardWare)
return;
- ExplosionShake = 1; // something explodes
+ ExplosionShake = 1; // something explodes
+
if (ax == fiMurphy)
{
if (ax == fiMurphy)
{
-#if
1
+#if
0
printf("::: Explosions.c: ExplodeFieldSP(): killing murphy\n");
#endif
KillMurphyFlag = 1;
printf("::: Explosions.c: ExplodeFieldSP(): killing murphy\n");
#endif
KillMurphyFlag = 1;
+
+#if 1
+ ExplosionShakeMurphy = 30; // Murphy explodes
+#endif
}
if (ax == fiElectron)
}
if (ax == fiElectron)
@@
-154,21
+129,17
@@
void ExplodeFieldSP(int si)
GfxGraphic[GetX(si)][GetY(si)] = -1; // restart for chain-explosions
// loc_g_2C3B:
GfxGraphic[GetX(si)][GetY(si)] = -1; // restart for chain-explosions
// loc_g_2C3B:
- subSoundFX
Explosion(
);
-}
// ExplodeFieldSP
+ subSoundFX
(si, ax, actExploding
);
+}
static void LetExplodeFieldSP(int tsi, int cx, int dh)
{
int al;
static void LetExplodeFieldSP(int tsi, int cx, int dh)
{
int al;
- if (tsi <
(-FieldWidth)
)
+ if (tsi <
-FieldWidth
)
return;
al = LowByte(PlayField16[tsi]);
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:
switch (al)
{
case fiHardWare:
@@
-197,7
+168,7
@@
static void LetExplodeFieldSP(int tsi, int cx, int dh)
break;
case fiMurphy:
break;
case fiMurphy:
-#if
1
+#if
0
printf("::: Explosions.c: LetExplodeFieldSP(): killing murphy [%d]\n",
tsi);
#endif
printf("::: Explosions.c: LetExplodeFieldSP(): killing murphy [%d]\n",
tsi);
#endif
@@
-215,10
+186,8
@@
static void LetExplodeFieldSP(int tsi, int cx, int dh)
GfxGraphic[GetX(tsi)][GetY(tsi)] = -1; // restart for chain-explosions
}
GfxGraphic[GetX(tsi)][GetY(tsi)] = -1; // restart for chain-explosions
}
-static
int
subExplodeZonk(int tsi, int cx)
+static
void
subExplodeZonk(int tsi, int cx)
{
{
- static int subExplodeZonk;
-
int ah;
ah = HighByte(PlayField16[tsi]) & 0xF0;
int ah;
ah = HighByte(PlayField16[tsi]) & 0xF0;
@@
-256,14
+225,10
@@
static int subExplodeZonk(int tsi, int cx)
subClearFieldDueToExplosion(tsi + FieldWidth);
break;
}
subClearFieldDueToExplosion(tsi + FieldWidth);
break;
}
+}
- return subExplodeZonk;
-} // subExplodeZonk
-
-static int subExplodeInfotron(int tsi, int cx)
+static void subExplodeInfotron(int tsi, int cx)
{
{
- static int subExplodeInfotron;
-
int ah;
ah = HighByte(PlayField16[tsi]) & 0xF0;
int ah;
ah = HighByte(PlayField16[tsi]) & 0xF0;
@@
-307,48
+272,30
@@
static int subExplodeInfotron(int tsi, int cx)
subClearFieldDueToExplosion(tsi + FieldWidth);
break;
}
subClearFieldDueToExplosion(tsi + FieldWidth);
break;
}
+}
- return subExplodeInfotron;
-} // subExplodeInfotron
-
-int subClearFieldDueToExplosion(int si)
+void subClearFieldDueToExplosion(int si)
{
{
- int subClearFieldDueToExplosion;
-
int X, Y;
if (LowByte(PlayField16[si]) == fiExplosion)
int X, Y;
if (LowByte(PlayField16[si]) == fiExplosion)
- return
subClearFieldDueToExplosion
;
+ return;
PlayField16[si] = 0;
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
PlayField16[si] = 0;
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
-#if 1
-
-#if 1
GfxGraphic[GetX(si)][GetY(si)] = aniSpace;
GfxGraphic[GetX(si)][GetY(si)] = aniSpace;
-#else
- StretchedSprites.BltImg(X, Y, aniSpace, 0);
-#endif
-
-#else
- StretchedSprites.BltEx(X, Y, fiSpace);
-#endif
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+}
- return subClearFieldDueToExplosion;
-} // subClearFieldDueToExplosion
-
-int subRedDiskReleaseExplosion()
+void subRedDiskReleaseExplosion()
{
{
- int subRedDiskReleaseExplosion;
-
int al, X, Y, si;
al = RedDiskReleasePhase; // Red disk release phase
if (al <= 1)
int al, X, Y, si;
al = RedDiskReleasePhase; // Red disk release phase
if (al <= 1)
- return
subRedDiskReleaseExplosion
;
+ return;
si = RedDiskReleaseMurphyPos;
if (PlayField16[si] == 0) // Release red disk
si = RedDiskReleaseMurphyPos;
if (PlayField16[si] == 0) // Release red disk
@@
-357,19
+304,14
@@
int subRedDiskReleaseExplosion()
// +++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
// +++++++++++++++++++++++++++++++++++++++++
X = GetStretchX(si);
Y = GetStretchY(si);
-#if 1
-
#if 0
// !!! causes flicker -- fix in Murphy.c !!!
GfxGraphic[GetX(si)][GetY(si)] = aniRedDisk;
#else
#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);
+ DDSpriteBuffer_BltImg(X, Y, aniRedDisk, 0);
#endif
// +++++++++++++++++++++++++++++++++++++++++
#endif
// +++++++++++++++++++++++++++++++++++++++++
+
RedDiskReleasePhase = RedDiskReleasePhase + 1;
if (RedDiskReleasePhase >= 0x28)
{
RedDiskReleasePhase = RedDiskReleasePhase + 1;
if (RedDiskReleasePhase >= 0x28)
{
@@
-377,14
+319,10
@@
int subRedDiskReleaseExplosion()
ExplodeFieldSP(si); // Explode
RedDiskReleasePhase = 0;
}
ExplodeFieldSP(si); // Explode
RedDiskReleasePhase = 0;
}
-
- return subRedDiskReleaseExplosion;
}
}
-
int
subFollowUpExplosions()
+
void
subFollowUpExplosions()
{
{
- int subFollowUpExplosions;
-
int ax, si;
// locloop_g_2919:
int ax, si;
// locloop_g_2919:
@@
-402,7
+340,6
@@
int subFollowUpExplosions()
PlayField16[si] = 0xFF18;
ExplodeFieldSP(si); // Explode
}
PlayField16[si] = 0xFF18;
ExplodeFieldSP(si); // Explode
}
-
}
else
{
}
else
{
@@
-413,6
+350,4
@@
int subFollowUpExplosions()
}
}
}
}
}
}
-
- return subFollowUpExplosions;
-} // subFollowUpExplosions
+}