From: Holger Schemel Date: Sat, 18 Oct 2003 22:54:09 +0000 (+0200) Subject: rnd-20031019-1-src X-Git-Tag: 3.0.7^2~11 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1bd9644544424ed912d886777c6e8ed387aac24a;p=rocksndiamonds.git rnd-20031019-1-src * fixed serious bug in code for delayed element pushing * fixed little bug in animation frame selection for pushed elements --- diff --git a/ChangeLog b/ChangeLog index 07127588..f33feed4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,14 @@ +2003-10-18 + * fixed serious bug in code for delayed element pushing + * fixed little bug in animation frame selection for pushed elements + 2003-10-08 - * added config directive for opening and closing Supaplex exit + * 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. diff --git a/src/conftime.h b/src/conftime.h index ae48cd90..05e72bcb 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-10-14 00:21]" +#define COMPILE_DATE_STRING "[2003-10-19 00:50]" diff --git a/src/files.c b/src/files.c index 3f22b604..fc7bfb7b 100644 --- a/src/files.c +++ b/src/files.c @@ -186,7 +186,7 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) element_info[element].collect_score = 10; /* special default */ element_info[element].collect_count = 1; /* special default */ - element_info[element].push_delay_fixed = 2; /* special default */ + element_info[element].push_delay_fixed = 8; /* special default */ element_info[element].push_delay_random = 8; /* special default */ element_info[element].move_delay_fixed = 0; element_info[element].move_delay_random = 0; diff --git a/src/game.c b/src/game.c index 8ff077ef..584c1a92 100644 --- a/src/game.c +++ b/src/game.c @@ -927,7 +927,7 @@ static void InitGameEngine() { if (!IS_CUSTOM_ELEMENT(i)) { - element_info[i].push_delay_fixed = 2; + element_info[i].push_delay_fixed = 8; element_info[i].push_delay_random = 8; } } @@ -7909,7 +7909,13 @@ int DigField(struct PlayerInfo *player, if (!FrameReached(&player->push_delay, player->push_delay_value) && !(tape.playing && tape.file_version < FILE_VERSION_2_0) && element != EL_SPRING && element != EL_BALLOON) + { + /* make sure that there is no move delay before next try to push */ + if (game.engine_version >= VERSION_IDENT(3,0,7)) + player->move_delay = INITIAL_MOVE_DELAY_OFF; + return MF_NO_ACTION; + } if (IS_SB_ELEMENT(element)) { diff --git a/src/init.c b/src/init.c index a4a92600..ebc9f2fd 100644 --- a/src/init.c +++ b/src/init.c @@ -2946,22 +2946,6 @@ void InitElementPropertiesEngine(int engine_version) (level.em_slippery_gems && engine_version > VERSION_IDENT(2,0,1))); } - -#if 0 - /* dynamically adjust element properties according to game engine version */ -#if 0 - if (engine_version < RELEASE_IDENT(2,2,0,7)) -#endif - { - for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; - - element_info[element].push_delay_fixed = 2; - element_info[element].push_delay_random = 8; - } - } -#endif } static void InitGlobal() diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 50a713f4..84ec3602 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -2293,6 +2293,9 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info) printf("GOT CUSTOM ARTWORK CONFIG FILE '%s'\n", filename); #endif + DrawInitText("Loading artwork config:", 120, FC_GREEN); + DrawInitText(ARTWORKINFO_FILENAME(artwork_info->type), 150, FC_YELLOW); + /* always start with reliable default values */ for (i=0; inext, token); } -void setListEntry(SetupFileList *list, char *token, char *value) +SetupFileList *setListEntry(SetupFileList *list, char *token, char *value) { if (list == NULL) - return; + return NULL; if (strcmp(list->token, token) == 0) { @@ -1183,11 +1140,13 @@ void setListEntry(SetupFileList *list, char *token, char *value) free(list->value); list->value = getStringCopy(value); + + return list; } else if (list->next == NULL) - list->next = newSetupFileList(token, value); + return (list->next = newSetupFileList(token, value)); else - setListEntry(list->next, token, value); + return setListEntry(list->next, token, value); } #ifdef DEBUG @@ -1308,13 +1267,13 @@ static void *loadSetupFileData(char *filename, boolean use_hash) int line_len; char line[MAX_LINE_LEN]; char *token, *value, *line_ptr; - void *setup_file_data; + void *setup_file_data, *insert_ptr; FILE *file; if (use_hash) setup_file_data = newSetupFileHash(); else - setup_file_data = newSetupFileList("", ""); + insert_ptr = setup_file_data = newSetupFileList("", ""); if (!(file = fopen(filename, MODE_READ))) { @@ -1379,7 +1338,7 @@ static void *loadSetupFileData(char *filename, boolean use_hash) if (use_hash) setHashEntry((SetupFileHash *)setup_file_data, token, value); else - setListEntry((SetupFileList *)setup_file_data, token, value); + insert_ptr = setListEntry((SetupFileList *)insert_ptr, token, value); } } diff --git a/src/libgame/setup.h b/src/libgame/setup.h index 5ae3bc4b..95407915 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -230,10 +230,10 @@ boolean checkCookieString(const char *, const char *); char *getFormattedSetupEntry(char *, char *); -struct SetupFileList *newSetupFileList(char *, char *); -void freeSetupFileList(struct SetupFileList *); -char *getListEntry(struct SetupFileList *, char *); -void setListEntry(struct SetupFileList *, char *, char *); +SetupFileList *newSetupFileList(char *, char *); +void freeSetupFileList(SetupFileList *); +char *getListEntry(SetupFileList *, char *); +SetupFileList *setListEntry(SetupFileList *, char *, char *); SetupFileList *loadSetupFileList(char *); SetupFileHash *newSetupFileHash(); diff --git a/src/libgame/system.h b/src/libgame/system.h index 007e02d3..d1c41d2a 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -203,6 +203,7 @@ #define RO_BASE_PATH RO_GAME_DIR #define RW_BASE_PATH RW_GAME_DIR +/* directory names */ #define GRAPHICS_DIRECTORY "graphics" #define SOUNDS_DIRECTORY "sounds" #define MUSIC_DIRECTORY "music" @@ -221,6 +222,31 @@ #define MUS_CLASSIC_SUBDIR "mus_orig" #endif +/* file names and filename extensions */ +#if !defined(PLATFORM_MSDOS) +#define LEVELSETUP_DIRECTORY "levelsetup" +#define SETUP_FILENAME "setup.conf" +#define LEVELSETUP_FILENAME "levelsetup.conf" +#define LEVELINFO_FILENAME "levelinfo.conf" +#define GRAPHICSINFO_FILENAME "graphicsinfo.conf" +#define SOUNDSINFO_FILENAME "soundsinfo.conf" +#define MUSICINFO_FILENAME "musicinfo.conf" +#define LEVELFILE_EXTENSION "level" +#define TAPEFILE_EXTENSION "tape" +#define SCOREFILE_EXTENSION "score" +#else +#define LEVELSETUP_DIRECTORY "lvlsetup" +#define SETUP_FILENAME "setup.cnf" +#define LEVELSETUP_FILENAME "lvlsetup.cnf" +#define LEVELINFO_FILENAME "lvlinfo.cnf" +#define GRAPHICSINFO_FILENAME "gfxinfo.cnf" +#define SOUNDSINFO_FILENAME "sndinfo.cnf" +#define MUSICINFO_FILENAME "musinfo.cnf" +#define LEVELFILE_EXTENSION "lvl" +#define TAPEFILE_EXTENSION "tap" +#define SCOREFILE_EXTENSION "sco" +#endif + /* areas in bitmap PIX_DOOR */ /* meaning in PIX_DB_DOOR: (3 PAGEs) @@ -324,6 +350,30 @@ (artwork).snd_current_identifier : \ (artwork).mus_current_identifier) +#define ARTWORKINFO_FILENAME(type) \ + ((type) == ARTWORK_TYPE_GRAPHICS ? \ + GRAPHICSINFO_FILENAME : \ + (type) == ARTWORK_TYPE_SOUNDS ? \ + SOUNDSINFO_FILENAME : \ + (type) == ARTWORK_TYPE_MUSIC ? \ + MUSICINFO_FILENAME : "") + +#define ARTWORK_DIRECTORY(type) \ + ((type) == ARTWORK_TYPE_GRAPHICS ? \ + GRAPHICS_DIRECTORY : \ + (type) == ARTWORK_TYPE_SOUNDS ? \ + SOUNDS_DIRECTORY : \ + (type) == ARTWORK_TYPE_MUSIC ? \ + MUSIC_DIRECTORY : "") + +#define OPTIONS_ARTWORK_DIRECTORY(type) \ + ((type) == ARTWORK_TYPE_GRAPHICS ? \ + options.graphics_directory : \ + (type) == ARTWORK_TYPE_SOUNDS ? \ + options.sounds_directory : \ + (type) == ARTWORK_TYPE_MUSIC ? \ + options.music_directory : "") + /* type definitions */ typedef int (*EventFilter)(const Event *); diff --git a/src/tools.c b/src/tools.c index 932df515..d98a4c1b 100644 --- a/src/tools.c +++ b/src/tools.c @@ -743,7 +743,11 @@ void DrawPlayer(struct PlayerInfo *player) { int element = MovingOrBlocked2Element(next_jx, next_jy); int graphic = el_act_dir2img(element, ACTION_PUSHING, move_dir); +#if 1 + int frame = getGraphicAnimationFrame(graphic, player->StepFrame); +#else int frame = getGraphicAnimationFrame(graphic, player->Frame); +#endif DrawGraphicShifted(px, py, sxx, syy, graphic, frame, NO_CUTTING, NO_MASKING);