X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FExplosions.c;h=7729d8448f3dcc7c24e00ff668fad0514298f385;hb=520916c89d7d96944bf3d66e3caa5afd840df74c;hp=0dc2cc71fd0513cd1b3a3d8d31e4d69c5bd0b23c;hpb=1e83803d7c99eb5232eab7d48a4194de3cf6f77f;p=rocksndiamonds.git diff --git a/src/game_sp/Explosions.c b/src/game_sp/Explosions.c index 0dc2cc71..7729d844 100644 --- a/src/game_sp/Explosions.c +++ b/src/game_sp/Explosions.c @@ -4,68 +4,74 @@ #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; - int ax, bl, X, Y; +void subAnimateExplosion(int si) +{ + int ax, bl; 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 +80,19 @@ 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"); -#endif - KillMurphyFlag = 1; + + ExplosionShakeMurphy = 30; // Murphy explodes } if (ax == fiElectron) @@ -112,15 +116,17 @@ 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) { int al; - if (tsi < (-FieldWidth)) + if (tsi < -FieldWidth) return; al = LowByte(PlayField16[tsi]); @@ -152,10 +158,6 @@ static void LetExplodeFieldSP(int tsi, int cx, int dh) break; case fiMurphy: -#if 1 - printf("::: Explosions.c: LetExplodeFieldSP(): kill murphy\n"); -#endif - KillMurphyFlag = 1; PlayField8[tsi] = dh; PlayField16[tsi] = cx; @@ -165,12 +167,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 +210,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 +257,26 @@ 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 +285,9 @@ int subRedDiskReleaseExplosion() // +++++++++++++++++++++++++++++++++++++++++ X = GetStretchX(si); Y = GetStretchY(si); - StretchedSprites.BltEx(X, Y, fiRedDisk); + DDSpriteBuffer_BltImg(X, Y, aniRedDisk, 0); // +++++++++++++++++++++++++++++++++++++++++ + RedDiskReleasePhase = RedDiskReleasePhase + 1; if (RedDiskReleasePhase >= 0x28) { @@ -308,14 +295,10 @@ int subRedDiskReleaseExplosion() ExplodeFieldSP(si); // Explode RedDiskReleasePhase = 0; } - - return subRedDiskReleaseExplosion; } -int subFollowUpExplosions() +void subFollowUpExplosions() { - int subFollowUpExplosions; - int ax, si; // locloop_g_2919: @@ -333,7 +316,6 @@ int subFollowUpExplosions() PlayField16[si] = 0xFF18; ExplodeFieldSP(si); // Explode } - } else { @@ -344,6 +326,4 @@ int subFollowUpExplosions() } } } - - return subFollowUpExplosions; -} // subFollowUpExplosions +}