X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Finit.c;h=29f4fd4b130744436de7c7fe4951de2c44035a79;hp=74ea88a03a9674cb7ad05e75920d1b4d7ac7d38c;hb=89401883eeb279c7101b1c635477a9bccc123d21;hpb=2f9505502fc5749fef69b36504fe9df66443ebf4 diff --git a/src/init.c b/src/init.c index 74ea88a0..29f4fd4b 100644 --- a/src/init.c +++ b/src/init.c @@ -937,14 +937,12 @@ void InitElementGraphicInfo() (move_dir == MV_BIT_UP && !front_is_left_or_upper) || (move_dir == MV_BIT_RIGHT && front_is_left_or_upper) || (move_dir == MV_BIT_DOWN && front_is_left_or_upper))); - Bitmap *dummy; /* swap frontside and backside graphic tile coordinates, if needed */ if (swap_movement_tiles_always || swap_movement_tiles_autodetected) { /* get current (wrong) backside tile coordinates */ - getFixedGraphicSourceExt(graphic, 0, &dummy, - &src_x_back, &src_y_back, TRUE); + getGraphicSourceXY(graphic, 0, &src_x_back, &src_y_back, TRUE); /* set frontside tile coordinates to backside tile coordinates */ g->src_x = src_x_back; @@ -1346,13 +1344,13 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, if (parameter[GFX_ARG_TILE_SIZE] != ARG_UNDEFINED_VALUE) { - anim_frames_per_row = src_image_width / g->tile_size; - anim_frames_per_col = src_image_height / g->tile_size; + anim_frames_per_row = MAX(1, src_image_width / g->tile_size); + anim_frames_per_col = MAX(1, src_image_height / g->tile_size); } else { - anim_frames_per_row = src_image_width / g->width; - anim_frames_per_col = src_image_height / g->height; + anim_frames_per_row = MAX(1, src_image_width / g->width); + anim_frames_per_col = MAX(1, src_image_height / g->height); } g->src_image_width = src_image_width; @@ -1708,6 +1706,7 @@ static void InitGraphicInfo() Error(ERR_INFO, "- config file: '%s'", getImageConfigFilename()); Error(ERR_INFO, "- config token: '%s'", getTokenFromImageID(i)); Error(ERR_INFO, "- image file: '%s'", src_bitmap->source_filename); + Error(ERR_INFO, "- frame size: %d, %d", width, height); Error(ERR_INFO, "error: first animation frame out of bounds (%d, %d) [%d, %d]", src_x, src_y, src_bitmap_width, src_bitmap_height); @@ -1736,10 +1735,10 @@ static void InitGraphicInfo() Error(ERR_INFO, "- config file: '%s'", getImageConfigFilename()); Error(ERR_INFO, "- config token: '%s'", getTokenFromImageID(i)); Error(ERR_INFO, "- image file: '%s'", src_bitmap->source_filename); + Error(ERR_INFO, "- frame size: %d, %d", width, height); Error(ERR_INFO, "error: last animation frame (%d) out of bounds (%d, %d) [%d, %d]", last_frame, src_x, src_y, src_bitmap_width, src_bitmap_height); - Error(ERR_INFO, "::: %d, %d", width, height); Error(ERR_INFO, "custom graphic rejected for this element/action"); if (i == fallback_graphic) @@ -1785,7 +1784,8 @@ static void InitGraphicCompatibilityInfo() { // printf("::: special treatment needed for token '%s'\n", fi->token); - graphic_info[i].bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap; + graphic_info[i].bitmaps = graphic_info[IMG_GLOBAL_DOOR].bitmaps; + graphic_info[i].bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap; } } } @@ -5456,6 +5456,9 @@ static void InitImages() ReinitializeGraphics(); print_timestamp_time("ReinitializeGraphics"); + LoadMenuDesignSettings_AfterGraphics(); + print_timestamp_time("LoadMenuDesignSettings_AfterGraphics"); + UPDATE_BUSY_STATE(); print_timestamp_done("InitImages"); @@ -5888,6 +5891,8 @@ void OpenAll() print_timestamp_time("[init setup/config stuff (1)]"); + InitScoresInfo(); + if (options.execute_command) Execute_Command(options.execute_command); @@ -5923,7 +5928,7 @@ void OpenAll() InitVideoDisplay(); InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen); - InitEventFilter(FilterEvents); + InitOverlayInfo(); print_timestamp_time("[init video stuff]");