rnd-20030817-1-src
authorHolger Schemel <info@artsoft.org>
Sun, 17 Aug 2003 00:41:00 +0000 (02:41 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:43:16 +0000 (10:43 +0200)
CHANGES
src/conftime.h
src/files.c
src/game.c
src/init.c
src/libgame/setup.c
src/libgame/system.h
src/tools.c

diff --git a/CHANGES b/CHANGES
index 0825e0a042fa9a92c957849f7668b14c0df8be98..3167146238805fae0024fc031e368ac8d209e348 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,8 @@
 Release Version 3.0.1 [?? ??? ????]
 -----------------------------------
-       - fixed bug with missing graphic for active red disk bomb
        - fixed bug which caused a crash at startup under Solaris
+       - fixed bug which caused the DOS version not finding its files
+       - fixed bug with missing graphic for active red disk bomb
        - added custom element property for dropping collected elements
        - added another 128 custom elements for those who can't get enough
 
index fab6f3d60731365bce3a71de32babc76e6e58e66..b22f073a97d7f723f1cc07dd5a1aa9699a26b475 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-08-16 20:51]"
+#define COMPILE_DATE_STRING "[2003-08-17 02:36]"
index 30bd8666d752ec79e8e66d5f60551c72df29afa1..358333a474f74da747c2fa25a0f87d7cba8ed2f1 100644 (file)
@@ -1971,9 +1971,9 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->fullscreen = FALSE;
   si->ask_on_escape = TRUE;
 
-  si->graphics_set = getStringCopy(GRAPHICS_SUBDIR);
-  si->sounds_set = getStringCopy(SOUNDS_SUBDIR);
-  si->music_set = getStringCopy(MUSIC_SUBDIR);
+  si->graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR);
+  si->sounds_set = getStringCopy(SND_CLASSIC_SUBDIR);
+  si->music_set = getStringCopy(MUS_CLASSIC_SUBDIR);
   si->override_level_graphics = FALSE;
   si->override_level_sounds = FALSE;
   si->override_level_music = FALSE;
index 5956c7d899ca466076188317e162b2fbad6382b1..1aef43abbb1143e3ac3952850e5f6aacb438dc3c 100644 (file)
@@ -1237,7 +1237,7 @@ void InitGame()
       if (CAN_CHANGE(element))
       {
        content = element_info[element].change.target_element;
-       is_player = (ELEM_IS_PLAYER(content) || content == EL_SP_MURPHY);
+       is_player = ELEM_IS_PLAYER(content);
 
        if (is_player && (found_rating < 3 || element < found_element))
        {
@@ -1252,7 +1252,7 @@ void InitGame()
       for(yy=0; yy < 3; yy++) for(xx=0; xx < 3; xx++)
       {
        content = element_info[element].content[xx][yy];
-       is_player = (ELEM_IS_PLAYER(content) || content == EL_SP_MURPHY);
+       is_player = ELEM_IS_PLAYER(content);
 
        if (is_player && (found_rating < 2 || element < found_element))
        {
@@ -1267,7 +1267,7 @@ void InitGame()
          continue;
 
        content = element_info[element].change.content[xx][yy];
-       is_player = (ELEM_IS_PLAYER(content) || content == EL_SP_MURPHY);
+       is_player = ELEM_IS_PLAYER(content);
 
        if (is_player && (found_rating < 1 || element < found_element))
        {
@@ -6586,6 +6586,7 @@ void ScrollFigure(struct PlayerInfo *player, int mode)
     if (Feld[jx][jy] == EL_EXIT_OPEN ||
        Feld[jx][jy] == EL_SP_EXIT_OPEN)
     {
+      DrawPlayer(player);      /* needed here only to cleanup last field */
       RemoveHero(player);
 
       if (local_player->friends_still_needed == 0 ||
index bb214b604b24112384b946c6b3881cf6b5533d25..947d0ef0d4c1aec6d10836a1b4fc26b39e9932a7 100644 (file)
@@ -548,6 +548,34 @@ void InitElementGraphicInfo()
     }
   }
 
+#if 1
+  /* now set all undefined/invalid graphics to -1 to set to default after it */
+  for (i=0; i<MAX_NUM_ELEMENTS; i++)
+  {
+    for (act=0; act<NUM_ACTIONS; act++)
+    {
+      if (graphic_info[element_info[i].graphic[act]].bitmap == NULL)
+       element_info[i].graphic[act] = -1;
+
+      if (graphic_info[element_info[i].crumbled[act]].bitmap == NULL)
+       element_info[i].crumbled[act] = -1;
+
+      for (dir=0; dir<NUM_DIRECTIONS; dir++)
+      {
+       int graphic;
+
+       graphic = element_info[i].direction_graphic[act][dir];
+       if (graphic_info[graphic].bitmap == NULL)
+         element_info[i].direction_graphic[act][dir] = -1;
+
+       graphic = element_info[i].direction_crumbled[act][dir];
+       if (graphic_info[graphic].bitmap == NULL)
+         element_info[i].direction_crumbled[act][dir] = -1;
+      }
+    }
+  }
+#endif
+
   /* now set all '-1' values to element specific default values */
   for (i=0; i<MAX_NUM_ELEMENTS; i++)
   {
@@ -576,9 +604,9 @@ void InitElementGraphicInfo()
 
     for (act=0; act<NUM_ACTIONS; act++)
     {
-      boolean act_remove = (act == ACTION_DIGGING ||
-                           act == ACTION_SNAPPING ||
-                           act == ACTION_COLLECTING);
+      boolean act_remove = ((IS_DIGGABLE(i)    && act == ACTION_DIGGING)  ||
+                           (IS_SNAPPABLE(i)   && act == ACTION_SNAPPING) ||
+                           (IS_COLLECTIBLE(i) && act == ACTION_COLLECTING));
 
       /* generic default action graphic (defined by "[default]" directive) */
       int default_action_graphic = element_info[EL_DEFAULT].graphic[act];
@@ -693,6 +721,15 @@ void InitElementSpecialGraphicInfo()
     if (special >= 0 && special < NUM_SPECIAL_GFX_ARGS)
       element_info[element].special_graphic[special] = graphic;
   }
+
+#if 1
+  /* now set all undefined/invalid graphics to default */
+  for (i=0; i < MAX_NUM_ELEMENTS; i++)
+    for (j=0; j < NUM_SPECIAL_GFX_ARGS; j++)
+      if (graphic_info[element_info[i].special_graphic[j]].bitmap == NULL)
+       element_info[i].special_graphic[j] =
+         element_info[i].graphic[ACTION_DEFAULT];
+#endif
 }
 
 static int get_element_from_token(char *token)
@@ -878,8 +915,9 @@ static void InitGraphicInfo()
     int src_x, src_y;
     int first_frame, last_frame;
 
-#if 0
-    printf("::: image: '%s'\n", image->token);
+#if 1
+    if (strcmp(image->token, "dynamite.EDITOR") == 0)
+      printf("::: image: '%s' [%d]\n", image->token, i);
 #endif
 
 #if 0
@@ -892,6 +930,11 @@ static void InitGraphicInfo()
 
     /* now check if no animation frames are outside of the loaded image */
 
+#if 1
+    if (graphic_info[i].bitmap == NULL)
+      printf("::: graphic_info['%s'].bitmap == NULL\n", image->token);
+#endif
+
     if (graphic_info[i].bitmap == NULL)
       continue;                /* skip check for optional images that are undefined */
 
@@ -1774,6 +1817,7 @@ void InitElementPropertiesStatic()
     EL_PLAYER_2,
     EL_PLAYER_3,
     EL_PLAYER_4,
+    EL_SP_MURPHY,
     -1
   };
 
@@ -3497,6 +3541,7 @@ void OpenAll()
   InitEventFilter(FilterMouseMotionEvents);
 
   InitElementPropertiesStatic();
+  InitElementPropertiesEngine(GAME_VERSION_ACTUAL);
 
   InitGfx();
 
index f0fbd60f3dc51c43ee6a62af47486917f035d616..2a5eb1ab12cdb0263a589a056082606f0e816c5a 100644 (file)
@@ -270,19 +270,19 @@ static char *getDefaultMusicDir(char *music_subdir)
 
 static char *getDefaultArtworkSet(int type)
 {
-  return (type == TREE_TYPE_GRAPHICS_DIR ? GRAPHICS_SUBDIR :
-         type == TREE_TYPE_SOUNDS_DIR   ? SOUNDS_SUBDIR   :
-         type == TREE_TYPE_MUSIC_DIR    ? MUSIC_SUBDIR    : "");
+  return (type == TREE_TYPE_GRAPHICS_DIR ? GFX_CLASSIC_SUBDIR :
+         type == TREE_TYPE_SOUNDS_DIR   ? SND_CLASSIC_SUBDIR :
+         type == TREE_TYPE_MUSIC_DIR    ? MUS_CLASSIC_SUBDIR : "");
 }
 
 static char *getDefaultArtworkDir(int type)
 {
   return (type == TREE_TYPE_GRAPHICS_DIR ?
-         getDefaultGraphicsDir(GRAPHICS_SUBDIR) :
+         getDefaultGraphicsDir(GFX_CLASSIC_SUBDIR) :
          type == TREE_TYPE_SOUNDS_DIR ?
-         getDefaultSoundsDir(SOUNDS_SUBDIR) :
+         getDefaultSoundsDir(SND_CLASSIC_SUBDIR) :
          type == TREE_TYPE_MUSIC_DIR ?
-         getDefaultMusicDir(MUSIC_SUBDIR) : "");
+         getDefaultMusicDir(MUS_CLASSIC_SUBDIR) : "");
 }
 
 static char *getUserGraphicsDir()
@@ -448,7 +448,7 @@ char *getSetupFilename()
   return filename;
 }
 
-static char *getCorrectedImageBasename(char *basename)
+static char *getCorrectedArtworkBasename(char *basename)
 {
   char *basename_corrected = basename;
 
@@ -463,7 +463,7 @@ static char *getCorrectedImageBasename(char *basename)
     /* if corrected filename is still longer than standard MS-DOS filename
        size (8 characters + 1 dot + 3 characters file extension), shorten
        filename by writing file extension after 8th basename character */
-    if (strlen(basename_corrected) > 8+1+3)
+    if (strlen(basename_corrected) > 8 + 1 + 3)
     {
       static char *msdos_filename = NULL;
 
@@ -471,7 +471,9 @@ static char *getCorrectedImageBasename(char *basename)
        free(msdos_filename);
 
       msdos_filename = getStringCopy(basename_corrected);
-      strncpy(&msdos_filename[8], &basename[strlen(basename) - 1+3], 1+3 + 1);
+      strncpy(&msdos_filename[8], &basename[strlen(basename) - (1+3)], 1+3 +1);
+
+      basename_corrected = msdos_filename;
     }
   }
 #endif
@@ -487,7 +489,7 @@ char *getCustomImageFilename(char *basename)
   if (filename != NULL)
     free(filename);
 
-  basename = getCorrectedImageBasename(basename);
+  basename = getCorrectedArtworkBasename(basename);
 
   if (!setup.override_level_graphics)
   {
@@ -524,7 +526,7 @@ char *getCustomImageFilename(char *basename)
   }
 
   /* 4th try: look for default artwork in new default artwork directory */
-  filename = getPath2(getDefaultGraphicsDir(GRAPHICS_SUBDIR), basename);
+  filename = getPath2(getDefaultGraphicsDir(GFX_CLASSIC_SUBDIR), basename);
   if (fileExists(filename))
     return filename;
 
@@ -546,6 +548,8 @@ char *getCustomSoundFilename(char *basename)
   if (filename != NULL)
     free(filename);
 
+  basename = getCorrectedArtworkBasename(basename);
+
   if (!setup.override_level_sounds)
   {
     /* 1st try: look for special artwork in current level series directory */
@@ -581,7 +585,7 @@ char *getCustomSoundFilename(char *basename)
   }
 
   /* 4th try: look for default artwork in new default artwork directory */
-  filename = getPath2(getDefaultSoundsDir(SOUNDS_SUBDIR), basename);
+  filename = getPath2(getDefaultSoundsDir(SND_CLASSIC_SUBDIR), basename);
   if (fileExists(filename))
     return filename;
 
@@ -665,7 +669,7 @@ char *getCustomMusicDirectory(void)
   }
 
   /* 4th try: look for default artwork in new default artwork directory */
-  directory = getStringCopy(getDefaultMusicDir(MUSIC_SUBDIR));
+  directory = getStringCopy(getDefaultMusicDir(MUS_CLASSIC_SUBDIR));
   if (fileExists(directory))
     return directory;
 
@@ -2169,7 +2173,7 @@ void LoadArtworkInfo()
     getTreeInfoFromIdentifier(artwork.gfx_first, setup.graphics_set);
   if (artwork.gfx_current == NULL)
     artwork.gfx_current =
-      getTreeInfoFromIdentifier(artwork.gfx_first, GRAPHICS_SUBDIR);
+      getTreeInfoFromIdentifier(artwork.gfx_first, GFX_CLASSIC_SUBDIR);
   if (artwork.gfx_current == NULL)
     artwork.gfx_current = getFirstValidTreeInfoEntry(artwork.gfx_first);
 
@@ -2177,7 +2181,7 @@ void LoadArtworkInfo()
     getTreeInfoFromIdentifier(artwork.snd_first, setup.sounds_set);
   if (artwork.snd_current == NULL)
     artwork.snd_current =
-      getTreeInfoFromIdentifier(artwork.snd_first, SOUNDS_SUBDIR);
+      getTreeInfoFromIdentifier(artwork.snd_first, SND_CLASSIC_SUBDIR);
   if (artwork.snd_current == NULL)
     artwork.snd_current = getFirstValidTreeInfoEntry(artwork.snd_first);
 
@@ -2185,7 +2189,7 @@ void LoadArtworkInfo()
     getTreeInfoFromIdentifier(artwork.mus_first, setup.music_set);
   if (artwork.mus_current == NULL)
     artwork.mus_current =
-      getTreeInfoFromIdentifier(artwork.mus_first, MUSIC_SUBDIR);
+      getTreeInfoFromIdentifier(artwork.mus_first, MUS_CLASSIC_SUBDIR);
   if (artwork.mus_current == NULL)
     artwork.mus_current = getFirstValidTreeInfoEntry(artwork.mus_first);
 
@@ -2272,7 +2276,7 @@ void LoadLevelArtworkInfo()
       getTreeInfoFromIdentifier(artwork.gfx_first, setup.graphics_set);
     if (artwork.gfx_current == NULL)
       artwork.gfx_current =
-       getTreeInfoFromIdentifier(artwork.gfx_first, GRAPHICS_SUBDIR);
+       getTreeInfoFromIdentifier(artwork.gfx_first, GFX_CLASSIC_SUBDIR);
     if (artwork.gfx_current == NULL)
       artwork.gfx_current = getFirstValidTreeInfoEntry(artwork.gfx_first);
   }
@@ -2283,7 +2287,7 @@ void LoadLevelArtworkInfo()
       getTreeInfoFromIdentifier(artwork.snd_first, setup.sounds_set);
     if (artwork.snd_current == NULL)
       artwork.snd_current =
-       getTreeInfoFromIdentifier(artwork.snd_first, SOUNDS_SUBDIR);
+       getTreeInfoFromIdentifier(artwork.snd_first, SND_CLASSIC_SUBDIR);
     if (artwork.snd_current == NULL)
       artwork.snd_current = getFirstValidTreeInfoEntry(artwork.snd_first);
   }
@@ -2294,7 +2298,7 @@ void LoadLevelArtworkInfo()
       getTreeInfoFromIdentifier(artwork.mus_first, setup.music_set);
     if (artwork.mus_current == NULL)
       artwork.mus_current =
-       getTreeInfoFromIdentifier(artwork.mus_first, MUSIC_SUBDIR);
+       getTreeInfoFromIdentifier(artwork.mus_first, MUS_CLASSIC_SUBDIR);
     if (artwork.mus_current == NULL)
       artwork.mus_current = getFirstValidTreeInfoEntry(artwork.mus_first);
   }
@@ -2336,9 +2340,9 @@ static void SaveUserLevelInfo()
   ldi.first_level = 1;
   ldi.sort_priority = LEVELCLASS_USER_START;
   ldi.readonly = FALSE;
-  setString(&ldi.graphics_set, GRAPHICS_SUBDIR);
-  setString(&ldi.sounds_set, SOUNDS_SUBDIR);
-  setString(&ldi.music_set, MUSIC_SUBDIR);
+  setString(&ldi.graphics_set, GFX_CLASSIC_SUBDIR);
+  setString(&ldi.sounds_set,   SND_CLASSIC_SUBDIR);
+  setString(&ldi.music_set,    MUS_CLASSIC_SUBDIR);
 #else
   ldi.name = getStringCopy(getLoginName());
   ldi.author = getStringCopy(getRealName());
@@ -2346,9 +2350,9 @@ static void SaveUserLevelInfo()
   ldi.first_level = 1;
   ldi.sort_priority = LEVELCLASS_USER_START;
   ldi.readonly = FALSE;
-  ldi.graphics_set = getStringCopy(GRAPHICS_SUBDIR);
-  ldi.sounds_set = getStringCopy(SOUNDS_SUBDIR);
-  ldi.music_set = getStringCopy(MUSIC_SUBDIR);
+  ldi.graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR);
+  ldi.sounds_set = getStringCopy(SND_CLASSIC_SUBDIR);
+  ldi.music_set = getStringCopy(MUS_CLASSIC_SUBDIR);
 #endif
 
   fprintf(file, "%s\n\n", getFormattedSetupEntry(TOKEN_STR_FILE_IDENTIFIER,
index f51df0548596588c4713ba7bb289b242756f23d0..a9f1efa1786ad01efeb85cb7b8d2321da3640dee 100644 (file)
 #define DOCS_DIRECTORY         "docs"
 
 #if !defined(PLATFORM_MSDOS)
-#define GRAPHICS_SUBDIR                "gfx_classic"
-#define SOUNDS_SUBDIR          "snd_classic"
-#define MUSIC_SUBDIR           "mus_classic"
+#define GFX_CLASSIC_SUBDIR     "gfx_classic"
+#define SND_CLASSIC_SUBDIR     "snd_classic"
+#define MUS_CLASSIC_SUBDIR     "mus_classic"
 #else
-#define GRAPHICS_SUBDIR                "gfx_orig"
-#define SOUNDS_SUBDIR          "snd_orig"
-#define MUSIC_SUBDIR           "mus_orig"
+#define GFX_CLASSIC_SUBDIR     "gfx_orig"
+#define SND_CLASSIC_SUBDIR     "snd_orig"
+#define MUS_CLASSIC_SUBDIR     "mus_orig"
 #endif
 
 
index 9b5873b5cc3a920c636bb21ec8bab50e7b76fec6..45d37436a325dec9840a38644e2fba606f3d4208 100644 (file)
@@ -1882,6 +1882,8 @@ boolean Request(char *text, unsigned int req_state)
 
   SetDrawBackgroundMask(REDRAW_FIELD | REDRAW_DOOR_1);
 
+  SetMouseCursor(CURSOR_DEFAULT);
+
   while(result < 0)
   {
     if (PendingEvent())