Removed some unused functions (kindly pointed out by the great ncc tool)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@796 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues 2009-05-10 14:47:09 +00:00
parent fc1786a077
commit 402df48b7f
15 changed files with 14 additions and 199 deletions

View File

@ -58,48 +58,6 @@ Func_effect Effect_function_before_cancel;
///This table holds pointers to the saved window backgrounds. We can have up to 8 windows open at a time. ///This table holds pointers to the saved window backgrounds. We can have up to 8 windows open at a time.
byte* Window_background[8]; byte* Window_background[8];
///Disables all the effects
void Cancel_effects(void)
{
Shade_mode_before_cancel=Shade_mode;
Shade_mode=0;
Quick_shade_mode_before_cancel=Quick_shade_mode;
Quick_shade_mode=0;
Stencil_mode_before_cancel=Stencil_mode;
Stencil_mode=0;
Sieve_mode_before_cancel=Sieve_mode;
Sieve_mode=0;
Colorize_mode_before_cancel=Colorize_mode;
Colorize_mode=0;
Smooth_mode_before_cancel=Smooth_mode;
Smooth_mode=0;
Tiling_mode_before_cancel=Tiling_mode;
Tiling_mode=0;
Effect_function_before_cancel=Effect_function;
Effect_function=No_effect;
}
///Get the effects and drawing modes back
void Restore_effects(void)
{
Shade_mode =Shade_mode_before_cancel;
Quick_shade_mode=Quick_shade_mode_before_cancel;
Stencil_mode =Stencil_mode_before_cancel;
Sieve_mode =Sieve_mode_before_cancel;
Colorize_mode =Colorize_mode_before_cancel;
Smooth_mode =Smooth_mode_before_cancel;
Tiling_mode =Tiling_mode_before_cancel;
Effect_function =Effect_function_before_cancel;
}
///Table of tooltip texts for menu buttons ///Table of tooltip texts for menu buttons
char * Menu_tooltip[NB_BUTTONS]= char * Menu_tooltip[NB_BUTTONS]=

View File

@ -22,17 +22,15 @@
/// Utility functions for the menu and all windows. /// Utility functions for the menu and all windows.
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
void Main_handler (void); void Main_handler (void);
void Draw_menu_button_frame(byte btn_number,byte pressed); void Draw_menu_button_frame(byte btn_number,byte pressed);
void Unselect_button (int btn_number); void Unselect_button (int btn_number);
void Select_button (int btn_number,byte click); void Select_button (int btn_number,byte click);
void Cancel_effects (void); void Open_window (word width,word height, char * title);
void Restore_effects (void); void Close_window (void);
void Open_window (word width,word height, char * title);
void Close_window (void);
void Open_popup (word x_pos, word y_pos, word width, word height); void Open_popup (word x_pos, word y_pos, word width, word height);
void Close_popup (void); void Close_popup (void);
void Window_draw_normal_bouton(word x_pos,word y_pos,word width,word height, void Window_draw_normal_bouton(word x_pos,word y_pos,word width,word height,
char * title,byte undersc_letter,byte clickable); char * title,byte undersc_letter,byte clickable);

17
io.c
View File

@ -39,23 +39,6 @@
#include "io.h" #include "io.h"
#include "realpath.h" #include "realpath.h"
word Endian_magic16(word x)
{
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
return x;
#else
return SDL_Swap16(x);
#endif
}
dword Endian_magic32(dword x)
{
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
return x;
#else
return SDL_Swap32(x);
#endif
}
// Lit un octet // Lit un octet
// Renvoie -1 si OK, 0 en cas d'erreur // Renvoie -1 si OK, 0 en cas d'erreur
int Read_byte(FILE *file, byte *dest) int Read_byte(FILE *file, byte *dest)

5
io.h
View File

@ -31,11 +31,6 @@
/// If you don't, you break another platform. /// If you don't, you break another platform.
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
/// Returns x, swapped if the current target is low-endian. Deprecated, please don't use it.
word Endian_magic16(word x);
/// Returns x, swapped if the current target is low-endian. Deprecated, please don't use it.
dword Endian_magic32(dword x);
/// Reads a single byte from an open file. Returns true if OK, false if a file i/o error occurred. /// Reads a single byte from an open file. Returns true if OK, false if a file i/o error occurred.
int Read_byte(FILE *file, byte *dest); int Read_byte(FILE *file, byte *dest);
/// Writes a single byte to an open file. Returns true if OK, false if a file i/o error occurred. /// Writes a single byte to an open file. Returns true if OK, false if a file i/o error occurred.

View File

@ -5528,20 +5528,8 @@ void Save_PC1(void)
} }
} }
/******************************************************************************************
Functions from op_c.c : load raw 24B (for testing) and load_tga (broken ? incomplete ?)
Saving would be nice as well.
******************************************************************************************/
void Load_RAW_24b(int width,int height,T_Bitmap24B source)
{
FILE* file;
file=fopen("TEST.RAW","rb");
if (Read_bytes(file,source,width*height*sizeof(T_Components)))
exit(3);
fclose(file);
}
/// UNUSED and UNTESTED function to load a TGA file.
void Load_TGA(char * fname,T_Bitmap24B * dest,int * width,int * height) void Load_TGA(char * fname,T_Bitmap24B * dest,int * width,int * height)
{ {
FILE* fichier; FILE* fichier;

16
misc.c
View File

@ -774,22 +774,6 @@ void Num2str(dword number,char * str,byte nb_char)
str[nb_char]='\0'; str[nb_char]='\0';
} }
// Transformer une chaîne en un entier naturel (renvoie -1 si ch. invalide)
int Str2num(char * str)
{
int value=0;
for (;*str;str++)
{
if ( (*str>='0') && (*str<='9') )
value=(value*10)+(*str-'0');
else
return -1;
}
return value;
}
// Arrondir un nombre réel à la valeur entière la plus proche // Arrondir un nombre réel à la valeur entière la plus proche
short Round(float value) short Round(float value)
{ {

1
misc.h
View File

@ -143,7 +143,6 @@ byte New_preview_is_needed; // Bool
unsigned long Memory_free(void); unsigned long Memory_free(void);
void Num2str(dword number,char * str,byte nb_char); void Num2str(dword number,char * str,byte nb_char);
int Str2num(char * str);
short Round(float value); short Round(float value);
short Round_div_max(short numerator,short divisor); short Round_div_max(short numerator,short divisor);

11
op_c.c
View File

@ -304,17 +304,6 @@ int OT_get(T_Occurrence_table * t,int r,int g,int b)
return t->table[index]; return t->table[index];
} }
void OT_set(T_Occurrence_table * t,int r,int g,int b,int i)
{
int index;
r=(r>>t->red_r);
g=(g>>t->red_g);
b=(b>>t->red_b);
index=(r<<t->dec_r) | (g<<t->dec_g) | (b<<t->dec_b);
t->table[index]=i;
}
void OT_inc(T_Occurrence_table * t,int r,int g,int b) void OT_inc(T_Occurrence_table * t,int r,int g,int b)
{ {
int index; int index;

1
op_c.h
View File

@ -165,7 +165,6 @@ void OT_init(T_Occurrence_table * t);
T_Occurrence_table * OT_new(int nbb_r,int nbb_g,int nbb_b); T_Occurrence_table * OT_new(int nbb_r,int nbb_g,int nbb_b);
void OT_delete(T_Occurrence_table * t); void OT_delete(T_Occurrence_table * t);
int OT_get(T_Occurrence_table * t,int r,int g,int b); int OT_get(T_Occurrence_table * t,int r,int g,int b);
void OT_set(T_Occurrence_table * t,int r,int g,int b,int i);
void OT_inc(T_Occurrence_table * t,int r,int g,int b); void OT_inc(T_Occurrence_table * t,int r,int g,int b);
void OT_count_occurrences(T_Occurrence_table * t,T_Bitmap24B image,int size); void OT_count_occurrences(T_Occurrence_table * t,T_Bitmap24B image,int size);

41
pages.c
View File

@ -228,30 +228,6 @@ void Download_infos_backup(T_List_of_pages * list)
FX_feedback_screen=list->Pages[1].Image; FX_feedback_screen=list->Pages[1].Image;
} }
int Allocate_page(T_Page * page,int width,int height)
{
// Important: la T_Page ne doit pas déjà désigner une page allouée auquel
// cas celle-ci serait perdue.
/* Debug : if (page->Image!=NULL) exit(666); */
// On alloue la mémoire pour le bitmap
page->Image=(byte *)malloc(width*height);
// On vérifie que l'allocation se soit bien passée
if (page->Image==NULL)
return 0; // Echec
else
{
page->Width=width;
page->Height=height;
// Important: La mise à jour des autres infos est du ressort de
// l'appelant.
return 1; // Succès
}
}
void Free_a_page(T_Page * page) void Free_a_page(T_Page * page)
{ {
// On peut appeler cette fonction sur une page non allouée. // On peut appeler cette fonction sur une page non allouée.
@ -730,23 +706,6 @@ int Init_all_backup_lists(int size,int width,int height)
return return_code; return return_code;
} }
void Free_all_backup_lists(void)
{
// On commence par supprimer les pages une à une dans chacune des listes
// Liste de la page principale
while (Main_backups->Nb_pages_allocated>0)
Free_last_page_of_list(Main_backups);
// Liste de la page de brouillon
while (Spare_backups->Nb_pages_allocated>0)
Free_last_page_of_list(Spare_backups);
// Puis on peut détruire les structures de liste elles-mêmes
Free_a_list_of_pages(Main_backups);
Free_a_list_of_pages(Spare_backups);
free(Main_backups);
free(Spare_backups);
}
void Set_number_of_backups(int nb_backups) void Set_number_of_backups(int nb_backups)
{ {
Change_page_number_of_list(Main_backups,nb_backups+1); Change_page_number_of_list(Main_backups,nb_backups+1);

View File

@ -41,7 +41,6 @@ void Upload_infos_page_main(T_Page * page);
void Download_infos_page_spare(T_Page * page); void Download_infos_page_spare(T_Page * page);
void Upload_infos_page_spare(T_Page * page); void Upload_infos_page_spare(T_Page * page);
void Download_infos_backup(T_List_of_pages * list); void Download_infos_backup(T_List_of_pages * list);
int Allocate_page(T_Page * page,int width,int height);
void Free_a_page(T_Page * page); void Free_a_page(T_Page * page);
void Copy_S_page(T_Page * dest,T_Page * source); void Copy_S_page(T_Page * dest,T_Page * source);
int Size_of_a_page(T_Page * page); int Size_of_a_page(T_Page * page);
@ -71,7 +70,6 @@ void Free_page_of_a_list(T_List_of_pages * list);
/// ///
int Init_all_backup_lists(int size,int width,int height); int Init_all_backup_lists(int size,int width,int height);
void Free_all_backup_lists(void);
void Set_number_of_backups(int nb_backups); void Set_number_of_backups(int nb_backups);
int Backup_with_new_dimensions(int upload,int width,int height); int Backup_with_new_dimensions(int upload,int width,int height);
int Backup_and_resize_the_spare(int width,int height); int Backup_and_resize_the_spare(int width,int height);

View File

@ -191,12 +191,6 @@ byte Get_SDL_pixel_8(SDL_Surface *bmp, int x, int y)
return ((byte *)(bmp->pixels))[(y*bmp->pitch+x)]; return ((byte *)(bmp->pixels))[(y*bmp->pitch+x)];
} }
void Clear_screen(byte color)
{
memset(Screen_SDL->pixels,color,Screen_SDL->pitch*Screen_SDL->h);
Update_rect(0,0,0,0);
}
void Clear_border(byte color) void Clear_border(byte color)
{ {
int width; int width;

View File

@ -46,9 +46,6 @@ byte * Surface_to_bytefield(SDL_Surface *source, byte * dest);
SDL_Color Color_to_SDL_color(byte); SDL_Color Color_to_SDL_color(byte);
byte Get_SDL_pixel_8(SDL_Surface *bmp, int x, int y); byte Get_SDL_pixel_8(SDL_Surface *bmp, int x, int y);
/// Fills the SDL screen with a given color
void Clear_screen(byte color);
/// ///
/// Clears the parts of screen that are outside of the editing area. /// Clears the parts of screen that are outside of the editing area.
/// There is such area only if the screen mode is not a multiple of the pixel /// There is such area only if the screen mode is not a multiple of the pixel

View File

@ -462,8 +462,7 @@ void Print_general(short x,short y,const char * str,byte text_color,byte backgro
} }
} }
// -- Afficher un caractère dans une fenêtre -- /// Draws a char in a window
void Print_char_in_window(short x_pos,short y_pos,const unsigned char c,byte text_color,byte background_color) void Print_char_in_window(short x_pos,short y_pos,const unsigned char c,byte text_color,byte background_color)
{ {
short x,y; short x,y;
@ -480,28 +479,7 @@ void Print_char_in_window(short x_pos,short y_pos,const unsigned char c,byte tex
(*(pixel++)?text_color:background_color)); (*(pixel++)?text_color:background_color));
} }
// -- Afficher un caractère sans fond dans une fenêtre -- ///Draws a char in a window, checking for bounds
void Print_transparent_char_in_window(short x_pos,short y_pos,const unsigned char c,byte color)
{
short x,y;
byte *pixel;
x_pos=(x_pos*Menu_factor_X)+Window_pos_X;
y_pos=(y_pos*Menu_factor_Y)+Window_pos_Y;
// Premier pixel du caractère
pixel=Menu_font + (c<<6);
for (y=0;y<8;y++)
for (x=0;x<8;x++)
{
if (*(pixel++))
Block(x_pos+(x*Menu_factor_X), y_pos+(y*Menu_factor_Y),
Menu_factor_X, Menu_factor_Y, color);
}
}
// -- Afficher une chaîne dans une fenêtre, avec taille maxi --
void Print_in_window_limited(short x,short y,const char * str,byte size,byte text_color,byte background_color) void Print_in_window_limited(short x,short y,const char * str,byte size,byte text_color,byte background_color)
{ {
char display_string[256]; char display_string[256];
@ -515,8 +493,7 @@ void Print_in_window_limited(short x,short y,const char * str,byte size,byte tex
Print_in_window(x, y, display_string, text_color, background_color); Print_in_window(x, y, display_string, text_color, background_color);
} }
// -- Afficher une chaîne dans une fenêtre -- /// Draws a string in a window
void Print_in_window(short x,short y,const char * str,byte text_color,byte background_color) void Print_in_window(short x,short y,const char * str,byte text_color,byte background_color)
{ {
Print_general((x*Menu_factor_X)+Window_pos_X, Print_general((x*Menu_factor_X)+Window_pos_X,
@ -525,17 +502,15 @@ void Print_in_window(short x,short y,const char * str,byte text_color,byte backg
Update_rect(x*Menu_factor_X+Window_pos_X,y*Menu_factor_Y+Window_pos_Y,8*Menu_factor_X*strlen(str),8*Menu_factor_Y); Update_rect(x*Menu_factor_X+Window_pos_X,y*Menu_factor_Y+Window_pos_Y,8*Menu_factor_X*strlen(str),8*Menu_factor_Y);
} }
// -- Afficher une chaîne dans le menu -- // Draws a string in the menu's status bar
void Print_in_menu(const char * str, short position) void Print_in_menu(const char * str, short position)
{ {
Print_general((18+(position<<3))*Menu_factor_X,Menu_status_Y,str,MC_Black,MC_Light); Print_general((18+(position<<3))*Menu_factor_X,Menu_status_Y,str,MC_Black,MC_Light);
Update_rect((18+(position<<3))*Menu_factor_X,Menu_status_Y,strlen(str)*8*Menu_factor_X,8*Menu_factor_Y); Update_rect((18+(position<<3))*Menu_factor_X,Menu_status_Y,strlen(str)*8*Menu_factor_X,8*Menu_factor_Y);
} }
// -- Afficher les coordonnées du pinceau dans le menu -- /// Draws the mouse coordinates on the menu
/// Only update the digits and doesn't refresh the "X: Y:" labels. This function needs to be fast as it is called each time the mouse moves.
// Note : cette fonction n'affiche que les chiffres, pas les X: Y: qui sont dans la gestion principale, car elle est apellée très souvent.
void Print_coordinates(void) void Print_coordinates(void)
{ {
char temp[5]; char temp[5];

View File

@ -61,7 +61,6 @@ void Print_general(short x,short y,const char * str,byte text_color,byte backgro
void Print_in_window(short x,short y,const char * str,byte text_color,byte background_color); void Print_in_window(short x,short y,const char * str,byte text_color,byte background_color);
void Print_in_window_limited(short x,short y,const char * str,byte size,byte text_color,byte background_color); void Print_in_window_limited(short x,short y,const char * str,byte size,byte text_color,byte background_color);
void Print_char_in_window(short x_pos,short y_pos,const unsigned char c,byte text_color,byte background_color); void Print_char_in_window(short x_pos,short y_pos,const unsigned char c,byte text_color,byte background_color);
void Print_transparent_char_in_window(short x_pos,short y_pos,const unsigned char c,byte color);
void Print_in_menu(const char * str, short position); void Print_in_menu(const char * str, short position);
void Print_coordinates(void); void Print_coordinates(void);
void Print_filename(void); void Print_filename(void);