rnd-20050807-1-src
authorHolger Schemel <info@artsoft.org>
Sat, 6 Aug 2005 22:48:45 +0000 (00:48 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:49:14 +0000 (10:49 +0200)
* changed some va_arg() arguments from 'long' to 'int', fixing problems
  on 64-bit architecture systems with LP64 data model
* fixed bug with bombs not exploding when hitting the last level line
  (introduced after the release of 3.1.0)
* added support for dumping small-sized level sketches from editor

16 files changed:
ChangeLog
src/conf_gfx.c
src/conftime.h
src/editor.c
src/editor.h
src/events.c
src/game.c
src/game_em/convert.c
src/init.c
src/libgame/gadgets.c
src/libgame/gadgets.h
src/libgame/image.c
src/libgame/misc.c
src/libgame/setup.c
src/libgame/system.h
src/main.h

index 6ea090be957d4b0c069b956d9658dbd6c7462893..5fb78a8ee80d78e113e368cad53298ee69fb88e1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-08-07
+       * changed some va_arg() arguments from 'long' to 'int', fixing problems
+         on 64-bit architecture systems with LP64 data model
+
+2005-08-06
+       * fixed bug with bombs not exploding when hitting the last level line
+         (introduced after the release of 3.1.0)
+
+2005-08-06
+       * added support for dumping small-sized level sketches from editor
+
 2005-07-24
        * added recognition of "trigger element" for "change digged element to"
          (this is not really what the "trigger element" was made for, but its
index 4e8af67038111b67ce4b5b33a465453d24c51fc3..9aa3e6bbe9abb401875199a0d7964572eef92175 100644 (file)
@@ -1465,21 +1465,18 @@ struct ConfigInfo image_config[] =
   { "emc_steelwall_1.xpos",                    "14"                    },
   { "emc_steelwall_1.ypos",                    "0"                     },
   { "emc_steelwall_1.frames",                  "1"                     },
-  { "emc_steelwall_2",                         "emc_object.pcx"        },
-  { "emc_steelwall_2.xpos",                    "25"                    },
-  { "emc_steelwall_2.ypos",                    "20"                    },
+  { "emc_steelwall_2",                         "RocksEMC.pcx"          },
+  { "emc_steelwall_2.xpos",                    "9"                     },
+  { "emc_steelwall_2.ypos",                    "8"                     },
   { "emc_steelwall_2.frames",                  "1"                     },
-  { "emc_steelwall_2.scale_up_factor",         "2"                     },
-  { "emc_steelwall_3",                         "emc_object.pcx"        },
-  { "emc_steelwall_3.xpos",                    "25"                    },
-  { "emc_steelwall_3.ypos",                    "21"                    },
+  { "emc_steelwall_3",                         "RocksEMC.pcx"          },
+  { "emc_steelwall_3.xpos",                    "9"                     },
+  { "emc_steelwall_3.ypos",                    "9"                     },
   { "emc_steelwall_3.frames",                  "1"                     },
-  { "emc_steelwall_3.scale_up_factor",         "2"                     },
-  { "emc_steelwall_4",                         "emc_object.pcx"        },
-  { "emc_steelwall_4.xpos",                    "25"                    },
-  { "emc_steelwall_4.ypos",                    "22"                    },
+  { "emc_steelwall_4",                         "RocksEMC.pcx"          },
+  { "emc_steelwall_4.xpos",                    "9"                     },
+  { "emc_steelwall_4.ypos",                    "10"                    },
   { "emc_steelwall_4.frames",                  "1"                     },
-  { "emc_steelwall_4.scale_up_factor",         "2"                     },
 
   { "emc_wall_1",                              "RocksDC.pcx"           },
   { "emc_wall_1.xpos",                         "13"                    },
@@ -1509,11 +1506,10 @@ struct ConfigInfo image_config[] =
   { "emc_wall_7.xpos",                         "15"                    },
   { "emc_wall_7.ypos",                         "2"                     },
   { "emc_wall_7.frames",                       "1"                     },
-  { "emc_wall_8",                              "emc_object.pcx"        },
-  { "emc_wall_8.xpos",                         "25"                    },
-  { "emc_wall_8.ypos",                         "31"                    },
+  { "emc_wall_8",                              "RocksEMC.pcx"          },
+  { "emc_wall_8.xpos",                         "8"                     },
+  { "emc_wall_8.ypos",                         "7"                     },
   { "emc_wall_8.frames",                       "1"                     },
-  { "emc_wall_8.scale_up_factor",              "2"                     },
 
   /* images for Diamond Caves style elements and actions */
 
@@ -3401,12 +3397,10 @@ struct ConfigInfo image_config[] =
   { "emc_gate_8_gray.EDITOR.xpos",             "3"                     },
   { "emc_gate_8_gray.EDITOR.ypos",             "7"                     },
 
-  { "emc_android",                             "emc_object.pcx"        },
-  { "emc_android.xpos",                                "7"                     },
-  { "emc_android.ypos",                                "13"                    },
+  { "emc_android",                             "RocksEMC.pcx"          },
+  { "emc_android.xpos",                                "0"                     },
+  { "emc_android.ypos",                                "8"                     },
   { "emc_android.frames",                      "8"                     },
-  { "emc_android.vertical",                    "true"                  },
-  { "emc_android.scale_up_factor",             "2"                     },
 
   { "emc_grass",                               "RocksEMC.pcx"          },
   { "emc_grass.xpos",                          "0"                     },
@@ -3465,30 +3459,26 @@ struct ConfigInfo image_config[] =
   { "emc_grass.digging.down.CRUMBLED.delay",   "2"                     },
   { "emc_grass.digging.down.CRUMBLED.anim_mode","linear"               },
 
-  { "emc_magic_ball",                          "emc_object.pcx"        },
-  { "emc_magic_ball.xpos",                     "22"                    },
-  { "emc_magic_ball.ypos",                     "18"                    },
+  { "emc_magic_ball",                          "RocksEMC.pcx"          },
+  { "emc_magic_ball.xpos",                     "0"                     },
+  { "emc_magic_ball.ypos",                     "9"                     },
   { "emc_magic_ball.frames",                   "1"                     },
-  { "emc_magic_ball.scale_up_factor",          "2"                     },
 
-  { "emc_magic_ball.active",                   "emc_object.pcx"        },
-  { "emc_magic_ball.active.xpos",              "22"                    },
-  { "emc_magic_ball.active.ypos",              "18"                    },
+  { "emc_magic_ball.active",                   "RocksEMC.pcx"          },
+  { "emc_magic_ball.active.xpos",              "0"                     },
+  { "emc_magic_ball.active.ypos",              "9"                     },
   { "emc_magic_ball.active.frames",            "16"                    },
-  { "emc_magic_ball.active.vertical",          "true"                  },
-  { "emc_magic_ball.active.scale_up_factor",   "2"                     },
+  { "emc_magic_ball.active.frames_per_line",   "8"                     },
 
-  { "emc_magic_ball_switch",                   "emc_object.pcx"        },
-  { "emc_magic_ball_switch.xpos",              "25"                    },
+  { "emc_magic_ball_switch",                   "RocksEMC.pcx"          },
+  { "emc_magic_ball_switch.xpos",              "8"                     },
   { "emc_magic_ball_switch.ypos",              "10"                    },
   { "emc_magic_ball_switch.frames",            "1"                     },
-  { "emc_magic_ball_switch.scale_up_factor",   "2"                     },
 
-  { "emc_magic_ball_switch.active",            "emc_object.pcx"        },
-  { "emc_magic_ball_switch.active.xpos",       "25"                    },
+  { "emc_magic_ball_switch.active",            "RocksEMC.pcx"          },
+  { "emc_magic_ball_switch.active.xpos",       "8"                     },
   { "emc_magic_ball_switch.active.ypos",       "9"                     },
   { "emc_magic_ball_switch.active.frames",     "1"                     },
-  { "emc_magic_ball_switch.active.scale_up_factor", "2"                        },
 
   { "emc_spring_bumper",                       "RocksEMC.pcx"          },
   { "emc_spring_bumper.xpos",                  "8"                     },
@@ -3520,67 +3510,55 @@ struct ConfigInfo image_config[] =
   { "emc_magnifier.ypos",                      "4"                     },
   { "emc_magnifier.frames",                    "1"                     },
 
-  { "emc_wall_9",                              "emc_object.pcx"        },
-  { "emc_wall_9.xpos",                         "26"                    },
-  { "emc_wall_9.ypos",                         "4"                     },
+  { "emc_wall_9",                              "RocksEMC.pcx"          },
+  { "emc_wall_9.xpos",                         "10"                    },
+  { "emc_wall_9.ypos",                         "5"                     },
   { "emc_wall_9.frames",                       "1"                     },
-  { "emc_wall_9.scale_up_factor",              "2"                     },
-  { "emc_wall_10",                             "emc_object.pcx"        },
-  { "emc_wall_10.xpos",                                "26"                    },
-  { "emc_wall_10.ypos",                                "5"                     },
+  { "emc_wall_10",                             "RocksEMC.pcx"          },
+  { "emc_wall_10.xpos",                                "10"                    },
+  { "emc_wall_10.ypos",                                "6"                     },
   { "emc_wall_10.frames",                      "1"                     },
-  { "emc_wall_10.scale_up_factor",             "2"                     },
-  { "emc_wall_11",                             "emc_object.pcx"        },
-  { "emc_wall_11.xpos",                                "26"                    },
-  { "emc_wall_11.ypos",                                "9"                     },
+  { "emc_wall_11",                             "RocksEMC.pcx"          },
+  { "emc_wall_11.xpos",                                "11"                    },
+  { "emc_wall_11.ypos",                                "5"                     },
   { "emc_wall_11.frames",                      "1"                     },
-  { "emc_wall_11.scale_up_factor",             "2"                     },
-  { "emc_wall_12",                             "emc_object.pcx"        },
-  { "emc_wall_12.xpos",                                "26"                    },
-  { "emc_wall_12.ypos",                                "10"                    },
+  { "emc_wall_12",                             "RocksEMC.pcx"          },
+  { "emc_wall_12.xpos",                                "11"                    },
+  { "emc_wall_12.ypos",                                "6"                     },
   { "emc_wall_12.frames",                      "1"                     },
-  { "emc_wall_12.scale_up_factor",             "2"                     },
-  { "emc_wall_13",                             "emc_object.pcx"        },
-  { "emc_wall_13.xpos",                                "25"                    },
-  { "emc_wall_13.ypos",                                "23"                    },
+  { "emc_wall_13",                             "RocksEMC.pcx"          },
+  { "emc_wall_13.xpos",                                "10"                    },
+  { "emc_wall_13.ypos",                                "7"                     },
   { "emc_wall_13.frames",                      "1"                     },
-  { "emc_wall_13.scale_up_factor",             "2"                     },
-  { "emc_wall_14",                             "emc_object.pcx"        },
-  { "emc_wall_14.xpos",                                "25"                    },
-  { "emc_wall_14.ypos",                                "24"                    },
+  { "emc_wall_14",                             "RocksEMC.pcx"          },
+  { "emc_wall_14.xpos",                                "10"                    },
+  { "emc_wall_14.ypos",                                "8"                     },
   { "emc_wall_14.frames",                      "1"                     },
-  { "emc_wall_14.scale_up_factor",             "2"                     },
-  { "emc_wall_15",                             "emc_object.pcx"        },
-  { "emc_wall_15.xpos",                                "25"                    },
-  { "emc_wall_15.ypos",                                "25"                    },
+  { "emc_wall_15",                             "RocksEMC.pcx"          },
+  { "emc_wall_15.xpos",                                "10"                    },
+  { "emc_wall_15.ypos",                                "9"                     },
   { "emc_wall_15.frames",                      "1"                     },
-  { "emc_wall_15.scale_up_factor",             "2"                     },
-  { "emc_wall_16",                             "emc_object.pcx"        },
-  { "emc_wall_16.xpos",                                "25"                    },
-  { "emc_wall_16.ypos",                                "26"                    },
+  { "emc_wall_16",                             "RocksEMC.pcx"          },
+  { "emc_wall_16.xpos",                                "10"                    },
+  { "emc_wall_16.ypos",                                "10"                    },
   { "emc_wall_16.frames",                      "1"                     },
-  { "emc_wall_16.scale_up_factor",             "2"                     },
 
-  { "emc_wall_slippery_1",                     "emc_object.pcx"        },
-  { "emc_wall_slippery_1.xpos",                        "25"                    },
-  { "emc_wall_slippery_1.ypos",                        "27"                    },
+  { "emc_wall_slippery_1",                     "RocksEMC.pcx"          },
+  { "emc_wall_slippery_1.xpos",                        "11"                    },
+  { "emc_wall_slippery_1.ypos",                        "7"                     },
   { "emc_wall_slippery_1.frames",              "1"                     },
-  { "emc_wall_slippery_1.scale_up_factor",     "2"                     },
-  { "emc_wall_slippery_2",                     "emc_object.pcx"        },
-  { "emc_wall_slippery_2.xpos",                        "25"                    },
-  { "emc_wall_slippery_2.ypos",                        "28"                    },
+  { "emc_wall_slippery_2",                     "RocksEMC.pcx"          },
+  { "emc_wall_slippery_2.xpos",                        "11"                    },
+  { "emc_wall_slippery_2.ypos",                        "8"                     },
   { "emc_wall_slippery_2.frames",              "1"                     },
-  { "emc_wall_slippery_2.scale_up_factor",     "2"                     },
-  { "emc_wall_slippery_3",                     "emc_object.pcx"        },
-  { "emc_wall_slippery_3.xpos",                        "25"                    },
-  { "emc_wall_slippery_3.ypos",                        "29"                    },
+  { "emc_wall_slippery_3",                     "RocksEMC.pcx"          },
+  { "emc_wall_slippery_3.xpos",                        "11"                    },
+  { "emc_wall_slippery_3.ypos",                        "9"                     },
   { "emc_wall_slippery_3.frames",              "1"                     },
-  { "emc_wall_slippery_3.scale_up_factor",     "2"                     },
-  { "emc_wall_slippery_4",                     "emc_object.pcx"        },
-  { "emc_wall_slippery_4.xpos",                        "25"                    },
-  { "emc_wall_slippery_4.ypos",                        "30"                    },
+  { "emc_wall_slippery_4",                     "RocksEMC.pcx"          },
+  { "emc_wall_slippery_4.xpos",                        "11"                    },
+  { "emc_wall_slippery_4.ypos",                        "10"                    },
   { "emc_wall_slippery_4.frames",              "1"                     },
-  { "emc_wall_slippery_4.scale_up_factor",     "2"                     },
 
   { "emc_fake_grass",                          "RocksEMC.pcx"          },
   { "emc_fake_grass.xpos",                     "0"                     },
@@ -3610,15 +3588,13 @@ struct ConfigInfo image_config[] =
   { "emc_dripper.xpos",                                "0"                     },
   { "emc_dripper.ypos",                                "0"                     },
   { "emc_dripper.frames",                      "1"                     },
-  { "emc_dripper.EDITOR",                      "emc_object.pcx"        },
-  { "emc_dripper.EDITOR.xpos",                 "25"                    },
-  { "emc_dripper.EDITOR.ypos",                 "15"                    },
-  { "emc_dripper.EDITOR.scale_up_factor",      "2"                     },
-  { "emc_dripper.active",                      "emc_object.pcx"        },
-  { "emc_dripper.active.xpos",                 "25"                    },
-  { "emc_dripper.active.ypos",                 "15"                    },
+  { "emc_dripper.EDITOR",                      "RocksEMC.pcx"          },
+  { "emc_dripper.EDITOR.xpos",                 "8"                     },
+  { "emc_dripper.EDITOR.ypos",                 "8"                     },
+  { "emc_dripper.active",                      "RocksEMC.pcx"          },
+  { "emc_dripper.active.xpos",                 "8"                     },
+  { "emc_dripper.active.ypos",                 "8"                     },
   { "emc_dripper.active.frames",               "1"                     },
-  { "emc_dripper.active.scale_up_factor",      "2"                     },
 
 #include "conf_chr.c"  /* include auto-generated data structure definitions */
 #include "conf_cus.c"  /* include auto-generated data structure definitions */
@@ -3627,13 +3603,21 @@ struct ConfigInfo image_config[] =
   /* images not associated to game elements (used for menu screens etc.) */
   /* keyword to stop parser: "NO_MORE_ELEMENT_IMAGES" <-- do not change! */
 
+#if 1
   /* !!! TEMPORARILY STORED HERE -- PROBABLY TO BE CHANGED !!! */
 
-  { "emc_object",                              "emc_object.pcx"        },
+  /* (for testing, change filename back to "emc_object dot pcx") */
+  { "emc_object",                              "RocksEMC.pcx"          },
+#if 0
   { "emc_object.scale_up_factor",              "2"                     },
+#endif
 
-  { "emc_sprite",                              "emc_sprite.pcx"        },
+  /* (for testing, change filename back to "emc_sprite dot pcx") */
+  { "emc_sprite",                              "RocksEMC.pcx"          },
+#if 0
   { "emc_sprite.scale_up_factor",              "2"                     },
+#endif
+#endif
 
   { "toon_1",                                  "RocksToons.pcx"        },
   { "toon_1.x",                                        "2"                     },
index 0cedaf281fa754879514175563021d218c31eaa4..a82deeada2c2424a3b9abec96536644ade0cf24e 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2005-07-24 14:45]"
+#define COMPILE_DATE_STRING "[2005-08-07 00:47]"
index 1ff0015f889c41ee87b02bc6794cf8b70e7a6189..f4b017cc724e5385409ac8d2a990833d57e8518b 100644 (file)
@@ -879,6 +879,9 @@ static struct
   char *text;
 } control_info[ED_NUM_CTRL_BUTTONS] =
 {
+  /* note: some additional characters are already reserved for "cheat mode"
+     shortcuts (":XYZ" style) -- for details, see "events.c" */
+
   { 's',       "draw single items"                     },
   { 'd',       "draw connected items"                  },
   { 'l',       "draw lines"                            },
@@ -2765,10 +2768,18 @@ static int editor_el_emerald_mine_club[] =
   EL_EMC_WALL_11,
   EL_EMC_WALL_12,
 
+#if RELEASE_311
+  EL_EMPTY,
+#else
   EL_EMC_ANDROID,
+#endif
   EL_BALLOON,
   EL_BALLOON_SWITCH_ANY,
+#if RELEASE_311
+  EL_EMPTY,
+#else
   EL_BALLOON_SWITCH_NONE,
+#endif
 
   EL_BALLOON_SWITCH_LEFT,
   EL_BALLOON_SWITCH_RIGHT,
@@ -2777,15 +2788,33 @@ static int editor_el_emerald_mine_club[] =
 
   EL_EMC_GRASS,
   EL_EMC_PLANT,
+#if RELEASE_311
+  EL_EMPTY,
+  EL_EMPTY,
+#else
   EL_EMC_LENSES,
   EL_EMC_MAGNIFIER,
+#endif
 
+#if RELEASE_311
+  EL_EMPTY,
+  EL_EMPTY,
+#else
   EL_EMC_MAGIC_BALL,
   EL_EMC_MAGIC_BALL_SWITCH,
+#endif
   EL_SPRING,
+#if RELEASE_311
+  EL_EMPTY,
+#else
   EL_EMC_SPRING_BUMPER,
+#endif
 
+#if RELEASE_311
+  EL_EMPTY,
+#else
   EL_EMC_DRIPPER,
+#endif
   EL_EMC_FAKE_GRASS,
   EL_EMPTY,
   EL_EMPTY,
@@ -7897,6 +7926,7 @@ static void SelectArea(int from_x, int from_y, int to_x, int to_y,
 #define CB_BRUSH_TO_LEVEL      2
 #define CB_DELETE_OLD_CURSOR   3
 #define CB_DUMP_BRUSH          4
+#define CB_DUMP_BRUSH_SMALL    5
 
 static void CopyBrushExt(int from_x, int from_y, int to_x, int to_y,
                         int button, int mode)
@@ -7908,7 +7938,8 @@ static void CopyBrushExt(int from_x, int from_y, int to_x, int to_y,
   int new_element = BUTTON_ELEMENT(button);
   int x, y;
 
-  if (mode == CB_DUMP_BRUSH)
+  if (mode == CB_DUMP_BRUSH ||
+      mode == CB_DUMP_BRUSH_SMALL)
   {
     if (!draw_with_brush)
     {
@@ -7955,10 +7986,12 @@ static void CopyBrushExt(int from_x, int from_y, int to_x, int to_y,
 
        if (IS_CUSTOM_ELEMENT(element))
          element_mapped = EL_CUSTOM_START;
-       else if (element > EL_ENVELOPE_4)
-         element_mapped = EL_CHAR_QUESTION;    /* change to EL_UNKNOWN ... */
+       else if (IS_GROUP_ELEMENT(element))
+         element_mapped = EL_GROUP_START;
+       else if (element >= NUM_FILE_ELEMENTS)
+         element_mapped = EL_UNKNOWN;
 
-       printf("`%03d", element_mapped);
+       printf("%c%03d", (mode == CB_DUMP_BRUSH ? '`' : '¸'), element_mapped);
 #endif
       }
 
@@ -8087,6 +8120,11 @@ void DumpBrush()
   CopyBrushExt(0, 0, 0, 0, 0, CB_DUMP_BRUSH);
 }
 
+void DumpBrush_Small()
+{
+  CopyBrushExt(0, 0, 0, 0, 0, CB_DUMP_BRUSH_SMALL);
+}
+
 static void FloodFill(int from_x, int from_y, int fill_element)
 {
   int i,x,y;
index 7eaa7743086727734557e56be986386037e1c369..62617108c26776cc2fe827ff51c2b72437ed26b2 100644 (file)
@@ -31,5 +31,6 @@ void RequestExitLevelEditor(boolean);
 void PrintEditorElementList();
 
 void DumpBrush();
+void DumpBrush_Small();
 
 #endif
index 6b5ec687d3aa6ae1000a8e9da1130bedade0d244..debb368b11c0d06426fc6b00898a04af2f1b7a37 100644 (file)
@@ -569,6 +569,10 @@ static void HandleKeysSpecial(Key key)
     {
       DumpBrush();
     }
+    else if (is_string_suffix(cheat_input, ":DDB"))
+    {
+      DumpBrush_Small();
+    }
   }
 }
 
index ba4c8f9d9ed8a7fe78d01489b9c511907eb882e1..b0d7ec6bfd1a670820bce99d0111fd67b8c7db58 100644 (file)
@@ -4404,9 +4404,9 @@ static void ActivateTimegateSwitch(int x, int y)
 
 void Impact(int x, int y)
 {
-  boolean lastline = (y == lev_fieldy-1);
+  boolean last_line = (y == lev_fieldy - 1);
   boolean object_hit = FALSE;
-  boolean impact = (lastline || object_hit);
+  boolean impact = (last_line || object_hit);
   int element = Feld[x][y];
   int smashed = EL_STEELWALL;
 
@@ -4414,7 +4414,7 @@ void Impact(int x, int y)
   printf("IMPACT!\n");
 #endif
 
-  if (!lastline)       /* check if element below was hit */
+  if (!last_line)      /* check if element below was hit */
   {
     if (Feld[x][y + 1] == EL_PLAYER_IS_LEAVING)
       return;
@@ -4435,10 +4435,10 @@ void Impact(int x, int y)
     if (object_hit)
       smashed = MovingOrBlocked2Element(x, y + 1);
 
-    impact = (lastline || object_hit);
+    impact = (last_line || object_hit);
   }
 
-  if (!lastline && smashed == EL_ACID) /* element falls into acid */
+  if (!last_line && smashed == EL_ACID)        /* element falls into acid */
   {
     SplashAcid(x, y + 1);
     return;
@@ -4637,7 +4637,7 @@ void Impact(int x, int y)
   }
 
   /* play sound of magic wall / mill */
-  if (!lastline &&
+  if (!last_line &&
       (Feld[x][y + 1] == EL_MAGIC_WALL_ACTIVE ||
        Feld[x][y + 1] == EL_BD_MAGIC_WALL_ACTIVE))
   {
@@ -4650,7 +4650,7 @@ void Impact(int x, int y)
   }
 
   /* play sound of object that hits the ground */
-  if (lastline || object_hit)
+  if (last_line || object_hit)
     PlayLevelSoundElementAction(x, y, element, ACTION_IMPACT);
 }
 
@@ -6461,6 +6461,10 @@ void StartMoving(int x, int y)
     ContinueMoving(x, y);
 }
 
+void dummy()
+{
+}
+
 void ContinueMoving(int x, int y)
 {
   int element = Feld[x][y];
@@ -6479,6 +6483,7 @@ void ContinueMoving(int x, int y)
 #else
   boolean pushed_by_player = Pushed[x][y];
 #endif
+  boolean last_line = (newy == lev_fieldy - 1);
 
   MovPos[x][y] += getElementMoveStepsize(x, y);
 
@@ -6774,20 +6779,19 @@ void ContinueMoving(int x, int y)
 #if USE_NEW_MOVE_STYLE
 #if 0
   if (CAN_FALL(element) && direction == MV_DOWN &&
-      (newy == lev_fieldy - 1 || !IS_FREE(x, newy + 1)) &&
-      IS_PLAYER(x, newy + 1))
+      !last_line && IS_PLAYER(x, newy + 1))
     printf("::: we would now kill the player [%d]\n", FrameCounter);
 #endif
 
   /* give the player one last chance (one more frame) to move away */
   if (CAN_FALL(element) && direction == MV_DOWN &&
-      (newy == lev_fieldy - 1 || !IS_FREE(x, newy + 1)) &&
-      ((newy < lev_fieldy - 1 && !IS_PLAYER(x, newy + 1)) ||
-       game.engine_version < VERSION_IDENT(3,1,1,0)))
+      (last_line || (!IS_FREE(x, newy + 1) &&
+                    (!IS_PLAYER(x, newy + 1) ||
+                     game.engine_version < VERSION_IDENT(3,1,1,0)))))
     Impact(x, newy);
 #else
   if (CAN_FALL(element) && direction == MV_DOWN &&
-      (newy == lev_fieldy - 1 || !IS_FREE(x, newy + 1)))
+      (last_line || !IS_FREE(x, newy + 1)))
     Impact(x, newy);
 #endif
 
index 6aac3b7d4db789b8f3d711a78096906f65658436..6287eea207642bdf86973d686e789c984bee2f25 100644 (file)
@@ -382,7 +382,8 @@ int cleanup_em_level(unsigned char *src, int length)
   length = 2172;
 
 #if 1
-  printf("::: EM level file version: %d\n", file_version);
+  if (options.debug)
+    printf("::: EM level file version: %d\n", file_version);
 #endif
 
   return file_version;
index 798f4b4aab05442ac4d6f0c40db79ce65d710d30..1f58073285447eaab1dac4f132d8be8288442f8c 100644 (file)
@@ -4710,7 +4710,12 @@ static char *getNewArtworkIdentifier(int type)
             artwork_current_identifier) != 0)
     artwork_new_identifier = artwork_current_identifier;
 
+#if 1
+  *(ARTWORK_CURRENT_IDENTIFIER_PTR(artwork, type))= artwork_current_identifier;
+#else
+  /* newer versions of gcc do not like this anymore :-/ */
   *(&(ARTWORK_CURRENT_IDENTIFIER(artwork, type))) = artwork_current_identifier;
+#endif
 
 #if 0
   if (type == ARTWORK_TYPE_GRAPHICS)
index aaf01eb7e99d70c806f148697b08a82444d27b96..5ac104c8a254688839d0f1111ce3f17efa951fc0 100644 (file)
@@ -744,11 +744,11 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap)
        break;
 
       case GDI_TYPE:
-       gi->type = va_arg(ap, unsigned long);
+       gi->type = va_arg(ap, unsigned int);
        break;
 
       case GDI_STATE:
-       gi->state = va_arg(ap, unsigned long);
+       gi->state = va_arg(ap, unsigned int);
        break;
 
       case GDI_ACTIVE:
@@ -770,18 +770,18 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap)
        break;
 
       case GDI_RADIO_NR:
-       gi->radio_nr = va_arg(ap, unsigned long);
+       gi->radio_nr = va_arg(ap, unsigned int);
        break;
 
       case GDI_NUMBER_VALUE:
-       gi->textinput.number_value = va_arg(ap, long);
+       gi->textinput.number_value = va_arg(ap, int);
        sprintf(gi->textinput.value, "%d", gi->textinput.number_value);
        strcpy(gi->textinput.last_value, gi->textinput.value);
        gi->textinput.cursor_position = strlen(gi->textinput.value);
        break;
 
       case GDI_NUMBER_MIN:
-       gi->textinput.number_min = va_arg(ap, long);
+       gi->textinput.number_min = va_arg(ap, int);
        if (gi->textinput.number_value < gi->textinput.number_min)
        {
          gi->textinput.number_value = gi->textinput.number_min;
@@ -791,7 +791,7 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap)
        break;
 
       case GDI_NUMBER_MAX:
-       gi->textinput.number_max = va_arg(ap, long);
+       gi->textinput.number_max = va_arg(ap, int);
        if (gi->textinput.number_value > gi->textinput.number_max)
        {
          gi->textinput.number_value = gi->textinput.number_max;
@@ -919,7 +919,7 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap)
        break;
 
       case GDI_EVENT_MASK:
-       gi->event_mask = va_arg(ap, unsigned long);
+       gi->event_mask = va_arg(ap, unsigned int);
        break;
 
       case GDI_AREA_SIZE:
index d69c40170c8d65d488dcad56ac876c9415c16961..ac14cb81f2b1d0e9dfecd733629c1c63799caa33 100644 (file)
@@ -213,8 +213,8 @@ struct GadgetInfo
   char info_text[MAX_INFO_TEXTSIZE];   /* short popup info text */
   int x, y;                            /* gadget position */
   int width, height;                   /* gadget size */
-  unsigned long type;                  /* type (button, text input, ...) */
-  unsigned long state;                 /* state (pressed, released, ...) */
+  unsigned int type;                   /* type (button, text input, ...) */
+  unsigned int state;                  /* state (pressed, released, ...) */
   boolean checked;                     /* check/radio button state */
   int radio_nr;                                /* number of radio button series */
   boolean mapped;                      /* gadget is mapped on the screen */
@@ -226,7 +226,7 @@ struct GadgetInfo
   struct GadgetDesign design[2];       /* 0: normal; 1: pressed */
   struct GadgetDesign alt_design[2];   /* alternative design */
   struct GadgetDecoration deco;                /* decoration on top of gadget */
-  unsigned long event_mask;            /* possible events for this gadget */
+  unsigned int event_mask;             /* possible events for this gadget */
   struct GadgetEvent event;            /* actual gadget event */
   gadget_function callback_info;       /* function for pop-up info text */
   gadget_function callback_action;     /* function for gadget action */
index 1475fe1e45ce4592daa77197704e9d005f5ac1c5..09ec64f6f869f423e7192d3c3ded3bce679cc6d6 100644 (file)
@@ -718,7 +718,7 @@ void ZoomPixmap(Display *display, GC gc, Pixmap src_pixmap, Pixmap dst_pixmap,
            for (i = 0; i < bytes_per_pixel; i++)
              *dst_ptr++ = *(src_ptr + i);
 
-         src_ptr += i;
+         src_ptr += bytes_per_pixel;
        }
       }
     }
index a3c3247978f80b38b24759f5d34bfbf6fc7871c1..8d8f8aae9ce92700e95e162f7003688a12586081 100644 (file)
@@ -2122,6 +2122,10 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info,
     boolean base_prefix_found = FALSE;
     boolean parameter_suffix_found = FALSE;
 
+#if 0
+    printf("::: examining '%s' -> '%s'\n", token, HASH_ITERATION_VALUE(itr));
+#endif
+
     /* skip all parameter definitions (handled by read_token_parameters()) */
     for (i = 0; i < num_suffix_list_entries && !parameter_suffix_found; i++)
     {
index 967fbcfacd60a10e9f36eacfdcd74b3fbd11a3a7..7c4fc88085bc28bace615f82fec30a274e7901a5 100644 (file)
@@ -302,8 +302,8 @@ char *setLevelArtworkDir(TreeInfo *ti)
   if (ti == NULL || leveldir_current == NULL)
     return NULL;
 
-  artwork_path_ptr = &(LEVELDIR_ARTWORK_PATH(leveldir_current, ti->type));
-  artwork_set_ptr  = &(LEVELDIR_ARTWORK_SET( leveldir_current, ti->type));
+  artwork_path_ptr = LEVELDIR_ARTWORK_PATH_PTR(leveldir_current, ti->type);
+  artwork_set_ptr  = LEVELDIR_ARTWORK_SET_PTR( leveldir_current, ti->type);
 
   checked_free(*artwork_path_ptr);
 
index 95c18af1076f911591faa3db707061bd4489d01f..0b210ed01f0584645db71364b390fbfa5700432a 100644 (file)
 
 
 /* values for artwork handling */
+#define LEVELDIR_ARTWORK_SET_PTR(leveldir, type)                       \
+                               ((type) == ARTWORK_TYPE_GRAPHICS ?      \
+                                &(leveldir)->graphics_set :            \
+                                (type) == ARTWORK_TYPE_SOUNDS ?        \
+                                &(leveldir)->sounds_set :              \
+                                &(leveldir)->music_set)
+
 #define LEVELDIR_ARTWORK_SET(leveldir, type)                           \
                                ((type) == ARTWORK_TYPE_GRAPHICS ?      \
                                 (leveldir)->graphics_set :             \
                                 (leveldir)->sounds_set :               \
                                 (leveldir)->music_set)
 
+#define LEVELDIR_ARTWORK_PATH_PTR(leveldir, type)                      \
+                               ((type) == ARTWORK_TYPE_GRAPHICS ?      \
+                                &(leveldir)->graphics_path :           \
+                                (type) == ARTWORK_TYPE_SOUNDS ?        \
+                                &(leveldir)->sounds_path :             \
+                                &(leveldir)->music_path)
+
 #define LEVELDIR_ARTWORK_PATH(leveldir, type)                          \
                                ((type) == ARTWORK_TYPE_GRAPHICS ?      \
                                 (leveldir)->graphics_path :            \
                                 (artwork).snd_first :  \
                                 (artwork).mus_first)
 
+#define ARTWORK_CURRENT_IDENTIFIER_PTR(artwork, type)                  \
+                               ((type) == ARTWORK_TYPE_GRAPHICS ?      \
+                                &(artwork).gfx_current_identifier :    \
+                                (type) == ARTWORK_TYPE_SOUNDS ?        \
+                                &(artwork).snd_current_identifier :    \
+                                &(artwork).mus_current_identifier)
+
 #define ARTWORK_CURRENT_IDENTIFIER(artwork, type)                      \
                                ((type) == ARTWORK_TYPE_GRAPHICS ?      \
                                 (artwork).gfx_current_identifier :     \
index 55aba3704c92e06377875d6604db34dd7256816d..2a2714a830ab47b1ec5b2f1ddd289e024e0e14a2 100644 (file)
 
 /* program information and versioning definitions */
 
-#if 1
+#define RELEASE_311                    TRUE
+
+#if RELEASE_311
 #define PROGRAM_VERSION_MAJOR          3
 #define PROGRAM_VERSION_MINOR          1
 #define PROGRAM_VERSION_PATCH          1
 #define PROGRAM_VERSION_BUILD          0
 #else
-#define PROGRAM_VERSION_MAJOR          3
-#define PROGRAM_VERSION_MINOR          2
-#define PROGRAM_VERSION_PATCH          0
-#define PROGRAM_VERSION_BUILD          3
+/* !!! make sure that packaging script can find unique version number !!! */
+#define X_PROGRAM_VERSION_MAJOR                3
+#define X_PROGRAM_VERSION_MINOR                2
+#define X_PROGRAM_VERSION_PATCH                0
+#define X_PROGRAM_VERSION_BUILD                3
 #endif
 
 #define PROGRAM_TITLE_STRING           "Rocks'n'Diamonds"
 #define PROGRAM_AUTHOR_STRING          "Holger Schemel"
-#define PROGRAM_COPYRIGHT_STRING       "Copyright ©1995-2004 by Holger Schemel"
+#define PROGRAM_COPYRIGHT_STRING       "Copyright ©1995-2005 by Holger Schemel"
 
 #define ICON_TITLE_STRING              PROGRAM_TITLE_STRING
 #define COOKIE_PREFIX                  "ROCKSNDIAMONDS"