Fixed stricter compilation warnings, deleted unused asm code
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@288 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
		
							parent
							
								
									20537fd58a
								
							
						
					
					
						commit
						b488ec9272
					
				
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							@ -24,7 +24,7 @@ ifdef COMSPEC
 | 
			
		||||
  DELCOMMAND = del
 | 
			
		||||
  BIN = grafx2.exe
 | 
			
		||||
  CFGBIN = gfxcfg.exe
 | 
			
		||||
  COPT = -Wall -O -g -ggdb `sdl-config --cflags`
 | 
			
		||||
  COPT = -W -Wall -O -g -ggdb `sdl-config --cflags`
 | 
			
		||||
  LOPT = `sdl-config --libs`
 | 
			
		||||
  CC = gcc
 | 
			
		||||
else
 | 
			
		||||
@ -50,7 +50,7 @@ endif
 | 
			
		||||
 | 
			
		||||
OBJ = main.o init.o graph.o sdlscreen.o divers.o special.o boutons.o palette.o \
 | 
			
		||||
      aide.o operatio.o pages.o loadsave.o readline.o moteur.o files.o op_c.o \
 | 
			
		||||
      linux.o op_asm.o readini.o saveini.o shade.o clavier.o io.o version.o
 | 
			
		||||
      linux.o readini.o saveini.o shade.o clavier.o io.o version.o
 | 
			
		||||
CFGOBJ = gfxcfg.o SFont.o clavier.o io.o
 | 
			
		||||
 | 
			
		||||
OBJDIR = obj/
 | 
			
		||||
 | 
			
		||||
@ -30,9 +30,8 @@ moteur.o: moteur.c const.h struct.h global.h loadsave.h graph.h divers.h \
 | 
			
		||||
  special.h boutons.h operatio.h shade.h erreurs.h linux.h sdlscreen.h
 | 
			
		||||
files.o: files.c const.h struct.h global.h loadsave.h graph.h divers.h \
 | 
			
		||||
  erreurs.h linux.h
 | 
			
		||||
op_c.o: op_c.c op_c.h struct.h const.h op_asm.h erreurs.h
 | 
			
		||||
op_c.o: op_c.c op_c.h struct.h const.h erreurs.h
 | 
			
		||||
linux.o: linux.c
 | 
			
		||||
op_asm.o: op_asm.c op_c.h struct.h const.h graph.h
 | 
			
		||||
readini.o: readini.c const.h global.h struct.h loadsave.h graph.h
 | 
			
		||||
saveini.o: saveini.c const.h global.h struct.h loadsave.h readini.h \
 | 
			
		||||
  files.h erreurs.h graph.h
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										4
									
								
								aide.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								aide.c
									
									
									
									
									
								
							@ -67,7 +67,7 @@ void Afficher_aide(void)
 | 
			
		||||
  short  Largeur;             // Largeur physique d'une ligne de texte
 | 
			
		||||
  char   TypeLigne;           // N: Normale, T: Titre, S: Sous-titre
 | 
			
		||||
                              // -: Ligne inférieur de sous-titre
 | 
			
		||||
  const unsigned char  * Ligne;
 | 
			
		||||
  const char * Ligne;
 | 
			
		||||
 | 
			
		||||
  Pos_Reel_X=Fenetre_Pos_X+(13*Menu_Facteur_X);
 | 
			
		||||
  Pos_Reel_Y=Fenetre_Pos_Y+(19*Menu_Facteur_Y);
 | 
			
		||||
@ -391,7 +391,7 @@ void Bouton_Stats(void)
 | 
			
		||||
 | 
			
		||||
  // Affichage du nombre de couleur utilisé
 | 
			
		||||
  Print_dans_fenetre(18,91,"Colors used:",STATS_COULEUR_TITRES,CM_Noir);
 | 
			
		||||
  bzero(Utilisation_couleur,256*sizeof(Utilisation_couleur[0]));
 | 
			
		||||
  memset(Utilisation_couleur,0,sizeof(Utilisation_couleur));
 | 
			
		||||
  sprintf(Buffer,"%d",Palette_Compter_nb_couleurs_utilisees(Utilisation_couleur));
 | 
			
		||||
  Print_dans_fenetre(122,91,Buffer,STATS_COULEUR_DONNEES,CM_Noir);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -331,7 +331,7 @@ void Bouton_Choix_backcolor(void)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//---------------------- Cacher ou réafficher le menu ------------------------
 | 
			
		||||
void Pixel_dans_barre_d_outil_cachee(word X,word Y,byte Couleur)
 | 
			
		||||
void Pixel_dans_barre_d_outil_cachee(__attribute__((unused)) word X,__attribute__((unused)) word Y,__attribute__((unused)) byte Couleur)
 | 
			
		||||
{
 | 
			
		||||
  // C'est fait exprès que ce soit vide...
 | 
			
		||||
  // C'est parce que y'a rien du tout à afficher vu que la barre d'outil est
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										10
									
								
								clavier.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								clavier.c
									
									
									
									
									
								
							@ -320,9 +320,9 @@ word Conversion_Touche(SDL_keysym Sym)
 | 
			
		||||
  // seront codées sur 11 bits, le 12e bit est mis à 1 (0x0800)
 | 
			
		||||
  if (Sym.sym != 0)
 | 
			
		||||
    Retour = Sym.sym;
 | 
			
		||||
  else if (Sym.scancode != 0)
 | 
			
		||||
  {
 | 
			
		||||
    Retour = (Sym.scancode & 0x07FF) | 0x0800;
 | 
			
		||||
  else if (Sym.scancode != 0)
 | 
			
		||||
  {
 | 
			
		||||
    Retour = (Sym.scancode & 0x07FF) | 0x0800;
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  if (Sym.mod & (KMOD_LSHIFT | KMOD_RSHIFT))
 | 
			
		||||
@ -331,7 +331,7 @@ word Conversion_Touche(SDL_keysym Sym)
 | 
			
		||||
    Retour |= MOD_CTRL;
 | 
			
		||||
  if (Sym.mod & (KMOD_LALT | KMOD_RALT | KMOD_MODE))
 | 
			
		||||
    Retour |= MOD_ALT;
 | 
			
		||||
  return Retour;
 | 
			
		||||
  return Retour;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char * Nom_touche(word Touche)
 | 
			
		||||
@ -447,7 +447,7 @@ const char * Nom_touche(word Touche)
 | 
			
		||||
  }
 | 
			
		||||
                             
 | 
			
		||||
  // Touches au libellé connu
 | 
			
		||||
  for (Indice=0; Indice < sizeof(Table_touches)/sizeof(S_Libelle_touche);Indice++)
 | 
			
		||||
  for (Indice=0; Indice < (long)sizeof(Table_touches)/(long)sizeof(S_Libelle_touche);Indice++)
 | 
			
		||||
  {
 | 
			
		||||
    if (Touche == Table_touches[Indice].Sym)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								divers.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								divers.c
									
									
									
									
									
								
							@ -135,7 +135,7 @@ void Effacer_image_courante(byte Couleur)
 | 
			
		||||
    );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Sensibilite_souris(word X,word Y)
 | 
			
		||||
void Sensibilite_souris(__attribute__((unused)) word X,__attribute__((unused)) word Y)
 | 
			
		||||
{
 | 
			
		||||
        puts("Sensibilite_souris non implémenté!");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								gfxcfg.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								gfxcfg.c
									
									
									
									
									
								
							@ -239,9 +239,9 @@ char * Interpretation_du_fichier_config()
 | 
			
		||||
  // Si la config contenait des touches, on les initialise:
 | 
			
		||||
  if (Chunk[CHUNK_TOUCHES].Taille)
 | 
			
		||||
  {
 | 
			
		||||
    int Indice_config;
 | 
			
		||||
    unsigned int Indice_config;
 | 
			
		||||
    Ptr = ChunkData[CHUNK_TOUCHES];
 | 
			
		||||
    for (Indice_config=0; Indice_config< Chunk[CHUNK_TOUCHES].Taille / sizeof(struct Config_Infos_touche) ; Indice_config++)
 | 
			
		||||
    for (Indice_config=0; Indice_config<Chunk[CHUNK_TOUCHES].Taille / sizeof(struct Config_Infos_touche) ; Indice_config++)
 | 
			
		||||
    {
 | 
			
		||||
      word Numero;
 | 
			
		||||
      word Touche;
 | 
			
		||||
@ -646,7 +646,7 @@ void Enregistrer_config()
 | 
			
		||||
 | 
			
		||||
/*** Main program ***/
 | 
			
		||||
 | 
			
		||||
int main(int argc, char * argv[])
 | 
			
		||||
int main(__attribute__((unused)) int argc, __attribute__((unused)) char *argv[])
 | 
			
		||||
{	
 | 
			
		||||
 | 
			
		||||
  if (Verifier_ecriture_possible())
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										9
									
								
								global.h
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								global.h
									
									
									
									
									
								
							@ -166,7 +166,6 @@ GLOBAL short Pinceau_Decalage_Y;
 | 
			
		||||
GLOBAL fonction_afficheur Pixel;          // Affiche un point à l'écran
 | 
			
		||||
GLOBAL fonction_afficheur Pixel_dans_menu;// Affiche un point dans le menu (ou pas si le menu est invisible)
 | 
			
		||||
GLOBAL fonction_lecteur   Lit_pixel;      // Teste la couleur d'un pixel dans l'écran
 | 
			
		||||
GLOBAL fonction_effaceur  Clear_screen;   // Efface rapidement tout l'écran (en faisant attention de ne pas effacer le menu)
 | 
			
		||||
GLOBAL fonction_display   Display_screen; // Affiche rapidement tout l'écran (en faisant attention de ne pas effacer le menu)
 | 
			
		||||
GLOBAL fonction_block     Block;          // Affiche rapidement un bloc à l'écran
 | 
			
		||||
GLOBAL fonction_afficheur Pixel_Preview_Normal; // Affiche un point de l'image à l'écran en mode normal (pas en mode loupe)
 | 
			
		||||
@ -418,10 +417,10 @@ GLOBAL byte Stencil[256];  // Tableau des couleurs prot
 | 
			
		||||
  // Mode grille:
 | 
			
		||||
 | 
			
		||||
GLOBAL byte  Snap_Mode;       // Le mode grille est enclenché
 | 
			
		||||
GLOBAL short Snap_Largeur;    // Largeur entre 2 points de la grille
 | 
			
		||||
GLOBAL short Snap_Hauteur;    // Hauteur entre 2 points de la grille
 | 
			
		||||
GLOBAL short Snap_Decalage_X; // Position en X du point le + à gauche
 | 
			
		||||
GLOBAL short Snap_Decalage_Y; // Position en Y du point le + en haut
 | 
			
		||||
GLOBAL word Snap_Largeur;    // Largeur entre 2 points de la grille
 | 
			
		||||
GLOBAL word Snap_Hauteur;    // Hauteur entre 2 points de la grille
 | 
			
		||||
GLOBAL word Snap_Decalage_X; // Position en X du point le + à gauche
 | 
			
		||||
GLOBAL word Snap_Decalage_Y; // Position en Y du point le + en haut
 | 
			
		||||
 | 
			
		||||
  // Mode trame:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										15
									
								
								graph.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								graph.c
									
									
									
									
									
								
							@ -1048,7 +1048,6 @@ void Initialiser_mode_video(int Largeur, int Hauteur, int Fullscreen)
 | 
			
		||||
        case MODE_SDL:
 | 
			
		||||
            Pixel = Pixel_SDL;
 | 
			
		||||
            Lit_pixel= Lit_Pixel_SDL;
 | 
			
		||||
            Clear_screen = Effacer_Tout_l_Ecran_SDL;
 | 
			
		||||
            Display_screen = Afficher_partie_de_l_ecran_SDL;
 | 
			
		||||
            Block = Block_SDL;
 | 
			
		||||
            Pixel_Preview_Normal = Pixel_Preview_Normal_SDL;
 | 
			
		||||
@ -1632,14 +1631,14 @@ void Print_nom_fichier(void)
 | 
			
		||||
 | 
			
		||||
  // -- Aucun effet en cours --
 | 
			
		||||
 | 
			
		||||
byte Aucun_effet(word X,word Y,byte Couleur)
 | 
			
		||||
byte Aucun_effet(__attribute__((unused)) word X,__attribute__((unused)) word Y,byte Couleur)
 | 
			
		||||
{
 | 
			
		||||
  return Couleur;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  // -- Effet de Shading --
 | 
			
		||||
 | 
			
		||||
byte Effet_Shade(word X,word Y,byte Couleur)
 | 
			
		||||
byte Effet_Shade(word X,word Y,__attribute__((unused)) byte Couleur)
 | 
			
		||||
{
 | 
			
		||||
  return Shade_Table[Lit_pixel_dans_ecran_feedback(X,Y)];
 | 
			
		||||
}
 | 
			
		||||
@ -1693,7 +1692,7 @@ byte Effet_Quick_shade(word X,word Y,byte Couleur)
 | 
			
		||||
 | 
			
		||||
  // -- Effet de Tiling --
 | 
			
		||||
 | 
			
		||||
byte Effet_Tiling(word X,word Y,byte Couleur)
 | 
			
		||||
byte Effet_Tiling(word X,word Y,__attribute__((unused)) byte Couleur)
 | 
			
		||||
{
 | 
			
		||||
  return Lit_pixel_dans_brosse((X+Brosse_Largeur-Tiling_Decalage_X)%Brosse_Largeur,
 | 
			
		||||
                               (Y+Brosse_Hauteur-Tiling_Decalage_Y)%Brosse_Hauteur);
 | 
			
		||||
@ -1701,7 +1700,7 @@ byte Effet_Tiling(word X,word Y,byte Couleur)
 | 
			
		||||
 | 
			
		||||
  // -- Effet de Smooth --
 | 
			
		||||
 | 
			
		||||
byte Effet_Smooth(word X,word Y,byte Couleur)
 | 
			
		||||
byte Effet_Smooth(word X,word Y,__attribute__((unused)) byte Couleur)
 | 
			
		||||
{
 | 
			
		||||
  int R,V,B;
 | 
			
		||||
  byte C;
 | 
			
		||||
@ -4145,7 +4144,7 @@ void Remplir(byte Couleur_de_remplissage)
 | 
			
		||||
  fonction_afficheur Pixel_figure;
 | 
			
		||||
 | 
			
		||||
  // Affichage d'un point de façon définitive (utilisation du pinceau)
 | 
			
		||||
  void inline Pixel_figure_Definitif(word Pos_X,word Pos_Y,byte Couleur)
 | 
			
		||||
  inline void Pixel_figure_Definitif(word Pos_X,word Pos_Y,byte Couleur)
 | 
			
		||||
  {
 | 
			
		||||
    Afficher_pinceau(Pos_X,Pos_Y,Couleur,0);
 | 
			
		||||
  }
 | 
			
		||||
@ -4161,7 +4160,7 @@ void Remplir(byte Couleur_de_remplissage)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // Affichage d'un point pour une preview en xor
 | 
			
		||||
  void Pixel_figure_Preview_xor(word Pos_X,word Pos_Y,byte Couleur)
 | 
			
		||||
  void Pixel_figure_Preview_xor(word Pos_X,word Pos_Y,__attribute__((unused)) byte Couleur)
 | 
			
		||||
  {
 | 
			
		||||
    if ( (Pos_X>=Limite_Gauche) &&
 | 
			
		||||
         (Pos_X<=Limite_Droite) &&
 | 
			
		||||
@ -4172,7 +4171,7 @@ void Remplir(byte Couleur_de_remplissage)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // Effacement d'un point de preview
 | 
			
		||||
  void Pixel_figure_Effacer_preview(word Pos_X,word Pos_Y,byte Couleur)
 | 
			
		||||
  void Pixel_figure_Effacer_preview(word Pos_X,word Pos_Y,__attribute__((unused)) byte Couleur)
 | 
			
		||||
  {
 | 
			
		||||
    if ( (Pos_X>=Limite_Gauche) &&
 | 
			
		||||
         (Pos_X<=Limite_Droite) &&
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										14
									
								
								init.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								init.c
									
									
									
									
									
								
							@ -72,7 +72,7 @@ void Chercher_repertoire_du_programme(char * Chaine)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Ajouter un lecteur à la liste de lecteurs
 | 
			
		||||
void Ajouter_lecteur(byte Numero, char Lettre, byte Type)
 | 
			
		||||
void Ajouter_lecteur(char Lettre, byte Type)
 | 
			
		||||
{
 | 
			
		||||
  Drive[Nb_drives].Lettre=Lettre;
 | 
			
		||||
  Drive[Nb_drives].Type  =Type;
 | 
			
		||||
@ -89,8 +89,8 @@ void Rechercher_drives(void)
 | 
			
		||||
	//Sous linux, il n'y a pas de lecteurs, on va juste mettre 
 | 
			
		||||
	// un disque dur qui pointera vers la racine,
 | 
			
		||||
	// et un autre vers le home directory de l'utilisateur.
 | 
			
		||||
	Ajouter_lecteur(0,'/', LECTEUR_HDD);
 | 
			
		||||
	Ajouter_lecteur(1,'~', LECTEUR_HDD);
 | 
			
		||||
	Ajouter_lecteur('/', LECTEUR_HDD);
 | 
			
		||||
	Ajouter_lecteur('~', LECTEUR_HDD);
 | 
			
		||||
   #else
 | 
			
		||||
	int DriveBits = GetLogicalDrives();
 | 
			
		||||
	int IndiceLecteur;
 | 
			
		||||
@ -125,7 +125,7 @@ void Rechercher_drives(void)
 | 
			
		||||
	        TypeLecteur=LECTEUR_NETWORK;
 | 
			
		||||
	        break;
 | 
			
		||||
	    }
 | 
			
		||||
	    Ajouter_lecteur(IndiceBit, 'A'+IndiceBit, TypeLecteur);
 | 
			
		||||
	    Ajouter_lecteur('A'+IndiceBit, TypeLecteur);
 | 
			
		||||
	    IndiceLecteur++;
 | 
			
		||||
	  }
 | 
			
		||||
	}
 | 
			
		||||
@ -1591,7 +1591,7 @@ int Charger_CFG(int Tout_charger)
 | 
			
		||||
  if ((Handle=fopen(Nom_du_fichier,"rb"))==NULL)
 | 
			
		||||
    return ERREUR_CFG_ABSENT;
 | 
			
		||||
 | 
			
		||||
  if ( (Taille_fichier<sizeof(CFG_Header))
 | 
			
		||||
  if ( (Taille_fichier<(long)sizeof(CFG_Header))
 | 
			
		||||
    || (!read_bytes(Handle, &CFG_Header.Signature, 3))
 | 
			
		||||
    || memcmp(CFG_Header.Signature,"CFG",3)
 | 
			
		||||
    || (!read_byte(Handle, &CFG_Header.Version1))
 | 
			
		||||
@ -1624,7 +1624,7 @@ int Charger_CFG(int Tout_charger)
 | 
			
		||||
      case CHUNK_TOUCHES: // Touches
 | 
			
		||||
        if (Tout_charger)
 | 
			
		||||
        {
 | 
			
		||||
          for (Indice=0; Indice<(Chunk.Taille/sizeof(CFG_Infos_touche)); Indice++)
 | 
			
		||||
          for (Indice=0; Indice<(long)(Chunk.Taille/sizeof(CFG_Infos_touche)); Indice++)
 | 
			
		||||
          {
 | 
			
		||||
            if (!read_word_le(Handle, &CFG_Infos_touche.Numero) ||
 | 
			
		||||
                !read_word_le(Handle, &CFG_Infos_touche.Touche) ||
 | 
			
		||||
@ -1666,7 +1666,7 @@ int Charger_CFG(int Tout_charger)
 | 
			
		||||
        }
 | 
			
		||||
        break;
 | 
			
		||||
      case CHUNK_MODES_VIDEO: // Modes vidéo
 | 
			
		||||
        for (Indice=0; Indice<(Chunk.Taille/sizeof(CFG_Mode_video)); Indice++)
 | 
			
		||||
        for (Indice=0; Indice<(long)(Chunk.Taille/sizeof(CFG_Mode_video)); Indice++)
 | 
			
		||||
        {
 | 
			
		||||
          if (!read_byte(Handle, &CFG_Mode_video.Etat) ||
 | 
			
		||||
              !read_word_le(Handle, &CFG_Mode_video.Largeur) ||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										44
									
								
								loadsave.c
									
									
									
									
									
								
							
							
						
						
									
										44
									
								
								loadsave.c
									
									
									
									
									
								
							@ -391,8 +391,7 @@ void Nom_fichier_complet(char * Nom_du_fichier, byte Sauve_Colorix)
 | 
			
		||||
void Lire_octet(FILE * Fichier, byte *Octet)
 | 
			
		||||
{
 | 
			
		||||
  // FIXME : Remplacer les appelants par read_bytes(), et gérer les retours d'erreur.
 | 
			
		||||
  if (!read_byte(Fichier, Octet))
 | 
			
		||||
  ;//  Erreur_fichier = 2;
 | 
			
		||||
  read_byte(Fichier, Octet);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// --------------------------------------------------------------------------
 | 
			
		||||
@ -426,23 +425,8 @@ void Close_ecriture(FILE *Fichier)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
void (/*__interrupt __near*/ *Ancien_handler_clavier)(void);
 | 
			
		||||
void /*__interrupt __near*/ Nouveau_handler_clavier(void)
 | 
			
		||||
{
 | 
			
		||||
  /* A revoir ...
 | 
			
		||||
  _disable();
 | 
			
		||||
  if (!Erreur_fichier)
 | 
			
		||||
    Erreur_fichier=-1;
 | 
			
		||||
  _enable();
 | 
			
		||||
  _chain_intr(Ancien_handler_clavier);
 | 
			
		||||
  */
 | 
			
		||||
  ;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// -------- Modifier la valeur du code d'erreur d'accès à un fichier --------
 | 
			
		||||
//   On n'est pas obligé d'utiliser cette fonction à chaque fois mais il est
 | 
			
		||||
// important de l'utiliser dans les cas du type:
 | 
			
		||||
@ -495,25 +479,11 @@ void Charger_image(byte Image)
 | 
			
		||||
  // Si on a su déterminer avec succès le format du fichier:
 | 
			
		||||
  if (!Erreur_fichier)
 | 
			
		||||
  {
 | 
			
		||||
    // Installer le handler d'interruption du clavier pour stopper une preview
 | 
			
		||||
    if (Pixel_de_chargement==Pixel_Chargement_dans_preview)
 | 
			
		||||
    {
 | 
			
		||||
        /* A revoir ...
 | 
			
		||||
      Ancien_handler_clavier=_dos_getvect(9);
 | 
			
		||||
      _dos_setvect(9,Nouveau_handler_clavier);
 | 
			
		||||
      */;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // On peut charger le fichier:
 | 
			
		||||
    Image_24b=0;
 | 
			
		||||
    Format_Load[Format]();
 | 
			
		||||
 | 
			
		||||
    // Désinstaller le handler d'interruption du clavier
 | 
			
		||||
    if (Pixel_de_chargement==Pixel_Chargement_dans_preview)
 | 
			
		||||
    /*A revoir ...
 | 
			
		||||
      _dos_setvect(9,Ancien_handler_clavier);
 | 
			
		||||
      */;
 | 
			
		||||
 | 
			
		||||
    if (Erreur_fichier>0)
 | 
			
		||||
      Erreur(0);
 | 
			
		||||
 | 
			
		||||
@ -1658,7 +1628,7 @@ void Load_LBM(void)
 | 
			
		||||
        read_dword_be(LBM_Fichier,&Nb_couleurs);
 | 
			
		||||
        Nb_couleurs/=3;
 | 
			
		||||
 | 
			
		||||
        if (((int)1<<Header.BitPlanes)!=Nb_couleurs)
 | 
			
		||||
        if (((dword)1<<Header.BitPlanes)!=Nb_couleurs)
 | 
			
		||||
        {
 | 
			
		||||
          if ((Nb_couleurs==32) && (Header.BitPlanes==6))
 | 
			
		||||
          {              // Ce n'est pas une image HAM mais une image 64 coul.
 | 
			
		||||
@ -3422,7 +3392,7 @@ void Test_PCX(void)
 | 
			
		||||
// -- Lire un fichier au format PCX -----------------------------------------
 | 
			
		||||
 | 
			
		||||
  // -- Afficher une ligne PCX codée sur 1 seul plan avec moins de 256 c. --
 | 
			
		||||
  void Draw_PCX_line(short Pos_Y, short Vraie_taille_ligne, byte Depth)
 | 
			
		||||
  void Draw_PCX_line(short Pos_Y, byte Depth)
 | 
			
		||||
  {
 | 
			
		||||
    short Pos_X;
 | 
			
		||||
    byte  Couleur;
 | 
			
		||||
@ -3646,7 +3616,7 @@ void Load_PCX(void)
 | 
			
		||||
                  if (PCX_Header.Depth==1)
 | 
			
		||||
                    Draw_ILBM_line(Pos_Y,Vraie_taille_ligne);
 | 
			
		||||
                  else
 | 
			
		||||
                    Draw_PCX_line(Pos_Y,Vraie_taille_ligne,PCX_Header.Depth);
 | 
			
		||||
                    Draw_PCX_line(Pos_Y,PCX_Header.Depth);
 | 
			
		||||
                }
 | 
			
		||||
              }
 | 
			
		||||
 | 
			
		||||
@ -3666,7 +3636,7 @@ void Load_PCX(void)
 | 
			
		||||
                    if (PCX_Header.Depth==1)
 | 
			
		||||
                      Draw_ILBM_line(Pos_Y,Vraie_taille_ligne);
 | 
			
		||||
                    else
 | 
			
		||||
                      Draw_PCX_line(Pos_Y,Vraie_taille_ligne,PCX_Header.Depth);
 | 
			
		||||
                      Draw_PCX_line(Pos_Y,PCX_Header.Depth);
 | 
			
		||||
                  }
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
@ -3996,8 +3966,8 @@ void Load_CEL(void)
 | 
			
		||||
    if (read_bytes(Fichier,&Header1,sizeof(T_CEL_Header1)))
 | 
			
		||||
    {
 | 
			
		||||
      Taille_du_fichier=Informations_Fichier.st_size;
 | 
			
		||||
      if ( (Taille_du_fichier>sizeof(T_CEL_Header1))
 | 
			
		||||
        && ( (((Header1.Width+1)>>1)*Header1.Height)==(Taille_du_fichier-sizeof(T_CEL_Header1)) ) )
 | 
			
		||||
      if ( (Taille_du_fichier>(long int)sizeof(T_CEL_Header1))
 | 
			
		||||
        && ( (((Header1.Width+1)>>1)*Header1.Height)==(Taille_du_fichier-(long int)sizeof(T_CEL_Header1)) ) )
 | 
			
		||||
      {
 | 
			
		||||
        // Chargement d'un fichier CEL sans signature (vieux fichiers)
 | 
			
		||||
        Principal_Largeur_image=Header1.Width;
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										279
									
								
								op_asm.c
									
									
									
									
									
								
							
							
						
						
									
										279
									
								
								op_asm.c
									
									
									
									
									
								
							@ -1,279 +0,0 @@
 | 
			
		||||
/*  Grafx2 - The Ultimate 256-color bitmap paint program
 | 
			
		||||
 | 
			
		||||
    Copyright 2007 Adrien Destugues
 | 
			
		||||
    Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
 | 
			
		||||
 | 
			
		||||
    Grafx2 is free software; you can redistribute it and/or
 | 
			
		||||
    modify it under the terms of the GNU General Public License
 | 
			
		||||
    as published by the Free Software Foundation; version 2
 | 
			
		||||
    of the License.
 | 
			
		||||
 | 
			
		||||
    Grafx2 is distributed in the hope that it will be useful,
 | 
			
		||||
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
    GNU General Public License for more details.
 | 
			
		||||
 | 
			
		||||
    You should have received a copy of the GNU General Public License
 | 
			
		||||
    along with Grafx2; if not, see <http://www.gnu.org/licenses/> or
 | 
			
		||||
    write to the Free Software Foundation, Inc.,
 | 
			
		||||
    59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 | 
			
		||||
*/
 | 
			
		||||
#include "op_c.h"
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
#include "graph.h"
 | 
			
		||||
 | 
			
		||||
/*************************************************************************************
 | 
			
		||||
 * Diffusion d'erreur avec l'algorithme de Floyd-Steinberg pour conversion 24b > 256c
 | 
			
		||||
 * Pour chaque pixel de la source :
 | 
			
		||||
 *  1) On fait une recherche dans la palette pour trouver la couleurs plus proche
 | 
			
		||||
 *  2) On calcule la différence avec la vraie couleur
 | 
			
		||||
 *  3) On répartit cette différence entre les pixels autours avec les coefs:
 | 
			
		||||
 *  	- 7/16 pour le pixel de droite
 | 
			
		||||
 *  	- 3/16 pour le pixel en bas à gauche
 | 
			
		||||
 *  	- 5/16 pour le pixel en dessous
 | 
			
		||||
 *  	- 1/16 pour le pixel en bas à droite
 | 
			
		||||
 *  Cette différence est appliquée directement à la source, et sera prise en compte
 | 
			
		||||
 *  lors du traitement des pixels suivants (on ne touche pas aux pixels qui sont au
 | 
			
		||||
 *  dessus ou à gauche de celui en cours !)
 | 
			
		||||
 ************************************************************************************/
 | 
			
		||||
 | 
			
		||||
void OPASM_DitherFS_6123(
 | 
			
		||||
  Bitmap256            Destination,  // Pointeur sur le 1er pixel de la ligne
 | 
			
		||||
  Bitmap24B            Source,       // Idem mais sur la source
 | 
			
		||||
  int                  Largeur,      // Largeur à traiter, =(largeur_image-2), (>0)
 | 
			
		||||
  struct Composantes * Palette,      // Palette de l'image destination
 | 
			
		||||
  byte *               TableC,       // Table de conversion 24b->8b
 | 
			
		||||
  byte                 ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte                 ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte                 ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte                 NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte                 NbbB)         // Nb_bits_bleus
 | 
			
		||||
{
 | 
			
		||||
	byte DSFRouge,DSFVert,DSFBleu=0,DSFRougeAD,DSFVertAD,DSFBleuAD;
 | 
			
		||||
	int VarA;
 | 
			
		||||
	Bitmap24B PixelCourant, Cible;
 | 
			
		||||
 | 
			
		||||
	// Pour chaque pixel sur la largeur
 | 
			
		||||
	for(VarA=0;VarA<Largeur;VarA++)
 | 
			
		||||
	{
 | 
			
		||||
		PixelCourant = Source + VarA;
 | 
			
		||||
		// On regarde la meilleure couleur d'après la table de conversion 24b>8b
 | 
			
		||||
		DSFRougeAD = PixelCourant->R - ReducR;
 | 
			
		||||
		DSFVertAD = PixelCourant->V - ReducV;
 | 
			
		||||
		DSFBleuAD = PixelCourant->B - ReducB;
 | 
			
		||||
 | 
			
		||||
		*Destination = *(TableC  + DSFRougeAD*256*256 + DSFVertAD*256 + DSFBleu);
 | 
			
		||||
 | 
			
		||||
		// On calcule l'erreur
 | 
			
		||||
		DSFRouge = PixelCourant->R - Palette[*Destination].R;
 | 
			
		||||
		DSFVert = PixelCourant->V - Palette[*Destination].V;
 | 
			
		||||
		DSFBleu = PixelCourant->B - Palette[*Destination].B;
 | 
			
		||||
 | 
			
		||||
		// On diffuse l'erreur sur le pixel de droite (6)
 | 
			
		||||
		DSFRougeAD = (DSFRouge*7)/16;
 | 
			
		||||
		DSFVertAD = (DSFVert*7)/16;
 | 
			
		||||
		DSFBleuAD = (DSFBleu*7)/16;
 | 
			
		||||
 | 
			
		||||
		// Diffusion de l'erreur dans la source
 | 
			
		||||
		Cible = PixelCourant + 1; // "Pixel à droite"
 | 
			
		||||
		Cible->R = Max(Cible->R + DSFRougeAD,255);
 | 
			
		||||
		Cible->V = Max(Cible->V + DSFVertAD,255);
 | 
			
		||||
		Cible->B = Max(Cible->B + DSFBleuAD,255);
 | 
			
		||||
 | 
			
		||||
		// On diffuse sur le pixel en bas à gauche (1)
 | 
			
		||||
		DSFRougeAD = (DSFRouge*3)/16;
 | 
			
		||||
		DSFVertAD = (DSFVert*3)/16;
 | 
			
		||||
		DSFBleuAD = (DSFBleu*3)/16;
 | 
			
		||||
 | 
			
		||||
		Cible = PixelCourant + Largeur; // "Pixel en bas à gauche"
 | 
			
		||||
		Cible->R = Max(Cible->R + DSFRougeAD,255);
 | 
			
		||||
		Cible->V = Max(Cible->V + DSFVertAD,255);
 | 
			
		||||
		Cible->B = Max(Cible->B + DSFBleuAD,255);
 | 
			
		||||
 | 
			
		||||
		// On diffuse sur le pixel en dessous (2)
 | 
			
		||||
		DSFRougeAD = (DSFRouge*5)/16;
 | 
			
		||||
		DSFVertAD = (DSFVert*5)/16;
 | 
			
		||||
		DSFBleuAD = (DSFBleu*5)/16;
 | 
			
		||||
 | 
			
		||||
		Cible ++; // "Pixel en dessous"
 | 
			
		||||
		Cible->R = Max(Cible->R + DSFRougeAD,255);
 | 
			
		||||
		Cible->V = Max(Cible->V + DSFVertAD,255);
 | 
			
		||||
		Cible->B = Max(Cible->B + DSFBleuAD,255);
 | 
			
		||||
 | 
			
		||||
		// On diffuse sur le pixel en dessous (2)
 | 
			
		||||
		DSFRougeAD = (DSFRouge*1)/16;
 | 
			
		||||
		DSFVertAD = (DSFVert*1)/16;
 | 
			
		||||
		DSFBleuAD = (DSFBleu*1)/16;
 | 
			
		||||
 | 
			
		||||
		Cible ++; // "Pixel en bas à droite"
 | 
			
		||||
		Cible->R = Max(Cible->R + DSFRougeAD,255);
 | 
			
		||||
		Cible->V = Max(Cible->V + DSFVertAD,255);
 | 
			
		||||
		Cible->B = Max(Cible->B + DSFBleuAD,255);
 | 
			
		||||
 | 
			
		||||
		Destination++;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
  
 | 
			
		||||
/* Les fonctions ci-dessous servent pour les pixels des bords et des coins, car on ne peut pas les traiter normalement
 | 
			
		||||
 * (segfault ou dithering sur l'autre bout de l'image) */
 | 
			
		||||
 | 
			
		||||
void OPASM_DitherFS_623(
 | 
			
		||||
  Bitmap256            Destination,  // Pointeur sur le 1er pixel de la ligne
 | 
			
		||||
  Bitmap24B            Source,       // Idem mais sur la source
 | 
			
		||||
  int                  Largeur,      // Largeur à traiter, =(largeur_image-2), (>0)
 | 
			
		||||
  struct Composantes * Palette,      // Palette de l'image destination
 | 
			
		||||
  byte *               TableC,       // Table de conversion 24b->8b
 | 
			
		||||
  byte                 ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte                 ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte                 ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte                 NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte                 NbbB)         // Nb_bits_bleus
 | 
			
		||||
{
 | 
			
		||||
	puts("OPASM_DitherFS_623 non implémenté!");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void OPASM_DitherFS_12(
 | 
			
		||||
  Bitmap256            Destination,  // Pointeur sur le 1er pixel de la ligne
 | 
			
		||||
  Bitmap24B            Source,       // Idem mais sur la source
 | 
			
		||||
  int                  Largeur,      // Largeur à traiter, =(largeur_image-2), (>0)
 | 
			
		||||
  struct Composantes * Palette,      // Palette de l'image destination
 | 
			
		||||
  byte *               TableC,       // Table de conversion 24b->8b
 | 
			
		||||
  byte                 ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte                 ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte                 ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte                 NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte                 NbbB)         // Nb_bits_bleus
 | 
			
		||||
{
 | 
			
		||||
	puts("OPASM_DitherFS_12 non implémenté!");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void OPASM_DitherFS_6(
 | 
			
		||||
  Bitmap256            Destination,  // Pointeur sur le 1er pixel de la ligne
 | 
			
		||||
  Bitmap24B            Source,       // Idem mais sur la source
 | 
			
		||||
  int                  Largeur,      // Largeur à traiter, =(largeur_image-1), (>0)
 | 
			
		||||
  struct Composantes * Palette,      // Palette de l'image destination
 | 
			
		||||
  byte *               TableC,       // Table de conversion 24b->8b
 | 
			
		||||
  byte                 ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte                 ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte                 ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte                 NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte                 NbbB)         // Nb_bits_bleus
 | 
			
		||||
{
 | 
			
		||||
	puts("OPASM_DitherFS_6 non implémenté!");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  void OPASM_DitherFS(
 | 
			
		||||
  Bitmap256 Destination,  // Pointeur sur le pixel
 | 
			
		||||
  Bitmap24B Source,       // Idem mais sur la source
 | 
			
		||||
  byte *    TableC,       // Table de conversion 24b->8b
 | 
			
		||||
  byte      ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte      ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte      ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte      NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte      NbbB)         // Nb_bits_bleus
 | 
			
		||||
{
 | 
			
		||||
	puts("OPASM_DitherFS non implémenté!");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void OPASM_DitherFS_2(
 | 
			
		||||
  Bitmap256            Destination,  // Pointeur sur le 1er pixel de la colonne
 | 
			
		||||
  Bitmap24B            Source,       // Idem mais sur la source
 | 
			
		||||
  int                  Hauteur,      // Hauteur à traiter, =(hauteur_image-1), (>0)
 | 
			
		||||
  struct Composantes * Palette,      // Palette de l'image destination
 | 
			
		||||
  byte *               TableC,       // Table de conversion 24b->8b
 | 
			
		||||
  byte                 ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte                 ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte                 ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte                 NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte                 NbbB)         // Nb_bits_bleus
 | 
			
		||||
{
 | 
			
		||||
	puts("OPASM_DitherFS_2 non implémenté!");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  void OPASM_Split_cluster_Rouge(
 | 
			
		||||
  int * tableO, // Table d'occurences
 | 
			
		||||
  int   rmin,   // rmin << rdec
 | 
			
		||||
  int   vmin,   // vmin << vdec
 | 
			
		||||
  int   bmin,   // bmin << bdec
 | 
			
		||||
  int   rmax,   // rmax << rdec
 | 
			
		||||
  int   vmax,   // vmin << vdec
 | 
			
		||||
  int   bmax,   // bmin << bdec
 | 
			
		||||
  int   rinc,   // Incrémentation sur les rouges 1 << rdec
 | 
			
		||||
  int   vinc,   // Incrémentation sur les verts  1 << vdec
 | 
			
		||||
  int   binc,   // Incrémentation sur les bleus  1 << bdec
 | 
			
		||||
  int   limite, // Nombre d'occurences minimales
 | 
			
		||||
  int   rdec,   // rdec
 | 
			
		||||
  int * rouge)  // Valeur du rouge atteignant la limite
 | 
			
		||||
{
 | 
			
		||||
	puts("OPASM_Split_cluster_Rouge non implémenté!");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void OPASM_Split_cluster_Vert(
 | 
			
		||||
  int * tableO, // Table d'occurences
 | 
			
		||||
  int   rmin,   // rmin << rdec
 | 
			
		||||
  int   vmin,   // vmin << vdec
 | 
			
		||||
  int   bmin,   // bmin << bdec
 | 
			
		||||
  int   rmax,   // rmax << rdec
 | 
			
		||||
  int   vmax,   // vmin << vdec
 | 
			
		||||
  int   bmax,   // bmin << bdec
 | 
			
		||||
  int   rinc,   // Incrémentation sur les rouges 1 << rdec
 | 
			
		||||
  int   vinc,   // Incrémentation sur les verts  1 << vdec
 | 
			
		||||
  int   binc,   // Incrémentation sur les bleus  1 << bdec
 | 
			
		||||
  int   limite, // Nombre d'occurences minimales
 | 
			
		||||
  int   vdec,   // vdec
 | 
			
		||||
  int * vert)   // Valeur du vert atteignant la limite
 | 
			
		||||
{
 | 
			
		||||
	puts("OPASM_Split_cluster_Vert non implémenté!");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void OPASM_Split_cluster_Bleu(
 | 
			
		||||
  int * tableO, // Table d'occurences
 | 
			
		||||
  int   rmin,   // rmin << rdec
 | 
			
		||||
  int   vmin,   // vmin << vdec
 | 
			
		||||
  int   bmin,   // bmin << bdec
 | 
			
		||||
  int   rmax,   // rmax << rdec
 | 
			
		||||
  int   vmax,   // vmin << vdec
 | 
			
		||||
  int   bmax,   // bmin << bdec
 | 
			
		||||
  int   rinc,   // Incrémentation sur les rouges 1 << rdec
 | 
			
		||||
  int   vinc,   // Incrémentation sur les verts  1 << vdec
 | 
			
		||||
  int   binc,   // Incrémentation sur les bleus  1 << bdec
 | 
			
		||||
  int   limite, // Nombre d'occurences minimales
 | 
			
		||||
  int   bdec,   // bdec
 | 
			
		||||
  int * bleu)   // Valeur du bleu atteignant la limite
 | 
			
		||||
{
 | 
			
		||||
	puts("OPASM_Split_cluster_Bleu non implémenté!");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  void OPASM_Compter_occurences(
 | 
			
		||||
  int *     Destination,  // Pointeur sur la table d'occurences
 | 
			
		||||
  Bitmap24B Source,       // Pointeur sur l'image
 | 
			
		||||
  int       Taille,       // Nombre de pixels dans l'image
 | 
			
		||||
  byte      ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte      ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte      ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte      NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte      NbbB)         // Nb_bits_bleus
 | 
			
		||||
{
 | 
			
		||||
	puts("OPASM_Compter_occurences non implémenté!");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void OPASM_Analyser_cluster(
 | 
			
		||||
  int * TableO, // Table d'occurences
 | 
			
		||||
  int * rmin,   // rmin << rdec
 | 
			
		||||
  int * vmin,   // vmin << vdec
 | 
			
		||||
  int * bmin,   // bmin << bdec
 | 
			
		||||
  int * rmax,   // rmax << rdec
 | 
			
		||||
  int * vmax,   // vmax << vdec
 | 
			
		||||
  int * bmax,   // bmax << bdec
 | 
			
		||||
  int   rdec,   // rdec
 | 
			
		||||
  int   vdec,   // vdec
 | 
			
		||||
  int   bdec,   // bdec
 | 
			
		||||
  int   rinc,   // Incrémentation sur les rouges 1 << rdec
 | 
			
		||||
  int   vinc,   // Incrémentation sur les verts  1 << vdec
 | 
			
		||||
  int   binc,   // Incrémentation sur les bleus  1 << bdec
 | 
			
		||||
  int * Nbocc)  // Nombre d'occurences
 | 
			
		||||
{
 | 
			
		||||
	puts("OPASM_Analyser_cluster non implémenté!");
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										147
									
								
								op_asm.h
									
									
									
									
									
								
							
							
						
						
									
										147
									
								
								op_asm.h
									
									
									
									
									
								
							@ -1,147 +0,0 @@
 | 
			
		||||
#ifndef _OP_ASM_H_
 | 
			
		||||
#define _OP_ASM_H_
 | 
			
		||||
 | 
			
		||||
void OPASM_DitherFS_6123(
 | 
			
		||||
  Bitmap256            Destination,  // Pointeur sur le 1er pixel de la ligne
 | 
			
		||||
  Bitmap24B            Source,       // Idem mais sur la source
 | 
			
		||||
  int                  Largeur,      // Largeur à traiter, =(largeur_image-2), (>0)
 | 
			
		||||
  struct Composantes * Palette,      // Palette de l'image destination
 | 
			
		||||
  byte *               TableC,       // Table de conversion 24b->8b
 | 
			
		||||
  byte                 ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte                 ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte                 ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte                 NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte                 NbbB);        // Nb_bits_bleus
 | 
			
		||||
 | 
			
		||||
void OPASM_DitherFS_623(
 | 
			
		||||
  Bitmap256            Destination,  // Pointeur sur le 1er pixel de la ligne
 | 
			
		||||
  Bitmap24B            Source,       // Idem mais sur la source
 | 
			
		||||
  int                  Largeur,      // Largeur à traiter, =(largeur_image-2), (>0)
 | 
			
		||||
  struct Composantes * Palette,      // Palette de l'image destination
 | 
			
		||||
  byte *               TableC,       // Table de conversion 24b->8b
 | 
			
		||||
  byte                 ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte                 ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte                 ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte                 NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte                 NbbB);        // Nb_bits_bleus
 | 
			
		||||
 | 
			
		||||
void OPASM_DitherFS_12(
 | 
			
		||||
  Bitmap256            Destination,  // Pointeur sur le 1er pixel de la ligne
 | 
			
		||||
  Bitmap24B            Source,       // Idem mais sur la source
 | 
			
		||||
  int                  Largeur,      // Largeur à traiter, =(largeur_image-2), (>0)
 | 
			
		||||
  struct Composantes * Palette,      // Palette de l'image destination
 | 
			
		||||
  byte *               TableC,       // Table de conversion 24b->8b
 | 
			
		||||
  byte                 ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte                 ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte                 ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte                 NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte                 NbbB);        // Nb_bits_bleus
 | 
			
		||||
 | 
			
		||||
void OPASM_DitherFS_6(
 | 
			
		||||
  Bitmap256            Destination,  // Pointeur sur le 1er pixel de la ligne
 | 
			
		||||
  Bitmap24B            Source,       // Idem mais sur la source
 | 
			
		||||
  int                  Largeur,      // Largeur à traiter, =(largeur_image-1), (>0)
 | 
			
		||||
  struct Composantes * Palette,      // Palette de l'image destination
 | 
			
		||||
  byte *               TableC,       // Table de conversion 24b->8b
 | 
			
		||||
  byte                 ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte                 ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte                 ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte                 NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte                 NbbB);        // Nb_bits_bleus
 | 
			
		||||
 | 
			
		||||
void OPASM_DitherFS(
 | 
			
		||||
  Bitmap256 Destination,  // Pointeur sur le pixel
 | 
			
		||||
  Bitmap24B Source,       // Idem mais sur la source
 | 
			
		||||
  byte *    TableC,       // Table de conversion 24b->8b
 | 
			
		||||
  byte      ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte      ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte      ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte      NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte      NbbB);        // Nb_bits_bleus
 | 
			
		||||
 | 
			
		||||
void OPASM_DitherFS_2(
 | 
			
		||||
  Bitmap256            Destination,  // Pointeur sur le 1er pixel de la colonne
 | 
			
		||||
  Bitmap24B            Source,       // Idem mais sur la source
 | 
			
		||||
  int                  Hauteur,      // Hauteur à traiter, =(hauteur_image-1), (>0)
 | 
			
		||||
  struct Composantes * Palette,      // Palette de l'image destination
 | 
			
		||||
  byte *               TableC,       // Table de conversion 24b->8b
 | 
			
		||||
  byte                 ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte                 ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte                 ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte                 NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte                 NbbB);        // Nb_bits_bleus
 | 
			
		||||
 | 
			
		||||
void OPASM_Compter_occurences(
 | 
			
		||||
  int *     Destination,  // Pointeur sur la table d'occurences
 | 
			
		||||
  Bitmap24B Source,       // Pointeur sur l'image
 | 
			
		||||
  int       Taille,       // Nombre de pixels dans l'image
 | 
			
		||||
  byte      ReducR,       // 8-Nb_bits_rouges
 | 
			
		||||
  byte      ReducV,       // 8-Nb_bits_verts
 | 
			
		||||
  byte      ReducB,       // 8-Nb_bits_bleus
 | 
			
		||||
  byte      NbbV,         // Nb_bits_verts
 | 
			
		||||
  byte      NbbB);        // Nb_bits_bleus
 | 
			
		||||
 | 
			
		||||
void OPASM_Analyser_cluster(
 | 
			
		||||
  int * TableO, // Table d'occurences
 | 
			
		||||
  int * rmin,   // rmin << rdec
 | 
			
		||||
  int * vmin,   // vmin << vdec
 | 
			
		||||
  int * bmin,   // bmin << bdec
 | 
			
		||||
  int * rmax,   // rmax << rdec
 | 
			
		||||
  int * vmax,   // vmax << vdec
 | 
			
		||||
  int * bmax,   // bmax << bdec
 | 
			
		||||
  int   rdec,   // rdec
 | 
			
		||||
  int   vdec,   // vdec
 | 
			
		||||
  int   bdec,   // bdec
 | 
			
		||||
  int   rinc,   // Incrémentation sur les rouges 1 << rdec
 | 
			
		||||
  int   vinc,   // Incrémentation sur les verts  1 << vdec
 | 
			
		||||
  int   binc,   // Incrémentation sur les bleus  1 << bdec
 | 
			
		||||
  int * Nbocc); // Nombre d'occurences
 | 
			
		||||
 | 
			
		||||
void OPASM_Split_cluster_Rouge(
 | 
			
		||||
  int * tableO, // Table d'occurences
 | 
			
		||||
  int   rmin,   // rmin << rdec
 | 
			
		||||
  int   vmin,   // vmin << vdec
 | 
			
		||||
  int   bmin,   // bmin << bdec
 | 
			
		||||
  int   rmax,   // rmax << rdec
 | 
			
		||||
  int   vmax,   // vmin << vdec
 | 
			
		||||
  int   bmax,   // bmin << bdec
 | 
			
		||||
  int   rinc,   // Incrémentation sur les rouges 1 << rdec
 | 
			
		||||
  int   vinc,   // Incrémentation sur les verts  1 << vdec
 | 
			
		||||
  int   binc,   // Incrémentation sur les bleus  1 << bdec
 | 
			
		||||
  int   limite, // Nombre d'occurences minimales
 | 
			
		||||
  int   rdec,   // rdec
 | 
			
		||||
  int * rouge); // Valeur du rouge atteignant la limite
 | 
			
		||||
 | 
			
		||||
void OPASM_Split_cluster_Vert(
 | 
			
		||||
  int * tableO, // Table d'occurences
 | 
			
		||||
  int   rmin,   // rmin << rdec
 | 
			
		||||
  int   vmin,   // vmin << vdec
 | 
			
		||||
  int   bmin,   // bmin << bdec
 | 
			
		||||
  int   rmax,   // rmax << rdec
 | 
			
		||||
  int   vmax,   // vmin << vdec
 | 
			
		||||
  int   bmax,   // bmin << bdec
 | 
			
		||||
  int   rinc,   // Incrémentation sur les rouges 1 << rdec
 | 
			
		||||
  int   vinc,   // Incrémentation sur les verts  1 << vdec
 | 
			
		||||
  int   binc,   // Incrémentation sur les bleus  1 << bdec
 | 
			
		||||
  int   limite, // Nombre d'occurences minimales
 | 
			
		||||
  int   vdec,   // vdec
 | 
			
		||||
  int * vert);  // Valeur du vert atteignant la limite
 | 
			
		||||
 | 
			
		||||
void OPASM_Split_cluster_Bleu(
 | 
			
		||||
  int * tableO, // Table d'occurences
 | 
			
		||||
  int   rmin,   // rmin << rdec
 | 
			
		||||
  int   vmin,   // vmin << vdec
 | 
			
		||||
  int   bmin,   // bmin << bdec
 | 
			
		||||
  int   rmax,   // rmax << rdec
 | 
			
		||||
  int   vmax,   // vmin << vdec
 | 
			
		||||
  int   bmax,   // bmin << bdec
 | 
			
		||||
  int   rinc,   // Incrémentation sur les rouges 1 << rdec
 | 
			
		||||
  int   vinc,   // Incrémentation sur les verts  1 << vdec
 | 
			
		||||
  int   binc,   // Incrémentation sur les bleus  1 << bdec
 | 
			
		||||
  int   limite, // Nombre d'occurences minimales
 | 
			
		||||
  int   bdec,   // bdec
 | 
			
		||||
  int * bleu);  // Valeur du bleu atteignant la limite
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										5
									
								
								op_c.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								op_c.c
									
									
									
									
									
								
							@ -25,7 +25,6 @@
 | 
			
		||||
#include <fcntl.h>
 | 
			
		||||
#include <sys/stat.h>
 | 
			
		||||
#include "op_c.h"
 | 
			
		||||
#include "op_asm.h"
 | 
			
		||||
#include "erreurs.h"
 | 
			
		||||
 | 
			
		||||
#undef OPTIMISATIONS_ASSEMBLEUR
 | 
			
		||||
@ -790,7 +789,7 @@ void CS_Trier_par_luminance(ClusterSet * cs)
 | 
			
		||||
  cs->clusters=nc;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_occurence * to,Table_conversion * tc,struct Composantes * palette)
 | 
			
		||||
void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_conversion * tc,struct Composantes * palette)
 | 
			
		||||
{
 | 
			
		||||
  int indice;
 | 
			
		||||
  int r,v,b;
 | 
			
		||||
@ -957,7 +956,7 @@ Table_conversion * Optimiser_palette(Bitmap24B image,int taille,struct Composant
 | 
			
		||||
        CS_Trier_par_chrominance(cs);
 | 
			
		||||
 | 
			
		||||
	// Enfin on génère la palette et la table de correspondance entre chaque couleur 24b et sa couleur palette associée.
 | 
			
		||||
        CS_Generer_TC_et_Palette(cs,to,tc,palette);
 | 
			
		||||
        CS_Generer_TC_et_Palette(cs,tc,palette);
 | 
			
		||||
 | 
			
		||||
        CS_Delete(cs);
 | 
			
		||||
        TO_Delete(to);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								op_c.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								op_c.h
									
									
									
									
									
								
							@ -184,7 +184,7 @@ void CS_Get(ClusterSet * cs,Cluster * c);
 | 
			
		||||
void CS_Set(ClusterSet * cs,Cluster * c);
 | 
			
		||||
void CS_Generer(ClusterSet * cs,Table_occurence * to);
 | 
			
		||||
void CS_Calculer_teintes(ClusterSet * cs,Table_occurence * to);
 | 
			
		||||
void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_occurence * to,Table_conversion * tc,struct Composantes * palette);
 | 
			
		||||
void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_conversion * tc,struct Composantes * palette);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										8
									
								
								pages.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								pages.c
									
									
									
									
									
								
							@ -511,7 +511,7 @@ void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courant
 | 
			
		||||
  (  (Liste_courante->Taille_liste==Liste_courante->Nb_pages_allouees)
 | 
			
		||||
    // ou qu'il ne reste plus assez de place pour allouer la Nouvelle_page
 | 
			
		||||
  || ( (Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)<
 | 
			
		||||
       (Nouvelle_page->Hauteur*Nouvelle_page->Largeur) )  );
 | 
			
		||||
       (unsigned long)(Nouvelle_page->Hauteur*Nouvelle_page->Largeur) )  );
 | 
			
		||||
 | 
			
		||||
  if (!Il_faut_liberer)
 | 
			
		||||
  {
 | 
			
		||||
@ -578,7 +578,7 @@ void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courant
 | 
			
		||||
 | 
			
		||||
        // On regarde s'il faut continuer à libérer de la place
 | 
			
		||||
        Il_faut_liberer=(Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)
 | 
			
		||||
                       <(Nouvelle_page->Hauteur*Nouvelle_page->Largeur);
 | 
			
		||||
                       <(unsigned long)(Nouvelle_page->Hauteur*Nouvelle_page->Largeur);
 | 
			
		||||
 | 
			
		||||
        // S'il ne faut pas, c'est qu'on peut allouer un bitmap
 | 
			
		||||
        // pour la Nouvelle_page
 | 
			
		||||
@ -990,7 +990,7 @@ void * Emprunter_memoire_de_page(int taille)
 | 
			
		||||
  {
 | 
			
		||||
    // On regarde s'il faut libérer des pages:
 | 
			
		||||
    Il_faut_liberer=
 | 
			
		||||
      (Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)<taille;
 | 
			
		||||
      (Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)<(unsigned long)taille;
 | 
			
		||||
 | 
			
		||||
    if (!Il_faut_liberer)
 | 
			
		||||
    {
 | 
			
		||||
@ -1039,7 +1039,7 @@ void * Emprunter_memoire_de_page(int taille)
 | 
			
		||||
 | 
			
		||||
        // On regarde s'il faut continuer à libérer de la place
 | 
			
		||||
        Il_faut_liberer=
 | 
			
		||||
          (Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)<taille;
 | 
			
		||||
          (Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)<(unsigned long)taille;
 | 
			
		||||
 | 
			
		||||
        // S'il ne faut pas, c'est qu'on peut allouer un bitmap
 | 
			
		||||
        // pour la Nouvelle_page
 | 
			
		||||
 | 
			
		||||
@ -85,7 +85,7 @@ int CaractereValide(int Caractere)
 | 
			
		||||
    return 0;
 | 
			
		||||
  
 | 
			
		||||
  int Position;
 | 
			
		||||
  for (Position=0; Position<sizeof(CaracteresInterdits); Position++)
 | 
			
		||||
  for (Position=0; Position<(long)sizeof(CaracteresInterdits); Position++)
 | 
			
		||||
    if (Caractere == CaracteresInterdits[Position])
 | 
			
		||||
      return 0;
 | 
			
		||||
  return 1;
 | 
			
		||||
 | 
			
		||||
@ -57,11 +57,6 @@ byte Lit_Pixel_SDL (word X,word Y)
 | 
			
		||||
        return *( Ecran + Y * Largeur_ecran + X );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Effacer_Tout_l_Ecran_SDL (byte Couleur)
 | 
			
		||||
{
 | 
			
		||||
        UNIMPLEMENTED
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Afficher_partie_de_l_ecran_SDL       (word Largeur,word Hauteur,word Largeur_image)
 | 
			
		||||
/* Afficher une partie de l'image telle quelle sur l'écran */
 | 
			
		||||
{
 | 
			
		||||
@ -429,7 +424,7 @@ void Display_brush_Mono_zoom_SDL (word Pos_X, word Pos_Y,
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Clear_brush_zoom_SDL        (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Pos_Y_Fin,byte Couleur_de_transparence,word Largeur_image,byte * Buffer)
 | 
			
		||||
void Clear_brush_zoom_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Pos_Y_Fin,__attribute__((unused)) byte Couleur_de_transparence,word Largeur_image,byte * Buffer)
 | 
			
		||||
{
 | 
			
		||||
        // En fait on va recopier l'image non zoomée dans la partie zoomée !
 | 
			
		||||
        byte* ESI = Principal_Ecran + Decalage_Y * Largeur_image + Decalage_X;
 | 
			
		||||
 | 
			
		||||
@ -27,7 +27,6 @@
 | 
			
		||||
 | 
			
		||||
  void Pixel_SDL                (word X,word Y,byte Couleur);
 | 
			
		||||
  byte Lit_Pixel_SDL            (word X,word Y);
 | 
			
		||||
  void Effacer_Tout_l_Ecran_SDL (byte Couleur);
 | 
			
		||||
  void Block_SDL                (word Debut_X,word Debut_Y,word Largeur,word Hauteur,byte Couleur);
 | 
			
		||||
  void Block_SDL_Fast           (word Debut_X,word Debut_Y,word Largeur,word Hauteur,byte Couleur);
 | 
			
		||||
  void Pixel_Preview_Normal_SDL (word X,word Y,byte Couleur);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user