Working on the filling routine (still broken)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@65 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
0843c8f742
commit
ae9a534ad8
28
divers.c
28
divers.c
@ -318,24 +318,8 @@ void Get_input(void)
|
|||||||
void Initialiser_chrono(dword Delai)
|
void Initialiser_chrono(dword Delai)
|
||||||
// Démarrer le chrono
|
// Démarrer le chrono
|
||||||
{
|
{
|
||||||
puts("Initialiser_chrono non implémenté!");
|
Chrono_delay = Delai;
|
||||||
/*
|
Chrono_cmp = SDL_GetTicks()/55;
|
||||||
push ebp
|
|
||||||
mov ebp,esp
|
|
||||||
|
|
||||||
arg Delai:dword
|
|
||||||
|
|
||||||
mov eax,Delai
|
|
||||||
mov Chrono_delay,eax
|
|
||||||
|
|
||||||
xor ah,ah
|
|
||||||
int 1Ah
|
|
||||||
mov word ptr[Chrono_cmp+0],dx
|
|
||||||
mov word ptr[Chrono_cmp+2],cx
|
|
||||||
|
|
||||||
mov esp,ebp
|
|
||||||
pop ebp
|
|
||||||
*/
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,7 +363,7 @@ word Detection_souris(void)
|
|||||||
|
|
||||||
byte Lit_pixel_dans_ecran_courant (word X,word Y)
|
byte Lit_pixel_dans_ecran_courant (word X,word Y)
|
||||||
{
|
{
|
||||||
return (*(Principal_Ecran+Y*Principal_Largeur_image+X));
|
return *(Principal_Ecran+Y*Principal_Largeur_image+X);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pixel_dans_ecran_courant (word X,word Y,byte Couleur)
|
void Pixel_dans_ecran_courant (word X,word Y,byte Couleur)
|
||||||
@ -512,14 +496,15 @@ void Remplacer_toutes_les_couleurs_dans_limites(byte * Table_de_remplacement)
|
|||||||
|
|
||||||
// On place dans CX le nombre de lignes à traiter
|
// On place dans CX le nombre de lignes à traiter
|
||||||
int Ligne;
|
int Ligne;
|
||||||
|
int Compteur;
|
||||||
|
|
||||||
// Pour chaque ligne :
|
// Pour chaque ligne :
|
||||||
for(Ligne = Limite_Haut;Ligne < Limite_Bas; Ligne++)
|
for(Ligne = Limite_Haut;Ligne < Limite_Bas; Ligne++)
|
||||||
{
|
{
|
||||||
int Compteur;
|
|
||||||
// Pour chaque pixel sur la ligne :
|
// Pour chaque pixel sur la ligne :
|
||||||
for (Compteur = Limite_Gauche;Compteur < Limite_Droite;Compteur ++);
|
for (Compteur = Limite_Gauche;Compteur < Limite_Droite;Compteur ++);
|
||||||
{
|
{
|
||||||
|
if(*edi!=0) DEBUG("c",*edi);
|
||||||
*edi = Table_de_remplacement[*edi];
|
*edi = Table_de_remplacement[*edi];
|
||||||
edi++;
|
edi++;
|
||||||
}
|
}
|
||||||
@ -528,6 +513,9 @@ void Remplacer_toutes_les_couleurs_dans_limites(byte * Table_de_remplacement)
|
|||||||
esi += Principal_Largeur_image;
|
esi += Principal_Largeur_image;
|
||||||
edi = esi;
|
edi = esi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEBUG("Ligne",Ligne);
|
||||||
|
DEBUG("Compteur",Compteur);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte inline Lit_pixel_dans_ecran_backup (word X,word Y)
|
byte inline Lit_pixel_dans_ecran_backup (word X,word Y)
|
||||||
|
|||||||
12
erreurs.h
Normal file
12
erreurs.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// Affcihenom fichier, n° ligne, nom fonction, une chaine et un entier.
|
||||||
|
#define DEBUG(y,z) printf("%s %d %s | %s : %d###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
|
||||||
|
|
||||||
|
// DEBUG en hexadécimal
|
||||||
|
#define DEBUGX(y,z) printf("%s %d %s | %s : %X###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
|
||||||
|
|
||||||
|
#define UNIMPLEMENTED printf("%s %d %s non implémenté !\n",__FILE__,__LINE__,__func__);
|
||||||
|
|
||||||
|
#define UNTESTED printf("%s %d %s à tester !\n",__FILE__,__LINE__,__func__);
|
||||||
|
|
||||||
|
void Erreur(int);
|
||||||
|
|
||||||
12
graph.c
12
graph.c
@ -3655,8 +3655,9 @@ void Fill(short * Limite_atteinte_Haut , short * Limite_atteinte_Bas,
|
|||||||
while (Debut_X<=Limite_Droite)
|
while (Debut_X<=Limite_Droite)
|
||||||
{
|
{
|
||||||
// On cherche son début
|
// On cherche son début
|
||||||
for (;(Debut_X<=Limite_Droite) &&
|
while((Debut_X<=Limite_Droite) &&
|
||||||
(Lit_pixel_dans_ecran_courant(Debut_X,Ligne)!=1);Debut_X++);
|
(Lit_pixel_dans_ecran_courant(Debut_X,Ligne)!=1))
|
||||||
|
Debut_X++;
|
||||||
|
|
||||||
if (Debut_X<=Limite_Droite)
|
if (Debut_X<=Limite_Droite)
|
||||||
{
|
{
|
||||||
@ -3840,6 +3841,7 @@ void Remplir(byte Couleur_de_remplissage)
|
|||||||
|
|
||||||
// On va maintenant "épurer" la zone visible de l'image:
|
// On va maintenant "épurer" la zone visible de l'image:
|
||||||
memset(Table_de_remplacement,0,256);
|
memset(Table_de_remplacement,0,256);
|
||||||
|
DEBUG("Num couleur",Lit_pixel_dans_ecran_courant(Pinceau_X,Pinceau_Y));
|
||||||
Table_de_remplacement[Lit_pixel_dans_ecran_courant(Pinceau_X,Pinceau_Y)]=1;
|
Table_de_remplacement[Lit_pixel_dans_ecran_courant(Pinceau_X,Pinceau_Y)]=1;
|
||||||
Remplacer_toutes_les_couleurs_dans_limites(Table_de_remplacement);
|
Remplacer_toutes_les_couleurs_dans_limites(Table_de_remplacement);
|
||||||
|
|
||||||
@ -3883,6 +3885,12 @@ void Remplir(byte Couleur_de_remplissage)
|
|||||||
Principal_Largeur_image,Principal_Ecran,
|
Principal_Largeur_image,Principal_Ecran,
|
||||||
Limite_atteinte_Droite+1,Limite_atteinte_Haut,Principal_Largeur_image);
|
Limite_atteinte_Droite+1,Limite_atteinte_Haut,Principal_Largeur_image);
|
||||||
|
|
||||||
|
DEBUG("Haut",Limite_atteinte_Haut);
|
||||||
|
DEBUG("Bas",Limite_atteinte_Bas);
|
||||||
|
|
||||||
|
DEBUG("Gauche",Limite_atteinte_Gauche);
|
||||||
|
DEBUG("Droite",Limite_atteinte_Droite);
|
||||||
|
|
||||||
for (Pos_Y=Limite_atteinte_Haut;Pos_Y<=Limite_atteinte_Bas;Pos_Y++)
|
for (Pos_Y=Limite_atteinte_Haut;Pos_Y<=Limite_atteinte_Bas;Pos_Y++)
|
||||||
for (Pos_X=Limite_atteinte_Gauche;Pos_X<=Limite_atteinte_Droite;Pos_X++)
|
for (Pos_X=Limite_atteinte_Gauche;Pos_X<=Limite_atteinte_Droite;Pos_X++)
|
||||||
if (Lit_pixel_dans_ecran_courant(Pos_X,Pos_Y)==2)
|
if (Lit_pixel_dans_ecran_courant(Pos_X,Pos_Y)==2)
|
||||||
|
|||||||
1
graph.h
1
graph.h
@ -146,7 +146,6 @@ void Detruire_les_listes_de_backups_en_fin_de_programme(void);
|
|||||||
void Nouveau_nombre_de_backups(int Nouveau);
|
void Nouveau_nombre_de_backups(int Nouveau);
|
||||||
int Backup_avec_nouvelles_dimensions(int Upload,int Largeur,int Hauteur);
|
int Backup_avec_nouvelles_dimensions(int Upload,int Largeur,int Hauteur);
|
||||||
int Backuper_et_redimensionner_brouillon(int Largeur,int Hauteur);
|
int Backuper_et_redimensionner_brouillon(int Largeur,int Hauteur);
|
||||||
void Backup(void);
|
|
||||||
void Undo(void);
|
void Undo(void);
|
||||||
void Redo(void);
|
void Redo(void);
|
||||||
void Detruire_la_page_courante(void);
|
void Detruire_la_page_courante(void);
|
||||||
|
|||||||
4
moteur.c
4
moteur.c
@ -269,8 +269,8 @@ void Tracer_cadre_de_bouton_du_menu(byte Numero,byte Enfonce)
|
|||||||
SDL_UpdateRect(Ecran_SDL,
|
SDL_UpdateRect(Ecran_SDL,
|
||||||
Debut_X*Menu_Facteur_X,
|
Debut_X*Menu_Facteur_X,
|
||||||
Debut_Y*Menu_Facteur_Y + Menu_Ordonnee,
|
Debut_Y*Menu_Facteur_Y + Menu_Ordonnee,
|
||||||
(Fin_X-Debut_X)*Menu_Facteur_X,
|
(Fin_X+1-Debut_X)*Menu_Facteur_X,
|
||||||
(Fin_Y-Debut_Y)*Menu_Facteur_Y);
|
(Fin_Y+1-Debut_Y)*Menu_Facteur_Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
#include "operatio.h"
|
#include "operatio.h"
|
||||||
#include "boutons.h"
|
#include "boutons.h"
|
||||||
|
#include "pages.h"
|
||||||
|
|
||||||
void Demarrer_pile_operation(word Operation_demandee)
|
void Demarrer_pile_operation(word Operation_demandee)
|
||||||
{
|
{
|
||||||
|
|||||||
13
pages.c
13
pages.c
@ -10,10 +10,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "pages.h"
|
#include "pages.h"
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
|
#include "erreurs.h"
|
||||||
// On déclare méchamment le prototype de Erreur pour éviter de faire un
|
|
||||||
// fichier "main.h":
|
|
||||||
void Erreur(int Code);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// GESTION DES PAGES
|
/// GESTION DES PAGES
|
||||||
@ -52,6 +49,7 @@ void Initialiser_S_Page(S_Page * Page)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Download_infos_page_principal(S_Page * Page)
|
void Download_infos_page_principal(S_Page * Page)
|
||||||
|
// Affiche la page à l'écran
|
||||||
{
|
{
|
||||||
//int Indice_facteur;
|
//int Indice_facteur;
|
||||||
int Dimensions_modifiees;
|
int Dimensions_modifiees;
|
||||||
@ -111,6 +109,7 @@ void Download_infos_page_principal(S_Page * Page)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Upload_infos_page_principal(S_Page * Page)
|
void Upload_infos_page_principal(S_Page * Page)
|
||||||
|
// Sauve l'écran courant dans la page
|
||||||
{
|
{
|
||||||
if (Page!=NULL)
|
if (Page!=NULL)
|
||||||
{
|
{
|
||||||
@ -805,10 +804,12 @@ int Backuper_et_redimensionner_brouillon(int Largeur,int Hauteur)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Backup(void)
|
void Backup(void)
|
||||||
|
// Sauve la page courante comme première page de backup et crée une nouvelle page
|
||||||
|
// pur continuer à dessiner. Utilisé par exemple pour le fill
|
||||||
{
|
{
|
||||||
S_Page * Nouvelle_page;
|
S_Page * Nouvelle_page;
|
||||||
|
|
||||||
// On remet à jour l'‚tat des infos de la page courante (pour pouvoir les
|
// On remet à jour l'état des infos de la page courante (pour pouvoir les
|
||||||
// retrouver plus tard)
|
// retrouver plus tard)
|
||||||
Upload_infos_page_principal(Principal_Backups->Pages);
|
Upload_infos_page_principal(Principal_Backups->Pages);
|
||||||
|
|
||||||
@ -823,7 +824,7 @@ void Backup(void)
|
|||||||
Download_infos_backup(Principal_Backups);
|
Download_infos_backup(Principal_Backups);
|
||||||
|
|
||||||
// On copie l'image du backup vers la page courante:
|
// On copie l'image du backup vers la page courante:
|
||||||
memcpy(Principal_Ecran,Ecran_backup,Principal_Largeur_image*Principal_Hauteur_image);
|
memcpy(Ecran_backup,Principal_Ecran,Principal_Largeur_image*Principal_Hauteur_image);
|
||||||
|
|
||||||
// On détruit le descripteur de la page courante
|
// On détruit le descripteur de la page courante
|
||||||
free(Nouvelle_page);
|
free(Nouvelle_page);
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
#include "moteur.h"
|
#include "moteur.h"
|
||||||
#include "readline.h"
|
#include "readline.h"
|
||||||
#include "boutons.h"
|
#include "boutons.h"
|
||||||
|
#include "pages.h"
|
||||||
|
|
||||||
// --------------------------- Menu des palettes -----------------------------
|
// --------------------------- Menu des palettes -----------------------------
|
||||||
char * Libelle_reduction_palette[7]=
|
char * Libelle_reduction_palette[7]=
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user