[layers] Merged changes from trunk (up-to-date now)
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1132 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
		
						commit
						ad4b417afb
					
				@ -1123,6 +1123,8 @@ void Button_Skins(void)
 | 
			
		||||
  do
 | 
			
		||||
  {
 | 
			
		||||
    clicked_button=Window_clicked_button();
 | 
			
		||||
    if (Is_shortcut(Key,0x100+BUTTON_HELP))
 | 
			
		||||
      Window_help(BUTTON_SETTINGS, "SKINS");
 | 
			
		||||
 | 
			
		||||
    switch(clicked_button)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										5
									
								
								global.h
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								global.h
									
									
									
									
									
								
							@ -112,11 +112,6 @@ GFX2_GLOBAL dword Key_ANSI;
 | 
			
		||||
/// Boolean set to true when the OS/window manager requests the application to close. ie: [X] button
 | 
			
		||||
GFX2_GLOBAL byte Quit_is_required;
 | 
			
		||||
 | 
			
		||||
/// Divisor for the mouse coordinates recieved. No target currently needs it, should be left at 1.
 | 
			
		||||
GFX2_GLOBAL byte Mouse_fix_factor_X;
 | 
			
		||||
/// Divisor for the mouse coordinates recieved. No target currently needs it, should be left at 1.
 | 
			
		||||
GFX2_GLOBAL byte Mouse_fix_factor_Y;
 | 
			
		||||
 | 
			
		||||
///
 | 
			
		||||
/// This boolean is true when the current operation allows changing the
 | 
			
		||||
/// foreground or background color.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										24
									
								
								helpfile.h
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								helpfile.h
									
									
									
									
									
								
							@ -2065,11 +2065,6 @@ static const T_Help_table helptable_settings[] =
 | 
			
		||||
  HELP_TEXT ("some particular files or directories must be")
 | 
			
		||||
  HELP_TEXT ("displayed by the fileselectors or not.")
 | 
			
		||||
  HELP_TEXT ("")
 | 
			
		||||
  HELP_TEXT ("- Show/Hide picture limits: Indicates if the")
 | 
			
		||||
  HELP_TEXT ("picture boundaries must be displayed when")
 | 
			
		||||
  HELP_TEXT ("you are in a resolution bigger than the")
 | 
			
		||||
  HELP_TEXT ("picture.")
 | 
			
		||||
  HELP_TEXT ("")
 | 
			
		||||
  HELP_TEXT ("- Clear palette: Indicates if loading a file")
 | 
			
		||||
  HELP_TEXT ("with a palette of less than 256 colors must")
 | 
			
		||||
  HELP_TEXT ("erase the rest of the current palette")
 | 
			
		||||
@ -2117,9 +2112,6 @@ static const T_Help_table helptable_settings[] =
 | 
			
		||||
  HELP_TEXT ("placing the handle in the center of the")
 | 
			
		||||
  HELP_TEXT ("brush.")
 | 
			
		||||
  HELP_TEXT ("")
 | 
			
		||||
  HELP_TEXT ("- Separate colors: Draws a squaring around")
 | 
			
		||||
  HELP_TEXT ("the colors of the tool-bar.")
 | 
			
		||||
  HELP_TEXT ("")
 | 
			
		||||
  HELP_TEXT ("- Auto-set resolution: sets the best")
 | 
			
		||||
  HELP_TEXT ("resolution for the loaded image.")
 | 
			
		||||
  HELP_TEXT ("")
 | 
			
		||||
@ -2151,9 +2143,10 @@ static const T_Help_table helptable_settings[] =
 | 
			
		||||
  HELP_TEXT ("GrafX2 with a classical font, or another one")
 | 
			
		||||
  HELP_TEXT ("a bit funnier.")
 | 
			
		||||
  HELP_TEXT ("")
 | 
			
		||||
  HELP_TEXT ("- Cursor: allows you to choose whether you")
 | 
			
		||||
  HELP_TEXT ("prefer a solid cursor or a transparent")
 | 
			
		||||
  HELP_TEXT ("cursor.")
 | 
			
		||||
  HELP_TEXT ("- Cursor: Allows you to choose the graphic")
 | 
			
		||||
  HELP_TEXT ("mouse cursor: Solid and Thin are solid black")
 | 
			
		||||
  HELP_TEXT ("and white cursors defined by the skin file,")
 | 
			
		||||
  HELP_TEXT (" Transparent is a 1-pixel wide XOR cross.")
 | 
			
		||||
  HELP_TEXT ("")
 | 
			
		||||
  HELP_TEXT ("- Graphic file: you can change the whole")
 | 
			
		||||
  HELP_TEXT ("interface by selecting where the sprites for")
 | 
			
		||||
@ -2165,6 +2158,15 @@ static const T_Help_table helptable_settings[] =
 | 
			
		||||
  HELP_TEXT ("days of Sunset Design. If you create a good")
 | 
			
		||||
  HELP_TEXT ("skin, feel free to share it with us! We may")
 | 
			
		||||
  HELP_TEXT ("include it in a future release...")
 | 
			
		||||
  HELP_TEXT ("")
 | 
			
		||||
  HELP_TEXT ("- Separate colors: Draws a squaring around")
 | 
			
		||||
  HELP_TEXT ("the colors of the tool-bar.")
 | 
			
		||||
  HELP_TEXT ("")
 | 
			
		||||
  HELP_TEXT ("- Show/Hide picture limits: Indicates if the")
 | 
			
		||||
  HELP_TEXT ("picture boundaries must be displayed when")
 | 
			
		||||
  HELP_TEXT ("you are in a resolution bigger than the")
 | 
			
		||||
  HELP_TEXT ("picture.")
 | 
			
		||||
  HELP_TEXT ("")
 | 
			
		||||
};
 | 
			
		||||
static const T_Help_table helptable_clear[] =
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										60
									
								
								main.c
									
									
									
									
									
								
							
							
						
						
									
										60
									
								
								main.c
									
									
									
									
									
								
							@ -170,18 +170,18 @@ void Error_function(int error_code, const char *filename, int line_number, const
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// --------------------- Analyse de la ligne de commande ---------------------
 | 
			
		||||
void Analyze_command_line(int argc,char * argv[])
 | 
			
		||||
void Analyze_command_line(int argc, char * argv[])
 | 
			
		||||
{
 | 
			
		||||
  char *buffer ;
 | 
			
		||||
  int index;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  File_in_command_line=0;
 | 
			
		||||
  Resolution_in_command_line=0;
 | 
			
		||||
  File_in_command_line = 0;
 | 
			
		||||
  Resolution_in_command_line = 0;
 | 
			
		||||
  
 | 
			
		||||
  Current_resolution=Config.Default_resolution;
 | 
			
		||||
  Current_resolution = Config.Default_resolution;
 | 
			
		||||
  
 | 
			
		||||
  for (index=1; index<argc; index++)
 | 
			
		||||
  for (index = 1; index<argc; index++)
 | 
			
		||||
  {
 | 
			
		||||
    if ( !strcmp(argv[index],"/?") ||
 | 
			
		||||
         !strcmp(argv[index],"/h") ||
 | 
			
		||||
@ -198,7 +198,7 @@ void Analyze_command_line(int argc,char * argv[])
 | 
			
		||||
      if (index<argc)
 | 
			
		||||
      {    
 | 
			
		||||
        Resolution_in_command_line = 1;
 | 
			
		||||
        Current_resolution=Convert_videomode_arg(argv[index]);
 | 
			
		||||
        Current_resolution = Convert_videomode_arg(argv[index]);
 | 
			
		||||
        if (Current_resolution == -1)
 | 
			
		||||
        {
 | 
			
		||||
          Error(ERROR_COMMAND_LINE);
 | 
			
		||||
@ -287,24 +287,31 @@ void Analyze_command_line(int argc,char * argv[])
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
      // Si ce n'est pas un paramètre, c'est le nom du fichier à ouvrir
 | 
			
		||||
      if (File_in_command_line)
 | 
			
		||||
      if (File_in_command_line > 1)
 | 
			
		||||
      {
 | 
			
		||||
        // plusieurs noms de fichier en argument
 | 
			
		||||
        // Il y a déjà 2 noms de fichiers et on vient d'en trouver un 3ème
 | 
			
		||||
        Error(ERROR_COMMAND_LINE);
 | 
			
		||||
        Display_syntax();
 | 
			
		||||
        exit(0);
 | 
			
		||||
      }
 | 
			
		||||
      else if (File_exists(argv[index]))
 | 
			
		||||
      {
 | 
			
		||||
        File_in_command_line=1;
 | 
			
		||||
		File_in_command_line ++;
 | 
			
		||||
		buffer = Realpath(argv[index], NULL);
 | 
			
		||||
 | 
			
		||||
        // On récupère le chemin complet du paramètre
 | 
			
		||||
        // Et on découpe ce chemin en répertoire(path) + fichier(.ext)
 | 
			
		||||
        buffer=Realpath(argv[index],NULL);
 | 
			
		||||
		if (File_in_command_line == 1)
 | 
			
		||||
		{
 | 
			
		||||
			// Separate path from filename
 | 
			
		||||
        Extract_path(Main_file_directory, buffer);
 | 
			
		||||
        Extract_filename(Main_filename, buffer);
 | 
			
		||||
			DEBUG(Main_filename, 0);
 | 
			
		||||
			free(buffer);
 | 
			
		||||
		} else {
 | 
			
		||||
			Extract_path(Spare_file_directory, buffer);
 | 
			
		||||
			Extract_filename(Spare_filename, buffer);
 | 
			
		||||
			DEBUG(Spare_filename, 1);
 | 
			
		||||
        free(buffer);
 | 
			
		||||
        chdir(Main_file_directory);
 | 
			
		||||
		}
 | 
			
		||||
      }
 | 
			
		||||
      else
 | 
			
		||||
      {
 | 
			
		||||
@ -551,7 +558,7 @@ int Init_program(int argc,char * argv[])
 | 
			
		||||
  if (temp)
 | 
			
		||||
    Error(temp);
 | 
			
		||||
 | 
			
		||||
  Analyze_command_line(argc,argv);
 | 
			
		||||
  Analyze_command_line(argc, argv);
 | 
			
		||||
 | 
			
		||||
  Current_help_section=0;
 | 
			
		||||
  Help_position=0;
 | 
			
		||||
@ -645,6 +652,18 @@ int Init_program(int argc,char * argv[])
 | 
			
		||||
  // Allocation de mémoire pour les différents écrans virtuels (et brosse)
 | 
			
		||||
  if (Init_all_backup_lists(Screen_width,Screen_height)==0)
 | 
			
		||||
    Error(ERROR_MEMORY);
 | 
			
		||||
  // On remet le nom par défaut pour la page de brouillon car il été modifié
 | 
			
		||||
  // par le passage d'un fichier en paramètre lors du traitement précédent.
 | 
			
		||||
  // Note: le fait que l'on ne modifie que les variables globales 
 | 
			
		||||
  // Brouillon_* et pas les infos contenues dans la page de brouillon 
 | 
			
		||||
  // elle-même ne m'inspire pas confiance mais ça a l'air de marcher sans 
 | 
			
		||||
  // poser de problèmes, alors...
 | 
			
		||||
  if (File_in_command_line == 1)
 | 
			
		||||
  {
 | 
			
		||||
    strcpy(Spare_file_directory,Spare_current_directory);
 | 
			
		||||
    strcpy(Spare_filename,"NO_NAME.GIF");
 | 
			
		||||
    Spare_fileformat=DEFAULT_FILEFORMAT;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // Nettoyage de l'écran virtuel (les autres recevront celui-ci par copie)
 | 
			
		||||
  memset(Main_screen,0,Main_image_width*Main_image_height);
 | 
			
		||||
@ -797,10 +816,19 @@ int main(int argc,char * argv[])
 | 
			
		||||
    if (Config.Opening_message && (!File_in_command_line))
 | 
			
		||||
      Button_Message_initial();
 | 
			
		||||
  
 | 
			
		||||
    if (File_in_command_line)
 | 
			
		||||
    switch (File_in_command_line)
 | 
			
		||||
    {
 | 
			
		||||
		case 2:
 | 
			
		||||
      Button_Reload();
 | 
			
		||||
      Resolution_in_command_line=0;
 | 
			
		||||
			DEBUG(Main_filename, 0);
 | 
			
		||||
			DEBUG(Spare_filename, 0);
 | 
			
		||||
			Button_Page();
 | 
			
		||||
			// no break ! proceed with the other file now
 | 
			
		||||
		case 1:
 | 
			
		||||
			Button_Reload();
 | 
			
		||||
			Resolution_in_command_line = 0;
 | 
			
		||||
		default:
 | 
			
		||||
			break;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  Main_handler();
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										222
									
								
								palette.c
									
									
									
									
									
								
							
							
						
						
									
										222
									
								
								palette.c
									
									
									
									
									
								
							@ -801,46 +801,46 @@ void Button_Palette(void)
 | 
			
		||||
 | 
			
		||||
  // Graduation des jauges de couleur
 | 
			
		||||
  Block(Window_pos_X + (Menu_factor_X * 179),
 | 
			
		||||
	Window_pos_Y + (Menu_factor_Y * 109), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
	MC_Dark);
 | 
			
		||||
    Window_pos_Y + (Menu_factor_Y * 109), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
    MC_Dark);
 | 
			
		||||
  Block(Window_pos_X + (Menu_factor_X * 206),
 | 
			
		||||
	Window_pos_Y + (Menu_factor_Y * 109), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
	MC_Dark);
 | 
			
		||||
    Window_pos_Y + (Menu_factor_Y * 109), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
    MC_Dark);
 | 
			
		||||
  Block(Window_pos_X + (Menu_factor_X * 233),
 | 
			
		||||
	Window_pos_Y + (Menu_factor_Y * 109), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
	MC_Dark);
 | 
			
		||||
    Window_pos_Y + (Menu_factor_Y * 109), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
    MC_Dark);
 | 
			
		||||
  Block(Window_pos_X + (Menu_factor_X * 179),
 | 
			
		||||
	Window_pos_Y + (Menu_factor_Y * 125), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
	MC_Dark);
 | 
			
		||||
    Window_pos_Y + (Menu_factor_Y * 125), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
    MC_Dark);
 | 
			
		||||
  Block(Window_pos_X + (Menu_factor_X * 206),
 | 
			
		||||
	Window_pos_Y + (Menu_factor_Y * 125), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
	MC_Dark);
 | 
			
		||||
    Window_pos_Y + (Menu_factor_Y * 125), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
    MC_Dark);
 | 
			
		||||
  Block(Window_pos_X + (Menu_factor_X * 233),
 | 
			
		||||
	Window_pos_Y + (Menu_factor_Y * 125), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
	MC_Dark);
 | 
			
		||||
    Window_pos_Y + (Menu_factor_Y * 125), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
    MC_Dark);
 | 
			
		||||
  Block(Window_pos_X + (Menu_factor_X * 179),
 | 
			
		||||
	Window_pos_Y + (Menu_factor_Y * 141), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
	MC_Dark);
 | 
			
		||||
    Window_pos_Y + (Menu_factor_Y * 141), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
    MC_Dark);
 | 
			
		||||
  Block(Window_pos_X + (Menu_factor_X * 206),
 | 
			
		||||
	Window_pos_Y + (Menu_factor_Y * 141), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
	MC_Dark);
 | 
			
		||||
    Window_pos_Y + (Menu_factor_Y * 141), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
    MC_Dark);
 | 
			
		||||
  Block(Window_pos_X + (Menu_factor_X * 233),
 | 
			
		||||
	Window_pos_Y + (Menu_factor_Y * 141), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
	MC_Dark);
 | 
			
		||||
    Window_pos_Y + (Menu_factor_Y * 141), Menu_factor_X * 17, Menu_factor_Y,
 | 
			
		||||
    MC_Dark);
 | 
			
		||||
  // Jauges de couleur
 | 
			
		||||
  red_slider = Window_set_scroller_button(182, 81, 88,Color_count,1,Color_max-working_palette[Fore_color].R*Color_max/255);// 2
 | 
			
		||||
  green_slider = Window_set_scroller_button(209, 81, 88,Color_count,1,Color_max-working_palette[Fore_color].G*Color_max/255);// 3
 | 
			
		||||
  blue_slider = Window_set_scroller_button(236, 81, 88,Color_count,1,Color_max-working_palette[Fore_color].B*Color_max/255);// 4
 | 
			
		||||
 | 
			
		||||
  if(Palette_view_is_RGB==1) {
 | 
			
		||||
	  Print_in_window(184,71,"R",MC_Dark,MC_Light);
 | 
			
		||||
	  Print_in_window(211,71,"G",MC_Dark,MC_Light);
 | 
			
		||||
	  Print_in_window(238,71,"B",MC_Dark,MC_Light);
 | 
			
		||||
      Print_in_window(184,71,"R",MC_Dark,MC_Light);
 | 
			
		||||
      Print_in_window(211,71,"G",MC_Dark,MC_Light);
 | 
			
		||||
      Print_in_window(238,71,"B",MC_Dark,MC_Light);
 | 
			
		||||
      Componant_unit(RGB_scale);
 | 
			
		||||
  } else {
 | 
			
		||||
	  Print_in_window(184,71,"H",MC_Dark,MC_Light);
 | 
			
		||||
	  Print_in_window(211,71,"S",MC_Dark,MC_Light);
 | 
			
		||||
	  Print_in_window(238,71,"L",MC_Dark,MC_Light);
 | 
			
		||||
      Print_in_window(184,71,"H",MC_Dark,MC_Light);
 | 
			
		||||
      Print_in_window(211,71,"S",MC_Dark,MC_Light);
 | 
			
		||||
      Print_in_window(238,71,"L",MC_Dark,MC_Light);
 | 
			
		||||
      Componant_unit(256);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -866,7 +866,7 @@ void Button_Palette(void)
 | 
			
		||||
  Window_set_normal_button( 6,32,59,14,"Spread" ,4,1,SDLK_e);   // 10
 | 
			
		||||
 | 
			
		||||
  reduce_dropdown = Window_set_dropdown_button(222, 17, 60, 14, 60, "Reduce", 0,
 | 
			
		||||
	0, 1, 1); // 11
 | 
			
		||||
    0, 1, 1); // 11
 | 
			
		||||
  Window_dropdown_add_item(reduce_dropdown, 0, "to 128");
 | 
			
		||||
  Window_dropdown_add_item(reduce_dropdown, 1, "to 64");
 | 
			
		||||
  Window_dropdown_add_item(reduce_dropdown, 2, "to 32");
 | 
			
		||||
@ -893,27 +893,27 @@ void Button_Palette(void)
 | 
			
		||||
  Window_set_normal_button(96,32,29,14,"HSL"    ,1,1,SDLK_h);   // 22
 | 
			
		||||
  Window_set_normal_button(96,47,29,14,"Srt"    ,1,1,SDLK_s);   // 23
 | 
			
		||||
 | 
			
		||||
  if (Config.Auto_nb_used)
 | 
			
		||||
  {
 | 
			
		||||
	Update_color_count(&used_colors,color_usage);
 | 
			
		||||
 | 
			
		||||
	Num2str(color_usage[Fore_color], str, 6);
 | 
			
		||||
	Print_in_window(222, 33, str, MC_Black, MC_Light);
 | 
			
		||||
	Print_in_window(222, 42, "pixels", MC_Dark, MC_Light);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  // Dessin des petits effets spéciaux pour les boutons [+] et [-]
 | 
			
		||||
  Draw_thingumajig(263, 74,MC_White,-1);
 | 
			
		||||
  Draw_thingumajig(280, 74,MC_White,+1);
 | 
			
		||||
  Draw_thingumajig(263,165,MC_Dark,-1);
 | 
			
		||||
  Draw_thingumajig(280,165,MC_Dark,+1);
 | 
			
		||||
 | 
			
		||||
  Update_window_area(0,0,299,188);
 | 
			
		||||
 | 
			
		||||
  Display_cursor();
 | 
			
		||||
 | 
			
		||||
  if (Config.Auto_nb_used)
 | 
			
		||||
  {
 | 
			
		||||
    Update_color_count(&used_colors,color_usage);
 | 
			
		||||
    
 | 
			
		||||
    Hide_cursor();
 | 
			
		||||
    Print_in_window(222, 42, "pixels", MC_Dark, MC_Light);
 | 
			
		||||
    Num2str(color_usage[Fore_color], str, 6);
 | 
			
		||||
    Print_in_window(222, 33, str, MC_Black, MC_Light);
 | 
			
		||||
    Display_cursor();
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  Update_window_area(0,0,299,188);
 | 
			
		||||
  
 | 
			
		||||
  do
 | 
			
		||||
  {
 | 
			
		||||
    old_mouse_x=Mouse_X;
 | 
			
		||||
@ -962,8 +962,8 @@ void Button_Palette(void)
 | 
			
		||||
                Block(Window_pos_X+(Menu_factor_X*237),Window_pos_Y+(Menu_factor_Y*58),Menu_factor_X*56,Menu_factor_Y*7,MC_Light);
 | 
			
		||||
                Num2str(Fore_color,str,3);
 | 
			
		||||
                Print_in_window(237,58,str,MC_Black,MC_Light);
 | 
			
		||||
				Num2str(color_usage[Fore_color], str, 6);
 | 
			
		||||
				Print_in_window(222, 33, str, MC_Black, MC_Light);
 | 
			
		||||
                Num2str(color_usage[Fore_color], str, 6);
 | 
			
		||||
                Print_in_window(222, 33, str, MC_Black, MC_Light);
 | 
			
		||||
                Update_rect(Window_pos_X+(Menu_factor_X*237),Window_pos_Y+(Menu_factor_Y*58),Menu_factor_X*56,Menu_factor_Y*7);
 | 
			
		||||
 | 
			
		||||
                // Affichage des jauges
 | 
			
		||||
@ -994,13 +994,13 @@ void Button_Palette(void)
 | 
			
		||||
                  Num2str(block_end  ,str+4,3);
 | 
			
		||||
                  str[3]=26; // Flèche vers la droite
 | 
			
		||||
                  Print_in_window(237,58,str,MC_Black,MC_Light);
 | 
			
		||||
				  {
 | 
			
		||||
					int pixel_count = 0;
 | 
			
		||||
				  	for (i = block_start; i <= block_end; i++)
 | 
			
		||||
						pixel_count += color_usage[i];
 | 
			
		||||
				  	Num2str(pixel_count, str, 6);
 | 
			
		||||
				  }
 | 
			
		||||
				  Print_in_window(222, 33, str, MC_Black, MC_Light);
 | 
			
		||||
                  {
 | 
			
		||||
                    int pixel_count = 0;
 | 
			
		||||
                    for (i = block_start; i <= block_end; i++)
 | 
			
		||||
                    pixel_count += color_usage[i];
 | 
			
		||||
                    Num2str(pixel_count, str, 6);
 | 
			
		||||
                  }
 | 
			
		||||
                  Print_in_window(222, 33, str, MC_Black, MC_Light);
 | 
			
		||||
 | 
			
		||||
                  // Affichage des jauges
 | 
			
		||||
                  Display_sliders(red_slider,green_slider,blue_slider,1,NULL);
 | 
			
		||||
@ -1018,13 +1018,13 @@ void Button_Palette(void)
 | 
			
		||||
                  Num2str(block_end  ,str+4,3);
 | 
			
		||||
                  str[3]=26; // Flèche vers la droite
 | 
			
		||||
                  Print_in_window(237,58,str,MC_Black,MC_Light);
 | 
			
		||||
				  {
 | 
			
		||||
					int pixel_count = 0;
 | 
			
		||||
				  	for (i = block_start; i <= block_end; i++)
 | 
			
		||||
						pixel_count += color_usage[i];
 | 
			
		||||
				  	Num2str(pixel_count, str, 6);
 | 
			
		||||
				  }
 | 
			
		||||
				  Print_in_window(222, 33, str, MC_Black, MC_Light);
 | 
			
		||||
                  {
 | 
			
		||||
                    int pixel_count = 0;
 | 
			
		||||
                    for (i = block_start; i <= block_end; i++)
 | 
			
		||||
                      pixel_count += color_usage[i];
 | 
			
		||||
                    Num2str(pixel_count, str, 6);
 | 
			
		||||
                  }
 | 
			
		||||
                  Print_in_window(222, 33, str, MC_Black, MC_Light);
 | 
			
		||||
 | 
			
		||||
                  // Affichage des jauges
 | 
			
		||||
                  Display_sliders(red_slider,green_slider,blue_slider,1,NULL);
 | 
			
		||||
@ -1041,8 +1041,8 @@ void Button_Palette(void)
 | 
			
		||||
                  Block(Window_pos_X+(Menu_factor_X*261),Window_pos_Y+(Menu_factor_Y*58),Menu_factor_X*32,Menu_factor_Y*7,MC_Light);
 | 
			
		||||
                  Num2str(Fore_color,str,3);
 | 
			
		||||
                  Print_in_window(237,58,str,MC_Black,MC_Light);
 | 
			
		||||
				  Num2str(Fore_color, str, 6);
 | 
			
		||||
				  Print_in_window(222, 33, str, MC_Black, MC_Light);
 | 
			
		||||
                  Num2str(Fore_color, str, 6);
 | 
			
		||||
                  Print_in_window(222, 33, str, MC_Black, MC_Light);
 | 
			
		||||
 | 
			
		||||
                  // Affichage des jauges
 | 
			
		||||
                  Display_sliders(red_slider,green_slider,blue_slider,0,working_palette);
 | 
			
		||||
@ -1439,65 +1439,65 @@ void Button_Palette(void)
 | 
			
		||||
 | 
			
		||||
      case 11: // Reduce
 | 
			
		||||
        memcpy(backup_palette, working_palette, sizeof(T_Palette));
 | 
			
		||||
		switch(Window_attribute2) // Get the dropdown value
 | 
			
		||||
		{
 | 
			
		||||
			case 0: // 128
 | 
			
		||||
				reduce_colors_number = 128;
 | 
			
		||||
				break;
 | 
			
		||||
			case 1: // 64
 | 
			
		||||
				reduce_colors_number = 64;
 | 
			
		||||
				break;
 | 
			
		||||
			case 2: // 32
 | 
			
		||||
				reduce_colors_number = 32;
 | 
			
		||||
				break;
 | 
			
		||||
			case 3: // 16
 | 
			
		||||
				reduce_colors_number = 16;
 | 
			
		||||
				break;
 | 
			
		||||
			case 4: // 8
 | 
			
		||||
				reduce_colors_number = 8;
 | 
			
		||||
				break;
 | 
			
		||||
			case 5: // 4
 | 
			
		||||
				reduce_colors_number = 4;
 | 
			
		||||
				break;
 | 
			
		||||
			case 6: // 2
 | 
			
		||||
				reduce_colors_number = 2;
 | 
			
		||||
				break;
 | 
			
		||||
			case 7: // other
 | 
			
		||||
				reduce_colors_number
 | 
			
		||||
					= Requester_window("Enter the max. number of colors",
 | 
			
		||||
						reduce_colors_number);
 | 
			
		||||
				if (reduce_colors_number < 2 || reduce_colors_number >= 256)
 | 
			
		||||
					reduce_colors_number = -1;
 | 
			
		||||
				break;
 | 
			
		||||
		}
 | 
			
		||||
		if (reduce_colors_number > 0)
 | 
			
		||||
		{
 | 
			
		||||
      if (!image_is_backed_up)
 | 
			
		||||
      {
 | 
			
		||||
        Backup_layers(-1);
 | 
			
		||||
        image_is_backed_up=1;
 | 
			
		||||
      }
 | 
			
		||||
        switch(Window_attribute2) // Get the dropdown value
 | 
			
		||||
        {
 | 
			
		||||
            case 0: // 128
 | 
			
		||||
                reduce_colors_number = 128;
 | 
			
		||||
                break;
 | 
			
		||||
            case 1: // 64
 | 
			
		||||
                reduce_colors_number = 64;
 | 
			
		||||
                break;
 | 
			
		||||
            case 2: // 32
 | 
			
		||||
                reduce_colors_number = 32;
 | 
			
		||||
                break;
 | 
			
		||||
            case 3: // 16
 | 
			
		||||
                reduce_colors_number = 16;
 | 
			
		||||
                break;
 | 
			
		||||
            case 4: // 8
 | 
			
		||||
                reduce_colors_number = 8;
 | 
			
		||||
                break;
 | 
			
		||||
            case 5: // 4
 | 
			
		||||
                reduce_colors_number = 4;
 | 
			
		||||
                break;
 | 
			
		||||
            case 6: // 2
 | 
			
		||||
                reduce_colors_number = 2;
 | 
			
		||||
                break;
 | 
			
		||||
            case 7: // other
 | 
			
		||||
                reduce_colors_number
 | 
			
		||||
                    = Requester_window("Enter the max. number of colors",
 | 
			
		||||
                        reduce_colors_number);
 | 
			
		||||
                if (reduce_colors_number < 2 || reduce_colors_number >= 256)
 | 
			
		||||
                    reduce_colors_number = -1;
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
        if (reduce_colors_number > 0)
 | 
			
		||||
        {
 | 
			
		||||
            if (!image_is_backed_up)
 | 
			
		||||
            {
 | 
			
		||||
                Backup_layers(-1);
 | 
			
		||||
                image_is_backed_up = 1;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
			Reduce_palette(&used_colors, reduce_colors_number, working_palette,
 | 
			
		||||
					color_usage);
 | 
			
		||||
            Reduce_palette(&used_colors, reduce_colors_number, working_palette,
 | 
			
		||||
                    color_usage);
 | 
			
		||||
 | 
			
		||||
			if ((Config.Safety_colors) && (used_colors<4))
 | 
			
		||||
			{
 | 
			
		||||
				memcpy(temp_palette, Main_palette, sizeof(T_Palette));
 | 
			
		||||
				memcpy(Main_palette, working_palette, sizeof(T_Palette));
 | 
			
		||||
				Set_nice_menu_colors(color_usage, 0);
 | 
			
		||||
				memcpy(working_palette, Main_palette, sizeof(T_Palette));
 | 
			
		||||
				memcpy(Main_palette, temp_palette, sizeof(T_Palette));
 | 
			
		||||
			}
 | 
			
		||||
            if ((Config.Safety_colors) && (used_colors<4))
 | 
			
		||||
            {
 | 
			
		||||
                memcpy(temp_palette, Main_palette, sizeof(T_Palette));
 | 
			
		||||
                memcpy(Main_palette, working_palette, sizeof(T_Palette));
 | 
			
		||||
                Set_nice_menu_colors(color_usage, 0);
 | 
			
		||||
                memcpy(working_palette, Main_palette, sizeof(T_Palette));
 | 
			
		||||
                memcpy(Main_palette, temp_palette, sizeof(T_Palette));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
			Set_palette(working_palette); // On définit la nouvelle palette
 | 
			
		||||
			Draw_all_palette_sliders(red_slider, green_slider, blue_slider,
 | 
			
		||||
					working_palette, block_start, block_end);
 | 
			
		||||
			memcpy(temp_palette, working_palette, sizeof(T_Palette));
 | 
			
		||||
            Set_palette(working_palette); // On définit la nouvelle palette
 | 
			
		||||
            Draw_all_palette_sliders(red_slider, green_slider, blue_slider,
 | 
			
		||||
                    working_palette, block_start, block_end);
 | 
			
		||||
            memcpy(temp_palette, working_palette, sizeof(T_Palette));
 | 
			
		||||
 | 
			
		||||
			End_of_modification();
 | 
			
		||||
			need_to_remap = 1;
 | 
			
		||||
		}
 | 
			
		||||
            End_of_modification();
 | 
			
		||||
            need_to_remap = 1;
 | 
			
		||||
        }
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
      case 12: // Undo
 | 
			
		||||
 | 
			
		||||
@ -469,13 +469,13 @@ int Load_INI(T_Config * conf)
 | 
			
		||||
    goto Erreur_Retour;
 | 
			
		||||
  if ((values[0]<0) || (values[0]>4))
 | 
			
		||||
    goto Erreur_ERREUR_INI_CORROMPU;
 | 
			
		||||
  conf->Mouse_fix_factor_X=Mouse_fix_factor_X=values[0];
 | 
			
		||||
  // Deprecated setting, unused
 | 
			
		||||
 | 
			
		||||
  if ((return_code=Load_INI_get_values (file,buffer,"Y_correction_factor",1,values)))
 | 
			
		||||
    goto Erreur_Retour;
 | 
			
		||||
  if ((values[0]<0) || (values[0]>4))
 | 
			
		||||
    goto Erreur_ERREUR_INI_CORROMPU;
 | 
			
		||||
  conf->Mouse_fix_factor_Y=Mouse_fix_factor_Y=values[0];
 | 
			
		||||
  // Deprecated setting, unused
 | 
			
		||||
 | 
			
		||||
  if ((return_code=Load_INI_get_values (file,buffer,"Cursor_aspect",1,values)))
 | 
			
		||||
    goto Erreur_Retour;
 | 
			
		||||
 | 
			
		||||
@ -445,11 +445,11 @@ int Save_INI(T_Config * conf)
 | 
			
		||||
  if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Y_sensitivity",1,values,0)))
 | 
			
		||||
    goto Erreur_Retour;
 | 
			
		||||
 | 
			
		||||
  values[0]=conf->Mouse_fix_factor_X;
 | 
			
		||||
  values[0]=0;
 | 
			
		||||
  if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"X_correction_factor",1,values,0)))
 | 
			
		||||
    goto Erreur_Retour;
 | 
			
		||||
 | 
			
		||||
  values[0]=conf->Mouse_fix_factor_Y;
 | 
			
		||||
  values[0]=0;
 | 
			
		||||
  if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Y_correction_factor",1,values,0)))
 | 
			
		||||
    goto Erreur_Retour;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								struct.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								struct.h
									
									
									
									
									
								
							@ -285,8 +285,6 @@ typedef struct
 | 
			
		||||
  byte Max_undo_pages;                   ///< Number of steps to memorize for Undo/Redo.
 | 
			
		||||
  byte Mouse_sensitivity_index_x;        ///< Mouse sensitivity in X axis
 | 
			
		||||
  byte Mouse_sensitivity_index_y;        ///< Mouse sensitivity in Y axis
 | 
			
		||||
  byte Mouse_fix_factor_X;               ///< Mouse correction factor in X axis.
 | 
			
		||||
  byte Mouse_fix_factor_Y;               ///< Mouse correction factor in Y axis.
 | 
			
		||||
  byte Mouse_merge_movement;             ///< Number of SDL mouse events that are merged into a single change of mouse coordinates.
 | 
			
		||||
  byte Delay_left_click_on_slider;       ///< Delay (in 1/100s) between two activations of a repeatable button when you hold left-click.
 | 
			
		||||
  byte Delay_right_click_on_slider;      ///< Delay (in 1/100s) between two activations of a repeatable button when you hold left-click.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user