rnd-20061029-1-src
authorHolger Schemel <info@artsoft.org>
Sun, 29 Oct 2006 19:26:55 +0000 (20:26 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:53:35 +0000 (10:53 +0200)
src/conftime.h
src/game.c
src/init.c
src/libgame/setup.c
src/screens.c
src/tools.c

index 4490d2ae7ebd77a67214fd91c1eff00b7266b5c5..d52d0e34fe45539c7da35bd383481a022c60c11b 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-10-28 22:48]"
+#define COMPILE_DATE_STRING "[2006-10-29 20:25]"
index f0875a7a1d49fefefeb72cd8cad48bfe3a2b4366..61d5d6b2f313b7586c73527b7bafd7a19da749dd 100644 (file)
@@ -2734,35 +2734,38 @@ void GameWon()
       DrawGameValue_Score(score);
     }
 
-    if (ExitX >= 0 && ExitY >= 0)      /* local player has left the level */
+    if (level.game_engine_type == GAME_ENGINE_TYPE_RND)
     {
-      /* close exit door after last player */
-      if (AllPlayersGone &&
-         (Feld[ExitX][ExitY] == EL_EXIT_OPEN ||
-          Feld[ExitX][ExitY] == EL_SP_EXIT_OPEN))
+      if (ExitX >= 0 && ExitY >= 0)    /* local player has left the level */
       {
-       int element = Feld[ExitX][ExitY];
-
-       Feld[ExitX][ExitY] = (element == EL_EXIT_OPEN ? EL_EXIT_CLOSING :
-                             EL_SP_EXIT_CLOSING);
+       /* close exit door after last player */
+       if (AllPlayersGone &&
+           (Feld[ExitX][ExitY] == EL_EXIT_OPEN ||
+            Feld[ExitX][ExitY] == EL_SP_EXIT_OPEN))
+       {
+         int element = Feld[ExitX][ExitY];
 
-       PlayLevelSoundElementAction(ExitX, ExitY, element, ACTION_CLOSING);
-      }
+         Feld[ExitX][ExitY] = (element == EL_EXIT_OPEN ? EL_EXIT_CLOSING :
+                               EL_SP_EXIT_CLOSING);
 
-      /* player disappears */
-      DrawLevelField(ExitX, ExitY);
-    }
+         PlayLevelSoundElementAction(ExitX, ExitY, element, ACTION_CLOSING);
+       }
 
-    for (i = 0; i < MAX_PLAYERS; i++)
-    {
-      struct PlayerInfo *player = &stored_player[i];
+       /* player disappears */
+       DrawLevelField(ExitX, ExitY);
+      }
 
-      if (player->present)
+      for (i = 0; i < MAX_PLAYERS; i++)
       {
-       RemovePlayer(player);
+       struct PlayerInfo *player = &stored_player[i];
 
-       /* player disappears */
-       DrawLevelField(player->jx, player->jy);
+       if (player->present)
+       {
+         RemovePlayer(player);
+
+         /* player disappears */
+         DrawLevelField(player->jx, player->jy);
+       }
       }
     }
 
index ee3a1552501dc795292f30884c4af9d54fd45189..aabc7026b630dd834afa213b6a4685ac9c16cf95 100644 (file)
@@ -4572,7 +4572,11 @@ void InitGfx()
 
   font_height = getFontHeight(FC_RED);
 
+#if 1
+  DrawInitText(getWindowTitleString(), 20, FC_YELLOW);
+#else
   DrawInitText(getProgramInitString(), 20, FC_YELLOW);
+#endif
   DrawInitText(PROGRAM_COPYRIGHT_STRING, 50, FC_RED);
   DrawInitText(PROGRAM_WEBSITE_STRING, WIN_YSIZE - 20 - font_height, FC_RED);
 
index 4f00449473f8cadcb520d70c9a0ea542c40f4797..d599d1c794c0082a0715aeb9fc42a3f1a11b07ff 100644 (file)
@@ -92,6 +92,8 @@ static int compareTreeInfoEntries(const void *, const void *);
 static int token_value_position   = TOKEN_VALUE_POSITION_DEFAULT;
 static int token_comment_position = TOKEN_COMMENT_POSITION_DEFAULT;
 
+static SetupFileHash *level_artwork_info_hash = NULL;
+
 
 /* ------------------------------------------------------------------------- */
 /* file functions                                                            */
@@ -1704,6 +1706,27 @@ static void *loadSetupFileData(char *filename, boolean use_hash)
   return setup_file_data;
 }
 
+void saveSetupFileHash(SetupFileHash *hash, char *filename)
+{
+  FILE *file;
+
+  if (!(file = fopen(filename, MODE_WRITE)))
+  {
+    Error(ERR_WARN, "cannot write configuration file '%s'", filename);
+
+    return;
+  }
+
+  BEGIN_HASH_ITERATION(hash, itr)
+  {
+    fprintf(file, "%s\n", getFormattedSetupEntry(HASH_ITERATION_TOKEN(itr),
+                                                HASH_ITERATION_VALUE(itr)));
+  }
+  END_HASH_ITERATION(hash, itr)
+
+  fclose(file);
+}
+
 SetupFileList *loadSetupFileList(char *filename)
 {
   return (SetupFileList *)loadSetupFileData(filename, FALSE);
@@ -2652,6 +2675,20 @@ void LoadLevelArtworkInfo()
 {
   DrawInitText("Looking for custom level artwork:", 120, FC_GREEN);
 
+#if 0
+  if (level_artwork_info_hash == NULL)
+  {
+    char *filename = getPath2(getSetupDir(), "test.conf");
+
+    level_artwork_info_hash = loadSetupFileHash(filename);
+
+    if (level_artwork_info_hash == NULL)
+      level_artwork_info_hash = newSetupFileHash();
+
+    free(filename);
+  }
+#endif
+
   LoadArtworkInfoFromLevelInfo(&artwork.gfx_first, leveldir_first_all);
   LoadArtworkInfoFromLevelInfo(&artwork.snd_first, leveldir_first_all);
   LoadArtworkInfoFromLevelInfo(&artwork.mus_first, leveldir_first_all);
index 0d297f6cecff9908e02f6c95047ab8b3d71bd76a..175e59fc73e38f62e953359f619237d188cbf676 100644 (file)
@@ -2561,10 +2561,17 @@ static void drawChooseTreeList(int first_entry, int num_page_entries,
   /* force LEVELS font on artwork setup screen */
   game_status = GAME_MODE_LEVELS;
 
+#if 1
+  /* clear tree list area, but not title or scrollbar */
+  DrawBackground(mSX, mSY + MENU_SCREEN_START_YPOS * 32,
+                SC_SCROLLBAR_XPOS + menu.scrollbar_xoffset,
+                NUM_MENU_ENTRIES_ON_SCREEN * 32);
+#else
   /* clear tree list area, but not title or scrollbar */
   DrawBackground(mSX, mSY + MENU_SCREEN_START_YPOS * 32,
                 SC_SCROLLBAR_XPOS + menu.scrollbar_xoffset,
                 MAX_MENU_ENTRIES_ON_SCREEN * 32);
+#endif
 
   for (i = 0; i < num_page_entries; i++)
   {
index ddc8353b5c9da4a33b9d0caa3d3911f3690ac87d..415935a4ed98f9772989edf5f8bd2c6f62b2f0c6 100644 (file)
@@ -274,7 +274,7 @@ void BackToFront()
 
   if (redraw_mask & REDRAW_TILES &&
       game_status == GAME_MODE_PLAYING &&
-      border.draw_masked[game_status])
+      border.draw_masked[GAME_MODE_PLAYING])
     redraw_mask |= REDRAW_FIELD;
 
   if (global.fps_slowdown && game_status == GAME_MODE_PLAYING)
@@ -315,7 +315,10 @@ void BackToFront()
   SyncDisplay();
 
 #if 1
-  DrawMaskedBorder(redraw_mask);
+  if (game_status != GAME_MODE_PLAYING ||
+      redraw_mask & REDRAW_FROM_BACKBUFFER ||
+      buffer == backbuffer)
+    DrawMaskedBorder(redraw_mask);
 #endif
 
   if (redraw_mask & REDRAW_ALL)
@@ -333,9 +336,6 @@ void BackToFront()
     if (game_status != GAME_MODE_PLAYING ||
        redraw_mask & REDRAW_FROM_BACKBUFFER)
     {
-#if 0
-      DrawMaskedBorder(REDRAW_FIELD);
-#endif
       BlitBitmap(backbuffer, window,
                 REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE, REAL_SX, REAL_SY);
     }
@@ -354,21 +354,22 @@ void BackToFront()
          ABS(ScreenMovPos) == ScrollStepSize ||
          redraw_tiles > REDRAWTILES_THRESHOLD)
       {
-#if 1
-       if (border.draw_masked[GFX_SPECIAL_ARG_MAIN])
+       if (border.draw_masked[GAME_MODE_PLAYING])
        {
-         BlitBitmap(buffer, backbuffer, fx, fy, SXSIZE, SYSIZE, SX, SY);
+         if (buffer != backbuffer)
+         {
+           BlitBitmap(buffer, backbuffer, fx, fy, SXSIZE, SYSIZE, SX, SY);
+           DrawMaskedBorder(REDRAW_FIELD);
+         }
 
-         DrawMaskedBorder(REDRAW_FIELD);
          BlitBitmap(backbuffer, window,
                     REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,
                     REAL_SX, REAL_SY);
        }
        else
+       {
          BlitBitmap(buffer, window, fx, fy, SXSIZE, SYSIZE, SX, SY);
-#else
-       BlitBitmap(buffer, window, fx, fy, SXSIZE, SYSIZE, SX, SY);
-#endif
+       }
 
 #if 0
 #ifdef DEBUG
@@ -392,28 +393,13 @@ void BackToFront()
   if (redraw_mask & REDRAW_DOORS)
   {
     if (redraw_mask & REDRAW_DOOR_1)
-    {
-#if 0
-      DrawMaskedBorder(REDRAW_DOOR_1);
-#endif
       BlitBitmap(backbuffer, window, DX, DY, DXSIZE, DYSIZE, DX, DY);
-    }
 
     if (redraw_mask & REDRAW_DOOR_2)
-    {
-#if 0
-      DrawMaskedBorder(REDRAW_DOOR_2);
-#endif
       BlitBitmap(backbuffer, window, VX, VY, VXSIZE, VYSIZE, VX, VY);
-    }
 
     if (redraw_mask & REDRAW_DOOR_3)
-    {
-#if 0
-      DrawMaskedBorder(REDRAW_DOOR_3);
-#endif
       BlitBitmap(backbuffer, window, EX, EY, EXSIZE, EYSIZE, EX, EY);
-    }
 
     redraw_mask &= ~REDRAW_DOORS;
   }