(mode5 branch) Fix a bug in saving, including autosave every few minutes, that auto-selects the last layer to draw.

git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1743 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2011-03-02 22:07:24 +00:00
parent 9058926e4b
commit 55422d160e
4 changed files with 32 additions and 20 deletions

View File

@@ -436,7 +436,7 @@ void Pre_load(T_IO_Context *context, short width, short height, long file_size,
context->Nb_layers=1;
Main_current_layer=0;
Main_layers_visible=1<<0;
Set_layer(context,0);
Set_loading_layer(context,0);
// Remove previous comment, unless we load just a palette
if (! Get_fileformat(context->Format)->Palette_only)
@@ -1261,7 +1261,18 @@ void Init_context_surface(T_IO_Context * context, char *file_name, char *file_di
}
/// Function to call when need to switch layers.
void Set_layer(T_IO_Context *context, byte layer)
void Set_saving_layer(T_IO_Context *context, byte layer)
{
context->Current_layer = layer;
if (context->Type == CONTEXT_MAIN_IMAGE)
{
context->Target_address=Main_backups->Pages->Image[layer];
}
}
/// Function to call when need to switch layers.
void Set_loading_layer(T_IO_Context *context, byte layer)
{
context->Current_layer = layer;
@@ -1280,9 +1291,8 @@ void Set_layer(T_IO_Context *context, byte layer)
context->Nb_layers = Main_backups->Pages->Nb_layers;
Main_layers_visible = (2<<layer)-1;
}
context->Target_address=Main_backups->Pages->Image[layer];
Main_current_layer = layer;
context->Target_address=Main_backups->Pages->Image[layer];
}
}