rnd-20031115-1-src
authorHolger Schemel <info@artsoft.org>
Sat, 15 Nov 2003 00:03:55 +0000 (01:03 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:44:32 +0000 (10:44 +0200)
* fixed a very nasty bug in dragon turning code in TurnRoundExt()
  (that only showed up on Linux, but not on Windows systems)
* fixed turning movement of butterflies and fireflies (no frame reset)
* enhanced sniksnak turning movement (two steps instead of only one)
* Version number set to 3.0.8.
* Version 3.0.7 released.

CHANGES
ChangeLog
src/conf_gfx.c
src/conftime.h
src/game.c
src/libgame/misc.c
src/main.c
src/main.h

diff --git a/CHANGES b/CHANGES
index a279c296d633cd5cda62efbf344cbdc1b564f431..0df493d13dcac0096031e39adcf5f164be13825d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+Release Version 3.0.8 [?? ??? ????]
+-----------------------------------
+
 Release Version 3.0.7 [10 NOV 2003]
 -----------------------------------
        - fixed incorrectly displayed animation for attacking dragon
index 2a751c5c0321bf9dd7f89f8d0974be69163ca004..6e7363554e8bffa02e204d29a86dbc0be0a69214 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2003-11-14
+       * fixed a very nasty bug in dragon turning code in TurnRoundExt()
+         (that only showed up on Linux, but not on Windows systems)
+
+2003-11-13
+       * fixed turning movement of butterflies and fireflies (no frame reset)
+       * enhanced sniksnak turning movement (two steps instead of only one)
+
+2003-11-10
+       * Version number set to 3.0.8.
+
+2003-11-10
+       * Version 3.0.7 released.
+
 2003-11-09
        * fixed reset of player animation frame when, for example,
          walking, digging or collecting share the same animation
index 1b9fd4ee5ff2fcc296ca78abd0d7197f486d98bd..d0758de8b21bd809e3725e649c6a669b27e1f178 100644 (file)
@@ -166,12 +166,14 @@ struct ConfigInfo image_config[] =
   { "bd_butterfly.frames",                     "2"                     },
   { "bd_butterfly.anim_mode",                  "pingpong"              },
   { "bd_butterfly.delay",                      "4"                     },
+  { "bd_butterfly.global_sync",                        "true"                  },
   { "bd_butterfly.right",                      "RocksElements.pcx"     },
   { "bd_butterfly.right.xpos",                 "4"                     },
   { "bd_butterfly.right.ypos",                 "12"                    },
   { "bd_butterfly.right.frames",               "2"                     },
   { "bd_butterfly.right.anim_mode",            "pingpong"              },
   { "bd_butterfly.right.delay",                        "4"                     },
+  { "bd_butterfly.right.global_sync",          "true"                  },
   { "bd_butterfly.right.EDITOR",               "RocksElements.pcx"     },
   { "bd_butterfly.right.EDITOR.xpos",          "8"                     },
   { "bd_butterfly.right.EDITOR.ypos",          "12"                    },
@@ -182,6 +184,7 @@ struct ConfigInfo image_config[] =
   { "bd_butterfly.up.frames",                  "2"                     },
   { "bd_butterfly.up.anim_mode",               "pingpong"              },
   { "bd_butterfly.up.delay",                   "4"                     },
+  { "bd_butterfly.up.global_sync",             "true"                  },
   { "bd_butterfly.up.EDITOR",                  "RocksElements.pcx"     },
   { "bd_butterfly.up.EDITOR.xpos",             "9"                     },
   { "bd_butterfly.up.EDITOR.ypos",             "12"                    },
@@ -192,6 +195,7 @@ struct ConfigInfo image_config[] =
   { "bd_butterfly.left.frames",                        "2"                     },
   { "bd_butterfly.left.anim_mode",             "pingpong"              },
   { "bd_butterfly.left.delay",                 "4"                     },
+  { "bd_butterfly.left.global_sync",           "true"                  },
   { "bd_butterfly.left.EDITOR",                        "RocksElements.pcx"     },
   { "bd_butterfly.left.EDITOR.xpos",           "10"                    },
   { "bd_butterfly.left.EDITOR.ypos",           "12"                    },
@@ -202,6 +206,7 @@ struct ConfigInfo image_config[] =
   { "bd_butterfly.down.frames",                        "2"                     },
   { "bd_butterfly.down.anim_mode",             "pingpong"              },
   { "bd_butterfly.down.delay",                 "4"                     },
+  { "bd_butterfly.down.global_sync",           "true"                  },
   { "bd_butterfly.down.EDITOR",                        "RocksElements.pcx"     },
   { "bd_butterfly.down.EDITOR.xpos",           "11"                    },
   { "bd_butterfly.down.EDITOR.ypos",           "12"                    },
@@ -213,12 +218,14 @@ struct ConfigInfo image_config[] =
   { "bd_firefly.frames",                       "2"                     },
   { "bd_firefly.anim_mode",                    "pingpong"              },
   { "bd_firefly.delay",                                "4"                     },
+  { "bd_firefly.global_sync",                  "true"                  },
   { "bd_firefly.right",                                "RocksElements.pcx"     },
   { "bd_firefly.right.xpos",                   "6"                     },
   { "bd_firefly.right.ypos",                   "12"                    },
   { "bd_firefly.right.frames",                 "2"                     },
   { "bd_firefly.right.anim_mode",              "pingpong"              },
   { "bd_firefly.right.delay",                  "4"                     },
+  { "bd_firefly.right.global_sync",            "true"                  },
   { "bd_firefly.right.EDITOR",                 "RocksElements.pcx"     },
   { "bd_firefly.right.EDITOR.xpos",            "12"                    },
   { "bd_firefly.right.EDITOR.ypos",            "12"                    },
@@ -229,6 +236,7 @@ struct ConfigInfo image_config[] =
   { "bd_firefly.up.frames",                    "2"                     },
   { "bd_firefly.up.anim_mode",                 "pingpong"              },
   { "bd_firefly.up.delay",                     "4"                     },
+  { "bd_firefly.up.global_sync",               "true"                  },
   { "bd_firefly.up.EDITOR",                    "RocksElements.pcx"     },
   { "bd_firefly.up.EDITOR.xpos",               "13"                    },
   { "bd_firefly.up.EDITOR.ypos",               "12"                    },
@@ -239,6 +247,7 @@ struct ConfigInfo image_config[] =
   { "bd_firefly.left.frames",                  "2"                     },
   { "bd_firefly.left.anim_mode",               "pingpong"              },
   { "bd_firefly.left.delay",                   "4"                     },
+  { "bd_firefly.left.global_sync",             "true"                  },
   { "bd_firefly.left.EDITOR",                  "RocksElements.pcx"     },
   { "bd_firefly.left.EDITOR.xpos",             "14"                    },
   { "bd_firefly.left.EDITOR.ypos",             "12"                    },
@@ -249,6 +258,7 @@ struct ConfigInfo image_config[] =
   { "bd_firefly.down.frames",                  "2"                     },
   { "bd_firefly.down.anim_mode",               "pingpong"              },
   { "bd_firefly.down.delay",                   "4"                     },
+  { "bd_firefly.down.global_sync",             "true"                  },
   { "bd_firefly.down.EDITOR",                  "RocksElements.pcx"     },
   { "bd_firefly.down.EDITOR.xpos",             "15"                    },
   { "bd_firefly.down.EDITOR.ypos",             "12"                    },
@@ -529,35 +539,59 @@ struct ConfigInfo image_config[] =
   { "sp_sniksnak.turning_from_left.up",                "RocksSP.pcx"           },
   { "sp_sniksnak.turning_from_left.up.xpos",   "12"                    },
   { "sp_sniksnak.turning_from_left.up.ypos",   "6"                     },
-  { "sp_sniksnak.turning_from_left.up.frames", "1"                     },
+  { "sp_sniksnak.turning_from_left.up.frames", "2"                     },
+  { "sp_sniksnak.turning_from_left.up.delay",  "4"                     },
+  { "sp_sniksnak.turning_from_left.up.offset", "1408"                  },
+  { "sp_sniksnak.turning_from_left.up.anim_mode","linear"              },
   { "sp_sniksnak.turning_from_left.down",      "RocksSP.pcx"           },
   { "sp_sniksnak.turning_from_left.down.xpos", "13"                    },
   { "sp_sniksnak.turning_from_left.down.ypos", "6"                     },
-  { "sp_sniksnak.turning_from_left.down.frames","1"                    },
+  { "sp_sniksnak.turning_from_left.down.frames","2"                    },
+  { "sp_sniksnak.turning_from_left.down.delay",        "4"                     },
+  { "sp_sniksnak.turning_from_left.down.offset","1504"                 },
+  { "sp_sniksnak.turning_from_left.down.anim_mode","linear"            },
   { "sp_sniksnak.turning_from_right.up",       "RocksSP.pcx"           },
   { "sp_sniksnak.turning_from_right.up.xpos",  "15"                    },
   { "sp_sniksnak.turning_from_right.up.ypos",  "6"                     },
-  { "sp_sniksnak.turning_from_right.up.frames",        "1"                     },
+  { "sp_sniksnak.turning_from_right.up.frames",        "2"                     },
+  { "sp_sniksnak.turning_from_right.up.delay", "4"                     },
+  { "sp_sniksnak.turning_from_right.up.offset",        "1312"                  },
+  { "sp_sniksnak.turning_from_right.up.anim_mode","linear"             },
   { "sp_sniksnak.turning_from_right.down",     "RocksSP.pcx"           },
   { "sp_sniksnak.turning_from_right.down.xpos",        "14"                    },
   { "sp_sniksnak.turning_from_right.down.ypos",        "6"                     },
-  { "sp_sniksnak.turning_from_right.down.frames","1"                   },
+  { "sp_sniksnak.turning_from_right.down.frames","2"                   },
+  { "sp_sniksnak.turning_from_right.down.delay","4"                    },
+  { "sp_sniksnak.turning_from_right.down.offset","1472"                        },
+  { "sp_sniksnak.turning_from_right.down.anim_mode","linear"           },
   { "sp_sniksnak.turning_from_up.left",                "RocksSP.pcx"           },
   { "sp_sniksnak.turning_from_up.left.xpos",   "12"                    },
   { "sp_sniksnak.turning_from_up.left.ypos",   "6"                     },
-  { "sp_sniksnak.turning_from_up.left.frames", "1"                     },
+  { "sp_sniksnak.turning_from_up.left.frames", "2"                     },
+  { "sp_sniksnak.turning_from_up.left.delay",  "4"                     },
+  { "sp_sniksnak.turning_from_up.left.offset", "896"                   },
+  { "sp_sniksnak.turning_from_up.left.anim_mode","linear"              },
   { "sp_sniksnak.turning_from_up.right",       "RocksSP.pcx"           },
   { "sp_sniksnak.turning_from_up.right.xpos",  "15"                    },
   { "sp_sniksnak.turning_from_up.right.ypos",  "6"                     },
-  { "sp_sniksnak.turning_from_up.right.frames",        "1"                     },
+  { "sp_sniksnak.turning_from_up.right.frames",        "2"                     },
+  { "sp_sniksnak.turning_from_up.right.delay", "4"                     },
+  { "sp_sniksnak.turning_from_up.right.offset",        "928"                   },
+  { "sp_sniksnak.turning_from_up.right.anim_mode","linear"             },
   { "sp_sniksnak.turning_from_down.left",      "RocksSP.pcx"           },
   { "sp_sniksnak.turning_from_down.left.xpos", "13"                    },
   { "sp_sniksnak.turning_from_down.left.ypos", "6"                     },
-  { "sp_sniksnak.turning_from_down.left.frames","1"                    },
+  { "sp_sniksnak.turning_from_down.left.frames","2"                    },
+  { "sp_sniksnak.turning_from_down.left.delay",        "4"                     },
+  { "sp_sniksnak.turning_from_down.left.offset","864"                  },
+  { "sp_sniksnak.turning_from_down.left.anim_mode","linear"            },
   { "sp_sniksnak.turning_from_down.right",     "RocksSP.pcx"           },
   { "sp_sniksnak.turning_from_down.right.xpos",        "14"                    },
   { "sp_sniksnak.turning_from_down.right.ypos",        "6"                     },
-  { "sp_sniksnak.turning_from_down.right.frames","1"                   },
+  { "sp_sniksnak.turning_from_down.right.frames","2"                   },
+  { "sp_sniksnak.turning_from_down.right.delay","4"                    },
+  { "sp_sniksnak.turning_from_down.right.offset","960"                 },
+  { "sp_sniksnak.turning_from_down.right.anim_mode","linear"           },
 
   { "sp_electron",                             "RocksSP.pcx"           },
   { "sp_electron.xpos",                                "8"                     },
index 26d241a25c0c8a95c1b683164b971ff2b416aeae..b3dbda7e50581498f56045e6a18d2e839f0482e5 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-11-10 02:01]"
+#define COMPILE_DATE_STRING "[2003-11-14 23:13]"
index 71013bf598ebd1a491c8cc3a52f2311f0db2fdbe..f5c787f6d07a37fc606f0426e3877f04cea1f626 100644 (file)
@@ -1460,6 +1460,10 @@ void InitGame()
       printf("Player %d %sactive.\n",
             i + 1, (stored_player[i].active ? "" : "not "));
   }
+
+#if 0
+  printf("::: starting game [%d]\n", FrameCounter);
+#endif
 }
 
 void InitMovDir(int x, int y)
@@ -3388,6 +3392,11 @@ inline static void TurnRoundExt(int x, int y)
     int rnd_value = 24;
     int rnd = RND(rnd_value);
 
+#if 0
+    if (FrameCounter < 1 && x == 0 && y == 29)
+      printf(":2: %d/%d: %d [%d]\n", x, y, MovDir[x][y], FrameCounter);
+#endif
+
     if (can_move_on && rnd > rnd_value / 8)
       MovDir[x][y] = old_move_dir;
     else if (can_turn_left && can_turn_right)
@@ -3402,8 +3411,25 @@ inline static void TurnRoundExt(int x, int y)
     xx = x + move_xy[MovDir[x][y]].x;
     yy = y + move_xy[MovDir[x][y]].y;
 
+#if 0
+    if (FrameCounter < 1 && x == 0 && y == 29)
+      printf(":3: %d/%d: %d (%d/%d: %d) [%d]\n", x, y, MovDir[x][y],
+            xx, yy, Feld[xx][yy],
+            FrameCounter);
+#endif
+
+#if 1
+    if (!IN_LEV_FIELD_AND_IS_FREE(xx, yy))
+      MovDir[x][y] = old_move_dir;
+#else
     if (!IS_FREE(xx, yy))
       MovDir[x][y] = old_move_dir;
+#endif
+
+#if 0
+    if (FrameCounter < 1 && x == 0 && y == 29)
+      printf(":4: %d/%d: %d [%d]\n", x, y, MovDir[x][y], FrameCounter);
+#endif
 
     MovDelay[x][y] = 0;
   }
@@ -4094,6 +4120,11 @@ void StartMoving(int x, int y)
 #endif
 #endif
 
+#if 0
+    if (FrameCounter < 1 && x == 0 && y == 29)
+      printf(":1: %d/%d: %d [%d]\n", x, y, MovDir[x][y], FrameCounter);
+#endif
+
     if (!MovDelay[x][y])       /* start new movement phase */
     {
       /* all objects that can change their move direction after each step
@@ -4108,6 +4139,11 @@ void StartMoving(int x, int y)
       {
        TurnRound(x, y);
 
+#if 0
+       if (FrameCounter < 1 && x == 0 && y == 29)
+         printf(":9: %d: %d [%d]\n", y, MovDir[x][y], FrameCounter);
+#endif
+
        if (MovDelay[x][y] && (element == EL_BUG ||
                               element == EL_SPACESHIP ||
                               element == EL_SP_SNIKSNAK ||
@@ -6129,6 +6165,10 @@ void GameActions()
   if (tape.pausing)
     return;
 
+#if 0
+  printf("::: getting new tape action [%d]\n", FrameCounter);
+#endif
+
   recorded_player_action = (tape.playing ? TapePlayAction() : NULL);
 
   for (i=0; i<MAX_PLAYERS; i++)
index a19bcace92430800df871f8918dafb0a9974fdb0..54a77ca176eada8cb4d960d596cd8cd825132d1d 100644 (file)
@@ -323,10 +323,27 @@ unsigned int init_random_number(int nr, long seed)
   return (unsigned int) seed;
 }
 
+#if 1
 unsigned int get_random_number(int nr, unsigned int max)
 {
   return (max > 0 ? random_linux_libc(nr) % max : 0);
 }
+#else
+unsigned int get_random_number(int nr, unsigned int max)
+{
+  unsigned int rnd = (max > 0 ? random_linux_libc(nr) % max : 0);
+
+  if (nr == 0 && FrameCounter < 2)
+    printf("::: %d [%d]\n", rnd, FrameCounter);
+
+#if 0
+  if (nr == 0 && FrameCounter < 2 && rnd == 8)
+    rnd /= 0;
+#endif
+
+  return rnd;
+}
+#endif
 
 
 /* ------------------------------------------------------------------------- */
index a06efd1ff5c5dfbdd38e456d27cddc17ce794730..00fea82a12c3abc7aeda0ff43dd34f5143c74a8d 100644 (file)
@@ -3699,6 +3699,8 @@ struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] =
   { ".emptying",               ACTION_EMPTYING,                FALSE   },
   { ".changing",               ACTION_CHANGING,                FALSE   },
   { ".exploding",              ACTION_EXPLODING,               FALSE   },
+  { ".boring",                 ACTION_BORING,                  FALSE   },
+  { ".sleeping",               ACTION_SLEEPING,                TRUE    },
   { ".dying",                  ACTION_DYING,                   FALSE   },
   { ".turning",                        ACTION_TURNING,                 FALSE   },
   { ".turning_from_left",      ACTION_TURNING_FROM_LEFT,       FALSE   },
index 7c1134f62bf06a15d6f3046b34d40d3ae2b1cb90..cbfbf67fc893ef3eceb67154b95f816196f5b996 100644 (file)
 #define ACTION_EMPTYING                                22
 #define ACTION_CHANGING                                23
 #define ACTION_EXPLODING                       24
-#define ACTION_DYING                           25
-#define ACTION_TURNING                         26
-#define ACTION_TURNING_FROM_LEFT               27
-#define ACTION_TURNING_FROM_RIGHT              28
-#define ACTION_TURNING_FROM_UP                 29
-#define ACTION_TURNING_FROM_DOWN               30
-#define ACTION_OTHER                           31
-
-#define NUM_ACTIONS                            32
+#define ACTION_BORING                          25
+#define ACTION_SLEEPING                                26
+#define ACTION_DYING                           27
+#define ACTION_TURNING                         28
+#define ACTION_TURNING_FROM_LEFT               29
+#define ACTION_TURNING_FROM_RIGHT              30
+#define ACTION_TURNING_FROM_UP                 31
+#define ACTION_TURNING_FROM_DOWN               32
+#define ACTION_OTHER                           33
+
+#define NUM_ACTIONS                            34
 
 /* values for special image configuration suffixes (must match game mode) */
 #define GFX_SPECIAL_ARG_MAIN                   0