X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Finit.c;h=3a2ccca2a197faf55d116d37b1dcff09bd548ce3;hp=c8b468c0dfef0feb7bc5c070d43b8a589b135d46;hb=7ecbe0a730dc19d8a46ffe6bbcb052f20d0c4152;hpb=8e3612567b52232c0f1dff593546cb90b396911c diff --git a/src/init.c b/src/init.c index c8b468c0..3a2ccca2 100644 --- a/src/init.c +++ b/src/init.c @@ -102,6 +102,11 @@ void DrawInitAnim() if (!DelayReached(&action_delay, action_delay_value)) return; + if (init_last.busy.x == -1) + init_last.busy.x = WIN_XSIZE / 2; + if (init_last.busy.y == -1) + init_last.busy.y = WIN_YSIZE / 2; + x = ALIGNED_TEXT_XPOS(&init_last.busy); y = ALIGNED_TEXT_YPOS(&init_last.busy); @@ -151,7 +156,7 @@ void InitGadgets() gadgets_initialized = TRUE; } -inline void InitElementSmallImagesScaledUp(int graphic) +inline static void InitElementSmallImagesScaledUp(int graphic) { struct GraphicInfo *g = &graphic_info[graphic]; @@ -1369,6 +1374,10 @@ static void InitGraphicInfo() static int full_size_graphics[] = { IMG_GLOBAL_BORDER, + IMG_GLOBAL_BORDER_MAIN, + IMG_GLOBAL_BORDER_SCORES, + IMG_GLOBAL_BORDER_EDITOR, + IMG_GLOBAL_BORDER_PLAYING, IMG_GLOBAL_DOOR, IMG_BACKGROUND_ENVELOPE_1, @@ -4549,8 +4558,6 @@ static void InitGlobal() global.create_images_dir = NULL; global.frames_per_second = 0; - global.fps_slowdown = FALSE; - global.fps_slowdown_factor = 1; global.border_status = GAME_MODE_MAIN; @@ -4676,10 +4683,16 @@ void Execute_Command(char *command) exit(0); } - else if (strPrefix(command, "autoplay ")) + else if (strPrefix(command, "autotest ") || + strPrefix(command, "autoplay ") || + strPrefix(command, "autoffwd ")) { char *str_ptr = getStringCopy(&command[9]); /* read command parameters */ + global.autoplay_mode = (strPrefix(command, "autotest") ? AUTOPLAY_TEST : + strPrefix(command, "autoplay") ? AUTOPLAY_PLAY : + strPrefix(command, "autoffwd") ? AUTOPLAY_FFWD : 0); + while (*str_ptr != '\0') /* continue parsing string */ { /* cut leading whitespace from string, replace it by string terminator */ @@ -5000,9 +5013,21 @@ static void InitMixer() void InitGfxBuffers() { + static int win_xsize_last = -1; + static int win_ysize_last = -1; + /* create additional image buffers for double-buffering and cross-fading */ - ReCreateBitmap(&bitmap_db_store, WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH); - ReCreateBitmap(&bitmap_db_cross, WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH); + + if (WIN_XSIZE != win_xsize_last || WIN_YSIZE != win_ysize_last) + { + /* may contain content for cross-fading -- only re-create if changed */ + ReCreateBitmap(&bitmap_db_store, WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH); + ReCreateBitmap(&bitmap_db_cross, WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH); + + win_xsize_last = WIN_XSIZE; + win_ysize_last = WIN_YSIZE; + } + ReCreateBitmap(&bitmap_db_field, FXSIZE, FYSIZE, DEFAULT_DEPTH); ReCreateBitmap(&bitmap_db_panel, DXSIZE, DYSIZE, DEFAULT_DEPTH); ReCreateBitmap(&bitmap_db_door_1, 3 * DXSIZE, DYSIZE, DEFAULT_DEPTH); @@ -5188,14 +5213,6 @@ void InitGfx() init_last = init; } -void RedrawGlobalBorder() -{ - BlitBitmap(graphic_info[IMG_GLOBAL_BORDER].bitmap, backbuffer, - 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0); - - redraw_mask = REDRAW_ALL; -} - void InitGfxBackground() { fieldbuffer = bitmap_db_field; @@ -5211,6 +5228,15 @@ static void InitLevelInfo() LoadLevelInfo(); /* global level info */ LoadLevelSetup_LastSeries(); /* last played series info */ LoadLevelSetup_SeriesInfo(); /* last played level info */ + + if (global.autoplay_leveldir && + global.autoplay_mode != AUTOPLAY_TEST) + { + leveldir_current = getTreeInfoFromIdentifier(leveldir_first, + global.autoplay_leveldir); + if (leveldir_current == NULL) + leveldir_current = getFirstValidTreeInfoEntry(leveldir_first); + } } static void InitLevelArtworkInfo()