merge Upload_infos_page_main() / Upload_infos_page_spare() => Upload_infos_page()
This commit is contained in:
		
							parent
							
								
									297b653304
								
							
						
					
					
						commit
						92620bb4ba
					
				@ -3301,7 +3301,7 @@ void Button_Load(void)
 | 
			
		||||
{
 | 
			
		||||
  // On sauve l'état actuel des paramètres de l'image pour pouvoir les
 | 
			
		||||
  // restituer en cas d'erreur n'affectant pas l'image
 | 
			
		||||
  Upload_infos_page_main(Main.backups->Pages);
 | 
			
		||||
  Upload_infos_page(&Main);
 | 
			
		||||
 | 
			
		||||
  Load_picture(1);
 | 
			
		||||
  Tilemap_update();
 | 
			
		||||
@ -3315,7 +3315,7 @@ void Button_Reload(void)
 | 
			
		||||
 | 
			
		||||
  // On sauve l'état actuel des paramètres de l'image pour pouvoir les
 | 
			
		||||
  // restituer en cas d'erreur n'affectant pas l'image
 | 
			
		||||
  Upload_infos_page_main(Main.backups->Pages);
 | 
			
		||||
  Upload_infos_page(&Main);
 | 
			
		||||
 | 
			
		||||
  if ( (!Main.image_is_modified) || Confirmation_box("Discard unsaved changes ?") )
 | 
			
		||||
  {
 | 
			
		||||
 | 
			
		||||
@ -685,7 +685,7 @@ void Main_handler(void)
 | 
			
		||||
        char* flimit;
 | 
			
		||||
        byte old_cursor_shape;
 | 
			
		||||
 | 
			
		||||
        Upload_infos_page_main(Main.backups->Pages);
 | 
			
		||||
        Upload_infos_page(&Main);
 | 
			
		||||
  
 | 
			
		||||
        flimit = Find_last_separator(Drop_file_name);
 | 
			
		||||
        *(flimit++) = '\0';
 | 
			
		||||
 | 
			
		||||
@ -532,7 +532,7 @@ void Resize_image(word chosen_width,word chosen_height)
 | 
			
		||||
  // |B| |    C   = Nouvelle image
 | 
			
		||||
  // +-+-+
 | 
			
		||||
 | 
			
		||||
  Upload_infos_page_main(Main.backups->Pages);
 | 
			
		||||
  Upload_infos_page(&Main);
 | 
			
		||||
  if (Backup_with_new_dimensions(chosen_width,chosen_height))
 | 
			
		||||
  {
 | 
			
		||||
    // La nouvelle page a pu être allouée, elle est pour l'instant pleine de
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										39
									
								
								src/pages.c
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								src/pages.c
									
									
									
									
									
								
							@ -392,21 +392,18 @@ void Redraw_current_layer(void)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TODO : Upload_infos_page_main/Upload_infos_page_spare => Upload_infos_page()
 | 
			
		||||
void Upload_infos_page_main(T_Page * page)
 | 
			
		||||
void Upload_infos_page(T_Document * doc)
 | 
			
		||||
// Sauve l'écran courant dans la page
 | 
			
		||||
{
 | 
			
		||||
  if (page!=NULL)
 | 
			
		||||
  if (doc->backups->Pages != NULL)
 | 
			
		||||
  {
 | 
			
		||||
    //page->Image[Main.current_layer].Pixels=Main_screen;
 | 
			
		||||
    page->Width=Main.image_width;
 | 
			
		||||
    page->Height=Main.image_height;
 | 
			
		||||
    memcpy(page->Palette,Main.palette,sizeof(T_Palette));
 | 
			
		||||
    page->File_format=Main.fileformat;
 | 
			
		||||
    doc->backups->Pages->Width = doc->image_width;
 | 
			
		||||
    doc->backups->Pages->Height = doc->image_height;
 | 
			
		||||
    memcpy(doc->backups->Pages->Palette, doc->palette, sizeof(T_Palette));
 | 
			
		||||
    doc->backups->Pages->File_format = doc->fileformat;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TODO : Download_infos_page_main/Download_infos_page_spare => Download_infos_page()
 | 
			
		||||
void Download_infos_page_spare(T_Page * page)
 | 
			
		||||
{
 | 
			
		||||
  if (page!=NULL)
 | 
			
		||||
@ -418,18 +415,6 @@ void Download_infos_page_spare(T_Page * page)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Upload_infos_page_spare(T_Page * page)
 | 
			
		||||
{
 | 
			
		||||
  if (page!=NULL)
 | 
			
		||||
  {
 | 
			
		||||
    //page->Image[Spare.current_layer].Pixels=Spare_screen;
 | 
			
		||||
    page->Width=Spare.image_width;
 | 
			
		||||
    page->Height=Spare.image_height;
 | 
			
		||||
    memcpy(page->Palette,Spare.palette,sizeof(T_Palette));
 | 
			
		||||
    page->File_format=Spare.fileformat;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
byte * FX_feedback_screen;
 | 
			
		||||
 | 
			
		||||
void Update_FX_feedback(byte with_feedback)
 | 
			
		||||
@ -783,7 +768,7 @@ int Init_all_backup_lists(enum IMAGE_MODES image_mode, int width, int height)
 | 
			
		||||
  // celle demandée par l'utilisateur.
 | 
			
		||||
 | 
			
		||||
  // On crée un descripteur de page correspondant à la page principale
 | 
			
		||||
  Upload_infos_page_main(Main.backups->Pages);
 | 
			
		||||
  Upload_infos_page(&Main);
 | 
			
		||||
  // On y met les infos sur la dimension de démarrage
 | 
			
		||||
  Main.backups->Pages->Width=width;
 | 
			
		||||
  Main.backups->Pages->Height=height;
 | 
			
		||||
@ -1105,7 +1090,7 @@ void Backup_layers(int layer)
 | 
			
		||||
 | 
			
		||||
  // On remet à jour l'état des infos de la page courante (pour pouvoir les
 | 
			
		||||
  // retrouver plus tard)
 | 
			
		||||
  Upload_infos_page_main(Main.backups->Pages);
 | 
			
		||||
  Upload_infos_page(&Main);
 | 
			
		||||
 | 
			
		||||
  // Create a fresh Page descriptor
 | 
			
		||||
  new_page=New_page(Main.backups->Pages->Nb_layers);
 | 
			
		||||
@ -1218,7 +1203,7 @@ void Undo(void)
 | 
			
		||||
 | 
			
		||||
  // On remet à jour l'état des infos de la page courante (pour pouvoir les
 | 
			
		||||
  // retrouver plus tard)
 | 
			
		||||
  Upload_infos_page_main(Main.backups->Pages);
 | 
			
		||||
  Upload_infos_page(&Main);
 | 
			
		||||
  // On fait faire un undo à la liste des backups de la page principale
 | 
			
		||||
  Backward_in_list_of_pages(Main.backups);
 | 
			
		||||
 | 
			
		||||
@ -1251,7 +1236,7 @@ void Redo(void)
 | 
			
		||||
  }
 | 
			
		||||
  // On remet à jour l'état des infos de la page courante (pour pouvoir les
 | 
			
		||||
  // retrouver plus tard)
 | 
			
		||||
  Upload_infos_page_main(Main.backups->Pages);
 | 
			
		||||
  Upload_infos_page(&Main);
 | 
			
		||||
  // On fait faire un redo à la liste des backups de la page principale
 | 
			
		||||
  Advance_in_list_of_pages(Main.backups);
 | 
			
		||||
 | 
			
		||||
@ -1297,8 +1282,8 @@ void Exchange_main_and_spare(void)
 | 
			
		||||
  // On commence par mettre à jour dans les descripteurs les infos sur les
 | 
			
		||||
  // pages qu'on s'apprête à échanger, pour qu'on se retrouve pas avec de
 | 
			
		||||
  // vieilles valeurs qui datent de mathuzalem.
 | 
			
		||||
  Upload_infos_page_main(Main.backups->Pages);
 | 
			
		||||
  Upload_infos_page_spare(Spare.backups->Pages);
 | 
			
		||||
  Upload_infos_page(&Main);
 | 
			
		||||
  Upload_infos_page(&Spare);
 | 
			
		||||
 | 
			
		||||
  // On inverse les listes de pages
 | 
			
		||||
//TODO
 | 
			
		||||
 | 
			
		||||
@ -54,7 +54,6 @@ extern T_Bitmap Main_visible_image_depth_buffer;
 | 
			
		||||
///
 | 
			
		||||
 | 
			
		||||
void Download_infos_page_main(T_Page * page);
 | 
			
		||||
void Upload_infos_page_main(T_Page * page);
 | 
			
		||||
/// Add a new layer to latest page of a list. Returns 0 on success.
 | 
			
		||||
byte Add_layer(T_List_of_pages *list, int layer);
 | 
			
		||||
/// Delete a layer from the latest page of a list. Returns 0 on success.
 | 
			
		||||
@ -64,10 +63,11 @@ byte Merge_layer();
 | 
			
		||||
/// Backs up a layer, unless it's already different from previous history step.
 | 
			
		||||
int Dup_layer_if_shared(T_Page * page, int layer);
 | 
			
		||||
 | 
			
		||||
void Upload_infos_page(T_Document * doc);
 | 
			
		||||
 | 
			
		||||
// private
 | 
			
		||||
T_Page * New_page(int nb_layers);
 | 
			
		||||
void Download_infos_page_spare(T_Page * page);
 | 
			
		||||
void Upload_infos_page_spare(T_Page * page);
 | 
			
		||||
void Clear_page(T_Page * page);
 | 
			
		||||
void Copy_S_page(T_Page * dest,T_Page * source);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -371,7 +371,7 @@ void Button_Transform_menu(void)
 | 
			
		||||
    old_width=Main.image_width;
 | 
			
		||||
    old_height=Main.image_height;
 | 
			
		||||
    
 | 
			
		||||
    Upload_infos_page_main(Main.backups->Pages);
 | 
			
		||||
    Upload_infos_page(&Main);
 | 
			
		||||
    // Allocate a new page
 | 
			
		||||
    if (Backup_with_new_dimensions(new_width,new_height))
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user