X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ffiles.c;h=0a514169af088775ddd38262b3df6a25f10ac617;hb=c74a890afba46c41f6ba6ef691bc89da0dd0135c;hp=39ecf24b895c5143c1960a50d3212800785eab2c;hpb=37a06df577bbfd00f4b361f92cacb0d97036ba93;p=rocksndiamonds.git diff --git a/src/files.c b/src/files.c index 39ecf24b..0a514169 100644 --- a/src/files.c +++ b/src/files.c @@ -119,6 +119,10 @@ #define CONF_CONTENTS_ELEMENT(b,c,x,y) ((b[CONF_CONTENT_BYTE_POS(c,x,y)]<< 8)|\ (b[CONF_CONTENT_BYTE_POS(c,x,y) + 1])) +#if 0 +static void LoadLevel_InitPlayfield(struct LevelInfo *, char *); +#endif + static struct LevelInfo li; static struct @@ -286,6 +290,10 @@ static struct EL_PLAYER_4, CONF_VALUE_BOOLEAN_4, &li.use_explosion_element[3], FALSE }, + { + EL_PLAYER_1, CONF_VALUE_BOOLEAN_5, + &li.continuous_snapping, TRUE + }, { EL_PLAYER_1, CONF_VALUE_INTEGER_1, &li.initial_player_stepsize, STEPSIZE_NORMAL @@ -568,7 +576,9 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) level->can_pass_to_walkable = FALSE; level->grow_into_diggable = TRUE; +#if 0 level->block_snap_field = TRUE; +#endif level->block_last_field = FALSE; /* EM does not block by default */ level->sp_block_last_field = TRUE; /* SP blocks the last field */ @@ -718,8 +728,13 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) /* !!! now done in InitElementPropertiesStatic() (see above) !!! */ /* !!! (else properties set there will be overwritten here) !!! */ /* start with no properties at all */ +#if 1 + for (j = 0; j < NUM_EP_BITFIELDS; j++) + ei->properties[j] = EP_BITMASK_DEFAULT; +#else for (j = 0; j < NUM_EP_BITFIELDS; j++) Properties[element][j] = EP_BITMASK_DEFAULT; +#endif #endif /* now set default properties */ @@ -800,9 +815,15 @@ static void setFileInfoToDefaults(struct LevelFileInfo *level_file_info) static void ActivateLevelTemplate() { +#if 1 + /* Currently there is no special action needed to activate the template + data, because 'element_info' property settings overwrite the original + level data, while all other variables do not change. */ +#else /* Currently there is no special action needed to activate the template data, because 'element_info' and 'Properties' overwrite the original level data, while all other variables do not change. */ +#endif } static char *getLevelFilenameFromBasename(char *basename) @@ -1381,10 +1402,17 @@ static int LoadLevel_CUS1(FILE *file, int chunk_size, struct LevelInfo *level) int element = getFile16BitBE(file); int properties = getFile32BitBE(file); +#if 1 + if (IS_CUSTOM_ELEMENT(element)) + element_info[element].properties[EP_BITFIELD_BASE] = properties; + else + Error(ERR_WARN, "invalid custom element number %d", element); +#else if (IS_CUSTOM_ELEMENT(element)) Properties[element][EP_BITFIELD_BASE] = properties; else Error(ERR_WARN, "invalid custom element number %d", element); +#endif } return chunk_size; @@ -1445,7 +1473,11 @@ static int LoadLevel_CUS3(FILE *file, int chunk_size, struct LevelInfo *level) ei->description[j] = getFile8Bit(file); ei->description[MAX_ELEMENT_NAME_LEN] = 0; +#if 1 + ei->properties[EP_BITFIELD_BASE] = getFile32BitBE(file); +#else Properties[element][EP_BITFIELD_BASE] = getFile32BitBE(file); +#endif /* some free bytes for future properties and padding */ ReadUnusedBytesFromFile(file, 7); @@ -1532,7 +1564,11 @@ static int LoadLevel_CUS4(FILE *file, int chunk_size, struct LevelInfo *level) ei->description[i] = getFile8Bit(file); ei->description[MAX_ELEMENT_NAME_LEN] = 0; +#if 1 + ei->properties[EP_BITFIELD_BASE] = getFile32BitBE(file); +#else Properties[element][EP_BITFIELD_BASE] = getFile32BitBE(file); +#endif ReadUnusedBytesFromFile(file, 4); /* reserved for more base properties */ ei->num_change_pages = getFile8Bit(file); @@ -2389,10 +2425,17 @@ void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) }; struct LevelInfo_EM *level_em = level->native_em_level; struct LEVEL *lev = level_em->lev; - struct PLAYER *ply1 = level_em->ply1; - struct PLAYER *ply2 = level_em->ply2; + struct PLAYER **ply = level_em->ply; int i, j, x, y; +#if 0 + printf("::: A\n"); + for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) + for (j = 0; j < 8; j++) + printf("::: ball %d, %d: %d\n", i, j, + level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); +#endif + lev->width = MIN(level->fieldx, EM_MAX_CAVE_WIDTH); lev->height = MIN(level->fieldy, EM_MAX_CAVE_HEIGHT); @@ -2445,6 +2488,13 @@ void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) map_element_RND_to_EM(level-> ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); +#if 0 + for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) + for (j = 0; j < 8; j++) + printf("::: ball %d, %d: %d\n", i, j, + level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); +#endif + map_android_clone_elements_RND_to_EM(level); #if 0 @@ -2457,6 +2507,45 @@ void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) for (x = 0; x < EM_MAX_CAVE_WIDTH; x++) level_em->cave[x][y] = ZBORDER; +#if 1 + +#if 0 +#if 1 + LoadLevel_InitPlayfield(); +#else + lev_fieldx = lev->width; /* !!! also in LoadLevel_InitPlayfield() !!! */ + lev_fieldy = lev->height; /* !!! also in LoadLevel_InitPlayfield() !!! */ + SetBorderElement(); /* !!! also in LoadLevel_InitPlayfield() !!! */ +#endif +#endif + +#if 0 + printf("::: BorderElement == %d\n", BorderElement); +#endif + + if (BorderElement == EL_STEELWALL) + { + for (y = 0; y < lev->height + 2; y++) + for (x = 0; x < lev->width + 2; x++) + level_em->cave[x + 1][y + 1] = map_element_RND_to_EM(EL_STEELWALL); + } + + /* then copy the real level contents from level file into the playfield */ + for (y = 0; y < lev->height; y++) for (x = 0; x < lev->width; x++) + { + int new_element = map_element_RND_to_EM(level->field[x][y]); + int offset = (BorderElement == EL_STEELWALL ? 1 : 0); + int xx = x + 1 + offset; + int yy = y + 1 + offset; + + if (level->field[x][y] == EL_AMOEBA_DEAD) + new_element = map_element_RND_to_EM(EL_AMOEBA_WET); + + level_em->cave[xx][yy] = new_element; + } + +#else + /* then copy the real level contents from level file into the playfield */ for (y = 0; y < lev->height; y++) for (x = 0; x < lev->width; x++) { @@ -2468,15 +2557,46 @@ void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) level_em->cave[x + 1][y + 1] = new_element; } +#endif + +#if 1 + + for (i = 0; i < MAX_PLAYERS; i++) + { + ply[i]->x_initial = 0; + ply[i]->y_initial = 0; + } + +#else + ply1->x_initial = 0; ply1->y_initial = 0; ply2->x_initial = 0; ply2->y_initial = 0; +#endif + /* initialize player positions and delete players from the playfield */ for (y = 0; y < lev->height; y++) for (x = 0; x < lev->width; x++) { + +#if 1 + if (ELEM_IS_PLAYER(level->field[x][y])) + { + int player_nr = GET_PLAYER_NR(level->field[x][y]); + int offset = (BorderElement == EL_STEELWALL ? 1 : 0); + int xx = x + 1 + offset; + int yy = y + 1 + offset; + + ply[player_nr]->x_initial = xx; + ply[player_nr]->y_initial = yy; + + level_em->cave[xx][yy] = map_element_RND_to_EM(EL_EMPTY); + } + +#else + #if 1 /* !!! CURRENTLY ONLY SUPPORT FOR ONE PLAYER !!! */ if (ELEM_IS_PLAYER(level->field[x][y])) @@ -2500,6 +2620,17 @@ void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) level_em->cave[x + 1][y + 1] = map_element_RND_to_EM(EL_EMPTY); } #endif + +#endif + + } + + if (BorderElement == EL_STEELWALL) + { +#if 1 + lev->width += 2; + lev->height += 2; +#endif } } @@ -2518,8 +2649,7 @@ void CopyNativeLevel_EM_to_RND(struct LevelInfo *level) }; struct LevelInfo_EM *level_em = level->native_em_level; struct LEVEL *lev = level_em->lev; - struct PLAYER *ply1 = level_em->ply1; - struct PLAYER *ply2 = level_em->ply2; + struct PLAYER **ply = level_em->ply; int i, j, x, y; level->fieldx = MIN(lev->width, MAX_LEV_FIELDX); @@ -2570,11 +2700,27 @@ void CopyNativeLevel_EM_to_RND(struct LevelInfo *level) level->wind_direction_initial = map_direction_EM_to_RND(lev->wind_direction_initial); +#if 0 + printf("::: foo\n"); + for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) + for (j = 0; j < 8; j++) + printf("::: ball %d, %d: %d\n", i, j, + level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); +#endif + for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) for (j = 0; j < 8; j++) level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]] = map_element_EM_to_RND(lev->ball_array[i][j]); +#if 0 + printf("::: bar\n"); + for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) + for (j = 0; j < 8; j++) + printf("::: ball %d, %d: %d\n", i, j, + level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); +#endif + map_android_clone_elements_EM_to_RND(level); #if 0 @@ -2593,13 +2739,50 @@ void CopyNativeLevel_EM_to_RND(struct LevelInfo *level) level->field[x][y] = new_element; } +#if 0 + printf("::: bar 0\n"); + for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) + for (j = 0; j < 8; j++) + printf("::: ball %d, %d: %d\n", i, j, + level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); +#endif + +#if 1 + + for (i = 0; i < MAX_PLAYERS; i++) + { + /* in case of all players set to the same field, use the first player */ + int nr = MAX_PLAYERS - i - 1; + int jx = ply[nr]->x_initial - 1; + int jy = ply[nr]->y_initial - 1; + +#if 0 + printf("::: player %d: %d, %d\n", nr, jx, jy); +#endif + + if (jx != -1 && jy != -1) + level->field[jx][jy] = EL_PLAYER_1 + nr; + } + +#else + /* in case of both players set to the same field, use the first player */ level->field[ply2->x_initial - 1][ply2->y_initial - 1] = EL_PLAYER_2; level->field[ply1->x_initial - 1][ply1->y_initial - 1] = EL_PLAYER_1; +#endif + #if 0 printf("::: native Emerald Mine file version: %d\n", level_em->file_version); #endif + +#if 0 + printf("::: bar 2\n"); + for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) + for (j = 0; j < 8; j++) + printf("::: ball %d, %d: %d\n", i, j, + level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); +#endif } static void LoadLevelFromFileInfo_EM(struct LevelInfo *level, @@ -2617,6 +2800,30 @@ void CopyNativeLevel_RND_to_Native(struct LevelInfo *level) void CopyNativeLevel_Native_to_RND(struct LevelInfo *level) { + +#if 0 + { + static int ball_xy[8][2] = + { + { 0, 0 }, + { 1, 0 }, + { 2, 0 }, + { 0, 1 }, + { 2, 1 }, + { 0, 2 }, + { 1, 2 }, + { 2, 2 }, + }; + int i, j; + + printf("::: A6\n"); + for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) + for (j = 0; j < 8; j++) + printf("::: ball %d, %d: %d\n", i, j, + level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); + } +#endif + if (level->game_engine_type == GAME_ENGINE_TYPE_EM) CopyNativeLevel_EM_to_RND(level); } @@ -2773,8 +2980,12 @@ static void LoadLevelFromFileStream_SP(FILE *file, struct LevelInfo *level, level->time_wheel = 0; level->amoeba_content = EL_EMPTY; +#if 1 + /* original Supaplex does not use score values -- use default values */ +#else for (i = 0; i < LEVEL_SCORE_ELEMENTS; i++) level->score[i] = 0; /* !!! CORRECT THIS !!! */ +#endif /* there are no yamyams in supaplex levels */ for (i = 0; i < level->num_yamyam_contents; i++) @@ -2999,10 +3210,15 @@ void LoadLevelFromFileInfo(struct LevelInfo *level, if (level->game_engine_type == GAME_ENGINE_TYPE_UNKNOWN) level->game_engine_type = GAME_ENGINE_TYPE_RND; +#if 1 + if (level_file_info->type != LEVEL_FILE_TYPE_RND) + CopyNativeLevel_Native_to_RND(level); +#else if (level_file_info->type == LEVEL_FILE_TYPE_RND) CopyNativeLevel_RND_to_Native(level); else CopyNativeLevel_Native_to_RND(level); +#endif } void LoadLevelFromFilename(struct LevelInfo *level, char *filename) @@ -3024,6 +3240,19 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) if (leveldir_current == NULL) /* only when dumping level */ return; + /* all engine modifications also valid for levels which use latest engine */ +#if 1 + if (level->game_version < VERSION_IDENT(3,2,0,5)) + { + /* time bonus score was given for 10 s instead of 1 s before 3.2.0-5 */ + level->score[SC_TIME_BONUS] /= 10; + } +#endif + +#if 0 + leveldir_current->latest_engine = TRUE; /* !!! TEST ONLY !!! */ +#endif + if (leveldir_current->latest_engine) { /* ---------- use latest game engine ----------------------------------- */ @@ -3086,8 +3315,16 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) /* extra time score was same value as time left score before 3.2.0-5 */ level->extra_time_score = level->score[SC_TIME_BONUS]; +#if 0 /* time bonus score was given for 10 s instead of 1 s before 3.2.0-5 */ level->score[SC_TIME_BONUS] /= 10; +#endif + } + + if (level->game_version < VERSION_IDENT(3,2,0,7)) + { + /* default behaviour for snapping was "not continuous" before 3.2.0-7 */ + level->continuous_snapping = FALSE; } /* only few elements were able to actively move into acid before 3.1.0 */ @@ -3290,6 +3527,21 @@ static void LoadLevel_InitPlayfield(struct LevelInfo *level, char *filename) SetBorderElement(); } +static void LoadLevel_InitNativeEngines(struct LevelInfo *level,char *filename) +{ + struct LevelFileInfo *level_file_info = &level->file_info; + +#if 1 + if (level_file_info->type == LEVEL_FILE_TYPE_RND) + CopyNativeLevel_RND_to_Native(level); +#else + if (level_file_info->type == LEVEL_FILE_TYPE_RND) + CopyNativeLevel_RND_to_Native(level); + else + CopyNativeLevel_Native_to_RND(level); +#endif +} + void LoadLevelTemplate(int nr) { char *filename; @@ -3320,6 +3572,8 @@ void LoadLevel(int nr) LoadLevel_InitVersion(&level, filename); LoadLevel_InitElements(&level, filename); LoadLevel_InitPlayfield(&level, filename); + + LoadLevel_InitNativeEngines(&level, filename); } static void SaveLevel_VERS(FILE *file, struct LevelInfo *level) @@ -3498,6 +3752,20 @@ static void SaveLevel_CUS1(FILE *file, struct LevelInfo *level, { int element = EL_CUSTOM_START + i; +#if 1 + struct ElementInfo *ei = &element_info[element]; + + if (ei->properties[EP_BITFIELD_BASE] != EP_BITMASK_DEFAULT) + { + if (check < num_changed_custom_elements) + { + putFile16BitBE(file, element); + putFile32BitBE(file, ei->properties[EP_BITFIELD_BASE]); + } + + check++; + } +#else if (Properties[element][EP_BITFIELD_BASE] != EP_BITMASK_DEFAULT) { if (check < num_changed_custom_elements) @@ -3508,6 +3776,7 @@ static void SaveLevel_CUS1(FILE *file, struct LevelInfo *level, check++; } +#endif } if (check != num_changed_custom_elements) /* should not happen */ @@ -3566,7 +3835,11 @@ static void SaveLevel_CUS3(FILE *file, struct LevelInfo *level, for (j = 0; j < MAX_ELEMENT_NAME_LEN; j++) putFile8Bit(file, ei->description[j]); +#if 1 + putFile32BitBE(file, ei->properties[EP_BITFIELD_BASE]); +#else putFile32BitBE(file, Properties[element][EP_BITFIELD_BASE]); +#endif /* some free bytes for future properties and padding */ WriteUnusedBytesToFile(file, 7); @@ -3639,7 +3912,11 @@ static void SaveLevel_CUS4(FILE *file, struct LevelInfo *level, int element) for (i = 0; i < MAX_ELEMENT_NAME_LEN; i++) putFile8Bit(file, ei->description[i]); +#if 1 + putFile32BitBE(file, ei->properties[EP_BITFIELD_BASE]); +#else putFile32BitBE(file, Properties[element][EP_BITFIELD_BASE]); +#endif WriteUnusedBytesToFile(file, 4); /* reserved for more base properties */ putFile8Bit(file, ei->num_change_pages); @@ -4512,6 +4789,7 @@ void SaveTape(int nr) void DumpTape(struct TapeInfo *tape) { + int tape_frame_counter; int i, j; if (tape->no_valid_file) @@ -4529,12 +4807,14 @@ void DumpTape(struct TapeInfo *tape) printf("Level series identifier: '%s'\n", tape->level_identifier); printf_line("-", 79); + tape_frame_counter = 0; + for (i = 0; i < tape->length; i++) { if (i >= MAX_TAPE_LEN) break; - printf("%03d: ", i); + printf("%04d: ", i); for (j = 0; j < MAX_PLAYERS; j++) { @@ -4553,7 +4833,10 @@ void DumpTape(struct TapeInfo *tape) } } - printf("(%03d)\n", tape->pos[i].delay); + printf("(%03d) ", tape->pos[i].delay); + printf("[%05d]\n", tape_frame_counter); + + tape_frame_counter += tape->pos[i].delay; } printf_line("-", 79); @@ -4666,14 +4949,17 @@ void SaveScore(int nr) #define SETUP_TOKEN_TIME_LIMIT 14 #define SETUP_TOKEN_FULLSCREEN 15 #define SETUP_TOKEN_ASK_ON_ESCAPE 16 -#define SETUP_TOKEN_GRAPHICS_SET 17 -#define SETUP_TOKEN_SOUNDS_SET 18 -#define SETUP_TOKEN_MUSIC_SET 19 -#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 20 -#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 21 -#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 22 - -#define NUM_GLOBAL_SETUP_TOKENS 23 +#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR 17 +#define SETUP_TOKEN_QUICK_SWITCH 18 +#define SETUP_TOKEN_INPUT_ON_FOCUS 19 +#define SETUP_TOKEN_GRAPHICS_SET 20 +#define SETUP_TOKEN_SOUNDS_SET 21 +#define SETUP_TOKEN_MUSIC_SET 22 +#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 23 +#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 24 +#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 25 + +#define NUM_GLOBAL_SETUP_TOKENS 26 /* editor setup */ #define SETUP_TOKEN_EDITOR_EL_BOULDERDASH 0 @@ -4714,8 +5000,13 @@ void SaveScore(int nr) #define SETUP_TOKEN_SHORTCUT_SAVE_GAME 0 #define SETUP_TOKEN_SHORTCUT_LOAD_GAME 1 #define SETUP_TOKEN_SHORTCUT_TOGGLE_PAUSE 2 +#define SETUP_TOKEN_SHORTCUT_FOCUS_PLAYER_1 3 +#define SETUP_TOKEN_SHORTCUT_FOCUS_PLAYER_2 4 +#define SETUP_TOKEN_SHORTCUT_FOCUS_PLAYER_3 5 +#define SETUP_TOKEN_SHORTCUT_FOCUS_PLAYER_4 6 +#define SETUP_TOKEN_SHORTCUT_FOCUS_PLAYER_ALL 7 -#define NUM_SHORTCUT_SETUP_TOKENS 3 +#define NUM_SHORTCUT_SETUP_TOKENS 8 /* player setup */ #define SETUP_TOKEN_PLAYER_USE_JOYSTICK 0 @@ -4776,6 +5067,9 @@ static struct TokenInfo global_setup_tokens[] = { TYPE_SWITCH, &si.time_limit, "time_limit" }, { TYPE_SWITCH, &si.fullscreen, "fullscreen" }, { TYPE_SWITCH, &si.ask_on_escape, "ask_on_escape" }, + { TYPE_SWITCH, &si.ask_on_escape_editor, "ask_on_escape_editor" }, + { TYPE_SWITCH, &si.quick_switch, "quick_player_switch" }, + { TYPE_SWITCH, &si.input_on_focus, "input_on_focus" }, { TYPE_STRING, &si.graphics_set, "graphics_set" }, { TYPE_STRING, &si.sounds_set, "sounds_set" }, { TYPE_STRING, &si.music_set, "music_set" }, @@ -4815,7 +5109,6 @@ static struct TokenInfo editor_cascade_setup_tokens[] = { TYPE_SWITCH, &seci.el_ce, "editor.cascade.el_ce" }, { TYPE_SWITCH, &seci.el_ge, "editor.cascade.el_ge" }, { TYPE_SWITCH, &seci.el_user, "editor.cascade.el_user" }, - { TYPE_SWITCH, &seci.el_generic, "editor.cascade.el_generic" }, { TYPE_SWITCH, &seci.el_dynamic, "editor.cascade.el_dynamic" }, }; @@ -4823,7 +5116,12 @@ static struct TokenInfo shortcut_setup_tokens[] = { { TYPE_KEY_X11, &ssi.save_game, "shortcut.save_game" }, { TYPE_KEY_X11, &ssi.load_game, "shortcut.load_game" }, - { TYPE_KEY_X11, &ssi.toggle_pause, "shortcut.toggle_pause" } + { TYPE_KEY_X11, &ssi.toggle_pause, "shortcut.toggle_pause" }, + { TYPE_KEY_X11, &ssi.focus_player[0], "shortcut.focus_player_1" }, + { TYPE_KEY_X11, &ssi.focus_player[1], "shortcut.focus_player_2" }, + { TYPE_KEY_X11, &ssi.focus_player[2], "shortcut.focus_player_3" }, + { TYPE_KEY_X11, &ssi.focus_player[3], "shortcut.focus_player_4" }, + { TYPE_KEY_X11, &ssi.focus_player_all,"shortcut.focus_player_all" }, }; static struct TokenInfo player_setup_tokens[] = @@ -4843,18 +5141,18 @@ static struct TokenInfo player_setup_tokens[] = { TYPE_KEY_X11, &sii.key.up, ".key.move_up" }, { TYPE_KEY_X11, &sii.key.down, ".key.move_down" }, { TYPE_KEY_X11, &sii.key.snap, ".key.snap_field" }, - { TYPE_KEY_X11, &sii.key.drop, ".key.place_bomb" } + { TYPE_KEY_X11, &sii.key.drop, ".key.place_bomb" }, }; static struct TokenInfo system_setup_tokens[] = { { TYPE_STRING, &syi.sdl_audiodriver, "system.sdl_audiodriver" }, - { TYPE_INTEGER, &syi.audio_fragment_size,"system.audio_fragment_size" } + { TYPE_INTEGER, &syi.audio_fragment_size,"system.audio_fragment_size" }, }; static struct TokenInfo options_setup_tokens[] = { - { TYPE_BOOLEAN, &soi.verbose, "options.verbose" } + { TYPE_BOOLEAN, &soi.verbose, "options.verbose" }, }; static char *get_corrected_login_name(char *login_name) @@ -4896,6 +5194,9 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->time_limit = TRUE; si->fullscreen = FALSE; si->ask_on_escape = TRUE; + si->ask_on_escape_editor = TRUE; + si->quick_switch = FALSE; + si->input_on_focus = FALSE; si->graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR); si->sounds_set = getStringCopy(SND_CLASSIC_SUBDIR); @@ -4923,6 +5224,12 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->shortcut.load_game = DEFAULT_KEY_LOAD_GAME; si->shortcut.toggle_pause = DEFAULT_KEY_TOGGLE_PAUSE; + si->shortcut.focus_player[0] = DEFAULT_KEY_FOCUS_PLAYER_1; + si->shortcut.focus_player[1] = DEFAULT_KEY_FOCUS_PLAYER_2; + si->shortcut.focus_player[2] = DEFAULT_KEY_FOCUS_PLAYER_3; + si->shortcut.focus_player[3] = DEFAULT_KEY_FOCUS_PLAYER_4; + si->shortcut.focus_player_all = DEFAULT_KEY_FOCUS_PLAYER_ALL; + for (i = 0; i < MAX_PLAYERS; i++) { si->input[i].use_joystick = FALSE; @@ -4964,7 +5271,6 @@ static void setSetupInfoToDefaults_EditorCascade(struct SetupInfo *si) si->editor_cascade.el_ce = FALSE; si->editor_cascade.el_ge = FALSE; si->editor_cascade.el_user = FALSE; - si->editor_cascade.el_generic = FALSE; si->editor_cascade.el_dynamic = FALSE; } @@ -5060,7 +5366,7 @@ void LoadSetup() { char *player_name_new; - checkSetupFileHashIdentifier(setup_file_hash, getCookie("SETUP")); + checkSetupFileHashIdentifier(setup_file_hash, filename,getCookie("SETUP")); decodeSetupFileHash(setup_file_hash); setup.direct_draw = !setup.double_buffering; @@ -5088,7 +5394,7 @@ void LoadSetup_EditorCascade() if (setup_file_hash) { - checkSetupFileHashIdentifier(setup_file_hash, getCookie("SETUP")); + checkSetupFileHashIdentifier(setup_file_hash, filename,getCookie("SETUP")); decodeSetupFileHash_EditorCascade(setup_file_hash); freeSetupFileHash(setup_file_hash); @@ -5698,7 +6004,7 @@ void LoadHelpAnimInfo() i_to_a(element_action_info[i].value)); /* do not store direction index (bit) here, but direction value! */ - for (i = 0; i < NUM_DIRECTIONS; i++) + for (i = 0; i < NUM_DIRECTIONS_FULL; i++) setHashEntry(direction_hash, element_direction_info[i].suffix, i_to_a(1 << element_direction_info[i].value)); @@ -5860,7 +6166,8 @@ void LoadHelpAnimInfo() #if 0 for (i = 0; i < num_list_entries; i++) - printf("::: %d, %d, %d => %d\n", + printf("::: '%s': %d, %d, %d => %d\n", + EL_NAME(helpanim_info[i].element), helpanim_info[i].element, helpanim_info[i].action, helpanim_info[i].direction,