X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ffiles.c;h=6882aaa584737ed2404631c52d2828526d0e05ca;hb=73d5033080f93ad34a3e5aee7e8abd7aba8e17a9;hp=df569c52794f4ddea14cb87c6a58566bd53c77d7;hpb=f7cfbcfe490a20f60a778ff9b05f174fab1ec2da;p=rocksndiamonds.git diff --git a/src/files.c b/src/files.c index df569c52..6882aaa5 100644 --- a/src/files.c +++ b/src/files.c @@ -8971,12 +8971,48 @@ static void InitMenuDesignSettings_SpecialPostProcessing() /* set default position for snapshot buttons to stop/pause/play buttons */ for (i = 0; game_buttons_xy[i].dst != NULL; i++) - { if ((*game_buttons_xy[i].dst).x == -1 && (*game_buttons_xy[i].dst).y == -1) + *game_buttons_xy[i].dst = *game_buttons_xy[i].src; +} + +static void InitMenuDesignSettings_SpecialPostProcessing_AfterGraphics() +{ + static struct + { + struct XYTileSize *dst, *src; + int graphic; + } + editor_buttons_xy[] = + { + { + &editor.button.element_left, &editor.palette.element_left, + IMG_GFX_EDITOR_BUTTON_ELEMENT_LEFT + }, { - (*game_buttons_xy[i].dst).x = (*game_buttons_xy[i].src).x; - (*game_buttons_xy[i].dst).y = (*game_buttons_xy[i].src).y; + &editor.button.element_middle, &editor.palette.element_middle, + IMG_GFX_EDITOR_BUTTON_ELEMENT_MIDDLE + }, + { + &editor.button.element_right, &editor.palette.element_right, + IMG_GFX_EDITOR_BUTTON_ELEMENT_RIGHT + }, + + { NULL, NULL } + }; + int i; + + /* set default position for element buttons to element graphics */ + for (i = 0; editor_buttons_xy[i].dst != NULL; i++) + { + if ((*editor_buttons_xy[i].dst).x == -1 && + (*editor_buttons_xy[i].dst).y == -1) + { + struct GraphicInfo *gd = &graphic_info[editor_buttons_xy[i].graphic]; + + gd->width = gd->height = editor_buttons_xy[i].src->tile_size; + + *editor_buttons_xy[i].dst = *editor_buttons_xy[i].src; } } } @@ -9364,6 +9400,11 @@ void LoadMenuDesignSettings() InitMenuDesignSettings_SpecialPostProcessing(); } +void LoadMenuDesignSettings_AfterGraphics() +{ + InitMenuDesignSettings_SpecialPostProcessing_AfterGraphics(); +} + void LoadUserDefinedEditorElementList(int **elements, int *num_elements) { char *filename = getEditorSetupFilename(); @@ -10168,6 +10209,8 @@ void CreateCustomElementImages(char *directory) SDLInitVideoDisplay(); + ReCreateBitmap(&backbuffer, video.width, video.height); + src_bitmap = LoadImage(src_filename); bitmap = CreateBitmap(TILEX * 16 * 2,