add function Get_image_mode()

just as there is Set_image_mode()
This commit is contained in:
Thomas Bernard 2019-11-29 01:03:45 +01:00
parent f8c06cd575
commit 4fa256398c
4 changed files with 13 additions and 1 deletions

View File

@ -360,6 +360,11 @@ void Set_image_mode(T_IO_Context *context, enum IMAGE_MODES mode)
} }
} }
enum IMAGE_MODES Get_image_mode(T_IO_Context *context)
{
return Main.backups->Pages->Image_mode;
}
/// ///
/// Generic allocation and similar stuff, done at beginning of image load, /// Generic allocation and similar stuff, done at beginning of image load,
/// as soon as size is known. /// as soon as size is known.

View File

@ -229,6 +229,8 @@ void Set_frame_duration(T_IO_Context *context, int duration);
int Get_frame_duration(T_IO_Context *context); int Get_frame_duration(T_IO_Context *context);
/// Function to set a specific image mode /// Function to set a specific image mode
void Set_image_mode(T_IO_Context *context, enum IMAGE_MODES mode); void Set_image_mode(T_IO_Context *context, enum IMAGE_MODES mode);
/// get the current image mode
enum IMAGE_MODES Get_image_mode(T_IO_Context *context);
// ================================================================= // =================================================================
// What follows here are the definitions of functions and data // What follows here are the definitions of functions and data

View File

@ -5768,7 +5768,7 @@ void Load_FLI(T_IO_Context * context)
else else
{ {
Set_loading_layer(context, current_frame); Set_loading_layer(context, current_frame);
if (context->Type == CONTEXT_MAIN_IMAGE && Main.backups->Pages->Image_mode == IMAGE_MODE_ANIMATION) if (context->Type == CONTEXT_MAIN_IMAGE && Get_image_mode(context) == IMAGE_MODE_ANIMATION)
{ {
// Copy the content of previous frame // Copy the content of previous frame
memcpy( memcpy(

View File

@ -84,6 +84,11 @@ void Set_image_mode(T_IO_Context *context, enum IMAGE_MODES mode)
printf("Set_image_mode(%p, %d)\n", context, mode); printf("Set_image_mode(%p, %d)\n", context, mode);
} }
enum IMAGE_MODES Get_image_mode(T_IO_Context *context)
{
return -1;
}
void Set_frame_duration(T_IO_Context *context, int duration) void Set_frame_duration(T_IO_Context *context, int duration)
{ {
printf("Set_frame_duration(%p, %d)\n", context, duration); printf("Set_frame_duration(%p, %d)\n", context, duration);