rocksndiamonds-3.0.8
authorHolger Schemel <info@artsoft.org>
Sun, 14 Dec 2003 01:32:21 +0000 (02:32 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:45:04 +0000 (10:45 +0200)
18 files changed:
CHANGES
ChangeLog [deleted file]
src/Makefile
src/conf_dem.c [deleted file]
src/conf_hlp.c [new file with mode: 0644]
src/conftime.h
src/editor.c
src/files.c
src/game.c
src/init.c
src/libgame/misc.c
src/libgame/misc.h
src/libgame/msdos.c
src/libgame/setup.c
src/libgame/sound.c
src/libgame/system.c
src/main.h
src/tools.c

diff --git a/CHANGES b/CHANGES
index 223c61837e3c5d2667e9fe9aa3081a284143a701..f8bad85919f05832bae9379472b28d6114b2948e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-Release Version 3.0.8 [13 DEC 2003]
+Release Version 3.0.8 [14 DEC 2003]
 -----------------------------------
        - added "musicinfo.conf" for menu and level music configuration
        - added "editorsetup.conf" for editor element list configuration
@@ -16,6 +16,23 @@ Release Version 3.0.8 [13 DEC 2003]
        - fixed bug with double nut cracking sound
        - fixed a very nasty bug in dragon turning code in TurnRoundExt()
        - finally fixed tape recording when player is created from CE change
+       - added new contributed levels from the following players:
+         + Audrius Saikunas (4 levels)
+         + Efraim Yawitz (20 levels)
+         + Krystian Abramowicz (100 levels)
+         + Paul E Collins (formerly known as Equinox Tetrachloride; 64 levels)
+         + Sebastian Simon (12 levels)
+       - amazing new level set:
+         + "BD2K3" from Alan Bond
+         + 43 levels full of BD nostalgia, action and fantastic effects
+         + overwhelming use of custom elements
+         + complete artwork set with graphics, sounds and music
+         + available as a separate download from www.artsoft.org
+       - another great level set was updated:
+         + "jue2" from Jürgen Bonhagen
+         + 15 new mind-boggling levels full of new challenges for your brain
+         + complete artwork set with graphics and sounds
+         + available for downloading from "http://www.jb-line.de/rnd.html"
 
 Release Version 3.0.7 [10 NOV 2003]
 -----------------------------------
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644 (file)
index 2fccf0c..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,500 +0,0 @@
-2003-12-13
-       * fixed bug with double nut cracking sound
-         (by eliminating "default element action sound" assignment in init.c)
-
-2003-12-10
-       * fixed crash when no music info files are available
-
-2003-12-07
-       * fixed boring and sleeping sounds
-
-2003-12-05
-       * added "maze runner" and "maze hunter" movement types
-       * added extended collision conditions for custom elements
-
-2003-12-03
-       * added warnings for undefined token values in artwork config files
-
-2003-12-02
-       * added menu entry for level set information to the info screen
-
-2003-12-02
-       * fixed bug with wrong default impact sound for colored emeralds
-
-2003-11-30
-       * added several sub-screens for the info screen
-       * menu text now also clickable (not only blue/red sphere left of it)
-
-2003-11-25
-       * added configurable "bored" and "sleeping" animations for the player
-       * added "awakening" sound for player waking up after sleeping
-
-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-19
-       * finally fixed tape recording when player is created from CE change
-
-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)
-
-2003-11-13
-       * fixed turning movement of butterflies and fireflies (no frame reset)
-       * enhanced sniksnak turning movement (two steps instead of only one)
-
-2003-11-10
-       * Version number set to 3.0.8.
-
-2003-11-10
-       * Version 3.0.7 released.
-
-2003-11-09
-       * fixed reset of player animation frame when, for example,
-         walking, digging or collecting share the same animation
-       * fixed CE with "deadly when touching" exploding when touching amoeba
-
-2003-11-08
-       * fixed tape recording when player is created from CE element change
-
-2003-11-04
-       * introduced "turning..." action graphic for elements with move delay
-         (non-CE: bug, spaceship, sniksnak, mole, pacman, yamyam)
-       * added turning animations for bug, spaceship and sniksnak
-
-2003-11-03
-       * prevent "extended" changed elements from delay change in same frame
-
-2003-11-02
-       * fixed bug when pushing element that can move away to the side
-         (like pushing falling elements, but now with moving elements)
-
-2003-11-01
-       * finally fixed serious bug in code for delayed element pushing (again)
-
-2003-10-19
-       * unavailable setup options now marked as "n/a" instead of "off"
-       * new boolean directive "latest_engine" for "levelinfo.conf": when set
-         to "true", levels are always played with the latest game engine,
-         which is desired for levels that are imported from other games; all
-         other levels are played with the engine version stored in level file
-         (which is normally the engine version the level was created with)
-
-2003-10-18
-       * fixed serious bug in code for delayed element pushing
-       * fixed little bug in animation frame selection for pushed elements
-       * speed-up of reading config file for verbose output
-
-2003-10-08
-       * added configuration option for opening and closing Supaplex exit
-       * added configuration option for moving up/down animation for Murphy
-       * fixed incorrectly displayed animation for attacking dragon
-       * fixed bug with not setting initial gravity for each new game
-       * fixed bug with teleportation of player by custom element change
-       * fixed bug with player not getting smashed by rock sometimes
-
-2003-10-06
-       * Version number set to 3.0.7.
-
-2003-10-06
-       * Version 3.0.6 released.
-
-2003-10-05
-       * added support for MP3 music for SDL version through SMPEG library
-
-2003-10-03
-       * fixed bug when initializing font graphic structure
-       * fixed bug with animation mode "pingpong" when using only 1 frame
-       * fixed bug with extended change target introduced in 3.0.5
-       * fixed bug where passing over moving element doubles player speed
-       * fixed bug with elements continuing to move into push direction
-       * fixed bug with duplicated player when dropping bomb with shield on
-       * added "switching" event for custom elements ("pressing" only once)
-       * fixed switching bug (resetting flag when not switching but not idle)
-
-2003-09-29
-       * fixed element tokens for certain file elements with ".active" etc.
-
-2003-09-29
-       * Version number set to 3.0.6.
-
-2003-09-29
-       * Version 3.0.5 released.
-
-2003-09-28
-       * now four envelope elements available
-       * font, background, animation and sound for envelope now configurable
-       * main menu doors opening/closing animation type now configurable
-
-2003-09-27
-       * active/inactive sides configurable for custom element changes
-       * new movement type "move when pushed" available for custom elements
-
-2003-09-20
-       * fixed bug in multiple config pages loader code that caused crashes
-
-2003-09-13
-       * enhanced (remaining low-resolution) Supaplex graphics
-
-2003-09-13
-       * Version number set to 3.0.5.
-
-2003-09-13
-       * Version 3.0.4 released.
-
-2003-09-12     src/tools.c
-       * fixed bug in custom definition of crumbled element graphics
-
-2003-09-11     src/files.c
-       * fixed bug in multiple config pages code that caused crashes
-
-2003-09-08
-       * Version number set to 3.0.4.
-
-2003-09-08
-       * Version 3.0.3 released.
-
-2003-09-07
-       * added music to Supaplex classic level set
-
-2003-09-07     src/libgame/misc.c
-       * added support for loading various music formats through SDL_mixer
-
-2003-09-06     (various source files)
-       * fixed several nasty bugs that may have caused crashes on some systems
-       * added envelope content which gets displayed when collecting envelope
-       * added multiple change event pages for custom elements
-
-2003-08-24     src/game.c
-       * fixed problem with player animation when snapping and moving
-
-2003-08-23     src/screens.c, src/cartoons.c, src/libgame/toons.c
-       * fixed problem with flickering when drawing toon animations
-
-2003-08-23     src/libgame/sdl.c
-       * fixed problem with setting mouse cursor in SDL version in fullscreen
-
-2003-08-23     src/game.c
-       * fixed bug (missing array boundary check) which could crash the game
-
-2003-08-23
-       * Version number set to 3.0.3.
-
-2003-08-22
-       * Version 3.0.2 released.
-
-2003-08-21     src/game.c
-       * fixed bug with creating inaccessible elements at player position
-
-2003-08-20     src/init.c
-       * fixed bug with not finding current level artwork directory
-
-2003-08-20     src/files.c
-       * fixed bug with choosing wrong engine version when playing tapes
-       * fixed bug with messing up custom element properties in 3.0.0 levels
-
-2003-08-18
-       * Version number set to 3.0.2.
-
-2003-08-18
-       * Version 3.0.1 released.
-
-2003-08-17     (no source files affected)
-       * changed all "classic" PCX image files with 16 colors or less to
-         256 color (8 bit) storage format, because the Allegro game library
-         cannot handle PCX files with less than 256 colors (contributed
-         graphics are not affected and might look wrong in the DOS version)
-
-2003-08-16     src/init.c
-       * fixed bug which (for example) crashed the level editor when defining
-         "dynamite.EDITOR:  [NONE]", because graphics may not be undefined
-         (only set to default) -- invalid graphics now set to default graphic
-
-2003-08-16     src/init.c
-       * fixed graphical bug of player digging/collecting/snapping element
-         when no corresponding graphic/animation is defined for this action,
-         resulting in player being drawn as EL_EMPTY (which should only be
-         done to elements being collected, but not to the player)
-
-2003-08-16     src/game.c
-       * fixed small graphical bug of player not totally moving into exit
-
-2003-08-16     src/libgame/setup.c
-       * fixed bug with wrong MS-DOS 8.3 filename conversion
-
-2003-08-16     src/tools.c
-       * fixed bug with invisible mouse cursor when pressing ESC while playing
-
-2003-08-16     (various source files)
-       * added another 128 custom elements (disabled in editor by default)
-
-2003-08-16     src/editor.c
-       * fixed NULL string bug causing Solaris to crash in sprintf()
-
-2003-08-16     src/screen.c
-       * fixed drawing over scrollbar on level selection with custom fonts
-
-2003-08-15     src/game.c
-       * cleanup of simple sounds / loop sounds / music settings
-
-2003-08-08     (various source files)
-       * added custom element property for dropping collected elements
-
-2003-08-08     src/conf_gfx.c
-       * fixed bug with missing graphic for active red disk bomb
-
-2003-08-07     src/files.c, src/editor.c src/game.c, src/main.h
-       * Extended variable "level.gravity" to "level.initial_gravity" and
-         "game.current_gravity" to prevent level setting from being changed
-         by playing the level (keeping the runtime value after playing).
-
-       * Fixed graphics bug when digging element that has 'crumbled' graphic
-         definition, but not 'diggable' graphic definition.
-
-2003-08-06
-       * Version number set to 3.0.1.
-
-2003-08-05
-       * Version 3.0.0 released.
-
-2003-08-05
-       * various bug fixes; among others:
-         - fixed bug with pushing spring over empty space
-         - fixed bug with leaving tube while placing dynamite
-         - fixed bug with explosion of smashed penguins
-         - allow Murphy player graphic in levels with non-Supaplex elements
-
-2003-04-07
-       * Various changes.
-       * I have forgotten to document changes for some time.
-
-2002-12-31
-       * Pre-Release Version 2.2.0rc1 released.
-
-2002-08-25
-       * Version number set to 2.1.2.
-
-2002-08-13
-       * Version 2.1.1 released.
-
-2002-08-10
-       * Version number set to 2.1.1.
-
-2002-08-05
-       * Version 2.1.0 released.
-       
-2002-05-19
-       * Version number set to 2.1.0.
-
-2002-04-03 to 2002-05-19       (various source files)
-       * graphics, sounds and music now fully configurable
-       * bug fixed that prevented walking through tubes when gravity on
-
-2002-04-02     src/events.c, src/editor.c
-       * Make Escape key less aggressive when playing or when editing level.
-         This can be configured as an option in the setup menu. (Default is
-         "less aggressive" which means "ask user if something can be lost"
-         when pressing the Escape key.)
-
-2002-04-02     src/screen.c
-       * Added "graphics setup" screen.
-
-2002-04-01     src/screen.c
-       * Changed "choose level" setup screen stuff to be more generic (to
-         make it easier to add more "choose from generic tree" setup screens).
-
-2002-04-01     src/config.c, src/timestamp.h
-       * Added source files "src/config.[ch]" and "src/timestamp.h" (which
-         automatically gets created by "src/Makefile" and contains an actual
-         compile-time timestamp to identify development versions of the game).
-
-2002-03-31     src/tape.c, src/events.c
-       * Added quick game/tape save/load functions to tape stuff which can be
-         invoked by a keyboard shortcut. Default: "F1" saves game/tape, "F2"
-         loads previously recorded tape and directly goes into recording mode
-         from the end of the tape (therefore appending to the tape).
-
-2002-03-31     src/tape.c
-       * Added "index mark" function to tape recorder. When playing or
-         recording, "eject" button changes to "index" button. Setting index
-         mark is not yet implemented, but pressing index button when playing
-         allows very quick advancing to end of tape (when normal playing),
-         very fast forward mode (when playing with normal fast forward) or
-         very fast reaching of "pause before end of tape" (when playing with
-         "pause before end" playing mode).
-
-2002-03-30     src/cartoons.c
-       * Moved some stuff from cartoons.c to the new "src/libgame/toons.c".
-
-2002-03-29     src/screen.c
-       * Changed setup screen stuff to be more generic (to make it easier
-         to add more setup screens).
-
-2002-03-23     src/main.c, src/main.h
-       * Various changes due to the introduction of the new libgame files
-         "setup.c" and "joystick.c".
-
-2002-03-23     src/files.c
-       * Generic parts of "src/files.c" (mainly setup and level directory
-         stuff) moved to new libgame file "src/libgame/setup.c".
-
-2002-03-23     src/joystick.c
-       * File "src/joystick.c" moved to libgame source tree, with
-         correspondig changes.
-
-2002-03-22     src/screens.c
-       * "HandleChooseLevel()": Another bug in level series navigation fixed.
-         (Wrong level series information displayed when entering main group.)
-
-2002-03-22     src/editor.c
-       * Slight change to support new gadget event "GD_EVENT_INFO_LEAVING".
-
-2002-03-22     src/editor.c
-       * Changed behaviour of "Escape" key in level editor to be more
-         intuitive: When in "Element Properties" or "Level Info" mode,
-         return to "Drawing Mode" instead of leaving the level editor.
-
-2002-03-21     src/game.c, src/editor.c, src/files.c
-       * 2.0.1 introduced the corrected "Emerald Mine" style behaviour of
-         gems (emeralds, diamonds, ...) slipping down from normal wall,
-         steel wall and growing wall (as in E.M.C. style levels). Although
-         the behaviour of contributed and private levels wasn't changed (due
-         to the use of "level.game_version"; see previous entry), editing
-         those levels will (of course) change the behaviour accordingly.
-
-         This change seems a bit too hard after thinking about it, because
-         the EM style behaviour is not the "expected" behaviour (gems would
-         normally only slip down from "rounded" walls). Therefore this was
-         now changed to an element property for gem style elements, with the
-         default setting "off" (which means: no special EM style behaviour).
-         To fix older converted levels, this flag is set to "on" for pre-2.0
-         levels that are neither contributed nor private levels.
-
-2002-03-20     src/files.h
-       * Corrected settings for "level.game_version" depending of level type.
-         (Contributed and private levels always get played with game engine
-         version they were created with, while converted levels always get
-         played with the most recent version of the game engine, to let new
-         corrections of the emulation behaviour take effect.)
-
-2002-03-20     src/main.h
-       * Added "#include <time.h>". This seems to be needed by "tape.c" for
-         compiling the SDL version on some systems.
-         Thanks to the several people who pointed this out.
-
-2002-03-19
-       * Version number set to 2.0.2.
-
-2002-03-19
-       * Version 2.0.1 released.
-
-2002-03-18     src/screens.c
-       * "HandleChooseLevel()": Small bug in level series navigation fixed.
-
-2002-03-18     src/files.c [src/libgame/misc.c]
-       * Moved some common functions from src/files.c to src/libgame/misc.c.
-
-2002-03-18     src/files.c [src/libgame/misc.c]
-       * Changed permissions for new directories and saved files (especially
-         score files) according to suggestions of Debian users and mantainers.
-         Thanks to Drew Parsons <dparsons@emerall.com> for the patch.
-
-2002-03-17     src/files.c
-       * Changed "{Load|Save}{Level|Tape}()" to IFF style file format:
-         Replaced "cookie" header string ("ROCKSNDIAMONDS_...\n") with
-         real IFF style header "RND1....XXXX" (where "XXXX" is "CAVE"
-         for levels and "TAPE" for tapes). Old "cookie" style format is
-         still supported for reading. New level and tape files are written
-         in new format.
-
-       * New IFF chunk "VERS" contains version numbers for file and game
-         (where "game version" is the version of the program that wrote the
-         file, and "file version" is a version number to distinguish files
-         with different format, for example after adding new features).
-
-2002-03-15     src/screen.c
-       * "DrawHallOfFame()": "FadeSounds()" when entering the hall of fame.
-         (Before, you heard a mixture of the in-game music and the
-         hall-of-fame music.)
-
-2002-03-14     src/events.c
-       * Function "DumpTape()" (files.c) now available by pressing 't' from
-         main menu (when in DEBUG mode).
-
-2002-03-14     src/game.c
-       * "GameWon()": When game was won playing a tape, now there is no delay
-         raising the score and no corresponding sound is played.
-
-2002-03-14     src/files.c
-       * Changed "LoadTape()" for real chunk support and also adjusted
-         "SaveTape()" accordingly.
-
-2002-03-14     src/game.c, src/tape.c, src/files.c
-       * Important changes to tape format: The old tape format stored all
-         actions with a real effect with a corresponding delay between the
-         stored actions. This had some major disadvantages (for example,
-         push delays had to be ignored, pressing a button for some seconds
-         mutated to several single button presses because of the non-action
-         delays between two action frames etc.). The new tape format just
-         stupidly records all device actions and replays them later. I really
-         don't know why I haven't solved it that way before?! Old-style tapes
-         (with tape file version less than 2.0) get converted to the new
-         format on-the-fly when loading and can therefore still be played;
-         only some minor parts of the old-style tape handling code was needed.
-         (A perfect conversion is not possible, because there is information
-         missing about the device actions between two action frames.)
-
-2002-03-14     src/files.c
-       * New function "DumpTape()" to dump the contents of the current tape
-         in a human readable format.
-
-2002-03-14     src/game.c
-       * Small tape bug fixed: When automatically advancing to next level
-         after a game was won, the tape from the previous level still was
-         loaded as a tape for the new level.
-
-2002-03-14     src/tape.c
-       * Small graphical bug fixed: When pressing ""Record" or "Play" on
-         tape, cartoons did not get completely removed because
-         StopAnimation() was not called.
-
-2002-03-13     src/files.c
-       * Changed "LoadLevel()" and "SaveLevel()" to add new chunk "CNT2".
-         Fixed bug of "CONT" and "BODY" (chunk size was set to 8-bit element
-         size even when using 16-bit elements). Added new chunk "CNT2" for
-         16-bit amoeba content (previously written in 8-bit field in "HEAD"
-         chunk even when content was 16-bit element). "CNT2" should now be
-         able to store content for arbitrary elements (up to eight blocks of
-         3 x 3 element arrays). All "CNT2" elements will always be stored as
-         16-bit elements. "CONT" (with 8/16-bit elements) now obsolete.
-
-2002-03-13     src/files.c
-       * Changed "LoadLevel()" for real chunk support.
-
-2002-03-12     src/game.c
-       * Fixed problem (introduced after 2.0.0 release) with penguins
-         not getting killed by enemies
-
-2002-02-24     src/game.c, src/main.h
-       * Added "player->is_moving"; now "player->last_move_dir" does
-         not contain any information if the player is just moving at
-         the moment or not.
-         Before, "player->last_move_dir" was misused for this purpose
-         for  the robot stuff (robots don't kill players when they are
-         moving). But setting "player->last_move_dir" to MV_NO_MOVING
-         broke tapes when walking through pipes!
-         ("IS_MOVING()" uses "MovPos[][]", but this fails when it is 0
-         in a continuous movement. This fact is ignored for friends and
-         enemies, though.)
index 16c6cd6ac003387bca848dd9a580404d65d77a88..05eccd9916ed18c56496318ab01a9216a5f4c6b0 100644 (file)
@@ -112,7 +112,7 @@ CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR)
 
 
 CONFIG = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES) $(JOYSTICK)
-DEBUG = -DDEBUG -g
+DEBUG = -DDEBUG -g
 # PROFILING = $(PROFILING_FLAGS)
 
 # OPTIONS = $(DEBUG) -Wall                     # only for debugging purposes
@@ -136,7 +136,7 @@ SRCS =      main.c          \
        conf_gfx.c      \
        conf_snd.c      \
        conf_mus.c      \
-       conf_dem.c      \
+       conf_hlp.c      \
        init.c          \
        config.c        \
        events.c        \
@@ -154,7 +154,7 @@ OBJS =      main.o          \
        conf_gfx.o      \
        conf_snd.o      \
        conf_mus.o      \
-       conf_dem.o      \
+       conf_hlp.o      \
        init.o          \
        config.o        \
        events.o        \
diff --git a/src/conf_dem.c b/src/conf_dem.c
deleted file mode 100644 (file)
index 7f84461..0000000
+++ /dev/null
@@ -1,640 +0,0 @@
-/***********************************************************
-* Rocks'n'Diamonds -- McDuffin Strikes Back!               *
-*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment                      *
-*               Holger Schemel                             *
-*               Detmolder Strasse 189                      *
-*               33604 Bielefeld                            *
-*               Germany                                    *
-*               e-mail: info@artsoft.org                   *
-*----------------------------------------------------------*
-* conf_inf.c                                               *
-***********************************************************/
-
-#include "libgame/libgame.h"
-#include "main.h"
-
-
-/* List values that are not defined in the configuration file are set to
-   reliable default values. If that value is GFX_ARG_UNDEFINED, it will
-   be dynamically determined, using some of the other list values. */
-
-struct ConfigInfo helpanim_config[] =
-{
-  { "player_1.moving.down",                    "16"                    },
-  { "player_1.moving.up",                      "16"                    },
-  { "player_1.moving.left",                    "16"                    },
-  { "player_1.moving.right",                   "16"                    },
-  { "player_1.pushing.left",                   "16"                    },
-  { "player_1.pushing.right",                  "16"                    },
-  { "end",                                     ""                      },
-
-  { "sand",                                    "50"                    },
-  { "sand.digging.left",                       "8"                     },
-  { "empty_space",                             "10"                    },
-  { "sand",                                    "50"                    },
-  { "sand.digging.right",                      "8"                     },
-  { "empty_space",                             "10"                    },
-  { "sand",                                    "50"                    },
-  { "sand.digging.up",                         "8"                     },
-  { "empty_space",                             "10"                    },
-  { "sand",                                    "50"                    },
-  { "sand.digging.down",                       "8"                     },
-  { "empty_space",                             "10"                    },
-  { "end",                                     ""                      },
-
-  { "empty_space",                             "-1"                    },
-  { "end",                                     ""                      },
-
-  { "quicksand_empty",                         "-1"                    },
-  { "end",                                     ""                      },
-
-  { "steelwall",                               "-1"                    },
-  { "end",                                     ""                      },
-
-  { "wall",                                    "-1"                    },
-  { "end",                                     ""                      },
-
-  { "expandable_wall.growing.left",            "20"                    },
-  { "wall",                                    "50"                    },
-  { "expandable_wall.growing.right",           "20"                    },
-  { "wall",                                    "50"                    },
-  { "expandable_wall.growing.up",              "20"                    },
-  { "wall",                                    "50"                    },
-  { "expandable_wall.growing.down",            "20"                    },
-  { "wall",                                    "50"                    },
-  { "empty_space",                             "20"                    },
-  { "end",                                     ""                      },
-
-  { "invisible_wall",                          "-1"                    },
-  { "end",                                     ""                      },
-
-  { "wall_slippery",                           "-1"                    },
-  { "end",                                     ""                      },
-
-  { "char_space",                              "10"                    },
-  { "char_exclam",                             "10"                    },
-  { "char_quotedbl",                           "10"                    },
-  { "char_numbersign",                         "10"                    },
-  { "char_dollar",                             "10"                    },
-  { "char_procent",                            "10"                    },
-  { "char_ampersand",                          "10"                    },
-  { "char_apostrophe",                         "10"                    },
-  { "char_parenleft",                          "10"                    },
-  { "char_parenright",                         "10"                    },
-  { "char_asterisk",                           "10"                    },
-  { "char_plus",                               "10"                    },
-  { "char_comma",                              "10"                    },
-  { "char_minus",                              "10"                    },
-  { "char_period",                             "10"                    },
-  { "char_slash",                              "10"                    },
-  { "char_0",                                  "10"                    },
-  { "char_1",                                  "10"                    },
-  { "char_2",                                  "10"                    },
-  { "char_3",                                  "10"                    },
-  { "char_4",                                  "10"                    },
-  { "char_5",                                  "10"                    },
-  { "char_6",                                  "10"                    },
-  { "char_7",                                  "10"                    },
-  { "char_8",                                  "10"                    },
-  { "char_9",                                  "10"                    },
-  { "char_colon",                              "10"                    },
-  { "char_semicolon",                          "10"                    },
-  { "char_less",                               "10"                    },
-  { "char_equal",                              "10"                    },
-  { "char_greater",                            "10"                    },
-  { "char_question",                           "10"                    },
-  { "char_at",                                 "10"                    },
-  { "char_a",                                  "10"                    },
-  { "char_b",                                  "10"                    },
-  { "char_c",                                  "10"                    },
-  { "char_d",                                  "10"                    },
-  { "char_e",                                  "10"                    },
-  { "char_f",                                  "10"                    },
-  { "char_g",                                  "10"                    },
-  { "char_h",                                  "10"                    },
-  { "char_i",                                  "10"                    },
-  { "char_j",                                  "10"                    },
-  { "char_k",                                  "10"                    },
-  { "char_l",                                  "10"                    },
-  { "char_m",                                  "10"                    },
-  { "char_n",                                  "10"                    },
-  { "char_o",                                  "10"                    },
-  { "char_p",                                  "10"                    },
-  { "char_q",                                  "10"                    },
-  { "char_r",                                  "10"                    },
-  { "char_s",                                  "10"                    },
-  { "char_t",                                  "10"                    },
-  { "char_u",                                  "10"                    },
-  { "char_v",                                  "10"                    },
-  { "char_w",                                  "10"                    },
-  { "char_x",                                  "10"                    },
-  { "char_y",                                  "10"                    },
-  { "char_z",                                  "10"                    },
-  { "char_bracketleft",                                "10"                    },
-  { "char_backslash",                          "10"                    },
-  { "char_bracketright",                       "10"                    },
-  { "char_asciicircum",                                "10"                    },
-  { "char_underscore",                         "10"                    },
-  { "char_copyright",                          "10"                    },
-  { "char_aumlaut",                            "10"                    },
-  { "char_oumlaut",                            "10"                    },
-  { "char_uumlaut",                            "10"                    },
-  { "char_degree",                             "10"                    },
-  { "char_trademark",                          "10"                    },
-  { "char_cursor",                             "10"                    },
-  { "end",                                     ""                      },
-
-  { "emerald",                                 "50"                    },
-  { "emerald.collecting",                      "8"                     },
-  { "empty_space",                             "10"                    },
-  { "end",                                     ""                      },
-
-  { "diamond",                                 "50"                    },
-  { "diamond.collecting",                      "8"                     },
-  { "empty_space",                             "10"                    },
-  { "end",                                     ""                      },
-
-  { "bd_diamond",                              "50"                    },
-  { "bd_diamond.collecting",                   "8"                     },
-  { "empty_space",                             "10"                    },
-  { "end",                                     ""                      },
-
-  { "emerald_yellow",                          "50"                    },
-  { "emerald_yellow.collecting",               "8"                     },
-  { "empty_space",                             "10"                    },
-  { "emerald_red",                             "50"                    },
-  { "emerald_red.collecting",                  "8"                     },
-  { "empty_space",                             "10"                    },
-  { "emerald_purple",                          "50"                    },
-  { "emerald_purple.collecting",               "8"                     },
-  { "empty_space",                             "10"                    },
-  { "end",                                     ""                      },
-
-  { "bd_rock",                                 "-1"                    },
-  { "end",                                     ""                      },
-
-  { "bomb",                                    "100"                   },
-  { "bomb.exploding",                          "16"                    },
-  { "empty_space",                             "10"                    },
-  { "end",                                     ""                      },
-
-  { "nut",                                     "100"                   },
-  { "nut.breaking",                            "6"                     },
-  { "emerald",                                 "20"                    },
-  { "end",                                     ""                      },
-
-  { "wall_emerald",                            "100"                   },
-  { "wall_emerald.exploding",                  "16"                    },
-  { "emerald",                                 "20"                    },
-  { "end",                                     ""                      },
-
-  { "wall_diamond",                            "100"                   },
-  { "wall_diamond.exploding",                  "16"                    },
-  { "diamond",                                 "20"                    },
-  { "end",                                     ""                      },
-
-  { "wall_bd_diamond",                         "100"                   },
-  { "wall_bd_diamond.exploding",               "16"                    },
-  { "bd_diamond",                              "20"                    },
-  { "end",                                     ""                      },
-
-  { "wall_emerald_yellow",                     "100"                   },
-  { "wall_emerald_yellow.exploding",           "16"                    },
-  { "emerald_yellow",                          "20"                    },
-  { "wall_emerald_red",                                "100"                   },
-  { "wall_emerald_red.exploding",              "16"                    },
-  { "emerald_red",                             "20"                    },
-  { "wall_emerald_purple",                     "100"                   },
-  { "wall_emerald_purple.exploding",           "16"                    },
-  { "emerald_purple",                          "20"                    },
-  { "end",                                     ""                      },
-
-  { "acid",                                    "-1"                    },
-  { "end",                                     ""                      },
-
-  { "key_1",                                   "50"                    },
-  { "key_2",                                   "50"                    },
-  { "key_3",                                   "50"                    },
-  { "key_4",                                   "50"                    },
-  { "end",                                     ""                      },
-
-  { "gate_1",                                  "50"                    },
-  { "gate_2",                                  "50"                    },
-  { "gate_3",                                  "50"                    },
-  { "gate_4",                                  "50"                    },
-  { "end",                                     ""                      },
-
-  { "gate_1_gray",                             "50"                    },
-  { "gate_2_gray",                             "50"                    },
-  { "gate_3_gray",                             "50"                    },
-  { "gate_4_gray",                             "50"                    },
-  { "end",                                     ""                      },
-
-  { "dynamite",                                        "-1"                    },
-  { "end",                                     ""                      },
-
-  { "dynamite.active",                         "96"                    },
-  { "dynamite.exploding",                      "16"                    },
-  { "empty_space",                             "20"                    },
-  { "end",                                     ""                      },
-
-  { "dynabomb.active",                         "100"                   },
-  { "dynabomb.exploding",                      "16"                    },
-  { "empty_space",                             "20"                    },
-  { "end",                                     ""                      },
-
-  { "dynabomb_increase_number",                        "-1"                    },
-  { "end",                                     ""                      },
-
-  { "dynabomb_increase_size",                  "-1"                    },
-  { "end",                                     ""                      },
-
-  { "dynabomb_increase_power",                 "-1"                    },
-  { "end",                                     ""                      },
-
-  { "spaceship.turning_from_right.up",         "8"                     },
-  { "spaceship.turning_from_up.left",          "8"                     },
-  { "spaceship.turning_from_left.down",                "8"                     },
-  { "spaceship.turning_from_down.right",       "8"                     },
-  { "end",                                     ""                      },
-
-  { "bug.turning_from_right.up",               "8"                     },
-  { "bug.turning_from_up.left",                        "8"                     },
-  { "bug.turning_from_left.down",              "8"                     },
-  { "bug.turning_from_down.right",             "8"                     },
-  { "end",                                     ""                      },
-
-  { "bd_butterfly",                            "-1"                    },
-  { "end",                                     ""                      },
-
-  { "bd_firefly",                              "-1"                    },
-  { "end",                                     ""                      },
-
-  { "pacman.right",                            "16"                    },
-  { "pacman.up",                               "16"                    },
-  { "pacman.left",                             "16"                    },
-  { "pacman.down",                             "16"                    },
-  { "end",                                     ""                      },
-
-  { "yamyam",                                  "-1"                    },
-  { "end",                                     ""                      },
-
-  { "dark_yamyam",                             "-1"                    },
-  { "end",                                     ""                      },
-
-  { "robot",                                   "-1"                    },
-  { "end",                                     ""                      },
-
-  { "mole.moving.right",                       "16"                    },
-  { "mole.moving.up",                          "16"                    },
-  { "mole.moving.left",                                "16"                    },
-  { "mole.moving.down",                                "16"                    },
-  { "end",                                     ""                      },
-
-  { "penguin.moving.right",                    "16"                    },
-  { "penguin.moving.up",                       "16"                    },
-  { "penguin.moving.left",                     "16"                    },
-  { "penguin.moving.down",                     "16"                    },
-  { "end",                                     ""                      },
-
-  { "pig.moving.right",                                "16"                    },
-  { "pig.moving.up",                           "16"                    },
-  { "pig.moving.left",                         "16"                    },
-  { "pig.moving.down",                         "16"                    },
-  { "end",                                     ""                      },
-
-  { "dragon.moving.right",                     "16"                    },
-  { "dragon.moving.up",                                "16"                    },
-  { "dragon.moving.left",                      "16"                    },
-  { "dragon.moving.down",                      "16"                    },
-  { "end",                                     ""                      },
-
-  { "satellite",                               "-1"                    },
-  { "end",                                     ""                      },
-
-  { "robot_wheel",                             "50"                    },
-  { "robot_wheel.active",                      "100"                   },
-  { "end",                                     ""                      },
-
-  { "lamp",                                    "50"                    },
-  { "lamp.active",                             "50"                    },
-  { "end",                                     ""                      },
-
-  { "time_orb_full",                           "50"                    },
-  { "time_orb_empty",                          "50"                    },
-  { "end",                                     ""                      },
-
-  { "amoeba_drop",                             "50"                    },
-  { "amoeba.growing",                          "6"                     },
-  { "amoeba_wet",                              "20"                    },
-  { "end",                                     ""                      },
-
-  { "amoeba_dead",                             "-1"                    },
-  { "end",                                     ""                      },
-
-  { "amoeba_wet",                              "-1"                    },
-  { "end",                                     ""                      },
-
-  { "amoeba_wet",                              "100"                   },
-  { "amoeba.growing",                          "6"                     },
-  { "end",                                     ""                      },
-
-  { "amoeba_full",                             "50"                    },
-  { "amoeba_dead",                             "50"                    },
-  { "amoeba.exploding",                                "16"                    },
-  { "diamond",                                 "20"                    },
-  { "end",                                     ""                      },
-
-  { "game_of_life",                            "-1"                    },
-  { "end",                                     ""                      },
-
-  { "biomaze",                                 "-1"                    },
-  { "end",                                     ""                      },
-
-  { "magic_wall.active",                       "-1"                    },
-  { "end",                                     ""                      },
-
-  { "bd_magic_wall.active",                    "-1"                    },
-  { "end",                                     ""                      },
-
-  { "exit_closed",                             "200"                   },
-  { "exit.opening",                            "30"                    },
-  { "exit_open",                               "100"                   },
-  { "exit.closing",                            "30"                    },
-  { "end",                                     ""                      },
-
-  { "exit_open",                               "-1"                    },
-  { "end",                                     ""                      },
-
-  { "sokoban_object",                          "-1"                    },
-  { "end",                                     ""                      },
-
-  { "sokoban_field_empty",                     "-1"                    },
-  { "end",                                     ""                      },
-
-  { "sokoban_field_full",                      "-1"                    },
-  { "end",                                     ""                      },
-
-  { "speed_pill",                              "-1"                    },
-  { "end",                                     ""                      },
-
-  { NULL,                                      NULL                    }
-};
-
-struct ConfigInfo helptext_config[] =
-{
-  {
-    "player_1",
-    "THE HERO: (Is _this_ guy good old Rockford?)"
-  },
-  {
-    "sand",
-    "Normal sand: You can dig through it"
-  },
-  {
-    "empty_space",
-    "Empty field: You can walk through it"
-  },
-  {
-    "quicksand_empty",
-    "Quicksand: You cannot pass it, but rocks can fall through it"
-  },
-  {
-    "steelwall",
-    "Massive Wall: Nothing can go through it"
-  },
-  {
-    "wall",
-    "Normal Wall: You can't go through it, but you can bomb it away"
-  },
-  {
-    "expandable_wall",
-    "Growing Wall: Grows in several directions if there is an empty field"
-  },
-  {
-    "invisible_wall",
-    "Invisible Wall: Behaves like normal wall, but is invisible"
-  },
-  {
-    "wall_slippery",
-    "Old Wall: Like normal wall, but some things can fall down from it"
-  },
-  {
-    "char_space",
-    "Letter Wall: Looks like a letter, behaves like a normal wall"
-  },
-  {
-    "emerald",
-    "Emerald: You must collect enough of them to finish a level"
-  },
-  {
-    "diamond",
-    "Diamond: Counts as 3 emeralds, but can be destroyed by rocks"
-  },
-  {
-    "bd_diamond",
-    "Diamond (BD style): Counts like one emerald and behaves a bit different"
-  },
-  {
-    "emerald_yellow",
-    "Colorful Gems: Seem to behave like Emeralds"
-  },
-  {
-    "bd_rock",
-    "Rock: Smashes several things; Can be moved by the player"
-  },
-  {
-    "bomb",
-    "Bomb: You can move it, but be careful when dropping it"
-  },
-  {
-    "nut",
-    "Nut: Throw a rock on it to open it; Each nut contains an emerald"
-  },
-  {
-    "wall_emerald",
-    "Wall with an emerald inside: Bomb the wall away to get it"
-  },
-  {
-    "wall_diamond",
-    "Wall with a diamond inside: Bomb the wall away to get it"
-  },
-  {
-    "wall_bd_diamond",
-    "Wall with BD style diamond inside: Bomb the wall away to get it"
-  },
-  {
-    "wall_emerald_yellow",
-    "Wall with colorful gem inside: Bomb the wall away to get it"
-  },
-  {
-    "acid",
-    "Acid: Things that fall in are gone forever (including our hero)"
-  },
-  {
-    "key_1",
-    "Key: Opens the door that has the same color (red/yellow/green/blue)"
-  },
-  {
-    "gate_1",
-    "Door: Can be opened by the key with the same color"
-  },
-  {
-    "gate_1_gray",
-    "Door: You have to find out the right color of the key for it"
-  },
-  {
-    "dynamite",
-    "Dynamite: Collect it and use it to destroy walls or kill enemies"
-  },
-  {
-    "dynamite.active",
-    "Dynamite: This one explodes after a few seconds"
-  },
-  {
-    "dynabomb",
-    "Dyna Bomb: Explodes in 4 directions with variable explosion size"
-  },
-  {
-    "dynabomb_increase_number",
-    "Dyna Bomb: Increases the number of dyna bombs available at a time"
-  },
-  {
-    "dynabomb_increase_size",
-    "Dyna Bomb: Increases the size of explosion of dyna bombs"
-  },
-  {
-    "dynabomb_increase_power",
-    "Dyna Bomb: Increases the power of explosion of dyna bombs"
-  },
-  {
-    "spaceship",
-    "Spaceship: Moves at the left side of walls; don't touch it!"
-  },
-  {
-    "bug",
-    "Bug: Moves at the right side of walls; don't touch it!"
-  },
-  {
-    "bd_butterfly",
-    "Butterfly: Moves at the right side of walls; don't touch it!"
-  },
-  {
-    "bd_firefly",
-    "Firefly: Moves at the left side of walls; don't touch it!"
-  },
-  {
-    "pacman",
-    "Pacman: Eats the amoeba and you, if you're not careful"
-  },
-  {
-    "yamyam",
-    "Cruncher: Eats diamonds and you, if you're not careful"
-  },
-  {
-    "dark_yamyam",
-    "Cruncher (BD style): Eats almost everything"
-  },
-  {
-    "robot",
-    "Robot: Tries to kill the player"
-  },
-  {
-    "mole",
-    "The mole: Eats the amoeba and turns empty space into normal sand"
-  },
-  {
-    "penguin",
-    "The penguin: Guide him to the exit, but keep him away from monsters!"
-  },
-  {
-    "pig",
-    "The Pig: Harmless, but eats all gems it can get"
-  },
-  {
-    "dragon",
-    "The Dragon: Breathes fire, especially to some monsters"
-  },
-  {
-    "satellite",
-    "Sonde: Follows you everywhere; harmless, but may block your way"
-  },
-  {
-    "robot_wheel",
-    "Magic Wheel: Touch it to get rid of the robots for some seconds"
-  },
-  {
-    "lamp",
-    "Light Bulb: All of them must be switched on to finish a level"
-  },
-  {
-    "time_orb_full",
-    "Extra Time Orb: Adds some seconds to the time available for the level"
-  },
-  {
-    "amoeba_drop",
-    "Amoeba Drop: Grows to an amoeba on the ground - don't touch it"
-  },
-  {
-    "amoeba_dead",
-    "Dead Amoeba: Does not grow, but can still kill bugs and spaceships"
-  },
-  {
-    "amoeba_wet",
-    "Normal Amoeba: Grows through empty fields, sand and quicksand"
-  },
-  {
-    "amoeba_wet",
-    "Dropping Amoeba: This one makes drops that grow to a new amoeba"
-  },
-  {
-    "amoeba_full",
-    "Living Amoeba (BD style): Contains other element, when surrounded"
-  },
-  {
-    "game_of_life",
-    "Game Of Life: Behaves like the well known 'Game Of Life' (2333 style)"
-  },
-  {
-    "biomaze",
-    "Biomaze: A bit like the 'Game Of Life', but builds crazy mazes"
-  },
-  {
-    "magic_wall",
-    "Magic Wall: Changes rocks, emeralds and diamonds when they pass it"
-  },
-  {
-    "bd_magic_wall",
-    "Magic Wall (BD style): Changes rocks and BD style diamonds"
-  },
-  {
-    "exit_closed",
-    "Exit door: Opens if you have enough emeralds to finish the level"
-  },
-  {
-    "exit_open",
-    "Open exit door: Enter here to leave the level and exit the actual game"
-  },
-  {
-    "sokoban_object",
-    "Sokoban element: Object which must be pushed to an empty field"
-  },
-  {
-    "sokoban_field_empty",
-    "Sokoban element: Empty field where a Sokoban object can be placed on"
-  },
-  {
-    "sokoban_field_full",
-    "Sokoban element: Field with object which can be pushed away"
-  },
-  {
-    "speed_pill",
-    "Speed pill: Lets the player run twice as fast as normally"
-  },
-
-  {
-    NULL,
-    NULL
-  }
-};
diff --git a/src/conf_hlp.c b/src/conf_hlp.c
new file mode 100644 (file)
index 0000000..68cd4cf
--- /dev/null
@@ -0,0 +1,640 @@
+/***********************************************************
+* Rocks'n'Diamonds -- McDuffin Strikes Back!               *
+*----------------------------------------------------------*
+* (c) 1995-2002 Artsoft Entertainment                      *
+*               Holger Schemel                             *
+*               Detmolder Strasse 189                      *
+*               33604 Bielefeld                            *
+*               Germany                                    *
+*               e-mail: info@artsoft.org                   *
+*----------------------------------------------------------*
+* conf_hlp.c                                               *
+***********************************************************/
+
+#include "libgame/libgame.h"
+#include "main.h"
+
+
+/* List values that are not defined in the configuration file are set to
+   reliable default values. If that value is GFX_ARG_UNDEFINED, it will
+   be dynamically determined, using some of the other list values. */
+
+struct ConfigInfo helpanim_config[] =
+{
+  { "player_1.moving.down",                    "16"                    },
+  { "player_1.moving.up",                      "16"                    },
+  { "player_1.moving.left",                    "16"                    },
+  { "player_1.moving.right",                   "16"                    },
+  { "player_1.pushing.left",                   "16"                    },
+  { "player_1.pushing.right",                  "16"                    },
+  { "end",                                     ""                      },
+
+  { "sand",                                    "50"                    },
+  { "sand.digging.left",                       "8"                     },
+  { "empty_space",                             "10"                    },
+  { "sand",                                    "50"                    },
+  { "sand.digging.right",                      "8"                     },
+  { "empty_space",                             "10"                    },
+  { "sand",                                    "50"                    },
+  { "sand.digging.up",                         "8"                     },
+  { "empty_space",                             "10"                    },
+  { "sand",                                    "50"                    },
+  { "sand.digging.down",                       "8"                     },
+  { "empty_space",                             "10"                    },
+  { "end",                                     ""                      },
+
+  { "empty_space",                             "-1"                    },
+  { "end",                                     ""                      },
+
+  { "quicksand_empty",                         "-1"                    },
+  { "end",                                     ""                      },
+
+  { "steelwall",                               "-1"                    },
+  { "end",                                     ""                      },
+
+  { "wall",                                    "-1"                    },
+  { "end",                                     ""                      },
+
+  { "expandable_wall.growing.left",            "20"                    },
+  { "wall",                                    "50"                    },
+  { "expandable_wall.growing.right",           "20"                    },
+  { "wall",                                    "50"                    },
+  { "expandable_wall.growing.up",              "20"                    },
+  { "wall",                                    "50"                    },
+  { "expandable_wall.growing.down",            "20"                    },
+  { "wall",                                    "50"                    },
+  { "empty_space",                             "20"                    },
+  { "end",                                     ""                      },
+
+  { "invisible_wall",                          "-1"                    },
+  { "end",                                     ""                      },
+
+  { "wall_slippery",                           "-1"                    },
+  { "end",                                     ""                      },
+
+  { "char_space",                              "10"                    },
+  { "char_exclam",                             "10"                    },
+  { "char_quotedbl",                           "10"                    },
+  { "char_numbersign",                         "10"                    },
+  { "char_dollar",                             "10"                    },
+  { "char_procent",                            "10"                    },
+  { "char_ampersand",                          "10"                    },
+  { "char_apostrophe",                         "10"                    },
+  { "char_parenleft",                          "10"                    },
+  { "char_parenright",                         "10"                    },
+  { "char_asterisk",                           "10"                    },
+  { "char_plus",                               "10"                    },
+  { "char_comma",                              "10"                    },
+  { "char_minus",                              "10"                    },
+  { "char_period",                             "10"                    },
+  { "char_slash",                              "10"                    },
+  { "char_0",                                  "10"                    },
+  { "char_1",                                  "10"                    },
+  { "char_2",                                  "10"                    },
+  { "char_3",                                  "10"                    },
+  { "char_4",                                  "10"                    },
+  { "char_5",                                  "10"                    },
+  { "char_6",                                  "10"                    },
+  { "char_7",                                  "10"                    },
+  { "char_8",                                  "10"                    },
+  { "char_9",                                  "10"                    },
+  { "char_colon",                              "10"                    },
+  { "char_semicolon",                          "10"                    },
+  { "char_less",                               "10"                    },
+  { "char_equal",                              "10"                    },
+  { "char_greater",                            "10"                    },
+  { "char_question",                           "10"                    },
+  { "char_at",                                 "10"                    },
+  { "char_a",                                  "10"                    },
+  { "char_b",                                  "10"                    },
+  { "char_c",                                  "10"                    },
+  { "char_d",                                  "10"                    },
+  { "char_e",                                  "10"                    },
+  { "char_f",                                  "10"                    },
+  { "char_g",                                  "10"                    },
+  { "char_h",                                  "10"                    },
+  { "char_i",                                  "10"                    },
+  { "char_j",                                  "10"                    },
+  { "char_k",                                  "10"                    },
+  { "char_l",                                  "10"                    },
+  { "char_m",                                  "10"                    },
+  { "char_n",                                  "10"                    },
+  { "char_o",                                  "10"                    },
+  { "char_p",                                  "10"                    },
+  { "char_q",                                  "10"                    },
+  { "char_r",                                  "10"                    },
+  { "char_s",                                  "10"                    },
+  { "char_t",                                  "10"                    },
+  { "char_u",                                  "10"                    },
+  { "char_v",                                  "10"                    },
+  { "char_w",                                  "10"                    },
+  { "char_x",                                  "10"                    },
+  { "char_y",                                  "10"                    },
+  { "char_z",                                  "10"                    },
+  { "char_bracketleft",                                "10"                    },
+  { "char_backslash",                          "10"                    },
+  { "char_bracketright",                       "10"                    },
+  { "char_asciicircum",                                "10"                    },
+  { "char_underscore",                         "10"                    },
+  { "char_copyright",                          "10"                    },
+  { "char_aumlaut",                            "10"                    },
+  { "char_oumlaut",                            "10"                    },
+  { "char_uumlaut",                            "10"                    },
+  { "char_degree",                             "10"                    },
+  { "char_trademark",                          "10"                    },
+  { "char_cursor",                             "10"                    },
+  { "end",                                     ""                      },
+
+  { "emerald",                                 "50"                    },
+  { "emerald.collecting",                      "8"                     },
+  { "empty_space",                             "10"                    },
+  { "end",                                     ""                      },
+
+  { "diamond",                                 "50"                    },
+  { "diamond.collecting",                      "8"                     },
+  { "empty_space",                             "10"                    },
+  { "end",                                     ""                      },
+
+  { "bd_diamond",                              "50"                    },
+  { "bd_diamond.collecting",                   "8"                     },
+  { "empty_space",                             "10"                    },
+  { "end",                                     ""                      },
+
+  { "emerald_yellow",                          "50"                    },
+  { "emerald_yellow.collecting",               "8"                     },
+  { "empty_space",                             "10"                    },
+  { "emerald_red",                             "50"                    },
+  { "emerald_red.collecting",                  "8"                     },
+  { "empty_space",                             "10"                    },
+  { "emerald_purple",                          "50"                    },
+  { "emerald_purple.collecting",               "8"                     },
+  { "empty_space",                             "10"                    },
+  { "end",                                     ""                      },
+
+  { "bd_rock",                                 "-1"                    },
+  { "end",                                     ""                      },
+
+  { "bomb",                                    "100"                   },
+  { "bomb.exploding",                          "16"                    },
+  { "empty_space",                             "10"                    },
+  { "end",                                     ""                      },
+
+  { "nut",                                     "100"                   },
+  { "nut.breaking",                            "6"                     },
+  { "emerald",                                 "20"                    },
+  { "end",                                     ""                      },
+
+  { "wall_emerald",                            "100"                   },
+  { "wall_emerald.exploding",                  "16"                    },
+  { "emerald",                                 "20"                    },
+  { "end",                                     ""                      },
+
+  { "wall_diamond",                            "100"                   },
+  { "wall_diamond.exploding",                  "16"                    },
+  { "diamond",                                 "20"                    },
+  { "end",                                     ""                      },
+
+  { "wall_bd_diamond",                         "100"                   },
+  { "wall_bd_diamond.exploding",               "16"                    },
+  { "bd_diamond",                              "20"                    },
+  { "end",                                     ""                      },
+
+  { "wall_emerald_yellow",                     "100"                   },
+  { "wall_emerald_yellow.exploding",           "16"                    },
+  { "emerald_yellow",                          "20"                    },
+  { "wall_emerald_red",                                "100"                   },
+  { "wall_emerald_red.exploding",              "16"                    },
+  { "emerald_red",                             "20"                    },
+  { "wall_emerald_purple",                     "100"                   },
+  { "wall_emerald_purple.exploding",           "16"                    },
+  { "emerald_purple",                          "20"                    },
+  { "end",                                     ""                      },
+
+  { "acid",                                    "-1"                    },
+  { "end",                                     ""                      },
+
+  { "key_1",                                   "50"                    },
+  { "key_2",                                   "50"                    },
+  { "key_3",                                   "50"                    },
+  { "key_4",                                   "50"                    },
+  { "end",                                     ""                      },
+
+  { "gate_1",                                  "50"                    },
+  { "gate_2",                                  "50"                    },
+  { "gate_3",                                  "50"                    },
+  { "gate_4",                                  "50"                    },
+  { "end",                                     ""                      },
+
+  { "gate_1_gray",                             "50"                    },
+  { "gate_2_gray",                             "50"                    },
+  { "gate_3_gray",                             "50"                    },
+  { "gate_4_gray",                             "50"                    },
+  { "end",                                     ""                      },
+
+  { "dynamite",                                        "-1"                    },
+  { "end",                                     ""                      },
+
+  { "dynamite.active",                         "96"                    },
+  { "dynamite.exploding",                      "16"                    },
+  { "empty_space",                             "20"                    },
+  { "end",                                     ""                      },
+
+  { "dynabomb.active",                         "100"                   },
+  { "dynabomb.exploding",                      "16"                    },
+  { "empty_space",                             "20"                    },
+  { "end",                                     ""                      },
+
+  { "dynabomb_increase_number",                        "-1"                    },
+  { "end",                                     ""                      },
+
+  { "dynabomb_increase_size",                  "-1"                    },
+  { "end",                                     ""                      },
+
+  { "dynabomb_increase_power",                 "-1"                    },
+  { "end",                                     ""                      },
+
+  { "spaceship.turning_from_right.up",         "8"                     },
+  { "spaceship.turning_from_up.left",          "8"                     },
+  { "spaceship.turning_from_left.down",                "8"                     },
+  { "spaceship.turning_from_down.right",       "8"                     },
+  { "end",                                     ""                      },
+
+  { "bug.turning_from_right.up",               "8"                     },
+  { "bug.turning_from_up.left",                        "8"                     },
+  { "bug.turning_from_left.down",              "8"                     },
+  { "bug.turning_from_down.right",             "8"                     },
+  { "end",                                     ""                      },
+
+  { "bd_butterfly",                            "-1"                    },
+  { "end",                                     ""                      },
+
+  { "bd_firefly",                              "-1"                    },
+  { "end",                                     ""                      },
+
+  { "pacman.right",                            "16"                    },
+  { "pacman.up",                               "16"                    },
+  { "pacman.left",                             "16"                    },
+  { "pacman.down",                             "16"                    },
+  { "end",                                     ""                      },
+
+  { "yamyam",                                  "-1"                    },
+  { "end",                                     ""                      },
+
+  { "dark_yamyam",                             "-1"                    },
+  { "end",                                     ""                      },
+
+  { "robot",                                   "-1"                    },
+  { "end",                                     ""                      },
+
+  { "mole.moving.right",                       "16"                    },
+  { "mole.moving.up",                          "16"                    },
+  { "mole.moving.left",                                "16"                    },
+  { "mole.moving.down",                                "16"                    },
+  { "end",                                     ""                      },
+
+  { "penguin.moving.right",                    "16"                    },
+  { "penguin.moving.up",                       "16"                    },
+  { "penguin.moving.left",                     "16"                    },
+  { "penguin.moving.down",                     "16"                    },
+  { "end",                                     ""                      },
+
+  { "pig.moving.right",                                "16"                    },
+  { "pig.moving.up",                           "16"                    },
+  { "pig.moving.left",                         "16"                    },
+  { "pig.moving.down",                         "16"                    },
+  { "end",                                     ""                      },
+
+  { "dragon.moving.right",                     "16"                    },
+  { "dragon.moving.up",                                "16"                    },
+  { "dragon.moving.left",                      "16"                    },
+  { "dragon.moving.down",                      "16"                    },
+  { "end",                                     ""                      },
+
+  { "satellite",                               "-1"                    },
+  { "end",                                     ""                      },
+
+  { "robot_wheel",                             "50"                    },
+  { "robot_wheel.active",                      "100"                   },
+  { "end",                                     ""                      },
+
+  { "lamp",                                    "50"                    },
+  { "lamp.active",                             "50"                    },
+  { "end",                                     ""                      },
+
+  { "time_orb_full",                           "50"                    },
+  { "time_orb_empty",                          "50"                    },
+  { "end",                                     ""                      },
+
+  { "amoeba_drop",                             "50"                    },
+  { "amoeba.growing",                          "6"                     },
+  { "amoeba_wet",                              "20"                    },
+  { "end",                                     ""                      },
+
+  { "amoeba_dead",                             "-1"                    },
+  { "end",                                     ""                      },
+
+  { "amoeba_wet",                              "-1"                    },
+  { "end",                                     ""                      },
+
+  { "amoeba_wet",                              "100"                   },
+  { "amoeba.growing",                          "6"                     },
+  { "end",                                     ""                      },
+
+  { "amoeba_full",                             "50"                    },
+  { "amoeba_dead",                             "50"                    },
+  { "amoeba.exploding",                                "16"                    },
+  { "diamond",                                 "20"                    },
+  { "end",                                     ""                      },
+
+  { "game_of_life",                            "-1"                    },
+  { "end",                                     ""                      },
+
+  { "biomaze",                                 "-1"                    },
+  { "end",                                     ""                      },
+
+  { "magic_wall.active",                       "-1"                    },
+  { "end",                                     ""                      },
+
+  { "bd_magic_wall.active",                    "-1"                    },
+  { "end",                                     ""                      },
+
+  { "exit_closed",                             "200"                   },
+  { "exit.opening",                            "30"                    },
+  { "exit_open",                               "100"                   },
+  { "exit.closing",                            "30"                    },
+  { "end",                                     ""                      },
+
+  { "exit_open",                               "-1"                    },
+  { "end",                                     ""                      },
+
+  { "sokoban_object",                          "-1"                    },
+  { "end",                                     ""                      },
+
+  { "sokoban_field_empty",                     "-1"                    },
+  { "end",                                     ""                      },
+
+  { "sokoban_field_full",                      "-1"                    },
+  { "end",                                     ""                      },
+
+  { "speed_pill",                              "-1"                    },
+  { "end",                                     ""                      },
+
+  { NULL,                                      NULL                    }
+};
+
+struct ConfigInfo helptext_config[] =
+{
+  {
+    "player_1",
+    "THE HERO: (Is _this_ guy good old Rockford?)"
+  },
+  {
+    "sand",
+    "Normal sand: You can dig through it"
+  },
+  {
+    "empty_space",
+    "Empty field: You can walk through it"
+  },
+  {
+    "quicksand_empty",
+    "Quicksand: You cannot pass it, but rocks can fall through it"
+  },
+  {
+    "steelwall",
+    "Massive Wall: Nothing can go through it"
+  },
+  {
+    "wall",
+    "Normal Wall: You can't go through it, but you can bomb it away"
+  },
+  {
+    "expandable_wall",
+    "Growing Wall: Grows in several directions if there is an empty field"
+  },
+  {
+    "invisible_wall",
+    "Invisible Wall: Behaves like normal wall, but is invisible"
+  },
+  {
+    "wall_slippery",
+    "Old Wall: Like normal wall, but some things can fall down from it"
+  },
+  {
+    "char_space",
+    "Letter Wall: Looks like a letter, behaves like a normal wall"
+  },
+  {
+    "emerald",
+    "Emerald: You must collect enough of them to finish a level"
+  },
+  {
+    "diamond",
+    "Diamond: Counts as 3 emeralds, but can be destroyed by rocks"
+  },
+  {
+    "bd_diamond",
+    "Diamond (BD style): Counts like one emerald and behaves a bit different"
+  },
+  {
+    "emerald_yellow",
+    "Colorful Gems: Seem to behave like Emeralds"
+  },
+  {
+    "bd_rock",
+    "Rock: Smashes several things; Can be moved by the player"
+  },
+  {
+    "bomb",
+    "Bomb: You can move it, but be careful when dropping it"
+  },
+  {
+    "nut",
+    "Nut: Throw a rock on it to open it; Each nut contains an emerald"
+  },
+  {
+    "wall_emerald",
+    "Wall with an emerald inside: Bomb the wall away to get it"
+  },
+  {
+    "wall_diamond",
+    "Wall with a diamond inside: Bomb the wall away to get it"
+  },
+  {
+    "wall_bd_diamond",
+    "Wall with BD style diamond inside: Bomb the wall away to get it"
+  },
+  {
+    "wall_emerald_yellow",
+    "Wall with colorful gem inside: Bomb the wall away to get it"
+  },
+  {
+    "acid",
+    "Acid: Things that fall in are gone forever (including our hero)"
+  },
+  {
+    "key_1",
+    "Key: Opens the door that has the same color (red/yellow/green/blue)"
+  },
+  {
+    "gate_1",
+    "Door: Can be opened by the key with the same color"
+  },
+  {
+    "gate_1_gray",
+    "Door: You have to find out the right color of the key for it"
+  },
+  {
+    "dynamite",
+    "Dynamite: Collect it and use it to destroy walls or kill enemies"
+  },
+  {
+    "dynamite.active",
+    "Dynamite: This one explodes after a few seconds"
+  },
+  {
+    "dynabomb",
+    "Dyna Bomb: Explodes in 4 directions with variable explosion size"
+  },
+  {
+    "dynabomb_increase_number",
+    "Dyna Bomb: Increases the number of dyna bombs available at a time"
+  },
+  {
+    "dynabomb_increase_size",
+    "Dyna Bomb: Increases the size of explosion of dyna bombs"
+  },
+  {
+    "dynabomb_increase_power",
+    "Dyna Bomb: Increases the power of explosion of dyna bombs"
+  },
+  {
+    "spaceship",
+    "Spaceship: Moves at the left side of walls; don't touch it!"
+  },
+  {
+    "bug",
+    "Bug: Moves at the right side of walls; don't touch it!"
+  },
+  {
+    "bd_butterfly",
+    "Butterfly: Moves at the right side of walls; don't touch it!"
+  },
+  {
+    "bd_firefly",
+    "Firefly: Moves at the left side of walls; don't touch it!"
+  },
+  {
+    "pacman",
+    "Pacman: Eats the amoeba and you, if you're not careful"
+  },
+  {
+    "yamyam",
+    "Cruncher: Eats diamonds and you, if you're not careful"
+  },
+  {
+    "dark_yamyam",
+    "Cruncher (BD style): Eats almost everything"
+  },
+  {
+    "robot",
+    "Robot: Tries to kill the player"
+  },
+  {
+    "mole",
+    "The mole: Eats the amoeba and turns empty space into normal sand"
+  },
+  {
+    "penguin",
+    "The penguin: Guide him to the exit, but keep him away from monsters!"
+  },
+  {
+    "pig",
+    "The Pig: Harmless, but eats all gems it can get"
+  },
+  {
+    "dragon",
+    "The Dragon: Breathes fire, especially to some monsters"
+  },
+  {
+    "satellite",
+    "Sonde: Follows you everywhere; harmless, but may block your way"
+  },
+  {
+    "robot_wheel",
+    "Magic Wheel: Touch it to get rid of the robots for some seconds"
+  },
+  {
+    "lamp",
+    "Light Bulb: All of them must be switched on to finish a level"
+  },
+  {
+    "time_orb_full",
+    "Extra Time Orb: Adds some seconds to the time available for the level"
+  },
+  {
+    "amoeba_drop",
+    "Amoeba Drop: Grows to an amoeba on the ground - don't touch it"
+  },
+  {
+    "amoeba_dead",
+    "Dead Amoeba: Does not grow, but can still kill bugs and spaceships"
+  },
+  {
+    "amoeba_wet",
+    "Normal Amoeba: Grows through empty fields, sand and quicksand"
+  },
+  {
+    "amoeba_wet",
+    "Dropping Amoeba: This one makes drops that grow to a new amoeba"
+  },
+  {
+    "amoeba_full",
+    "Living Amoeba (BD style): Contains other element, when surrounded"
+  },
+  {
+    "game_of_life",
+    "Game Of Life: Behaves like the well known 'Game Of Life' (2333 style)"
+  },
+  {
+    "biomaze",
+    "Biomaze: A bit like the 'Game Of Life', but builds crazy mazes"
+  },
+  {
+    "magic_wall",
+    "Magic Wall: Changes rocks, emeralds and diamonds when they pass it"
+  },
+  {
+    "bd_magic_wall",
+    "Magic Wall (BD style): Changes rocks and BD style diamonds"
+  },
+  {
+    "exit_closed",
+    "Exit door: Opens if you have enough emeralds to finish the level"
+  },
+  {
+    "exit_open",
+    "Open exit door: Enter here to leave the level and exit the actual game"
+  },
+  {
+    "sokoban_object",
+    "Sokoban element: Object which must be pushed to an empty field"
+  },
+  {
+    "sokoban_field_empty",
+    "Sokoban element: Empty field where a Sokoban object can be placed on"
+  },
+  {
+    "sokoban_field_full",
+    "Sokoban element: Field with object which can be pushed away"
+  },
+  {
+    "speed_pill",
+    "Speed pill: Lets the player run twice as fast as normally"
+  },
+
+  {
+    NULL,
+    NULL
+  }
+};
index 606fe7076d7d44bb385fe9e3b3e5e6ddb5efb939..aa6bde03bf82d6520cfe0a15034915b27386b3de 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-12-13 16:52]"
+#define COMPILE_DATE_STRING "[2003-12-14 02:31]"
index f6df5544d2b3a6cd3fbaf72fd53ad52ad1cb2d96..9914b16f83b5a60a81f8ceb500e426bfec6b8b0a 100644 (file)
@@ -3075,8 +3075,7 @@ static void ReinitializeElementList()
   int pos = 0;
   int i, j;
 
-  if (editor_elements != NULL)
-    free(editor_elements);
+  checked_free(editor_elements);
 
   if (!initialized)
   {
@@ -5533,8 +5532,7 @@ char *getElementDescriptionFilename(int element)
   static char *filename = NULL;
   char basename[MAX_FILENAME_LEN];
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   /* 1st try: look for element description file for exactly this element */
   sprintf(basename, "%s.txt", element_info[element].token_name);
index e064ee6d93fc0ac598c77695daf2f4d89429d061..929ce3348b305dee810dcb66aab779fb13c73b7f 100644 (file)
@@ -2919,7 +2919,7 @@ static struct MusicFileInfo *get_music_file_info_ext(char *basename, int music,
       getStringCopy(value != NULL && *value != '\0' ? value : UNKNOWN_NAME);
   }
 
-  tmp_music_file_info.basename = basename;
+  tmp_music_file_info.basename = getStringCopy(basename);
   tmp_music_file_info.music = music;
   tmp_music_file_info.is_sound = is_sound;
 
@@ -2975,23 +2975,17 @@ void LoadMusicInfo()
   {
     next = music_file_info->next;
 
-    if (music_file_info->title_header)
-      free(music_file_info->title_header);
-    if (music_file_info->artist_header)
-      free(music_file_info->artist_header);
-    if (music_file_info->album_header)
-      free(music_file_info->album_header);
-    if (music_file_info->year_header)
-      free(music_file_info->year_header);
-
-    if (music_file_info->title)
-      free(music_file_info->title);
-    if (music_file_info->artist)
-      free(music_file_info->artist);
-    if (music_file_info->album)
-      free(music_file_info->album);
-    if (music_file_info->year)
-      free(music_file_info->year);
+    checked_free(music_file_info->basename);
+
+    checked_free(music_file_info->title_header);
+    checked_free(music_file_info->artist_header);
+    checked_free(music_file_info->album_header);
+    checked_free(music_file_info->year_header);
+
+    checked_free(music_file_info->title);
+    checked_free(music_file_info->artist);
+    checked_free(music_file_info->album);
+    checked_free(music_file_info->year);
 
     free(music_file_info);
 
index 455599f51cf88d923d8d76a8fce8dc9b71f690eb..05e65026508d942835b1e28bd9c464b7fa2d2e8c 100644 (file)
@@ -8918,13 +8918,10 @@ void InitPlayLevelSound()
 {
   int num_sounds = getSoundListSize();
 
-  if (loop_sound_frame != NULL)
-    free(loop_sound_frame);
+  checked_free(loop_sound_frame);
+  checked_free(loop_sound_volume);
 
-  if (loop_sound_volume != NULL)
-    free(loop_sound_volume);
-
-  loop_sound_frame = checked_calloc(num_sounds * sizeof(int));
+  loop_sound_frame  = checked_calloc(num_sounds * sizeof(int));
   loop_sound_volume = checked_calloc(num_sounds * sizeof(int));
 }
 
index 104aef40ac734df328fc5a9a4bb62af4400ba255..9871ed6cd8c3f0c5c0c4dc1ed5ad04a3edeb5837 100644 (file)
@@ -614,9 +614,9 @@ void InitElementGraphicInfo()
 
     for (act = 0; act < NUM_ACTIONS; act++)
     {
-      boolean act_remove = ((IS_DIGGABLE(i)    && act == ACTION_DIGGING)  ||
-                           (IS_SNAPPABLE(i)   && act == ACTION_SNAPPING) ||
-                           (IS_COLLECTIBLE(i) && act == ACTION_COLLECTING));
+      boolean act_remove = (act == ACTION_DIGGING ||
+                           act == ACTION_SNAPPING ||
+                           act == ACTION_COLLECTING);
       boolean act_turning = (act == ACTION_TURNING_FROM_LEFT ||
                             act == ACTION_TURNING_FROM_RIGHT ||
                             act == ACTION_TURNING_FROM_UP ||
@@ -967,8 +967,7 @@ static void InitGraphicInfo()
   GC copy_clipmask_gc = None;
 #endif
 
-  if (graphic_info != NULL)
-    free(graphic_info);
+  checked_free(graphic_info);
 
   graphic_info = checked_calloc(num_images * sizeof(struct GraphicInfo));
 
@@ -1265,8 +1264,7 @@ static void InitSoundInfo()
   int num_sounds = getSoundListSize();
   int i, j;
 
-  if (sound_info != NULL)
-    free(sound_info);
+  checked_free(sound_info);
 
   sound_effect_properties = checked_calloc(num_sounds * sizeof(int));
   sound_info = checked_calloc(num_sounds * sizeof(struct SoundInfo));
@@ -1497,8 +1495,7 @@ static void InitMusicInfo()
   int num_music = getMusicListSize();
   int i, j;
 
-  if (music_info != NULL)
-    free(music_info);
+  checked_free(music_info);
 
   music_info = checked_calloc(num_music * sizeof(struct MusicInfo));
 
index 0c4547e04782a096e6b72865cda4274bb47b42c7..06ca9357c65f87d792349e44d0fcacaf074098c7 100644 (file)
@@ -90,8 +90,7 @@ char *i_to_a(unsigned int i)
 {
   static char *a = NULL;
 
-  if (a != NULL)
-    free(a);
+  checked_free(a);
 
   if (i > 2147483647)  /* yes, this is a kludge */
     i = 2147483647;
@@ -501,8 +500,7 @@ char *getStringToLower(char *s)
 
 void setString(char **old_value, char *new_value)
 {
-  if (*old_value != NULL)
-    free(*old_value);
+  checked_free(*old_value);
 
   *old_value = getStringCopy(new_value);
 }
@@ -784,7 +782,7 @@ void Error(int mode, char *format, ...)
 
 
 /* ------------------------------------------------------------------------- */
-/* memory allocation functions                                               */
+/* checked memory allocation and freeing functions                           */
 /* ------------------------------------------------------------------------- */
 
 void *checked_malloc(unsigned long size)
@@ -821,6 +819,12 @@ void *checked_realloc(void *ptr, unsigned long size)
   return ptr;
 }
 
+void checked_free(void *ptr)
+{
+  if (ptr != NULL)     /* this check should be done by free() anyway */
+    free(ptr);
+}
+
 
 /* ------------------------------------------------------------------------- */
 /* various helper functions                                                  */
@@ -1480,8 +1484,7 @@ boolean fileHasPrefix(char *basename, char *prefix)
   static char *basename_lower = NULL;
   int basename_length, prefix_length;
 
-  if (basename_lower != NULL)
-    free(basename_lower);
+  checked_free(basename_lower);
 
   if (basename == NULL || prefix == NULL)
     return FALSE;
@@ -1503,8 +1506,7 @@ boolean fileHasSuffix(char *basename, char *suffix)
   static char *basename_lower = NULL;
   int basename_length, suffix_length;
 
-  if (basename_lower != NULL)
-    free(basename_lower);
+  checked_free(basename_lower);
 
   if (basename == NULL || suffix == NULL)
     return FALSE;
index 0e771902b7dc156e31ef29342f44b5e08cb3438c..af65d4ca98343f432654b389432a3ccfdaaa68cd 100644 (file)
@@ -109,6 +109,7 @@ void Error(int, char *, ...);
 void *checked_malloc(unsigned long);
 void *checked_calloc(unsigned long);
 void *checked_realloc(void *, unsigned long);
+void checked_free(void *);
 
 inline void swap_numbers(int *, int *);
 inline void swap_number_pairs(int *, int *, int *, int *);
index 02c6a96e34ffd97ea7e88a2a3eb9d25b97fa9764..a82da6cda9b3006e06b44ee4cea20a8d8e8fe3b7 100644 (file)
@@ -378,8 +378,7 @@ Status XStringListToTextProperty(char **list, int count,
 
 void XFree(void *data)
 {
-  if (data)
-    free(data);
+  checked_free(data);
 }
 
 GC XCreateGC(Display *display, Drawable d, unsigned long value_mask,
@@ -598,11 +597,9 @@ void XFreePixmap(Display *display, Pixmap pixmap)
 
 void XFreeGC(Display *display, GC gc)
 {
-  XGCValues *gcv;
+  XGCValues *gcv = (XGCValues *)gc;
 
-  gcv = (XGCValues *)gc;
-  if (gcv)
-    free(gcv);
+  checked_free(gcv);
 }
 
 void XUnmapWindow(Display *display, Window window)
@@ -616,11 +613,8 @@ void XCloseDisplay(Display *display)
   if (is_screen_bitmap(bitmap))
     destroy_bitmap(bitmap);
 
-  if (display->screens)
-    free(display->screens);
-
-  if (display)
-    free(display);
+  checked_free(display->screens);
+  checked_free(display);
 
   /* return to text mode (or DOS box on Windows screen) */
   set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
index 1ff198f00d501361abf82704f8fe3980f0353600..905c890ed0761d45229bdc3cf4834bf657a3079f 100644 (file)
@@ -97,8 +97,7 @@ static char *getUserLevelDir(char *level_subdir)
   char *data_dir = getUserDataDir();
   char *userlevel_subdir = LEVELS_DIRECTORY;
 
-  if (userlevel_dir)
-    free(userlevel_dir);
+  checked_free(userlevel_dir);
 
   if (level_subdir != NULL)
     userlevel_dir = getPath3(data_dir, userlevel_subdir, level_subdir);
@@ -114,8 +113,7 @@ static char *getScoreDir(char *level_subdir)
   char *data_dir = getCommonDataDir();
   char *score_subdir = SCORES_DIRECTORY;
 
-  if (score_dir)
-    free(score_dir);
+  checked_free(score_dir);
 
   if (level_subdir != NULL)
     score_dir = getPath3(data_dir, score_subdir, level_subdir);
@@ -131,8 +129,7 @@ static char *getLevelSetupDir(char *level_subdir)
   char *data_dir = getUserDataDir();
   char *levelsetup_subdir = LEVELSETUP_DIRECTORY;
 
-  if (levelsetup_dir)
-    free(levelsetup_dir);
+  checked_free(levelsetup_dir);
 
   if (level_subdir != NULL)
     levelsetup_dir = getPath3(data_dir, levelsetup_subdir, level_subdir);
@@ -149,8 +146,7 @@ static char *getLevelDirFromTreeInfo(TreeInfo *node)
   if (node == NULL)
     return options.level_directory;
 
-  if (level_dir)
-    free(level_dir);
+  checked_free(level_dir);
 
   level_dir = getPath2((node->user_defined ? getUserLevelDir(NULL) :
                        options.level_directory), node->fullpath);
@@ -169,8 +165,7 @@ static char *getTapeDir(char *level_subdir)
   char *data_dir = getUserDataDir();
   char *tape_subdir = TAPES_DIRECTORY;
 
-  if (tape_dir)
-    free(tape_dir);
+  checked_free(tape_dir);
 
   if (level_subdir != NULL)
     tape_dir = getPath3(data_dir, tape_subdir, level_subdir);
@@ -186,8 +181,7 @@ static char *getSolutionTapeDir()
   char *data_dir = getCurrentLevelDir();
   char *tape_subdir = TAPES_DIRECTORY;
 
-  if (tape_dir)
-    free(tape_dir);
+  checked_free(tape_dir);
 
   tape_dir = getPath2(data_dir, tape_subdir);
 
@@ -201,8 +195,7 @@ static char *getDefaultGraphicsDir(char *graphics_subdir)
   if (graphics_subdir == NULL)
     return options.graphics_directory;
 
-  if (graphics_dir)
-    free(graphics_dir);
+  checked_free(graphics_dir);
 
   graphics_dir = getPath2(options.graphics_directory, graphics_subdir);
 
@@ -216,8 +209,7 @@ static char *getDefaultSoundsDir(char *sounds_subdir)
   if (sounds_subdir == NULL)
     return options.sounds_directory;
 
-  if (sounds_dir)
-    free(sounds_dir);
+  checked_free(sounds_dir);
 
   sounds_dir = getPath2(options.sounds_directory, sounds_subdir);
 
@@ -231,8 +223,7 @@ static char *getDefaultMusicDir(char *music_subdir)
   if (music_subdir == NULL)
     return options.music_directory;
 
-  if (music_dir)
-    free(music_dir);
+  checked_free(music_dir);
 
   music_dir = getPath2(options.music_directory, music_subdir);
 
@@ -290,8 +281,7 @@ static char *getSetupArtworkDir(TreeInfo *ti)
 {
   static char *artwork_dir = NULL;
 
-  if (artwork_dir != NULL)
-    free(artwork_dir);
+  checked_free(artwork_dir);
 
   artwork_dir = getPath2(ti->basepath, ti->fullpath);
 
@@ -309,8 +299,7 @@ char *setLevelArtworkDir(TreeInfo *ti)
   artwork_path_ptr = &(LEVELDIR_ARTWORK_PATH(leveldir_current, ti->type));
   artwork_set_ptr  = &(LEVELDIR_ARTWORK_SET( leveldir_current, ti->type));
 
-  if (*artwork_path_ptr != NULL)
-    free(*artwork_path_ptr);
+  checked_free(*artwork_path_ptr);
 
   if ((level_artwork = getTreeInfoFromIdentifier(ti, *artwork_set_ptr)))
     *artwork_path_ptr = getStringCopy(getSetupArtworkDir(level_artwork));
@@ -325,8 +314,7 @@ char *setLevelArtworkDir(TreeInfo *ti)
 
     char *dir = getPath2(getCurrentLevelDir(), ARTWORK_DIRECTORY(ti->type));
 
-    if (*artwork_set_ptr != NULL)
-      free(*artwork_set_ptr);
+    checked_free(*artwork_set_ptr);
 
     if (fileExists(dir))
     {
@@ -366,8 +354,7 @@ char *getLevelFilename(int nr)
   static char *filename = NULL;
   char basename[MAX_FILENAME_LEN];
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   if (nr < 0)
     sprintf(basename, "template.%s", LEVELFILE_EXTENSION);
@@ -384,8 +371,7 @@ char *getTapeFilename(int nr)
   static char *filename = NULL;
   char basename[MAX_FILENAME_LEN];
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   sprintf(basename, "%03d.%s", nr, TAPEFILE_EXTENSION);
   filename = getPath2(getTapeDir(leveldir_current->filename), basename);
@@ -398,8 +384,7 @@ char *getSolutionTapeFilename(int nr)
   static char *filename = NULL;
   char basename[MAX_FILENAME_LEN];
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   sprintf(basename, "%03d.%s", nr, TAPEFILE_EXTENSION);
   filename = getPath2(getSolutionTapeDir(), basename);
@@ -412,8 +397,7 @@ char *getScoreFilename(int nr)
   static char *filename = NULL;
   char basename[MAX_FILENAME_LEN];
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   sprintf(basename, "%03d.%s", nr, SCOREFILE_EXTENSION);
   filename = getPath2(getScoreDir(leveldir_current->filename), basename);
@@ -425,8 +409,7 @@ char *getSetupFilename()
 {
   static char *filename = NULL;
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   filename = getPath2(getSetupDir(), SETUP_FILENAME);
 
@@ -437,8 +420,7 @@ char *getEditorSetupFilename()
 {
   static char *filename = NULL;
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   filename = getPath2(getSetupDir(), EDITORSETUP_FILENAME);
 
@@ -449,8 +431,7 @@ char *getHelpAnimFilename()
 {
   static char *filename = NULL;
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   filename = getPath2(getCurrentLevelDir(), HELPANIM_FILENAME);
 
@@ -461,8 +442,7 @@ char *getHelpTextFilename()
 {
   static char *filename = NULL;
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   filename = getPath2(getCurrentLevelDir(), HELPTEXT_FILENAME);
 
@@ -488,8 +468,7 @@ char *getLevelSetInfoFilename()
 
   for (i = 0; basenames[i] != NULL; i++)
   {
-    if (filename != NULL)
-      free(filename);
+    checked_free(filename);
 
     filename = getPath2(getCurrentLevelDir(), basenames[i]);
     if (fileExists(filename))
@@ -518,8 +497,7 @@ static char *getCorrectedArtworkBasename(char *basename)
     {
       static char *msdos_filename = NULL;
 
-      if (msdos_filename != NULL)
-       free(msdos_filename);
+      checked_free(msdos_filename);
 
       msdos_filename = getStringCopy(basename_corrected);
       strncpy(&msdos_filename[8], &basename[strlen(basename) - (1+3)], 1+3 +1);
@@ -537,8 +515,7 @@ char *getCustomImageFilename(char *basename)
   static char *filename = NULL;
   boolean skip_setup_artwork = FALSE;
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   basename = getCorrectedArtworkBasename(basename);
 
@@ -596,8 +573,7 @@ char *getCustomSoundFilename(char *basename)
   static char *filename = NULL;
   boolean skip_setup_artwork = FALSE;
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   basename = getCorrectedArtworkBasename(basename);
 
@@ -655,8 +631,7 @@ char *getCustomMusicFilename(char *basename)
   static char *filename = NULL;
   boolean skip_setup_artwork = FALSE;
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   basename = getCorrectedArtworkBasename(basename);
 
@@ -730,8 +705,7 @@ char *getCustomArtworkLevelConfigFilename(int type)
 {
   static char *filename = NULL;
 
-  if (filename != NULL)
-    free(filename);
+  checked_free(filename);
 
   filename = getPath2(getLevelArtworkDir(type), ARTWORKINFO_FILENAME(type));
 
@@ -743,8 +717,7 @@ char *getCustomMusicDirectory(void)
   static char *directory = NULL;
   boolean skip_setup_artwork = FALSE;
 
-  if (directory != NULL)
-    free(directory);
+  checked_free(directory);
 
   if (!setup.override_level_music)
   {
@@ -1268,12 +1241,12 @@ void freeSetupFileList(SetupFileList *list)
   if (list == NULL)
     return;
 
-  if (list->token)
-    free(list->token);
-  if (list->value)
-    free(list->value);
+  checked_free(list->token);
+  checked_free(list->value);
+
   if (list->next)
     freeSetupFileList(list->next);
+
   free(list);
 }
 
@@ -1295,8 +1268,7 @@ SetupFileList *setListEntry(SetupFileList *list, char *token, char *value)
 
   if (strcmp(list->token, token) == 0)
   {
-    if (list->value)
-      free(list->value);
+    checked_free(list->value);
 
     list->value = getStringCopy(value);
 
@@ -1805,40 +1777,26 @@ static void setTreeInfoToDefaultsFromParent(TreeInfo *ldi, TreeInfo *parent)
 
 static void freeTreeInfo(TreeInfo *ldi)
 {
-  if (ldi->filename)
-    free(ldi->filename);
-  if (ldi->fullpath)
-    free(ldi->fullpath);
-  if (ldi->basepath)
-    free(ldi->basepath);
-  if (ldi->identifier)
-    free(ldi->identifier);
-
-  if (ldi->name)
-    free(ldi->name);
-  if (ldi->name_sorting)
-    free(ldi->name_sorting);
-  if (ldi->author)
-    free(ldi->author);
-
-  if (ldi->class_desc)
-    free(ldi->class_desc);
+  checked_free(ldi->filename);
+  checked_free(ldi->fullpath);
+  checked_free(ldi->basepath);
+  checked_free(ldi->identifier);
+
+  checked_free(ldi->name);
+  checked_free(ldi->name_sorting);
+  checked_free(ldi->author);
+
+  checked_free(ldi->class_desc);
 
   if (ldi->type == TREE_TYPE_LEVEL_DIR)
   {
-    if (ldi->graphics_set)
-      free(ldi->graphics_set);
-    if (ldi->sounds_set)
-      free(ldi->sounds_set);
-    if (ldi->music_set)
-      free(ldi->music_set);
-
-    if (ldi->graphics_path)
-      free(ldi->graphics_path);
-    if (ldi->sounds_path)
-      free(ldi->sounds_path);
-    if (ldi->music_path)
-      free(ldi->music_path);
+    checked_free(ldi->graphics_set);
+    checked_free(ldi->sounds_set);
+    checked_free(ldi->music_set);
+
+    checked_free(ldi->graphics_path);
+    checked_free(ldi->sounds_path);
+    checked_free(ldi->music_path);
   }
 }
 
@@ -1872,8 +1830,7 @@ void setSetupInfo(struct TokenInfo *token_info,
       break;
 
     case TYPE_STRING:
-      if (*(char **)setup_value != NULL)
-       free(*(char **)setup_value);
+      checked_free(*(char **)setup_value);
       *(char **)setup_value = getStringCopy(token_value);
       break;
 
@@ -2437,8 +2394,7 @@ static TreeInfo *getDummyArtworkInfo(int type)
   artwork_new->fullpath = getStringCopy(UNDEFINED_FILENAME);
   artwork_new->basepath = getStringCopy(UNDEFINED_FILENAME);
 
-  if (artwork_new->name != NULL)
-    free(artwork_new->name);
+  checked_free(artwork_new->name);
 
   artwork_new->identifier   = getStringCopy(UNDEFINED_FILENAME);
   artwork_new->name         = getStringCopy(UNDEFINED_FILENAME);
index ea4e8463501efadeca90f46fc3670288a9bf411f..a70ea3accf9018ed7c264f76b6bc06f61a89f5b6 100644 (file)
@@ -569,8 +569,7 @@ static void ReadReloadInfoFromPipe(SoundControl *snd_ctrl)
                                     &setup.override_level_sounds :
                                     &setup.override_level_music);
 
-  if (set_identifier)
-    free(set_identifier);
+  checked_free(set_identifier);
 
   set_identifier = checked_malloc(snd_ctrl->data_len);
 
@@ -579,16 +578,12 @@ static void ReadReloadInfoFromPipe(SoundControl *snd_ctrl)
 
   if (ti == NULL)
     ti = *ti_ptr = checked_calloc(sizeof(TreeInfo));
-  if (leveldir_current->fullpath != NULL)
-    free(leveldir_current->fullpath);
-  if (leveldir_current->sounds_path != NULL)
-    free(leveldir_current->sounds_path);
-  if (leveldir_current->music_path != NULL)
-    free(leveldir_current->music_path);
-  if (ti->basepath != NULL)
-    free(ti->basepath);
-  if (ti->fullpath != NULL)
-    free(ti->fullpath);
+
+  checked_free(leveldir_current->fullpath);
+  checked_free(leveldir_current->sounds_path);
+  checked_free(leveldir_current->music_path);
+  checked_free(ti->basepath);
+  checked_free(ti->fullpath);
 
   if (read(audio.mixer_pipe[0], set_identifier,
           snd_ctrl->data_len) != snd_ctrl->data_len ||
@@ -2387,8 +2382,7 @@ void FreeSound(void *ptr)
 #endif
   }
 
-  if (sound->source_filename)
-    free(sound->source_filename);
+  checked_free(sound->source_filename);
 
   free(sound);
 }
index 1c33deb66375d930e42c891f98017114e73cffcc..9934650f753173d935459d8b13dc00f7b83a9d09 100644 (file)
@@ -370,8 +370,7 @@ inline static void FreeBitmapPointers(Bitmap *bitmap)
   X11FreeBitmapPointers(bitmap);
 #endif
 
-  if (bitmap->source_filename)
-    free(bitmap->source_filename);
+  checked_free(bitmap->source_filename);
   bitmap->source_filename = NULL;
 }
 
index 186b7ef936979df5ad9e6aeb79ec0f2e757466d2..9484a5c6a90c9f4eb9f12dab53007840e732a057 100644 (file)
 #define PROGRAM_VERSION_MAJOR  3
 #define PROGRAM_VERSION_MINOR  0
 #define PROGRAM_VERSION_PATCH  8
-#define PROGRAM_VERSION_BUILD  2
+#define PROGRAM_VERSION_BUILD  3
 
 #define PROGRAM_TITLE_STRING   "Rocks'n'Diamonds"
 #define PROGRAM_AUTHOR_STRING  "Holger Schemel"
index a54b64d4e06cfe2fe4acb81a243f9f7c3d2dc5b1..6b8ae64696af23dee2a8be92a643ba4a6bae91e0 100644 (file)
@@ -2025,7 +2025,7 @@ boolean Request(char *text, unsigned int req_state)
   for (ty = 0; ty < MAX_REQUEST_LINES; ty++)
   {
     char text_line[max_request_line_len + 1];
-    int tx, tl, tc;
+    int tx, tl, tc = 0;
 
     if (!*text)
       break;