From: Holger Schemel Date: Sun, 19 Jan 2003 18:24:38 +0000 (+0100) Subject: rnd-20030119-1-src X-Git-Tag: 3.0.0^2~169 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=7b47ce7ba0f673f0de5130daf5726104d0b38902;p=rocksndiamonds.git rnd-20030119-1-src --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 53176615..dae09689 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -36,7 +36,7 @@ struct ConfigInfo image_config_suffix[] = { ".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 } }; @@ -531,10 +531,14 @@ struct ConfigInfo image_config[] = { "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 */ diff --git a/src/conftime.h b/src/conftime.h index 9b4859ba..c86c2ea5 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-01-18 18:43]" +#define COMPILE_DATE_STRING "[2003-01-19 19:22]" diff --git a/src/game.c b/src/game.c index 10e6e2fb..533119c9 100644 --- a/src/game.c +++ b/src/game.c @@ -2178,7 +2178,7 @@ void Impact(int x, int y) 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; @@ -2207,7 +2207,8 @@ void Impact(int x, int y) 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 = @@ -2228,29 +2229,31 @@ void Impact(int x, int y) 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 || @@ -2258,19 +2261,23 @@ void Impact(int x, int y) 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) @@ -5224,6 +5231,8 @@ void GameActions() 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 diff --git a/src/init.c b/src/init.c index 2b1b7931..2b7836e2 100644 --- a/src/init.c +++ b/src/init.c @@ -184,8 +184,21 @@ static void InitArtworkInfo() 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 '%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) @@ -587,8 +596,8 @@ void ReloadCustomArtwork() 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); @@ -604,11 +613,7 @@ void ReloadCustomArtwork() 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; @@ -617,11 +622,11 @@ void ReloadCustomArtwork() 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 */ @@ -630,12 +635,7 @@ void ReloadCustomArtwork() 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; @@ -650,11 +650,7 @@ void ReloadCustomArtwork() 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; @@ -668,10 +664,6 @@ void ReloadCustomArtwork() SetDoorState(DOOR_OPEN_ALL); CloseDoor(DOOR_CLOSE_ALL | DOOR_NO_DELAY); } - -#if 0 - printf("<-- '%s'\n", artwork.gfx_current_identifier); -#endif } void FreeGadgets() @@ -701,7 +693,6 @@ void InitGadgets() void InitElementInfo() { - int i, act, dir; /* set values to -1 to identify later as "uninitialized" values */ @@ -787,7 +778,7 @@ void InitElementInfo() } } -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; @@ -847,33 +838,22 @@ static void set_graphic_parameters(int graphic, int action, int *parameter) 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; @@ -884,25 +864,6 @@ static void InitGraphicInfo() image_files = getCurrentImageList(); - /* set temporary graphics action field to default value */ - for (i=0; i -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) { @@ -925,7 +886,7 @@ static void InitGraphicInfo() 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 */ @@ -952,8 +913,7 @@ static void InitGraphicInfo() 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; @@ -976,8 +936,7 @@ static void InitGraphicInfo() 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) @@ -1043,17 +1002,17 @@ static void InitSoundInfo() /* 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; } } @@ -1088,11 +1047,11 @@ static void InitSoundInfo() 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++; } diff --git a/src/libgame/image.c b/src/libgame/image.c index c4d30808..b2ed4d7e 100644 --- a/src/libgame/image.c +++ b/src/libgame/image.c @@ -720,9 +720,10 @@ char *getImageConfigFilename() 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; @@ -731,14 +732,25 @@ void InitImageList(struct ConfigInfo *config_list, 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 = diff --git a/src/libgame/image.h b/src/libgame/image.h index 75c9ad18..0bc0b4b3 100644 --- a/src/libgame/image.h +++ b/src/libgame/image.h @@ -76,7 +76,8 @@ struct FileInfo *getCurrentImageList(); 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(); diff --git a/src/libgame/misc.c b/src/libgame/misc.c index abea6277..5b083e41 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1614,6 +1614,7 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info) 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; @@ -1689,6 +1690,13 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info) { 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, "-"); @@ -1710,6 +1718,8 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info) freeSetupFileList(setup_file_list); + freeSetupFileList(extra_file_list); + #if 0 for (i=0; itoken) @@ -1043,15 +1043,12 @@ void freeSetupFileList(struct SetupFileList *setup_file_list) 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; @@ -1060,7 +1057,7 @@ static struct SetupFileList *newSetupFileList(char *token, char *value) 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) @@ -1072,14 +1069,15 @@ char *getTokenValue(struct SetupFileList *setup_file_list, char *token) 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); diff --git a/src/libgame/setup.h b/src/libgame/setup.h index d3328728..e5dc50d8 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -206,6 +206,7 @@ boolean checkCookieString(const char *, const char *); 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 *); diff --git a/src/libgame/sound.c b/src/libgame/sound.c index 1a403e7b..460bed15 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -1770,9 +1770,10 @@ struct FileInfo *getCurrentSoundList() 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; @@ -1781,14 +1782,25 @@ void InitSoundList(struct ConfigInfo *config_list, 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 = diff --git a/src/libgame/sound.h b/src/libgame/sound.h index 45905aab..9e495961 100644 --- a/src/libgame/sound.h +++ b/src/libgame/sound.h @@ -143,7 +143,8 @@ void StopSound(int); 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); diff --git a/src/libgame/system.h b/src/libgame/system.h index f77bc0ac..fa722636 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -517,9 +517,13 @@ struct ArtworkListInfo 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 */ diff --git a/src/main.c b/src/main.c index 7cb24632..b0a19802 100644 --- a/src/main.c +++ b/src/main.c @@ -19,63 +19,68 @@ #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; @@ -86,6 +91,13 @@ struct GameInfo game; 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] = { @@ -2760,34 +2772,45 @@ 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 }, +}; /* ========================================================================= */ diff --git a/src/main.h b/src/main.h index 221b3530..423058b4 100644 --- a/src/main.h +++ b/src/main.h @@ -38,24 +38,24 @@ #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)=0 &&(y)=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2) #define IN_LEV_FIELD(x,y) ((x)>=0 && (x)=0 &&(y)