X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame_sp%2FExplosions.c;h=4eded7b3444ea83a03b8e37d4143ec92ad692033;hp=0dc2cc71fd0513cd1b3a3d8d31e4d69c5bd0b23c;hb=e51177796149f37de339bda83558c3c49758be93;hpb=1e83803d7c99eb5232eab7d48a4194de3cf6f77f diff --git a/src/game_sp/Explosions.c b/src/game_sp/Explosions.c index 0dc2cc71..4eded7b3 100644 --- a/src/game_sp/Explosions.c +++ b/src/game_sp/Explosions.c @@ -4,68 +4,78 @@ #include "Explosions.h" + 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 // ========================================================================== -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) - return subAnimateExplosion; + return; ax = (TimerVar & 3); if (ax != 0) - return subAnimateExplosion; + return; bl = HighByte(PlayField16[si]); + if ((bl & 0x80) != 0) // infotron explosion! goto loc_g_28D0; bl = bl + 1; MovHighByte(&PlayField16[si], bl); + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, aniExplosion[bl]); + GfxGraphic[GetX(si)][GetY(si)] = aniDefaultExplosion; // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + if (bl == 8) { PlayField16[si] = 0; - ExplosionShake = 0; // nothing explodes + ExplosionShake = 0; // nothing explodes + // ExplosionShakeMurphy = 0; // nothing explodes + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + GfxGraphic[GetX(si)][GetY(si)] = aniSpace; + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ } // loc_ret_g_28CF: - return subAnimateExplosion; + return; loc_g_28D0: // explosion produces infotron bl = bl + 1; if (bl == 0x89) { PlayField16[si] = fiInfotron; - MovLowByte(&ExplosionShake, 0); // nothing explodes - return subAnimateExplosion; + MovLowByte(&ExplosionShake, 0); // nothing explodes + // MovLowByte(&ExplosionShakeMurphy, 0); // nothing explodes + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + GfxGraphic[GetX(si)][GetY(si)] = aniInfotron; + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + return; } // loc_g_28E3: MovHighByte(&PlayField16[si], bl); + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, aniExplosionInfo + bl - 0x80); + GfxGraphic[GetX(si)][GetY(si)] = aniElectronExplosion; // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - - return subAnimateExplosion; -} // subAnimateExplosion +} // ========================================================================== // SUBROUTINE @@ -74,21 +84,25 @@ loc_g_28D0: // explosion produces infotron void ExplodeFieldSP(int si) { - // int ax, al, cx, dl, dh; int ax, cx, dl; ax = LowByte(PlayField16[si]); if (ax == fiHardWare) return; - ExplosionShake = 1; // something explodes + ExplosionShake = 1; // something explodes + if (ax == fiMurphy) { -#if 1 - printf("::: Explosions.c: ExplodeFieldSP(): kill murphy\n"); +#if 0 + printf("::: Explosions.c: ExplodeFieldSP(): killing murphy\n"); #endif KillMurphyFlag = 1; + +#if 1 + ExplosionShakeMurphy = 30; // Murphy explodes +#endif } if (ax == fiElectron) @@ -112,9 +126,11 @@ 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 + subSoundFX(si, ax, actExploding); +} static void LetExplodeFieldSP(int tsi, int cx, int dh) { @@ -152,8 +168,9 @@ static void LetExplodeFieldSP(int tsi, int cx, int dh) break; case fiMurphy: -#if 1 - printf("::: Explosions.c: LetExplodeFieldSP(): kill murphy\n"); +#if 0 + printf("::: Explosions.c: LetExplodeFieldSP(): killing murphy [%d]\n", + tsi); #endif KillMurphyFlag = 1; @@ -165,12 +182,12 @@ 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) +static void subExplodeZonk(int tsi, int cx) { - static int subExplodeZonk; - int ah; ah = HighByte(PlayField16[tsi]) & 0xF0; @@ -208,14 +225,10 @@ static int subExplodeZonk(int tsi, int cx) 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; @@ -259,38 +272,30 @@ static int subExplodeInfotron(int tsi, int cx) 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) - return subClearFieldDueToExplosion; + return; PlayField16[si] = 0; // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, fiSpace); + GfxGraphic[GetX(si)][GetY(si)] = aniSpace; // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +} - return subClearFieldDueToExplosion; -} // subClearFieldDueToExplosion - -int subRedDiskReleaseExplosion() +void subRedDiskReleaseExplosion() { - int subRedDiskReleaseExplosion; - 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 @@ -299,8 +304,14 @@ int subRedDiskReleaseExplosion() // +++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, fiRedDisk); +#if 0 + // !!! causes flicker -- fix in Murphy.c !!! + GfxGraphic[GetX(si)][GetY(si)] = aniRedDisk; +#else + DDSpriteBuffer_BltImg(X, Y, aniRedDisk, 0); +#endif // +++++++++++++++++++++++++++++++++++++++++ + RedDiskReleasePhase = RedDiskReleasePhase + 1; if (RedDiskReleasePhase >= 0x28) { @@ -308,14 +319,10 @@ int subRedDiskReleaseExplosion() ExplodeFieldSP(si); // Explode RedDiskReleasePhase = 0; } - - return subRedDiskReleaseExplosion; } -int subFollowUpExplosions() +void subFollowUpExplosions() { - int subFollowUpExplosions; - int ax, si; // locloop_g_2919: @@ -333,7 +340,6 @@ int subFollowUpExplosions() PlayField16[si] = 0xFF18; ExplodeFieldSP(si); // Explode } - } else { @@ -344,6 +350,4 @@ int subFollowUpExplosions() } } } - - return subFollowUpExplosions; -} // subFollowUpExplosions +}