# specify X11 library path on your system
XLIB_PATH = /usr/X11/lib
-# change this to the directory where you want to install game data like levels
-GAME_DIR = .
+# choose directory for read-only game data (like graphics, sounds, levels)
+# RO_GAME_DIR = /usr/games
+
+# choose directory for writable game data (like highscore files)
+# RW_GAME_DIR = /var/games
# uncomment this if your system has no joystick include file
# JOYSTICK = -DNO_JOYSTICK
CPP = $(CC) -E
-CONFIG_GAME_DIR = -DGAME_DIR="\"$(GAME_DIR)\""
+ifdef RO_GAME_DIR
+CONFIG_RO_GAME_DIR = -DRO_GAME_DIR="\"$(RO_GAME_DIR)\""
+endif
+
+ifdef RW_GAME_DIR
+CONFIG_RW_GAME_DIR = -DRW_GAME_DIR="\"$(RW_GAME_DIR)\""
+endif
+
CONFIG_SCORE_ENTRIES = -D$(SCORE_ENTRIES)
+CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR)
+
CONFIG = $(CONFIG_GAME_DIR) $(SOUNDS) $(JOYSTICK) \
$(CONFIG_SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
static void SaveUserLevelInfo(); /* for 'InitUserLevelDir()' */
static char *getSetupLine(char *, int); /* for 'SaveUserLevelInfo()' */
-static char *getGlobalDataDir()
-{
- return GAME_DIR;
-}
-
char *getUserDataDir()
{
static char *userdata_dir = NULL;
static char *getScoreDir(char *level_subdir)
{
static char *score_dir = NULL;
- char *data_dir = getGlobalDataDir();
+ char *data_dir = options.rw_base_directory;
char *score_subdir = SCORES_DIRECTORY;
if (score_dir)
break;
element = Feld[x][y];
+
+ /* do not restart explosions of fields with active bombs */
+ if (element == EL_EXPLODING && IS_ACTIVE_BOMB(Store2[x][y]))
+ continue;
+
Explode(x, y, EX_PHASE_START, EX_BORDER);
if (element != EL_LEERRAUM &&
player->programmed_action = move_direction;
DOUBLE_PLAYER_SPEED(player);
+ PlaySoundLevel(x, y, SND_GATE);
+
break;
case EL_EM_GATE_1X:
player->programmed_action = move_direction;
DOUBLE_PLAYER_SPEED(player);
+ PlaySoundLevel(x, y, SND_GATE);
+
break;
case EL_SP_PORT1_LEFT:
player->programmed_action = move_direction;
DOUBLE_PLAYER_SPEED(player);
+ PlaySoundLevel(x, y, SND_GATE);
+
break;
case EL_AUSGANG_ZU:
PropModePrepend, (unsigned char *) &delete_atom, 1);
sprintf(icon_filename, "%s/%s/%s",
- options.base_directory, GRAPHICS_DIRECTORY,
+ options.ro_base_directory, GRAPHICS_DIRECTORY,
icon_pic.picture_filename);
XReadBitmapFile(display,window,icon_filename,
&icon_width,&icon_height,
Error(ERR_EXIT, "cannot read icon bitmap file '%s'", icon_filename);
sprintf(icon_filename, "%s/%s/%s",
- options.base_directory, GRAPHICS_DIRECTORY,
+ options.ro_base_directory, GRAPHICS_DIRECTORY,
icon_pic.picturemask_filename);
XReadBitmapFile(display,window,icon_filename,
&icon_width,&icon_height,
sprintf(basefilename, "%s%s", pic->picture_filename, picture_ext);
DrawInitText(basefilename, 150, FC_YELLOW);
sprintf(filename, "%s/%s/%s",
- options.base_directory, GRAPHICS_DIRECTORY, basefilename);
+ options.ro_base_directory, GRAPHICS_DIRECTORY, basefilename);
#ifdef MSDOS
rest(100);
sprintf(basefilename, "%s%s", pic->picture_filename, picturemask_ext);
DrawInitText(basefilename, 150, FC_YELLOW);
sprintf(filename, "%s/%s/%s",
- options.base_directory, GRAPHICS_DIRECTORY, basefilename);
+ options.ro_base_directory, GRAPHICS_DIRECTORY, basefilename);
#if DEBUG_TIMING
debug_print_timestamp(1, NULL); /* initialize timestamp function */
if (joystick_nr < 0)
return 0;
- /* the allegro global variable ïnum_joysticksï contains the number
+ /* the allegro global variable 'num_joysticks' contains the number
of joysticks found at initialization under MSDOS / Windows */
#if 0
"boom",
"booom",
"exit",
- "empty"
+ "empty",
+ "gate"
};
/* background music */
char *display_name;
char *server_host;
int server_port;
- char *base_directory;
+ char *ro_base_directory;
+ char *rw_base_directory;
char *level_directory;
boolean serveronly;
boolean network;
#define SND_SP_BOOOM 58
#define SND_SP_EXIT 59
#define SND_EMPTY 60
+#define SND_GATE 61
-#define NUM_SOUNDS 61
+#define NUM_SOUNDS 62
/* default input keys */
#define KEY_UNDEFINDED XK_VoidSymbol
#define SETUPINPUT 9
#define CALIBRATION 10
-#ifndef GAME_DIR
-#define GAME_DIR "."
+#ifndef RO_GAME_DIR
+#define RO_GAME_DIR "."
#endif
-#define BASE_PATH GAME_DIR
+#ifndef RW_GAME_DIR
+#define RW_GAME_DIR "."
+#endif
+
+#define RO_BASE_PATH RO_GAME_DIR
+#define RW_BASE_PATH RW_GAME_DIR
#define GRAPHICS_DIRECTORY "graphics"
#define SOUNDS_DIRECTORY "sounds"
options.display_name = NULL;
options.server_host = NULL;
options.server_port = 0;
- options.base_directory = BASE_PATH;
- options.level_directory = BASE_PATH "/" LEVELS_DIRECTORY;
+ options.ro_base_directory = RO_BASE_PATH;
+ options.rw_base_directory = RW_BASE_PATH;
+ options.level_directory = RO_BASE_PATH "/" LEVELS_DIRECTORY;
options.serveronly = FALSE;
options.network = FALSE;
options.verbose = FALSE;
if (option_arg == NULL)
Error(ERR_EXIT_HELP, "option '%s' requires an argument", option_str);
- options.base_directory = option_arg;
+ /* this should be extended to separate options for ro and rw data */
+ options.ro_base_directory = option_arg;
+ options.rw_base_directory = option_arg;
if (option_arg == next_option)
options_left++;
/* adjust path for level directory accordingly */
options.level_directory =
- getPath2(options.base_directory, LEVELS_DIRECTORY);
+ getPath2(options.ro_base_directory, LEVELS_DIRECTORY);
}
else if (strncmp(option, "-levels", option_len) == 0)
{
BITMAP *mouse_bitmap = NULL;
char *filename;
- filename = getPath3(options.base_directory, GRAPHICS_DIRECTORY,
+ filename = getPath3(options.ro_base_directory, GRAPHICS_DIRECTORY,
MOUSE_FILENAME);
mouse_bitmap = Read_PCX_to_AllegroBitmap(filename);
#endif
sprintf(filename, "%s/%s/%s.%s",
- options.base_directory, SOUNDS_DIRECTORY, snd_info->name, sound_ext);
+ options.ro_base_directory, SOUNDS_DIRECTORY,
+ snd_info->name, sound_ext);
#ifndef MSDOS