};
+/* forward declaration for internal use */
+static int get_graphic_parameter_value(char *, char *, int);
+
+
void DrawInitAnim()
{
struct GraphicInfo *graphic_info_last = graphic_info;
int sync_frame = FrameCounter;
int x, y;
+ /* prevent OS (Windows) from complaining about program not responding */
+ CheckQuitEvent();
+
if (game_status != GAME_MODE_LOADING)
return;
int special = property_mapping[i].ext3_index;
int graphic = property_mapping[i].artwork_index;
- if (font_nr < 0)
+ if (font_nr < 0 || font_nr >= NUM_FONTS)
continue;
if (IS_SPECIAL_GFX_ARG(special))
special = GFX_SPECIAL_ARG_DEFAULT;
global_anim_info[anim_nr].graphic[part_nr][special] = graphic;
+
+ /* fix default value for ".draw_masked" (for backward compatibility) */
+ struct GraphicInfo *g = &graphic_info[graphic];
+ struct FileInfo *image = getImageListEntryFromImageID(graphic);
+ char **parameter_raw = image->parameter;
+ int p = GFX_ARG_DRAW_MASKED;
+ int draw_masked = get_graphic_parameter_value(parameter_raw[p],
+ image_config_suffix[p].token,
+ image_config_suffix[p].type);
+
+ /* if ".draw_masked" parameter is undefined, use default value "TRUE" */
+ if (draw_masked == ARG_UNDEFINED_VALUE)
+ g->draw_masked = TRUE;
}
#if 0
g->post_delay_random = 0;
g->init_event = ANIM_EVENT_DEFAULT;
g->anim_event = ANIM_EVENT_DEFAULT;
+ g->draw_masked = FALSE;
g->draw_order = 0;
g->fade_mode = FADE_MODE_DEFAULT;
g->fade_delay = -1;
g->draw_xoffset = parameter[GFX_ARG_DRAW_XOFFSET];
g->draw_yoffset = parameter[GFX_ARG_DRAW_YOFFSET];
- /* this is only used for drawing envelope graphics */
- g->draw_masked = parameter[GFX_ARG_DRAW_MASKED];
+ /* use a different default value for global animations and toons */
+ if ((graphic >= IMG_GFX_GLOBAL_ANIM_1 && graphic <= IMG_GFX_GLOBAL_ANIM_8) ||
+ (graphic >= IMG_TOON_1 && graphic <= IMG_TOON_20))
+ g->draw_masked = TRUE;
+
+ /* this is used for drawing envelopes, global animations and toons */
+ if (parameter[GFX_ARG_DRAW_MASKED] != ARG_UNDEFINED_VALUE)
+ g->draw_masked = parameter[GFX_ARG_DRAW_MASKED];
/* used for toon animations and global animations */
if (parameter[GFX_ARG_DRAW_ORDER] != ARG_UNDEFINED_VALUE)
for (i = 0; i < num_images; i++)
{
- Bitmap *src_bitmap;
+ Bitmap *src_bitmap = graphic_info[i].bitmap;
int src_x, src_y;
int width, height;
- int first_frame, last_frame;
+ int last_frame;
int src_bitmap_width, src_bitmap_height;
/* now check if no animation frames are outside of the loaded image */
/* check if first animation frame is inside specified bitmap */
- first_frame = 0;
- getFixedGraphicSource(i, first_frame, &src_bitmap, &src_x, &src_y);
-
+ /* do not use getGraphicSourceXY() here to get position of first frame; */
/* this avoids calculating wrong start position for out-of-bounds frame */
src_x = graphic_info[i].src_x;
src_y = graphic_info[i].src_y;
Error(ERR_INFO_LINE, "-");
graphic_info[i] = graphic_info[fallback_graphic];
+
+ /* if first frame out of bounds, do not check last frame anymore */
+ continue;
}
/* check if last animation frame is inside specified bitmap */
last_frame = graphic_info[i].anim_frames - 1;
- getFixedGraphicSource(i, last_frame, &src_bitmap, &src_x, &src_y);
+ getGraphicSourceXY(i, last_frame, &src_x, &src_y, FALSE);
if (src_x < 0 || src_y < 0 ||
src_x + width > src_bitmap_width ||
EL_INTERNAL_CASCADE_SP_ACTIVE,
EL_INTERNAL_CASCADE_DC_ACTIVE,
EL_INTERNAL_CASCADE_DX_ACTIVE,
+ EL_INTERNAL_CASCADE_MM_ACTIVE,
+ EL_INTERNAL_CASCADE_DF_ACTIVE,
EL_INTERNAL_CASCADE_CHARS_ACTIVE,
EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE,
EL_INTERNAL_CASCADE_CE_ACTIVE,
EL_INTERNAL_CASCADE_SP,
EL_INTERNAL_CASCADE_DC,
EL_INTERNAL_CASCADE_DX,
+ EL_INTERNAL_CASCADE_MM,
+ EL_INTERNAL_CASCADE_DF,
EL_INTERNAL_CASCADE_CHARS,
EL_INTERNAL_CASCADE_STEEL_CHARS,
EL_INTERNAL_CASCADE_CE,
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++)
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;
if (setup.options.verbose)
options.verbose = TRUE;
+
+ if (setup.debug.show_frames_per_second)
+ global.show_frames_per_second = TRUE;
}
static void InitGameInfo()
em_open_all();
sp_open_all();
+ mm_open_all();
if (global.autoplay_leveldir)
{
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
}
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();