X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=a8017155d78226cad43a2891794f528a7bc913b6;hb=884012f34f9f3c22bf75d1468e4ed57d7795a24b;hp=7ec7446a70f767802e4cfd2c7ee51ecc72948443;hpb=c6bdf2fa014d0a3dd50260a409704e487e73e572;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 7ec7446a..a8017155 100644 --- a/src/init.c +++ b/src/init.c @@ -183,6 +183,19 @@ static int getFontBitmapID(int font_nr) return font_nr; } +static int getFontFromToken(char *token) +{ + int i; + + /* !!! OPTIMIZE THIS BY USING HASH !!! */ + for (i = 0; i < NUM_FONTS; i++) + if (strEqual(token, font_info[i].token_name)) + return i; + + /* if font not found, use reliable default value */ + return FONT_INITIAL_1; +} + void InitFontGraphicInfo() { static struct FontBitmapInfo *font_bitmap_info = NULL; @@ -193,7 +206,8 @@ void InitFontGraphicInfo() if (graphic_info == NULL) /* still at startup phase */ { - InitFontInfo(font_initial, NUM_INITIAL_FONTS, getFontBitmapID); + InitFontInfo(font_initial, NUM_INITIAL_FONTS, + getFontBitmapID, getFontFromToken); return; } @@ -412,7 +426,8 @@ void InitFontGraphicInfo() } } - InitFontInfo(font_bitmap_info, num_font_bitmaps, getFontBitmapID); + InitFontInfo(font_bitmap_info, num_font_bitmaps, + getFontBitmapID, getFontFromToken); } void InitElementGraphicInfo() @@ -1290,8 +1305,6 @@ static void InitGraphicInfo() IMG_BACKGROUND, IMG_BACKGROUND_TITLE_INITIAL, IMG_BACKGROUND_TITLE, - IMG_BACKGROUND_MESSAGE_INITIAL, - IMG_BACKGROUND_MESSAGE, IMG_BACKGROUND_MAIN, IMG_BACKGROUND_LEVELS, IMG_BACKGROUND_SCORES, @@ -5098,6 +5111,8 @@ void ReloadCustomArtwork(int force_reload) /* force redraw of (open or closed) door graphics */ SetDoorState(DOOR_OPEN_ALL); CloseDoor(DOOR_CLOSE_ALL | DOOR_NO_DELAY); + + fading = fading_none; } } @@ -5182,6 +5197,8 @@ void OpenAll() return; } + fading = fading_none; + game_status = GAME_MODE_MAIN; DrawMainMenu();