rnd-20030210-1-src
authorHolger Schemel <info@artsoft.org>
Mon, 10 Feb 2003 01:43:59 +0000 (02:43 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:40:20 +0000 (10:40 +0200)
17 files changed:
src/cartoons.c
src/conf_gfx.c
src/conf_gfx.h
src/conftime.h
src/editor.c
src/files.c
src/game.c
src/init.c
src/libgame/image.c
src/libgame/image.h
src/libgame/misc.c
src/libgame/sound.c
src/libgame/sound.h
src/libgame/system.h
src/libgame/toons.c
src/libgame/toons.h
src/main.h

index eb43b98d309b5643c6c647f58ae73e5fd9d2db97..b95525049e6cf613d8ea1b2a2a36f1ee16f30b14 100644 (file)
 
 
 /* values for toon definition */
-#if 0
-#define NUM_TOONS      18
-#else
-#define NUM_TOONS      6
-#endif
+#define MAX_NUM_TOONS                  20
 
-#define DWARF_XSIZE    40
-#define DWARF_YSIZE    48
-#define DWARF_X                2
-#define DWARF_Y                72
-#define DWARF2_Y       186
-#define DWARF_FRAMES   8
-#define DWARF_DELAY    5
-#define DWARF_STEPSIZE 4
-#define JUMPER_XSIZE   48
-#define JUMPER_YSIZE   56
-#define JUMPER_X       2
-#define JUMPER_Y       125
-#define JUMPER_FRAMES  8
-#define JUMPER_DELAY   5
-#define JUMPER_STEPSIZE        4
-#define CLOWN_XSIZE    80
-#define CLOWN_YSIZE    110
-#define CLOWN_X                327
-#define CLOWN_Y                10
-#define CLOWN_FRAMES   1
-#define CLOWN_DELAY    5
-#define CLOWN_STEPSIZE 4
-#define BIRD_XSIZE     32
-#define BIRD_YSIZE     30
-#define BIRD1_X                2
-#define BIRD1_Y                2
-#define BIRD2_X                2
-#define BIRD2_Y                37
-#define BIRD_FRAMES    8
-#define BIRD_DELAY     2
-#define BIRD_STEPSIZE  4
-
-struct ToonInfo toons[NUM_TOONS] =
-{
-#if 0
-  {
-    IMG_GLOBAL_TOONS,
-    DWARF_XSIZE, DWARF_YSIZE,
-    DWARF_X, DWARF_Y,
-    DWARF_FRAMES,
-    DWARF_DELAY,
-    DWARF_STEPSIZE,
-    ANIM_LOOP,
-    ANIMDIR_RIGHT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_GLOBAL_TOONS,
-    DWARF_XSIZE, DWARF_YSIZE,
-    DWARF_X, DWARF2_Y,
-    DWARF_FRAMES,
-    DWARF_DELAY,
-    DWARF_STEPSIZE,
-    ANIM_LOOP,
-    ANIMDIR_LEFT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_GLOBAL_TOONS,
-    JUMPER_XSIZE, JUMPER_YSIZE,
-    JUMPER_X, JUMPER_Y,
-    JUMPER_FRAMES,
-    JUMPER_DELAY,
-    JUMPER_STEPSIZE,
-    ANIM_LOOP,
-    ANIMDIR_RIGHT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_GLOBAL_TOONS,
-    CLOWN_XSIZE, CLOWN_YSIZE,
-    CLOWN_X, CLOWN_Y,
-    CLOWN_FRAMES,
-    CLOWN_DELAY,
-    CLOWN_STEPSIZE,
-    ANIM_LOOP,
-    ANIMDIR_UP,
-    ANIMPOS_ANY
-  },
-  {
-    IMG_GLOBAL_TOONS,
-    BIRD_XSIZE, BIRD_YSIZE,
-    BIRD1_X, BIRD1_Y,
-    BIRD_FRAMES,
-    BIRD_DELAY,
-    BIRD_STEPSIZE,
-    ANIM_PINGPONG,
-    ANIMDIR_RIGHT,
-    ANIMPOS_UPPER
-  },
-  {
-    IMG_GLOBAL_TOONS,
-    BIRD_XSIZE, BIRD_YSIZE,
-    BIRD2_X, BIRD2_Y,
-    BIRD_FRAMES,
-    BIRD_DELAY,
-    BIRD_STEPSIZE,
-    ANIM_PINGPONG,
-    ANIMDIR_LEFT,
-    ANIMPOS_UPPER
-  },
-#else
-  {
-    IMG_TOON_1,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_RIGHT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_TOON_2,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_LEFT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_TOON_3,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_RIGHT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_TOON_4,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_UP,
-    ANIMPOS_ANY
-  },
-  {
-    IMG_TOON_5,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_RIGHT,
-    ANIMPOS_UPPER
-  },
-  {
-    IMG_TOON_6,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_LEFT,
-    ANIMPOS_UPPER
-  },
-#endif
-
-#if 0
-  {
-    IMG_PLAYER1_MOVING_LEFT,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_LEFT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_PLAYER1_MOVING_RIGHT,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_RIGHT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_PENGUIN_MOVING_LEFT,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_LEFT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_PENGUIN_MOVING_RIGHT,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_RIGHT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_MOLE_MOVING_LEFT,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_LEFT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_MOLE_MOVING_RIGHT,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_RIGHT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_PIG_MOVING_LEFT,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_LEFT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_PIG_MOVING_RIGHT,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_RIGHT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_DRAGON_MOVING_LEFT,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_LEFT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_DRAGON_MOVING_RIGHT,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_RIGHT,
-    ANIMPOS_DOWN
-  },
-  {
-    IMG_SATELLITE_MOVING,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_LEFT,
-    ANIMPOS_ANY
-  },
-  {
-    IMG_SATELLITE_MOVING,
-    -1, -1,
-    -1, -1,
-    -1,
-    -1,
-    -1,
-    -1,
-    ANIMDIR_RIGHT,
-    ANIMPOS_ANY
-  },
-#endif
-
-};
+static struct ToonInfo toons[MAX_NUM_TOONS];
 
 static void PrepareBackbuffer()
 {
@@ -368,11 +59,16 @@ boolean ToonNeedsRedraw()
 
 void InitToons()
 {
+  int num_toons = MAX_NUM_TOONS;
   int i;
 
-  for (i=0; i<NUM_TOONS; i++)
+  if (global.num_toons > 0 && global.num_toons < MAX_NUM_TOONS)
+    num_toons = global.num_toons;
+
+  for (i=0; i < num_toons; i++)
   {
-    int graphic = toons[i].graphic;
+    int graphic = IMG_TOON_1 + i;
+    struct FileInfo *image = getImageListEntry(graphic);
 
     toons[i].bitmap = graphic_info[graphic].bitmap;
 
@@ -389,11 +85,14 @@ void InitToons()
 
     toons[i].step_offset = graphic_info[graphic].step_offset;
     toons[i].step_delay  = graphic_info[graphic].step_delay;
+
+    toons[i].direction = image->parameter[GFX_ARG_DIRECTION];
+    toons[i].position = image->parameter[GFX_ARG_POSITION];
   }
 
   InitToonScreen(bitmap_db_door,
                 BackToFront, PrepareBackbuffer, ToonNeedsRedraw,
-                toons, NUM_TOONS,
+                toons, num_toons,
                 REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,
                 GAME_FRAME_DELAY);
 }
index e96e5de528bdc8d83337632e46a3f38096683407..830e88d2fa43355b116eb16ff086e2fe277b443b 100644 (file)
@@ -43,6 +43,8 @@ struct ConfigInfo image_config_suffix[] =
   { ".global_sync",                    "false",        TYPE_BOOLEAN },
   { ".step_offset",                    "4",            TYPE_INTEGER },
   { ".step_delay",                     "1",            TYPE_INTEGER },
+  { ".direction",                      ARG_UNDEFINED,  TYPE_STRING  },
+  { ".position",                       ARG_UNDEFINED,  TYPE_STRING  },
   { ".name",                           ARG_UNDEFINED,  TYPE_STRING  },
 
   { NULL,                              NULL,           0            }
@@ -2693,10 +2695,6 @@ 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! */
 
-  { "global.border",                           "RocksScreen.pcx"       },
-  { "global.door",                             "RocksDoor.pcx"         },
-  { "global.toons",                            "RocksToons.pcx"        },
-
   { "toon_1",                                  "RocksToons.pcx"        },
   { "toon_1.x",                                        "2"                     },
   { "toon_1.y",                                        "72"                    },
@@ -2706,6 +2704,8 @@ struct ConfigInfo image_config[] =
   { "toon_1.delay",                            "1"                     },
   { "toon_1.step_offset",                      "4"                     },
   { "toon_1.step_delay",                       "5"                     },
+  { "toon_1.direction",                                "right"                 },
+  { "toon_1.position",                         "bottom"                },
 
   { "toon_2",                                  "RocksToons.pcx"        },
   { "toon_2.x",                                        "2"                     },
@@ -2716,6 +2716,8 @@ struct ConfigInfo image_config[] =
   { "toon_2.delay",                            "1"                     },
   { "toon_2.step_offset",                      "4"                     },
   { "toon_2.step_delay",                       "5"                     },
+  { "toon_2.direction",                                "left"                  },
+  { "toon_2.position",                         "bottom"                },
 
   { "toon_3",                                  "RocksToons.pcx"        },
   { "toon_3.x",                                        "2"                     },
@@ -2726,6 +2728,8 @@ struct ConfigInfo image_config[] =
   { "toon_3.delay",                            "1"                     },
   { "toon_3.step_offset",                      "4"                     },
   { "toon_3.step_delay",                       "5"                     },
+  { "toon_3.direction",                                "right"                 },
+  { "toon_3.position",                         "bottom"                },
 
   { "toon_4",                                  "RocksToons.pcx"        },
   { "toon_4.x",                                        "327"                   },
@@ -2736,6 +2740,8 @@ struct ConfigInfo image_config[] =
   { "toon_4.delay",                            "1"                     },
   { "toon_4.step_offset",                      "1"                     },
   { "toon_4.step_delay",                       "1"                     },
+  { "toon_4.direction",                                "up"                    },
+  { "toon_4.position",                         "any"                   },
 
   { "toon_5",                                  "RocksToons.pcx"        },
   { "toon_5.x",                                        "2"                     },
@@ -2747,6 +2753,8 @@ struct ConfigInfo image_config[] =
   { "toon_5.mode_pingpong2",                   "true"                  },
   { "toon_5.step_offset",                      "2"                     },
   { "toon_5.step_delay",                       "1"                     },
+  { "toon_5.direction",                                "right"                 },
+  { "toon_5.position",                         "upper"                 },
 
   { "toon_6",                                  "RocksToons.pcx"        },
   { "toon_6.x",                                        "2"                     },
@@ -2758,6 +2766,127 @@ struct ConfigInfo image_config[] =
   { "toon_6.mode_pingpong2",                   "true"                  },
   { "toon_6.step_offset",                      "2"                     },
   { "toon_6.step_delay",                       "1"                     },
+  { "toon_6.direction",                                "left"                  },
+  { "toon_6.position",                         "upper"                 },
+
+  { "toon_7",                                  "RocksHeroes.pcx"       },
+  { "toon_7.xpos",                             "0"                     },
+  { "toon_7.ypos",                             "1"                     },
+  { "toon_7.frames",                           "4"                     },
+  { "toon_7.delay",                            "4"                     },
+  { "toon_7.direction",                                "left"                  },
+  { "toon_7.position",                         "bottom"                },
+
+  { "toon_8",                                  "RocksHeroes.pcx"       },
+  { "toon_8.xpos",                             "4"                     },
+  { "toon_8.ypos",                             "1"                     },
+  { "toon_8.frames",                           "4"                     },
+  { "toon_8.delay",                            "4"                     },
+  { "toon_8.direction",                                "right"                 },
+  { "toon_8.position",                         "bottom"                },
+
+  { "toon_9",                                  "RocksHeroes.pcx"       },
+  { "toon_9.xpos",                             "8"                     },
+  { "toon_9.ypos",                             "7"                     },
+  { "toon_9.frames",                           "4"                     },
+  { "toon_9.delay",                            "2"                     },
+  { "toon_9.direction",                                "left"                  },
+  { "toon_9.position",                         "bottom"                },
+
+  { "toon_10",                                 "RocksHeroes.pcx"       },
+  { "toon_10.xpos",                            "12"                    },
+  { "toon_10.ypos",                            "7"                     },
+  { "toon_10.frames",                          "4"                     },
+  { "toon_10.delay",                           "2"                     },
+  { "toon_10.direction",                       "right"                 },
+  { "toon_10.position",                                "bottom"                },
+
+  { "toon_11",                                 "RocksHeroes.pcx"       },
+  { "toon_11.xpos",                            "8"                     },
+  { "toon_11.ypos",                            "5"                     },
+  { "toon_11.frames",                          "4"                     },
+  { "toon_11.delay",                           "2"                     },
+  { "toon_11.direction",                       "left"                  },
+  { "toon_11.position",                                "bottom"                },
+
+  { "toon_12",                                 "RocksHeroes.pcx"       },
+  { "toon_12.xpos",                            "12"                    },
+  { "toon_12.ypos",                            "5"                     },
+  { "toon_12.frames",                          "4"                     },
+  { "toon_12.delay",                           "2"                     },
+  { "toon_12.direction",                       "right"                 },
+  { "toon_12.position",                                "bottom"                },
+
+  { "toon_13",                                 "RocksHeroes.pcx"       },
+  { "toon_13.xpos",                            "8"                     },
+  { "toon_13.ypos",                            "1"                     },
+  { "toon_13.frames",                          "4"                     },
+  { "toon_13.delay",                           "2"                     },
+  { "toon_13.direction",                       "left"                  },
+  { "toon_13.position",                                "bottom"                },
+
+  { "toon_14",                                 "RocksHeroes.pcx"       },
+  { "toon_14.xpos",                            "12"                    },
+  { "toon_14.ypos",                            "1"                     },
+  { "toon_14.frames",                          "4"                     },
+  { "toon_14.delay",                           "2"                     },
+  { "toon_14.direction",                       "right"                 },
+  { "toon_14.position",                                "bottom"                },
+
+  { "toon_15",                                 "RocksHeroes.pcx"       },
+  { "toon_15.xpos",                            "8"                     },
+  { "toon_15.ypos",                            "3"                     },
+  { "toon_15.frames",                          "4"                     },
+  { "toon_15.delay",                           "2"                     },
+  { "toon_15.direction",                       "left"                  },
+  { "toon_15.position",                                "bottom"                },
+
+  { "toon_16",                                 "RocksHeroes.pcx"       },
+  { "toon_16.xpos",                            "12"                    },
+  { "toon_16.ypos",                            "3"                     },
+  { "toon_16.frames",                          "4"                     },
+  { "toon_16.delay",                           "2"                     },
+  { "toon_16.direction",                       "right"                 },
+  { "toon_16.position",                                "bottom"                },
+
+  { "toon_17",                                 "RocksHeroes.pcx"       },
+  { "toon_17.xpos",                            "8"                     },
+  { "toon_17.ypos",                            "9"                     },
+  { "toon_17.frames",                          "8"                     },
+  { "toon_17.delay",                           "2"                     },
+  { "toon_17.direction",                       "left"                  },
+  { "toon_17.position",                                "any"                   },
+
+  { "toon_18",                                 "RocksHeroes.pcx"       },
+  { "toon_18.xpos",                            "8"                     },
+  { "toon_18.ypos",                            "9"                     },
+  { "toon_18.frames",                          "8"                     },
+  { "toon_18.delay",                           "2"                     },
+  { "toon_18.direction",                       "right"                 },
+  { "toon_18.position",                                "any"                   },
+
+  { "toon_19",                                 "RocksElements.pcx"     },
+  { "toon_19.xpos",                            "8"                     },
+  { "toon_19.ypos",                            "0"                     },
+  { "toon_19.frames",                          "2"                     },
+  { "toon_19.delay",                           "4"                     },
+  { "toon_19.direction",                       "down"                  },
+  { "toon_19.position",                                "any"                   },
+
+  { "toon_20",                                 "RocksElements.pcx"     },
+  { "toon_20.xpos",                            "10"                    },
+  { "toon_20.ypos",                            "0"                     },
+  { "toon_20.frames",                          "2"                     },
+  { "toon_20.delay",                           "4"                     },
+  { "toon_20.direction",                       "down"                  },
+  { "toon_20.position",                                "any"                   },
+
+  { "global.num_toons",                                "20"                    },
+
+  { "global.border",                           "RocksScreen.pcx"       },
+  { "global.door",                             "RocksDoor.pcx"         },
+
+  { "menu.main.hide_static_text",              "false"                 },
 
   { "font.big",                                        "RocksFontBig.pcx"      },
   { "font.medium",                             "RocksFontMedium.pcx"   },
index b2b0dab091e2220e9985a320852360d9ae28dd07..9244c8dd1729b7848be00062cc905c675e276e9c 100644 (file)
 #define IMG_CUSTOM_126                                 764
 #define IMG_CUSTOM_127                                 765
 #define IMG_CUSTOM_128                                 766
-#define IMG_GLOBAL_BORDER                              767
-#define IMG_GLOBAL_DOOR                                        768
-#define IMG_GLOBAL_TOONS                               769
-#define IMG_TOON_1                                     770
-#define IMG_TOON_2                                     771
-#define IMG_TOON_3                                     772
-#define IMG_TOON_4                                     773
-#define IMG_TOON_5                                     774
-#define IMG_TOON_6                                     775
-#define IMG_FONT_BIG                                   776
-#define IMG_FONT_MEDIUM                                        777
-#define IMG_FONT_SMALL                                 778
-#define IMG_FONT_EM                                    779
-#define IMG_BACKGROUND_DEFAULT                         780
-#define IMG_BACKGROUND_DOOR                            781
-#define IMG_BACKGROUND_MAIN                            782
-#define IMG_BACKGROUND_LEVEL_SERIES                    783
-#define IMG_BACKGROUND_HALL_OF_FAME                    784
-#define IMG_BACKGROUND_EDITOR_SETTINGS_LEVEL           785
-#define IMG_BACKGROUND_EDITOR_SETTINGS_ELEMENT         786
-#define IMG_BACKGROUND_INFO                            787
-#define IMG_BACKGROUND_SETUP                           788
-#define IMG_INFO_FONT_EM_1                             789
-#define IMG_INFO_FONT_EM_2                             790
-#define IMG_INFO_FONT_EM_3                             791
-#define IMG_INFO_FONT_EM_4                             792
-#define IMG_INFO_FONT_EM_5                             793
+#define IMG_TOON_1                                     767
+#define IMG_TOON_2                                     768
+#define IMG_TOON_3                                     769
+#define IMG_TOON_4                                     770
+#define IMG_TOON_5                                     771
+#define IMG_TOON_6                                     772
+#define IMG_TOON_7                                     773
+#define IMG_TOON_8                                     774
+#define IMG_TOON_9                                     775
+#define IMG_TOON_10                                    776
+#define IMG_TOON_11                                    777
+#define IMG_TOON_12                                    778
+#define IMG_TOON_13                                    779
+#define IMG_TOON_14                                    780
+#define IMG_TOON_15                                    781
+#define IMG_TOON_16                                    782
+#define IMG_TOON_17                                    783
+#define IMG_TOON_18                                    784
+#define IMG_TOON_19                                    785
+#define IMG_TOON_20                                    786
+#define IMG_GLOBAL_BORDER                              787
+#define IMG_GLOBAL_DOOR                                        788
+#define IMG_FONT_BIG                                   789
+#define IMG_FONT_MEDIUM                                        790
+#define IMG_FONT_SMALL                                 791
+#define IMG_FONT_EM                                    792
+#define IMG_BACKGROUND_DEFAULT                         793
+#define IMG_BACKGROUND_DOOR                            794
+#define IMG_BACKGROUND_MAIN                            795
+#define IMG_BACKGROUND_LEVEL_SERIES                    796
+#define IMG_BACKGROUND_HALL_OF_FAME                    797
+#define IMG_BACKGROUND_EDITOR_SETTINGS_LEVEL           798
+#define IMG_BACKGROUND_EDITOR_SETTINGS_ELEMENT         799
+#define IMG_BACKGROUND_INFO                            800
+#define IMG_BACKGROUND_SETUP                           801
+#define IMG_INFO_FONT_EM_1                             802
+#define IMG_INFO_FONT_EM_2                             803
+#define IMG_INFO_FONT_EM_3                             804
+#define IMG_INFO_FONT_EM_4                             805
+#define IMG_INFO_FONT_EM_5                             806
 
-#define NUM_IMAGE_FILES                                        794
+#define NUM_IMAGE_FILES                                        807
 
 #endif /* CONF_GFX_H */
index 71df4b0964b8cde2f35bb8a3c07f9d94be5c06dd..9c30de7e9448c0b8eff9fb8e581662af9abc63c9 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-02-09 21:58]"
+#define COMPILE_DATE_STRING "[2003-02-10 02:41]"
index 407d31073c8be9c6bd98c6f1a7e526297659a213..633a5586256d065d67ddffdf4e666e20eda4c762 100644 (file)
 #define GADGET_ID_CUSTOM_INDESTRUCTIBLE        78
 #define GADGET_ID_CUSTOM_CAN_FALL      79
 #define GADGET_ID_CUSTOM_CAN_SMASH     80
-#define GADGET_ID_CUSTOM_SLIPPERY      81
+#define GADGET_ID_CUSTOM_PUSHABLE      81
+#define GADGET_ID_CUSTOM_SLIPPERY      82
 
 /* gadgets for buttons in element list */
-#define GADGET_ID_ELEMENTLIST_FIRST    82
+#define GADGET_ID_ELEMENTLIST_FIRST    83
 #define GADGET_ID_ELEMENTLIST_LAST     (GADGET_ID_ELEMENTLIST_FIRST +  \
                                        ED_NUM_ELEMENTLIST_BUTTONS - 1)
 
 #define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE        5
 #define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL      6
 #define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH     7
-#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY      8
+#define ED_CHECKBUTTON_ID_CUSTOM_PUSHABLE      8
+#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY      9
 
-#define ED_NUM_CHECKBUTTONS                    9
+#define ED_NUM_CHECKBUTTONS                    10
 
 #define ED_CHECKBUTTON_ID_LEVEL_FIRST  ED_CHECKBUTTON_ID_DOUBLE_SPEED
 #define ED_CHECKBUTTON_ID_LEVEL_LAST   ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
@@ -439,6 +441,7 @@ static struct
   boolean indestructible;
   boolean can_fall;
   boolean can_smash;
+  boolean pushable;
   boolean slippery;
 } custom_element_properties[NUM_CUSTOM_ELEMENTS];
 
@@ -717,6 +720,12 @@ static struct
   },
   {
     ED_SETTINGS_XPOS,                  ED_COUNTER_YPOS(7),
+    GADGET_ID_CUSTOM_PUSHABLE,
+    &custom_element_properties[0].pushable,
+    "pushable",                                "element can be pushed"
+  },
+  {
+    ED_SETTINGS_XPOS,                  ED_COUNTER_YPOS(8),
     GADGET_ID_CUSTOM_SLIPPERY,
     &custom_element_properties[0].slippery,
     "slippery",                                "other elements can fall down from it"
@@ -2490,6 +2499,9 @@ static void CopyCustomElementPropertiesToEditor()
     custom_element_properties[i].can_smash =
       ((properties & EP_BIT_CAN_SMASH) != 0 ? TRUE : FALSE);
 
+    custom_element_properties[i].pushable =
+      ((properties & EP_BIT_PUSHABLE) != 0 ? TRUE : FALSE);
+
     custom_element_properties[i].slippery =
       ((properties & EP_BIT_SLIPPERY) != 0 ? TRUE : FALSE);
   }
@@ -2520,6 +2532,11 @@ static void CopyCustomElementPropertiesToGame()
     else
       Properties1[element] &= ~EP_BIT_CAN_SMASH;
 
+    if (custom_element_properties[i].pushable)
+      Properties1[element] |= EP_BIT_PUSHABLE;
+    else
+      Properties1[element] &= ~EP_BIT_PUSHABLE;
+
     if (custom_element_properties[i].slippery)
       Properties1[element] |= EP_BIT_SLIPPERY;
     else
@@ -3173,6 +3190,18 @@ static void DrawPropertiesWindow()
                 GDI_CHECKED, *checkbutton_info[i].value, GDI_END);
     MapCheckbuttonGadget(i);
 
+    /* draw checkbutton gadget */
+    i = ED_CHECKBUTTON_ID_CUSTOM_PUSHABLE;
+    x = checkbutton_info[i].x + xoffset_right2;
+    y = checkbutton_info[i].y + yoffset_right2;
+
+    checkbutton_info[i].value = &custom_element_properties[nr].pushable;
+
+    DrawTextF(x, y, font_color, checkbutton_info[i].text);
+    ModifyGadget(level_editor_gadget[checkbutton_info[i].gadget_id],
+                GDI_CHECKED, *checkbutton_info[i].value, GDI_END);
+    MapCheckbuttonGadget(i);
+
     /* draw checkbutton gadget */
     i = ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY;
     x = checkbutton_info[i].x + xoffset_right2;
index a453554b856f9cde652bf1a25e1c9837f17f7be3..902b3b890889fdb6d30e812d43ce7f60c2987c38 100644 (file)
@@ -1701,15 +1701,20 @@ void LoadSpecialMenuDesignSettings()
   struct SetupFileList *setup_file_list;
   char *value;
 
+  /* !!! CHANGE THIS !!! (redundant initialization) !!! */
   gfx.menu_main_hide_static_text = FALSE;
+  global.num_toons = 20;
 
   if ((setup_file_list = loadSetupFileList(filename)) == NULL)
     return;
 
   value = getTokenValue(setup_file_list, "menu.main.hide_static_text");
-
   if (value != NULL)
     gfx.menu_main_hide_static_text = get_boolean_from_string(value);
 
+  value = getTokenValue(setup_file_list, "global.num_toons");
+  if (value != NULL)
+    global.num_toons = get_integer_from_string(value);
+
   freeSetupFileList(setup_file_list);
 }
index 4a297314858004b037a51cfff7eff27e3d91f7de..5f3f9689f3cdbd505d7c56a5e3533afdb358337e 100644 (file)
@@ -6068,7 +6068,9 @@ int DigField(struct PlayerInfo *player,
     case EL_SPRING:
       if (mode == DF_SNAP)
        return MF_NO_ACTION;
+
       /* no "break" -- fall through to next case */
+
       /* the following elements can be pushed by "snapping" */
     case EL_BD_ROCK:
       if (dy)
@@ -6089,7 +6091,8 @@ int DigField(struct PlayerInfo *player,
        player->push_delay = FrameCounter;
 #if 0
       if (!FrameReached(&player->push_delay, player->push_delay_value) &&
-         !tape.playing && element != EL_SPRING)
+         !tape.playing &&
+         element != EL_SPRING)
        return MF_NO_ACTION;
 #else
       if (!FrameReached(&player->push_delay, player->push_delay_value) &&
@@ -6400,6 +6403,48 @@ int DigField(struct PlayerInfo *player,
       break;
 
     default:
+      if (IS_PUSHABLE(element))
+      {
+       if (mode == DF_SNAP)
+         return MF_NO_ACTION;
+
+       if (CAN_FALL(element) && dy)
+         return MF_NO_ACTION;
+
+       player->Pushing = TRUE;
+
+       if (!IN_LEV_FIELD(x+dx, y+dy) || !IS_FREE(x+dx, y+dy))
+         return MF_NO_ACTION;
+
+       if (dx && real_dy)
+       {
+         if (IN_LEV_FIELD(jx, jy+real_dy) && !IS_SOLID(Feld[jx][jy+real_dy]))
+           return MF_NO_ACTION;
+       }
+       else if (dy && real_dx)
+       {
+         if (IN_LEV_FIELD(jx+real_dx, jy) && !IS_SOLID(Feld[jx+real_dx][jy]))
+           return MF_NO_ACTION;
+       }
+
+       if (player->push_delay == 0)
+         player->push_delay = FrameCounter;
+
+       if (!FrameReached(&player->push_delay, player->push_delay_value) &&
+           !(tape.playing && tape.file_version < FILE_VERSION_2_0))
+         return MF_NO_ACTION;
+
+       RemoveField(x, y);
+       Feld[x + dx][y + dy] = element;
+
+       player->push_delay_value = 2 + RND(8);
+
+       DrawLevelField(x + dx, y + dy);
+       PlaySoundLevelElementAction(x, y, element, ACTION_PUSHING);
+
+       break;
+      }
+
       return MF_NO_ACTION;
   }
 
index 60f6febb1d948eb5f7b8e2b1955ece08dfeac1e0..3d3a02cc286c95d245c24b7217de926c1c46fdd4 100644 (file)
@@ -167,6 +167,14 @@ static void InitArtworkConfig()
   static char *direction_suffix[NUM_DIRECTIONS + 1];
   static char *special_suffix[NUM_SPECIAL_GFX_ARGS + 1];
   static char *dummy[1] = { NULL };
+  static char *ignore_image_tokens[] =
+  {
+    "name",
+    "sort_priority",
+    "menu.main.hide_static_text",
+    "global.num_toons",
+    NULL
+  };
   int i;
 
   for (i=0; i<MAX_NUM_ELEMENTS + 1; i++)
@@ -181,9 +189,10 @@ static void InitArtworkConfig()
     special_suffix[i] = special_suffix_info[i].suffix;
 
   InitImageList(image_config, NUM_IMAGE_FILES, image_config_suffix,
-               element_prefix, action_suffix,direction_suffix,special_suffix);
+               element_prefix, action_suffix,direction_suffix, special_suffix,
+               ignore_image_tokens);
   InitSoundList(sound_config, NUM_SOUND_FILES, sound_config_suffix,
-               sound_class_prefix, action_suffix, dummy, dummy);
+               sound_class_prefix, action_suffix, dummy, dummy, dummy);
 }
 
 void InitLevelArtworkInfo()
@@ -257,10 +266,11 @@ static void ReinitializeMusic()
 static void InitImages()
 {
   ReloadCustomImages();
-  ReinitializeGraphics();
 
   LoadCustomElementDescriptions();
   LoadSpecialMenuDesignSettings();
+
+  ReinitializeGraphics();
 }
 
 static void InitSound()
@@ -585,11 +595,7 @@ void ReloadCustomArtwork()
 
     ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE);
 
-    ReloadCustomImages();
-    ReinitializeGraphics();
-
-    LoadCustomElementDescriptions();
-    LoadSpecialMenuDesignSettings();
+    InitImages();
 
     FreeTileClipmasks();
     InitTileClipmasks();
@@ -796,7 +802,7 @@ void InitElementGraphicInfo()
     }
   }
 
-#if 1
+#if 0
 #if DEBUG
   if (options.verbose)
   {
index d6e3013ce4be6aff07941727e99d65177342e740..b7634e85366b6e06b6b1ed177a9302c777cf1473 100644 (file)
@@ -822,10 +822,9 @@ struct PropertyMapping *getImageListPropertyMapping()
 
 void InitImageList(struct ConfigInfo *config_list, int num_file_list_entries,
                   struct ConfigInfo *config_suffix_list,
-                  char **base_prefixes,
-                  char **ext1_suffixes,
-                  char **ext2_suffixes,
-                  char **ext3_suffixes)
+                  char **base_prefixes, char **ext1_suffixes,
+                  char **ext2_suffixes, char **ext3_suffixes,
+                  char **ignore_tokens)
 {
   int i;
 
@@ -866,10 +865,15 @@ void InitImageList(struct ConfigInfo *config_list, int num_file_list_entries,
   for (i=0; ext3_suffixes[i] != NULL; i++)
     image_info->num_ext3_suffixes++;
 
+  image_info->num_ignore_tokens = 0;
+  for (i=0; ignore_tokens[i] != NULL; i++)
+    image_info->num_ignore_tokens++;
+
   image_info->base_prefixes = base_prefixes;
   image_info->ext1_suffixes = ext1_suffixes;
   image_info->ext2_suffixes = ext2_suffixes;
   image_info->ext3_suffixes = ext3_suffixes;
+  image_info->ignore_tokens = ignore_tokens;
 
   image_info->num_property_mapping_entries = 0;
 
index 88e18dda13dbaf3d70a3bd46d8bfb27e45358fb8..63050285eb17dd2bdd4315d912afafa723dd817b 100644 (file)
@@ -82,7 +82,7 @@ char *getImageConfigFilename();
 int getImageListPropertyMappingSize();
 struct PropertyMapping *getImageListPropertyMapping();
 void InitImageList(struct ConfigInfo *, int, struct ConfigInfo *,
-                  char **, char **, char **, char **);
+                  char **, char **, char **, char **, char **);
 
 void ReloadCustomImages();
 void CreateImageWithSmallImages(int);
index 3e3f5b7164983b24de30c8e0c7f5eb411be6628d..f35620c237768cadcb77ac225d9bf8ba7c168bc0 100644 (file)
@@ -1579,6 +1579,11 @@ struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list,
       }
     }
 
+    /* the following tokens are no file definitions, but other config tokens */
+    if (strcmp(config_list[i].token, "global.num_toons") == 0 ||
+       strcmp(config_list[i].token, "menu.main.hide_static_text") == 0)
+      is_file_entry = FALSE;
+
     if (is_file_entry)
     {
       if (i > 0)
@@ -1745,12 +1750,14 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info)
   char **ext1_suffixes = artwork_info->ext1_suffixes;
   char **ext2_suffixes = artwork_info->ext2_suffixes;
   char **ext3_suffixes = artwork_info->ext3_suffixes;
+  char **ignore_tokens = artwork_info->ignore_tokens;
   int num_file_list_entries = artwork_info->num_file_list_entries;
   int num_suffix_list_entries = artwork_info->num_suffix_list_entries;
   int num_base_prefixes = artwork_info->num_base_prefixes;
   int num_ext1_suffixes = artwork_info->num_ext1_suffixes;
   int num_ext2_suffixes = artwork_info->num_ext2_suffixes;
   int num_ext3_suffixes = artwork_info->num_ext3_suffixes;
+  int num_ignore_tokens = artwork_info->num_ignore_tokens;
   char *filename = getCustomArtworkConfigFilename(artwork_info->type);
   struct SetupFileList *setup_file_list;
   struct SetupFileList *extra_file_list = NULL;
@@ -1809,9 +1816,9 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info)
   for (i=0; i<num_file_list_entries; i++)
     read_token_parameters(setup_file_list, suffix_list, &file_list[i]);
 
-  /* set all known tokens to "known" keyword */
-  setTokenValue(setup_file_list, "name", known_token_value);
-  setTokenValue(setup_file_list, "sort_priority", known_token_value);
+  /* set all tokens that can be ignored here to "known" keyword */
+  for (i=0; i < num_ignore_tokens; i++)
+    setTokenValue(setup_file_list, ignore_tokens[i], known_token_value);
 
   /* copy all unknown config file tokens to extra config list */
   for (list = setup_file_list; list != NULL; list = list->next)
index 3f1d04e9eee0cd0593e1f54114e5e3af1f3c626a..1c0da669591633f3e2674158fd121d6be721bc2a 100644 (file)
@@ -1794,10 +1794,9 @@ struct PropertyMapping *getSoundListPropertyMapping()
 
 void InitSoundList(struct ConfigInfo *config_list, int num_file_list_entries,
                   struct ConfigInfo *config_suffix_list,
-                  char **base_prefixes,
-                  char **ext1_suffixes,
-                  char **ext2_suffixes,
-                  char **ext3_suffixes)
+                  char **base_prefixes, char **ext1_suffixes,
+                  char **ext2_suffixes, char **ext3_suffixes,
+                  char **ignore_tokens)
 {
   int i;
 
@@ -1838,10 +1837,15 @@ void InitSoundList(struct ConfigInfo *config_list, int num_file_list_entries,
   for (i=0; ext3_suffixes[i] != NULL; i++)
     sound_info->num_ext3_suffixes++;
 
+  sound_info->num_ignore_tokens = 0;
+  for (i=0; ignore_tokens[i] != NULL; i++)
+    sound_info->num_ignore_tokens++;
+
   sound_info->base_prefixes = base_prefixes;
   sound_info->ext1_suffixes = ext1_suffixes;
   sound_info->ext2_suffixes = ext2_suffixes;
   sound_info->ext3_suffixes = ext3_suffixes;
+  sound_info->ignore_tokens = ignore_tokens;
 
   sound_info->num_property_mapping_entries = 0;
 
index 6bebb5dc936c32f6338d18b595b130dc5adc43b2..a23f03f0010c4007851dfb1c7b92a855e296fa9b 100644 (file)
@@ -148,7 +148,7 @@ struct FileInfo *getSoundListEntry(int);
 int getSoundListPropertyMappingSize();
 struct PropertyMapping *getSoundListPropertyMapping();
 void InitSoundList(struct ConfigInfo *, int, struct ConfigInfo *,
-                  char **, char **, char **, char **);
+                  char **, char **, char **, char **, char **);
 void InitReloadCustomSounds(char *);
 void InitReloadCustomMusic(char *);
 void FreeAllSounds(void);
index 532f079a5ca09a477cadf3955203e22696f7a8f0..03250949d9584fab32f7f372ee86412c0e1d6369 100644 (file)
@@ -536,26 +536,25 @@ struct ArtworkListInfo
 
   int num_file_list_entries;
   int num_dynamic_file_list_entries;
-
   struct FileInfo *file_list;                  /* static artwork file array */
   struct FileInfo *dynamic_file_list;          /* dynamic artwrk file array */
 
   int num_suffix_list_entries;
-
   struct ConfigInfo *suffix_list;              /* parameter suffixes array */
 
   int num_base_prefixes;
   int num_ext1_suffixes;
   int num_ext2_suffixes;
   int num_ext3_suffixes;
-
   char **base_prefixes;                                /* base token prefixes array */
   char **ext1_suffixes;                                /* property suffixes array 1 */
   char **ext2_suffixes;                                /* property suffixes array 2 */
   char **ext3_suffixes;                                /* property suffixes array 3 */
 
-  int num_property_mapping_entries;
+  int num_ignore_tokens;
+  char **ignore_tokens;                                /* file tokens to be ignored */
 
+  int num_property_mapping_entries;
   struct PropertyMapping *property_mapping;    /* mapping token -> artwork */
 
   int sizeof_artwork_list_entry;
index 5c0d4444fbae5f68d1268d5b717ceaa924662251..c8c71e3a96c6f7ac6323ae12dea69b10c1197a75 100644 (file)
@@ -81,6 +81,18 @@ int getAnimationFrame(int num_frames, int delay, int mode, int start_frame,
 /* toon animation functions                                                  */
 /* ========================================================================= */
 
+static int get_toon_direction(char *direction_raw)
+{
+  static char *direction = NULL;
+
+  setString(&direction, getStringToLower(direction_raw));
+
+  return (strcmp(direction, "left")  == 0 ? MV_LEFT :
+         strcmp(direction, "right") == 0 ? MV_RIGHT :
+         strcmp(direction, "up")    == 0 ? MV_UP :
+         strcmp(direction, "down")  == 0 ? MV_DOWN : MV_NO_MOVING);
+}
+
 void InitToonScreen(Bitmap *save_buffer,
                    void (*update_function)(void),
                    void (*prepare_backbuffer_function)(void),
@@ -154,11 +166,12 @@ boolean AnimateToon(int toon_nr, boolean restart)
   struct ToonInfo *anim = &screen_info.toons[toon_nr];
   Bitmap *anim_bitmap = screen_info.toons[toon_nr].bitmap;
   GC anim_clip_gc = anim_bitmap->stored_clip_gc;
+  int direction = get_toon_direction(anim->direction);
 
   if (restart)
   {
-    horiz_move = (anim->direction & (ANIMDIR_LEFT | ANIMDIR_RIGHT));
-    vert_move = (anim->direction & (ANIMDIR_UP | ANIMDIR_DOWN));
+    horiz_move = (direction & (MV_LEFT | MV_RIGHT));
+    vert_move = (direction & (MV_UP | MV_DOWN));
     anim_delay_value = anim->step_delay * screen_info.frame_delay_value;
 
     frame = getAnimationFrame(anim->anim_frames, anim->anim_delay,
@@ -167,16 +180,20 @@ boolean AnimateToon(int toon_nr, boolean restart)
 
     if (horiz_move)
     {
-      if (anim->position == ANIMPOS_UP)
+      int pos_bottom = screen_info.height - anim->height;
+
+      if (strcmp(anim->position, "top") == 0)
        pos_y = 0;
-      else if (anim->position == ANIMPOS_DOWN)
-       pos_y = screen_info.height - anim->height;
-      else if (anim->position == ANIMPOS_UPPER)
-       pos_y = SimpleRND((screen_info.height - anim->height) / 2);
+      else if (strcmp(anim->position, "bottom") == 0)
+       pos_y = pos_bottom;
+      else if (strcmp(anim->position, "upper")  == 0)
+       pos_y = SimpleRND(pos_bottom / 2);
+      else if (strcmp(anim->position, "lower")  == 0)
+       pos_y = pos_bottom / 2 + SimpleRND(pos_bottom / 2);
       else
-       pos_y = SimpleRND(screen_info.height - anim->height);
+       pos_y = SimpleRND(pos_bottom);
 
-      if (anim->direction == ANIMDIR_RIGHT)
+      if (direction == MV_RIGHT)
       {
        delta_x = anim->step_offset;
        pos_x = -anim->width + delta_x;
@@ -186,18 +203,21 @@ boolean AnimateToon(int toon_nr, boolean restart)
        delta_x = -anim->step_offset;
        pos_x = screen_info.width + delta_x;
       }
+
       delta_y = 0;
     }
     else
     {
-      if (anim->position == ANIMPOS_LEFT)
+      int pos_right = screen_info.width - anim->width;
+
+      if (strcmp(anim->position, "left") == 0)
        pos_x = 0;
-      else if (anim->position == ANIMPOS_RIGHT)
-       pos_x = screen_info.width - anim->width;
+      else if (strcmp(anim->position, "right")  == 0)
+       pos_x = pos_right;
       else
-       pos_x = SimpleRND(screen_info.width - anim->width);
+       pos_x = SimpleRND(pos_right);
 
-      if (anim->direction == ANIMDIR_DOWN)
+      if (direction == MV_DOWN)
       {
        delta_y = anim->step_offset;
        pos_y = -anim->height + delta_y;
@@ -207,6 +227,7 @@ boolean AnimateToon(int toon_nr, boolean restart)
        delta_y = -anim->step_offset;
        pos_y = screen_info.width + delta_y;
       }
+
       delta_x = 0;
     }
   }
index 8ea41d1868fb375e51de653b2e699c5b488e50ac..a30cbe63456786bcf9d1dc4642930d6a05487c17 100644 (file)
@@ -26,6 +26,7 @@
 #define ANIM_REVERSE           (1 << 4)
 #define ANIM_RANDOM            (1 << 5)
 
+#if 0
 /* values for toon animation direction */
 #define ANIMDIR_LEFT   1
 #define ANIMDIR_RIGHT  2
@@ -38,6 +39,7 @@
 #define ANIMPOS_UP     4
 #define ANIMPOS_DOWN   8
 #define ANIMPOS_UPPER  16
+#endif
 
 
 struct ToonScreenInfo
@@ -58,6 +60,7 @@ struct ToonScreenInfo
 
 struct ToonInfo
 {
+#if 0
   int graphic;
   int width, height;
   int src_x, src_y;
@@ -72,7 +75,11 @@ struct ToonInfo
   int anim_start_frame;
   Bitmap *bitmap;      /* dynamically initialized */
 
-#if 0
+  char *direction_str;
+  char *position_str;
+
+#else
+
   Bitmap *bitmap;
   int src_x, src_y;
   int width, height;
@@ -82,6 +89,8 @@ struct ToonInfo
   int anim_mode;
   int step_offset;
   int step_delay;
+  char *direction;
+  char *position;
 #endif
 };
 
index 12d5ea2398ec471420627234ed5e6f1a1c0f4c1c..f6a456e977ad92097b25f922c80069cbf9af9664 100644 (file)
 #define GFX_ARG_GLOBAL_SYNC                    19
 #define GFX_ARG_STEP_OFFSET                    20
 #define GFX_ARG_STEP_DELAY                     21
+#define GFX_ARG_DIRECTION                      22
+#define GFX_ARG_POSITION                       23
+#define GFX_ARG_NAME                           24
 
-#define NUM_GFX_ARGS                           22
+#define NUM_GFX_ARGS                           25
 
 
 /* values for sound configuration suffixes */
@@ -1002,6 +1005,8 @@ struct GlobalInfo
   char *autoplay_leveldir;
   int autoplay_level_nr;
 
+  int num_toons;
+
   float frames_per_second;
   boolean fps_slowdown;
   int fps_slowdown_factor;