Fix issue 320: Image corruption when running a Lua script after loading 24bit image
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1366 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
		
							parent
							
								
									c26b09a3d3
								
							
						
					
					
						commit
						827ad2da1c
					
				
							
								
								
									
										10
									
								
								buttons.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								buttons.c
									
									
									
									
									
								
							@ -653,8 +653,8 @@ void Button_Clear(void)
 | 
			
		||||
  else
 | 
			
		||||
    Clear_current_image(Main_backups->Pages->Transparent_color);
 | 
			
		||||
  Redraw_layered_image();
 | 
			
		||||
  Display_all_screen();
 | 
			
		||||
  End_of_modification();
 | 
			
		||||
  Display_all_screen();
 | 
			
		||||
  Unselect_button(BUTTON_CLEAR);
 | 
			
		||||
  Display_cursor();
 | 
			
		||||
}
 | 
			
		||||
@ -668,8 +668,8 @@ void Button_Clear_with_backcolor(void)
 | 
			
		||||
  else
 | 
			
		||||
    Clear_current_image(Back_color);
 | 
			
		||||
  Redraw_layered_image();
 | 
			
		||||
  Display_all_screen();
 | 
			
		||||
  End_of_modification();
 | 
			
		||||
  Display_all_screen();
 | 
			
		||||
  Unselect_button(BUTTON_CLEAR);
 | 
			
		||||
  Display_cursor();
 | 
			
		||||
}
 | 
			
		||||
@ -2747,8 +2747,6 @@ void Load_picture(byte image)
 | 
			
		||||
    {
 | 
			
		||||
      if (image)
 | 
			
		||||
      {
 | 
			
		||||
        End_of_modification();
 | 
			
		||||
        
 | 
			
		||||
        if (Main_magnifier_mode)
 | 
			
		||||
        {
 | 
			
		||||
          Draw_menu_button_frame(BUTTON_MAGNIFIER,0);
 | 
			
		||||
@ -2791,6 +2789,7 @@ void Load_picture(byte image)
 | 
			
		||||
 | 
			
		||||
      Compute_optimal_menu_colors(Main_palette);
 | 
			
		||||
      Redraw_layered_image();
 | 
			
		||||
      End_of_modification();
 | 
			
		||||
      Display_all_screen();
 | 
			
		||||
 | 
			
		||||
      if (image)
 | 
			
		||||
@ -2851,8 +2850,6 @@ void Button_Reload(void)
 | 
			
		||||
 | 
			
		||||
    if (File_error!=1)
 | 
			
		||||
    {
 | 
			
		||||
      End_of_modification();
 | 
			
		||||
      
 | 
			
		||||
      if (Main_magnifier_mode)
 | 
			
		||||
      {
 | 
			
		||||
        Draw_menu_button_frame(BUTTON_MAGNIFIER,0);
 | 
			
		||||
@ -2893,6 +2890,7 @@ void Button_Reload(void)
 | 
			
		||||
        Compute_paintbrush_coordinates();
 | 
			
		||||
      }
 | 
			
		||||
      Redraw_layered_image();
 | 
			
		||||
      End_of_modification();
 | 
			
		||||
      Display_all_screen();
 | 
			
		||||
 | 
			
		||||
      Main_image_is_modified=0;
 | 
			
		||||
 | 
			
		||||
@ -1329,7 +1329,6 @@ int Check_recovery(void)
 | 
			
		||||
    Main_offset_Y=0;
 | 
			
		||||
    Compute_limits();
 | 
			
		||||
    Compute_paintbrush_coordinates();
 | 
			
		||||
    Redraw_layered_image();
 | 
			
		||||
    if (Backups_main)
 | 
			
		||||
      Button_Page();
 | 
			
		||||
  }
 | 
			
		||||
@ -1341,7 +1340,6 @@ int Check_recovery(void)
 | 
			
		||||
    Main_offset_Y=0;
 | 
			
		||||
    Compute_limits();
 | 
			
		||||
    Compute_paintbrush_coordinates();
 | 
			
		||||
    Redraw_layered_image();
 | 
			
		||||
  }
 | 
			
		||||
  return restored_main + restored_spare;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										4
									
								
								main.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								main.c
									
									
									
									
									
								
							@ -811,8 +811,8 @@ int Init_program(int argc,char * argv[])
 | 
			
		||||
          Init_context_layered_image(&context, spare_filename, spare_directory);
 | 
			
		||||
          Load_image(&context);
 | 
			
		||||
          Destroy_context(&context);
 | 
			
		||||
          End_of_modification();
 | 
			
		||||
          Redraw_layered_image();
 | 
			
		||||
          End_of_modification();
 | 
			
		||||
  
 | 
			
		||||
          Button_Page();
 | 
			
		||||
          // no break ! proceed with the other file now
 | 
			
		||||
@ -820,8 +820,8 @@ int Init_program(int argc,char * argv[])
 | 
			
		||||
          Init_context_layered_image(&context, main_filename, main_directory);
 | 
			
		||||
          Load_image(&context);
 | 
			
		||||
          Destroy_context(&context);
 | 
			
		||||
          End_of_modification();
 | 
			
		||||
          Redraw_layered_image();
 | 
			
		||||
          End_of_modification();
 | 
			
		||||
          
 | 
			
		||||
          Hide_cursor();
 | 
			
		||||
          Compute_optimal_menu_colors(Main_palette);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user