{ ".mode_pingpong2", "false", TYPE_BOOLEAN },
{ ".mode_random", "false", TYPE_BOOLEAN },
{ ".mode_reverse", "false", TYPE_BOOLEAN },
- { ".global_sync", ARG_UNDEFINED, TYPE_BOOLEAN },
+ { ".global_sync", "false", TYPE_BOOLEAN },
{ NULL, NULL, 0 }
};
{ "sp_explosion.xpos", "8" },
{ "sp_explosion.ypos", "3" },
{ "sp_explosion.frames", "8" },
+ { "sp_explosion.delay", "3" },
+ { "sp_explosion.mode_linear", "true" },
{ "sp_explosion_infotron", "RocksSP.pcx" },
{ "sp_explosion_infotron.xpos", "8" },
{ "sp_explosion_infotron.ypos", "4" },
{ "sp_explosion_infotron.frames", "8" },
+ { "sp_explosion.delay", "3" },
+ { "sp_explosion.mode_linear", "true" },
/* images for Sokoban style elements and actions */
-#define COMPILE_DATE_STRING "[2003-01-18 18:43]"
+#define COMPILE_DATE_STRING "[2003-01-19 19:22]"
if ((element == EL_BOMB ||
element == EL_SP_DISK_ORANGE ||
element == EL_DX_SUPABOMB) &&
- (lastline || object_hit)) /* element is bomb */
+ (lastline || object_hit)) /* element is bomb */
{
Bang(x, y);
return;
if (!lastline && object_hit) /* check which object was hit */
{
if (CAN_CHANGE(element) &&
- (smashed == EL_MAGIC_WALL || smashed == EL_BD_MAGIC_WALL))
+ (smashed == EL_MAGIC_WALL ||
+ smashed == EL_BD_MAGIC_WALL))
{
int xx, yy;
int activated_magic_wall =
SND_BD_MAGIC_WALL_ACTIVATING));
}
- if (IS_PLAYER(x, y+1))
+ if (IS_PLAYER(x, y + 1))
{
KillHeroUnlessProtected(x, y+1);
return;
}
else if (smashed == EL_PENGUIN)
{
- Bang(x, y+1);
+ Bang(x, y + 1);
return;
}
else if (element == EL_BD_DIAMOND)
{
if (IS_ENEMY(smashed) && IS_BD_ELEMENT(smashed))
{
- Bang(x, y+1);
+ Bang(x, y + 1);
return;
}
}
- else if ((element == EL_SP_INFOTRON || element == EL_SP_ZONK) &&
- (smashed == EL_SP_SNIKSNAK || smashed == EL_SP_ELECTRON ||
+ else if ((element == EL_SP_INFOTRON ||
+ element == EL_SP_ZONK) &&
+ (smashed == EL_SP_SNIKSNAK ||
+ smashed == EL_SP_ELECTRON ||
smashed == EL_SP_DISK_ORANGE))
{
- Bang(x, y+1);
+ Bang(x, y + 1);
return;
}
else if (element == EL_ROCK ||
element == EL_BD_ROCK)
{
if (IS_ENEMY(smashed) ||
- smashed == EL_BOMB || smashed == EL_SP_DISK_ORANGE ||
+ smashed == EL_BOMB ||
+ smashed == EL_SP_DISK_ORANGE ||
smashed == EL_DX_SUPABOMB ||
- smashed == EL_SATELLITE || smashed == EL_PIG ||
- smashed == EL_DRAGON || smashed == EL_MOLE)
+ smashed == EL_SATELLITE ||
+ smashed == EL_PIG ||
+ smashed == EL_DRAGON ||
+ smashed == EL_MOLE)
{
- Bang(x, y+1);
+ Bang(x, y + 1);
return;
}
- else if (!IS_MOVING(x, y+1))
+ else if (!IS_MOVING(x, y + 1))
{
- if (smashed == EL_LAMP || smashed == EL_LAMP_ACTIVE)
+ if (smashed == EL_LAMP ||
+ smashed == EL_LAMP_ACTIVE)
{
- Bang(x, y+1);
+ Bang(x, y + 1);
return;
}
else if (smashed == EL_NUT)
ChangeElement(x, y);
#if 1
+ else if (element == EL_EXPLOSION)
+ ; /* drawing of correct explosion animation is handled separately */
else if (IS_ANIMATED(graphic))
DrawLevelGraphicAnimation(x, y, graphic);
#endif
static void InitArtworkConfig()
{
- InitImageList(image_config, image_config_suffix, NUM_IMAGE_FILES);
- InitSoundList(sound_config, sound_config_suffix, NUM_SOUND_FILES);
+ static struct ConfigInfo action_suffix[NUM_ACTIONS + 1];
+ static struct ConfigInfo direction_suffix[NUM_DIRECTIONS + 1];
+ static struct ConfigInfo empty[1];
+ int i;
+
+ for (i=0; i<NUM_ACTIONS + 1; i++)
+ action_suffix[i].token = element_action_info[i].suffix;
+ for (i=0; i<NUM_DIRECTIONS + 1; i++)
+ direction_suffix[i].token = element_direction_info[i].suffix;
+ empty[0].token = NULL;
+
+ InitImageList(image_config, NUM_IMAGE_FILES, image_config_suffix,
+ action_suffix, direction_suffix);
+ InitSoundList(sound_config, NUM_SOUND_FILES, sound_config_suffix,
+ action_suffix, empty);
}
void InitLevelArtworkInfo()
if (!validLevelSeries(leveldir_current))
return;
-#if 0
- printf("--> '%s'\n", artwork.gfx_current_identifier);
-#endif
-
/* when a new level series was selected, check if there was a change
in custom artwork stored in level series directory */
if (leveldir_current_identifier != leveldir_current->identifier)
if (strcmp(artwork.gfx_current_identifier, gfx_new_identifier) != 0 ||
last_override_level_graphics != setup.override_level_graphics)
{
-#if 1
- printf("RELOADING GRAPHICS '%s' -> '%s' (-> '%s')\n",
+#if 0
+ printf("RELOADING GRAPHICS '%s' -> '%s' ('%s')\n",
artwork.gfx_current_identifier,
artwork.gfx_current->identifier,
gfx_new_identifier);
FreeTileClipmasks();
InitTileClipmasks();
-#if 0
- artwork.gfx_current_identifier = gfx_new_identifier;
-#else
artwork.gfx_current_identifier = artwork.gfx_current->identifier;
-#endif
last_override_level_graphics = setup.override_level_graphics;
redraw_screen = TRUE;
if (strcmp(artwork.snd_current_identifier, snd_new_identifier) != 0 ||
last_override_level_sounds != setup.override_level_sounds)
{
-#if 1
- printf("RELOADING SOUNDS '%s' -> '%s' (-> '%s')\n",
+#if 0
+ printf("RELOADING SOUNDS '%s' -> '%s' ('%s')\n",
artwork.snd_current_identifier,
- snd_new_identifier,
- artwork.snd_current->identifier);
+ artwork.snd_current->identifier,
+ snd_new_identifier);
#endif
/* set artwork path to send it to the sound server process */
InitReloadCustomSounds(snd_new_identifier);
ReinitializeSounds();
-#if 0
- artwork.snd_current_identifier = snd_new_identifier;
-#else
artwork.snd_current_identifier = artwork.snd_current->identifier;
-#endif
-
last_override_level_sounds = setup.override_level_sounds;
redraw_screen = TRUE;
InitReloadCustomMusic(mus_new_identifier);
ReinitializeMusic();
-#if 0
- artwork.mus_current_identifier = mus_new_identifier;
-#else
artwork.mus_current_identifier = artwork.mus_current->identifier;
-#endif
last_override_level_music = setup.override_level_music;
redraw_screen = TRUE;
SetDoorState(DOOR_OPEN_ALL);
CloseDoor(DOOR_CLOSE_ALL | DOOR_NO_DELAY);
}
-
-#if 0
- printf("<-- '%s'\n", artwork.gfx_current_identifier);
-#endif
}
void FreeGadgets()
void InitElementInfo()
{
-
int i, act, dir;
/* set values to -1 to identify later as "uninitialized" values */
}
}
-static void set_graphic_parameters(int graphic, int action, int *parameter)
+static void set_graphic_parameters(int graphic, int *parameter)
{
Bitmap *src_bitmap = getBitmapFromImageID(graphic);
int num_xtiles = (src_bitmap ? src_bitmap->width : TILEX) / TILEX;
if (parameter[GFX_ARG_MODE_REVERSE])
graphic_info[graphic].anim_mode |= ANIM_REVERSE;
- /* set first frame of animation after determining animation mode */
- graphic_info[graphic].anim_start_frame = parameter[GFX_ARG_START_FRAME];
-
/* automatically determine correct start frame, if not defined */
if (parameter[GFX_ARG_START_FRAME] == ARG_UNDEFINED_VALUE)
graphic_info[graphic].anim_start_frame = 0;
else if (graphic_info[graphic].anim_mode & ANIM_REVERSE)
graphic_info[graphic].anim_start_frame =
graphic_info[graphic].anim_frames - parameter[GFX_ARG_START_FRAME] - 1;
+ else
+ graphic_info[graphic].anim_start_frame = parameter[GFX_ARG_START_FRAME];
/* animation synchronized with global frame counter, not move position */
graphic_info[graphic].anim_global_sync = parameter[GFX_ARG_GLOBAL_SYNC];
-
- /* set global_sync for all animations with undefined "animation action" */
- if (parameter[GFX_ARG_GLOBAL_SYNC] == ARG_UNDEFINED_VALUE)
- graphic_info[graphic].anim_global_sync =
- (action == ACTION_DEFAULT ? TRUE : FALSE);
-
- /* "linear" animations are never globally synchronized */
- if (parameter[GFX_ARG_MODE_LINEAR])
- graphic_info[graphic].anim_global_sync = FALSE;
}
static void InitGraphicInfo()
{
static boolean clipmasks_initialized = FALSE;
- static int gfx_action[NUM_IMAGE_FILES];
int i;
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
Pixmap src_pixmap;
image_files = getCurrentImageList();
- /* set temporary graphics action field to default value */
- for (i=0; i<NUM_IMAGE_FILES; i++)
- gfx_action[i] = ACTION_DEFAULT;
-
- /* set temporary graphics action field from element_to_graphic list */
- i = 0;
- while (element_to_graphic[i].element > -1)
- {
- int action = element_to_graphic[i].action;
- int graphic = element_to_graphic[i].graphic;
-
- if (action == -1)
- action = ACTION_DEFAULT;
-
- gfx_action[graphic] = action;
-
- i++;
- }
-
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
if (clipmasks_initialized)
{
int src_x, src_y;
int first_frame, last_frame;
- set_graphic_parameters(i, gfx_action[i], image_files[i].parameter);
+ set_graphic_parameters(i, image_files[i].parameter);
/* now check if no animation frames are outside of the loaded image */
Error(ERR_RETURN, "custom graphic rejected for this element/action");
Error(ERR_RETURN_LINE, "-");
- set_graphic_parameters(i, gfx_action[i],
- image_files[i].default_parameter);
+ set_graphic_parameters(i, image_files[i].default_parameter);
}
last_frame = graphic_info[i].anim_frames - 1;
Error(ERR_RETURN, "custom graphic rejected for this element/action");
Error(ERR_RETURN_LINE, "-");
- set_graphic_parameters(i, gfx_action[i],
- image_files[i].default_parameter);
+ set_graphic_parameters(i, image_files[i].default_parameter);
}
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
/* determine all loop sounds and identify certain sound classes */
- for (j=0; sound_action_properties[j].text; j++)
+ for (j=0; element_action_info[j].suffix; j++)
{
- int len_action_text = strlen(sound_action_properties[j].text);
+ int len_action_text = strlen(element_action_info[j].suffix);
if (len_action_text < len_effect_text &&
strcmp(&sound_files[i].token[len_effect_text - len_action_text],
- sound_action_properties[j].text) == 0)
+ element_action_info[j].suffix) == 0)
{
- sound_effect_properties[i] = sound_action_properties[j].value;
+ sound_effect_properties[i] = element_action_info[j].value;
- if (sound_action_properties[j].is_loop)
+ if (element_action_info[j].is_loop_sound)
sound_info[i].loop = TRUE;
}
}
int sound_action = ACTION_DIGGING;
int j = 0;
- while (sound_action_properties[j].text)
+ while (element_action_info[j].suffix)
{
- if (sound_action_properties[j].value == sound_action)
+ if (element_action_info[j].value == sound_action)
printf("element %d, sound action '%s' == %d\n",
- element, sound_action_properties[j].text,
+ element, element_action_info[j].suffix,
element_info_[element].sound[sound_action]);
j++;
}
return getCustomArtworkConfigFilename(image_info->type);
}
-void InitImageList(struct ConfigInfo *config_list,
+void InitImageList(struct ConfigInfo *config_list, int num_file_list_entries,
struct ConfigInfo *config_suffix_list,
- int num_file_list_entries)
+ struct ConfigInfo *ext1_suffix_list,
+ struct ConfigInfo *ext2_suffix_list)
{
int i;
image_info->type = ARTWORK_TYPE_GRAPHICS;
image_info->num_file_list_entries = num_file_list_entries;
+
image_info->num_suffix_list_entries = 0;
for (i=0; config_suffix_list[i].token != NULL; i++)
image_info->num_suffix_list_entries++;
+ image_info->num_ext1_suffix_list_entries = 0;
+ for (i=0; ext1_suffix_list[i].token != NULL; i++)
+ image_info->num_ext1_suffix_list_entries++;
+
+ image_info->num_ext2_suffix_list_entries = 0;
+ for (i=0; ext2_suffix_list[i].token != NULL; i++)
+ image_info->num_ext2_suffix_list_entries++;
+
image_info->file_list =
getFileListFromConfigList(config_list, config_suffix_list,
num_file_list_entries);
image_info->suffix_list = config_suffix_list;
+ image_info->ext1_suffix_list = ext1_suffix_list;
+ image_info->ext2_suffix_list = ext2_suffix_list;
image_info->custom_setup_list = NULL;
image_info->artwork_list =
Bitmap *getBitmapFromImageID(int);
char *getTokenFromImageID(int);
char *getImageConfigFilename();
-void InitImageList(struct ConfigInfo *, struct ConfigInfo *, int);
+void InitImageList(struct ConfigInfo *, int, struct ConfigInfo *,
+ struct ConfigInfo *, struct ConfigInfo *);
void ReloadCustomImages();
void FreeAllImages();
int num_suffix_list_entries = artwork_info->num_suffix_list_entries;
char *filename = getCustomArtworkConfigFilename(artwork_info->type);
struct SetupFileList *setup_file_list;
+ struct SetupFileList *extra_file_list = NULL;
char *known_token_value = "[KNOWN_TOKEN]";
int i, j;
{
if (strcmp(setup_file_list->value, known_token_value) != 0)
{
+ if (extra_file_list == NULL)
+ extra_file_list = newSetupFileList(setup_file_list->token,
+ setup_file_list->value);
+ else
+ setTokenValue(extra_file_list, setup_file_list->token,
+ setup_file_list->value);
+
if (!unknown_tokens_found)
{
Error(ERR_RETURN_LINE, "-");
freeSetupFileList(setup_file_list);
+ freeSetupFileList(extra_file_list);
+
#if 0
for (i=0; i<num_file_list_entries; i++)
{
void freeSetupFileList(struct SetupFileList *setup_file_list)
{
- if (!setup_file_list)
+ if (setup_file_list == NULL)
return;
if (setup_file_list->token)
free(setup_file_list);
}
-static struct SetupFileList *newSetupFileList(char *token, char *value)
+struct SetupFileList *newSetupFileList(char *token, char *value)
{
struct SetupFileList *new = checked_malloc(sizeof(struct SetupFileList));
- new->token = checked_malloc(strlen(token) + 1);
- strcpy(new->token, token);
-
- new->value = checked_malloc(strlen(value) + 1);
- strcpy(new->value, value);
+ new->token = getStringCopy(token);
+ new->value = getStringCopy(value);
new->next = NULL;
char *getTokenValue(struct SetupFileList *setup_file_list, char *token)
{
- if (!setup_file_list)
+ if (setup_file_list == NULL)
return NULL;
if (strcmp(setup_file_list->token, token) == 0)
void setTokenValue(struct SetupFileList *setup_file_list,
char *token, char *value)
{
- if (!setup_file_list)
+ if (setup_file_list == NULL)
return;
if (strcmp(setup_file_list->token, token) == 0)
{
- free(setup_file_list->value);
- setup_file_list->value = checked_malloc(strlen(value) + 1);
- strcpy(setup_file_list->value, value);
+ if (setup_file_list->value)
+ free(setup_file_list->value);
+
+ setup_file_list->value = getStringCopy(value);
}
else if (setup_file_list->next == NULL)
setup_file_list->next = newSetupFileList(token, value);
char *getFormattedSetupEntry(char *, char *);
void freeSetupFileList(struct SetupFileList *);
+struct SetupFileList *newSetupFileList(char *, char *);
char *getTokenValue(struct SetupFileList *, char *);
void setTokenValue(struct SetupFileList *, char *, char *);
struct SetupFileList *loadSetupFileList(char *);
return sound_info->file_list;
}
-void InitSoundList(struct ConfigInfo *config_list,
+void InitSoundList(struct ConfigInfo *config_list, int num_file_list_entries,
struct ConfigInfo *config_suffix_list,
- int num_file_list_entries)
+ struct ConfigInfo *ext1_suffix_list,
+ struct ConfigInfo *ext2_suffix_list)
{
int i;
sound_info->type = ARTWORK_TYPE_SOUNDS;
sound_info->num_file_list_entries = num_file_list_entries;
+
sound_info->num_suffix_list_entries = 0;
for (i=0; config_suffix_list[i].token != NULL; i++)
sound_info->num_suffix_list_entries++;
+ sound_info->num_ext1_suffix_list_entries = 0;
+ for (i=0; ext1_suffix_list[i].token != NULL; i++)
+ sound_info->num_ext1_suffix_list_entries++;
+
+ sound_info->num_ext2_suffix_list_entries = 0;
+ for (i=0; ext2_suffix_list[i].token != NULL; i++)
+ sound_info->num_ext2_suffix_list_entries++;
+
sound_info->file_list =
getFileListFromConfigList(config_list, config_suffix_list,
num_file_list_entries);
sound_info->suffix_list = config_suffix_list;
+ sound_info->ext1_suffix_list = ext1_suffix_list;
+ sound_info->ext2_suffix_list = ext2_suffix_list;
sound_info->custom_setup_list = NULL;
sound_info->artwork_list =
void StopSounds(void);
void StopSoundExt(int, int);
struct FileInfo *getCurrentSoundList();
-void InitSoundList(struct ConfigInfo *, struct ConfigInfo *, int);
+void InitSoundList(struct ConfigInfo *, int, struct ConfigInfo *,
+ struct ConfigInfo *, struct ConfigInfo *);
void InitReloadCustomSounds(char *);
void InitReloadCustomMusic(char *);
void FreeAllSounds(void);
int num_file_list_entries;
int num_suffix_list_entries;
+ int num_ext1_suffix_list_entries;
+ int num_ext2_suffix_list_entries;
struct FileInfo *file_list; /* static artwork file array */
struct ConfigInfo *suffix_list; /* parameter suffixes array */
+ struct ConfigInfo *ext1_suffix_list; /* property suffixes array 1 */
+ struct ConfigInfo *ext2_suffix_list; /* property suffixes array 2 */
struct SetupFileList *custom_setup_list; /* additional definitions */
struct ListNodeInfo **artwork_list; /* static artwork node array */
#include "events.h"
#if 0
-GC tile_clip_gc;
-Bitmap *pix[NUM_BITMAPS];
+GC tile_clip_gc;
+Bitmap *pix[NUM_BITMAPS];
#endif
-Bitmap *bitmap_db_field, *bitmap_db_door;
+Bitmap *bitmap_db_field, *bitmap_db_door;
#if 0
-Pixmap tile_clipmask[NUM_TILES];
+Pixmap tile_clipmask[NUM_TILES];
#endif
-DrawBuffer *fieldbuffer;
-DrawBuffer *drawto_field;
+DrawBuffer *fieldbuffer;
+DrawBuffer *drawto_field;
-int game_status = MAINMENU;
-boolean level_editor_test_game = FALSE;
-boolean network_playing = FALSE;
+int game_status = MAINMENU;
+boolean level_editor_test_game = FALSE;
+boolean network_playing = FALSE;
-int key_joystick_mapping = 0;
+int key_joystick_mapping = 0;
-boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
-int redraw_x1 = 0, redraw_y1 = 0;
+boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
+int redraw_x1 = 0, redraw_y1 = 0;
-short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA];
-short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short AmoebaCnt[MAX_NUM_AMOEBA];
+short AmoebaCnt2[MAX_NUM_AMOEBA];
+short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-unsigned long Properties1[MAX_NUM_ELEMENTS];
-unsigned long Properties2[MAX_NUM_ELEMENTS];
+unsigned long Properties1[MAX_NUM_ELEMENTS];
+unsigned long Properties2[MAX_NUM_ELEMENTS];
-int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-int lev_fieldx,lev_fieldy, scroll_x,scroll_y;
+int lev_fieldx, lev_fieldy;
+int scroll_x, scroll_y;
-int FX = SX, FY = SY, ScrollStepSize;
-int ScreenMovDir = MV_NO_MOVING, ScreenMovPos = 0;
-int ScreenGfxPos = 0;
-int BorderElement = EL_STEELWALL;
-int GameFrameDelay = GAME_FRAME_DELAY;
-int FfwdFrameDelay = FFWD_FRAME_DELAY;
-int BX1 = 0, BY1 = 0, BX2 = SCR_FIELDX-1, BY2 = SCR_FIELDY-1;
-int SBX_Left, SBX_Right;
-int SBY_Upper, SBY_Lower;
-int ZX,ZY, ExitX,ExitY;
-int AllPlayersGone;
+int FX = SX, FY = SY;
+int ScrollStepSize;
+int ScreenMovDir = MV_NO_MOVING, ScreenMovPos = 0;
+int ScreenGfxPos = 0;
+int BorderElement = EL_STEELWALL;
+int GameFrameDelay = GAME_FRAME_DELAY;
+int FfwdFrameDelay = FFWD_FRAME_DELAY;
+int BX1 = 0, BY1 = 0;
+int BX2 = SCR_FIELDX - 1, BY2 = SCR_FIELDY - 1;
+int SBX_Left, SBX_Right;
+int SBY_Upper, SBY_Lower;
+int ZX, ZY;
+int ExitX, ExitY;
+int AllPlayersGone;
-int TimeFrames, TimePlayed, TimeLeft;
+int TimeFrames, TimePlayed, TimeLeft;
-boolean network_player_action_received = FALSE;
+boolean network_player_action_received = FALSE;
struct LevelInfo level;
struct PlayerInfo stored_player[MAX_PLAYERS], *local_player = NULL;
struct GlobalInfo global;
struct FileInfo *image_files;
struct FileInfo *sound_files;
+struct GraphicInfo graphic_info[NUM_IMAGE_FILES];
+struct SoundInfo sound_info[NUM_SOUND_FILES];
+
+
+/* ------------------------------------------------------------------------- */
+/* element definitions */
+/* ------------------------------------------------------------------------- */
struct ElementInfo element_info[MAX_NUM_ELEMENTS] =
{
/* ------------------------------------------------------------------------- */
-/* sound definitions */
+/* element action and direction definitions */
/* ------------------------------------------------------------------------- */
-struct SoundActionProperties sound_action_properties[] =
+struct ElementActionInfo element_action_info[] =
{
- /* insert _all_ loop sound actions here */
- { ".waiting", ACTION_WAITING, TRUE },
- { ".moving", ACTION_MOVING, TRUE }, /* continuos moving */
- { ".active", ACTION_ACTIVE, TRUE },
- { ".growing", ACTION_GROWING, TRUE },
- { ".attacking", ACTION_ATTACKING, TRUE },
+ { ".[DEFAULT]", ACTION_DEFAULT, TRUE },
+ { ".waiting", ACTION_WAITING, TRUE },
+ { ".falling", ACTION_FALLING, TRUE },
+ { ".moving", ACTION_MOVING, TRUE },
+ { ".digging", ACTION_DIGGING, FALSE },
+ { ".snapping", ACTION_SNAPPING, FALSE },
+ { ".collecting", ACTION_COLLECTING, FALSE },
+ { ".pushing", ACTION_PUSHING, FALSE },
+ { ".passing", ACTION_PASSING, FALSE },
+ { ".impact", ACTION_IMPACT, FALSE },
+ { ".cracking", ACTION_CRACKING, FALSE },
+ { ".breaking", ACTION_BREAKING, FALSE },
+ { ".activating", ACTION_ACTIVATING, FALSE },
+ { ".opening", ACTION_OPENING, FALSE },
+ { ".closing", ACTION_CLOSING, FALSE },
+ { ".eating", ACTION_EATING, FALSE },
+ { ".attacking", ACTION_ATTACKING, TRUE },
+ { ".growing", ACTION_GROWING, TRUE },
+ { ".shrinking", ACTION_SHRINKING, FALSE },
+ { ".active", ACTION_ACTIVE, TRUE },
+ { ".other", ACTION_OTHER, FALSE },
- /* other (non-loop) sound actions are optional */
-#if 0
- { ".stepping", ACTION_MOVING, FALSE }, /* discrete moving */
-#endif
- { ".digging", ACTION_DIGGING, FALSE },
- { ".collecting", ACTION_COLLECTING, FALSE },
- { ".passing", ACTION_PASSING, FALSE },
- { ".impact", ACTION_IMPACT, FALSE },
- { ".pushing", ACTION_PUSHING, FALSE },
- { ".activating", ACTION_ACTIVATING, FALSE },
- { NULL, 0, 0 },
+ { NULL, 0, 0 },
};
+struct ElementDirectionInfo element_direction_info[] =
+{
+ { ".left", MV_BIT_LEFT },
+ { ".right", MV_BIT_RIGHT },
+ { ".up", MV_BIT_UP },
+ { ".down", MV_BIT_DOWN },
-struct GraphicInfo graphic_info[NUM_IMAGE_FILES];
-struct SoundInfo sound_info[NUM_SOUND_FILES];
+ { NULL, 0 },
+};
/* ========================================================================= */
#define SND_UNDEFINED (-1)
-#define WIN_XSIZE 672
-#define WIN_YSIZE 560
-
-#define SCR_FIELDX 17
-#define SCR_FIELDY 17
-#define MAX_BUF_XSIZE (SCR_FIELDX + 2)
-#define MAX_BUF_YSIZE (SCR_FIELDY + 2)
-#define MIN_LEV_FIELDX 3
-#define MIN_LEV_FIELDY 3
-#define STD_LEV_FIELDX 64
-#define STD_LEV_FIELDY 32
-#define MAX_LEV_FIELDX 128
-#define MAX_LEV_FIELDY 128
-
-#define SCREENX(a) ((a) - scroll_x)
-#define SCREENY(a) ((a) - scroll_y)
-#define LEVELX(a) ((a) + scroll_x)
-#define LEVELY(a) ((a) + scroll_y)
+#define WIN_XSIZE 672
+#define WIN_YSIZE 560
+
+#define SCR_FIELDX 17
+#define SCR_FIELDY 17
+#define MAX_BUF_XSIZE (SCR_FIELDX + 2)
+#define MAX_BUF_YSIZE (SCR_FIELDY + 2)
+#define MIN_LEV_FIELDX 3
+#define MIN_LEV_FIELDY 3
+#define STD_LEV_FIELDX 64
+#define STD_LEV_FIELDY 32
+#define MAX_LEV_FIELDX 128
+#define MAX_LEV_FIELDY 128
+
+#define SCREENX(a) ((a) - scroll_x)
+#define SCREENY(a) ((a) - scroll_y)
+#define LEVELX(a) ((a) + scroll_x)
+#define LEVELY(a) ((a) + scroll_y)
#define IN_VIS_FIELD(x,y) ((x)>=0 && (x)<SCR_FIELDX && (y)>=0 &&(y)<SCR_FIELDY)
#define IN_SCR_FIELD(x,y) ((x)>=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2)
#define IN_LEV_FIELD(x,y) ((x)>=0 && (x)<lev_fieldx && (y)>=0 &&(y)<lev_fieldy)
boolean loop;
};
-struct SoundActionProperties
+struct ElementActionInfo
{
- char *text;
+ char *suffix;
+ int value;
+ boolean is_loop_sound;
+};
+
+struct ElementDirectionInfo
+{
+ char *suffix;
int value;
- boolean is_loop;
};
#if 0
-extern GC tile_clip_gc;
-extern Bitmap *pix[];
+extern GC tile_clip_gc;
+extern Bitmap *pix[];
#endif
-extern Bitmap *bitmap_db_field, *bitmap_db_door;
-extern Pixmap tile_clipmask[];
-extern DrawBuffer *fieldbuffer;
-extern DrawBuffer *drawto_field;
-
-extern int game_status;
-extern boolean level_editor_test_game;
-extern boolean network_playing;
-
-extern int key_joystick_mapping;
-
-extern boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
-extern int redraw_x1, redraw_y1;
-
-extern short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA];
-extern short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-
-extern unsigned long Properties1[MAX_NUM_ELEMENTS];
-extern unsigned long Properties2[MAX_NUM_ELEMENTS];
-
-extern int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-
-extern int lev_fieldx,lev_fieldy, scroll_x,scroll_y;
-
-extern int FX,FY, ScrollStepSize;
-extern int ScreenMovDir, ScreenMovPos, ScreenGfxPos;
-extern int BorderElement;
-extern int GameFrameDelay;
-extern int FfwdFrameDelay;
-extern int BX1,BY1, BX2,BY2;
-extern int SBX_Left, SBX_Right;
-extern int SBY_Upper, SBY_Lower;
-extern int ZX,ZY, ExitX,ExitY;
-extern int AllPlayersGone;
-
-extern int TimeFrames, TimePlayed, TimeLeft;
-extern boolean SiebAktiv;
-extern int SiebCount;
-
-extern boolean network_player_action_received;
-
-extern int graphics_action_mapping[];
+extern Bitmap *bitmap_db_field, *bitmap_db_door;
+extern Pixmap tile_clipmask[];
+extern DrawBuffer *fieldbuffer;
+extern DrawBuffer *drawto_field;
+
+extern int game_status;
+extern boolean level_editor_test_game;
+extern boolean network_playing;
+
+extern int key_joystick_mapping;
+
+extern boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
+extern int redraw_x1, redraw_y1;
+
+extern short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short AmoebaCnt[MAX_NUM_AMOEBA];
+extern short AmoebaCnt2[MAX_NUM_AMOEBA];
+extern short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+
+extern unsigned long Properties1[MAX_NUM_ELEMENTS];
+extern unsigned long Properties2[MAX_NUM_ELEMENTS];
+
+extern int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+
+extern int lev_fieldx, lev_fieldy;
+extern int scroll_x, scroll_y;
+
+extern int FX, FY;
+extern int ScrollStepSize;
+extern int ScreenMovDir, ScreenMovPos, ScreenGfxPos;
+extern int BorderElement;
+extern int GameFrameDelay;
+extern int FfwdFrameDelay;
+extern int BX1, BY1;
+extern int BX2, BY2;
+extern int SBX_Left, SBX_Right;
+extern int SBY_Upper, SBY_Lower;
+extern int ZX, ZY;
+extern int ExitX, ExitY;
+extern int AllPlayersGone;
+
+extern int TimeFrames, TimePlayed, TimeLeft;
+extern boolean SiebAktiv;
+extern int SiebCount;
+
+extern boolean network_player_action_received;
+
+extern int graphics_action_mapping[];
extern struct LevelInfo level;
extern struct PlayerInfo stored_player[], *local_player;
extern struct GameInfo game;
extern struct GlobalInfo global;
extern struct ElementInfo element_info[];
+extern struct ElementActionInfo element_action_info[];
+extern struct ElementDirectionInfo element_direction_info[];
extern struct GraphicInfo graphic_info[];
extern struct SoundInfo sound_info[];
-extern struct SoundActionProperties sound_action_properties[];
extern struct ConfigInfo image_config[], sound_config[];
extern struct ConfigInfo image_config_suffix[], sound_config_suffix[];
extern struct FileInfo *image_files, *sound_files;