rnd-20031124-1-src
authorHolger Schemel <info@artsoft.org>
Mon, 24 Nov 2003 01:27:31 +0000 (02:27 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:44:42 +0000 (10:44 +0200)
* added "copy" and "exchange" functions for custom elements to editor
* added configurable element animations for info screen
* added configurable music credits for info screen
* added "editorsetup.conf" for editor element list configuration
* added "musicinfo.conf" for menu and level music configuration

16 files changed:
ChangeLog
src/conf_gfx.c
src/conf_mus.c
src/conf_snd.c
src/conftime.h
src/editor.c
src/editor.h
src/game.c
src/init.c
src/libgame/misc.c
src/libgame/misc.h
src/libgame/setup.c
src/libgame/setup.h
src/main.c
src/main.h
src/tools.c

index 6e7363554e8bffa02e204d29a86dbc0be0a69214..f9943b3612fc9682c2d56e8cd9bc38b55138c137 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+
+2003-11-22
+       * added "copy" and "exchange" functions for custom elements to editor
+
+2003-11-21
+       * added configurable element animations for info screen
+
+2003-11-20
+       * added configurable music credits for info screen
+
+2003-11-18
+       * added "editorsetup.conf" for editor element list configuration
+
+2003-11-16
+       * added "musicinfo.conf" for menu and level music configuration
+
 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)
index 36d9ddbfd2f9696df101577ec8dbfc2137f97770..1bca3da12807cd569b8432c09aa40f928b9ce795 100644 (file)
 
 struct ConfigInfo image_config_suffix[] =
 {
-  { ".x",                              ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".y",                              ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".xpos",                           ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".ypos",                           ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".width",                          ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".height",                         ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".offset",                         ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".vertical",                       "false",        TYPE_BOOLEAN },
-  { ".xoffset",                                ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".yoffset",                                ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".frames",                         ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".frames_per_line",                        ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".start_frame",                    ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".delay",                          "1",            TYPE_INTEGER },
-  { ".anim_mode",                      ARG_UNDEFINED,  TYPE_STRING  },
-  { ".global_sync",                    "false",        TYPE_BOOLEAN },
-  { ".crumbled_like",                  ARG_UNDEFINED,  TYPE_TOKEN   },
-  { ".diggable_like",                  ARG_UNDEFINED,  TYPE_TOKEN   },
-  { ".border_size",                    ARG_UNDEFINED,  TYPE_INTEGER },
-  { ".step_offset",                    "4",            TYPE_INTEGER },
-  { ".step_delay",                     "1",            TYPE_INTEGER },
-  { ".direction",                      ARG_UNDEFINED,  TYPE_STRING  },
-  { ".position",                       ARG_UNDEFINED,  TYPE_STRING  },
-  { ".draw_xoffset",                   "0",            TYPE_INTEGER },
-  { ".draw_yoffset",                   "0",            TYPE_INTEGER },
-  { ".draw_masked",                    "false",        TYPE_BOOLEAN },
-  { ".name",                           ARG_UNDEFINED,  TYPE_STRING  },
-
-  { NULL,                              NULL,           0            }
+  { ".x",                              ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".y",                              ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".xpos",                           ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".ypos",                           ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".width",                          ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".height",                         ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".offset",                         ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".vertical",                       "false",        TYPE_BOOLEAN    },
+  { ".xoffset",                                ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".yoffset",                                ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".frames",                         ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".frames_per_line",                        ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".start_frame",                    ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".delay",                          "1",            TYPE_INTEGER    },
+  { ".anim_mode",                      ARG_UNDEFINED,  TYPE_STRING     },
+  { ".global_sync",                    "false",        TYPE_BOOLEAN    },
+  { ".crumbled_like",                  ARG_UNDEFINED,  TYPE_TOKEN      },
+  { ".diggable_like",                  ARG_UNDEFINED,  TYPE_TOKEN      },
+  { ".border_size",                    ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".step_offset",                    "4",            TYPE_INTEGER    },
+  { ".step_delay",                     "1",            TYPE_INTEGER    },
+  { ".direction",                      ARG_UNDEFINED,  TYPE_STRING     },
+  { ".position",                       ARG_UNDEFINED,  TYPE_STRING     },
+  { ".draw_xoffset",                   "0",            TYPE_INTEGER    },
+  { ".draw_yoffset",                   "0",            TYPE_INTEGER    },
+  { ".draw_masked",                    "false",        TYPE_BOOLEAN    },
+  { ".anim_delay_fixed",               ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".anim_delay_random",              ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".post_delay_fixed",               ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".post_delay_random",              ARG_UNDEFINED,  TYPE_INTEGER    },
+  { ".name",                           ARG_UNDEFINED,  TYPE_STRING     },
+
+  { NULL,                              NULL,           0               }
 };
 
 struct ConfigInfo image_config[] =
@@ -3704,5 +3708,10 @@ struct ConfigInfo image_config[] =
   { "door_2.step_delay",                       "10"                    },
   { "door_2.anim_mode",                                "default"               },
 
+  { "[player].boring_delay_fixed",             "0"                     },
+  { "[player].boring_delay_random",            "0"                     },
+  { "[player].sleeping_delay_fixed",           "0"                     },
+  { "[player].sleeping_delay_random",          "0"                     },
+
   { NULL,                                      NULL                    }
 };
index 469c7ed90900c2b4eb8cc9077786426ee085d516..1c29c617d7d4ed6ebd65acec197d9b55b36cac61 100644 (file)
 
 struct ConfigInfo music_config_suffix[] =
 {
-  { ".mode_loop",                      ARG_UNDEFINED,  TYPE_BOOLEAN },
+  { ".mode_loop",                      ARG_UNDEFINED,  TYPE_BOOLEAN    },
 
-  { NULL,                              NULL,           0            }
+  { NULL,                              NULL,           0               }
 };
 
 struct ConfigInfo music_config[] =
 {
-  { "background",                      UNDEFINED_FILENAME      },
-  { "background.MAIN",                 UNDEFINED_FILENAME      },
-  { "background.LEVELS",               UNDEFINED_FILENAME      },
-  { "background.SCORES",               UNDEFINED_FILENAME      },
-  { "background.EDITOR",               UNDEFINED_FILENAME      },
-  { "background.INFO",                 "rhythmloop.wav"        },
-  { "background.SETUP",                        UNDEFINED_FILENAME      },
+  { "background",                      UNDEFINED_FILENAME              },
+  { "background.MAIN",                 UNDEFINED_FILENAME              },
+  { "background.LEVELS",               UNDEFINED_FILENAME              },
+  { "background.SCORES",               UNDEFINED_FILENAME              },
+  { "background.EDITOR",               UNDEFINED_FILENAME              },
+  { "background.INFO",                 "rhythmloop.wav"                },
+  { "background.SETUP",                        UNDEFINED_FILENAME              },
 
   /* there is no definition for "background.PLAYING", because this would
      prevent selecting music from music directory that is not defined in
      "musicinfo.conf", when no default music is defined here */
 
-  { NULL,                              NULL                    }
+  { NULL,                              NULL                            }
 };
index 9d028a5adbfb0afa24e56d134582690e61fd5a24..deb105e2955c0416d43616b76822722412d067a9 100644 (file)
 
 struct ConfigInfo sound_config_suffix[] =
 {
-  { ".mode_loop",                      ARG_UNDEFINED,  TYPE_BOOLEAN },
+  { ".mode_loop",                      ARG_UNDEFINED,  TYPE_BOOLEAN    },
 
-  { NULL,                              NULL,           0            }
+  { NULL,                              NULL,           0               }
 };
 
 struct ConfigInfo sound_config[] =
 {
   /* some default sounds */
-  { "[default].digging",               "schlurf.wav"           },
-  { "[default].collecting",            "pong.wav"              },
-  { "[default].snapping",              "pong.wav"              },
-  { "[default].pushing",               "pusch.wav"             },
-  { "[default].impact",                        "klopf.wav"             },
-  { "[default].walking",               "empty.wav"             },
-  { "[default].passing",               "gate.wav"              },
-  { "[default].dying",                 "autsch.wav"            },
-  { "[default].exploding",             "roaaar.wav"            },
-  { "[sp_default].exploding",          "booom.wav"             },
+  { "[default].digging",               "schlurf.wav"                   },
+  { "[default].collecting",            "pong.wav"                      },
+  { "[default].snapping",              "pong.wav"                      },
+  { "[default].pushing",               "pusch.wav"                     },
+  { "[default].impact",                        "klopf.wav"                     },
+  { "[default].walking",               "empty.wav"                     },
+  { "[default].passing",               "gate.wav"                      },
+  { "[default].dying",                 "autsch.wav"                    },
+  { "[default].exploding",             "roaaar.wav"                    },
+  { "[sp_default].exploding",          "booom.wav"                     },
 
   /* sounds for Boulder Dash style elements and actions */
-  { "bd_diamond.collecting",           "pong.wav"              },
-  { "bd_diamond.impact",               "pling.wav"             },
-  { "bd_rock.pushing",                 "pusch.wav"             },
-  { "bd_rock.impact",                  "klopf.wav"             },
-  { "bd_magic_wall.activating",                "quirk.wav"             },
-  { "bd_magic_wall.active",            "miep.wav"              },
-  { "bd_magic_wall.filling",           "quirk.wav"             },
-  { "bd_amoeba.waiting",               UNDEFINED_FILENAME      },
-  { "bd_amoeba.growing",               "amoebe.wav"            },
-  { "bd_amoeba.turning_to_gem",                "pling.wav"             },
-  { "bd_amoeba.turning_to_rock",       "klopf.wav"             },
-  { "bd_butterfly.moving",             "klapper.wav"           },
-  { "bd_butterfly.waiting",            "klapper.wav"           },
-  { "bd_firefly.moving",               "roehr.wav"             },
-  { "bd_firefly.waiting",              "roehr.wav"             },
+  { "bd_diamond.collecting",           "pong.wav"                      },
+  { "bd_diamond.impact",               "pling.wav"                     },
+  { "bd_rock.pushing",                 "pusch.wav"                     },
+  { "bd_rock.impact",                  "klopf.wav"                     },
+  { "bd_magic_wall.activating",                "quirk.wav"                     },
+  { "bd_magic_wall.active",            "miep.wav"                      },
+  { "bd_magic_wall.filling",           "quirk.wav"                     },
+  { "bd_amoeba.waiting",               UNDEFINED_FILENAME              },
+  { "bd_amoeba.growing",               "amoebe.wav"                    },
+  { "bd_amoeba.turning_to_gem",                "pling.wav"                     },
+  { "bd_amoeba.turning_to_rock",       "klopf.wav"                     },
+  { "bd_butterfly.moving",             "klapper.wav"                   },
+  { "bd_butterfly.waiting",            "klapper.wav"                   },
+  { "bd_firefly.moving",               "roehr.wav"                     },
+  { "bd_firefly.waiting",              "roehr.wav"                     },
 
   /* sounds for Supaplex style elements and actions */
-  { "sp_base.digging",                 "base.wav"              },
-  { "sp_buggy_base.digging",           "base.wav"              },
-  { "sp_buggy_base.active",            "bug.wav"               },
-  { "sp_infotron.collecting",          "infotron.wav"          },
-  { "sp_infotron.impact",              "pling.wav"             },
-  { "sp_zonk.pushing",                 "zonkpush.wav"          },
-  { "sp_zonk.impact",                  "zonkdown.wav"          },
-  { "sp_disk_red.collecting",          "infotron.wav"          },
-  { "sp_disk_orange.pushing",          "zonkpush.wav"          },
-  { "sp_disk_yellow.pushing",          "pusch.wav"             },
-  { "[sp_port].passing",               "gate.wav"              },
-  { "[sp_exit].passing",               "exit.wav"              },
-  { "[sp_exit].opening",               UNDEFINED_FILENAME      },
-  { "[sp_exit].closing",               UNDEFINED_FILENAME      },
-  { "sp_sniksnak.moving",              UNDEFINED_FILENAME      },
-  { "sp_sniksnak.waiting",             UNDEFINED_FILENAME      },
-  { "sp_electron.moving",              UNDEFINED_FILENAME      },
-  { "sp_electron.waiting",             UNDEFINED_FILENAME      },
-  { "sp_terminal.activating",          UNDEFINED_FILENAME      },
-  { "sp_terminal.active",              UNDEFINED_FILENAME      },
+  { "sp_base.digging",                 "base.wav"                      },
+  { "sp_buggy_base.digging",           "base.wav"                      },
+  { "sp_buggy_base.active",            "bug.wav"                       },
+  { "sp_infotron.collecting",          "infotron.wav"                  },
+  { "sp_infotron.impact",              "pling.wav"                     },
+  { "sp_zonk.pushing",                 "zonkpush.wav"                  },
+  { "sp_zonk.impact",                  "zonkdown.wav"                  },
+  { "sp_disk_red.collecting",          "infotron.wav"                  },
+  { "sp_disk_orange.pushing",          "zonkpush.wav"                  },
+  { "sp_disk_yellow.pushing",          "pusch.wav"                     },
+  { "[sp_port].passing",               "gate.wav"                      },
+  { "[sp_exit].passing",               "exit.wav"                      },
+  { "[sp_exit].opening",               UNDEFINED_FILENAME              },
+  { "[sp_exit].closing",               UNDEFINED_FILENAME              },
+  { "sp_sniksnak.moving",              UNDEFINED_FILENAME              },
+  { "sp_sniksnak.waiting",             UNDEFINED_FILENAME              },
+  { "sp_electron.moving",              UNDEFINED_FILENAME              },
+  { "sp_electron.waiting",             UNDEFINED_FILENAME              },
+  { "sp_terminal.activating",          UNDEFINED_FILENAME              },
+  { "sp_terminal.active",              UNDEFINED_FILENAME              },
 
   /* sounds for Sokoban style elements and actions */
-  { "[sokoban].pushing",               "pusch.wav"             },
-  { "[sokoban].filling",               "deng.wav"              },
-  { "[sokoban].emptying",              UNDEFINED_FILENAME      },
+  { "[sokoban].pushing",               "pusch.wav"                     },
+  { "[sokoban].filling",               "deng.wav"                      },
+  { "[sokoban].emptying",              UNDEFINED_FILENAME              },
 
   /* sounds for Emerald Mine style elements and actions */
-  { "[player].moving",                 "empty.wav"             },
-  { "[player].moving.mode_loop",       "false"                 },
-  { "sand.digging",                    "schlurf.wav"           },
-  { "emerald.collecting",              "pong.wav"              },
-  { "emerald.impact",                  "pling.wav"             },
-  { "diamond.collecting",              "pong.wav"              },
-  { "diamond.impact",                  "pling.wav"             },
-  { "diamond.breaking",                        "quirk.wav"             },
-  { "rock.pushing",                    "pusch.wav"             },
-  { "rock.impact",                     "klopf.wav"             },
-  { "bomb.pushing",                    "pusch.wav"             },
-  { "nut.pushing",                     "knurk.wav"             },
-  { "nut.breaking",                    "knack.wav"             },
-  { "nut.impact",                      "klumpf.wav"            },
-  { "[dynamite].collecting",           "pong.wav"              },
-  { "[dynamite].dropping",             "deng.wav"              },
-  { "[dynamite].active",               "zisch.wav"             },
-  { "[key].collecting",                        "pong.wav"              },
-  { "[gate].passing",                  "gate.wav"              },
-  { "bug.moving",                      "klapper.wav"           },
-  { "bug.waiting",                     "klapper.wav"           },
-  { "spaceship.moving",                        "roehr.wav"             },
-  { "spaceship.waiting",               "roehr.wav"             },
-  { "yamyam.moving",                   UNDEFINED_FILENAME      },
-  { "yamyam.waiting",                  "njam.wav"              },
-  { "yamyam.digging",                  UNDEFINED_FILENAME      },
-  { "robot.moving",                    "schlurf.wav"           },
-  { "robot.moving.mode_loop",          "false"                 },
-  { "robot.waiting",                   UNDEFINED_FILENAME      },
-  { "robot_wheel.activating",          "deng.wav"              },
-  { "robot_wheel.active",              "miep.wav"              },
-  { "magic_wall.activating",           "quirk.wav"             },
-  { "magic_wall.active",               "miep.wav"              },
-  { "magic_wall.filling",              "quirk.wav"             },
-  { "[amoeba].waiting",                        UNDEFINED_FILENAME      },
-  { "[amoeba].growing",                        "amoebe.wav"            },
-  { "[amoeba].dropping",               UNDEFINED_FILENAME      },
-  { "acid.splashing",                  "blurb.wav"             },
-  { "[quicksand].filling",             UNDEFINED_FILENAME      },
-  { "[quicksand].emptying",            UNDEFINED_FILENAME      },
-  { "[exit].opening",                  "oeffnen.wav"           },
-  { "[exit].closing",                  "oeffnen.wav"           },
-  { "[exit].passing",                  "buing.wav"             },
-  { "penguin.passing",                 "buing.wav"             },
+  { "[player].moving",                 "empty.wav"                     },
+  { "[player].moving.mode_loop",       "false"                         },
+  { "sand.digging",                    "schlurf.wav"                   },
+  { "emerald.collecting",              "pong.wav"                      },
+  { "emerald.impact",                  "pling.wav"                     },
+  { "diamond.collecting",              "pong.wav"                      },
+  { "diamond.impact",                  "pling.wav"                     },
+  { "diamond.breaking",                        "quirk.wav"                     },
+  { "rock.pushing",                    "pusch.wav"                     },
+  { "rock.impact",                     "klopf.wav"                     },
+  { "bomb.pushing",                    "pusch.wav"                     },
+  { "nut.pushing",                     "knurk.wav"                     },
+  { "nut.breaking",                    "knack.wav"                     },
+  { "nut.impact",                      "klumpf.wav"                    },
+  { "[dynamite].collecting",           "pong.wav"                      },
+  { "[dynamite].dropping",             "deng.wav"                      },
+  { "[dynamite].active",               "zisch.wav"                     },
+  { "[key].collecting",                        "pong.wav"                      },
+  { "[gate].passing",                  "gate.wav"                      },
+  { "bug.moving",                      "klapper.wav"                   },
+  { "bug.waiting",                     "klapper.wav"                   },
+  { "spaceship.moving",                        "roehr.wav"                     },
+  { "spaceship.waiting",               "roehr.wav"                     },
+  { "yamyam.moving",                   UNDEFINED_FILENAME              },
+  { "yamyam.waiting",                  "njam.wav"                      },
+  { "yamyam.digging",                  UNDEFINED_FILENAME              },
+  { "robot.moving",                    "schlurf.wav"                   },
+  { "robot.moving.mode_loop",          "false"                         },
+  { "robot.waiting",                   UNDEFINED_FILENAME              },
+  { "robot_wheel.activating",          "deng.wav"                      },
+  { "robot_wheel.active",              "miep.wav"                      },
+  { "magic_wall.activating",           "quirk.wav"                     },
+  { "magic_wall.active",               "miep.wav"                      },
+  { "magic_wall.filling",              "quirk.wav"                     },
+  { "[amoeba].waiting",                        UNDEFINED_FILENAME              },
+  { "[amoeba].growing",                        "amoebe.wav"                    },
+  { "[amoeba].dropping",               UNDEFINED_FILENAME              },
+  { "acid.splashing",                  "blurb.wav"                     },
+  { "[quicksand].filling",             UNDEFINED_FILENAME              },
+  { "[quicksand].emptying",            UNDEFINED_FILENAME              },
+  { "[exit].opening",                  "oeffnen.wav"                   },
+  { "[exit].closing",                  "oeffnen.wav"                   },
+  { "[exit].passing",                  "buing.wav"                     },
+  { "penguin.passing",                 "buing.wav"                     },
 
   /* sounds for Emerald Mine Club style elements and actions */
-  { "balloon.moving",                  UNDEFINED_FILENAME      },
-  { "balloon.waiting",                 UNDEFINED_FILENAME      },
-  { "balloon.pushing",                 "schlurf.wav"           },
-  { "[balloon_switch].activating",     UNDEFINED_FILENAME      },
-  { "spring.moving",                   UNDEFINED_FILENAME      },
-  { "spring.pushing",                  "pusch.wav"             },
-  { "spring.impact",                   "klopf.wav"             },
-  { "[wall].growing",                  UNDEFINED_FILENAME      },
+  { "balloon.moving",                  UNDEFINED_FILENAME              },
+  { "balloon.waiting",                 UNDEFINED_FILENAME              },
+  { "balloon.pushing",                 "schlurf.wav"                   },
+  { "[balloon_switch].activating",     UNDEFINED_FILENAME              },
+  { "spring.moving",                   UNDEFINED_FILENAME              },
+  { "spring.pushing",                  "pusch.wav"                     },
+  { "spring.impact",                   "klopf.wav"                     },
+  { "[wall].growing",                  UNDEFINED_FILENAME              },
 
   /* sounds for Diamond Caves style elements and actions */
-  { "pearl.collecting",                        "pong.wav"              },
-  { "pearl.breaking",                  "knack.wav"             },
-  { "pearl.impact",                    "pling.wav"             },
-  { "crystal.collecting",              "pong.wav"              },
-  { "crystal.impact",                  "pling.wav"             },
-  { "[envelope].collecting",           "pong.wav"              },
-  { "[envelope].opening",              UNDEFINED_FILENAME      },
-  { "[envelope].closing",              UNDEFINED_FILENAME      },
-  { "invisible_sand.digging",          "schlurf.wav"           },
-  { "shield_normal.collecting",                "pong.wav"              },
-  { "shield_normal.active",            UNDEFINED_FILENAME      },
-  { "shield_deadly.collecting",                "pong.wav"              },
-  { "shield_deadly.active",            UNDEFINED_FILENAME      },
-  { "extra_time.collecting",           "gong.wav"              },
-  { "mole.moving",                     UNDEFINED_FILENAME      },
-  { "mole.waiting",                    UNDEFINED_FILENAME      },
-  { "mole.digging",                    "blurb.wav"             },
-  { "[switchgate_switch].activating",  UNDEFINED_FILENAME      },
-  { "[switchgate].opening",            "oeffnen.wav"           },
-  { "[switchgate].closing",            "oeffnen.wav"           },
-  { "[switchgate].passing",            "gate.wav"              },
-  { "timegate_switch.activating",      "deng.wav"              },
-  { "timegate_switch.active",          "miep.wav"              },
-  { "timegate_switch.deactivating",    UNDEFINED_FILENAME      },
-  { "timegate.opening",                        "oeffnen.wav"           },
-  { "[timegate].closing",              "oeffnen.wav"           },
-  { "[timegate].passing",              "gate.wav"              },
-  { "[conveyor_belt_switch].activating",UNDEFINED_FILENAME     },
-  { "[conveyor_belt].active",          UNDEFINED_FILENAME      },
-  { "[conveyor_belt_switch].deactivating",UNDEFINED_FILENAME   },
-  { "light_switch.activating",         UNDEFINED_FILENAME      },
-  { "light_switch.deactivating",       UNDEFINED_FILENAME      },
+  { "pearl.collecting",                        "pong.wav"                      },
+  { "pearl.breaking",                  "knack.wav"                     },
+  { "pearl.impact",                    "pling.wav"                     },
+  { "crystal.collecting",              "pong.wav"                      },
+  { "crystal.impact",                  "pling.wav"                     },
+  { "[envelope].collecting",           "pong.wav"                      },
+  { "[envelope].opening",              UNDEFINED_FILENAME              },
+  { "[envelope].closing",              UNDEFINED_FILENAME              },
+  { "invisible_sand.digging",          "schlurf.wav"                   },
+  { "shield_normal.collecting",                "pong.wav"                      },
+  { "shield_normal.active",            UNDEFINED_FILENAME              },
+  { "shield_deadly.collecting",                "pong.wav"                      },
+  { "shield_deadly.active",            UNDEFINED_FILENAME              },
+  { "extra_time.collecting",           "gong.wav"                      },
+  { "mole.moving",                     UNDEFINED_FILENAME              },
+  { "mole.waiting",                    UNDEFINED_FILENAME              },
+  { "mole.digging",                    "blurb.wav"                     },
+  { "[switchgate_switch].activating",  UNDEFINED_FILENAME              },
+  { "[switchgate].opening",            "oeffnen.wav"                   },
+  { "[switchgate].closing",            "oeffnen.wav"                   },
+  { "[switchgate].passing",            "gate.wav"                      },
+  { "timegate_switch.activating",      "deng.wav"                      },
+  { "timegate_switch.active",          "miep.wav"                      },
+  { "timegate_switch.deactivating",    UNDEFINED_FILENAME              },
+  { "timegate.opening",                        "oeffnen.wav"                   },
+  { "[timegate].closing",              "oeffnen.wav"                   },
+  { "[timegate].passing",              "gate.wav"                      },
+  { "[conveyor_belt_switch].activating",UNDEFINED_FILENAME             },
+  { "[conveyor_belt].active",          UNDEFINED_FILENAME              },
+  { "[conveyor_belt_switch].deactivating",UNDEFINED_FILENAME           },
+  { "light_switch.activating",         UNDEFINED_FILENAME              },
+  { "light_switch.deactivating",       UNDEFINED_FILENAME              },
 
   /* sounds for DX Boulderdash style elements and actions */
-  { "dx_supabomb.pushing",             "pusch.wav"             },
-  { "trap.digging",                    "schlurf.wav"           },
-  { "trap.activating",                 UNDEFINED_FILENAME      },
-  { "[tube].walking",                  UNDEFINED_FILENAME      },
+  { "dx_supabomb.pushing",             "pusch.wav"                     },
+  { "trap.digging",                    "schlurf.wav"                   },
+  { "trap.activating",                 UNDEFINED_FILENAME              },
+  { "[tube].walking",                  UNDEFINED_FILENAME              },
 
   /* sounds for Rocks'n'Diamonds style elements and actions */
-  { "amoeba.turning_to_gem",           "pling.wav"             },
-  { "amoeba.turning_to_rock",          "klopf.wav"             },
-  { "speed_pill.collecting",           "pong.wav"              },
-  { "dynabomb_increase_number.collecting","pong.wav"           },
-  { "dynabomb_increase_size.collecting","pong.wav"             },
-  { "dynabomb_increase_power.collecting","pong.wav"            },
-  { "[dynabomb].dropping",             "deng.wav"              },
-  { "[dynabomb].active",               "zisch.wav"             },
-  { "satellite.moving",                        UNDEFINED_FILENAME      },
-  { "satellite.waiting",               UNDEFINED_FILENAME      },
-  { "satellite.pushing",               "pusch.wav"             },
-  { "lamp.activating",                 "deng.wav"              },
-  { "lamp.deactivating",               "deng.wav"              },
-  { "time_orb_full.collecting",                "gong.wav"              },
-  { "time_orb_full.impact",            "deng.wav"              },
-  { "time_orb_empty.pushing",          "pusch.wav"             },
-  { "time_orb_empty.impact",           "deng.wav"              },
-  { "game_of_life.waiting",            UNDEFINED_FILENAME      },
-  { "game_of_life.growing",            "amoebe.wav"            },
-  { "biomaze.waiting",                 UNDEFINED_FILENAME      },
-  { "biomaze.growing",                 "amoebe.wav"            },
-  { "pacman.moving",                   UNDEFINED_FILENAME      },
-  { "pacman.waiting",                  UNDEFINED_FILENAME      },
-  { "pacman.digging",                  UNDEFINED_FILENAME      },
-  { "dark_yamyam.moving",              UNDEFINED_FILENAME      },
-  { "dark_yamyam.waiting",             "njam.wav"              },
-  { "dark_yamyam.digging",             UNDEFINED_FILENAME      },
-  { "penguin.moving",                  UNDEFINED_FILENAME      },
-  { "penguin.waiting",                 UNDEFINED_FILENAME      },
-  { "pig.moving",                      UNDEFINED_FILENAME      },
-  { "pig.waiting",                     UNDEFINED_FILENAME      },
-  { "pig.digging",                     UNDEFINED_FILENAME      },
-  { "dragon.moving",                   UNDEFINED_FILENAME      },
-  { "dragon.waiting",                  UNDEFINED_FILENAME      },
-  { "dragon.attacking",                        UNDEFINED_FILENAME      },
+  { "amoeba.turning_to_gem",           "pling.wav"                     },
+  { "amoeba.turning_to_rock",          "klopf.wav"                     },
+  { "speed_pill.collecting",           "pong.wav"                      },
+  { "dynabomb_increase_number.collecting","pong.wav"                   },
+  { "dynabomb_increase_size.collecting","pong.wav"                     },
+  { "dynabomb_increase_power.collecting","pong.wav"                    },
+  { "[dynabomb].dropping",             "deng.wav"                      },
+  { "[dynabomb].active",               "zisch.wav"                     },
+  { "satellite.moving",                        UNDEFINED_FILENAME              },
+  { "satellite.waiting",               UNDEFINED_FILENAME              },
+  { "satellite.pushing",               "pusch.wav"                     },
+  { "lamp.activating",                 "deng.wav"                      },
+  { "lamp.deactivating",               "deng.wav"                      },
+  { "time_orb_full.collecting",                "gong.wav"                      },
+  { "time_orb_full.impact",            "deng.wav"                      },
+  { "time_orb_empty.pushing",          "pusch.wav"                     },
+  { "time_orb_empty.impact",           "deng.wav"                      },
+  { "game_of_life.waiting",            UNDEFINED_FILENAME              },
+  { "game_of_life.growing",            "amoebe.wav"                    },
+  { "biomaze.waiting",                 UNDEFINED_FILENAME              },
+  { "biomaze.growing",                 "amoebe.wav"                    },
+  { "pacman.moving",                   UNDEFINED_FILENAME              },
+  { "pacman.waiting",                  UNDEFINED_FILENAME              },
+  { "pacman.digging",                  UNDEFINED_FILENAME              },
+  { "dark_yamyam.moving",              UNDEFINED_FILENAME              },
+  { "dark_yamyam.waiting",             "njam.wav"                      },
+  { "dark_yamyam.digging",             UNDEFINED_FILENAME              },
+  { "penguin.moving",                  UNDEFINED_FILENAME              },
+  { "penguin.waiting",                 UNDEFINED_FILENAME              },
+  { "pig.moving",                      UNDEFINED_FILENAME              },
+  { "pig.waiting",                     UNDEFINED_FILENAME              },
+  { "pig.digging",                     UNDEFINED_FILENAME              },
+  { "dragon.moving",                   UNDEFINED_FILENAME              },
+  { "dragon.waiting",                  UNDEFINED_FILENAME              },
+  { "dragon.attacking",                        UNDEFINED_FILENAME              },
 
   /* sounds not associated to game elements (used for menu screens etc.) */
   /* keyword to stop parser: "NO_MORE_ELEMENT_SOUNDS" <-- do not change! */
 
   /* sounds for other game actions */
-  { "game.starting",                   UNDEFINED_FILENAME      },
-  { "game.running_out_of_time",                "gong.wav"              },
-  { "game.leveltime_bonus",            "sirr.wav"              },
-  { "game.losing",                     "lachen.wav"            },
-  { "game.winning",                    UNDEFINED_FILENAME      },
-  { "game.sokoban_solving",            "buing.wav"             },
+  { "game.starting",                   UNDEFINED_FILENAME              },
+  { "game.running_out_of_time",                "gong.wav"                      },
+  { "game.leveltime_bonus",            "sirr.wav"                      },
+  { "game.losing",                     "lachen.wav"                    },
+  { "game.winning",                    UNDEFINED_FILENAME              },
+  { "game.sokoban_solving",            "buing.wav"                     },
 
   /* sounds for other non-game actions */
-  { "door.opening",                    "oeffnen.wav"           },
-  { "door.closing",                    "oeffnen.wav"           },
+  { "door.opening",                    "oeffnen.wav"                   },
+  { "door.closing",                    "oeffnen.wav"                   },
 
-  { "background.MAIN",                 UNDEFINED_FILENAME      },
-  { "background.LEVELS",               UNDEFINED_FILENAME      },
-  { "background.SCORES",               "halloffame.wav"        },
-  { "background.SCORES.mode_loop",     "false"                 },
-  { "background.EDITOR",               UNDEFINED_FILENAME      },
-  { "background.INFO",                 UNDEFINED_FILENAME      },
-  { "background.SETUP",                        UNDEFINED_FILENAME      },
+  { "background.MAIN",                 UNDEFINED_FILENAME              },
+  { "background.LEVELS",               UNDEFINED_FILENAME              },
+  { "background.SCORES",               "halloffame.wav"                },
+  { "background.SCORES.mode_loop",     "false"                         },
+  { "background.EDITOR",               UNDEFINED_FILENAME              },
+  { "background.INFO",                 UNDEFINED_FILENAME              },
+  { "background.SETUP",                        UNDEFINED_FILENAME              },
 
 #if 0
-  { "[not used]",                      "antigrav.wav"          },
-  { "[not used]",                      "bong.wav"              },
-  { "[not used]",                      "fuel.wav"              },
-  { "[not used]",                      "holz.wav"              },
-  { "[not used]",                      "hui.wav"               },
-  { "[not used]",                      "kabumm.wav"            },
-  { "[not used]",                      "kink.wav"              },
-  { "[not used]",                      "kling.wav"             },
-  { "[not used]",                      "krach.wav"             },
-  { "[not used]",                      "laser.wav"             },
-  { "[not used]",                      "quiek.wav"             },
-  { "[not used]",                      "rumms.wav"             },
-  { "[not used]",                      "schlopp.wav"           },
-  { "[not used]",                      "schrff.wav"            },
-  { "[not used]",                      "schwirr.wav"           },
-  { "[not used]",                      "slurp.wav"             },
-  { "[not used]",                      "sproing.wav"           },
-  { "[not used]",                      "warnton.wav"           },
-  { "[not used]",                      "whoosh.wav"            },
-  { "[not used]",                      "boom.wav"              },
+  { "[not used]",                      "antigrav.wav"                  },
+  { "[not used]",                      "bong.wav"                      },
+  { "[not used]",                      "fuel.wav"                      },
+  { "[not used]",                      "holz.wav"                      },
+  { "[not used]",                      "hui.wav"                       },
+  { "[not used]",                      "kabumm.wav"                    },
+  { "[not used]",                      "kink.wav"                      },
+  { "[not used]",                      "kling.wav"                     },
+  { "[not used]",                      "krach.wav"                     },
+  { "[not used]",                      "laser.wav"                     },
+  { "[not used]",                      "quiek.wav"                     },
+  { "[not used]",                      "rumms.wav"                     },
+  { "[not used]",                      "schlopp.wav"                   },
+  { "[not used]",                      "schrff.wav"                    },
+  { "[not used]",                      "schwirr.wav"                   },
+  { "[not used]",                      "slurp.wav"                     },
+  { "[not used]",                      "sproing.wav"                   },
+  { "[not used]",                      "warnton.wav"                   },
+  { "[not used]",                      "whoosh.wav"                    },
+  { "[not used]",                      "boom.wav"                      },
 #endif
 
-  { NULL,                              NULL                    }
+  { NULL,                              NULL                            }
 };
index 59183376d4b5d816a001952ff982593a2681f25b..9f4d9c1a3589353fded2393a4d9dd333c84f5a76 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-11-22 20:08]"
+#define COMPILE_DATE_STRING "[2003-11-24 02:22]"
index 26ec5f727430cbeca7182886237d636826339c32..cb202d16206bd999051e660581ca6019ba5c250c 100644 (file)
@@ -3136,6 +3136,35 @@ static void ReinitializeElementList()
     element_shift = num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS;
 }
 
+void PrintEditorElementList()
+{
+  boolean *stop = &setup.editor.el_user_defined;
+  int i, j;
+
+  for (i=0; editor_elements_info[i].setup_value != stop; i++)
+  {
+    for (j=0; j < *editor_elements_info[i].headline_list_size; j++)
+    {
+      int element = (*editor_elements_info[i].headline_list)[j];
+
+      printf("# %s\n", element_info[element].token_name);
+    }
+
+    if (j > 0)
+      printf("#\n");
+
+    for (j=0; j < *editor_elements_info[i].element_list_size; j++)
+    {
+      int element = (*editor_elements_info[i].element_list)[j];
+
+      printf("# %s\n", element_info[element].token_name);
+    }
+
+    if (j > 0)
+      printf("#\n");
+  }
+}
+
 static void ReinitializeElementListButtons()
 {
   static boolean last_setup_value_headlines = FALSE;
index 3213c4528fdbc101e3c8d40dbddf96475683fdfb..3844a2c83d29d7f9c87a139daa0c2bb7e56e6091 100644 (file)
@@ -32,5 +32,6 @@ void HandleLevelEditorKeyInput(Key);
 void HandleLevelEditorIdle();
 void HandleEditorGadgetInfoText(void *ptr);
 void RequestExitLevelEditor(boolean);
+void PrintEditorElementList();
 
 #endif
index e870941590c4041bfc946e5f5d5566c85e2ac2bf..3e8a721b7fc743ea31aade60c3f63ab0322a3e1f 100644 (file)
@@ -186,6 +186,7 @@ static void PlayLevelSound(int, int, int);
 static void PlayLevelSoundNearest(int, int, int);
 static void PlayLevelSoundAction(int, int, int);
 static void PlayLevelSoundElementAction(int, int, int, int);
+static void PlayLevelSoundElementActionIfLoop(int, int, int, int);
 static void PlayLevelSoundActionIfLoop(int, int, int);
 static void StopLevelSoundActionIfLoop(int, int, int);
 static void PlayLevelMusic();
@@ -1059,6 +1060,12 @@ void InitGame()
     player->is_pushing = FALSE;
     player->is_switching = FALSE;
 
+    player->is_bored = FALSE;
+    player->is_sleeping = FALSE;
+
+    player->frame_counter_bored = -1;
+    player->frame_counter_sleeping = -1;
+
     player->switch_x = -1;
     player->switch_y = -1;
 
@@ -5944,6 +5951,58 @@ static boolean CheckElementChange(int x, int y, int element, int trigger_event)
   return CheckElementSideChange(x, y, element, CH_SIDE_ANY, trigger_event, -1);
 }
 
+static void SetPlayerWaiting(struct PlayerInfo *player, boolean is_waiting)
+{
+  boolean was_waiting = player->is_waiting;
+
+  if (is_waiting)
+  {
+    int jx = player->jx, jy = player->jy;
+    int element = player->element_nr;
+    int action;
+
+    if (!was_waiting)          /* not waiting -> waiting */
+    {
+      player->is_waiting = TRUE;
+      player->is_bored = FALSE;
+      player->is_sleeping = FALSE;
+
+      player->frame_counter_bored =
+       (FrameCounter +
+        game.player_boring_delay_fixed +
+        SimpleRND(game.player_boring_delay_random));
+      player->frame_counter_sleeping =
+       (FrameCounter +
+        game.player_sleeping_delay_fixed +
+        SimpleRND(game.player_sleeping_delay_random));
+
+      InitPlayerGfxAnimation(player, ACTION_WAITING, player->MovDir);
+    }
+
+    if (FrameCounter >= player->frame_counter_bored)
+      player->is_bored = TRUE;
+    if (FrameCounter >= player->frame_counter_sleeping)
+      player->is_sleeping = TRUE;
+
+    action = (player->is_sleeping ? ACTION_SLEEPING :
+             player->is_bored ? ACTION_BORING : ACTION_WAITING);
+
+    if (!was_waiting)
+      PlayLevelSoundElementAction(jx, jy, element, action);
+    else
+      PlayLevelSoundElementActionIfLoop(jx, jy, element, action);
+  }
+  else if (was_waiting)                /* waiting -> not waiting */
+  {
+    player->is_waiting = FALSE;
+    player->is_bored = FALSE;
+    player->is_sleeping = FALSE;
+
+    player->frame_counter_bored = -1;
+    player->frame_counter_sleeping = -1;
+  }
+}
+
 #if 1
 static byte PlayerActions(struct PlayerInfo *player, byte player_action)
 {
@@ -5998,6 +6057,8 @@ static byte PlayerActions(struct PlayerInfo *player, byte player_action)
       }
     }
 
+    SetPlayerWaiting(player, FALSE);
+
 #if 1
     return player_action;
 #else
@@ -6017,7 +6078,7 @@ static byte PlayerActions(struct PlayerInfo *player, byte player_action)
     CheckGravityMovement(player);
 
     if (player->MovPos == 0)
-      InitPlayerGfxAnimation(player, ACTION_DEFAULT, player->MovDir);
+      SetPlayerWaiting(player, TRUE);
 
     if (player->MovPos == 0)   /* needed for tape.playing */
       player->is_moving = FALSE;
@@ -8594,6 +8655,15 @@ static void PlayLevelSoundElementAction(int x, int y, int element, int action)
     PlayLevelSound(x, y, sound_effect);
 }
 
+static void PlayLevelSoundElementActionIfLoop(int x, int y, int element,
+                                             int action)
+{
+  int sound_effect = element_info[element].sound[action];
+
+  if (sound_effect != SND_UNDEFINED && IS_LOOP_SOUND(sound_effect))
+    PlayLevelSound(x, y, sound_effect);
+}
+
 static void PlayLevelSoundActionIfLoop(int x, int y, int action)
 {
   int sound_effect = element_info[Feld[x][y]].sound[action];
index c0e3fce0f4b15e05c26ab701cc4bf76dab399e2c..2f5bd60df686df939d9cff8bf9a4ef1a9c89fe72 100644 (file)
@@ -826,6 +826,10 @@ static void set_graphic_parameters(int graphic, char **parameter_raw)
   graphic_info[graphic].crumbled_like = -1;    /* do not use clone element */
   graphic_info[graphic].diggable_like = -1;    /* do not use clone element */
   graphic_info[graphic].border_size = TILEX / 8;  /* "CRUMBLED" border size */
+  graphic_info[graphic].anim_delay_fixed = 0;
+  graphic_info[graphic].anim_delay_random = 0;
+  graphic_info[graphic].post_delay_fixed = 0;
+  graphic_info[graphic].post_delay_random = 0;
 
   /* optional x and y tile position of animation frame sequence */
   if (parameter[GFX_ARG_XPOS] != ARG_UNDEFINED_VALUE)
@@ -921,6 +925,20 @@ static void set_graphic_parameters(int graphic, char **parameter_raw)
   if (parameter[GFX_ARG_BORDER_SIZE] != ARG_UNDEFINED_VALUE)
     graphic_info[graphic].border_size = parameter[GFX_ARG_BORDER_SIZE];
 
+  /* this is only used for player "boring" and "sleeping" actions */
+  if (parameter[GFX_ARG_ANIM_DELAY_FIXED] != ARG_UNDEFINED_VALUE)
+    graphic_info[graphic].anim_delay_fixed =
+      parameter[GFX_ARG_ANIM_DELAY_FIXED];
+  if (parameter[GFX_ARG_ANIM_DELAY_RANDOM] != ARG_UNDEFINED_VALUE)
+    graphic_info[graphic].anim_delay_fixed =
+      parameter[GFX_ARG_ANIM_DELAY_RANDOM];
+  if (parameter[GFX_ARG_POST_DELAY_FIXED] != ARG_UNDEFINED_VALUE)
+    graphic_info[graphic].anim_delay_fixed =
+      parameter[GFX_ARG_POST_DELAY_FIXED];
+  if (parameter[GFX_ARG_POST_DELAY_RANDOM] != ARG_UNDEFINED_VALUE)
+    graphic_info[graphic].anim_delay_fixed =
+      parameter[GFX_ARG_POST_DELAY_RANDOM];
+
   /* this is only used for toon animations */
   graphic_info[graphic].step_offset = parameter[GFX_ARG_STEP_OFFSET];
   graphic_info[graphic].step_delay  = parameter[GFX_ARG_STEP_DELAY];
@@ -3179,7 +3197,7 @@ void Execute_Command(char *command)
     int i;
 
     printf("# You can configure additional/alternative image files here.\n");
-    printf("# (The images below are default and therefore commented out.)\n");
+    printf("# (The entries below are default and therefore commented out.)\n");
     printf("\n");
     printf("%s\n", getFormattedSetupEntry("name", "Classic Graphics"));
     printf("\n");
@@ -3198,7 +3216,7 @@ void Execute_Command(char *command)
     int i;
 
     printf("# You can configure additional/alternative sound files here.\n");
-    printf("# (The sounds below are default and therefore commented out.)\n");
+    printf("# (The entries below are default and therefore commented out.)\n");
     printf("\n");
     printf("%s\n", getFormattedSetupEntry("name", "Classic Sounds"));
     printf("\n");
@@ -3214,11 +3232,30 @@ void Execute_Command(char *command)
   }
   else if (strcmp(command, "print musicinfo.conf") == 0)
   {
-    printf("# (Currently only \"name\" and \"sort_priority\" recognized.)\n");
+    int i;
+
+    printf("# You can configure additional/alternative music files here.\n");
+    printf("# (The entries below are default and therefore commented out.)\n");
     printf("\n");
     printf("%s\n", getFormattedSetupEntry("name", "Classic Music"));
     printf("\n");
     printf("%s\n", getFormattedSetupEntry("sort_priority", "100"));
+    printf("\n");
+
+    for (i=0; music_config[i].token != NULL; i++)
+      printf("# %s\n",
+            getFormattedSetupEntry(music_config[i].token,
+                                   music_config[i].value));
+
+    exit(0);
+  }
+  else if (strcmp(command, "print editorsetup.conf") == 0)
+  {
+    printf("# You can configure your personal editor element list here.\n");
+    printf("# (The entries below are default and therefore commented out.)\n");
+    printf("\n");
+
+    PrintEditorElementList();
 
     exit(0);
   }
index 948304ceabed40fbe7e355689d231d3ddb777302..9b3f663352d5833598f6fc81885014758e5f05d5 100644 (file)
@@ -550,36 +550,7 @@ void setString(char **old_value, char *new_value)
 /* command line option handling functions                                    */
 /* ------------------------------------------------------------------------- */
 
-static void printUsage()
-{
-  printf("\n"
-        "Usage: %s [OPTION]... [HOSTNAME [PORT]]\n"
-        "\n"
-        "Options:\n"
-        "  -d, --display HOSTNAME[:SCREEN]  specify X server display\n"
-        "  -b, --basepath DIRECTORY         alternative base DIRECTORY\n"
-        "  -l, --level DIRECTORY            alternative level DIRECTORY\n"
-        "  -g, --graphics DIRECTORY         alternative graphics DIRECTORY\n"
-        "  -s, --sounds DIRECTORY           alternative sounds DIRECTORY\n"
-        "  -m, --music DIRECTORY            alternative music DIRECTORY\n"
-        "  -n, --network                    network multiplayer game\n"
-        "      --serveronly                 only start network server\n"
-        "  -v, --verbose                    verbose mode\n"
-        "      --debug                      display debugging information\n"
-        "  -e, --execute COMMAND            execute batch COMMAND:\n"
-        "\n"
-        "Valid commands for '--execute' option:\n"
-        "  \"print graphicsinfo.conf\"        print default graphics config\n"
-        "  \"print soundsinfo.conf\"          print default sounds config\n"
-        "  \"print musicinfo.conf\"           print default music config\n"
-        "  \"dump level FILE\"                dump level data from FILE\n"
-        "  \"dump tape FILE\"                 dump tape data from FILE\n"
-        "  \"autoplay LEVELDIR\"              play level tapes for LEVELDIR\n"
-        "\n",
-        program.command_basename);
-}
-
-void GetOptions(char *argv[])
+void GetOptions(char *argv[], void (*print_usage_function)(void))
 {
   char **options_left = &argv[1];
 
@@ -641,7 +612,7 @@ void GetOptions(char *argv[])
       Error(ERR_EXIT_HELP, "unrecognized option '%s'", option);
     else if (strncmp(option, "-help", option_len) == 0)
     {
-      printUsage();
+      print_usage_function();
 
       exit(0);
     }
index 71c0d7fe171ffcfb47a7e85a91089676191703e3..266efa285f69db19d390d7a8ccc3046db7ac669f 100644 (file)
@@ -99,7 +99,7 @@ char *getStringCopy(char *);
 char *getStringToLower(char *);
 void setString(char **, char *);
 
-void GetOptions(char **);
+void GetOptions(char **, void (*print_usage_function)(void));
 
 void SetError(char *, ...);
 char *GetError(void);
index 446fb1e4470bfa326bb86856ffca8b1da4370127..00168642fb95fb9665f46805699c6194a560f7ea 100644 (file)
@@ -1234,6 +1234,17 @@ SetupFileList *setListEntry(SetupFileList *list, char *token, char *value)
     return setListEntry(list->next, token, value);
 }
 
+SetupFileList *addListEntry(SetupFileList *list, char *token, char *value)
+{
+  if (list == NULL)
+    return NULL;
+
+  if (list->next == NULL)
+    return (list->next = newSetupFileList(token, value));
+  else
+    return addListEntry(list->next, token, value);
+}
+
 #ifdef DEBUG
 static void printSetupFileList(SetupFileList *list)
 {
@@ -1430,7 +1441,7 @@ static void *loadSetupFileData(char *filename, boolean use_hash)
       if (use_hash)
        setHashEntry((SetupFileHash *)setup_file_data, token, value);
       else
-       insert_ptr = setListEntry((SetupFileList *)insert_ptr, token, value);
+       insert_ptr = addListEntry((SetupFileList *)insert_ptr, token, value);
     }
   }
 
index 85ec5db1b57f7ced3bd63a5de6272f59e147963c..8f1bffef92816a56f9d9e9c00b879bf0d64b0206 100644 (file)
@@ -243,6 +243,7 @@ SetupFileList *newSetupFileList(char *, char *);
 void freeSetupFileList(SetupFileList *);
 char *getListEntry(SetupFileList *, char *);
 SetupFileList *setListEntry(SetupFileList *, char *, char *);
+SetupFileList *addListEntry(SetupFileList *, char *, char *);
 SetupFileList *loadSetupFileList(char *);
 
 SetupFileHash *newSetupFileHash();
index f7b2a41e832b8972b44de1924bbc6ec3c72be431..ee4271d03637f58437856246fb5adea172431cc2 100644 (file)
@@ -3714,7 +3714,18 @@ struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] =
   { ".changing",               ACTION_CHANGING,                FALSE   },
   { ".exploding",              ACTION_EXPLODING,               FALSE   },
   { ".boring",                 ACTION_BORING,                  FALSE   },
-  { ".sleeping",               ACTION_SLEEPING,                TRUE    },
+  { ".boring:1",               ACTION_BORING_1,                FALSE   },
+  { ".boring:2",               ACTION_BORING_2,                FALSE   },
+  { ".boring:3",               ACTION_BORING_3,                FALSE   },
+  { ".boring:4",               ACTION_BORING_4,                FALSE   },
+  { ".boring:5",               ACTION_BORING_5,                FALSE   },
+  { ".boring:6",               ACTION_BORING_6,                FALSE   },
+  { ".boring:7",               ACTION_BORING_7,                FALSE   },
+  { ".boring:8",               ACTION_BORING_8,                FALSE   },
+  { ".sleeping",               ACTION_SLEEPING,                FALSE   },
+  { ".sleeping:1",             ACTION_SLEEPING_1,              FALSE   },
+  { ".sleeping:2",             ACTION_SLEEPING_2,              FALSE   },
+  { ".sleeping:3",             ACTION_SLEEPING_3,              FALSE   },
   { ".dying",                  ACTION_DYING,                   FALSE   },
   { ".turning",                        ACTION_TURNING,                 FALSE   },
   { ".turning_from_left",      ACTION_TURNING_FROM_LEFT,       FALSE   },
@@ -3792,6 +3803,11 @@ struct TokenIntPtrInfo image_config_vars[] =
   { "door_2.step_delay",       &door_2.step_delay                         },
   { "door_2.anim_mode",                &door_2.anim_mode                          },
 
+  { "[player].boring_delay_fixed",     &game.player_boring_delay_fixed    },
+  { "[player].boring_delay_random",    &game.player_boring_delay_random   },
+  { "[player].sleeping_delay_fixed",   &game.player_sleeping_delay_fixed  },
+  { "[player].sleeping_delay_random",  &game.player_sleeping_delay_random },
+
   { NULL,                      NULL,                                      }
 };
 
@@ -3856,6 +3872,36 @@ struct MusicPrefixInfo music_prefix_info[NUM_MUSIC_PREFIXES + 1] =
 /* main()                                                                    */
 /* ========================================================================= */
 
+static void print_usage()
+{
+  printf("\n"
+        "Usage: %s [OPTION]... [HOSTNAME [PORT]]\n"
+        "\n"
+        "Options:\n"
+        "  -d, --display HOSTNAME[:SCREEN]  specify X server display\n"
+        "  -b, --basepath DIRECTORY         alternative base DIRECTORY\n"
+        "  -l, --level DIRECTORY            alternative level DIRECTORY\n"
+        "  -g, --graphics DIRECTORY         alternative graphics DIRECTORY\n"
+        "  -s, --sounds DIRECTORY           alternative sounds DIRECTORY\n"
+        "  -m, --music DIRECTORY            alternative music DIRECTORY\n"
+        "  -n, --network                    network multiplayer game\n"
+        "      --serveronly                 only start network server\n"
+        "  -v, --verbose                    verbose mode\n"
+        "      --debug                      display debugging information\n"
+        "  -e, --execute COMMAND            execute batch COMMAND:\n"
+        "\n"
+        "Valid commands for '--execute' option:\n"
+        "  \"print graphicsinfo.conf\"        print default graphics config\n"
+        "  \"print soundsinfo.conf\"          print default sounds config\n"
+        "  \"print musicinfo.conf\"           print default music config\n"
+        "  \"print editorsetup.conf\"         print default editor config\n"
+        "  \"dump level FILE\"                dump level data from FILE\n"
+        "  \"dump tape FILE\"                 dump tape data from FILE\n"
+        "  \"autoplay LEVELDIR\"              play level tapes for LEVELDIR\n"
+        "\n",
+        program.command_basename);
+}
+
 int main(int argc, char *argv[])
 {
   InitProgramInfo(argv[0], USERDATA_DIRECTORY,
@@ -3867,7 +3913,7 @@ int main(int argc, char *argv[])
   InitExitFunction(CloseAllAndExit);
   InitPlatformDependentStuff();
 
-  GetOptions(argv);
+  GetOptions(argv, print_usage);
   OpenAll();
 
   EventLoop();
index 627d52910ab897329294d468e7765a068e16013c..3c6527ab01c3abd652178e794e2b6822445df9fa 100644 (file)
 #define ACTION_CHANGING                                23
 #define ACTION_EXPLODING                       24
 #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
+#define ACTION_BORING_1                                26
+#define ACTION_BORING_2                                27
+#define ACTION_BORING_3                                28
+#define ACTION_BORING_4                                29
+#define ACTION_BORING_5                                30
+#define ACTION_BORING_6                                31
+#define ACTION_BORING_7                                32
+#define ACTION_BORING_8                                33
+#define ACTION_SLEEPING                                34
+#define ACTION_SLEEPING_1                      35
+#define ACTION_SLEEPING_2                      36
+#define ACTION_SLEEPING_3                      37
+#define ACTION_DYING                           38
+#define ACTION_TURNING                         39
+#define ACTION_TURNING_FROM_LEFT               40
+#define ACTION_TURNING_FROM_RIGHT              41
+#define ACTION_TURNING_FROM_UP                 42
+#define ACTION_TURNING_FROM_DOWN               43
+#define ACTION_OTHER                           44
+
+#define NUM_ACTIONS                            45
 
 /* values for special image configuration suffixes (must match game mode) */
 #define GFX_SPECIAL_ARG_DEFAULT                        0
 #define GFX_ARG_DRAW_XOFFSET                   23
 #define GFX_ARG_DRAW_YOFFSET                   24
 #define GFX_ARG_DRAW_MASKED                    25
-#define GFX_ARG_NAME                           26
+#define GFX_ARG_ANIM_DELAY_FIXED               26
+#define GFX_ARG_ANIM_DELAY_RANDOM              27
+#define GFX_ARG_POST_DELAY_FIXED               28
+#define GFX_ARG_POST_DELAY_RANDOM              29
+#define GFX_ARG_NAME                           30
 
-#define NUM_GFX_ARGS                           27
+#define NUM_GFX_ARGS                           31
 
 
 /* values for sound configuration suffixes */
@@ -1158,7 +1173,7 @@ struct PlayerInfo
   byte programmed_action;      /* action forced by game itself (like moving
                                   through doors); overrides other actions */
 
-  int jx,jy, last_jx,last_jy;
+  int jx, jy, last_jx, last_jy;
   int MovDir, MovPos, GfxDir, GfxPos;
   int Frame, StepFrame;
 
@@ -1178,6 +1193,12 @@ struct PlayerInfo
   boolean is_pushing;
   boolean is_switching;
 
+  boolean is_bored;
+  boolean is_sleeping;
+
+  int frame_counter_bored;
+  int frame_counter_sleeping;
+
   int switch_x, switch_y;
 
   int show_envelope;
@@ -1304,6 +1325,12 @@ struct GameInfo
   boolean gravity;
   boolean explosions_delayed;
   boolean envelope_active;
+
+  /* values for player idle animation (no effect on engine) */
+  int player_boring_delay_fixed;
+  int player_boring_delay_random;
+  int player_sleeping_delay_fixed;
+  int player_sleeping_delay_random;
 };
 
 struct GlobalInfo
@@ -1456,6 +1483,11 @@ struct GraphicInfo
   int diggable_like;           /* element for cloning digging graphics */
   int border_size;             /* border size for "crumbled" graphics */
 
+  int anim_delay_fixed;                /* optional delay values for bored and   */
+  int anim_delay_random;       /* sleeping player animations (animation */
+  int post_delay_fixed;                /* intervall and following pause before  */
+  int post_delay_random;       /* next intervall (bored animation only) */
+
   int step_offset;             /* optional step offset of toon animations */
   int step_delay;              /* optional step delay of toon animations */
 
index fbb3079302ec7e5a67aa8b7986827f3596112b00..e28f068e467df5a93d88eb2f8f06fd53d67be701 100644 (file)
@@ -553,6 +553,19 @@ static int getPlayerGraphic(struct PlayerInfo *player, int move_dir)
     return el_act_dir2img(player->element_nr, player->GfxAction, move_dir);
 }
 
+static boolean equalGraphics(int graphic1, int graphic2)
+{
+  struct GraphicInfo *g1 = &graphic_info[graphic1];
+  struct GraphicInfo *g2 = &graphic_info[graphic2];
+
+  return (g1->bitmap      == g2->bitmap &&
+         g1->src_x       == g2->src_x &&
+         g1->src_y       == g2->src_y &&
+         g1->anim_frames == g2->anim_frames &&
+         g1->anim_delay  == g2->anim_delay &&
+         g1->anim_mode   == g2->anim_mode);
+}
+
 void DrawAllPlayers()
 {
   int i;
@@ -615,11 +628,19 @@ void DrawPlayer(struct PlayerInfo *player)
   if (element == EL_EXPLOSION)
     return;
 
-  action = (player->is_pushing    ? ACTION_PUSHING    :
+  action = (player->is_pushing   ? ACTION_PUSHING    :
            player->is_digging    ? ACTION_DIGGING    :
            player->is_collecting ? ACTION_COLLECTING :
            player->is_moving     ? ACTION_MOVING     :
-           player->is_snapping   ? ACTION_SNAPPING   : ACTION_DEFAULT);
+           player->is_snapping   ? ACTION_SNAPPING   :
+           player->is_sleeping   ? ACTION_SLEEPING   :
+           player->is_bored      ? ACTION_BORING     :
+           player->is_waiting    ? ACTION_WAITING    : ACTION_DEFAULT);
+
+  if (player->is_bored || player->is_sleeping)
+  {
+    /* ... */
+  }
 
 #if 0
   printf("::: '%s'\n", element_action_info[action].suffix);
@@ -704,8 +725,7 @@ void DrawPlayer(struct PlayerInfo *player)
 
   /* in the case of changed player action or direction, prevent the current
      animation frame from being restarted for identical animations */
-  if (player->Frame == 0 &&
-      graphic_info[graphic].bitmap == graphic_info[last_player_graphic].bitmap)
+  if (player->Frame == 0 && equalGraphics(graphic, last_player_graphic))
     player->Frame = last_player_frame;
 
 #else