X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=54f4277d736fc9843ce9a583c9983dc10fc0782e;hb=3e260bd26ec0df0531a83f1323178743f641187d;hp=8a741fcba844807fb44edc76448e535e1275ba54;hpb=3b6e79911d74a8c1d28e33e0eb8b943c04d9ae7b;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 8a741fcb..54f4277d 100644 --- a/src/init.c +++ b/src/init.c @@ -97,6 +97,9 @@ void DrawInitAnim() int sync_frame = FrameCounter; int x, y; + /* prevent OS (Windows) from complaining about program not responding */ + CheckQuitEvent(); + if (game_status != GAME_MODE_LOADING) return; @@ -4722,6 +4725,16 @@ static void InitGlobal() element_info[i].editor_description= element_name_info[i].editor_description; } + for (i = 0; i < NUM_GLOBAL_ANIM_TOKENS + 1; i++) + { + /* check if global_anim_name_info defined for each entry in "main.h" */ + if (i < NUM_GLOBAL_ANIM_TOKENS && + global_anim_name_info[i].token_name == NULL) + Error(ERR_EXIT, "undefined 'global_anim_name_info' entry for anim %d", i); + + global_anim_info[i].token_name = global_anim_name_info[i].token_name; + } + /* create hash from image config list */ image_config_hash = newSetupFileHash(); for (i = 0; image_config[i].token != NULL; i++) @@ -4825,6 +4838,7 @@ static void InitGlobal() global.create_images_dir = NULL; global.frames_per_second = 0; + global.show_frames_per_second = FALSE; global.border_status = GAME_MODE_LOADING; global.anim_status = global.anim_status_next = GAME_MODE_LOADING; @@ -5044,6 +5058,9 @@ static void InitSetup() if (setup.options.verbose) options.verbose = TRUE; + + if (setup.debug.show_frames_per_second) + global.show_frames_per_second = TRUE; } static void InitGameInfo() @@ -6064,10 +6081,10 @@ void OpenAll() Error(ERR_DEBUG, "::: SDL_AndroidGetExternalStoragePath() == '%s'", SDL_AndroidGetExternalStoragePath()); Error(ERR_DEBUG, "::: SDL_AndroidGetExternalStorageState() == '%s'", - (SDL_AndroidGetExternalStorageState() == - SDL_ANDROID_EXTERNAL_STORAGE_READ ? "read" : - SDL_AndroidGetExternalStorageState() == - SDL_ANDROID_EXTERNAL_STORAGE_WRITE ? "write" : "not available")); + (SDL_AndroidGetExternalStorageState() & + SDL_ANDROID_EXTERNAL_STORAGE_WRITE ? "writable" : + SDL_AndroidGetExternalStorageState() & + SDL_ANDROID_EXTERNAL_STORAGE_READ ? "readable" : "not available")); #endif #endif } @@ -6098,7 +6115,7 @@ void CloseAllAndExit(int exit_value) CloseVideoDisplay(); ClosePlatformDependentStuff(); - if (exit_value != 0) + if (exit_value != 0 && !options.execute_command) { /* fall back to default level set (current set may have caused an error) */ SaveLevelSetup_LastSeries_Deactivate();