Some cleanups
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1169 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
		
							parent
							
								
									7283412da2
								
							
						
					
					
						commit
						792abd4866
					
				
							
								
								
									
										27
									
								
								brush.c
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								brush.c
									
									
									
									
									
								
							@ -720,7 +720,8 @@ void Capture_brush(short start_x,short start_y,short end_x,short end_y,short cle
 | 
			
		||||
    if (start_y+new_brush_height>Main_image_height)
 | 
			
		||||
      new_brush_height=Main_image_height-start_y;
 | 
			
		||||
 | 
			
		||||
    Realloc_brush(new_brush_width, new_brush_height);
 | 
			
		||||
    if (Realloc_brush(new_brush_width, new_brush_height) != 0)
 | 
			
		||||
      return; // Unable to allocate the new brush, keep the old one.
 | 
			
		||||
 | 
			
		||||
    Copy_image_to_brush(start_x,start_y,Brush_width,Brush_height,Main_image_width);
 | 
			
		||||
 | 
			
		||||
@ -747,10 +748,10 @@ void Rotate_90_deg()
 | 
			
		||||
  short temp;
 | 
			
		||||
  byte * new_brush;
 | 
			
		||||
 | 
			
		||||
  new_brush=(byte *)malloc(((long)Brush_height)*Brush_width);
 | 
			
		||||
  new_brush=(byte *)malloc(((size_t)Brush_height)*Brush_width);
 | 
			
		||||
  if (new_brush)
 | 
			
		||||
  {
 | 
			
		||||
    Rotate_90_deg_lowlevel(Brush,/*@out@*/ new_brush,Brush_width,Brush_height);
 | 
			
		||||
    Rotate_90_deg_lowlevel(Brush,new_brush,Brush_width,Brush_height);
 | 
			
		||||
    free(Brush);
 | 
			
		||||
    Brush=new_brush;
 | 
			
		||||
 | 
			
		||||
@ -1601,18 +1602,18 @@ void Interpolate_texture(int start_x,int start_y,int xt1,int yt1,
 | 
			
		||||
        yt=(((float)((x_pos-start_x)*delta_yt))/(float)delta_x2) + (float)yt1;
 | 
			
		||||
        if (ScanY_X[0][y_pos]==UNDEFINED) // Gauche non défini
 | 
			
		||||
        {
 | 
			
		||||
          ScanY_X[0][y_pos]=x_pos;
 | 
			
		||||
          ScanY_X[0][y_pos]=(float)x_pos;
 | 
			
		||||
          ScanY_Xt[0][y_pos]=xt;
 | 
			
		||||
          ScanY_Yt[0][y_pos]=yt;
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
          if (x_pos>=ScanY_X[0][y_pos])
 | 
			
		||||
          if ((float)x_pos>=ScanY_X[0][y_pos])
 | 
			
		||||
          {
 | 
			
		||||
            if ((ScanY_X[1][y_pos]==UNDEFINED) // Droit non défini
 | 
			
		||||
             || (x_pos>ScanY_X[1][y_pos]))
 | 
			
		||||
            {
 | 
			
		||||
              ScanY_X[1][y_pos]=x_pos;
 | 
			
		||||
              ScanY_X[1][y_pos]=(float)x_pos;
 | 
			
		||||
              ScanY_Xt[1][y_pos]=xt;
 | 
			
		||||
              ScanY_Yt[1][y_pos]=yt;
 | 
			
		||||
            }
 | 
			
		||||
@ -1624,13 +1625,13 @@ void Interpolate_texture(int start_x,int start_y,int xt1,int yt1,
 | 
			
		||||
              ScanY_X[1][y_pos]=ScanY_X[0][y_pos];
 | 
			
		||||
              ScanY_Xt[1][y_pos]=ScanY_Xt[0][y_pos];
 | 
			
		||||
              ScanY_Yt[1][y_pos]=ScanY_Yt[0][y_pos];
 | 
			
		||||
              ScanY_X[0][y_pos]=x_pos;
 | 
			
		||||
              ScanY_X[0][y_pos]=(float)x_pos;
 | 
			
		||||
              ScanY_Xt[0][y_pos]=xt;
 | 
			
		||||
              ScanY_Yt[0][y_pos]=yt;
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
              ScanY_X[0][y_pos]=x_pos;
 | 
			
		||||
              ScanY_X[0][y_pos]=(float)x_pos;
 | 
			
		||||
              ScanY_Xt[0][y_pos]=xt;
 | 
			
		||||
              ScanY_Yt[0][y_pos]=yt;
 | 
			
		||||
            }
 | 
			
		||||
@ -1658,18 +1659,18 @@ void Interpolate_texture(int start_x,int start_y,int xt1,int yt1,
 | 
			
		||||
        yt=(((float)((y_pos-start_y)*delta_yt))/(float)delta_y2) + (float)yt1;
 | 
			
		||||
        if (ScanY_X[0][y_pos]==UNDEFINED) // Gauche non défini
 | 
			
		||||
        {
 | 
			
		||||
          ScanY_X[0][y_pos]=x_pos;
 | 
			
		||||
          ScanY_X[0][y_pos]=(float)x_pos;
 | 
			
		||||
          ScanY_Xt[0][y_pos]=xt;
 | 
			
		||||
          ScanY_Yt[0][y_pos]=yt;
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
          if (x_pos>=ScanY_X[0][y_pos])
 | 
			
		||||
          if ((float)x_pos>=ScanY_X[0][y_pos])
 | 
			
		||||
          {
 | 
			
		||||
            if ((ScanY_X[1][y_pos]==UNDEFINED) // Droit non défini
 | 
			
		||||
             || (x_pos>ScanY_X[1][y_pos]))
 | 
			
		||||
            {
 | 
			
		||||
              ScanY_X[1][y_pos]=x_pos;
 | 
			
		||||
              ScanY_X[1][y_pos]=(float)x_pos;
 | 
			
		||||
              ScanY_Xt[1][y_pos]=xt;
 | 
			
		||||
              ScanY_Yt[1][y_pos]=yt;
 | 
			
		||||
            }
 | 
			
		||||
@ -1681,13 +1682,13 @@ void Interpolate_texture(int start_x,int start_y,int xt1,int yt1,
 | 
			
		||||
              ScanY_X[1][y_pos]=ScanY_X[0][y_pos];
 | 
			
		||||
              ScanY_Xt[1][y_pos]=ScanY_Xt[0][y_pos];
 | 
			
		||||
              ScanY_Yt[1][y_pos]=ScanY_Yt[0][y_pos];
 | 
			
		||||
              ScanY_X[0][y_pos]=x_pos;
 | 
			
		||||
              ScanY_X[0][y_pos]=(float)x_pos;
 | 
			
		||||
              ScanY_Xt[0][y_pos]=xt;
 | 
			
		||||
              ScanY_Yt[0][y_pos]=yt;
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
              ScanY_X[0][y_pos]=x_pos;
 | 
			
		||||
              ScanY_X[0][y_pos]=(float)x_pos;
 | 
			
		||||
              ScanY_Xt[0][y_pos]=xt;
 | 
			
		||||
              ScanY_Yt[0][y_pos]=yt;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										11
									
								
								buttons.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								buttons.c
									
									
									
									
									
								
							@ -1013,12 +1013,6 @@ void Draw_one_skin_name(word x, word y, word index, byte highlighted)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define SWAP_BYTES(a,b) { byte c=a; a=b; b=c;}
 | 
			
		||||
#define SWAP_WORDS(a,b) { word c=a; a=b; b=c;}
 | 
			
		||||
#define SWAP_DWORDS(a,b) { dword c=a; a=b; b=c;}
 | 
			
		||||
#define SWAP_SHORTS(a,b) { short c=a; a=b; b=c;}
 | 
			
		||||
#define SWAP_FLOATS(a,b) { float c=a; a=b; b=c;}
 | 
			
		||||
 | 
			
		||||
/// Skin selector window
 | 
			
		||||
void Button_Skins(void)
 | 
			
		||||
{
 | 
			
		||||
@ -3827,7 +3821,7 @@ byte Smooth_default_matrices[4][3][3]=
 | 
			
		||||
void Button_Smooth_menu(void)
 | 
			
		||||
{
 | 
			
		||||
  short clicked_button;
 | 
			
		||||
  short x,y,i,j;
 | 
			
		||||
  word x,y,i,j;
 | 
			
		||||
  byte  chosen_matrix[3][3];
 | 
			
		||||
  T_Special_button * matrix_input[3][3];
 | 
			
		||||
  char  str[3];
 | 
			
		||||
@ -3851,7 +3845,8 @@ void Button_Smooth_menu(void)
 | 
			
		||||
    for (i=0; i<3; i++)
 | 
			
		||||
    {
 | 
			
		||||
      matrix_input[i][j]=Window_set_input_button(10+(i*21),62+(j*13),2); // 7..15
 | 
			
		||||
      Num2str(chosen_matrix[i][j]=Smooth_matrix[i][j],str,2);
 | 
			
		||||
      chosen_matrix[i][j] = Smooth_matrix[i][j] ;
 | 
			
		||||
      Num2str(chosen_matrix[i][j], str, 2);
 | 
			
		||||
      Window_input_content(matrix_input[i][j],str);
 | 
			
		||||
    }
 | 
			
		||||
  Update_window_area(0,0,Window_width, Window_height);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								misc.h
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								misc.h
									
									
									
									
									
								
							@ -25,6 +25,12 @@
 | 
			
		||||
 | 
			
		||||
#include "struct.h"
 | 
			
		||||
 | 
			
		||||
#define SWAP_BYTES(a,b) { byte c=a; a=b; b=c;}
 | 
			
		||||
#define SWAP_WORDS(a,b) { word c=a; a=b; b=c;}
 | 
			
		||||
#define SWAP_DWORDS(a,b) { dword c=a; a=b; b=c;}
 | 
			
		||||
#define SWAP_SHORTS(a,b) { short c=a; a=b; b=c;}
 | 
			
		||||
#define SWAP_FLOATS(a,b) { float c=a; a=b; b=c;}
 | 
			
		||||
 | 
			
		||||
void Copy_image_to_brush(short start_x,short start_y,short Brush_width,short Brush_height,word image_width);
 | 
			
		||||
void Remap_general_lowlevel(byte * conversion_table,byte * buffer,short width,short height,short buffer_width);
 | 
			
		||||
void Scroll_picture(byte * main_src, byte * main_dest, short x_offset,short y_offset);
 | 
			
		||||
 | 
			
		||||
@ -2572,8 +2572,6 @@ void Remap_screen_after_menu_colors_change(void)
 | 
			
		||||
void Compute_optimal_menu_colors(T_Components * palette)
 | 
			
		||||
{
 | 
			
		||||
  byte table[4];
 | 
			
		||||
  short i;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  Old_black =MC_Black;
 | 
			
		||||
  Old_dark = MC_Dark;
 | 
			
		||||
@ -2630,9 +2628,7 @@ void Compute_optimal_menu_colors(T_Components * palette)
 | 
			
		||||
  if ( ((palette[MC_Light].R*30)+(palette[MC_Light].G*59)+(palette[MC_Light].B*11)) <
 | 
			
		||||
       ((palette[MC_Dark].R*30)+(palette[MC_Dark].G*59)+(palette[MC_Dark].B*11)) )
 | 
			
		||||
  {
 | 
			
		||||
    i=MC_Light;
 | 
			
		||||
    MC_Light=MC_Dark;
 | 
			
		||||
    MC_Dark=i;
 | 
			
		||||
    SWAP_BYTES(MC_Light, MC_Dark);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // On cherche une couleur de transparence différente des 4 autres.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user