rnd-20060121-2-src
authorHolger Schemel <info@artsoft.org>
Sat, 21 Jan 2006 15:51:39 +0000 (16:51 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:50:32 +0000 (10:50 +0200)
src/conf_gfx.c
src/conftime.h
src/files.c
src/game.c
src/init.c
src/libgame/system.h
src/main.c
src/main.h
src/screens.c
src/tools.c

index a85fa0e8699e44baa6b3502e997944495e48b274..52f0f135d05056f9950bc85de8255bac0cbe8430 100644 (file)
@@ -3668,13 +3668,13 @@ struct ConfigInfo image_config[] =
   /* !!! TEMPORARILY STORED HERE -- PROBABLY TO BE CHANGED !!! */
 
   /* (for testing, change filename back to "emc_object dot pcx") */
-  { "emc_object",                              "RocksEMC.pcx"          },
+  { "emc_object",                              "emc_object.pcx"        },
 #if 0
   { "emc_object.scale_up_factor",              "2"                     },
 #endif
 
   /* (for testing, change filename back to "emc_sprite dot pcx") */
-  { "emc_sprite",                              "RocksEMC.pcx"          },
+  { "emc_sprite",                              "emc_sprite.pcx"        },
 #if 0
   { "emc_sprite.scale_up_factor",              "2"                     },
 #endif
index acf6db27e90d80b242f4131d70d0f837cf81ec39..a8f32364a2d671e4db0bf88bc5435cb0bacc0d9c 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-01-20 03:45]"
+#define COMPILE_DATE_STRING "[2006-01-21 16:50]"
index 39ecf24b895c5143c1960a50d3212800785eab2c..6b395bf0cd7e8c1eed3b49a382ef5c1ab8e88d11 100644 (file)
@@ -5698,7 +5698,7 @@ void LoadHelpAnimInfo()
                 i_to_a(element_action_info[i].value));
 
   /* do not store direction index (bit) here, but direction value! */
-  for (i = 0; i < NUM_DIRECTIONS; i++)
+  for (i = 0; i < NUM_DIRECTIONS_FULL; i++)
     setHashEntry(direction_hash, element_direction_info[i].suffix,
                 i_to_a(1 << element_direction_info[i].value));
 
index e1cd4686b61546bee5012001111e375367633ae0..8cbcc8ee4e3873a8011decd0c3b72f185d70e72d 100644 (file)
@@ -4905,7 +4905,7 @@ inline static void TurnRoundExt(int x, int y)
       int start_pos = check_pos[MovDir[x][y] & 0x0f];
       int i;
 
-      MovDelay[x][y] = level.android_move_time;
+      MovDelay[x][y] = level.android_move_time * 8 + 1;
 
       if (start_pos < 0)       /* (should never happen) */
        return;
@@ -5177,7 +5177,7 @@ static void TurnRound(int x, int y)
     GfxFrame[x][y] = 0;
 
   if (MovDelay[x][y])
-    GfxAction[x][y] = ACTION_TURNING_FROM_LEFT + MV_DIR_BIT(direction);
+    GfxAction[x][y] = ACTION_TURNING_FROM_LEFT + MV_DIR_TO_BIT(direction);
 }
 
 static boolean JustBeingPushed(int x, int y)
@@ -10368,7 +10368,7 @@ void RemovePlayer(struct PlayerInfo *player)
 static void setFieldForSnapping(int x, int y, int element, int direction)
 {
   struct ElementInfo *ei = &element_info[element];
-  int direction_bit = MV_DIR_BIT(direction);
+  int direction_bit = MV_DIR_TO_BIT(direction);
   int graphic_snapping = ei->direction_graphic[ACTION_SNAPPING][direction_bit];
   int action = (graphic_snapping != IMG_EMPTY_SPACE ? ACTION_SNAPPING :
                IS_DIGGABLE(element) ? ACTION_DIGGING : ACTION_COLLECTING);
index 02fef9059f1a4233c8983b33cfc07d68b06f1377..dd2296b8a01f1d5d7d336dc55540407735b62021 100644 (file)
@@ -320,7 +320,7 @@ void InitElementGraphicInfo()
       element_info[i].graphic[act] = -1;
       element_info[i].crumbled[act] = -1;
 
-      for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+      for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
       {
        element_info[i].direction_graphic[act][dir] = -1;
        element_info[i].direction_crumbled[act][dir] = -1;
@@ -404,7 +404,7 @@ void InitElementGraphicInfo()
     if (crumbled)
     {
       if (direction < 0)
-       for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+       for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
          element_info[element].direction_crumbled[action][dir] = -1;
 
       if (direction > -1)
@@ -415,7 +415,7 @@ void InitElementGraphicInfo()
     else
     {
       if (direction < 0)
-       for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+       for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
          element_info[element].direction_graphic[action][dir] = -1;
 
       if (direction > -1)
@@ -443,7 +443,7 @@ void InitElementGraphicInfo()
        element_info[i].crumbled[act] =
          element_info[crumbled_like].crumbled[act];
       for (act = 0; act < NUM_ACTIONS; act++)
-       for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+       for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
          element_info[i].direction_crumbled[act][dir] =
            element_info[crumbled_like].direction_crumbled[act][dir];
     }
@@ -452,7 +452,7 @@ void InitElementGraphicInfo()
     {
       element_info[i].graphic[ACTION_DIGGING] =
        element_info[diggable_like].graphic[ACTION_DIGGING];
-      for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+      for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
        element_info[i].direction_graphic[ACTION_DIGGING][dir] =
          element_info[diggable_like].direction_graphic[ACTION_DIGGING][dir];
     }
@@ -489,7 +489,7 @@ void InitElementGraphicInfo()
       if (graphic > 0 && graphic_info[graphic].bitmap == NULL)
        element_info[i].crumbled[act] = -1;
 
-      for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+      for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
       {
        graphic = element_info[i].direction_graphic[act][dir];
        if (graphic > 0 && graphic_info[graphic].bitmap == NULL)
@@ -508,7 +508,7 @@ void InitElementGraphicInfo()
   {
     for (act = 0; act < NUM_ACTIONS; act++)
     {
-      for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+      for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
       {
        int graphic = element_info[i].direction_graphic[act][dir];
        int move_dir = (act == ACTION_FALLING ? MV_BIT_DOWN : dir);
@@ -566,8 +566,8 @@ void InitElementGraphicInfo()
   {
     int default_graphic = element_info[i].graphic[ACTION_DEFAULT];
     int default_crumbled = element_info[i].crumbled[ACTION_DEFAULT];
-    int default_direction_graphic[NUM_DIRECTIONS];
-    int default_direction_crumbled[NUM_DIRECTIONS];
+    int default_direction_graphic[NUM_DIRECTIONS_FULL];
+    int default_direction_crumbled[NUM_DIRECTIONS_FULL];
 
     if (default_graphic == -1)
       default_graphic = IMG_UNKNOWN;
@@ -580,7 +580,7 @@ void InitElementGraphicInfo()
       default_crumbled = IMG_EMPTY;
 #endif
 
-    for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+    for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
     {
       default_direction_graphic[dir] =
        element_info[i].direction_graphic[ACTION_DEFAULT][dir];
@@ -653,7 +653,7 @@ void InitElementGraphicInfo()
        default_action_crumbled = default_crumbled;
 #endif
 
-      for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+      for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
       {
        /* use action graphic as the default direction graphic, if undefined */
        int default_action_direction_graphic = element_info[i].graphic[act];
@@ -725,7 +725,7 @@ void InitElementGraphicInfo()
       if (graphic_info[crumbled].anim_frames == 1)
        graphic_info[crumbled].anim_mode = ANIM_NONE;
 
-      for (dir = 0; dir < NUM_DIRECTIONS; dir++)
+      for (dir = 0; dir < NUM_DIRECTIONS_FULL; dir++)
       {
        graphic = element_info[i].direction_graphic[act][dir];
        crumbled = element_info[i].direction_crumbled[act][dir];
@@ -4133,7 +4133,7 @@ static void InitArtworkConfig()
   static char *sound_id_prefix[2 * MAX_NUM_ELEMENTS + 1];
   static char *music_id_prefix[NUM_MUSIC_PREFIXES + 1];
   static char *action_id_suffix[NUM_ACTIONS + 1];
-  static char *direction_id_suffix[NUM_DIRECTIONS + 1];
+  static char *direction_id_suffix[NUM_DIRECTIONS_FULL + 1];
   static char *special_id_suffix[NUM_SPECIAL_GFX_ARGS + 1];
   static char *level_id_suffix[MAX_LEVELS + 1];
   static char *dummy[1] = { NULL };
@@ -4207,9 +4207,9 @@ static void InitArtworkConfig()
     action_id_suffix[i] = element_action_info[i].suffix;
   action_id_suffix[NUM_ACTIONS] = NULL;
 
-  for (i = 0; i < NUM_DIRECTIONS; i++)
+  for (i = 0; i < NUM_DIRECTIONS_FULL; i++)
     direction_id_suffix[i] = element_direction_info[i].suffix;
-  direction_id_suffix[NUM_DIRECTIONS] = NULL;
+  direction_id_suffix[NUM_DIRECTIONS_FULL] = NULL;
 
   for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
     special_id_suffix[i] = special_suffix_info[i].suffix;
index a164fbe2df3ceb70f791809c2203858a9f339543..3fd6798d3ff8a24f9d1aa52ac2631ea2a9415da9 100644 (file)
 
 #define NUM_DIRECTIONS         4
 
+/* diagonal movement directions are used in a different contect than buttons */
+#define MV_BIT_UPLEFT          4
+#define MV_BIT_UPRIGHT         5
+#define MV_BIT_DOWNLEFT                6
+#define MV_BIT_DOWNRIGHT       7
+
+#define NUM_DIRECTIONS_FULL    8
+
 /* values for special "button" bitmasks */
 #define BUTTON_1               4
 #define BUTTON_2               5
 #define MV_UP                  (1 << MV_BIT_UP)
 #define MV_DOWN                        (1 << MV_BIT_DOWN)
 
+#define MV_UPLEFT              (MV_UP   | MV_LEFT)
+#define MV_UPRIGHT             (MV_UP   | MV_RIGHT)
+#define MV_DOWNLEFT            (MV_DOWN | MV_LEFT)
+#define MV_DOWNRIGHT           (MV_DOWN | MV_RIGHT)
+
 #define MV_HORIZONTAL          (MV_LEFT | MV_RIGHT)
 #define MV_VERTICAL            (MV_UP   | MV_DOWN)
 #define MV_ALL_DIRECTIONS      (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)
 #define KEY_BUTTON             (KEY_BUTTON_1 | KEY_BUTTON_2)
 #define KEY_ACTION             (KEY_MOTION | KEY_BUTTON)
 
-#define MV_DIR_BIT(x)          ((x) == MV_LEFT  ? MV_BIT_LEFT  :       \
-                                (x) == MV_RIGHT ? MV_BIT_RIGHT :       \
-                                (x) == MV_UP    ? MV_BIT_UP    : MV_BIT_DOWN)
-
-#define MV_DIR_OPPOSITE(x)     ((x) == MV_LEFT  ? MV_RIGHT :           \
-                                (x) == MV_RIGHT ? MV_LEFT  :           \
-                                (x) == MV_UP    ? MV_DOWN  :           \
-                                (x) == MV_DOWN  ? MV_UP    : MV_NONE)
-
+#define MV_DIR_FROM_BIT(x)     ((x) < NUM_DIRECTIONS ? 1 << (x) :        \
+                                (x) == MV_BIT_UPLEFT    ? MV_UPLEFT    : \
+                                (x) == MV_BIT_UPRIGHT   ? MV_UPRIGHT   : \
+                                (x) == MV_BIT_DOWNLEFT  ? MV_DOWNLEFT  : \
+                                (x) == MV_BIT_DOWNRIGHT ? MV_DOWNRIGHT : \
+                                MV_NONE)
+
+#define MV_DIR_TO_BIT(x)       ((x) == MV_LEFT      ? MV_BIT_LEFT      : \
+                                (x) == MV_RIGHT     ? MV_BIT_RIGHT     : \
+                                (x) == MV_UP        ? MV_BIT_UP        : \
+                                (x) == MV_DOWN      ? MV_BIT_DOWN      : \
+                                (x) == MV_UPLEFT    ? MV_BIT_UPLEFT    : \
+                                (x) == MV_UPRIGHT   ? MV_BIT_UPRIGHT   : \
+                                (x) == MV_DOWNLEFT  ? MV_BIT_DOWNLEFT  : \
+                                (x) == MV_DOWNRIGHT ? MV_BIT_DOWNRIGHT : \
+                                MV_BIT_DOWN)
+
+#define MV_DIR_OPPOSITE(x)     ((x) == MV_LEFT      ? MV_RIGHT     : \
+                                (x) == MV_RIGHT     ? MV_LEFT      : \
+                                (x) == MV_UP        ? MV_DOWN      : \
+                                (x) == MV_DOWN      ? MV_UP        : \
+                                (x) == MV_UPLEFT    ? MV_DOWNRIGHT : \
+                                (x) == MV_UPRIGHT   ? MV_DOWNLEFT  : \
+                                (x) == MV_DOWNLEFT  ? MV_UPRIGHT   : \
+                                (x) == MV_DOWNRIGHT ? MV_UPLEFT    : \
+                                MV_NONE)
 
 /* values for animation mode (frame order and direction) */
 #define ANIM_NONE              0
index d62be79e4f1615e87b6d44c7177d83cbf8ac879e..9c2a781c24d24d166d433e6bb1205267b6ef1ca4 100644 (file)
@@ -4458,12 +4458,16 @@ struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] =
   { NULL,                      0,                              0       }
 };
 
-struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS + 1] =
+struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS_FULL + 1] =
 {
   { ".left",           MV_BIT_LEFT                     },
   { ".right",          MV_BIT_RIGHT                    },
   { ".up",             MV_BIT_UP                       },
   { ".down",           MV_BIT_DOWN                     },
+  { ".upleft",         MV_BIT_UP                       },
+  { ".upright",                MV_BIT_RIGHT                    },
+  { ".downleft",       MV_BIT_LEFT                     },
+  { ".downright",      MV_BIT_DOWN                     },
 
   { NULL,              0                               }
 };
index c131ffc0d95d602a2c856ea22689aa5b712c53ff..c9948bf0f714cd7ad05ad0edc80f61bebdeaf605 100644 (file)
@@ -2161,11 +2161,11 @@ struct ElementInfo
   /* ---------- graphic and sound definitions ---------- */
 
   int graphic[NUM_ACTIONS];    /* default graphics for several actions */
-  int direction_graphic[NUM_ACTIONS][NUM_DIRECTIONS];
+  int direction_graphic[NUM_ACTIONS][NUM_DIRECTIONS_FULL];
                                /* special graphics for left/right/up/down */
 
   int crumbled[NUM_ACTIONS];   /* crumbled graphics for several actions */
-  int direction_crumbled[NUM_ACTIONS][NUM_DIRECTIONS];
+  int direction_crumbled[NUM_ACTIONS][NUM_DIRECTIONS_FULL];
                                /* crumbled graphics for left/right/up/down */
 
   int special_graphic[NUM_SPECIAL_GFX_ARGS];
index fbedf9c4b7c4eaf4a365ce883944d5fef1d59699..ae2843a1fbc515b64e4dceda60589d6ae85e9f31 100644 (file)
@@ -887,7 +887,7 @@ static char *getHelpText(int element, int action, int direction)
     strcat(token, element_action_info[action].suffix);
 
   if (direction != -1)
-    strcat(token, element_direction_info[MV_DIR_BIT(direction)].suffix);
+    strcat(token, element_direction_info[MV_DIR_TO_BIT(direction)].suffix);
 
   return getHashEntry(helptext_info, token);
 }
index 62dda7ed784395c03c995792568c8289dad3c5dc..f382840ad7b003864c3f55177816170ea9126abc 100644 (file)
@@ -3336,11 +3336,11 @@ em_object_mapping_list[] =
   },
   {
     Yandroid_ne,                       FALSE,  FALSE,
-    EL_EMC_ANDROID,                    ACTION_TURNING_FROM_UP, MV_BIT_RIGHT
+    EL_EMC_ANDROID,                    ACTION_GROWING, MV_BIT_UPRIGHT
   },
   {
     Yandroid_neB,                      FALSE,  TRUE,
-    EL_EMC_ANDROID,                    ACTION_TURNING_FROM_UP, MV_BIT_RIGHT
+    EL_EMC_ANDROID,                    ACTION_SHRINKING, MV_BIT_UPRIGHT
   },
   {
     Yandroid_e,                                FALSE,  FALSE,
@@ -3352,11 +3352,11 @@ em_object_mapping_list[] =
   },
   {
     Yandroid_se,                       FALSE,  FALSE,
-    EL_EMC_ANDROID,                    ACTION_TURNING_FROM_DOWN, MV_BIT_RIGHT
+    EL_EMC_ANDROID,                    ACTION_GROWING, MV_BIT_DOWNRIGHT
   },
   {
     Yandroid_seB,                      FALSE,  TRUE,
-    EL_EMC_ANDROID,                    ACTION_TURNING_FROM_DOWN, MV_BIT_RIGHT
+    EL_EMC_ANDROID,                    ACTION_SHRINKING, MV_BIT_DOWNRIGHT
   },
   {
     Yandroid_s,                                FALSE,  FALSE,
@@ -3368,11 +3368,11 @@ em_object_mapping_list[] =
   },
   {
     Yandroid_sw,                       FALSE,  FALSE,
-    EL_EMC_ANDROID,                    ACTION_TURNING_FROM_DOWN, MV_BIT_LEFT
+    EL_EMC_ANDROID,                    ACTION_GROWING, MV_BIT_DOWNLEFT
   },
   {
     Yandroid_swB,                      FALSE,  TRUE,
-    EL_EMC_ANDROID,                    ACTION_TURNING_FROM_DOWN, MV_BIT_LEFT
+    EL_EMC_ANDROID,                    ACTION_SHRINKING, MV_BIT_DOWNLEFT
   },
   {
     Yandroid_w,                                FALSE,  FALSE,
@@ -3384,11 +3384,11 @@ em_object_mapping_list[] =
   },
   {
     Yandroid_nw,                       FALSE,  FALSE,
-    EL_EMC_ANDROID,                    ACTION_TURNING_FROM_UP, MV_BIT_LEFT
+    EL_EMC_ANDROID,                    ACTION_GROWING, MV_BIT_UPLEFT
   },
   {
     Yandroid_nwB,                      FALSE,  TRUE,
-    EL_EMC_ANDROID,                    ACTION_TURNING_FROM_UP, MV_BIT_LEFT
+    EL_EMC_ANDROID,                    ACTION_SHRINKING, MV_BIT_UPLEFT
   },
   {
     Xspring,                           TRUE,   FALSE,
@@ -5534,7 +5534,7 @@ int el_act_dir2img(int element, int action, int direction)
   if (direction == MV_NONE)
     return element_info[element].graphic[action];
 
-  direction = MV_DIR_BIT(direction);
+  direction = MV_DIR_TO_BIT(direction);
 
   return element_info[element].direction_graphic[action][direction];
 }
@@ -5542,7 +5542,7 @@ int el_act_dir2img(int element, int action, int direction)
 int el_act_dir2img(int element, int action, int direction)
 {
   element = GFX_ELEMENT(element);
-  direction = MV_DIR_BIT(direction);   /* default: MV_NONE => MV_DOWN */
+  direction = MV_DIR_TO_BIT(direction);        /* default: MV_NONE => MV_DOWN */
 
   /* direction_graphic[][] == graphic[] for undefined direction graphics */
   return element_info[element].direction_graphic[action][direction];
@@ -5557,7 +5557,7 @@ static int el_act_dir2crm(int element, int action, int direction)
   if (direction == MV_NONE)
     return element_info[element].crumbled[action];
 
-  direction = MV_DIR_BIT(direction);
+  direction = MV_DIR_TO_BIT(direction);
 
   return element_info[element].direction_crumbled[action][direction];
 }
@@ -5565,7 +5565,7 @@ static int el_act_dir2crm(int element, int action, int direction)
 static int el_act_dir2crm(int element, int action, int direction)
 {
   element = GFX_ELEMENT(element);
-  direction = MV_DIR_BIT(direction);   /* default: MV_NONE => MV_DOWN */
+  direction = MV_DIR_TO_BIT(direction);        /* default: MV_NONE => MV_DOWN */
 
   /* direction_graphic[][] == graphic[] for undefined direction graphics */
   return element_info[element].direction_crumbled[action][direction];
@@ -5695,7 +5695,8 @@ void InitGraphicInfo_EM(void)
       object_mapping[e].action = em_object_mapping_list[i].action;
 
     if (em_object_mapping_list[i].direction != -1)
-      object_mapping[e].direction = (1 << em_object_mapping_list[i].direction);
+      object_mapping[e].direction =
+       MV_DIR_FROM_BIT(em_object_mapping_list[i].direction);
   }
 
   for (i = 0; em_player_mapping_list[i].action_em != -1; i++)
@@ -5710,7 +5711,7 @@ void InitGraphicInfo_EM(void)
 
     if (em_player_mapping_list[i].direction != -1)
       player_mapping[p][a].direction =
-       (1 << em_player_mapping_list[i].direction);
+       MV_DIR_FROM_BIT(em_player_mapping_list[i].direction);
   }
 
   for (i = 0; i < TILE_MAX; i++)
@@ -6026,6 +6027,13 @@ void InitGraphicInfo_EM(void)
        (i << 16) | (j << 12) | (g_em->width << 6) | g_em->height;
 
 #if DEBUG_EM_GFX
+
+#if 1
+      /* skip check for EMC elements not contained in original EMC artwork */
+      if (element == EL_EMC_FAKE_ACID)
+       continue;
+#endif
+
       if (g_em->bitmap != debug_bitmap ||
          g_em->src_x != debug_src_x ||
          g_em->src_y != debug_src_y ||