X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame_sp%2FDoGameStuff.c;h=88434a90dbc64112c2f4b04002fbd5df2572d9b7;hp=458f8aa653075e9f05c2d0aa4c929ba4201a0ec0;hb=3ff2e8a0b5c27b99a9920bdf5ed82bc41bf40181;hpb=0d95c7df5f708c3f30e10cab3894082019f8cd6c diff --git a/src/game_sp/DoGameStuff.c b/src/game_sp/DoGameStuff.c index 458f8aa6..88434a90 100644 --- a/src/game_sp/DoGameStuff.c +++ b/src/game_sp/DoGameStuff.c @@ -4,30 +4,26 @@ #include "DoGameStuff.h" + static void CallAnimation(int si, byte bl); static boolean IsToBeAnimated(int bl); -// static char *VB_Name = "modDoGameStuff"; - -// --- Option Explicit +int AnimationPosTable[SP_MAX_PLAYFIELD_SIZE]; +byte AnimationSubTable[SP_MAX_PLAYFIELD_SIZE]; -int *AnimationPosTable; -byte *AnimationSubTable; // ========================================================================== // SUBROUTINE // Do game stuff // ========================================================================== -int subDoGameStuff() +void subDoGameStuff() { - int subDoGameStuff; - int si, cx, dx, bl; subAnimateMurphy(&MurphyPosIndex); // move Murphy in any direction - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Build a database of locations and subs-to-call of animatable fields only: // Make a snapshot from the field before the animation cycle starts. // first and last line are not animated. @@ -52,7 +48,7 @@ int subDoGameStuff() } while (0 < cx); // locloop_g_2282' until all lines scanned(not top- and bottom edge) - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Now use the database to animate all animatables the fastest way. // All the other fields are not checked anymore: those have no database entry. // The field from before animation is frozen in the database in order not to @@ -66,30 +62,22 @@ int subDoGameStuff() } // loop locloop_g_22B8 ' until all animatables done } -#if 0 - printf("::: DoGameStuff.c: KillMurphyFlag == %d [%d]\n", - KillMurphyFlag, MurphyMoveCounter); -#endif - // All animations are done now - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (KillMurphyFlag == 1 || MurphyMoveCounter == 0) { - if (LeadOutCounter == 0) + if (LeadOutCounter == 0 && + !game_sp.LevelSolved && + !game_sp.GameOver) { -#if 0 - printf("::: DoGameStuff.c: killing murphy [%d] ...\n", KillMurphyFlag); -#endif + KillMurphyFlag = 0; // no more "kill Murphy" + ExplodeFieldSP(MurphyExplodePos); // Explode + LeadOutCounter = 0x40; // quit: start lead-out - KillMurphyFlag = 0; // no more "kill Murphy" - ExplodeFieldSP(MurphyExplodePos); // Explode - LeadOutCounter = 0x40; // quit: start lead-out + /* give Murphy some more time (LeadOutCounter) to reach the exit */ } } // loc_g_22FB: - - - return subDoGameStuff; -} // subDoGameStuff +} static boolean IsToBeAnimated(int bl) {