X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ffiles.c;h=d25a47988ea1485e5ca929f3318cc9a9d83c899e;hb=1e422c29292f0583391b0ce9e9c872b38f035ac0;hp=9f92ad68cb84300f0e09883ac808a6803a4b153a;hpb=4179dabc517f32c163c5d2c9aec2e15c57225d42;p=rocksndiamonds.git diff --git a/src/files.c b/src/files.c index 9f92ad68..d25a4798 100644 --- a/src/files.c +++ b/src/files.c @@ -6551,7 +6551,7 @@ static void LoadLevelFromFileInfo_SB(struct LevelInfo *level, boolean load_xsb_to_ces = check_special_flags("load_xsb_to_ces"); int file_level_nr = 0; int line_nr = 0; - int x, y; + int x = 0, y = 0; /* initialized to make compilers happy */ #if 0 printf("::: looking for level number %d [%d]\n", @@ -9060,15 +9060,20 @@ void SaveScore(int nr) #define SETUP_TOKEN_SHORTCUT_FOCUS_PLAYER_4 6 #define SETUP_TOKEN_SHORTCUT_FOCUS_PLAYER_ALL 7 #define SETUP_TOKEN_SHORTCUT_TAPE_EJECT 8 -#define SETUP_TOKEN_SHORTCUT_TAPE_STOP 9 -#define SETUP_TOKEN_SHORTCUT_TAPE_PAUSE 10 -#define SETUP_TOKEN_SHORTCUT_TAPE_RECORD 11 -#define SETUP_TOKEN_SHORTCUT_TAPE_PLAY 12 -#define SETUP_TOKEN_SHORTCUT_SOUND_SIMPLE 13 -#define SETUP_TOKEN_SHORTCUT_SOUND_LOOPS 14 -#define SETUP_TOKEN_SHORTCUT_SOUND_MUSIC 15 - -#define NUM_SHORTCUT_SETUP_TOKENS 16 +#define SETUP_TOKEN_SHORTCUT_TAPE_EXTRA 9 +#define SETUP_TOKEN_SHORTCUT_TAPE_STOP 10 +#define SETUP_TOKEN_SHORTCUT_TAPE_PAUSE 11 +#define SETUP_TOKEN_SHORTCUT_TAPE_RECORD 12 +#define SETUP_TOKEN_SHORTCUT_TAPE_PLAY 13 +#define SETUP_TOKEN_SHORTCUT_SOUND_SIMPLE 14 +#define SETUP_TOKEN_SHORTCUT_SOUND_LOOPS 15 +#define SETUP_TOKEN_SHORTCUT_SOUND_MUSIC 16 +#define SETUP_TOKEN_SHORTCUT_SNAP_LEFT 17 +#define SETUP_TOKEN_SHORTCUT_SNAP_RIGHT 18 +#define SETUP_TOKEN_SHORTCUT_SNAP_UP 19 +#define SETUP_TOKEN_SHORTCUT_SNAP_DOWN 20 + +#define NUM_SHORTCUT_SETUP_TOKENS 21 /* player setup */ #define SETUP_TOKEN_PLAYER_USE_JOYSTICK 0 @@ -9214,6 +9219,7 @@ static struct TokenInfo shortcut_setup_tokens[] = { TYPE_KEY_X11, &ssi.focus_player[3], "shortcut.focus_player_4" }, { TYPE_KEY_X11, &ssi.focus_player_all,"shortcut.focus_player_all" }, { TYPE_KEY_X11, &ssi.tape_eject, "shortcut.tape_eject" }, + { TYPE_KEY_X11, &ssi.tape_extra, "shortcut.tape_extra" }, { TYPE_KEY_X11, &ssi.tape_stop, "shortcut.tape_stop" }, { TYPE_KEY_X11, &ssi.tape_pause, "shortcut.tape_pause" }, { TYPE_KEY_X11, &ssi.tape_record, "shortcut.tape_record" }, @@ -9221,6 +9227,10 @@ static struct TokenInfo shortcut_setup_tokens[] = { TYPE_KEY_X11, &ssi.sound_simple, "shortcut.sound_simple" }, { TYPE_KEY_X11, &ssi.sound_loops, "shortcut.sound_loops" }, { TYPE_KEY_X11, &ssi.sound_music, "shortcut.sound_music" }, + { TYPE_KEY_X11, &ssi.snap_left, "shortcut.snap_left" }, + { TYPE_KEY_X11, &ssi.snap_right, "shortcut.snap_right" }, + { TYPE_KEY_X11, &ssi.snap_up, "shortcut.snap_up" }, + { TYPE_KEY_X11, &ssi.snap_down, "shortcut.snap_down" }, }; static struct TokenInfo player_setup_tokens[] = @@ -9338,6 +9348,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->shortcut.focus_player_all = DEFAULT_KEY_FOCUS_PLAYER_ALL; si->shortcut.tape_eject = DEFAULT_KEY_TAPE_EJECT; + si->shortcut.tape_extra = DEFAULT_KEY_TAPE_EXTRA; si->shortcut.tape_stop = DEFAULT_KEY_TAPE_STOP; si->shortcut.tape_pause = DEFAULT_KEY_TAPE_PAUSE; si->shortcut.tape_record = DEFAULT_KEY_TAPE_RECORD; @@ -9347,6 +9358,11 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->shortcut.sound_loops = DEFAULT_KEY_SOUND_LOOPS; si->shortcut.sound_music = DEFAULT_KEY_SOUND_MUSIC; + si->shortcut.snap_left = DEFAULT_KEY_SNAP_LEFT; + si->shortcut.snap_right = DEFAULT_KEY_SNAP_RIGHT; + si->shortcut.snap_up = DEFAULT_KEY_SNAP_UP; + si->shortcut.snap_down = DEFAULT_KEY_SNAP_DOWN; + for (i = 0; i < MAX_PLAYERS; i++) { si->input[i].use_joystick = FALSE; @@ -9374,6 +9390,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->options.verbose = FALSE; #if defined(CREATE_SPECIAL_EDITION_RND_JUE) + si->toons = FALSE; si->handicap = FALSE; si->fullscreen = TRUE; si->override_level_graphics = AUTO; @@ -9814,7 +9831,8 @@ static void InitMenuDesignSettings_SpecialPreProcessing() { viewport.playfield[i] = viewport.playfield[GFX_SPECIAL_ARG_DEFAULT]; viewport.door_1[i] = viewport.door_1[GFX_SPECIAL_ARG_DEFAULT]; - viewport.door_2[i] = viewport.door_2[GFX_SPECIAL_ARG_DEFAULT]; + if (i != GFX_SPECIAL_ARG_EDITOR) /* editor value already initialized */ + viewport.door_2[i] = viewport.door_2[GFX_SPECIAL_ARG_DEFAULT]; } } @@ -9957,31 +9975,44 @@ static void LoadMenuDesignSettingsFromFilename(char *filename) /* (eg, init "viewport.door_1.MAIN.xyz" from "viewport.door_1.xyz") */ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++) { - char *token_1 = "viewport.playfield.width"; - char *token_2 = "viewport.playfield.height"; - char *token_3 = "viewport.door_1.x"; - char *token_4 = "viewport.door_1.y"; - char *token_5 = "viewport.door_2.x"; - char *token_6 = "viewport.door_2.y"; + char *token_1 = "viewport.playfield.x"; + char *token_2 = "viewport.playfield.y"; + char *token_3 = "viewport.playfield.width"; + char *token_4 = "viewport.playfield.height"; + char *token_5 = "viewport.playfield.border_size"; + char *token_6 = "viewport.door_1.x"; + char *token_7 = "viewport.door_1.y"; + char *token_8 = "viewport.door_2.x"; + char *token_9 = "viewport.door_2.y"; char *value_1 = getHashEntry(setup_file_hash, token_1); char *value_2 = getHashEntry(setup_file_hash, token_2); char *value_3 = getHashEntry(setup_file_hash, token_3); char *value_4 = getHashEntry(setup_file_hash, token_4); char *value_5 = getHashEntry(setup_file_hash, token_5); char *value_6 = getHashEntry(setup_file_hash, token_6); + char *value_7 = getHashEntry(setup_file_hash, token_7); + char *value_8 = getHashEntry(setup_file_hash, token_8); + char *value_9 = getHashEntry(setup_file_hash, token_9); if (value_1 != NULL) - viewport.playfield[i].width = get_token_parameter_value(token_1,value_1); + viewport.playfield[i].x = get_token_parameter_value(token_1, value_1); if (value_2 != NULL) - viewport.playfield[i].height = get_token_parameter_value(token_2,value_2); + viewport.playfield[i].y = get_token_parameter_value(token_2, value_2); if (value_3 != NULL) - viewport.door_1[i].x = get_token_parameter_value(token_3, value_3); + viewport.playfield[i].width = get_token_parameter_value(token_3, value_3); if (value_4 != NULL) - viewport.door_1[i].y = get_token_parameter_value(token_4, value_4); + viewport.playfield[i].height = get_token_parameter_value(token_4,value_4); if (value_5 != NULL) - viewport.door_2[i].x = get_token_parameter_value(token_5, value_5); + viewport.playfield[i].border_size = get_token_parameter_value(token_5, + value_5); if (value_6 != NULL) - viewport.door_2[i].y = get_token_parameter_value(token_6, value_6); + viewport.door_1[i].x = get_token_parameter_value(token_6, value_6); + if (value_7 != NULL) + viewport.door_1[i].y = get_token_parameter_value(token_7, value_7); + if (value_8 != NULL) + viewport.door_2[i].x = get_token_parameter_value(token_8, value_8); + if (value_9 != NULL) + viewport.door_2[i].y = get_token_parameter_value(token_9, value_9); } /* special case: initialize with default values that may be overwritten */ @@ -10320,6 +10351,10 @@ void LoadMusicInfo() if (!music_info_listed(music_file_info, music->filename)) { *new = get_music_file_info(music->filename, i); +#if 0 + if (*new != NULL) + printf(":1: adding '%s' ['%s'] ...\n", (*new)->title, music->filename); +#endif if (*new != NULL) new = &(*new)->next; } @@ -10365,6 +10400,10 @@ void LoadMusicInfo() if (!music_info_listed(music_file_info, basename)) { *new = get_music_file_info(basename, MAP_NOCONF_MUSIC(num_music_noconf)); +#if 0 + if (*new != NULL) + printf(":2: adding '%s' ['%s'] ...\n", (*new)->title, basename); +#endif if (*new != NULL) new = &(*new)->next; } @@ -10834,8 +10873,9 @@ void CreateLevelSketchImages() filename1 = getPath2(global.create_images_dir, basename1); filename2 = getPath2(global.create_images_dir, basename2); - getGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y); - BlitBitmap(src_bitmap, bitmap1, src_x, src_y, TILEX, TILEY, 0, 0); + getFixedGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y); + BlitBitmap(src_bitmap, bitmap1, src_x, src_y, TILEX, TILEY, + 0, 0); if (SDL_SaveBMP(bitmap1->surface, filename1) != 0) Error(ERR_EXIT, "cannot save level sketch image file '%s'", filename1); @@ -10886,7 +10926,7 @@ void CreateCustomElementImages() TILEY * (NUM_CUSTOM_ELEMENTS + NUM_GROUP_ELEMENTS) / 16, DEFAULT_DEPTH); - getGraphicSource(dummy_graphic, 0, &src_bitmap, &src_x, &src_y); + getFixedGraphicSource(dummy_graphic, 0, &src_bitmap, &src_x, &src_y); for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) { @@ -10898,18 +10938,22 @@ void CreateCustomElementImages() BlitBitmap(src_bitmap, bitmap, 0, 0, TILEX, TILEY, TILEX * x, TILEY * y + yoffset_ce); - BlitBitmap(src_bitmap, bitmap, 0, TILEY, TILEX, TILEY, - TILEX * x + TILEX * 16, TILEY * y + yoffset_ce); + BlitBitmap(src_bitmap, bitmap, 0, TILEY, + TILEX, TILEY, + TILEX * x + TILEX * 16, + TILEY * y + yoffset_ce); for (j = 2; j >= 0; j--) { int c = ii % 10; - BlitBitmap(src_bitmap, bitmap, TILEX + c * 7, 0, 6, 10, + BlitBitmap(src_bitmap, bitmap, + TILEX + c * 7, 0, 6, 10, TILEX * x + 6 + j * 7, TILEY * y + 11 + yoffset_ce); - BlitBitmap(src_bitmap, bitmap, TILEX + c * 8, TILEY, 6, 10, + BlitBitmap(src_bitmap, bitmap, + TILEX + c * 8, TILEY, 6, 10, TILEX * 16 + TILEX * x + 6 + j * 8, TILEY * y + 10 + yoffset_ce); @@ -10927,8 +10971,10 @@ void CreateCustomElementImages() BlitBitmap(src_bitmap, bitmap, 0, 0, TILEX, TILEY, TILEX * x, TILEY * y + yoffset_ge); - BlitBitmap(src_bitmap, bitmap, 0, TILEY, TILEX, TILEY, - TILEX * x + TILEX * 16, TILEY * y + yoffset_ge); + BlitBitmap(src_bitmap, bitmap, 0, TILEY, + TILEX, TILEY, + TILEX * x + TILEX * 16, + TILEY * y + yoffset_ge); for (j = 1; j >= 0; j--) { @@ -10938,7 +10984,8 @@ void CreateCustomElementImages() TILEX * x + 6 + j * 10, TILEY * y + 11 + yoffset_ge); - BlitBitmap(src_bitmap, bitmap, TILEX + c * 8, TILEY + 12, 6, 10, + BlitBitmap(src_bitmap, bitmap, + TILEX + c * 8, TILEY + 12, 6, 10, TILEX * 16 + TILEX * x + 10 + j * 8, TILEY * y + 10 + yoffset_ge);