rnd-20021117-1-src
authorHolger Schemel <info@artsoft.org>
Sun, 17 Nov 2002 03:10:39 +0000 (04:10 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:38:58 +0000 (10:38 +0200)
src/conf_e2g.c
src/conftime.h
src/game.c
src/init.c
src/main.c
src/main.h
src/tools.c

index ffe88a23b40ddba0cabcbbc59c5acd05fcfbd777..b7ba1638c8787bedf8909e6230e960c324cc22b4 100644 (file)
@@ -913,7 +913,7 @@ element_to_graphic[] =
     IMG_SPRING
   },
   {
-    EL_SPRING_MOVING,                          -1, GFX_ACTION_MOVING,
+    EL_SPRING,                                 -1, GFX_ACTION_MOVING,
     IMG_SPRING_MOVING
   },
   {
index bf91ef7f2a978683f48b52bdc544f6892a23dc8e..5c3b0058fed6239363fda42c774faad4e6f2b819 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2002-10-28 22:52]"
+#define COMPILE_DATE_STRING "[2002-11-17 04:09]"
index 81f233b0d2fd2062adf09c6164087d37521528d7..32ee2ac3ef708231db380c2366b3e21577bb72c4 100644 (file)
@@ -292,6 +292,8 @@ static void InitField(int x, int y, boolean init_game)
          Feld[x][y] = EL_SP_MURPHY_CLONE;
          break;
        }
+
+       Feld[x][y] = EL_PLAYER1;
       }
       /* no break! */
     case EL_PLAYER1:
@@ -2326,18 +2328,18 @@ void TurnRound(int x, int y)
 
   int element = Feld[x][y];
   int old_move_dir = MovDir[x][y];
-  int left_dir = turn[old_move_dir].left;
+  int left_dir  = turn[old_move_dir].left;
   int right_dir = turn[old_move_dir].right;
-  int back_dir = turn[old_move_dir].back;
+  int back_dir  = turn[old_move_dir].back;
 
-  int left_dx = move_xy[left_dir].x, left_dy = move_xy[left_dir].y;
-  int right_dx = move_xy[right_dir].x, right_dy = move_xy[right_dir].y;
-  int move_dx = move_xy[old_move_dir].x, move_dy = move_xy[old_move_dir].y;
-  int back_dx = move_xy[back_dir].x, back_dy = move_xy[back_dir].y;
+  int left_dx  = move_xy[left_dir].x,     left_dy  = move_xy[left_dir].y;
+  int right_dx = move_xy[right_dir].x,    right_dy = move_xy[right_dir].y;
+  int move_dx  = move_xy[old_move_dir].x, move_dy  = move_xy[old_move_dir].y;
+  int back_dx  = move_xy[back_dir].x,     back_dy  = move_xy[back_dir].y;
 
-  int left_x = x+left_dx, left_y = y+left_dy;
-  int right_x = x+right_dx, right_y = y+right_dy;
-  int move_x = x+move_dx, move_y = y+move_dy;
+  int left_x  = x + left_dx,  left_y  = y + left_dy;
+  int right_x = x + right_dx, right_y = y + right_dy;
+  int move_x  = x + move_dx,  move_y  = y + move_dy;
 
   if (element == EL_BUG || element == EL_BD_BUTTERFLY)
   {
@@ -2581,17 +2583,18 @@ void TurnRound(int x, int y)
     MovDir[x][y] = game.balloon_dir;
     MovDelay[x][y] = 0;
   }
-  else if (element == EL_SPRING_MOVING)
+  else if (element == EL_SPRING)
   {
-    if (!IN_LEV_FIELD(move_x, move_y) || !IS_FREE(move_x, move_y) ||
-       (IN_LEV_FIELD(x, y+1) && IS_FREE(x, y+1)))
-    {
-      Feld[x][y] = EL_SPRING;
+    if ((MovDir[x][y] == MV_LEFT || MovDir[x][y] == MV_RIGHT) &&
+       (!IN_LEV_FIELD(move_x, move_y) || !IS_FREE(move_x, move_y) ||
+        (IN_LEV_FIELD(x, y + 1) && IS_FREE(x, y + 1))))
       MovDir[x][y] = MV_NO_MOVING;
-    }
+
     MovDelay[x][y] = 0;
   }
-  else if (element == EL_ROBOT || element == EL_SATELLITE || element == EL_PENGUIN)
+  else if (element == EL_ROBOT ||
+          element == EL_SATELLITE ||
+          element == EL_PENGUIN)
   {
     int attr_x = -1, attr_y = -1;
 
@@ -2918,24 +2921,38 @@ void StartMoving(int x, int y)
       }
     }
   }
-  else if (CAN_MOVE(element))
+
+  if (CAN_MOVE(element))       /* not "else if" because of EL_SPRING */
   {
     int newx, newy;
 
-    if ((element == EL_SATELLITE || element == EL_BALLOON ||
-        element == EL_SPRING_MOVING)
+    if ((element == EL_SATELLITE ||
+        element == EL_BALLOON ||
+        element == EL_SPRING)
        && JustBeingPushed(x, y))
       return;
 
+    if (element == EL_SPRING && MovDir[x][y] == MV_DOWN)
+      Feld[x][y + 1] = EL_EMPTY;       /* was set to EL_BLOCKED above */
+
     if (!MovDelay[x][y])       /* start new movement phase */
     {
       /* all objects that can change their move direction after each step */
       /* (MAMPFER, MAMPFER2 and PACMAN go straight until they hit a wall  */
 
-      if (element!=EL_YAMYAM && element!=EL_DARK_YAMYAM && element!=EL_PACMAN)
+      if (element != EL_YAMYAM &&
+         element != EL_DARK_YAMYAM &&
+         element != EL_PACMAN)
       {
+#if 0
+  if (element == EL_SPRING)
+    printf("1--> %d\n", MovDir[x][y]);
+#endif
        TurnRound(x, y);
-
+#if 0
+  if (element == EL_SPRING)
+    printf("2--> %d\n", MovDir[x][y]);
+#endif
        if (MovDelay[x][y] && (element == EL_BUG ||
                               element == EL_SPACESHIP ||
                               element == EL_SP_SNIKSNAK ||
@@ -3256,7 +3273,7 @@ void ContinueMoving(int x, int y)
   int direction = MovDir[x][y];
   int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
   int dy = (direction == MV_UP   ? -1 : direction == MV_DOWN  ? +1 : 0);
-  int horiz_move = (dx!=0);
+  int horiz_move = (dx != 0);
   int newx = x + dx, newy = y + dy;
   int step = (horiz_move ? dx : dy) * TILEX / 8;
 
@@ -3273,8 +3290,8 @@ void ContinueMoving(int x, int y)
   else if (CAN_FALL(element) && horiz_move &&
           y < lev_fieldy-1 && IS_BELT_ACTIVE(Feld[x][y+1]))
     step /= 2;
-  else if (element == EL_SPRING_MOVING)
-    step*=2;
+  else if (element == EL_SPRING && horiz_move)
+    step *= 2;
 
 #if OLD_GAME_BEHAVIOUR
   else if (CAN_FALL(element) && horiz_move && !IS_SP_ELEMENT(element))
@@ -3369,8 +3386,13 @@ void ContinueMoving(int x, int y)
     GfxAction[newx][newy] = GfxAction[x][y];   /* keep action one frame */
     GfxAction[x][y] = GFX_ACTION_DEFAULT;
 
+#if 0
     if (!CAN_MOVE(element))
       MovDir[newx][newy] = 0;
+#else
+    if (CAN_FALL(element) && MovDir[newx][newy] == MV_DOWN)
+      MovDir[newx][newy] = 0;
+#endif
 
     DrawLevelField(x, y);
     DrawLevelField(newx, newy);
@@ -6231,13 +6253,13 @@ int DigField(struct PlayerInfo *player,
       else
       {
        RemoveField(x, y);
-       Feld[x+dx][y+dy] = element;
+       Feld[x + dx][y + dy] = element;
       }
 
       if (element == EL_SPRING)
       {
-       Feld[x+dx][y+dy] = EL_SPRING_MOVING;
-       MovDir[x+dx][y+dy] = move_direction;
+       Feld[x + dx][y + dy] = EL_SPRING;
+       MovDir[x + dx][y + dy] = move_direction;
       }
 
       player->push_delay_value = (element == EL_SPRING ? 0 : 2 + RND(8));
index b78b32065d56dafb7628e4cef29bbb09dd7a0cc0..22ac7a8f96a1bda62f307262f2740ceba090d4e4 100644 (file)
@@ -1750,7 +1750,7 @@ void InitElementProperties()
     EL_SP_SNIKSNAK,
     EL_SP_ELECTRON,
     EL_BALLOON,
-    EL_SPRING_MOVING
+    EL_SPRING
   };
   static int ep_can_move_num = SIZEOF_ARRAY_INT(ep_can_move);
 
index e10f3d63fa6412ba6498517f18f47323629d4842..364cedcde6db75c423e4279e78e9d073e432f336 100644 (file)
@@ -2562,12 +2562,14 @@ struct ConfigInfo image_config[] =
   { "twinkle_blue.frames",                     "3"                     },
   { "twinkle_blue.delay",                      "2"                     },
   { "twinkle_blue.mode_pingpong",              "1"                     },
+  { "twinkle_blue.global_sync",                        "0"                     },
   { "twinkle_white",                           "RocksHeroes.pcx"       },
   { "twinkle_white.xpos",                      "13"                    },
   { "twinkle_white.ypos",                      "11"                    },
   { "twinkle_white.frames",                    "3"                     },
   { "twinkle_white.delay",                     "2"                     },
   { "twinkle_white.mode_pingpong",             "1"                     },
+  { "twinkle_white.global_sync",               "0"                     },
 
   { "steelwall_topleft",                       "RocksElements.pcx"     },
   { "steelwall_topleft.xpos",                  "0"                     },
index ff6f5f5098ccfae3032f1ea2a85e1c55d7791e01..223ca8ebb2dadffc822589897a16a0503af2a192 100644 (file)
 #define EL_TIMEGATE_CLOSING            (EL_FIRST_RUNTIME_REAL + 20)
 #define EL_PEARL_BREAKING              (EL_FIRST_RUNTIME_REAL + 21)
 #define EL_TRAP_ACTIVE                 (EL_FIRST_RUNTIME_REAL + 22)
-#define EL_SPRING_MOVING               (EL_FIRST_RUNTIME_REAL + 23)
-#define EL_SP_MURPHY_CLONE             (EL_FIRST_RUNTIME_REAL + 24)
-#define EL_QUICKSAND_EMPTYING          (EL_FIRST_RUNTIME_REAL + 25)
-#define EL_MAGIC_WALL_EMPTYING         (EL_FIRST_RUNTIME_REAL + 26)
-#define EL_BD_MAGIC_WALL_EMPTYING      (EL_FIRST_RUNTIME_REAL + 27)
-#define EL_AMOEBA_DRIPPING             (EL_FIRST_RUNTIME_REAL + 28)
-#define EL_SP_EXIT_OPEN                        (EL_FIRST_RUNTIME_REAL + 29)
-#define EL_INVISIBLE_STEELWALL_ACTIVE  (EL_FIRST_RUNTIME_REAL + 30)
-#define EL_INVISIBLE_SAND_ACTIVE       (EL_FIRST_RUNTIME_REAL + 31)
-#define EL_INVISIBLE_WALL_ACTIVE       (EL_FIRST_RUNTIME_REAL + 32)
-#define EL_CONVEYOR_BELT1_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 33)
-#define EL_CONVEYOR_BELT1_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 34)
-#define EL_CONVEYOR_BELT1_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 35)
-#define EL_CONVEYOR_BELT2_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 36)
-#define EL_CONVEYOR_BELT2_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 37)
-#define EL_CONVEYOR_BELT2_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 38)
-#define EL_CONVEYOR_BELT3_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 39)
-#define EL_CONVEYOR_BELT3_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 40)
-#define EL_CONVEYOR_BELT3_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 41)
-#define EL_CONVEYOR_BELT4_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 42)
-#define EL_CONVEYOR_BELT4_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 43)
-#define EL_CONVEYOR_BELT4_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 44)
+#define EL_SP_MURPHY_CLONE             (EL_FIRST_RUNTIME_REAL + 23)
+#define EL_QUICKSAND_EMPTYING          (EL_FIRST_RUNTIME_REAL + 24)
+#define EL_MAGIC_WALL_EMPTYING         (EL_FIRST_RUNTIME_REAL + 25)
+#define EL_BD_MAGIC_WALL_EMPTYING      (EL_FIRST_RUNTIME_REAL + 26)
+#define EL_AMOEBA_DRIPPING             (EL_FIRST_RUNTIME_REAL + 27)
+#define EL_SP_EXIT_OPEN                        (EL_FIRST_RUNTIME_REAL + 28)
+#define EL_INVISIBLE_STEELWALL_ACTIVE  (EL_FIRST_RUNTIME_REAL + 29)
+#define EL_INVISIBLE_SAND_ACTIVE       (EL_FIRST_RUNTIME_REAL + 30)
+#define EL_INVISIBLE_WALL_ACTIVE       (EL_FIRST_RUNTIME_REAL + 31)
+#define EL_CONVEYOR_BELT1_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 32)
+#define EL_CONVEYOR_BELT1_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 33)
+#define EL_CONVEYOR_BELT1_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 34)
+#define EL_CONVEYOR_BELT2_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 35)
+#define EL_CONVEYOR_BELT2_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 36)
+#define EL_CONVEYOR_BELT2_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 37)
+#define EL_CONVEYOR_BELT3_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 38)
+#define EL_CONVEYOR_BELT3_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 39)
+#define EL_CONVEYOR_BELT3_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 40)
+#define EL_CONVEYOR_BELT4_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 41)
+#define EL_CONVEYOR_BELT4_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 42)
+#define EL_CONVEYOR_BELT4_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 43)
 
 /* "unreal" (and therefore not drawable) runtime elements */
-#define EL_FIRST_RUNTIME_UNREAL                (EL_FIRST_RUNTIME_REAL + 45)
+#define EL_FIRST_RUNTIME_UNREAL                (EL_FIRST_RUNTIME_REAL + 44)
 
 #define EL_BLOCKED                     (EL_FIRST_RUNTIME_UNREAL + 0)
 #define EL_EXPLOSION                   (EL_FIRST_RUNTIME_UNREAL + 1)
index fed92762a5c67701cefcf9d6da900ee2d97e729a..493213367b73499b7da2075f98603ee8dde095e4 100644 (file)
@@ -700,18 +700,25 @@ void DrawPlayer(struct PlayerInfo *player)
 
   if (player_is_moving && last_element == EL_EXPLOSION)
   {
-    int frame = Frame[last_jx][last_jy];
-    int delay = 2;
+    int graphic = IMG_EXPLOSION;
+    int phase = Frame[last_jx][last_jy] - 1;
+    int delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2);
+    int frame = (phase / delay - 1);
 
-    if (frame > 2)
-      DrawGraphicThruMask(SCREENX(last_jx), SCREENY(last_jy), GFX_EXPLOSION,
-                         ((frame - 1) / delay - 1));
+    if (game.emulation == EMU_SUPAPLEX)
+      graphic = (Store[last_jx][last_jy] == EL_SP_INFOTRON ?
+                IMG_SP_EXPLOSION_INFOTRON :
+                IMG_SP_EXPLOSION);
+
+    if (frame >= 0)
+      DrawGraphicThruMask(SCREENX(last_jx), SCREENY(last_jy), graphic, frame);
   }
 
   /* draw elements that stay over the player */
   /* handle the field the player is leaving ... */
   if (player_is_moving && IS_OVER_PLAYER(last_element))
     DrawLevelField(last_jx, last_jy);
+
   /* ... and the field the player is entering */
   if (IS_OVER_PLAYER(element))
     DrawLevelField(jx, jy);
@@ -2839,7 +2846,6 @@ int el2gfx_OLD(int element)
     case EL_TUBE_RIGHT_UP:             return GFX_TUBE_RIGHT_UP;
     case EL_TUBE_RIGHT_DOWN:           return GFX_TUBE_RIGHT_DOWN;
     case EL_SPRING:                    return GFX_SPRING;
-    case EL_SPRING_MOVING:             return GFX_SPRING;
     case EL_TRAP:                      return GFX_TRAP_INACTIVE;
     case EL_TRAP_ACTIVE:               return GFX_TRAP_ACTIVE;
     case EL_BD_WALL:                   return GFX_BD_WALL;