rnd-20020505-2-src
authorHolger Schemel <info@artsoft.org>
Sun, 5 May 2002 21:29:12 +0000 (23:29 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:37:21 +0000 (10:37 +0200)
src/game.c
src/libgame/setup.c
src/tape.c
src/tape.h
src/timestamp.h

index f898c8ae0b3c0b29d912e1c99e8e4262b25beee5..e83bf4a0ca05dd90b700625b5ddc19dd8f80e58d 100644 (file)
@@ -450,6 +450,14 @@ static void InitField(int x, int y, boolean init_game)
 
 void DrawGameDoorValues()
 {
+  int i, j;
+
+  for (i=0; i<MAX_PLAYERS; i++)
+    for (j=0; j<4; j++)
+      if (stored_player[i].key[j])
+       DrawMiniGraphicExt(drawto, DX_KEYS + j * MINI_TILEX, DY_KEYS,
+                          GFX_SCHLUESSEL1 + j);
+
   DrawText(DX + XX_EMERALDS, DY + YY_EMERALDS,
           int2str(local_player->gems_still_needed, 3), FS_SMALL, FC_YELLOW);
   DrawText(DX + XX_DYNAMITE, DY + YY_DYNAMITE,
@@ -820,18 +828,7 @@ void InitGame()
               DX + XX_LEVEL - 1, DY + YY_LEVEL + 1);
   }
 
-#if 1
   DrawGameDoorValues();
-#else
-  DrawText(DX + XX_EMERALDS, DY + YY_EMERALDS,
-          int2str(local_player->gems_still_needed, 3), FS_SMALL, FC_YELLOW);
-  DrawText(DX + XX_DYNAMITE, DY + YY_DYNAMITE,
-          int2str(local_player->dynamite, 3), FS_SMALL, FC_YELLOW);
-  DrawText(DX + XX_SCORE, DY + YY_SCORE,
-          int2str(local_player->score, 5), FS_SMALL, FC_YELLOW);
-  DrawText(DX + XX_TIME, DY + YY_TIME,
-          int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW);
-#endif
 
   UnmapGameButtons();
   UnmapTapeButtons();
@@ -1005,7 +1002,7 @@ void GameWon()
       PlaySoundExt(SND_GAME_LEVELTIME_BONUS, PSND_MAX_VOLUME, PSND_MAX_RIGHT,
                   PSND_LOOP);
 
-    while(TimeLeft > 0)
+    while (TimeLeft > 0)
     {
       if (!tape.playing && !setup.sound_loops)
        PlaySoundStereo(SND_GAME_LEVELTIME_BONUS, PSND_MAX_RIGHT);
@@ -1031,7 +1028,7 @@ void GameWon()
       PlaySoundExt(SND_GAME_LEVELTIME_BONUS, PSND_MAX_VOLUME, PSND_MAX_RIGHT,
                   PSND_LOOP);
 
-    while(TimePlayed < 999)
+    while (TimePlayed < 999)
     {
       if (!tape.playing && !setup.sound_loops)
        PlaySoundStereo(SND_GAME_LEVELTIME_BONUS, PSND_MAX_RIGHT);
@@ -4835,7 +4832,7 @@ void GameActions()
        for (i=0; i<MAX_PLAYERS; i++)
          KillHero(&stored_player[i]);
     }
-    else if (level.time == 0)          /* level without time limit */
+    else if (level.time == 0 && !AllPlayersGone) /* level without time limit */
       DrawText(DX_TIME, DY_TIME, int2str(TimePlayed, 3), FS_SMALL, FC_YELLOW);
   }
 
@@ -5625,7 +5622,8 @@ int DigField(struct PlayerInfo *player,
     case EL_TRAP_INACTIVE:
     case EL_SP_BASE:
     case EL_SP_BUG:
-      Feld[x][y] = EL_LEERRAUM;
+      RemoveField(x, y);
+
       if (element == EL_LEERRAUM)
        PlaySoundLevel(x, y, SND_EMPTY_SPACE_DIGGING);
       else if (element == EL_ERDREICH)
index 524be341fb412a8b0c3fec3c1a24d91bf9ad8435..7b0189b880f3744e0ff6a0d85137cc7b261bf233 100644 (file)
@@ -80,6 +80,7 @@ static char *levelclass_desc[NUM_LEVELCLASS_DESC] =
                         9)
 
 #define TOKEN_VALUE_POSITION           40
+#define TOKEN_COMMENT_POSITION         60
 
 #define MAX_COOKIE_LEN                 256
 
@@ -1927,7 +1928,9 @@ char *getSetupLine(struct TokenInfo *token_info, char *prefix, int token_nr)
     if (strcmp(keyname, "(undefined)") != 0 &&
        strcmp(keyname, "(unknown)") != 0)
     {
-      for (i=strlen(entry); i<50; i++)
+      /* add at least one whitespace */
+      strcat(entry, " ");
+      for (i=strlen(entry); i<TOKEN_COMMENT_POSITION; i++)
        strcat(entry, " ");
 
       strcat(entry, "# ");
index 73e73a7de5616c496ac0bebfd75d35325adaf3c7..3c39d5abc17c3c9e99ea3726d22c666ac004cc00 100644 (file)
@@ -35,6 +35,7 @@
 
 /* forward declaration for internal use */
 static void HandleTapeButtons(struct GadgetInfo *);
+static void TapeStopIndexSearch();
 
 static struct GadgetInfo *tape_gadget[NUM_TAPE_BUTTONS];
 
@@ -468,13 +469,7 @@ void TapeTogglePause(boolean toggle_manual)
 
   if (tape.index_search)
   {
-    tape.index_search = FALSE;
-
-    SetDrawDeactivationMask(REDRAW_NONE);
-    audio.sound_deactivated = FALSE;
-
-    RedrawPlayfield(TRUE, 0,0,0,0);
-    DrawGameDoorValues();
+    TapeStopIndexSearch();
 
     if (tape.quick_resume)
     {
@@ -524,6 +519,9 @@ void TapeStopPlaying()
   tape.playing = FALSE;
   tape.pausing = FALSE;
 
+  if (tape.index_search)
+    TapeStopIndexSearch();
+
   DrawVideoDisplay(VIDEO_STATE_PLAY_OFF, 0);
   MapTapeEjectButton();
 }
@@ -603,7 +601,7 @@ unsigned int GetTapeLength()
   return(tape_length * GAME_FRAME_DELAY / 1000);
 }
 
-void TapeIndexSearch()
+static void TapeStartIndexSearch()
 {
   tape.index_search = TRUE;
 
@@ -616,7 +614,18 @@ void TapeIndexSearch()
   }
 }
 
-void TapeSingleStep()
+static void TapeStopIndexSearch()
+{
+  tape.index_search = FALSE;
+
+  SetDrawDeactivationMask(REDRAW_NONE);
+  audio.sound_deactivated = FALSE;
+
+  RedrawPlayfield(TRUE, 0,0,0,0);
+  DrawGameDoorValues();
+}
+
+static void TapeSingleStep()
 {
   if (options.network)
     return;
@@ -654,7 +663,7 @@ void TapeQuickLoad()
     if (!TAPE_IS_EMPTY(tape))
     {
       TapeStartGamePlaying();
-      TapeIndexSearch();
+      TapeStartIndexSearch();
 
       tape.quick_resume = TRUE;
     }
@@ -823,7 +832,7 @@ static void HandleTapeButtons(struct GadgetInfo *gi)
 
     case TAPE_CTRL_ID_INDEX:
       if (tape.playing)
-       TapeIndexSearch();
+       TapeStartIndexSearch();
       else if (tape.recording)
        TapeSingleStep();
       break;
index a3743d38115ec350ea2ab83c280c94778a9c64a0..3617700a3f3a914d62fda499493b61932124f922 100644 (file)
@@ -95,7 +95,6 @@ byte *TapePlayAction(void);
 void TapeStop(void);
 void TapeErase(void);
 unsigned int GetTapeLength(void);
-void TapeIndexSearch(void);
 void TapeQuickSave(void);
 void TapeQuickLoad(void);
 
index b823a66879e5db85c0b1704317e98bea0c6db2b2..3fbd9303871eb6dd3ee062e05f02b9f8f5d41b29 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2002-05-05 20:35]"
+#define COMPILE_DATE_STRING "[2002-05-05 23:27]"