X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=6cfba4e633c944145fee8330797e0ef72c32a839;hb=4f1505e125379280d5e68a04ac780e746e6dfdf5;hp=6fd4ae087a8e5b4135de7de6cded6a737fc2020b;hpb=a7a3a417929449b5d1c32a5ef9e67693015d187b;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 6fd4ae08..6cfba4e6 100644 --- a/src/init.c +++ b/src/init.c @@ -110,14 +110,14 @@ static int copy_properties[][5] = static int get_graphic_parameter_value(char *, char *, int); -static Bitmap *getLoadingBackgroundBitmap(int graphic) +static int getLoadingBackgroundImage(int graphic) { - return getBitmapFromGraphicOrDefault(graphic, INITIAL_IMG_BACKGROUND); + return getImageFromGraphicOrDefault(graphic, INITIAL_IMG_BACKGROUND); } static void SetLoadingWindowBackgroundImage(int graphic) { - SetWindowBackgroundBitmap(getLoadingBackgroundBitmap(graphic)); + SetBackgroundImage(getLoadingBackgroundImage(graphic), REDRAW_ALL); } static void SetLoadingBackgroundImage(void) @@ -381,7 +381,7 @@ void InitImageTextures(void) CreateImageTextures(texture_graphics[i]); } -static int getFontBitmapID(int font_nr) +static int getFontSpecialSuffix(void) { int special = -1; @@ -394,6 +394,13 @@ static int getFontBitmapID(int font_nr) else if (game_status == GAME_MODE_PSEUDO_TYPENAMES) special = GFX_SPECIAL_ARG_NAMES; + return special; +} + +static int getFontBitmapID(int font_nr) +{ + int special = getFontSpecialSuffix(); + if (special != -1) return font_info[font_nr].special_bitmap_id[special]; else @@ -411,6 +418,22 @@ static int getFontFromToken(char *token) return FONT_INITIAL_1; } +static char *getTokenFromFont(int font_nr) +{ + static char *token = NULL; + int special = getFontSpecialSuffix(); + + checked_free(token); + + if (special != -1) + token = getStringCat2(font_info[font_nr].token_name, + special_suffix_info[special].suffix); + else + token = getStringCopy(font_info[font_nr].token_name); + + return token; +} + static void InitFontGraphicInfo(void) { static struct FontBitmapInfo *font_bitmap_info = NULL; @@ -422,7 +445,7 @@ static void InitFontGraphicInfo(void) if (graphic_info == NULL) // still at startup phase { InitFontInfo(font_initial, NUM_INITIAL_FONTS, - getFontBitmapID, getFontFromToken); + getFontBitmapID, getFontFromToken, getTokenFromFont); return; } @@ -647,7 +670,7 @@ static void InitFontGraphicInfo(void) } InitFontInfo(font_bitmap_info, num_font_bitmaps, - getFontBitmapID, getFontFromToken); + getFontBitmapID, getFontFromToken, getTokenFromFont); } static void InitGlobalAnimGraphicInfo(void) @@ -1668,6 +1691,12 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, g->active_yoffset = parameter[GFX_ARG_ACTIVE_YOFFSET]; g->pressed_xoffset = parameter[GFX_ARG_PRESSED_XOFFSET]; g->pressed_yoffset = parameter[GFX_ARG_PRESSED_YOFFSET]; + + // this is only used for drawing stacked global animations + g->stacked_xfactor = parameter[GFX_ARG_STACKED_XFACTOR]; + g->stacked_yfactor = parameter[GFX_ARG_STACKED_YFACTOR]; + g->stacked_xoffset = parameter[GFX_ARG_STACKED_XOFFSET]; + g->stacked_yoffset = parameter[GFX_ARG_STACKED_YOFFSET]; } static void set_graphic_parameters(int graphic) @@ -4240,6 +4269,7 @@ void InitElementPropertiesStatic(void) EL_BD_AMOEBA, EL_EMC_MAGIC_BALL, EL_EMC_ANDROID, + EL_MM_GRAY_BALL, -1 }; @@ -5654,7 +5684,6 @@ void InitGfxBuffers(void) } ReCreateBitmap(&bitmap_db_field, FXSIZE, FYSIZE); - ReCreateBitmap(&bitmap_db_panel, DXSIZE, DYSIZE); ReCreateBitmap(&bitmap_db_door_1, 3 * DXSIZE, DYSIZE); ReCreateBitmap(&bitmap_db_door_2, 3 * VXSIZE, VYSIZE); @@ -6420,7 +6449,7 @@ void DisplayExitMessage(char *format, va_list ap) sy += 3 * font_height; num_lines_printed = - DrawTextBuffer(sx, sy, program.log_filename[LOG_ERR_ID], font_2, + DrawTextBuffer(sx, sy, program.log_filename, font_2, line_length, line_length, max_lines, 0, BLIT_ON_BACKGROUND, TRUE, TRUE, FALSE);